Project

General

Profile

Feature #8217 ยป use-cases_conditions-functions.txt

Marc Egger, 04.06.2020 19:14

 
1
Use Cases "Conditions and Functions"
2
====================================
3

    
4
Mail Function
5
-------------
6
In many situations we need to send an email to the head of a committee plus all his deputies. For now it is rather complicated to collect all the needed info (name, title, mail for head; mail for all deputies, name of student)
7
Ideally we could use the same code for each such mail and would only need to pass the id of the student and the subject and body of the message.
8

    
9
-> functions
10

    
11
Graduation Ceremony
12
-------------------
13
Students should be able to register with a given Link until a specific deadline. 
14
- Before the deadline, a from should be displayed. 
15
- After the deadline, a warning should be displayed. 
16

    
17
-> if-then-else
18
-> include content elements
19
(A nice option would also be to redirect to a different page on the server side)
20

    
21
Note: This can be solved via a "beforeLoad"-Action element and the formModeGlobal parameter. 
22
A real "if-then-else" is only needed when the content is not in a form but in a report (and Typo3's time limited access can not be used, e.g. because the until-date depends on the record)
23

    
24

    
25
Status Table
26
------------
27
We want to display the exact same status table on different pages. The status table needs the id of the student, however the variable storing the id on a given page might be {{id:R}} or {{r:S}} or {{feUser:T}}.
28

    
29
-> functions
30

    
31
Note: The display part, can be solved with twig template files. The combination of Query + Display can be stored in a separate tt_content-Record but there is no robust solution to ensure the right variable.
32

    
33

    
34
Possible Solutions
35
==================
36
We need a way to include a "code-blocks/functions" and pass variables to it 
37
 - maybe a new Function-Argument-store and a way to include content elements?)
38

    
39

    
40
Needed Constructs
41
=================
42
- if-then-else: see https://project.math.uzh.ch/issues/8217
43
- functions
44
- for-loops: 2/3 ok with existing solutions
45
  - 10.1.sql
46
  - SELECT seq FROM seq_1_to_9;
47
  - twig loops
48

    
49
  
50
Other Ideas
51
===========
52

    
53
Server-Side Redirect
54
--------------------
55
  - useful in if-then-else
56
  - redirect if a user is not allowed to access something
57
  - redirect user after action pages have been processed
58
  - split complex task into several pages and then chain them server side
59
  
60
Stop-Rendering
61
--------------
62
  - avoid else parts
    (1-1/1)