openrat-cms

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

commit c4e86c71326b5d66e534ab9fab5d1d0e5ac5fcd6
parent 8430e6fd36d8ec139c78ae25d5a3efb33224a22d
Author: Jan Dankert <devnull@localhost>
Date:   Wed, 28 Nov 2018 23:09:54 +0100

Fix: Gespeicherte Gültigkeitszeiträume auch zum Template ausgeben.

Diffstat:
modules/cms-core/action/ObjectAction.class.php | 14++++++++------
modules/cms-core/action/TextAction.class.php | 2++
modules/cms-ui/themes/default/html/views/file/edit.php | 2+-
3 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/modules/cms-core/action/ObjectAction.class.php b/modules/cms-core/action/ObjectAction.class.php @@ -489,10 +489,6 @@ class ObjectAction extends Action public function propView() { - $this->setTemplateVar( 'valid_from_date' ,$this->baseObject->validFromDate==null?'':date('Y-m-d',$this->baseObject->validFromDate) ); - $this->setTemplateVar( 'valid_from_time' ,$this->baseObject->validFromDate==null?'':date('H:i' ,$this->baseObject->validFromDate) ); - $this->setTemplateVar( 'valid_until_date',$this->baseObject->validToDate ==null?'':date('Y-m-d',$this->baseObject->validToDate ) ); - $this->setTemplateVar( 'valid_until_time',$this->baseObject->validToDate ==null?'':date('H:i' ,$this->baseObject->validToDate ) ); } public function propPost() @@ -508,6 +504,11 @@ class ObjectAction extends Action public function settingsView() { $this->setTemplateVar('settings',$this->baseObject->settings); + + $this->setTemplateVar( 'valid_from_date' ,$this->baseObject->validFromDate==null?'':date('Y-m-d',$this->baseObject->validFromDate) ); + $this->setTemplateVar( 'valid_from_time' ,$this->baseObject->validFromDate==null?'':date('H:i' ,$this->baseObject->validFromDate) ); + $this->setTemplateVar( 'valid_until_date',$this->baseObject->validToDate ==null?'':date('Y-m-d',$this->baseObject->validToDate ) ); + $this->setTemplateVar( 'valid_until_time',$this->baseObject->validToDate ==null?'':date('H:i' ,$this->baseObject->validToDate ) ); } public function settingsPost() @@ -524,11 +525,12 @@ class ObjectAction extends Action } // Gültigkeitszeiträume speichern. - if ($this->getRequestVar( 'valid_from_date' )) + if ($this->hasRequestVar( 'valid_from_date' )) $this->baseObject->validFromDate = strtotime( $this->getRequestVar( 'valid_from_date' ).' '.$this->getRequestVar( 'valid_from_time' ) ); else $this->baseObject->validFromDate = null; - if ($this->getRequestVar( 'valid_until_date')) + + if ($this->hasRequestVar( 'valid_until_date')) $this->baseObject->validToDate = strtotime( $this->getRequestVar( 'valid_until_date').' '.$this->getRequestVar( 'valid_until_time') ); else $this->baseObject->validToDate = null; diff --git a/modules/cms-core/action/TextAction.class.php b/modules/cms-core/action/TextAction.class.php @@ -57,6 +57,8 @@ namespace cms\action $this->text->load(); $this->file = $this->text; + + parent::init(); } diff --git a/modules/cms-ui/themes/default/html/views/file/edit.php b/modules/cms-ui/themes/default/html/views/file/edit.php @@ -9,7 +9,7 @@ <div class="input"> <br/> - <input size="40" id="req15434390431432155717_file" type="file" name="file" class="upload" /> + <input size="40" id="req1543442927474481529_file" type="file" name="file" class="upload" /> <br/>