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);
131 $from = self::parseTime(
132 $this->
str($a_post_var .
"_from_hh~" . $loop),
133 $this->
str($a_post_var .
"_from_mm~" . $loop)
135 $to = self::parseTime(
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");
172 $def = array(null => null);
175 $days = array(
"Mo",
"Tu",
"We",
"Th",
"Fr",
"Sa",
"Su");
177 foreach ($def as $slot => $days_select) {
179 foreach ($days as $day) {
180 $day_value = strtolower($day);
188 if ($days_select && in_array($day_value, $days_select,
true)) {
189 $tpl->
setVariable(
"DAY_STATUS",
" checked=\"checked\"");
207 $parts = explode(
"-", $slot);
208 $from = explode(
":",
$parts[0]);
209 $to = explode(
":",
$parts[1]);
220 $tpl->
setVariable(
"ADD_STYLE",
" style=\"display:none\"");
224 $tpl->
setVariable(
"RMV_STYLE",
" style=\"display:none\"");
240 $tpl->addJavascript(
"Modules/BookingManager/js/ScheduleInput.js");
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);
parseCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
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...
static get(string $a_glyph, string $a_text="")
if($clientAssertionType !='urn:ietf:params:oauth:client-assertion-type:jwt-bearer'|| $grantType !='client_credentials') $parts
get(string $part=self::DEFAULT_BLOCK)
Renders the given block and returns the html string.
loadLanguageModule(string $a_module)
Load language module.
setVariable(string $variable, $value='')
Sets the given variable to the given value.
setVariable($variable, $value='')
Sets a variable value.
setCurrentBlock(string $part=self::DEFAULT_BLOCK)
Sets the template to the given block.
setCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
__construct(Container $dic, ilPlugin $plugin)
parseCurrentBlock(string $block_name=self::DEFAULT_BLOCK)
Parses the given block.