openrat-cms

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

commit c4489b3949b269256ac878722d15747171e11529
parent c4e40dc3e623468ded30d846e800534eec310a25
Author: Jan Dankert <develop@jandankert.de>
Date:   Mon, 27 Jun 2022 02:54:38 +0200

Fix: Editing of dates was broken, do not know why the code was missing up to now...

Diffstat:
Mmodules/cms/action/PageelementAction.class.php | 11+++++++++++
Mmodules/cms/action/page/PageAllAction.class.php | 5+++++
Mmodules/cms/action/pageelement/PageelementAllAction.class.php | 5+++++
Mmodules/cms/ui/themes/default/html/views/page/all.php | 8++++----
Mmodules/cms/ui/themes/default/html/views/page/all.tpl.src.xml | 4++--
Mmodules/cms/ui/themes/default/html/views/pageelement/all.php | 8++++----
Mmodules/cms/ui/themes/default/html/views/pageelement/all.tpl.src.xml | 4++--
7 files changed, 33 insertions(+), 12 deletions(-)

diff --git a/modules/cms/action/PageelementAction.class.php b/modules/cms/action/PageelementAction.class.php @@ -287,6 +287,17 @@ class PageelementAction extends BaseAction /** + * Date. + * + */ + protected function editDate() + { + $this->setTemplateVar('date',date('Y-m-d',$this->value->date )); + $this->setTemplateVar('time',date('H:i' ,$this->value->date )); + } + + + /** * Ein Element der Seite bearbeiten * * Es wird ein Formular erzeugt, mit dem der Benutzer den Inhalt bearbeiten kann. diff --git a/modules/cms/action/page/PageAllAction.class.php b/modules/cms/action/page/PageAllAction.class.php @@ -74,6 +74,11 @@ class PageAllAction extends PageAction implements Method { switch( $element->typeid) { + case Element::ELEMENT_TYPE_DATE: + $output['date']=date('Y-m-d',$value->date ); + $output['time']=date('H:i' ,$value->date ); + break; + case Element::ELEMENT_TYPE_LINK: $project = new Project($this->page->projectid); $output['rootfolderid'] = $project->getRootObjectId(); diff --git a/modules/cms/action/pageelement/PageelementAllAction.class.php b/modules/cms/action/pageelement/PageelementAllAction.class.php @@ -74,6 +74,11 @@ class PageelementAllAction extends PageelementAction implements Method { switch( $element->typeid) { + case Element::ELEMENT_TYPE_DATE: + $output['date']=date('Y-m-d',$value->date ); + $output['time']=date('H:i' ,$value->date ); + break; + case Element::ELEMENT_TYPE_LINK: $project = new Project($this->page->projectid); $output['rootfolderid'] = $project->getRootObjectId(); diff --git a/modules/cms/ui/themes/default/html/views/page/all.php b/modules/cms/ui/themes/default/html/views/page/all.php @@ -21,12 +21,12 @@ <h3 class="<?php echo O::escapeHtml('or-fieldset-label') ?>"><?php echo O::escapeHtml('') ?></h3> <div class="<?php echo O::escapeHtml('or-fieldset-value') ?>"><?php echo O::escapeHtml('') ?> <label class="<?php echo O::escapeHtml('or-form-row or-form-input') ?>"><?php echo O::escapeHtml('') ?> - <span class="<?php echo O::escapeHtml('or-form-label') ?>"><?php echo O::escapeHtml('date') ?></span> - <input name="<?php echo O::escapeHtml(''.@$name.'_date') ?>" type="<?php echo O::escapeHtml('date') ?>" maxlength="<?php echo O::escapeHtml('256') ?>" value="<?php echo O::escapeHtml(''.@$value.'') ?>" class="<?php echo O::escapeHtml('or-input') ?>" /><?php echo O::escapeHtml('') ?> + <span class="<?php echo O::escapeHtml('or-form-label') ?>"><?php echo O::escapeHtml(''.@O::lang('date').'') ?></span> + <input name="<?php echo O::escapeHtml(''.@$name.'_date') ?>" type="<?php echo O::escapeHtml('date') ?>" maxlength="<?php echo O::escapeHtml('256') ?>" value="<?php echo O::escapeHtml(''.@$date.'') ?>" class="<?php echo O::escapeHtml('or-input') ?>" /><?php echo O::escapeHtml('') ?> </label> <label class="<?php echo O::escapeHtml('or-form-row or-form-input') ?>"><?php echo O::escapeHtml('') ?> - <span class="<?php echo O::escapeHtml('or-form-label') ?>"><?php echo O::escapeHtml('time') ?></span> - <input name="<?php echo O::escapeHtml(''.@$name.'_time') ?>" type="<?php echo O::escapeHtml('time') ?>" maxlength="<?php echo O::escapeHtml('256') ?>" value="<?php echo O::escapeHtml(''.@$value.'') ?>" class="<?php echo O::escapeHtml('or-input') ?>" /><?php echo O::escapeHtml('') ?> + <span class="<?php echo O::escapeHtml('or-form-label') ?>"><?php echo O::escapeHtml(''.@O::lang('time').'') ?></span> + <input name="<?php echo O::escapeHtml(''.@$name.'_time') ?>" type="<?php echo O::escapeHtml('time') ?>" maxlength="<?php echo O::escapeHtml('256') ?>" value="<?php echo O::escapeHtml(''.@$time.'') ?>" class="<?php echo O::escapeHtml('or-input') ?>" /><?php echo O::escapeHtml('') ?> </label> </div> </section> diff --git a/modules/cms/ui/themes/default/html/views/page/all.tpl.src.xml b/modules/cms/ui/themes/default/html/views/page/all.tpl.src.xml @@ -13,8 +13,8 @@ <group title="${label}" collapsible="false" description="${desc}"> <if value="${type}" equals="date"> <fieldset label=""> - <input type="date" name="${name}_date" label="date" default="${value}" /> - <input type="time" name="${name}_time" label="time" default="${value}" /> + <input type="date" name="${name}_date" label="${message:date}" default="${date}" /> + <input type="time" name="${name}_time" label="${message:time}" default="${time}" /> </fieldset> </if> <if value="${type}" equals="text"> diff --git a/modules/cms/ui/themes/default/html/views/pageelement/all.php b/modules/cms/ui/themes/default/html/views/pageelement/all.php @@ -22,12 +22,12 @@ <h3 class="<?php echo O::escapeHtml('or-fieldset-label') ?>"><?php echo O::escapeHtml('') ?></h3> <div class="<?php echo O::escapeHtml('or-fieldset-value') ?>"><?php echo O::escapeHtml('') ?> <label class="<?php echo O::escapeHtml('or-form-row or-form-input') ?>"><?php echo O::escapeHtml('') ?> - <span class="<?php echo O::escapeHtml('or-form-label') ?>"><?php echo O::escapeHtml('date') ?></span> - <input name="<?php echo O::escapeHtml(''.@$name.'_date') ?>" type="<?php echo O::escapeHtml('date') ?>" maxlength="<?php echo O::escapeHtml('256') ?>" value="<?php echo O::escapeHtml(''.@$value.'') ?>" class="<?php echo O::escapeHtml('or-input') ?>" /><?php echo O::escapeHtml('') ?> + <span class="<?php echo O::escapeHtml('or-form-label') ?>"><?php echo O::escapeHtml(''.@O::lang('date').'') ?></span> + <input name="<?php echo O::escapeHtml(''.@$name.'_date') ?>" type="<?php echo O::escapeHtml('date') ?>" maxlength="<?php echo O::escapeHtml('256') ?>" value="<?php echo O::escapeHtml(''.@$date.'') ?>" class="<?php echo O::escapeHtml('or-input') ?>" /><?php echo O::escapeHtml('') ?> </label> <label class="<?php echo O::escapeHtml('or-form-row or-form-input') ?>"><?php echo O::escapeHtml('') ?> - <span class="<?php echo O::escapeHtml('or-form-label') ?>"><?php echo O::escapeHtml('time') ?></span> - <input name="<?php echo O::escapeHtml(''.@$name.'_time') ?>" type="<?php echo O::escapeHtml('time') ?>" maxlength="<?php echo O::escapeHtml('256') ?>" value="<?php echo O::escapeHtml(''.@$value.'') ?>" class="<?php echo O::escapeHtml('or-input') ?>" /><?php echo O::escapeHtml('') ?> + <span class="<?php echo O::escapeHtml('or-form-label') ?>"><?php echo O::escapeHtml(''.@O::lang('time').'') ?></span> + <input name="<?php echo O::escapeHtml(''.@$name.'_time') ?>" type="<?php echo O::escapeHtml('time') ?>" maxlength="<?php echo O::escapeHtml('256') ?>" value="<?php echo O::escapeHtml(''.@$time.'') ?>" class="<?php echo O::escapeHtml('or-input') ?>" /><?php echo O::escapeHtml('') ?> </label> </div> </section> diff --git a/modules/cms/ui/themes/default/html/views/pageelement/all.tpl.src.xml b/modules/cms/ui/themes/default/html/views/pageelement/all.tpl.src.xml @@ -9,8 +9,8 @@ <group title="${label}" description="${desc}"> <if value="${type}" equals="date"> <fieldset label=""> - <input type="date" name="${name}_date" label="date" default="${value}" /> - <input type="time" name="${name}_time" label="time" default="${value}" /> + <input type="date" name="${name}_date" label="${message:date}" default="${date}" /> + <input type="time" name="${name}_time" label="${message:time}" default="${time}" /> </fieldset> </if> <if value="${type}" equals="text">