1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
options.php
См. документацию.
1<?
3IncludeModuleLangFile($_SERVER["DOCUMENT_ROOT"].BX_ROOT."/modules/main/options.php");
4CModule::IncludeModule('calendar');
6
7if (!$USER->CanDoOperation('edit_php')) // Is admin
8 $APPLICATION->AuthForm(GetMessage("ACCESS_DENIED"));
9
11 array(
12 "DIV" => "edit1", "TAB" => GetMessage("CAL_OPT_SETTINGS"), "ICON" => "calendar_settings", "TITLE" => GetMessage("CAL_SETTINGS_TITLE"),
13 ),
14 array(
15 "DIV" => "edit2", "TAB" => GetMessage("CAL_OPT_TYPES"), "ICON" => "calendar_settings", "TITLE" => GetMessage("CAL_OPT_TYPES"),
16 )
17);
18
19$tabControl = new CAdminTabControl("tabControl", $aTabs);
20
21CUtil::InitJSCore(array('ajax', 'window', 'popup', 'access'));
22
23$arTypes = CCalendarType::GetList();
24$dbSites = CSite::GetList('sort', 'asc', array('ACTIVE' => 'Y'));
27while ($arRes = $dbSites->GetNext())
28{
29 $sites[$arRes['ID']] = '('.$arRes['ID'].') '.$arRes['NAME'];
30 if ($arRes['DEF'] == 'Y')
31 $default_site = $arRes['ID'];
32}
33
35if (CModule::IncludeModule("forum"))
36{
38 while ($ar = $db->GetNext())
39 $arForums[$ar["ID"]] = "[".$ar["ID"]."] ".$ar["NAME"];
40}
41
42if ($_SERVER['REQUEST_METHOD'] == "POST" && isset($_REQUEST['save_type']) && $_REQUEST['save_type'] == 'Y' && check_bitrix_sessid())
43{
44 //CUtil::JSPostUnEscape();
45 $APPLICATION->RestartBuffer();
46 if (isset($_REQUEST['del_type']) && $_REQUEST['del_type'] == 'Y')
47 {
48 $xmlId = trim($_REQUEST['type_xml_id']);
49 if ($xmlId != '')
51 }
52 else
53 {
54 $bNew = isset($_POST['type_new']) && $_POST['type_new'] == 'Y';
55 $xmlId = trim($bNew ? $_POST['type_xml_id'] : $_POST['type_xml_id_hidden']);
56 $name = trim($_POST['type_name']);
57
58 if ($xmlId != '' && $name != '')
59 {
60 $XML_ID = CCalendarType::Edit(array(
61 'NEW' => $bNew,
62 'arFields' => array(
63 'XML_ID' => $xmlId,
64 'NAME' => $name,
65 'DESCRIPTION' => trim($_POST['type_desc'])
66 )
67 ));
68
69 if ($XML_ID)
70 {
71 $arTypes_ = CCalendarType::GetList(array('arFilter' => array('XML_ID' => $XML_ID)));
72 if ($arTypes_[0])
73 OutputTypeHtml($arTypes_[0]);
74 }
75 }
76 }
77 die();
78}
79
80if($_SERVER['REQUEST_METHOD']=="POST" && $Update.$Apply.$RestoreDefaults <> '' && check_bitrix_sessid())
81{
83 {
84 COption::RemoveOption("calendar");
85 }
86 else
87 {
88 // Save permissions for calendar types
89 foreach($_POST['cal_type_perm'] as $xml_id => $perm)
90 {
91 // Save type permissions
93 'NEW' => false,
94 'arFields' => array(
95 'XML_ID' => $xml_id,
96 'ACCESS' => $perm
97 )
98 ));
99 }
100
101 $SET = array(
102 'work_time_start' => $_REQUEST['work_time_start'],
103 'work_time_end' => $_REQUEST['work_time_end'],
104 'year_holidays' => $_REQUEST['year_holidays'],
105 'year_workdays' => $_REQUEST['year_workdays'],
106 'week_holidays' => is_array($_REQUEST['week_holidays']) ? implode('|',$_REQUEST['week_holidays']) : '',
107 //'week_start' => $_REQUEST['week_start'],
108 'user_name_template' => $_REQUEST['user_name_template'],
109 'sync_by_push' => isset($_REQUEST['sync_by_push']),
110 'user_show_login' => isset($_REQUEST['user_show_login']),
111 'path_to_user' => $_REQUEST['path_to_user'],
112 'path_to_user_calendar' => $_REQUEST['path_to_user_calendar'],
113 'path_to_group' => $_REQUEST['path_to_group'],
114 'path_to_group_calendar' => $_REQUEST['path_to_group_calendar'],
115 'path_to_vr' => $_REQUEST['path_to_vr'],
116 'path_to_rm' => $_REQUEST['path_to_rm'],
117 'denied_superpose_types' => array(),
118 'pathes_for_sites' => isset($_REQUEST['pathes_for_sites']),
119 'pathes' => $_REQUEST['pathes'],
120 'dep_manager_sub' => isset($_REQUEST['dep_manager_sub']),
121 'forum_id' => intval($_REQUEST['calendar_forum_id']),
122
123 'rm_iblock_type' => $_REQUEST['rm_iblock_type'],
124 'rm_iblock_id' => $_REQUEST['rm_iblock_id'],
125 'rm_for_sites' => isset($_REQUEST['reserve_meetings_for_sites']) || count($sites) <= 1,
126 'rm_iblock_ids' => $_REQUEST['rm_iblock_ids']
127 );
128
129 foreach($arTypes as $type)
130 {
131 $pathType = 'path_to_type_'.$type['XML_ID'];
132 if (isset($_REQUEST[$pathType]))
133 {
134 $SET[$pathType] = $_REQUEST[$pathType];
135 }
136 }
137
138 foreach($arTypes as $type)
139 {
140 if (
141 isset($_REQUEST['denied_superpose_types'])
142 && is_array($_REQUEST['denied_superpose_types'])
143 && !in_array($type['XML_ID'], $_REQUEST['denied_superpose_types'])
144 )
145 {
146 $SET['denied_superpose_types'][] = $type['XML_ID'];
147 }
148 }
149
150 $CUR_SET = CCalendar::GetSettings(array('getDefaultForEmpty' => false));
151 foreach($CUR_SET as $key => $value)
152 {
153 if (!isset($SET[$key]) && isset($value))
154 $SET[$key] = $value;
155 }
156
158 }
159
160 if($Update <> '' && $_REQUEST["back_url_settings"] <> '')
161 LocalRedirect($_REQUEST["back_url_settings"]);
162 else
163 LocalRedirect($APPLICATION->GetCurPage()."?mid=".urlencode($mid)."&lang=".urlencode(LANGUAGE_ID)."&back_url_settings=".urlencode($_REQUEST["back_url_settings"])."&".$tabControl->ActiveTabParam());
164}
165
169while ($arIBType = $dbIBlockType->Fetch())
170{
171 if ($arIBTypeData = CIBlockType::GetByIDLang($arIBType["ID"], LANG))
172 {
173 $arIB[$arIBType['ID']] = array();
174 $arIBTypes[$arIBType['ID']] = '['.$arIBType['ID'].'] '.$arIBTypeData['NAME'];
175 }
176}
177
178$dbIBlock = CIBlock::GetList(array('SORT' => 'ASC'), array('ACTIVE' => 'Y'));
179while ($arIBlock = $dbIBlock->Fetch())
180{
181 $arIB[$arIBlock['IBLOCK_TYPE_ID']][$arIBlock['ID']] = ($arIBlock['CODE'] ? '['.$arIBlock['CODE'].'] ' : '').$arIBlock['NAME'];
182}
183
184$SET = CCalendar::GetSettings(array('getDefaultForEmpty' => false, 'site' => false));
185
186$tabControl->Begin();
187?>
188<form method="post" name="cal_opt_form" action="<?= $APPLICATION->GetCurPage()?>?mid=<?= urlencode($mid)?>&amp;lang=<?= LANGUAGE_ID?>">
189<?= bitrix_sessid_post();?>
190<?
191$arDays = Array('MO', 'TU', 'WE', 'TH', 'FR', 'SA', 'SU');
192
194for ($i = 0; $i < 24; $i++)
195{
196 $arWorTimeList[strval($i)] = CCalendar::FormatTime($i, 0);
197 $arWorTimeList[strval($i).'.30'] = CCalendar::FormatTime($i, 30);
198}
199$tabControl->BeginNextTab();
200?>
201 <tr>
202 <td><label for="cal_work_time"><?= GetMessage("CAL_WORK_TIME")?>:</label></td>
203 <td>
204 <select id="cal_work_time" name="work_time_start">
205 <?foreach($arWorTimeList as $key => $val):?>
206 <option value="<?= $key?>" <? if ($SET['work_time_start'] == $key){echo ' selected="selected" ';}?>><?= $val?></option>
208 </select>
209 &mdash;
210 <select id="cal_work_time" name="work_time_end">
211 <?foreach($arWorTimeList as $key => $val):?>
212 <option value="<?= $key?>" <? if ($SET['work_time_end'] == $key){echo ' selected="selected" ';}?>><?= $val?></option>
213 <?endforeach;?>
214 </select>
215 </td>
216 </tr>
217
218 <tr>
219 <td style="vertical-align: top;"><label for="cal_week_holidays"><?= GetMessage("CAL_WEEK_HOLIDAYS")?>:</label></td>
220 <td>
221 <select size="7" multiple=true id="cal_week_holidays" name="week_holidays[]">
222 <?foreach($arDays as $day):?>
223 <option value="<?= $day?>" <?if (in_array($day, $SET['week_holidays'])){echo ' selected="selected"';}?>><?= GetMessage('CAL_OPTION_FIRSTDAY_'.$day)?></option>
224 <?endforeach;?>
225 </select>
226 </td>
227 </tr>
228 <? /*
229 <tr>
230 <td><label for="cal_week_start"><?= GetMessage("CAL_OPTION_FIRSTDAY")?>:</label></td>
231 <td>
232 <select id="cal_week_start" name="week_start">
233 <?foreach($arDays as $day):?>
234 <option value="<?= $day?>" <? if ($SET['week_start'] == $day){echo ' selected="selected" ';}?>><?= GetMessage('CAL_OPTION_FIRSTDAY_'.$day)?></option>
235 <?endforeach;?>
236 </select>
237 </td>
238 </tr>
239 */
240 ?>
241 <tr>
242 <td><label for="cal_year_holidays"><?= GetMessage("CAL_YEAR_HOLIDAYS")?>:</label></td>
243 <td>
244 <input name="year_holidays" type="text" value="<?= htmlspecialcharsbx($SET['year_holidays'])?>" id="cal_year_holidays" size="60"/>
245 </td>
246 </tr>
247 <tr>
248 <td><label for="cal_year_workdays"><?= GetMessage("CAL_YEAR_WORKDAYS")?>:</label></td>
249 <td>
250 <input name="year_workdays" type="text" value="<?= htmlspecialcharsbx($SET['year_workdays'])?>" id="cal_year_workdays" size="60"/>
251 </td>
252 </tr>
253 <?if (CCalendar::IsIntranetEnabled()):?>
254 <tr>
255 <td><label for="cal_user_name_template"><?= GetMessage("CAL_USER_NAME_TEMPLATE")?>:</label></td>
256 <td>
257 <input name="user_name_template" type="text" value="<?= htmlspecialcharsbx($SET['user_name_template'])?>" id="cal_user_name_template" size="60" />
258 </td>
259 </tr>
260 <tr>
261 <td><input name="sync_by_push" type="checkbox" value="Y" id="cal_sync_by_push" <?if($SET['sync_by_push']){echo'checked';}?>/></td>
262 <td>
263 <label for="cal_sync_by_push"><?= GetMessage("CAL_SYNC_PUSH_ENABLE")?></label>
264 </td>
265 </tr>
266 <tr>
267 <td><input name="user_show_login" type="checkbox" value="Y" id="cal_user_show_login" <?if($SET['user_show_login']){echo'checked';}?>/></td>
268 <td>
269 <label for="cal_user_show_login"><?= GetMessage("CAL_USER_SHOW_LOGIN")?></label>
270 </td>
271 </tr>
272 <tr title="<?= GetMessage('CAL_DEP_MANAGER_SUB_TITLE')?>">
273 <td><input name="dep_manager_sub" type="checkbox" value="Y" id="cal_dep_manager_sub" <?if($SET['dep_manager_sub']){echo'checked';}?>/></td>
274 <td>
275 <label for="cal_dep_manager_sub"><?= GetMessage("CAL_DEP_MANAGER_SUB")?></label>
276 </td>
277 </tr>
278 <tr>
279 <td style="vertical-align: top;"><label for="denied_superpose_types"><?= GetMessage("CAL_SP_TYPES")?>:</label></td>
280 <td>
281 <select size="3" multiple=true id="denied_superpose_types" name="denied_superpose_types[]">
282 <?foreach($arTypes as $type):?>
283 <option value="<?= $type["XML_ID"]?>" <?if (!in_array($type["XML_ID"], $SET['denied_superpose_types'])){echo ' selected="selected"';}?>><?= htmlspecialcharsex($type["NAME"])?></option>
284 <?endforeach;?>
285 </select>
286 </td>
287 </tr>
288
289 <!-- Path parameters title -->
290 <tr class="heading"><td colSpan="2"><?= GetMessage('CAL_PATH_TITLE')?></td></tr>
291
292 <?
293 $arPathes = CCalendar::GetPathesList();
294 $commonForSites = $SET['pathes_for_sites'];
295 if (count($sites) > 1):?>
296 <tr>
297 <td>
298 <input name="pathes_for_sites" type="checkbox" id="cal_pathes_for_sites" <?if($commonForSites){echo 'checked=true';}?> value="Y" /></td>
299 <td>
300 <label for="cal_pathes_for_sites"><?= GetMessage("CAL_PATH_COMMON")?></label>
301<script>
302BX.ready(function(){
303 BX('cal_pathes_for_sites').onclick = function()
304 {
305 BX('bx-cal-opt-sites-pathes-tr').style.display = this.checked ? 'none' : '';
306 <?foreach($arPathes as $pathName):?>
307 BX('bx-cal-opt-path-<?= $pathName?>').style.display = this.checked ? '' : 'none';
308 <?endforeach;?>
309 };
310});
311</script>
312 </td>
313 </tr>
314 <tr id="bx-cal-opt-sites-pathes-tr" <?if($commonForSites){echo'style="display:none;"';}?>>
315 <td colSpan="2" align="center">
316 <?
318 foreach($sites as $siteId => $siteName)
319 $aSubTabs[] = array("DIV" => "opt_cal_path_".$siteId, "TAB" => $siteName, 'TITLE' => $siteName);
320
321 $innerTabControl = new CAdminViewTabControl("childTabControlUserCommonPath", $aSubTabs);
322 $innerTabControl->Begin();?>
323 <?foreach($sites as $siteId => $siteName):?>
324 <?$innerTabControl->BeginNextTab();?>
325 <table>
326 <?
327 foreach($arPathes as $pathName)
328 {
329 $val = $SET['pathes'][$siteId][$pathName] ?? null;
330 if (!isset($val) || empty($val))
331 $val = $SET[$pathName];
332
333 $title = GetMessage("CAL_".mb_strtoupper($pathName));
334 if($title == '' && mb_substr($pathName, 0, mb_strlen('path_to_type_')) == 'path_to_type_')
335 {
336 $typeXmlId = mb_substr($pathName, mb_strlen('path_to_type_'));
337 foreach($arTypes as $type)
338 {
339 if ($type['XML_ID'] == $typeXmlId)
340 {
341 $title = GetMessage("CAL_PATH_TO_CAL_TYPE", array("#CALENDAR_TYPE#" => $type['NAME']));
342 break;
343 }
344 }
345 }
346 ?>
347 <tr>
348 <td class="field-name"><label for="cal_<?= $pathName?>"><?= htmlspecialcharsbx($title)?>:</label></td>
349 <td>
350 <input name="pathes[<?= $siteId?>][<?= $pathName?>]" type="text" value="<?= htmlspecialcharsbx($val)?>" id="cal_<?= $pathName?>" size="60"/>
351 </td>
352 </tr>
353 <?}?>
354 </table>
355 <?endforeach;?>
356 <?$innerTabControl->End();?>
357 </td>
358 </tr>
359 <?endif; /* if (count($sites) > 1)*/?>
360
361 <?
362 /* common pathes for all sites*/
363 if (count($sites) <= 1)
364 $commonForSites = true;
365
366 foreach($arPathes as $pathName)
367 {
368 $title = GetMessage("CAL_".mb_strtoupper($pathName));
369 if($title == '' && mb_substr($pathName, 0, mb_strlen('path_to_type_')) == 'path_to_type_')
370 {
371 $typeXmlId = mb_substr($pathName, mb_strlen('path_to_type_'));
372 foreach($arTypes as $type)
373 {
374 if ($type['XML_ID'] == $typeXmlId)
375 {
376 $title = GetMessage("CAL_PATH_TO_CAL_TYPE", array("#CALENDAR_TYPE#" => $type['NAME']));
377 break;
378 }
379 }
380 }
381
382 ?>
383 <tr id="bx-cal-opt-path-<?= $pathName?>" <?if(!$commonForSites){echo'style="display:none;"';}?>>
384 <td><label for="cal_<?=$pathName?>"><?= htmlspecialcharsbx($title)?>:</label></td>
385 <td>
386 <input name="<?= $pathName?>" type="text" value="<?= htmlspecialcharsbx($SET[$pathName])?>" id="cal_<?= $pathName?>" size="60"/>
387 </td>
388 </tr>
389 <?}?>
390
391 <!-- Reserve meetings and video reserve meetings -->
392 <?
393 $reserveMeetingForSites = $SET['rm_for_sites'];
394 if (count($sites) <= 1)
396 ?>
397 <tr class="heading"><td colSpan="2"><?= GetMessage('CAL_RESERVE_MEETING')?></td></tr>
398 <tr>
399 <td><label for="cal_rm_iblock_type"><?= GetMessage("CAL_RM_IBLOCK_TYPE")?>:</label></td>
400 <td>
401 <select name="rm_iblock_type" onchange="changeIblockList(this.value)">
402 <option value=""><?= GetMessage('CAL_NOT_SET')?></option>
403 <?foreach ($arIBTypes as $ibtype_id => $ibtype_name):?>
404 <option value="<?= $ibtype_id?>" <?if($ibtype_id == $SET['rm_iblock_type']){echo ' selected="selected"';}?>><?= htmlspecialcharsbx($ibtype_name)?></option>
405 <?endforeach;?>
406 </select>
407 </td>
408 </tr>
409
410 <?if (count($sites) > 1):?>
411 <tr>
412 <td>
413 <input name="reserve_meetings_for_sites" type="checkbox" id="cal_reserve_meetings_for_sites" value="Y" <?if($reserveMeetingForSites){echo 'checked';}?>>
414 </td>
415 <td>
416 <label for="cal_reserve_meetings_for_sites"><?= GetMessage("CAL_PATH_COMMON")?></label>
417 <script>
418 BX.ready(function(){
419 BX('cal_reserve_meetings_for_sites').onclick = function()
420 {
421 BX('bx-cal-opt-sites-rm-tr').style.display = this.checked ? 'none' : '';
422 BX('bx-cal-opt-common-rm-tr').style.display = this.checked ? '' : 'none';
423 };
424 });
425 </script>
426 </td>
427 </tr>
428
429 <tr id="bx-cal-opt-sites-rm-tr" <?if($reserveMeetingForSites){echo'style="display:none;"';}?>>
430 <td colSpan="2" align="center">
431 <?
432 $aSubTabs = array();
433 foreach($sites as $siteId => $siteName)
434 $aSubTabs[] = array("DIV" => "opt_cal_rm_".$siteId, "TAB" => $siteName, 'TITLE' => $siteName);
435
436 $innerTabControl = new CAdminViewTabControl("childTabControlUserCommon", $aSubTabs);
437 $innerTabControl->Begin();?>
438
439 <?foreach($sites as $siteId => $siteName):?>
440 <?$innerTabControl->BeginNextTab();?>
441 <table>
442 <tr>
443 <td class="field-name"><label for="cal_rm_iblock_id_<?= $siteId?>"><?= GetMessage("CAL_RM_IBLOCK_ID")?>:</label></td>
444 <td>
445 <select id="cal_rm_iblock_id_<?= $siteId?>" name="rm_iblock_ids[<?= $siteId?>]">
446 <?if ($SET['rm_iblock_type']):?>
447 <option value=""><?= GetMessage('CAL_NOT_SET')?></option>
448 <?foreach ($arIB[$SET['rm_iblock_type']] as $iblock_id => $iblock):
449 $valueForSite = COption::GetOptionString('calendar', 'rm_iblock_id', "", $siteId, true);?>
450 <option value="<?= $iblock_id?>"<? if($iblock_id == $valueForSite){echo ' selected="selected"';}?>><?= htmlspecialcharsbx($iblock)?></option>
451 <?endforeach;?>
452 <?else:?>
453 <option value=""><?= GetMessage('CAL_NOT_SET')?></option>
454 <?endif;?>
455 </select>
456 </td>
457 </tr>
458 </table>
459
460 <?endforeach;?>
461 <?$innerTabControl->End();?>
462 </td>
463 </tr>
464 <?endif; /* if (count($sites) > 1)*/?>
465
466 <tr id="bx-cal-opt-common-rm-tr" <?if(!$reserveMeetingForSites) {echo'style="display:none;"';}?>>
467 <td><label for="cal_rm_iblock_id"><?= GetMessage("CAL_RM_IBLOCK_ID")?>:</label></td>
468 <td>
469 <select id="cal_rm_iblock_id" name="rm_iblock_id">
470<?if ($SET['rm_iblock_type']):?>
471 <option value=""><?= GetMessage('CAL_NOT_SET')?></option>
472 <?foreach ($arIB[$SET['rm_iblock_type']] as $iblock_id => $iblock):?>
473 <option value="<?= $iblock_id?>"<? if($iblock_id == $SET['rm_iblock_id']){echo ' selected="selected"';}?>><?= htmlspecialcharsbx($iblock)?></option>
474 <?endforeach;?>
475<?else:?>
476 <option value=""><?= GetMessage('CAL_NOT_SET')?></option>
477<?endif;?>
478
479 </select>
480 </td>
481 </tr>
482
483 <?endif?>
484
485
486 <!-- Comments settings -->
487 <tr class="heading"><td colSpan="2"><?= GetMessage('CAL_COMMENTS_SETTINGS')?></td></tr>
488 <tr>
489 <td align="right"><?= GetMessage("CAL_COMMENTS_FORUM")?>:</td>
490 <td>
491 <select name="calendar_forum_id">
492 <option value="0">&nbsp;</option>
493 <?foreach ($arForums as $key => $value):?>
494 <option value="<?= $key ?>"<?= $SET['forum_id'] == $key ? " selected" : "" ?>><?= $value?></option>
495 <? endforeach?>
496 </select>
497 </td>
498 </tr>
499 <!-- END Comments settings -->
500
501<?$tabControl->BeginNextTab();?>
502 <tr class="">
503 <td colspan="2" style="text-align: left;">
504 <a class="bxco-add-type" href="javascript:void(0);" onclick="addType(); return false;" title="<?= GetMessage('CAL_ADD_TYPE_TITLE')?>"><i></i><span><?= GetMessage('CAL_ADD_TYPE')?></span></a>
505 </td>
506 </tr>
507 <tr><td colspan="2" align="center">
508<?
509$APPLICATION->SetAdditionalCSS("/bitrix/js/calendar/cal-style.css");
510$GLOBALS['APPLICATION']->AddHeadScript("/bitrix/js/calendar/cal-controlls.js");
511?>
512 <table id="bxcal_type_tbl" style="width: 650px;">
513 <?
514 $actionUrl = '/bitrix/admin/settings.php?mid=calendar&lang='.LANG;
516 for ($i = 0, $l = count($arTypes); $i < $l; $i++):
517 $type = $arTypes[$i];
518 $arXML_ID[$type['XML_ID']] = true;
519 ?>
520 <tr><td>
521 <? OutputTypeHtml($type) ?>
522 </td></tr>
523 <?endfor;?>
524 </table>
525 </td></tr>
526
527<?$tabControl->BeginNextTab();?>
528
529<?$tabControl->Buttons();?>
530 <input type="submit" class="adm-btn-save" name="Update" value="<?=GetMessage("MAIN_SAVE")?>" title="<?=GetMessage("MAIN_OPT_SAVE_TITLE")?>" />
531 <input type="submit" name="Apply" value="<?=GetMessage("MAIN_APPLY")?>" title="<?=GetMessage("MAIN_OPT_APPLY_TITLE")?>">
532 <?if($_REQUEST["back_url_settings"] <> ''):?>
533 <input type="button" name="Cancel" value="<?=GetMessage("MAIN_OPT_CANCEL")?>" title="<?=GetMessage("MAIN_OPT_CANCEL_TITLE")?>" onclick="window.location='<?= htmlspecialcharsbx(CUtil::addslashes($_REQUEST["back_url_settings"]))?>'">
534 <input type="hidden" name="back_url_settings" value="<?=htmlspecialcharsbx($_REQUEST["back_url_settings"])?>">
535 <?endif?>
536 <input type="submit" name="RestoreDefaults" title="<?echo GetMessage("MAIN_HINT_RESTORE_DEFAULTS")?>" onclick="return confirm('<?echo AddSlashes(GetMessage("MAIN_HINT_RESTORE_DEFAULTS_WARNING"))?>')" value="<?echo GetMessage("CAL_RESTORE_DEFAULTS")?>">
537<?$tabControl->End();?>
538</form>
539
540<div id="edit_type_dialog" class="bxco-popup">
541<form method="POST" name="caltype_dialog_form" id="caltype_dialog_form" action="<?= $APPLICATION->GetCurPage()?>?mid=<?= urlencode($mid)?>&amp;lang=<?=LANGUAGE_ID?>&amp;save_type=Y" ENCTYPE="multipart/form-data">
542 <?=bitrix_sessid_post()?>
543 <input type="hidden" name="type_new" id="type_new_inp" value="Y" size="32" />
544 <table border="0" cellSpacing="0" class="bxco-popup-tbl">
545 <tr>
546 <td class="bxco-2-right">
547 <label for="type_name_inp"><b><?= GetMessage('CAL_TYPE_NAME')?></b>:</label>
548 </td>
549 <td><input type="text" name="type_name" id="type_name_inp" value="" size="32" /></td>
550 </tr>
551 <tr>
552 <td class="bxco-2-right">
553 <label for="type_xml_id_inp"><b><?= GetMessage('CAL_TYPE_XML_ID')?></b>:</label>
554 <br>
555 <span class="bxco-lbl-note"><?= GetMessage('CAL_ONLY_LATIN')?></span>
556 </td>
557 <td>
558 <input type="hidden" name="type_xml_id_hidden" id="type_xml_id_hidden_inp" value="" size="32" />
559 <input type="text" name="type_xml_id" id="type_xml_id_inp" value="" size="32" />
560 </td>
561 </tr>
562 <tr>
563 <td class="bxco-2-right"><label for="type_desc_inp"><?= GetMessage('CAL_TYPE_DESCRIPTION')?>:</label></td>
564 <td><textarea name="type_desc" id="type_desc_inp" rows="3" cols="30" style="resize:none;"></textarea></td>
565 </tr>
566 </table>
567</form>
568</div>
569
570<script>
571
572var arIblocks = <?= CUtil::PhpToJsObject($arIB)?>;
573function changeIblockList(value, index)
574{
575 if (null == index)
576 index = 0;
577
578 var
579 i, j,
580 arControls = [
581 BX('cal_rm_iblock_id'),
582 BX('cal_vr_iblock_id')
583 ];
584
585 for (i = 0; i < arControls.length; i++)
586 {
587 if (arControls[i])
588 arControls[i].options.length = 0;
589
590 arControls[i].options[0] = new Option('<?= GetMessage('CAL_NOT_SET')?>', '');
591
592 for (j in arIblocks[value])
593 arControls[i].options[arControls[i].options.length] = new Option(arIblocks[value][j], j);
594 }
595}
596
597function addType(oType)
598{
599 if (!window.BXCEditType)
600 {
601 window.arXML_ID = <?= CUtil::PhpToJsObject($arXML_ID)?>;
602 window.BXCEditType = new BX.PopupWindow("BXCEditType", null, {
603 autoHide: true,
604 zIndex: 0,
605 offsetLeft: 0,
606 offsetTop: 0,
607 draggable: true,
608 bindOnResize: false,
609 closeByEsc : true,
610 titleBar: '<?= GetMessage("CAL_EDIT_TYPE_DIALOG")?>',
611 closeIcon: { right : "12px", top : "10px"},
612 className: 'bxc-popup-window',
613 buttons: [
614 new BX.PopupWindowButton({
615 text: '<?= GetMessage("MAIN_SAVE")?>',
616 className: "popup-window-button-accept",
617 events: {click : function()
618 {
619 // Check form
620 // Check name
621 if (BX.util.trim(BX('type_name_inp').value) == '')
622 {
623 alert('<?= GetMessage('CAL_TYPE_NAME_WARN')?>');
624 BX.focus(BX('type_xml_id_inp'));
625 return;
626 }
627
628 // Check xml_id
629 var bNew = BX('type_new_inp').value == 'Y', xmlId;
630 if (bNew)
631 {
632 xmlId = BX.util.trim(BX('type_xml_id_inp').value);
633 if (xmlId == '' || window.arXML_ID[xmlId] || xmlId.replace(new RegExp('[^a-z0-9_\-]', 'ig'), "") != xmlId)
634 {
635 alert('<?= GetMessage('CAL_TYPE_XML_ID_WARN')?>');
636 BX.focus(BX('type_xml_id_inp'));
637 return;
638 }
639 }
640 else
641 {
642 xmlId = BX.util.trim(BX('type_xml_id_hidden_inp').value);
643 }
644
645 // Post
646 BX.ajax.submit(BX('caltype_dialog_form'), function(result)
647 {
648 window.arXML_ID[xmlId] = true;
649 if (bNew)
650 {
651 BX('bxcal_type_tbl').insertRow(-1).insertCell(-1).innerHTML = result;
652 }
653 else
654 {
655 var pCont = BX('type-cont-' + xmlId);
656 if (pCont && pCont.parentNode)
657 pCont.parentNode.innerHTML = result;
658 }
659 });
660 window.BXCEditType.close();
661 }}
662 }),
663 new BX.PopupWindowButtonLink({
664 text: '<?= GetMessage("CAL_CLOSE")?>',
665 className: "popup-window-button-link-cancel",
666 events: {click : function(){window.BXCEditType.close();}}
667 })
668 ],
669 content: BX('edit_type_dialog')
670 });
671 }
672
673 var bNew = !oType;
674 BX('type_new_inp').value = bNew ? 'Y' : 'N';
675 BX('type_name_inp').value = bNew ? '' : oType.NAME;
676 BX('type_desc_inp').value = bNew ? '' : oType.DESCRIPTION;
677 BX('type_xml_id_inp').value = bNew ? '' : oType.XML_ID;
678 BX('type_xml_id_hidden_inp').value = bNew ? '' : oType.XML_ID;
679 BX('type_xml_id_inp').disabled = !bNew;
680 window.BXCEditType.show();
681}
682
683function delType(xml_id)
684{
685 if (confirm('<?= GetMessage('CAL_DELETE_CONFIRM')?>'))
686 {
687 BX.ajax.post('<?= $APPLICATION->GetCurPage()?>?mid=<?= urlencode($mid)?>&lang=<?=LANGUAGE_ID?>&save_type=Y&del_type=Y&type_xml_id=' + xml_id, {sessid: BX.bitrix_sessid()}, function()
688 {
689 var pCont = BX('type-cont-' + xml_id);
690 if (pCont && pCont.parentNode)
691 BX.cleanNode(pCont.parentNode, true);
692 });
693 }
694}
695</script>
696
697<?
699{
700 $XML_ID = preg_replace("/[^a-zA-Z0-9_]/i", "", $type['XML_ID']);
701 CCalendarSceleton::GetAccessHTML('calendar_type', 'bxec-calendar-type-'.$XML_ID);
702?>
703 <div class="bxcopt-type-cont" id="type-cont-<?= $XML_ID?>"">
704 <div class="bxcopt-type-cont-title">
705 <span class="bxcopt-type-title-label"><?= htmlspecialcharsbx($type['NAME'])?> [<?= $XML_ID?>]</span>
706 <a href="javascript:void(0);" onclick="delType('<?= $XML_ID?>'); return false;"><?= GetMessage('CAL_DELETE')?></a>
707 <a href="javascript:void(0);" onclick="addType(<?= htmlspecialcharsbx(CUtil::PhpToJsObject($type))?>); return false;"><?= GetMessage('CAL_CHANGE')?></a>
708 </div>
709 <? if($type['DESCRIPTION'] <> ''):?>
710 <span class="bxcopt-type-desc"><?= htmlspecialcharsbx($type['DESCRIPTION'])?></span>
711 <? endif;?>
712 <div class="bxcopt-type-access-cont">
713 <span class="bxcopt-type-access-cont-title"><?= GetMessage('CAL_TYPE_PERMISSION_ACCESS')?>:</span>
714 <div class="bxcopt-type-access-values-cont" id="type-access-values-cont<?= $XML_ID?>"></div>
715 <a class="bxcopt-add-access-link" href="javascript:void(0);" id="type-access-link<?= $XML_ID?>"><?= GetMessage('CAL_ADD_ACCESS')?></a>
716 </div>
717<script>
718BX = top.BX;
719BX.ready(function()
720{
721 setTimeout(function(){
722 top.accessNames = {};
723 var code, arNames = <?= CUtil::PhpToJsObject(CCalendar::GetAccessNames())?>;
724 for (code in arNames)
725 top.accessNames[code] = arNames[code];
726
727 top.BXCalAccess<?= $XML_ID?> = new top.ECCalendarAccess({
728 bind: 'calendar-type-<?= $XML_ID?>',
729 GetAccessName: function(code){return top.accessNames[code] || code;},
730 inputName: 'cal_type_perm[<?= $XML_ID?>]',
731 pCont: BX('type-access-values-cont<?= $XML_ID?>'),
732 pLink: BX('type-access-link<?= $XML_ID?>'),
733 delTitle: '<?= GetMessage("CAL_DELETE")?>',
734 noAccessRights: '<?= GetMessage("CAL_NOT_SET")?>'
735 });
736 top.BXCalAccess<?= $XML_ID?>.SetSelected(<?= CUtil::PhpToJsObject($type['ACCESS'])?>);
737 }, 100);
738});
739</script>
740 </div>
741
742<?
743}
744
745?>
return select
Определения access_edit.php:440
$type
Определения options.php:106
$dbSites
Определения options.php:14
$aSubTabs
Определения options.php:16
const BX_ROOT
Определения bx_root.php:3
$default_site
Определения options.php:26
$arDays
Определения options.php:191
OutputTypeHtml($type)
Определения options.php:698
$arTypes
Определения options.php:23
foreach($arPathes as $pathName) $reserveMeetingForSites
Определения options.php:393
$arPathes
Определения options.php:293
while($arIBlock=$dbIBlock->Fetch()) $SET
Определения options.php:184
$arIBTypes
Определения options.php:167
$commonForSites
Определения options.php:294
while($arIBType=$dbIBlockType->Fetch()) $dbIBlock
Определения options.php:178
$arWorTimeList
Определения options.php:193
$arXML_ID
Определения options.php:515
$arIB
Определения options.php:168
while($arRes=$dbSites->GetNext()) $arForums
Определения options.php:34
if(CModule::IncludeModule("forum")) if( $_SERVER $dbIBlockType[ 'REQUEST_METHOD']=="POST" &&isset( $_REQUEST[ 'save_type']) &&$_REQUEST[ 'save_type']=='Y' &&check_bitrix_sessid()) if($_SERVER['REQUEST_METHOD']=="POST" && $Update. $Apply. $RestoreDefaults<> '' &&check_bitrix_sessid())
Определения options.php:166
$innerTabControl
Определения options.php:321
$actionUrl
Определения options.php:514
global $APPLICATION
Определения include.php:80
change_password_forgot_link login popup forget pas AUTH_GOTO_FORGOT_FORM login btn wrap change_password_button login popup link login popup return auth javascript
Определения change_password.php:57
static GetListEx($arOrder=Array("SORT"=>"ASC"), $arFilter=Array(), $bCount=false, $iNum=0, $arAddParams=array())
Определения forum_new.php:936
static GetOptionString($module_id, $name, $def="", $site=false, $bExactSite=false)
Определения option.php:8
static RemoveOption($module_id, $name="", $site=false)
Определения option.php:35
static GetSettings($params=[])
Определения calendar.php:4717
static SetSettings($settings=[], $clearOptions=false)
Определения calendar.php:1308
static GetAccessHTML($binging='calendar_section', $id=false)
Определения calendar_sceleton.php:166
static Edit($params)
Определения calendar_type.php:205
static Delete($XML_ID)
Определения calendar_type.php:266
static GetList($params=[])
Определения calendar_type.php:22
static GetList($arOrder=array("SORT"=> "ASC"), $arFilter=array())
Определения iblocktype.php:53
static GetByIDLang($ID, $LID, $bFindAny=true)
Определения iblocktype.php:274
static IncludeModule($module_name)
Определения module.php:151
$sites
Определения clear_component_cache.php:15
& nbsp
Определения epilog_main_admin.php:38
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
bx_acc_lim_group_list limitGroupList[] multiple<?=$group[ 'ID']?> ID selected margin top
Определения file_new.php:657
<?endfor;?> addType()
Определения options.php:1663
$perm
Определения options.php:169
$_REQUEST["admin_mnu_menu_id"]
Определения get_menu.php:8
if(! $catalogEdit->isSuccess()) $iblock
Определения iblock_catalog_edit.php:38
$Update
Определения options.php:212
$RestoreDefaults
Определения options.php:55
$_SERVER["DOCUMENT_ROOT"]
Определения cron_frame.php:9
global $USER
Определения csv_new_run.php:40
$tabControl
Определения csv_new_setup.php:244
$aTabs
Определения csv_new_setup.php:238
endif
Определения csv_new_setup.php:990
$l
Определения options.php:783
$mid
Определения options.php:27
$siteId
Определения ajax.php:8
bitrix_sessid_post($varname='sessid', $returnInvocations=false)
Определения tools.php:4700
check_bitrix_sessid($varname='sessid')
Определения tools.php:4686
htmlspecialcharsbx($string, $flags=ENT_COMPAT, $doubleEncode=true)
Определения tools.php:2701
IncludeModuleLangFile($filepath, $lang=false, $bReturnArray=false)
Определения tools.php:3778
GetMessage($name, $aReplace=null)
Определения tools.php:3397
LocalRedirect($url, $skip_security_check=false, $status="302 Found")
Определения tools.php:4005
$name
Определения menu_edit.php:35
$value
Определения Param.php:39
global_menu_<?echo $menu["menu_id"]?> adm main menu item icon adm main menu item text text adm main menu hover adm submenu menucontainer menu_id menu_id items_id items_id desktop menu_id block none adm global submenu<?=($subMenuDisplay=="block" ? " adm-global-submenu-active" :"")?> global_submenu_<?echo $menu["menu_id"]?> text MAIN_PR_ADMIN_FAV items adm submenu items wrap adm submenu items stretch wrap BX adminMenu itemsStretchScroll()"> <table class if (!empty( $menu["items"])) elseif ( $menu[ 'menu_id']=='desktop') if ( $menu[ 'menu_id']=='desktop') endforeach
Определения prolog_main_admin.php:255
<? endif;?> window document title
Определения prolog_main_admin.php:76
$ar
Определения options.php:199
if(empty($signedUserToken)) $key
Определения quickway.php:257
die
Определения quickway.php:367
$i
Определения factura.php:643
font style
Определения invoice.php:442
font size
Определения invoice.php:442
</p ></td >< td valign=top style='border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;padding:0cm 2.0pt 0cm 2.0pt;height:9.0pt'>< p class=Normal align=center style='margin:0cm;margin-bottom:.0001pt;text-align:center;line-height:normal'>< a name=ТекстовоеПоле54 ></a ><?=($taxRate > count( $arTaxList) > 0) ? $taxRate."%"
Определения waybill.php:936
endfor
Определения template.php:569
text align
Определения template.php:556
$title
Определения pdf.php:123
$val
Определения options.php:1793
margin right
Определения options_user_settings.php:273
$arRes
Определения options.php:104
$GLOBALS['_____370096793']
Определения update_client.php:1
$arIBlock['PROPERTY']
Определения yandex_detail.php:172