1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
options.php
См. документацию.
1<?php
2
4
5$module_id = "bizproc";
6$bizprocPerms = $APPLICATION::GetGroupRight($module_id);
7if ($bizprocPerms >= "R") :
8
9 CModule::IncludeModule("bizproc");
10
11 IncludeModuleLangFile($_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/options.php");
12 IncludeModuleLangFile(__FILE__);
13
14 $dbSites = CSite::GetList("", "", ["ACTIVE" => "Y"]);
17 while ($site = $dbSites->Fetch())
18 {
19 $site["ID"] = htmlspecialcharsbx($site["ID"]);
20 $site["NAME"] = htmlspecialcharsbx($site["NAME"]);
21 $arSites[] = $site;
22
23 $aSubTabs[] = ["DIV" => "opt_site_" . $site["ID"], "TAB" => "(" . $site["ID"] . ") " . $site["NAME"], 'TITLE' => ''];
24 }
26
27 if ($_SERVER['REQUEST_METHOD'] === "GET" && !empty($RestoreDefaults) && $bizprocPerms === "W" && check_bitrix_sessid())
28 {
29 COption::RemoveOption("bizproc");
30 }
31
34 ["log_cleanup_days", GetMessage("BIZPROC_LOG_CLEANUP_DAYS"), "90", ["text", 3]],
35 ["search_cleanup_days", GetMessage("BIZPROC_SEARCH_CLEANUP_DAYS"), "180", ["text", 3]],
36 ["log_skip_types", GetMessage("BIZPROC_LOG_SKIP_TYPES"), "1,2", ["checkboxlist", [
37 1 => GetMessage("BIZPROC_LOG_SKIP_TYPES_1_1"),
38 2 => GetMessage("BIZPROC_LOG_SKIP_TYPES_2_1"),
39 ]]],
40 ["automation_no_forced_tracking", GetMessage("BIZPROC_AUTOMATION_NO_FORCED_TRACKING"), "N", ["checkbox"]],
41 ["limit_simultaneous_processes", GetMessage("BIZPROC_LIMIT_SIMULTANEOUS_PROCESSES"), "", ["text", 3]],
42 ["employee_compatible_mode", GetMessage("BIZPROC_EMPLOYEE_COMPATIBLE_MODE"), "N", ["checkbox"]],
43 ["limit_while_iterations", GetMessage("BIZPROC_LIMIT_WHILE_ITERATIONS"), "1000", ["text", 5]],
44 ['enable_getdocument_select', GetMessage('BIZPROC_OPT_ENABLE_GETDOCUMENT_SELECT'), $defaultValue, ['checkbox']]
45 ];
46
48 if ($_SERVER['REQUEST_METHOD'] === "POST" && !empty($Update) && $bizprocPerms === "W" && check_bitrix_sessid())
49 {
50 COption::SetOptionString("bizproc", "log_cleanup_days", ($log_cleanup_days ?? 0));
51 if ($log_cleanup_days > 0)
52 {
53 CAgent::AddAgent("CBPTrackingService::ClearOldAgent();", "bizproc", "N", 86400);
54 }
55 else
56 {
57 CAgent::RemoveAgent("CBPTrackingService::ClearOldAgent();", "bizproc");
58 }
59
60 COption::SetOptionString("bizproc", "search_cleanup_days", ($search_cleanup_days ?? 0));
61 if ($search_cleanup_days > 0)
62 {
63 CAgent::AddAgent(\Bitrix\Bizproc\Worker\Workflow\ClearFilterAgent::getName(), "bizproc", "N", 86400);
64 CAgent::AddAgent(\Bitrix\Bizproc\Worker\Task\ClearSearchContentAgent::getName(), "bizproc", "N", 86400);
65 }
66 else
67 {
68 CAgent::RemoveAgent(\Bitrix\Bizproc\Worker\Workflow\ClearFilterAgent::getName(), "bizproc");
69 CAgent::RemoveAgent(\Bitrix\Bizproc\Worker\Task\ClearSearchContentAgent::getName(), "bizproc");
70 }
71
72 COption::SetOptionString("bizproc", "employee_compatible_mode", ($employee_compatible_mode ?? 'N') === "Y" ? "Y" : "N");
73 COption::SetOptionString("bizproc", "limit_simultaneous_processes", ($limit_simultaneous_processes ?? 0) ? $limit_simultaneous_processes : 0);
74 COption::SetOptionString("bizproc", "limit_while_iterations", ($limit_while_iterations ?? 1000));
75 COption::SetOptionString("bizproc", "log_skip_types", ($log_skip_types ?? '') ? implode(',', $log_skip_types) : "");
76 COption::SetOptionString("bizproc", "automation_no_forced_tracking", ($automation_no_forced_tracking ?? 'N') === "Y" ? "Y" : "N");
77 COption::SetOptionString('bizproc', 'enable_getdocument_select', ($enable_getdocument_select ?? 'N') === 'Y' ? 'Y' : 'N');
78
79 \Bitrix\Main\Config\Option::set("bizproc", "use_gzip_compression", $_REQUEST["use_gzip_compression"]);
80 \Bitrix\Main\Config\Option::set("bizproc", "locked_wi_path", $_REQUEST["locked_wi_path"]);
81
82 CBPSchedulerService::setDelayMinLimit($_REQUEST["delay_min_limit"], $_REQUEST['delay_min_limit_type']);
83
84 foreach ($arSites as $site)
85 {
86 if (isset($_POST["name_template_" . $site["LID"]]))
87 {
88 if (empty($_POST["name_template_" . $site["LID"]]))
89 COption::RemoveOption("bizproc", "name_template", $site["LID"]);
90 else
91 COption::SetOptionString("bizproc", "name_template", $_POST["name_template_" . $site["LID"]], false, $site["LID"]);
92 }
93 }
94 }
95
96 if ($strWarning <> '')
98
100 ["DIV" => "edit1", "TAB" => GetMessage("BIZPROC_TAB_SET"), "ICON" => "", "TITLE" => GetMessage("BIZPROC_TAB_SET_ALT")],
101 ];
102 $tabControl = new CAdminTabControl("tabControl", $aTabs);
103 $tabControl->Begin();
104 ?>
105 <form method="POST"
106 name="bizproc_opt_form"
107 action="<?= $APPLICATION->GetCurPage() ?>?mid=<?= htmlspecialcharsbx($mid ?? 'bizproc') ?>&lang=<?= LANGUAGE_ID ?>"
108 ENCTYPE="multipart/form-data"><?php
109 echo bitrix_sessid_post();
110 $tabControl->BeginNextTab();
111 ?>
112 <?php
113 for ($i = 0, $cnt = count($arAllOptions); $i < $cnt; $i++):
115 $val = COption::GetOptionString("bizproc", $Option[0], $Option[2]);
117 ?>
118 <tr>
119 <td width="50%" valign="top"><?php
120 if ($type[0] == "checkbox")
121 echo "<label for=\"" . htmlspecialcharsbx($Option[0]) . "\">" . $Option[1] . "</label>";
122 else
123 echo $Option[1];
124 ?>:
125 </td>
126 <td width="50%" valign="top">
127 <?php
128 if ($type[0] == "checkbox"):?>
129 <input type="checkbox" name="<?php
130 echo htmlspecialcharsbx($Option[0]) ?>" id="<?php
131 echo htmlspecialcharsbx($Option[0]) ?>" value="Y"<?php
132 if ($val == "Y")
133 echo " checked"; ?>>
134 <?php
135 elseif ($type[0] == "text"):?>
136 <input type="text" size="<?php
137 echo $type[1] ?>" value="<?php
138 echo htmlspecialcharsbx($val) ?>" name="<?php
139 echo htmlspecialcharsbx($Option[0]) ?>">
140 <?php
141 elseif ($type[0] == "textarea"):?>
142 <textarea rows="<?php
143 echo $type[1] ?>" cols="<?php
144 echo $type[2] ?>" name="<?php
145 echo htmlspecialcharsbx($Option[0]) ?>"><?php
146 echo htmlspecialcharsbx($val) ?></textarea>
147 <?php
148 elseif ($type[0] == "checkboxlist"):?>
149 <?php
150 $arVal = explode(',', $val);
151 ?>
152 <?php
153 foreach ($type[1] as $k => $v):?>
154 <input type="checkbox" name="<?php
155 echo htmlspecialcharsbx($Option[0]) ?>[]" id="<?php
156 echo htmlspecialcharsbx($Option[0] . '_' . $k) ?>" value="<?= $k ?>"<?php
157 if (in_array($k, $arVal))
158 echo " checked"; ?>>
159 <label for="<?= htmlspecialcharsbx($Option[0] . '_' . $k) ?>"><?php
160 echo htmlspecialcharsbx($v) ?></label><br>
161 <?php
162 endforeach; ?>
163 <?php
164 endif ?>
165 </td>
166 </tr>
167 <?php
169 <tr>
170 <td width="50%" valign="top"><?= GetMessage("BIZPROC_OPT_USE_GZIP_COMPRESSION") ?>:</td>
171 <td width="50%" valign="top">
172 <select name="use_gzip_compression">
173 <?php
174 $useGZipCompression = \Bitrix\Main\Config\Option::get("bizproc", "use_gzip_compression", ""); ?>
175 <option value="" <?php
176 if (empty($useGZipCompression))
177 echo "selected"; ?>><?= GetMessage("BIZPROC_OPT_USE_GZIP_COMPRESSION_EMPTY") ?></option>
178 <option value="Y" <?php
179 if ($useGZipCompression == "Y")
180 echo "selected"; ?>><?= GetMessage("BIZPROC_OPT_USE_GZIP_COMPRESSION_Y") ?></option>
181 <option value="N" <?php
182 if ($useGZipCompression == "N")
183 echo "selected"; ?>><?= GetMessage("BIZPROC_OPT_USE_GZIP_COMPRESSION_N") ?></option>
184 </select>
185 </td>
186 </tr>
187 <tr>
188 <td width="50%" valign="top"><?= GetMessage("BIZPROC_OPT_LOCKED_WI_PATH") ?>:</td>
189 <td width="50%" valign="top">
190 <?php
191 $path = \Bitrix\Main\Config\Option::get("bizproc", "locked_wi_path", "/bizproc/bizproc/?type=is_locked"); ?>
192 <input type="text" size="40" name="locked_wi_path" value="<?= htmlspecialcharsbx($path) ?>">
193 </td>
194 </tr>
195 <tr>
196 <td width="50%" valign="top"><?= GetMessage("BIZPROC_OPT_TIME_LIMIT") ?>:</td>
197 <td width="50%" valign="top">
198 <?php
199 [$delayTime, $delayType] = CBPSchedulerService::getDelayMinLimit(true);
200 ?>
201 <input type="text" name="delay_min_limit" value="<?= $delayTime ?>" size="5" />
202 <select name="delay_min_limit_type">
203 <option value="s"<?= ($delayType == "s") ? " selected" : "" ?>><?= GetMessage("BIZPROC_OPT_TIME_LIMIT_S") ?></option>
204 <option value="m"<?= ($delayType == "m") ? " selected" : "" ?>><?= GetMessage("BIZPROC_OPT_TIME_LIMIT_M") ?></option>
205 <option value="h"<?= ($delayType == "h") ? " selected" : "" ?>><?= GetMessage("BIZPROC_OPT_TIME_LIMIT_H") ?></option>
206 <option value="d"<?= ($delayType == "d") ? " selected" : "" ?>><?= GetMessage("BIZPROC_OPT_TIME_LIMIT_D") ?></option>
207 </select>
208 </td>
209 </tr>
210 <tr>
211 <td valign="top" colspan="2" align="center">
212 <?php
213 $subTabControl->Begin();
214 foreach ($arSites as $site)
215 {
216 $subTabControl->BeginNextTab();
217 $curVal = COption::GetOptionString("bizproc", "name_template", "", $site["LID"]);
218 ?>
219 <label><?= GetMessage("BIZPROC_NAME_TEMPLATE") ?></label>:
220 <select name="name_template_<?php
221 echo $site["LID"] ?>">
222 <?php
223 $arNameTemplates = CSite::GetNameTemplates();
224 $arNameTemplates = array_reverse($arNameTemplates, true); //prepend array with default '' => Site Format value
225 $arNameTemplates[""] = GetMessage("BIZPROC_OPTIONS_NAME_IN_SITE_FORMAT");
226 $arNameTemplates = array_reverse($arNameTemplates, true);
227 foreach ($arNameTemplates as $template => $phrase)
228 {
229 $template = str_replace(["#NOBR#", "#/NOBR#"], ["", ""], $template);
230 ?>
231 <option value="<?= $template ?>" <?= (($template == $curVal) ? " selected" : "") ?> ><?= $phrase ?></option><?php
232 }
233 ?>
234 </select>
235 <?php
236 }
237 $subTabControl->End();
238 ?>
239 </td>
240 </tr>
241 <?php
242 $tabControl->Buttons(); ?>
243 <script>
244 function RestoreDefaults()
245 {
246 if (confirm('<?= AddSlashes(GetMessage("MAIN_HINT_RESTORE_DEFAULTS_WARNING"))?>'))
247 window.location = "<?= $APPLICATION->GetCurPage() ?>?RestoreDefaults=Y&lang=<?= LANG ?>&mid=<?= urlencode($mid) ?>&<?= bitrix_sessid_get() ?>";
248 }
249 </script>
250
251 <input type="submit" class="adm-btn-save" <?php
252 if ($bizprocPerms < "W")
253 echo "disabled" ?> name="Update" value="<?php
254 echo GetMessage("MAIN_SAVE") ?>">
255 <input type="hidden" name="Update" value="Y">
256 <input type="reset" name="reset" value="<?php
257 echo GetMessage("MAIN_RESET") ?>">
258 <input type="button" <?php
259 if ($bizprocPerms < "W")
260 echo "disabled" ?> title="<?php
261 echo GetMessage("MAIN_HINT_RESTORE_DEFAULTS") ?>" OnClick="RestoreDefaults();" value="<?php
262 echo GetMessage("MAIN_RESTORE_DEFAULTS") ?>">
263 <?php
264 $tabControl->End(); ?>
265 </form>
266<?php
267endif;
$path
Определения access_edit.php:21
return select
Определения access_edit.php:440
$type
Определения options.php:106
$dbSites
Определения options.php:14
$arSites
Определения options.php:15
$strWarning
Определения options.php:47
$useGZipCompression
Определения options.php:174
while($site=$dbSites->Fetch()) $subTabControl
Определения options.php:25
$aSubTabs
Определения options.php:16
$bizprocPerms
Определения options.php:6
if($_SERVER $defaultValue['REQUEST_METHOD']==="GET" &&!empty($RestoreDefaults) && $bizprocPerms==="W" &&check_bitrix_sessid())
Определения options.php:32
$module_id
Определения options.php:6
$arVal
Определения options.php:1785
if($canUseYandexMarket) $strWarning
Определения options.php:74
if($_SERVER $arAllOptions['REQUEST_METHOD']=='GET' &&!empty($_REQUEST['RestoreDefaults']) &&! $bReadOnly &&check_bitrix_sessid())
Определения options.php:63
static get($moduleId, $name, $default="", $siteId=false)
Определения option.php:30
static set($moduleId, $name, $value="", $siteId="")
Определения option.php:261
static isModuleInstalled($moduleName)
Определения modulemanager.php:125
static ShowMessage($message)
Определения admin_lib.php:2351
static getDelayMinLimit($withType=false)
Определения schedulerservice.php:13
static setDelayMinLimit($limit, $type='s')
Определения schedulerservice.php:40
$template
Определения file_edit.php:49
bx popup label bx width30 PAGE_NEW_MENU_NAME text width
Определения file_new.php:677
$_REQUEST["admin_mnu_menu_id"]
Определения get_menu.php:8
$Update
Определения options.php:212
$RestoreDefaults
Определения options.php:55
$_SERVER["DOCUMENT_ROOT"]
Определения cron_frame.php:9
$tabControl
Определения csv_new_setup.php:244
$aTabs
Определения csv_new_setup.php:238
endif
Определения csv_new_setup.php:990
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
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
if( $daysToExpire >=0 &&$daysToExpire< 60 elseif)( $daysToExpire< 0)
Определения prolog_main_admin.php:393
<? endif;?> window document title
Определения prolog_main_admin.php:76
$i
Определения factura.php:643
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
$val
Определения options.php:1793
else $Option[0]
Определения options.php:387
$k
Определения template_pdf.php:567
$site
Определения yandex_run.php:614