Integration Service

This document describes the lino_welfare.modlib.integ plugin. See also Automatic calendar events.

Table of contents:

This page is a tested document and the following instructions are used for initialization:

>>> import lino
>>> lino.startup('lino_welfare.projects.mathieu.settings.demo')
>>> from lino.api.doctest import *
>>> ses = rt.login('robin')
>>> translation.activate('en')
>>> ses.get_user().user_type.hidden_languages = None

Note that we set lino.modlib.users.UserType.hidden_languages to None because in this document we want to see the other languages as well.

Configuration

>>> ses.show(isip.ContractEndings)
... 
=============== ====== =============== ========= ====================
 Designation     ISIP   Job supplying   Success   Require date ended
--------------- ------ --------------- --------- --------------------
 Alcohol         Yes    Yes             No        Yes
 Force majeure   Yes    Yes             No        Yes
 Normal          Yes    Yes             No        No
 Santé           Yes    Yes             No        Yes
=============== ====== =============== ========= ====================

Note that designations are in French because that’s the main language and because lino_welfare.modlib.isip.ContractEnding.name is not a babel field.

>>> print(settings.SITE.get_default_language())
fr
>>> ses.show(jobs.Schedules)
... 
==== ========================= ================== =========================== ===========================
 ID   Designation               Designation (nl)   Designation (de)            Designation (en)
---- ------------------------- ------------------ --------------------------- ---------------------------
 1    5 jours/semaine                              5-Tage-Woche                5 days/week
 2    individuel                                   Individuell                 Individual
 3    lundi,mercredi,vendredi                      Montag, Mittwoch, Freitag   Monday, Wednesday, Friday
==== ========================= ================== =========================== ===========================
>>> ses.show(jobs.ContractTypes)
... 
=========================== ================== =========================== ============================ ===========
 Designation                 Designation (nl)   Designation (de)            Designation (en)             Reference
--------------------------- ------------------ --------------------------- ---------------------------- -----------
 avec remboursement                             mit Rückerstattung          social economy with refund   art60-7c
 avec remboursement école                       mit Rückerstattung Schule   social economy school        art60-7d
 ville d'Eupen                                  Stadt Eupen                 town                         art60-7e
 économie sociale                               Sozialökonomie              social economy               art60-7a
 économie sociale - majoré                      Sozialökonomie - majoré     social economy - increased   art60-7b
=========================== ================== =========================== ============================ ===========
>>> ses.show(art61.ContractTypes)
... 
======================== ======================== =================== ====================== ===========
 Designation              Designation (nl)         Designation (de)    Designation (en)       Reference
------------------------ ------------------------ ------------------- ---------------------- -----------
 Mise à l'emploi art.61   Mise à l'emploi art.61   Art.61-Konvention   Art61 job supplyment
======================== ======================== =================== ====================== ===========
>>> ses.show(immersion.ContractTypes)
... 
=========================== =========================== =========================== ===================== ==================== ================
 Designation                 Designation (nl)            Designation (de)            Designation (en)      Examination Policy   Template
--------------------------- --------------------------- --------------------------- --------------------- -------------------- ----------------
 MISIP                       MISIP                       MISIP                       MISIP                                      Default.odt
 Mise en situation interne   Mise en situation interne   Mise en situation interne   Internal engagement                        Default.odt
 Stage d'immersion           Stage d'immersion           Stage d'immersion           Immersion training                         StageForem.odt
=========================== =========================== =========================== ===================== ==================== ================
>>> ses.show(jobs.JobTypes)
... 
==== ===== ================================================ ======== ================
 ID   No.   Designation                                      Remark   Social economy
---- ----- ------------------------------------------------ -------- ----------------
 4    4     Extern (Privat Kostenrückerstattung)                      No
 3    3     Extern (Öffentl. VoE mit Kostenrückerstattung)            No
 2    2     Intern                                                    No
 5    5     Sonstige                                                  No
 1    1     Sozialwirtschaft = "majorés"                              No
==== ===== ================================================ ======== ================

UsersWithClients

>>> ses.show(integ.UsersWithClients)
... 
==================== ============ =========== ======== ========= ========= ================= ================ ========
 Coach                Évaluation   Formation   Search   Travail   Standby   Primary clients   Active clients   Total
-------------------- ------------ ----------- -------- --------- --------- ----------------- ---------------- --------
 Alicia Allmanns      **1**                             **1**     **1**     **3**             **3**            **7**
 Hubert Huppertz      **4**        **4**       **6**                        **14**            **14**           **17**
 Mélanie Mélard       **1**        **2**       **2**    **3**     **2**     **10**            **10**           **19**
 **Total (3 rows)**   **6**        **6**       **8**    **4**     **3**     **27**            **27**           **43**
==================== ============ =========== ======== ========= ========= ================= ================ ========

Note that the numbers in this table depend on lino_welfare.modlib.integ.Plugin.only_primary whose default value is False.

>>> dd.plugins.integ.only_primary
True

Activity report

>>> translation.activate('en')
>>> ses.show(integ.ActivityReport, stripped=True)
... 
------------
Introduction
------------

Ceci est un **rapport**,
càd un document complet généré par Lino, contenant des
sections, des tables et du texte libre.
Dans la version écran cliquer sur un chiffre pour voir d'où
il vient.


------------------------
Users with their Clients
------------------------

==================== ============ =========== ======== ========= ========= ================= ================ ========
 Coach                Évaluation   Formation   Search   Travail   Standby   Primary clients   Active clients   Total
-------------------- ------------ ----------- -------- --------- --------- ----------------- ---------------- --------
 Alicia Allmanns      **1**                             **1**     **1**     **3**             **3**            **7**
 Hubert Huppertz      **4**        **4**       **6**                        **14**            **14**           **17**
 Mélanie Mélard       **1**        **2**       **2**    **3**     **2**     **10**            **10**           **19**
 **Total (3 rows)**   **6**        **6**       **8**    **4**     **3**     **27**            **27**           **43**
==================== ============ =========== ======== ========= ========= ================= ================ ========

--------------------
Indicateurs généraux
--------------------

No data to display
.

No data to display
--------------------------------
Causes d'arrêt des interventions
--------------------------------

============================ ======== ======== ========= ========= ======== ====== ======= =======
 Description                  alicia   hubert   melanie   patrick   romain   rolf   robin   Total
---------------------------- -------- -------- --------- --------- -------- ------ ------- -------
 Transfer to colleague
 End of right on social aid
 Moved to another town
 Found a job
============================ ======== ======== ========= ========= ======== ====== ======= =======

=====
ISIPs
=====

----------------------
PIIS par agent et type
----------------------

================== ================ ================== =========== ===================== ================ =======
 Description        VSE Ausbildung   VSE Arbeitssuche   VSE Lehre   VSE Vollzeitstudium   VSE Sprachkurs   Total
------------------ ---------------- ------------------ ----------- --------------------- ---------------- -------
 Alicia Allmanns
 Caroline Carnol
 Hubert Huppertz
 Judith Jousten
 Kerstin Kerres
 Mélanie Mélard
 nicolas
 Patrick Paraneau
 Robin Rood
 Rolf Rompen
 Romain Raffault
 Theresia Thelen
================== ================ ================== =========== ===================== ================ =======

----------------------------------
Organisations externes et contrats
----------------------------------

===================== ================ ================== =========== ===================== ================ =======
 Organization          VSE Ausbildung   VSE Arbeitssuche   VSE Lehre   VSE Vollzeitstudium   VSE Sprachkurs   Total
--------------------- ---------------- ------------------ ----------- --------------------- ---------------- -------
 Bäckerei Ausdemwald
 Bäckerei Mießen
 Bäckerei Schmitz
 Rumma & Ko OÜ
===================== ================ ================== =========== ===================== ================ =======

------------------------
Contract endings by type
------------------------

=============== ================ ================== =========== ===================== ================ =======
 Description     VSE Ausbildung   VSE Arbeitssuche   VSE Lehre   VSE Vollzeitstudium   VSE Sprachkurs   Total
--------------- ---------------- ------------------ ----------- --------------------- ---------------- -------
 Alcohol
 Force majeure
 Normal
 Santé
=============== ================ ================== =========== ===================== ================ =======

--------------------------
PIIS et types de formation
--------------------------

================= ================ ===================== =======
 Education Type    VSE Ausbildung   VSE Vollzeitstudium   Total
----------------- ---------------- --------------------- -------
 Alpha
 Apprenticeship
 Remote study
 Part-time study
 Training
 Prequalifying
 Qualifying
 University
 School
 Special school
 Highschool
================= ================ ===================== =======

=======================
Art60§7 job supplyments
=======================

-------------------------
Art60§7 par agent et type
-------------------------

================== ==================== ========================== =============== ================== =========================== =======
 Description        avec remboursement   avec remboursement école   ville d'Eupen   économie sociale   économie sociale - majoré   Total
------------------ -------------------- -------------------------- --------------- ------------------ --------------------------- -------
 Alicia Allmanns
 Caroline Carnol
 Hubert Huppertz
 Judith Jousten
 Kerstin Kerres
 Mélanie Mélard
 nicolas
 Patrick Paraneau
 Robin Rood
 Rolf Rompen
 Romain Raffault
 Theresia Thelen
================== ==================== ========================== =============== ================== =========================== =======

--------------------------
Job providers and contrats
--------------------------

================================ ==================== ========================== =============== ================== =========================== =======
 Organization                     avec remboursement   avec remboursement école   ville d'Eupen   économie sociale   économie sociale - majoré   Total
-------------------------------- -------------------- -------------------------- --------------- ------------------ --------------------------- -------
 BISA
 R-Cycle Sperrgutsortierzentrum
 Pro Aktiv V.o.G.
================================ ==================== ========================== =============== ================== =========================== =======

------------------------
Contract endings by type
------------------------

=============== ==================== ========================== =============== ================== =========================== =======
 Description     avec remboursement   avec remboursement école   ville d'Eupen   économie sociale   économie sociale - majoré   Total
--------------- -------------------- -------------------------- --------------- ------------------ --------------------------- -------
 Alcohol
 Force majeure
 Normal
 Santé
=============== ==================== ========================== =============== ================== =========================== =======

Printing UsersWithClients to pdf

User problem report:

pdf-Dokument aus Startseite erstellen:
kommt leider nur ein leeres Dok-pdf bei raus auf den 30/09/2011 datiert

The following lines reproduced this problem and passed when it was fixed:

>>> settings.SITE.appy_params.update(raiseOnError=True)
>>> url = 'http://127.0.0.1:8000/api/integ/UsersWithClients?an=as_pdf'
>>> test_client.force_login(rt.login('rolf').user)
>>> res = test_client.get(url, REMOTE_USER='rolf')  
>>> print(res.status_code)  
200
>>> result = json.loads(res.content.decode())  
>>> print(result['open_url']) 
/media/cache/appypdf/127.0.0.1/integ.UsersWithClients.pdf
>>> print(result['success']) 
True

The following reproduces a bug we discovered on 20180921. It was not possible to sort reverse on a column with a virtual field.

>>> # url = "/api/integ/Clients?_dc=1537533953315&start=0&limit=33&fmt=json&rp=ext-comp-1251"
>>> url += "&pv=30&pv=200125&pv=&pv=21.09.2018&pv=21.09.2018&pv=&pv=&pv=&pv=&pv=&pv=false&pv=&pv=&pv=1&pv=false&pv=false&sort=applies_until&dir=DESC"
>>> url = "/api/integ/Clients?_dc=1541013238935&start=0&limit=12&fmt=json&rp=ext-comp-1497&pv=30&pv=6&pv=&pv=&pv=&pv=&pv=&pv=&pv=&pv=&pv=false&pv=&pv=&pv=false&pv=false&sort=applies_until&dir=DESC"
>>> res = test_client.get(url, REMOTE_USER='rolf')  
>>> print(res.status_code)  
200

Don’t read me

Verify that #2784 is fixed:

>>> for ba in integ.ActivityReport.get_actions():
...     if ba.action.is_window_action():
...         ba
<BoundAction(integ.ActivityReport, <lino.core.actions.ShowEmptyTable show ('D\xe9tail')>)>

Part of #4436:

>>> show_choices('romain', '/choices/courses/Activities/teacher')
<br/>
Mélanie Mélard
Patrick Paraneau
Romain Raffault
Rolf Rompen
Robin Rood
>>> show_choices('romain', '/choices/isip/Contracts/user')
<br/>
Alicia Allmanns
Hubert Huppertz
Mélanie Mélard
Patrick Paraneau
Romain Raffault
Rolf Rompen
Robin Rood
>>> show_choices('romain', '/choices/isip/Contracts/user_asd')
<br/>
Alicia Allmanns
Caroline Carnol
Hubert Huppertz
Judith Jousten
Kerstin Kerres
Mélanie Mélard
Patrick Paraneau
Romain Raffault
Rolf Rompen
Robin Rood
>>> show_choices('romain', '/choices/art60/Contracts/user')
<br/>
Alicia Allmanns
Hubert Huppertz
Mélanie Mélard
Patrick Paraneau
Romain Raffault
Rolf Rompen
Robin Rood
>>> show_choices('romain', '/choices/art60/Contracts/user_asd')
<br/>
Alicia Allmanns
Caroline Carnol
Hubert Huppertz
Judith Jousten
Kerstin Kerres
Mélanie Mélard
Patrick Paraneau
Romain Raffault
Rolf Rompen
Robin Rood