]> gitweb.hamatoma.de Git - webcal.git/commitdiff
WBC2020.07.23.00: Spalte "Fahrdienst", Farbanpassung, akt. Skeleton master
authorWinfried Kappeler <winfried.kappeler@infeos.eu>
Thu, 23 Jul 2020 18:21:53 +0000 (20:21 +0200)
committerWinfried Kappeler <winfried.kappeler@infeos.eu>
Thu, 23 Jul 2020 18:21:53 +0000 (20:21 +0200)
* local.css:
** Farbe Tabellenzeile:hover

* Locals:
* frame: mit green.css und gray.css
* addmember(), subMember() und membersOfTerm(): + Param $type
* neu: $_frameSnippets, frameSnippets() und localFrame()

* Terms:
** neues Feld: userterms.userterm_type
** neu: Filter "Start" in Seite base
** Seite Edit: neu: "Fahrdienst" mit buttonAddFahrdienst und
   buttonSubFahrdienst

25 files changed:
app/locals/build/common/locals.frame.snippets.html
app/locals/locals.model.php
app/locals/locals.view.php
app/locals/sql/locals.snippets.sql
app/terms/build/base/terms.base.config.php
app/terms/build/base/terms.base.snippets.html
app/terms/build/common/terms.common.config.php [deleted file]
app/terms/build/common/terms.common.snippets.html [deleted file]
app/terms/build/delete/terms.delete.config.php
app/terms/build/delete/terms.delete.snippets.html
app/terms/build/edit/terms.edit.config.php
app/terms/build/edit/terms.edit.snippets.html
app/terms/build/new/terms.new.config.php
app/terms/build/new/terms.new.snippets.html
app/terms/sql/terms.snippets.sql
app/terms/sql/terms.sql
app/terms/terms.model.php
app/terms/terms.view.php
config/changes/version.php
public/css/page/common/blue.css [new symlink]
public/css/page/common/gray.css [new file with mode: 0644]
public/css/page/common/green.css [new symlink]
public/css/page/common/local.css
tools/generator/terms.module
tools/generator/terms.snippets.php

index 293fe1250f48a5765798c27f8ac4d46a544bceed..f3c59b5559fe97faf13cf472b5a5b9c9eb3d24b2 100644 (file)
@@ -11,6 +11,8 @@ SNIPPET_ROOT:
     <link href="###PUBLIC_PREFIX###/public/css/vendor/bootstrap.min-4.4.1.css" rel="stylesheet">
     <link href="###PUBLIC_PREFIX###/public/css/page/common/jquery.datetimepicker.css" rel="stylesheet">
     <link href="###PUBLIC_PREFIX###/public/css/page/common/global.css" rel="stylesheet">
     <link href="###PUBLIC_PREFIX###/public/css/vendor/bootstrap.min-4.4.1.css" rel="stylesheet">
     <link href="###PUBLIC_PREFIX###/public/css/page/common/jquery.datetimepicker.css" rel="stylesheet">
     <link href="###PUBLIC_PREFIX###/public/css/page/common/global.css" rel="stylesheet">
+    <link href="###PUBLIC_PREFIX###/public/css/page/common/gray.css" rel="stylesheet">
+    <link href="###PUBLIC_PREFIX###/public/css/page/common/green.css" rel="stylesheet">
     <link href="###PUBLIC_PREFIX###/public/css/page/common/local.css" rel="stylesheet">
 
     <!-- Custom styles for this template -->
     <link href="###PUBLIC_PREFIX###/public/css/page/common/local.css" rel="stylesheet">
 
     <!-- Custom styles for this template -->
index 571bb2b14817c79149ff6fdacf71396aa3c53776..0d12c516dd038d22f119c417e982ebe36a20596a 100644 (file)
@@ -27,12 +27,13 @@ trait Model
      * @param int $term
      *            the related term
      */
      * @param int $term
      *            the related term
      */
-    public function addMember(int $member, int $term)
+    public function addMember(int $member, int $term, string $type)
     {
         $sql = $this->_sqlSnippetsModel->getSnippet('SQL_INSERT_USERTERM');
         $this->_db->prepareAndExecute($sql, [
             ':member' => $member,
             ':term' => $term,
     {
         $sql = $this->_sqlSnippetsModel->getSnippet('SQL_INSERT_USERTERM');
         $this->_db->prepareAndExecute($sql, [
             ':member' => $member,
             ':term' => $term,
+            ':type' => $type,
             ':user' => $_SESSION['shortname']
         ]);
     }
             ':user' => $_SESSION['shortname']
         ]);
     }
@@ -45,12 +46,13 @@ trait Model
      * @param int $term
      *            the related term
      */
      * @param int $term
      *            the related term
      */
-    public function subMember(int $member, int $term)
+    public function subMember(int $member, int $term, string $type)
     {
         $sql = $this->_sqlSnippetsModel->getSnippet('SQL_DELETE_USERTERM');
         $this->_db->prepareAndExecute($sql, [
             ':member' => $member,
     {
         $sql = $this->_sqlSnippetsModel->getSnippet('SQL_DELETE_USERTERM');
         $this->_db->prepareAndExecute($sql, [
             ':member' => $member,
-            ':term' => $term
+            ':term' => $term,
+            ':type' => $type
         ]);
     }
 
         ]);
     }
 
@@ -61,11 +63,12 @@ trait Model
      *            the members related to this term will be assembled
      * @return string the display names of the members, delimited by ' '
      */
      *            the members related to this term will be assembled
      * @return string the display names of the members, delimited by ' '
      */
-    public function membersOfTerm(int $term): string
+    public function membersOfTerm(int $term, string $type): string
     {
         $sql = $this->_sqlSnippetsModel->getSnippet('SQL_USERTERM_BY_TERM');
         $recs = $this->_db->readall($sql, [
     {
         $sql = $this->_sqlSnippetsModel->getSnippet('SQL_USERTERM_BY_TERM');
         $recs = $this->_db->readall($sql, [
-            ':term' => $term
+            ':term' => $term,
+            ':type' => $type
         ], false);
         $rc = '';
         foreach ($recs as &$rec) {
         ], false);
         $rc = '';
         foreach ($recs as &$rec) {
index ff757d9e7fd9ab35790d4143c422d6f7d4272fc4..4cd3d71d9210e9624d3a3abbbcbd5df637a45335 100644 (file)
@@ -18,6 +18,8 @@ trait View
         ]
     ];
 
         ]
     ];
 
+    private $_frameSnippets;
+
     /**
      * Adapts the full page in a application depending way.
      *
     /**
      * Adapts the full page in a application depending way.
      *
@@ -29,4 +31,46 @@ trait View
         // do nothing
     }
 
         // do nothing
     }
 
+    /**
+     * Returns null or the local frame snippets.
+     *
+     * @param string $module
+     *            the calling module: the result can depend on this
+     * @param string $page
+     *            the calling page: the result can depend on this
+     * @return LN\Snippets|NULL null: no local frame is available otherwise: the local frame snippets
+     */
+    public function frameSnippets(?string $module = null, ?string $page = null): ?LN\Snippets
+    {
+        if ($this->_frameSnippets == null) {
+            $name = ROOT . 'app/locals/build/common/locals.frame.snippets.html';
+            if (\file_exists($name)) {
+                $this->_frameSnippets = new LN\Snippets();
+                $this->_frameSnippets->readSnippets($name);
+            }
+        }
+        return $this->_frameSnippets;
+    }
+
+    /**
+     * Returns null or the local frame snippets.
+     *
+     * @param string $module
+     *            the calling module: the result can depend on this
+     * @param string $page
+     *            the calling page: the result can depend on this
+     * @param array $macros
+     *            the page specific placeholder map
+     * @return string the local frame
+     */
+    public function localFrame(string $module, ?string $page, ?array &$macros)
+    {
+        $common = TC\Controller::getInstance();
+        $snippets = $this->frameSnippets($module, $page);
+        $frame = $snippets->getSnippet('SNIPPET_ROOT', $macros);
+        $config = $this->simpleConfiguration($module, $page);
+        LN\StringUtils::replaceMacros($frame, $config, true);
+        $common->replaceCommonMacros($frame);
+        return $frame;
+    }
 }
 }
index 6ff8c6d64c825efc7151fefe50f0f4ffba754545..b4506b6f8baadf5fda5d25d628b16c4acd726843 100644 (file)
@@ -1,15 +1,15 @@
 SQL_INSERT_USERTERM:
 insert into userterms
 SQL_INSERT_USERTERM:
 insert into userterms
-  (userterm_user, userterm_term, created, createdby) 
+  (userterm_user, userterm_term, userterm_type, created, createdby) 
 values 
 values 
-  (:member, :term, now(), :user)
+  (:member, :term, :type, now(), :user)
 ;
 
 SQL_DELETE_USERTERM:
 delete
   from userterms
 where 
 ;
 
 SQL_DELETE_USERTERM:
 delete
   from userterms
 where 
-  userterm_term=:term and userterm_user=:member
+  userterm_term=:term and userterm_user=:member and userterm_type=:type
 ;
 
 SQL_USERTERM_BY_TERM:
 ;
 
 SQL_USERTERM_BY_TERM:
@@ -20,6 +20,7 @@ from
   left join loginusers u on u.user_id=tt.userterm_user
 where
   userterm_term=:term
   left join loginusers u on u.user_id=tt.userterm_user
 where
   userterm_term=:term
+  AND userterm_type=:type
 order by user_displayname
 ;
 
 order by user_displayname
 ;
 
index c0906e4c74978e9db4b5434fdfc8683aae54f08a..611f8340b48b95fe8fb7a366a657fad0d5c8df10 100644 (file)
@@ -1,13 +1,13 @@
 <?php
 use \app\common as TC;
 
 <?php
 use \app\common as TC;
 
-$include = "common/terms.common.config.php";
-
 $configArray = array(
     'local_js' => '',
     'local_css' => '',
     'local_pageType' => 'base',
 $configArray = array(
     'local_js' => '',
     'local_css' => '',
     'local_pageType' => 'base',
+    'data' => 'Daten',
     'local_title' => 'Termine',
     'local_title' => 'Termine',
+    'parent_title' => 'Termine',
     'hasFilter' => TC\Controller::getInstance()->configurationAsBool('terms', 'filter:switch'),
 
         // PHP_HOOK_CONFIG_BASE
     'hasFilter' => TC\Controller::getInstance()->configurationAsBool('terms', 'filter:switch'),
 
         // PHP_HOOK_CONFIG_BASE
index 3f3f14a30b824d0710556d83d86a850e376d2e29..9fcc8dbdc4fc2f8586e44a533638c53dcfe14ae0 100644 (file)
@@ -5,11 +5,22 @@ SNIPPET_ROOT:
 <button type="submit" id="buttonRedirectJS" hidden="hidden" name="buttonRedirectJS">Clicked by JS</button> 
 <button type="submit" id="buttonUpdateJS" hidden="hidden" name="buttonUpdateJS">Clicked by JS</button> 
 <div class="form">
 <button type="submit" id="buttonRedirectJS" hidden="hidden" name="buttonRedirectJS">Clicked by JS</button> 
 <button type="submit" id="buttonUpdateJS" hidden="hidden" name="buttonUpdateJS">Clicked by JS</button> 
 <div class="form">
+<!-- panel.filter -->
+<fieldset>
+    <legend>###SNIPPET_COMMON_LEGEND_PAGED###</legend>
+    <div class="row">
+    <div  class="col-md-2"><label for="filterDate">Start</label></div>
+    <div class="col-md-4"><input class="editdatetime datetimepicker" type="text" id="filterDate" name="filterDate" value="###val_filterDate###" /><!-- err_filterDate --></div>
+    <div  class="col-md-2"><span class="pseudo-label"></span></div>
+    <div  class="col-md-4"><button type="submit" name="buttonSearch">Suchen</button></div>
+    </div>
+</fieldset>
+<!-- end.panel.filter -->
 <!-- panel.fields -->
 <div class="row">
     <div  class="col-md-12"><span class="pseudo-label"></span></div>
     
 <!-- panel.fields -->
 <div class="row">
     <div  class="col-md-12"><span class="pseudo-label"></span></div>
     
-###SNIPPET_IF_2###
+###SNIPPET_IF_3###
 </div>
 <!-- end.panel.fields -->
 
 </div>
 <!-- end.panel.fields -->
 
@@ -22,6 +33,7 @@ SNIPPET_ROOT:
         <th>Datum###COMMON_SNIPPET[SNIPPET_SORT_BUTTON,sort_term_date]###</th>
         <th>Bezeichnung###COMMON_SNIPPET[SNIPPET_SORT_BUTTON,sort_term_name]###</th>
         <th>Platzanweiser</th>
         <th>Datum###COMMON_SNIPPET[SNIPPET_SORT_BUTTON,sort_term_date]###</th>
         <th>Bezeichnung###COMMON_SNIPPET[SNIPPET_SORT_BUTTON,sort_term_name]###</th>
         <th>Platzanweiser</th>
+        <th>Fahrdienst</th>
         <th>Bemerkung</th>
       <th></th>
     </tr>
         <th>Bemerkung</th>
       <th></th>
     </tr>
@@ -34,8 +46,9 @@ SNIPPET_ROOT:
 </form>
 
 
 </form>
 
 
-SNIPPET_IF_2:
-    <div  class="col-md-12"><button type="submit" name="buttonNew">Neuer Termin</button></div>    <div  class="col-md-12"><span class="pseudo-label"></span></div>
+SNIPPET_IF_3:
+    <div  class="col-md-12"><button type="submit" name="buttonNew">Neuer Termin</button></div>
+    <div  class="col-md-12"><span class="pseudo-label"></span></div>
     
 
 SNIPPET_ROW:
     
 
 SNIPPET_ROW:
@@ -46,6 +59,7 @@ SNIPPET_ROW:
     <td>###term_date###</td>
     <td>###term_name###</td>
     <td>###members###</td>
     <td>###term_date###</td>
     <td>###term_name###</td>
     <td>###members###</td>
+    <td>###members2###</td>
     <td>###term_info###</td>
     <td><a href="/###APP_NAME###/terms/delete?action=delete&termID=###term_id###"><img src="###PUBLIC_PREFIX###/public/icon/famfamfam/silk/delete.png" alt="###alt_delete###" /></a>
     </td>
     <td>###term_info###</td>
     <td><a href="/###APP_NAME###/terms/delete?action=delete&termID=###term_id###"><img src="###PUBLIC_PREFIX###/public/icon/famfamfam/silk/delete.png" alt="###alt_delete###" /></a>
     </td>
diff --git a/app/terms/build/common/terms.common.config.php b/app/terms/build/common/terms.common.config.php
deleted file mode 100644 (file)
index 4d0e492..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-<?php
-use \app\common as TC;
-
-
-
-$configArray = array(
-    'local_js' => '',
-    'local_css' => '',
-    'data' => 'Daten',     'parent_title' => 'Termine',
-
-        // PHP_HOOK_CONFIG_COMMON
-    '!EoA!' => ''
-);
diff --git a/app/terms/build/common/terms.common.snippets.html b/app/terms/build/common/terms.common.snippets.html
deleted file mode 100644 (file)
index 6e42e03..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-SNIPPET_FIELDS:
-<!-- page.common -->
-<!-- end.page.common -->
-
-SNIPPET_DUMMY_FOR_HOOK:
-<!-- PHP_HOOK_HTML_SNIPPETS not used-->
-
-END:
index 7e8df4321eff38460d97ac4ec71456823f20f68c..629bbc938f39a1e0676c8ae54575325c164d30da 100644 (file)
@@ -1,13 +1,13 @@
 <?php
 use \app\common as TC;
 
 <?php
 use \app\common as TC;
 
-$include = "common/terms.common.config.php";
-
 $configArray = array(
     'local_js' => '',
     'local_css' => '',
     'local_pageType' => 'delete',
 $configArray = array(
     'local_js' => '',
     'local_css' => '',
     'local_pageType' => 'delete',
+    'data' => 'Daten',
     'local_title' => 'Termin löschen',
     'local_title' => 'Termin löschen',
+    'parent_title' => 'Termine',
 
         // PHP_HOOK_CONFIG_DELETE
     '!EoA!' => ''
 
         // PHP_HOOK_CONFIG_DELETE
     '!EoA!' => ''
index 2187d9b32b59696e81e0529945543bd86209e38e..551a300b2091fc9e4ee8d4e3d36fd1cb1c08ccc4 100644 (file)
@@ -11,12 +11,17 @@ SNIPPET_ROOT:
 <fieldset>
 <div class="row">
     <input type="hidden" id="term_id" name="term_id" value="###val_term_id###" />
 <fieldset>
 <div class="row">
     <input type="hidden" id="term_id" name="term_id" value="###val_term_id###" />
-<div  class="col-md-2"><label>Bezeichnung</label></div>    <div class="col-md-10"><input class="edittext" type="text" id="term_name" name="term_name" value="###val_term_name###" maxlength="32" /><!-- err_term_name --></div>
-<div  class="col-md-2"><label>Datum</label></div>    <div class="col-md-10"><input class="editdatetime datetimepicker" type="text" id="term_date" name="term_date" value="###val_term_date###" /><!-- err_term_date --></div>
-<div  class="col-md-2"><label>Bemerkungen</label></div>    <div class="col-md-10"><textarea class="edittext" rows="3" cols="60" id="term_info" name="term_info" maxlength="4000">###val_term_info###</textarea><!-- err_term_info --></div>
+    <div  class="col-md-2"><label for="term_name">Bezeichnung</label></div>
+    <div class="col-md-10"><input class="edittext" type="text" id="term_name" name="term_name" value="###val_term_name###" maxlength="32" /><!-- err_term_name --></div>
+    <div  class="col-md-2"><label for="term_date">Datum</label></div>
+    <div class="col-md-10"><input class="editdatetime datetimepicker" type="text" id="term_date" name="term_date" value="###val_term_date###" /><!-- err_term_date --></div>
+    <div  class="col-md-2"><label for="term_info">Bemerkungen</label></div>
+    <div class="col-md-10"><textarea class="edittext" rows="3" cols="60" id="term_info" name="term_info" maxlength="4000">###val_term_info###</textarea><!-- err_term_info --></div>
     <div  class="col-md-2"><span class="pseudo-label"></span></div>
     <div  class="col-md-2"><span class="pseudo-label"></span></div>
-    <div  class="col-md-4"><button type="submit" name="buttonDelete">Löschen</button></div>    <div  class="col-md-2"><span class="pseudo-label"></span></div>
-    <div  class="col-md-4"><button type="submit" name="buttonClose">Schließen</button></div></div>
+    <div  class="col-md-4"><button type="submit" name="buttonDelete">L&ouml;schen</button></div>
+    <div  class="col-md-2"><span class="pseudo-label"></span></div>
+    <div  class="col-md-4"><button type="submit" name="buttonClose">Schlie&szlig;en</button></div>
+</div>
 </fieldset> 
 <!-- end.panel.fieldgroup -->
 </form>
 </fieldset> 
 <!-- end.panel.fieldgroup -->
 </form>
index afe55fe4cea46def08fdba6cb0271ae811545e72..f2276392e6f545838cd035116a165470b049ca17 100644 (file)
@@ -1,13 +1,13 @@
 <?php
 use \app\common as TC;
 
 <?php
 use \app\common as TC;
 
-$include = "common/terms.common.config.php";
-
 $configArray = array(
     'local_js' => '',
     'local_css' => '',
     'local_pageType' => 'edit',
 $configArray = array(
     'local_js' => '',
     'local_css' => '',
     'local_pageType' => 'edit',
+    'data' => 'Daten',
     'local_title' => 'Termin ändern',
     'local_title' => 'Termin ändern',
+    'parent_title' => 'Termine',
 
         // PHP_HOOK_CONFIG_EDIT
     '!EoA!' => ''
 
         // PHP_HOOK_CONFIG_EDIT
     '!EoA!' => ''
index 01c3cbecf0a88c78fcce3ced10a2a19dce40957b..178a76b768b6d784256288f1a11dde12ad70e2e6 100644 (file)
@@ -10,18 +10,36 @@ SNIPPET_ROOT:
 <!-- panel.fieldgroup -->
 <fieldset>
 <div class="row">
 <!-- panel.fieldgroup -->
 <fieldset>
 <div class="row">
-<div  class="col-md-2"><label>Bezeichnung</label></div>    <div class="col-md-4"><input class="edittext" type="text" id="term_name" name="term_name" value="###val_term_name###" maxlength="32" /><!-- err_term_name --></div>
-<div  class="col-md-2"><label>Datum</label></div>    <div class="col-md-4"><input class="editdatetime datetimepicker" type="text" id="term_date" name="term_date" value="###val_term_date###" /><!-- err_term_date --></div>
-<div  class="col-md-2"><label>Bemerkungen</label></div>    <div class="col-md-10"><textarea class="edittext" rows="3" cols="60" id="term_info" name="term_info" maxlength="4000">###val_term_info###</textarea><!-- err_term_info --></div>
+    <div  class="col-md-2"><label for="term_name">Bezeichnung</label></div>
+    <div class="col-md-4"><input class="edittext" type="text" id="term_name" name="term_name" value="###val_term_name###" maxlength="32" /><!-- err_term_name --></div>
+    <div  class="col-md-2"><label for="term_date">Datum</label></div>
+    <div class="col-md-4"><input class="editdatetime datetimepicker" type="text" id="term_date" name="term_date" value="###val_term_date###" /><!-- err_term_date --></div>
+    <div  class="col-md-2"><label for="term_info">Bemerkungen</label></div>
+    <div class="col-md-10"><textarea class="edittext" rows="3" cols="60" id="term_info" name="term_info" maxlength="4000">###val_term_info###</textarea><!-- err_term_info --></div>
     <input type="hidden" id="membersShdw" name="membersShdw" value="###val_membersShdw###" />
     <input type="hidden" id="membersShdw" name="membersShdw" value="###val_membersShdw###" />
-<div  class="col-md-2"><label>Platzanweiser</label></div>    <div class="col-md-10"><textarea class="edittext readonly readonly" rows="3" cols="60" id="members" name="members">###val_members###</textarea><!-- err_members --></div>
+    <div  class="col-md-2"><label for="members"><xml><b>Platzanweiser</b></label></div>
+    <div class="col-md-10"><textarea class="edittext readonly readonly" rows="3" cols="60" id="members" name="members">###val_members###</textarea><!-- err_members --></div>
     <div  class="col-md-2"><label for="member">Ändern</label></div>
     <div  class="col-md-4"><select class="editselect edittext" id="member" name="member">###opt_member###</select><!-- err_member --></div>
     <div  class="col-md-2"><label for="member">Ändern</label></div>
     <div  class="col-md-4"><select class="editselect edittext" id="member" name="member">###opt_member###</select><!-- err_member --></div>
-    <div  class="col-md-3"><button type="submit" name="buttonAdd">Hinzufügen</button></div>    <div  class="col-md-3"><button type="submit" name="buttonSub">Entfernen</button></div>    <div  class="col-md-12"><span class="pseudo-label"></span></div>
+    <div  class="col-md-3"><button type="submit" name="buttonAdd">Hinzuf&uuml;gen</button></div>
+    <div  class="col-md-3"><button type="submit" name="buttonSub">Entfernen</button></div>
+    <div  class="col-md-12"><span class="pseudo-label"></span></div>
+    
+    <input type="hidden" id="members2Shdw" name="members2Shdw" value="###val_members2Shdw###" />
+    <div  class="col-md-2"><label for="members2"><xml><b>Fahrdienst</b></label></div>
+    <div class="col-md-10"><textarea class="edittext readonly readonly" rows="3" cols="60" id="members2" name="members2">###val_members2###</textarea><!-- err_members2 --></div>
+    <div  class="col-md-2"><label for="member2">Ändern</label></div>
+    <div  class="col-md-4"><select class="editselect edittext" id="member2" name="member2">###opt_member2###</select><!-- err_member2 --></div>
+    <div  class="col-md-3"><button type="submit" name="buttonAddFahrdienst">Hinzuf&uuml;gen</button></div>
+    <div  class="col-md-3"><button type="submit" name="buttonSubFahrdienst">Entfernen</button></div>
+    <div  class="col-md-12"><span class="pseudo-label"></span></div>
+    
+    <div  class="col-md-12"><span class="pseudo-label"></span></div>
     
 ###SNIPPET_IF_2###
 ###SNIPPET_IF_3###
     
 ###SNIPPET_IF_2###
 ###SNIPPET_IF_3###
-    <div  class="col-md-3"><button type="submit" name="buttonClose">Schließen</button></div></div>
+    <div  class="col-md-3"><button type="submit" name="buttonClose">Schlie&szlig;en</button></div>
+</div>
 </fieldset> 
 <!-- end.panel.fieldgroup -->
 </form>
 </fieldset> 
 <!-- end.panel.fieldgroup -->
 </form>
@@ -32,6 +50,7 @@ SNIPPET_IF_2:
     <div  class="col-md-2"><span class="pseudo-label"></span></div>
     <div  class="col-md-4"><button type="submit" name="buttonSave">Speichern</button></div>
 
     <div  class="col-md-2"><span class="pseudo-label"></span></div>
     <div  class="col-md-4"><button type="submit" name="buttonSave">Speichern</button></div>
 
+
 SNIPPET_IF_3:
     <div  class="col-md-6"><span class="pseudo-label"></span></div>
 
 SNIPPET_IF_3:
     <div  class="col-md-6"><span class="pseudo-label"></span></div>
 
index da46f2f9279f40d3339c2171446c1b9ce0464026..6e036c821abdde2a68c27f829abd90d2477ca4de 100644 (file)
@@ -1,13 +1,13 @@
 <?php
 use \app\common as TC;
 
 <?php
 use \app\common as TC;
 
-$include = "common/terms.common.config.php";
-
 $configArray = array(
     'local_js' => '',
     'local_css' => '',
     'local_pageType' => 'new',
 $configArray = array(
     'local_js' => '',
     'local_css' => '',
     'local_pageType' => 'new',
+    'data' => 'Daten',
     'local_title' => 'Neuer Termin',
     'local_title' => 'Neuer Termin',
+    'parent_title' => 'Termine',
 
         // PHP_HOOK_CONFIG_NEW
     '!EoA!' => ''
 
         // PHP_HOOK_CONFIG_NEW
     '!EoA!' => ''
index 02c155d33948183e44565b6ac73842f5ed9787a3..941eb628d6d840d6bd814bd488dd4425c30418e3 100644 (file)
@@ -10,13 +10,18 @@ SNIPPET_ROOT:
 <fieldset>
 <div class="row">
     <input type="hidden" id="term_id" name="term_id" value="###val_term_id###" />
 <fieldset>
 <div class="row">
     <input type="hidden" id="term_id" name="term_id" value="###val_term_id###" />
-<div  class="col-md-2"><label>Bezeichnung</label></div>    <div class="col-md-10"><input class="edittext" type="text" id="term_name" name="term_name" value="###val_term_name###" maxlength="32" /><!-- err_term_name --></div>
-<div  class="col-md-2"><label>Datum</label></div>    <div class="col-md-10"><input class="editdatetime datetimepicker" type="text" id="term_date" name="term_date" value="###val_term_date###" /><!-- err_term_date --></div>
-<div  class="col-md-2"><label>Bemerkungen</label></div>    <div class="col-md-10"><textarea class="edittext" rows="3" cols="60" id="term_info" name="term_info" maxlength="4000">###val_term_info###</textarea><!-- err_term_info --></div>
+    <div  class="col-md-2"><label for="term_name">Bezeichnung</label></div>
+    <div class="col-md-10"><input class="edittext" type="text" id="term_name" name="term_name" value="###val_term_name###" maxlength="32" /><!-- err_term_name --></div>
+    <div  class="col-md-2"><label for="term_date">Datum</label></div>
+    <div class="col-md-10"><input class="editdatetime datetimepicker" type="text" id="term_date" name="term_date" value="###val_term_date###" /><!-- err_term_date --></div>
+    <div  class="col-md-2"><label for="term_info">Bemerkungen</label></div>
+    <div class="col-md-10"><textarea class="edittext" rows="3" cols="60" id="term_info" name="term_info" maxlength="4000">###val_term_info###</textarea><!-- err_term_info --></div>
 ###errors###
     <div  class="col-md-2"><span class="pseudo-label"></span></div>
 ###errors###
     <div  class="col-md-2"><span class="pseudo-label"></span></div>
-    <div  class="col-md-4"><button type="submit" name="buttonSave">Speichern</button></div>    <div  class="col-md-2"><span class="pseudo-label"></span></div>
-    <div  class="col-md-4"><button type="submit" name="buttonClose">Schließen</button></div></div>
+    <div  class="col-md-4"><button type="submit" name="buttonSave">Speichern</button></div>
+    <div  class="col-md-2"><span class="pseudo-label"></span></div>
+    <div  class="col-md-4"><button type="submit" name="buttonClose">Schlie&szlig;en</button></div>
+</div>
 </fieldset> 
 <!-- end.panel.fieldgroup -->
 </form>
 </fieldset> 
 <!-- end.panel.fieldgroup -->
 </form>
index bbac8f96c62e29c05be1b09e879de79cfa10815a..5fd028a069d23b13a6f2136ec8dee433f61a1e96 100644 (file)
@@ -41,7 +41,8 @@ SELECT
 FROM
     terms tt
 WHERE
 FROM
     terms tt
 WHERE
-   tt.deletedat is null
+   tt.term_date >= :date
+   AND tt.deletedat is null
 
 SQL_TERMS_BASE_GETALL_COUNT:
 SELECT
 
 SQL_TERMS_BASE_GETALL_COUNT:
 SELECT
@@ -49,7 +50,8 @@ SELECT
 FROM
     terms tt
 WHERE
 FROM
     terms tt
 WHERE
-   tt.deletedat is null
+   tt.term_date >= :date
+   AND tt.deletedat is null
 
 SQL_TERMS_NEW_INSERT:
 INSERT INTO terms (
 
 SQL_TERMS_NEW_INSERT:
 INSERT INTO terms (
index 19e0612c4998c3e82875ca56313f0ff411200ed2..69345f64dbee7a1e079f4ade61608d675e08824b 100644 (file)
@@ -37,6 +37,7 @@ CREATE TABLE userterms(
   term_id int(10) unsigned NOT NULL AUTO_INCREMENT,
   userterm_term int(10) unsigned,
   userterm_user int(10) unsigned,
   term_id int(10) unsigned NOT NULL AUTO_INCREMENT,
   userterm_term int(10) unsigned,
   userterm_user int(10) unsigned,
+  userterm_type varchar(16),
   created timestamp NULL,
   createdby varchar(16),
   changed timestamp NULL,
   created timestamp NULL,
   createdby varchar(16),
   changed timestamp NULL,
@@ -50,7 +51,7 @@ CREATE TABLE userterms(
 INSERT INTO configurations
 (configuration_scope, configuration_property, configuration_order, configuration_type, configuration_value, configuration_description, configuration_changed_by)
 VALUES
 INSERT INTO configurations
 (configuration_scope, configuration_property, configuration_order, configuration_type, configuration_value, configuration_description, configuration_changed_by)
 VALUES
-('terms', 'required:base', 0, 'string', 'term_id,userterm_term,userterm_user,created,createdby,changed,changedby,deletedat,deletedby', 'Pflichtfelder bei terms. Trennung mit Komma', 'wk');
+('terms', 'required:base', 0, 'string', 'term_id,userterm_term,userterm_user,userterm_type,created,createdby,changed,changedby,deletedat,deletedby', 'Pflichtfelder bei terms. Trennung mit Komma', 'wk');
 -- ! endif
 insert into starters (starter_name, starter_label, starter_parent, starter_image, starter_link)
 values (
 -- ! endif
 insert into starters (starter_name, starter_label, starter_parent, starter_image, starter_link)
 values (
index 1e154c92cec522e3e964fdefe584402d54565937..05cdecf24ed750a1abdbce56c29bfb26ac5056b5 100644 (file)
@@ -97,6 +97,9 @@ trait Model {
                 array_push($replacement, $parts[2*$ix+1]);
             }
         }
                 array_push($replacement, $parts[2*$ix+1]);
             }
         }
+        if ($record['date'] == null) {
+            $record['date'] = new \DateTime('1900-01-01 00:00:00');
+        }
 
         $sqlCount = $this->_sqlSnippetsModel->getSnippet('SQL_TERMS_BASE_GETALL_COUNT');
 
 
         $sqlCount = $this->_sqlSnippetsModel->getSnippet('SQL_TERMS_BASE_GETALL_COUNT');
 
@@ -106,6 +109,7 @@ trait Model {
         }
         // PHP_HOOK_MODEL_TERMS_BASE_GETALL_START
         $params = [
         }
         // PHP_HOOK_MODEL_TERMS_BASE_GETALL_START
         $params = [
+            ':date' => $record['date'] != null ? LN\DB::dateTimeToDbDateTime($record['date']) : null,
         ];
         // PHP_HOOK_MODEL_TERMS_BASE_GETALL_PARAM_FIX
         $countFiltered = intval($this->_db->readUniqueValue($sqlCount, $params));
         ];
         // PHP_HOOK_MODEL_TERMS_BASE_GETALL_PARAM_FIX
         $countFiltered = intval($this->_db->readUniqueValue($sqlCount, $params));
index 70625416ec5a95b2bd737e09ae116a4842e70541..b26516c5ac26b5086c3b442b1f5a322829bc410c 100644 (file)
@@ -12,70 +12,7 @@ trait View {
 
     use \lib\native\MViewC;
         // PHP_HOOK_VIEW_USE_TRAIT
 
     use \lib\native\MViewC;
         // PHP_HOOK_VIEW_USE_TRAIT
-    private $_build = [
-        'base' => [
-            'name' => 'base',
-            'site' => 1,
-            'config' => 1
-        ],
-        'new' => [
-            'name' => 'new',
-            'site' => 1,
-            'config' => 1
-        ],
-        'edit' => [
-            'name' => 'edit',
-            'site' => 1,
-            'config' => 1
-        ],
-        'delete' => [
-            'name' => 'delete',
-            'site' => 1,
-            'config' => 1
-        ]
-    ];
     public $_moduleType = 'backend';
     public $_moduleType = 'backend';
-    /**
-     * Returns the configuration of the common page.
-     *
-     * @return array the configuration
-     */
-    public function getCommonConfig()
-    {
-        // common config is included in edit config:
-        $config = $this->_getConfiguration($this->_build['edit'], 'edit');
-        return $config;
-    }
-    /**
-     * Handles AJAX requests.
-     */
-    public function ajax()
-    {
-        [
-        $snippets,
-        $config
-        ] = $this->_getSnippetsAndConfig($this->_build['edit'], 'edit');
-        $common = TC\Controller::getInstance();
-        $fieldSet = $this->buildCommonFieldSet('edit', URL_DOMAIN_APP_PREFIX . '/terms/ajax');
-        $answer = '';
-        if (! \array_key_exists('ajaxMode', $_POST)) {
-            error_log('Terms::ajax(): Missing argument "ajaxMode"');
-        } else {
-            switch ($_POST['ajaxMode']) {
-                case 'newChanged':
-                    $answer = $common->testNewChanged($fieldSet);
-                    break;
-                case 'editChanged':
-                    $record = $this->termById($_POST['termID']);
-                    $answer = $common->testNewChanged($fieldSet);
-                    break;
-                default:
-                    error_log('Terms::ajax(): unknown mode: ' . $_POST['ajaxMode']);
-                    break;
-            }
-        }
-        $this->answerAjax($answer ?? '');
-    }
         // PHP_HOOK_VIEW_METHODS
 
     /**
         // PHP_HOOK_VIEW_METHODS
 
     /**
@@ -89,9 +26,9 @@ trait View {
         $locals = LOC\Controller::getInstance();
         // PHP_HOOK_BASE_INIT
         [
         $locals = LOC\Controller::getInstance();
         // PHP_HOOK_BASE_INIT
         [
-        $snippets,
-        $config
-        ] = $this->_getSnippetsAndConfig($this->_build['base'], 'base');
+        $config,
+        $snippets
+        ] = $this->simpleConfigurationAndSnippet('terms', 'base');
         $content = $snippets->getSnippet('SNIPPET_ROOT', $config);
         $breadcrumbs = [
                 [
         $content = $snippets->getSnippet('SNIPPET_ROOT', $config);
         $breadcrumbs = [
                 [
@@ -105,7 +42,7 @@ trait View {
         $urlAction = FULL_URL_APP_PREFIX . '/terms/base';
         $fieldSet = new LN\FieldSet('base', $config, $urlAction, $validator);
         $common->addPagingAndSortingFields($fieldSet);
         $urlAction = FULL_URL_APP_PREFIX . '/terms/base';
         $fieldSet = new LN\FieldSet('base', $config, $urlAction, $validator);
         $common->addPagingAndSortingFields($fieldSet);
-
+            $fieldDate = new LN\InputField($fieldSet, "filterDate", '', 'datetime', null, 'Start');
         // PHP_HOOK_BASE_FIELDS
         $fieldSet->setFromPost();
         // PHP_HOOK_BASE_START
         // PHP_HOOK_BASE_FIELDS
         $fieldSet->setFromPost();
         // PHP_HOOK_BASE_START
@@ -117,11 +54,13 @@ trait View {
         $storage->fetchFromFieldset($fieldSet, $storageFields);
         if (count($_POST) == 0){
                 // First call
         $storage->fetchFromFieldset($fieldSet, $storageFields);
         if (count($_POST) == 0){
                 // First call
-        // PHP_HOOK_BASE_FIRST_CALL
+        // === start PHP_HOOK_BASE_FIRST_CALL
+                $fieldDate->value = new \DateTime();
+        // === end PHP_HOOK_BASE_FIRST_CALL
             }
         // PHP_HOOK_BASE_FIELDS_READY
             $pagingData = $common->getPagingAndSortingData($fieldSet, $storage);
             }
         // PHP_HOOK_BASE_FIELDS_READY
             $pagingData = $common->getPagingAndSortingData($fieldSet, $storage);
-            $empty = false;
+            $empty = empty($fieldDate->value);
         if (\array_key_exists('buttonNew', $_POST)) {
             $linkPage = '/terms/new';
         // PHP_HOOK_BASE_REDIRECT_BUTTONNEW
         if (\array_key_exists('buttonNew', $_POST)) {
             $linkPage = '/terms/new';
         // PHP_HOOK_BASE_REDIRECT_BUTTONNEW
@@ -136,6 +75,7 @@ trait View {
             $rows = '';
             $record = [];
             $sqlReplacement = '';
             $rows = '';
             $record = [];
             $sqlReplacement = '';
+            $record['date'] = LN\StringUtils::stringToDateTime($fieldSet->getField('filterDate')->value, $error);
         // PHP_HOOK_BASE_BEFORE_GET_ALL
             $records = $this->getAllTermsBase($sqlReplacement, $pagingData, $record);
             $content = $common->setLegendWithPages($pagingData, $content, ! $empty);
         // PHP_HOOK_BASE_BEFORE_GET_ALL
             $records = $this->getAllTermsBase($sqlReplacement, $pagingData, $record);
             $content = $common->setLegendWithPages($pagingData, $content, ! $empty);
@@ -148,7 +88,8 @@ trait View {
             foreach ($records as &$rec) {
                 $rowNo++;
         // === start PHP_HOOK_BASE_TABLE_ROW_ADAPTION
             foreach ($records as &$rec) {
                 $rowNo++;
         // === start PHP_HOOK_BASE_TABLE_ROW_ADAPTION
-                $rec['members'] = $locals->membersOfTerm($rec['term_id']);
+                $rec['members'] = $locals->membersOfTerm($rec['term_id'], 'anweiser');
+                $rec['members2'] = $locals->membersOfTerm($rec['term_id'], 'fahrdienst');
         // === end PHP_HOOK_BASE_TABLE_ROW_ADAPTION
         $html = $common->rowFromDatabase($templateRow, $rec);
             if (! $editAllowed){
         // === end PHP_HOOK_BASE_TABLE_ROW_ADAPTION
         $html = $common->rowFromDatabase($templateRow, $rec);
             if (! $editAllowed){
@@ -161,7 +102,7 @@ trait View {
             }
             $content = str_replace('###ROWS###', $rows, $content);
         // PHP_HOOK_BASE_HTML
             }
             $content = str_replace('###ROWS###', $rows, $content);
         // PHP_HOOK_BASE_HTML
-        $common->switchConditional($content, 'SNIPPET_IF_2', null, 'role', '1,2', false, $snippets, $config);
+        $common->switchConditional($content, 'SNIPPET_IF_3', null, 'role', '1,2', false, $snippets, $config);
             $dummyStr = null;
             $map = $locals->buildPlaceholderMap('', $config);
         // PHP_HOOK_BASE_HTML_REPLACEMENT
             $dummyStr = null;
             $map = $locals->buildPlaceholderMap('', $config);
         // PHP_HOOK_BASE_HTML_REPLACEMENT
@@ -183,9 +124,9 @@ trait View {
         $locals = LOC\Controller::getInstance();
         // PHP_HOOK_NEW_INIT
         [
         $locals = LOC\Controller::getInstance();
         // PHP_HOOK_NEW_INIT
         [
-            $snippets,
-            $config
-        ] = $this->_getSnippetsAndConfig($this->_build['new'], 'new');
+            $config,
+            $snippets
+        ] = $this->simpleConfigurationAndSnippet('terms', 'new');
         // PHP_HOOK_NEW_FIELDSET_START
         $content = null;
         $validator = new TermsValidator($this);
         // PHP_HOOK_NEW_FIELDSET_START
         $content = null;
         $validator = new TermsValidator($this);
@@ -278,9 +219,9 @@ trait View {
         // PHP_HOOK_EDIT_INIT
         $termID = isset($_GET['termID']) ? $_GET['termID'] : (isset($_POST['term_id']) ? $_POST['term_id'] : -1);
         [
         // PHP_HOOK_EDIT_INIT
         $termID = isset($_GET['termID']) ? $_GET['termID'] : (isset($_POST['term_id']) ? $_POST['term_id'] : -1);
         [
-            $snippets,
-            $config
-        ] = $this->_getSnippetsAndConfig($this->_build['edit'], 'edit');
+            $config,
+            $snippets
+        ] = $this->simpleConfigurationAndSnippet('terms', 'edit');
         // PHP_HOOK_EDIT_FIELDSET_START
         $content = null;
         $validator = new TermsValidator($this);
         // PHP_HOOK_EDIT_FIELDSET_START
         $content = null;
         $validator = new TermsValidator($this);
@@ -290,11 +231,15 @@ trait View {
             $fieldName = new LN\InputField($fieldSet, "term_name", ':db:', 'text', null, 'Bezeichnung');
             $fieldDate = new LN\InputField($fieldSet, "term_date", ':db:', 'datetime', null, 'Datum');
             $fieldInfo = new LN\InputField($fieldSet, "term_info", ':db:', 'text', null, 'Bemerkungen');
             $fieldName = new LN\InputField($fieldSet, "term_name", ':db:', 'text', null, 'Bezeichnung');
             $fieldDate = new LN\InputField($fieldSet, "term_date", ':db:', 'datetime', null, 'Datum');
             $fieldInfo = new LN\InputField($fieldSet, "term_info", ':db:', 'text', null, 'Bemerkungen');
-            $fieldMembers = new LN\InputField($fieldSet, "members", ':readonly:', 'text', null, 'Platzanweiser');
+            $fieldMembers = new LN\InputField($fieldSet, "members", ':readonly:', 'text', null, '<xml><b>Platzanweiser</b>');
             $fieldMembersShdw = new LN\InputField($fieldSet, "membersShdw", ':isshadow:hidden:', 'text');
             $fieldMember = new LN\InputField($fieldSet, "member", ':undef:', 'combobox', null, 'Ändern');
             $fieldMembersShdw = new LN\InputField($fieldSet, "membersShdw", ':isshadow:hidden:', 'text');
             $fieldMember = new LN\InputField($fieldSet, "member", ':undef:', 'combobox', null, 'Ändern');
+            $fieldMembers2 = new LN\InputField($fieldSet, "members2", ':readonly:', 'text', null, '<xml><b>Fahrdienst</b>');
+            $fieldMembers2Shdw = new LN\InputField($fieldSet, "members2Shdw", ':isshadow:hidden:', 'text');
+            $fieldMember2 = new LN\InputField($fieldSet, "member2", ':undef:', 'combobox', null, 'Ändern');
         // === start PHP_HOOK_EDIT_FIELDSET_COMPLETE_FIELDS
         $common->fillUserCombobox($fieldMember, [1, 27, 30], false);
         // === start PHP_HOOK_EDIT_FIELDSET_COMPLETE_FIELDS
         $common->fillUserCombobox($fieldMember, [1, 27, 30], false);
+        $common->fillUserCombobox($fieldMember2, [1, 27, 30], false);
         // === end PHP_HOOK_EDIT_FIELDSET_COMPLETE_FIELDS
         $fieldSet->setFromPost();
         // PHP_HOOK_EDIT_START
         // === end PHP_HOOK_EDIT_FIELDSET_COMPLETE_FIELDS
         $fieldSet->setFromPost();
         // PHP_HOOK_EDIT_START
@@ -310,6 +255,7 @@ trait View {
             $fieldSet->setFromRecord($record);
         // === start PHP_HOOK_EDIT_FIRST_CALL_EARLY
             $fieldMember->value = $_SESSION['userID'];
             $fieldSet->setFromRecord($record);
         // === start PHP_HOOK_EDIT_FIRST_CALL_EARLY
             $fieldMember->value = $_SESSION['userID'];
+            $fieldMember2->value = $_SESSION['userID'];
         // === end PHP_HOOK_EDIT_FIRST_CALL_EARLY
         }
         // PHP_HOOK_EDIT_START2
         // === end PHP_HOOK_EDIT_FIRST_CALL_EARLY
         }
         // PHP_HOOK_EDIT_START2
@@ -353,9 +299,13 @@ trait View {
                 } else {
         // === start PHP_HOOK_EDIT_VALIDATED
                     if (\array_key_exists('buttonAdd', $_POST)){
                 } else {
         // === start PHP_HOOK_EDIT_VALIDATED
                     if (\array_key_exists('buttonAdd', $_POST)){
-                        $locals->addMember($fieldMember->value, $termID);
+                        $locals->addMember(intval($fieldMember->value), $termID, 'anweiser');
                     } elseif (\array_key_exists('buttonSub', $_POST)){
                     } elseif (\array_key_exists('buttonSub', $_POST)){
-                        $locals->subMember($fieldMember->value, $termID);
+                        $locals->subMember(intval($fieldMember->value), $termID, 'anweiser');
+                    } elseif (\array_key_exists('buttonAddFahrdienst', $_POST)){
+                        $locals->addMember(intval($fieldMember2->value), $termID, 'fahrdienst');
+                    } elseif (\array_key_exists('buttonSubFahrdienst', $_POST)){
+                        $locals->subMember(intval($fieldMember2->value), $termID, 'fahrdienst');
                     }
         // === end PHP_HOOK_EDIT_VALIDATED
                 }
                     }
         // === end PHP_HOOK_EDIT_VALIDATED
                 }
@@ -380,7 +330,8 @@ trait View {
             $storageAllowed = true;
             $buttonName = 'buttonSave';
         // === start PHP_HOOK_EDIT_HTML
             $storageAllowed = true;
             $buttonName = 'buttonSave';
         // === start PHP_HOOK_EDIT_HTML
-            $fieldMembers->value = $locals->membersOfTerm($termID);
+            $fieldMembers->value = $locals->membersOfTerm($termID, 'anweiser');
+            $fieldMembers2->value = $locals->membersOfTerm($termID, 'fahrdienst');
         // === end PHP_HOOK_EDIT_HTML
         $common->switchConditional($content, 'SNIPPET_IF_2', null, 'role', '1,2', false, $snippets, $config);
         $common->switchConditional($content, 'SNIPPET_IF_3', null, 'role', '3,4', false, $snippets, $config);
         // === end PHP_HOOK_EDIT_HTML
         $common->switchConditional($content, 'SNIPPET_IF_2', null, 'role', '1,2', false, $snippets, $config);
         $common->switchConditional($content, 'SNIPPET_IF_3', null, 'role', '3,4', false, $snippets, $config);
@@ -406,9 +357,9 @@ trait View {
     {
         // PHP_HOOK_DELETE_INIT
         [
     {
         // PHP_HOOK_DELETE_INIT
         [
-        $snippets,
-        $config
-        ] = $this->_getSnippetsAndConfig($this->_build['delete'], 'delete');
+        $config,
+        $snippets
+        ] = $this->simpleConfigurationAndSnippet('terms', 'delete');
         $sysflags = TS\Controller::getInstance();
         $record = null;
         if (\array_key_exists('termID', $_GET)){
         $sysflags = TS\Controller::getInstance();
         $record = null;
         if (\array_key_exists('termID', $_GET)){
@@ -492,15 +443,13 @@ trait View {
      */
     public function base()
     {
      */
     public function base()
     {
+        $common = TC\Controller::getInstance();
     // PHP_HOOK_VIEW_BUILD_METHOD_BASE
         $html = $this->buildBase();
 
     // PHP_HOOK_VIEW_BUILD_METHOD_BASE
         $html = $this->buildBase();
 
-        $macros = $this->_getConfiguration($this->_build['base'], 'base');
-        $common = TC\Controller::getInstance();
-        $locals = LOC\Controller::getInstance();
-        $html = $common->buildFullPage($macros, $html);
-        $locals->adaptFullPage($html);
-        $this->_showHTML($html);
+        $macros = $this->simpleConfiguration('terms', 'base');
+        $frame = $common->createFullPage($html, 'terms', 'base', $macros);
+        $this->_showHTML($frame);
         return $html;
     }
 
         return $html;
     }
 
@@ -513,15 +462,13 @@ trait View {
      */
     public function new()
     {
      */
     public function new()
     {
+        $common = TC\Controller::getInstance();
     // PHP_HOOK_VIEW_BUILD_METHOD_NEW
         $html = $this->buildNew();
 
     // PHP_HOOK_VIEW_BUILD_METHOD_NEW
         $html = $this->buildNew();
 
-        $macros = $this->_getConfiguration($this->_build['new'], 'new');
-        $common = TC\Controller::getInstance();
-        $locals = LOC\Controller::getInstance();
-        $html = $common->buildFullPage($macros, $html);
-        $locals->adaptFullPage($html);
-        $this->_showHTML($html);
+        $macros = $this->simpleConfiguration('terms', 'new');
+        $frame = $common->createFullPage($html, 'terms', 'new', $macros);
+        $this->_showHTML($frame);
         return $html;
     }
 
         return $html;
     }
 
@@ -534,15 +481,13 @@ trait View {
      */
     public function edit()
     {
      */
     public function edit()
     {
+        $common = TC\Controller::getInstance();
     // PHP_HOOK_VIEW_BUILD_METHOD_EDIT
         $html = $this->buildEdit();
 
     // PHP_HOOK_VIEW_BUILD_METHOD_EDIT
         $html = $this->buildEdit();
 
-        $macros = $this->_getConfiguration($this->_build['edit'], 'edit');
-        $common = TC\Controller::getInstance();
-        $locals = LOC\Controller::getInstance();
-        $html = $common->buildFullPage($macros, $html);
-        $locals->adaptFullPage($html);
-        $this->_showHTML($html);
+        $macros = $this->simpleConfiguration('terms', 'edit');
+        $frame = $common->createFullPage($html, 'terms', 'edit', $macros);
+        $this->_showHTML($frame);
         return $html;
     }
 
         return $html;
     }
 
@@ -555,15 +500,13 @@ trait View {
      */
     public function delete()
     {
      */
     public function delete()
     {
+        $common = TC\Controller::getInstance();
     // PHP_HOOK_VIEW_BUILD_METHOD_DELETE
         $html = $this->buildDelete();
 
     // PHP_HOOK_VIEW_BUILD_METHOD_DELETE
         $html = $this->buildDelete();
 
-        $macros = $this->_getConfiguration($this->_build['delete'], 'delete');
-        $common = TC\Controller::getInstance();
-        $locals = LOC\Controller::getInstance();
-        $html = $common->buildFullPage($macros, $html);
-        $locals->adaptFullPage($html);
-        $this->_showHTML($html);
+        $macros = $this->simpleConfiguration('terms', 'delete');
+        $frame = $common->createFullPage($html, 'terms', 'delete', $macros);
+        $this->_showHTML($frame);
         return $html;
     }
 
         return $html;
     }
 
index e6db8360d63e8a70555e139fb3511d76ad5e125f..4c076a46a544d1fe9a1992f34a4e6534d3a1a69e 100644 (file)
@@ -15,8 +15,8 @@
  *
  * Die anderen Versionsnummern dienen nur der Information.
  */
  *
  * Die anderen Versionsnummern dienen nur der Information.
  */
-define ( 'APPLICATION_VERSION', 'WCL2020.05.24.00' );
-define ( 'DB_VERSION', '2018.11.28.00' );
+define ( 'APPLICATION_VERSION', 'WCL2020.07.23.00' );
+define ( 'DB_VERSION', '2019.05.20.00' );
 define ( 'TEST_DB_VERSION', '2018.11.07.00' );
 define ( 'LIB_VERSION', defined ( 'SKELETON_VERSION' ) ? SKELETON_VERSION : '???' );
 ?>
 define ( 'TEST_DB_VERSION', '2018.11.07.00' );
 define ( 'LIB_VERSION', defined ( 'SKELETON_VERSION' ) ? SKELETON_VERSION : '???' );
 ?>
diff --git a/public/css/page/common/blue.css b/public/css/page/common/blue.css
new file mode 120000 (symlink)
index 0000000..b9ff524
--- /dev/null
@@ -0,0 +1 @@
+../../../../../skeleton/public/css/page/common/blue.css
\ No newline at end of file
diff --git a/public/css/page/common/gray.css b/public/css/page/common/gray.css
new file mode 100644 (file)
index 0000000..8fc9296
--- /dev/null
@@ -0,0 +1,128 @@
+.navbar-nav a:hover.nav-link {
+       color:                  #FFF;
+}
+a.nav-link {
+       color:                          #CCC;
+}
+.tabs-modules a.nav-link {
+    color:          #777;
+}
+.tabs-modules a:hover.nav-link {
+    color:          #333;
+}
+.logout {
+       color:                          #CCC;
+       background-color:       #333;
+       border-color:           #CCC;
+}
+.logout:hover {
+       color:                          #000;
+       background-color:       #BBB;
+       border-color:           #333;
+}
+.db-table tr, .db-table th, .db-table td{
+       border: grey solid 1px;
+}
+fieldset {
+       border: gray solid 1px;
+}
+.summary {
+       background-color: lightgray;
+}
+.ui-datepicker-header {
+       background: url('/public/img/vendor/jquery-ui/dark_leather.png') repeat 0 0 #000;
+       color: #e0e0e0;
+       -webkit-box-shadow: inset 0px 1px 1px 0px rgba(250, 250, 250, 2);
+       -moz-box-shadow: inset 0px 1px 1px 0px rgba(250, 250, 250, .2);
+       box-shadow: inset 0px 1px 1px 0px rgba(250, 250, 250, .2);
+       text-shadow: 1px -1px 0px #000;
+       border-color: #111;
+       filter: dropshadow(color=#000, offx=1, offy=-1);
+}
+.ui-datepicker-prev, .ui-datepicker-next {
+       background-image: url('/public/img/vendor/jquery-ui/arrow.png');
+}
+
+.ui-datepicker thead {
+       background-color: #f7f7f7;
+       background-image: -moz-linear-gradient(top,  #f7f7f7 0%, #f1f1f1 100%);
+       background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f7f7f7), color-stop(100%,#f1f1f1));
+       background-image: -webkit-linear-gradient(top,  #f7f7f7 0%,#f1f1f1 100%);
+       background-image: -o-linear-gradient(top,  #f7f7f7 0%,#f1f1f1 100%);
+       background-image: -ms-linear-gradient(top,  #f7f7f7 0%,#f1f1f1 100%);
+       background-image: linear-gradient(top,  #f7f7f7 0%,#f1f1f1 100%);
+       filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f7f7f7', endColorstr='#f1f1f1',GradientType=0 );
+       border-bottom: 1px solid #bbb;
+}
+
+.ui-datepicker th {
+       color: #666666;
+       text-shadow: 1px 0px 0px #fff;
+       filter: dropshadow(color=#fff, offx=1, offy=0);
+}
+.ui-datepicker tbody td {
+       border-right: 1px solid #bbb;
+}
+.ui-datepicker tbody tr {
+       border-bottom: 1px solid #bbb;
+}
+.ui-datepicker td span, .ui-datepicker td a {
+       color: #666666;
+       text-shadow: 1px 1px 0px #fff;
+       filter: dropshadow(color=#fff, offx=1, offy=1);
+}
+.ui-datepicker-calendar .ui-state-default {
+       background: #ededed;
+       background: -moz-linear-gradient(top,  #ededed 0%, #dedede 100%);
+       background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#ededed), color-stop(100%,#dedede));
+       background: -webkit-linear-gradient(top,  #ededed 0%,#dedede 100%);
+       background: -o-linear-gradient(top,  #ededed 0%,#dedede 100%);
+       background: -ms-linear-gradient(top,  #ededed 0%,#dedede 100%);
+       background: linear-gradient(top,  #ededed 0%,#dedede 100%);
+       filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ededed', endColorstr='#dedede',GradientType=0 );
+       -webkit-box-shadow: inset 1px 1px 0px 0px rgba(250, 250, 250, .5);
+       -moz-box-shadow: inset 1px 1px 0px 0px rgba(250, 250, 250, .5);
+       box-shadow: inset 1px 1px 0px 0px rgba(250, 250, 250, .5);
+}
+.ui-datepicker-calendar .ui-state-hover {
+       background: #f7f7f7;
+}
+.ui-datepicker-calendar .ui-state-active {
+       -webkit-box-shadow: inset 0px 0px 10px 0px rgba(0, 0, 0, .1);
+       -moz-box-shadow: inset 0px 0px 10px 0px rgba(0, 0, 0, .1);
+       box-shadow: inset 0px 0px 10px 0px rgba(0, 0, 0, .1);
+       color: #e0e0e0;
+}
+.ui-datepicker-calendar .ui-state-disabled {
+       background: #ededed;
+}
+.ui-datepicker-unselectable .ui-state-default {
+       background: #f4f4f4;
+       color: #b4b3b3;
+}
+fieldset.fieldgroup-header {
+    background-color: white;
+}
+.tab-pane .paging-block,
+.tab-pane .table {
+    background-color: white;
+}
+.field-set-pane {
+       border: solid black 1px;
+}
+.pseudo-button {
+  border: solid 2px #babab9;
+  background-color: #e8e8e7;
+}
+.customtable tr, .customtable th, .customtable td{
+    border: grey solid 1px;
+}
+.tabs-modules a.tab-module-link {
+    background-color: #f0f0f0;
+    border-color: #111;
+    border: solid 1px black;
+}
+.page-link:hover {
+    color: black;
+}
+
diff --git a/public/css/page/common/green.css b/public/css/page/common/green.css
new file mode 120000 (symlink)
index 0000000..4e2bf50
--- /dev/null
@@ -0,0 +1 @@
+../../../../../skeleton/public/css/page/common/green.css
\ No newline at end of file
index de23d49d4cb76499dfbeb7b27491eecfc31d02f2..b4d5b41b3da0b4513bc0b5a1972cf49de9a48a40 100644 (file)
@@ -130,4 +130,7 @@ input, .pseudo-field {
 
 .filtered-text {
        background-color: #e4eda3;
 
 .filtered-text {
        background-color: #e4eda3;
-}
\ No newline at end of file
+}
+.table tr:hover {
+    background: #e4eda3 !important;
+}
index ddeba02c3ea2284facf0058d3bf878a44262e782..0d41f55701feeb37e9a3b86db4da65d11d0d811c 100644 (file)
@@ -16,6 +16,7 @@ module Terms Term
     dbfield term_id "Id" int primary
     dbfield userterm_term " " int ref:terms.term_id
     dbfield userterm_user " " int ref:loginusers.user_id
     dbfield term_id "Id" int primary
     dbfield userterm_term " " int ref:terms.term_id
     dbfield userterm_user " " int ref:loginusers.user_id
+    dbfield userterm_type " " text size:16
   end.dbtable
   
   dbtable loginusers user
   end.dbtable
   
   dbtable loginusers user
@@ -47,6 +48,10 @@ module Terms Term
   page base "Termine"
     option.page sql.getall:PHP_HOOK_SQL_GET_ALL
     option.page sql.getall.count:PHP_HOOK_SQL_GET_ALL_COUNT
   page base "Termine"
     option.page sql.getall:PHP_HOOK_SQL_GET_ALL
     option.page sql.getall.count:PHP_HOOK_SQL_GET_ALL_COUNT
+    section panel.filter
+      filterfield filterDate "Start" 2 4 term_date date.lowerbound
+      button buttonSearch "Suchen" 2 4 none
+    end.section
      section panel.fields
        empty.line
        if role in 1,2
      section panel.fields
        empty.line
        if role in 1,2
@@ -55,9 +60,9 @@ module Terms Term
        end.if
      end.section
      section table
        end.if
      end.section
      section table
-        option.table viewed:term_id:term_date:term_name:members:term_info
+        option.table viewed:term_id:term_date:term_name:members:members2:term_info
         option.table sorted:term_id:term_date:term_name
         option.table sorted:term_id:term_date:term_name
-        option.table heads:"Id":"Datum":"Bezeichnung":"Platzanweiser":"Bemerkung"
+        option.table heads:"Id":"Datum":"Bezeichnung":"Platzanweiser":"Fahrdienst":"Bemerkung"
         option.table edit.by.dialog
         option.table delete.by.dialog
      end.section
         option.table edit.by.dialog
         option.table delete.by.dialog
      end.section
@@ -76,11 +81,17 @@ module Terms Term
       dbreference term_name 2 4
       dbreference term_date 2 4
       dbreference term_info 2 10
       dbreference term_name 2 4
       dbreference term_date 2 4
       dbreference term_info 2 10
-      field members "Platzanweiser" text 2 10 rows:3 readonly no.storage
+      field members "<xml><b>Platzanweiser</b>" text 2 10 rows:3 readonly no.storage
       field member "Ändern" int 2 4 combobox undef no.storage
       button buttonAdd "Hinzufügen" 0 3 none
       button buttonSub "Entfernen" 0 3 none
       empty.line
       field member "Ändern" int 2 4 combobox undef no.storage
       button buttonAdd "Hinzufügen" 0 3 none
       button buttonSub "Entfernen" 0 3 none
       empty.line
+      field members2 "<xml><b>Fahrdienst</b>" text 2 10 rows:3 readonly no.storage
+      field member2 "Ändern" int 2 4 combobox undef no.storage
+      button buttonAddFahrdienst "Hinzufügen" 0 3 none
+      button buttonSubFahrdienst "Entfernen" 0 3 none
+      empty.line
+      empty.line
       if role in 1,2
          button buttonSave "Speichern" 2 4 save.and.exit
       end.if
       if role in 1,2
          button buttonSave "Speichern" 2 4 save.and.exit
       end.if
index 8aecdc0532a077e74d3387c58d84cb444a2a52d3..22d1af7f68194d0c803f80679264ad170195ccad 100644 (file)
@@ -4,7 +4,8 @@ SELECT
 FROM
     terms tt
 WHERE
 FROM
     terms tt
 WHERE
-   tt.deletedat is null
+   tt.term_date >= :date
+   AND tt.deletedat is null
 
 PHP_HOOK_SQL_GET_ALL_COUNT:
 SELECT
 
 PHP_HOOK_SQL_GET_ALL_COUNT:
 SELECT
@@ -12,28 +13,40 @@ SELECT
 FROM
     terms tt
 WHERE
 FROM
     terms tt
 WHERE
-   tt.deletedat is null
+   tt.term_date >= :date
+   AND tt.deletedat is null
 
 PHP_HOOK_EDIT_FIELDSET_COMPLETE_FIELDS:
         $common->fillUserCombobox($fieldMember, [1, 27, 30], false);
 
 PHP_HOOK_EDIT_FIELDSET_COMPLETE_FIELDS:
         $common->fillUserCombobox($fieldMember, [1, 27, 30], false);
+        $common->fillUserCombobox($fieldMember2, [1, 27, 30], false);
 
 PHP_HOOK_EDIT_VALIDATED:
                     if (\array_key_exists('buttonAdd', $_POST)){
 
 PHP_HOOK_EDIT_VALIDATED:
                     if (\array_key_exists('buttonAdd', $_POST)){
-                        $locals->addMember($fieldMember->value, $termID);
+                        $locals->addMember(intval($fieldMember->value), $termID, 'anweiser');
                     } elseif (\array_key_exists('buttonSub', $_POST)){
                     } elseif (\array_key_exists('buttonSub', $_POST)){
-                        $locals->subMember($fieldMember->value, $termID);
+                        $locals->subMember(intval($fieldMember->value), $termID, 'anweiser');
+                    } elseif (\array_key_exists('buttonAddFahrdienst', $_POST)){
+                        $locals->addMember(intval($fieldMember2->value), $termID, 'fahrdienst');
+                    } elseif (\array_key_exists('buttonSubFahrdienst', $_POST)){
+                        $locals->subMember(intval($fieldMember2->value), $termID, 'fahrdienst');
                     }
 
 PHP_HOOK_EDIT_HTML:
                     }
 
 PHP_HOOK_EDIT_HTML:
-            $fieldMembers->value = $locals->membersOfTerm($termID);
+            $fieldMembers->value = $locals->membersOfTerm($termID, 'anweiser');
+            $fieldMembers2->value = $locals->membersOfTerm($termID, 'fahrdienst');
 
 PHP_HOOK_BASE_TABLE_ROW_ADAPTION:
 
 PHP_HOOK_BASE_TABLE_ROW_ADAPTION:
-                $rec['members'] = $locals->membersOfTerm($rec['term_id']);
+                $rec['members'] = $locals->membersOfTerm($rec['term_id'], 'anweiser');
+                $rec['members2'] = $locals->membersOfTerm($rec['term_id'], 'fahrdienst');
 
 PHP_HOOK_EDIT_FIRST_CALL_EARLY:
             $fieldMember->value = $_SESSION['userID'];
 
 PHP_HOOK_EDIT_FIRST_CALL_EARLY:
             $fieldMember->value = $_SESSION['userID'];
+            $fieldMember2->value = $_SESSION['userID'];
 
 PHP_HOOK_BASE_TABLE_RECORDS_ADAPTION:
             $deleteAllowed = $_SESSION['roleID'] <= 2;
 
 
 PHP_HOOK_BASE_TABLE_RECORDS_ADAPTION:
             $deleteAllowed = $_SESSION['roleID'] <= 2;
 
+PHP_HOOK_BASE_FIRST_CALL:
+                $fieldDate->value = new \DateTime();
+
 END:
\ No newline at end of file
 END:
\ No newline at end of file