Project

General

Profile

Feature #8217

if-elseif-else construct

Added by Nicola Chiapolini over 1 year ago. Updated 2 months ago.

Status:
Priorize
Priority:
Normal
Assignee:
Target version:
Start date:
16.04.2019
Due date:
% Done:

0%

Estimated time:
Discuss:

Description

Prio2 für Nicola

Da if-elseif-else situationen ziemlich häuffig vorkommen, wäre es schön, wenn QFQ das direkt anbieten würde und wir nicht jeweils ein Pseudo-Query schreiben müssten.
(Intern könnte das aber natürlich problemlos über ein Pseudo-Query gelöst werden).

Mein Vorschlag für die Syntax wäre:

10.if = "{{feUser:TE:alnumx:s}}"="nchiapol" 
10 {
1.sql = SELECT shortname, mail FROM persons_ldap
[...]
}
11.elseif = "{{feUser:TE:alnumx:s}}"="crose"
[...]
12.else
[...]

sollte identisch sein mit

10.sql = SELECT 1 AS _ FROM (SELECT "") AS fake WHERE ("{{feUser:TE:alnumx:s}}"="nchiapol") LIMIT 1
10.1.sql = SELECT shortname FROM persons_ldap
[...]
11.sql = SELECT 1 AS _ FROM (SELECT "") AS fake WHERE NOT ("{{feUser:TE:alnumx:s}}"="nchiapol") AND ("{{feUser:TE:alnumx:s}}"="crose") LIMIT 1
[...]
12.sql = SELECT 1 AS _ FROM (SELECT "") AS fake WHERE NOT ("{{feUser:TE:alnumx:s}}"="nchiapol") OR ("{{feUser:TE:alnumx:s}}"="crose") LIMIT 1
[...]

Falls für if-elseif-else statt 10-11-12 drei mal 10 verwendet werden kann, wäre das natürlich noch eleganter. Aber ich glaube schon diese Lösung wäre ein grosser Fortschritt.

Vorteile: * viel intuitivere Syntax * leichter lesbar * falls später Probleme entdeckt werden, können diese Zentral behoben werden.

Use Cases von Nicola:  use-cases_conditions-functions.txt


Related issues

Related to QFQ - Feature #10716: Business Logic mit Externen SkriptenPriorize2020-06-04

History

#1 Updated by Carsten Rose over 1 year ago

  • Target version set to 146

#2 Updated by Carsten Rose about 1 year ago

  • Tracker changed from Support to Feature
  • Target version changed from 146 to 141

#3 Updated by Carsten Rose 8 months ago

  • Status changed from New to Some day maybe

#4 Updated by Carsten Rose 8 months ago

  • Status changed from Some day maybe to New

#5 Updated by Carsten Rose 6 months ago

  • Target version changed from 141 to next3

#7 Updated by Marc Egger 2 months ago

  • Description updated (diff)

#8 Updated by Marc Egger 2 months ago

  • Description updated (diff)

#9 Updated by Marc Egger 2 months ago

  • Status changed from New to Priorize

#10 Updated by Marc Egger 2 months ago

  • Related to Feature #10716: Business Logic mit Externen Skripten added

Also available in: Atom PDF