32 string $a_postvar =
""
36 $this->
lng = $DIC->language();
37 $this->tpl =
$DIC[
"tpl"];
43 $this->value = $a_value;
53 $this->validationFailureMessage = $a_msg;
78 foreach (
$data as $slot => $days) {
84 $parts = explode(
"-", $slot);
85 $from = str_replace(
":",
"",
$parts[0]);
86 $to = str_replace(
":",
"",
$parts[1]);
92 foreach (
$data as $rslot => $rdays) {
93 if ($slot != $rslot && $rdays && array_intersect($days, $rdays)) {
94 $rparts = explode(
"-", $rslot);
95 $rfrom = str_replace(
":",
"", $rparts[0]);
96 $rto = str_replace(
":",
"", $rparts[1]);
98 if (($rfrom > $from && $rfrom < $to) ||
99 ($rto > $from && $rto < $to) ||
100 ($rfrom < $from && $rto > $to)) {
126 $a_remove_invalid =
true
129 for ($loop = 0; $loop < 240; $loop++) {
130 $days = $this->
strArray($a_post_var .
"_days~" . $loop);
132 $this->
str($a_post_var .
"_from_hh~" . $loop),
133 $this->
str($a_post_var .
"_from_mm~" . $loop)
136 $this->
str($a_post_var .
"_to_hh~" . $loop),
137 $this->
str($a_post_var .
"_to_mm~" . $loop)
141 if ($days || $from !==
"00:00" || $to !==
"00:00") {
142 $slot = $from .
"-" . $to;
144 if (isset(
$res[$slot])) {
145 $res[$slot] = array_unique(array_merge(
$res[$slot], $days));
150 $res[$slot] = array();
153 if ($a_remove_invalid && !($days && $from && $to && $from !== $to)) {
166 $tpl =
new ilTemplate(
"tpl.schedule_input.html",
true,
true,
"Modules/BookingManager");
168 $lng->loadLanguageModule(
"dateplaner");
172 $def = array(
null =>
null);
175 $days = array(
"Mo",
"Tu",
"We",
"Th",
"Fr",
"Sa",
"Su");
177 foreach ($def as $slot => $days_select) {
178 $tpl->setCurrentBlock(
"days");
179 foreach ($days as $day) {
180 $day_value = strtolower($day);
182 $tpl->setVariable(
"ROW", $row);
183 $tpl->setVariable(
"ID", $this->getFieldId());
184 $tpl->setVariable(
"POST_VAR", $this->getPostVar());
185 $tpl->setVariable(
"DAY", $day_value);
186 $tpl->setVariable(
"TXT_DAY",
$lng->txt($day .
"_short"));
188 if ($days_select && in_array($day_value, $days_select,
true)) {
189 $tpl->setVariable(
"DAY_STATUS",
" checked=\"checked\"");
192 $tpl->parseCurrentBlock();
195 $tpl->setCurrentBlock(
"row");
196 $tpl->setVariable(
"ROW", $row);
197 $tpl->setVariable(
"ID", $this->getFieldId());
198 $tpl->setVariable(
"POST_VAR", $this->getPostVar());
199 $tpl->setVariable(
"TXT_FROM",
$lng->txt(
"cal_from"));
200 $tpl->setVariable(
"TXT_TO",
$lng->txt(
"cal_until"));
203 $tpl->setVariable(
"TXT_MULTI_ADD",
$lng->txt(
"add"));
204 $tpl->setVariable(
"TXT_MULTI_REMOVE",
$lng->txt(
"remove"));
207 $parts = explode(
"-", $slot);
208 $from = explode(
":",
$parts[0]);
209 $to = explode(
":",
$parts[1]);
211 $tpl->setVariable(
"FROM_HH_VALUE", $from[0]);
212 $tpl->setVariable(
"FROM_MM_VALUE", $from[1]);
213 $tpl->setVariable(
"TO_HH_VALUE", $to[0]);
214 $tpl->setVariable(
"TO_MM_VALUE", $to[1]);
220 $tpl->setVariable(
"ADD_STYLE",
" style=\"display:none\"");
224 $tpl->setVariable(
"RMV_STYLE",
" style=\"display:none\"");
228 $tpl->parseCurrentBlock();
240 $tpl->addJavascript(
"Modules/BookingManager/js/ScheduleInput.js");
242 $html = $this->render();
256 $hours = (
int) $a_hours;
257 $min = (
int) $a_minutes;
258 if ($hours > 23 || $min > 59) {
261 return str_pad($hours, 2,
"0", STR_PAD_LEFT) .
":" .
262 str_pad($min, 2,
"0", STR_PAD_LEFT);
setVariable($variable, $value='')
Sets a variable value.
static get(string $a_glyph, string $a_text="")
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
special template class to simplify handling of ITX/PEAR
setCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
parseCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
if($DIC->http() ->request() ->getMethod()=="GET" &&isset($DIC->http() ->request() ->getQueryParams()['tex'])) $tpl
if($clientAssertionType !='urn:ietf:params:oauth:client-assertion-type:jwt-bearer'|| $grantType !='client_credentials') $parts
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc