<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 -->
* @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,
+ ':type' => $type,
':user' => $_SESSION['shortname']
]);
}
* @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,
- ':term' => $term
+ ':term' => $term,
+ ':type' => $type
]);
}
* 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, [
- ':term' => $term
+ ':term' => $term,
+ ':type' => $type
], false);
$rc = '';
foreach ($recs as &$rec) {
]
];
+ private $_frameSnippets;
+
/**
* Adapts the full page in a application depending way.
*
// 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;
+ }
}
SQL_INSERT_USERTERM:
insert into userterms
- (userterm_user, userterm_term, created, createdby)
+ (userterm_user, userterm_term, userterm_type, created, createdby)
values
- (:member, :term, now(), :user)
+ (:member, :term, :type, now(), :user)
;
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:
left join loginusers u on u.user_id=tt.userterm_user
where
userterm_term=:term
+ AND userterm_type=:type
order by user_displayname
;
<?php
use \app\common as TC;
-$include = "common/terms.common.config.php";
-
$configArray = array(
'local_js' => '',
'local_css' => '',
'local_pageType' => 'base',
+ 'data' => 'Daten',
'local_title' => 'Termine',
+ 'parent_title' => 'Termine',
'hasFilter' => TC\Controller::getInstance()->configurationAsBool('terms', 'filter:switch'),
// PHP_HOOK_CONFIG_BASE
<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>
-###SNIPPET_IF_2###
+###SNIPPET_IF_3###
</div>
<!-- end.panel.fields -->
<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>
</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:
<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>
+++ /dev/null
-<?php
-use \app\common as TC;
-
-
-
-$configArray = array(
- 'local_js' => '',
- 'local_css' => '',
- 'data' => 'Daten', 'parent_title' => 'Termine',
-
- // PHP_HOOK_CONFIG_COMMON
- '!EoA!' => ''
-);
+++ /dev/null
-SNIPPET_FIELDS:
-<!-- page.common -->
-<!-- end.page.common -->
-
-SNIPPET_DUMMY_FOR_HOOK:
-<!-- PHP_HOOK_HTML_SNIPPETS not used-->
-
-END:
<?php
use \app\common as TC;
-$include = "common/terms.common.config.php";
-
$configArray = array(
'local_js' => '',
'local_css' => '',
'local_pageType' => 'delete',
+ 'data' => 'Daten',
'local_title' => 'Termin löschen',
+ 'parent_title' => 'Termine',
// PHP_HOOK_CONFIG_DELETE
'!EoA!' => ''
<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-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ö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>
</fieldset>
<!-- end.panel.fieldgroup -->
</form>
<?php
use \app\common as TC;
-$include = "common/terms.common.config.php";
-
$configArray = array(
'local_js' => '',
'local_css' => '',
'local_pageType' => 'edit',
+ 'data' => 'Daten',
'local_title' => 'Termin ändern',
+ 'parent_title' => 'Termine',
// PHP_HOOK_CONFIG_EDIT
'!EoA!' => ''
<!-- 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###" />
-<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-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ü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ü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###
- <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ßen</button></div>
+</div>
</fieldset>
<!-- end.panel.fieldgroup -->
</form>
<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>
<?php
use \app\common as TC;
-$include = "common/terms.common.config.php";
-
$configArray = array(
'local_js' => '',
'local_css' => '',
'local_pageType' => 'new',
+ 'data' => 'Daten',
'local_title' => 'Neuer Termin',
+ 'parent_title' => 'Termine',
// PHP_HOOK_CONFIG_NEW
'!EoA!' => ''
<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>
- <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ßen</button></div>
+</div>
</fieldset>
<!-- end.panel.fieldgroup -->
</form>
FROM
terms tt
WHERE
- tt.deletedat is null
+ tt.term_date >= :date
+ AND tt.deletedat is null
SQL_TERMS_BASE_GETALL_COUNT:
SELECT
FROM
terms tt
WHERE
- tt.deletedat is null
+ tt.term_date >= :date
+ AND tt.deletedat is null
SQL_TERMS_NEW_INSERT:
INSERT INTO terms (
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,
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 (
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');
}
// 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));
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';
- /**
- * 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
/**
$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 = [
[
$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
$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);
- $empty = false;
+ $empty = empty($fieldDate->value);
if (\array_key_exists('buttonNew', $_POST)) {
$linkPage = '/terms/new';
// PHP_HOOK_BASE_REDIRECT_BUTTONNEW
$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);
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){
}
$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
$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_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);
$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');
+ $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);
+ $common->fillUserCombobox($fieldMember2, [1, 27, 30], false);
// === end PHP_HOOK_EDIT_FIELDSET_COMPLETE_FIELDS
$fieldSet->setFromPost();
// PHP_HOOK_EDIT_START
$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
} 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)){
- $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
}
$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);
{
// 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)){
*/
public function base()
{
+ $common = TC\Controller::getInstance();
// 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;
}
*/
public function new()
{
+ $common = TC\Controller::getInstance();
// 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;
}
*/
public function edit()
{
+ $common = TC\Controller::getInstance();
// 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;
}
*/
public function delete()
{
+ $common = TC\Controller::getInstance();
// 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;
}
*
* 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 : '???' );
?>
--- /dev/null
+../../../../../skeleton/public/css/page/common/blue.css
\ No newline at end of file
--- /dev/null
+.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;
+}
+
--- /dev/null
+../../../../../skeleton/public/css/page/common/green.css
\ No newline at end of file
.filtered-text {
background-color: #e4eda3;
-}
\ No newline at end of file
+}
+.table tr:hover {
+ background: #e4eda3 !important;
+}
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
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
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 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
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 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
FROM
terms tt
WHERE
- tt.deletedat is null
+ tt.term_date >= :date
+ AND tt.deletedat is null
PHP_HOOK_SQL_GET_ALL_COUNT:
SELECT
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);
+ $common->fillUserCombobox($fieldMember2, [1, 27, 30], false);
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)){
- $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:
- $fieldMembers->value = $locals->membersOfTerm($termID);
+ $fieldMembers->value = $locals->membersOfTerm($termID, 'anweiser');
+ $fieldMembers2->value = $locals->membersOfTerm($termID, 'fahrdienst');
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'];
+ $fieldMember2->value = $_SESSION['userID'];
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