setTitle(_c("room-reservation:Configuration")); $this->setIcon("mod_room-reservation_config"); } public function processRequestVariables() { // default values $this->bPostShowWeekend = $this->oCfg->isShowWeekend(); $this->bPostShowLessons = $this->oCfg->isShowLessons(); if(isset($_POST["mod_roomReservationConfigPage"])) { if(isset($_POST["mod_roomReservationConfigPage"]["showweekend"])) { $this->bPostShowWeekend = ($_POST["mod_roomReservationConfigPage"]["showweekend"] == true); } if(isset($_POST["mod_roomReservationConfigPage"]["showlessons"])) { $this->bPostShowLessons = ($_POST["mod_roomReservationConfigPage"]["showlessons"] == true); } // process the request if(isset($_POST["mod_roomReservationConfigPage"]["submit"])) { $this->oCfg->setShowWeekend($this->bPostShowWeekend); $this->oCfg->setShowLessons($this->bPostShowLessons); try { $this->oCfg->writeConfig(); } catch(Exception $e) { $this->asMessages[] = $e->getMessage(); } } } } public function doShow() { // error messages if(count($this->asMessages) > 0) { printf("

%s

", nl2br(q(join("\n", $this->asMessages)))); } echo "". "
\n"; // two rows GroupBox(_("Privileges"), "keys"); $asAdminGroups = rrPrivilegedGroups("mod_roomreservation_admin"); $asBookGroups = rrPrivilegedGroups("mod_roomreservation_book"); $asViewGroups = rrPrivilegedGroups("mod_roomreservation_view"); echo sprintf("

%s

\n

%s

\n

%s

", _c("room-reservation:This is ". "a short summary of the privileges related to the room reservation ". "schedulde and the groups which have them assigned."), sprintf(_c("room-reservation:If one of these privileges is not assigned to ". "any group, all users on this server are allowed to perform the specified ". "action. Please use the %sgroup administration%s to assign and revoke ". "privileges."), "", ""), _c("room-reservation:Please note that every group with the booking ". "privilege can also implicitly view the booking table and every group with ". "the administration privilege can also implicitly book and view the ". "booking table.")); echo "

\n"; echo sprintf("\n", icon("keys"), _("View the booking table").":", $asViewGroups == array() ? _c("room-reservation:all users") : icon("act-group") . join(", ", array_map("getGroupName", $asViewGroups))); echo "\n"; echo sprintf("\n", icon("keys"), _("Book rooms").":", $asBookGroups == array() ? _c("room-reservation:all users") : icon("act-group") . join(", ", array_map("getGroupName", $asBookGroups))); echo "\n"; echo sprintf("\n", icon("keys"), _("Administration of the room reservation schedule"), $asAdminGroups == array() ? _c("room-reservation:all users") : icon("act-group") . join(", ", array_map("getGroupName", $asAdminGroups))); echo "
%s%s%s
%s%s%s
%s%s%s

\n"; _GroupBox(); GroupBox(_c("room-reservation:Further options"), "manage"); printf("
". "\n", $_SERVER["PHP_SELF"]); printf("\n"; printf("", $GLOBALS["stdbtn"], _("OK")); echo "
<%s name='mod_roomReservationConfigPage". "[showweekend]' id='mod_roomReservationConfigPageShowWeekend' ". "value='1' %s />
". "%s

", $GLOBALS["smlchk"], $this->bPostShowWeekend ? "checked='checked' " : "", _c("room-reservation:Show weekend"), _c("room-reservation:If ". "selected, the weekdays saturday and sunday are also shown in the ". "booking table.")); echo "
<%s name='mod_roomReservationConfigPage". "[showlessons]' id='mod_roomReservationConfigPageShowLessons' ". "value='1'%s />
". "%s

", $GLOBALS["smlchk"], $this->bPostShowLessons ? "checked='checked' " : "", _c("room-reservation:Show „lesson” texts"), _c("room-reservation:Check this box to show texts like ". "„nth lesson&rdquo in the booking page. If this box is ". "unchecked, none of these texts are shown.")); printf("
<%s name='mod_roomReservationConfigPage". "[submit]' value='%s' />
\n"; _GroupBox(); // second row echo "
\n"; GroupBox(_c("room-reservation:Periods"), "mod_room-reservation_timeslice"); printf("

%s

", _c("room-reservation:Here you can fill in the ". "periods where bookings can be undertaken. A booking period can ". "e. g. correspond to a lesson.")); echo "
"; $otlb = new mod_roomReservationTimesliceListBox($this->oCfg); $otlb->show(); echo "
"; _GroupBox(); echo "
\n"; } } ?>