<?php
-/**\r
- * @file mod_roomReservationTimesliceListBox.inc\r
- * A list box that allows the user to add and delete timeslices\r
- * @author Roland Hieber (roland.hieber@wilhelm-gym.net)\r
- * @date 23.06.2008\r
- * \r
- * Copyright © 2007 Roland Hieber\r
- *\r
- * Permission is hereby granted, free of charge, to any person obtaining\r
- * copy of this software and associated documentation files (the "Software"),\r
- * to deal in the Software without restriction, including without limitation\r
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,\r
- * and/or sell copies of the Software, and to permit persons to whom the\r
- * Software is furnished to do so, subject to the following conditions:\r
- * \r
- * The above copyright notice and this permission notice shall be included in\r
- * all copies or substantial portions of the Software.\r
- *\r
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\r
- * THE SOFTWARE.\r
- */\r
+/**
+ * @file mod_roomReservationTimesliceListBox.inc
+ * A list box that allows the user to add and delete timeslices
+ * @author Roland Hieber (roland.hieber@wilhelm-gym.net)
+ * @date 23.06.2008
+ *
+ * Copyright © 2007 Roland Hieber
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
require_once("ctrl.inc");
require_once("mod_room-reservation/mod_roomReservationControl.inc");
/** Delete a timeslice */
define("MOD_ROOM_RESERVATION_TLB_ACTION_DELETE", 2);
/** @} */
-\r
+
/** @todo document, add a delete confirmation */
class mod_roomReservationTimesliceListBox extends mod_roomReservationControl {
// Note: we want to handle the timestamps in GMT format, hence the "+0000"
if(strtotime($this->getNewBegin()." +0000") === false) {
$this->asMessages[] = _c("room-reservation:The beginning time is ".
- "invalid.");
+ "invalid.");
$bErrors = true;
}
if(strtotime($this->getNewEnd()." +0000") === false) {
$this->asMessages[] = _c("room-reservation:The ending time is ".
- "invalid.");
+ "invalid.");
$bErrors = true;
}
}
TreeViewLine(array(sprintf("<%s name='mod_roomReservationTimesliceListBox".
- "[begin]' value='%s' size='8'/>", $GLOBALS["stdedt"],
+ "[begin]' value='%s' size='8'/>", $GLOBALS["stdedt"],
$this->getNewBegin()), sprintf("<%s name='".
"mod_roomReservationTimesliceListBox[end]' value='%s' size='8'/> <%s ".
"name='mod_roomReservationTimesliceListBox[submit]' value='%s' />",
$aoTs = $this->oCfg->getTimeslices();
if(count($aoTs) > 0) {
echo "<form action='?mod_roomReservationTimesliceListBox[action]=delete' ".
- "method='post'>";
+ "method='post'>";
$i = 0;
foreach($aoTs as $oTs) {
$sBox = sprintf("<input type='hidden' ".
- "name='mod_roomReservationTimesliceListBox[l][%d]' value='0' />".
- "<%s name='mod_roomReservationTimesliceListBox[l][%d]' value='1' />",
+ "name='mod_roomReservationTimesliceListBox[l][%d]' value='0' />".
+ "<%s name='mod_roomReservationTimesliceListBox[l][%d]' value='1' />",
$i, $GLOBALS["smlchk"], $i);
// Note: we have only GMT timestamps in the timeslice objects
TreeViewLine(array($sBox . gmstrftime(_("%#I:%M %p"), $oTs->getBegin()),
printf("<tr><td class='tbbtm' colspan='%d'>", $GLOBALS["treeview_cols"]);
CheckCombo();
printf("<%s name='mod_roomReservationTimesliceListBox[submit]' ".
- "value='%s' />", $GLOBALS["stdbtn"], _("Delete"));
+ "value='%s' />", $GLOBALS["stdbtn"], _("Delete"));
echo "</td></tr>\n";
} else {
TreeViewEmpty();
}
/** @} */
}
-?>
\ No newline at end of file
+?>