X-Git-Url: https://git.rohieb.name/iserv-mod-room-reservation.git/blobdiff_plain/5760b2a8d146d7c186daab1743c84683d0d84cea..812fac452957622e1041dc12e7237a6dc00660f8:/includes/mod_roomReservationTimesliceListBox.inc diff --git a/includes/mod_roomReservationTimesliceListBox.inc b/includes/mod_roomReservationTimesliceListBox.inc old mode 100755 new mode 100644 index 7c958af..6928a33 --- a/includes/mod_roomReservationTimesliceListBox.inc +++ b/includes/mod_roomReservationTimesliceListBox.inc @@ -27,6 +27,7 @@ */ require_once("ctrl.inc"); +require_once("mod_room-reservation/mod_roomReservationControl.inc"); require_once("mod_room-reservation/mod_roomReservationTimeslice.inc"); /*****************************************************************************/ @@ -48,10 +49,8 @@ define("MOD_ROOM_RESERVATION_TLB_ACTION_DELETE", 2); /** @} */ /** @todo document, add a delete confirmation */ -class mod_roomReservationTimesliceListBox /* extends mclControl */ { +class mod_roomReservationTimesliceListBox extends mod_roomReservationControl { - /** (mod_roomReservationConfig) Reference to the configuration object */ - protected $oCfg; /** * (constant) The action to be done (GET data). * See @ref timeslicelistbox_actions. @@ -61,8 +60,6 @@ class mod_roomReservationTimesliceListBox /* extends mclControl */ { protected $sNewBegin; /** (string) The ending for a new timeslice (GET data) */ protected $sNewEnd; - /** (array of strings) Errors that occur while processing the form */ - protected $asFormErrors; /***************************************************************************/ /** @@ -71,12 +68,10 @@ class mod_roomReservationTimesliceListBox /* extends mclControl */ { * Constructor * @param $oCfg (reference to mod_roomReservationConfig) Reference to the * configuration - * @return mod_roomReservationBookingTable + * @return mod_roomReservationTimesliceListBox */ public function __construct(mod_roomReservationConfig &$oCfg) { - $this->oCfg = $oCfg; - - $this->processRequestVariables(); + parent::__construct($oCfg); } /***************************************************************************/ @@ -118,12 +113,12 @@ class mod_roomReservationTimesliceListBox /* extends mclControl */ { // Note: we want to handle the timestamps in GMT format, hence the "+0000" if(strtotime($this->getNewBegin()." +0000") === false) { - $this->asFormErrors[] = _c("room-reservation:The beginning time is ". + $this->asMessages[] = _c("room-reservation:The beginning time is ". "invalid."); $bErrors = true; } if(strtotime($this->getNewEnd()." +0000") === false) { - $this->asFormErrors[] = _c("room-reservation:The ending time is ". + $this->asMessages[] = _c("room-reservation:The ending time is ". "invalid."); $bErrors = true; } @@ -137,12 +132,12 @@ class mod_roomReservationTimesliceListBox /* extends mclControl */ { $this->setNewBegin(""); $this->setNewEnd(""); } catch(Exception $e) { - $this->asFormErrors[] = $e->getMessage(); + $this->asMessages[] = $e->getMessage(); } } } elseif($this->getAction() == MOD_ROOM_RESERVATION_TLB_ACTION_DELETE) { - // FIXME delete a timeslice from the configuration file + // delete a timeslice from the configuration file if(isset($_POST["mod_roomReservationTimesliceListBox"])) { if(isset($_POST["mod_roomReservationTimesliceListBox"]["l"])) { $ao = $this->oCfg->getTimeslices(); @@ -210,20 +205,22 @@ class mod_roomReservationTimesliceListBox /* extends mclControl */ { */ /** - * Show the control + * Actually show the control * @return void */ - public function show() { + public function doShow() { TreeView(array(_c("room-reservation:Begin"), _c("room-reservation:End"))); // addition form printf("