The Calendar plugin in Presto

Presto extends the standard lino_xl.lib.cal plugin lino_presto.lib.cal.

This document is part of the Lino test suite and has been tested using doctest. You can re-play the instructions on this page in the demo project, either interactively in a Django shell session or by writing a script and run it using run. Read also the general documentation about Doctests in Lino. The following instructions are used for initialization:

>>> from lino import startup
>>> startup('lino_presto.projects.noereth.settings.doctests')
>>> from lino.api.doctest import *

Workflow

>>> rt.show(cal.EntryStates)
====== ============ =============== ============= ================= ======== =================== =========
 Wert   name         Text            Button text   Gäste ausfüllen   Stabil   nicht blockierend   No auto
------ ------------ --------------- ------------- ----------------- -------- ------------------- ---------
 10     suggested    Vorschlag       ?             Ja                Nein     Nein                Nein
 20     draft        Geplant         ☐             Ja                Nein     Nein                Nein
 50     took_place   Stattgefunden   ☑             Nein              Ja       Nein                Nein
 60     missed       Missed          ☉             Nein              Ja       Nein                Ja
 70     cancelled    Abgesagt        ⚕             Nein              Ja       Ja                  Ja
====== ============ =============== ============= ================= ======== =================== =========
>>> rt.show(cal.GuestStates)
====== ========= ============== =================== =============
 Wert   name      Nachträglich   Text                Button text
------ --------- -------------- ------------------- -------------
 20     invited   Ja             Planned             ☑
 50     needs     Ja             Needs replacement   ⚕
 60     found     Nein           Found replacement   ☉
====== ========= ============== =================== =============

Replacement planning

A worker announces that they need replacement for a deployment in the future. You find the calendar entry, and in the GuestsByEntry slave table, Workflow column, change the presence state from “planned” to “needs replacement”

At any moment you can see the GuestsNeedingReplacement table, which shows all presences needing replacement.

>>> rt.login("robin").show(cal.GuestsNeedingReplacement)
============ ============ ============ =================================================================== ====================================================== ===========
 Beginnt am   Beginnt um   Arbeiter     Kalendereintrag                                                     Workflow                                               Bemerkung
------------ ------------ ------------ ------------------------------------------------------------------- ------------------------------------------------------ -----------
 11.05.17     08:00:00     Herr Garry   `? Heimpflege 2/2017 Einsatz 18 für DENON Denis (179) <Detail>`__   **⚕ Needs replacement** → [Find replacement] [☑] [☉]
 26.08.17     08:00:00     Herr Garry   `? Heimpflege 2/2017 Einsatz 33 für DENON Denis (179) <Detail>`__   **⚕ Needs replacement** → [Find replacement] [☑] [☉]
 10.12.17     08:00:00     Herr Garry   `? Heimpflege 2/2017 Einsatz 48 für DENON Denis (179) <Detail>`__   **⚕ Needs replacement** → [Find replacement] [☑] [☉]
============ ============ ============ =================================================================== ====================================================== ===========

When this table is not empty, it causes a welcome message “You have 3 items in Needing replacement”.

In the workflow column you can click on “Find replacement” to specify another worker who is going to replace the originally planned worker.

Teams

A team is a group of workers responsible for a given activity.

The team of an order is defined by its journal. You can have a same team for different journals, but you cannot have several teams for one journal.

Lino Presto injects a field lino_xl.lib.ledger.Journal.room.

class Room
event_type
guest_role
invoicing_area
>>> print(rt.models.cal.Room._meta.verbose_name)
Team
>>> rt.show(cal.Rooms, language="en")
================ ================== ================== =====================
 Designation      Designation (fr)   Designation (en)   Calendar entry type
---------------- ------------------ ------------------ ---------------------
 Garten           Garten             Garden             Outside work
 Umzüge           Umzüge             Moves              Outside work
 Renovierung      Renovierung        Renovation         Inside work
 Haushaltshilfe   Haushaltshilfe     Home help          Inside work
 Heimpflege       Heimpflege         Home care          Inside work
 Büro             Bureau             Office             Office work
================ ================== ================== =====================