1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
user_search.php
См. документацию.
1<?php
2
3require_once(__DIR__."/../include/prolog_admin_before.php");
4
9
10if(!($USER->CanDoOperation('view_subordinate_users') || $USER->CanDoOperation('view_all_users')))
11 $APPLICATION->AuthForm(GetMessage("ACCESS_DENIED"));
12
13IncludeModuleLangFile($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/admin/user_admin.php");
14IncludeModuleLangFile(__FILE__);
15
16$FN = preg_replace("/[^a-z0-9_\\[\\]:]/i", "", $_REQUEST["FN"]);
17$FC = preg_replace("/[^a-z0-9_\\[\\]:]/i", "", $_REQUEST["FC"]);
18if($FN == "")
19 $FN = "find_form";
20if($FC == "")
21 $FC = "USER_ID";
22
23if (isset($_REQUEST['JSFUNC']))
24{
25 $JSFUNC = preg_replace("/[^a-z0-9_\\[\\]:]/i", "", $_REQUEST['JSFUNC']);
26}
27else
28{
29 $JSFUNC = '';
30}
31// идентификатор таблицы
32$sTableID = "tbl_user_popup";
33
34// инициализация сортировки
35$oSort = new CAdminSorting($sTableID, "ID", "asc");
36// инициализация списка
38
39// инициализация параметров списка - фильтры
41 "find",
42 "find_type",
43 "find_id",
44 "find_timestamp_1",
45 "find_timestamp_2",
46 "find_last_login_1",
47 "find_last_login_2",
48 "find_active",
49 "find_login",
50 "find_name",
51 "find_email",
52 "find_keywords",
53 "find_group_id"
54);
55
56$lAdmin->InitFilter($arFilterFields);
57
58//инициализация массива фильтра для GetList
59function CheckFilter($FilterArr) // проверка введенных полей
60{
61 global $strError;
62 foreach($FilterArr as $f)
63 global $$f;
64
65 $str = "";
66 if(trim($find_timestamp_1) <> '' || trim($find_timestamp_2) <> '')
67 {
68 $date_1_ok = false;
69 $date1_stm = MkDateTime(FmtDate($find_timestamp_1,"D.M.Y"),"d.m.Y");
70 $date2_stm = MkDateTime(FmtDate($find_timestamp_2,"D.M.Y")." 23:59","d.m.Y H:i");
71 if (!$date1_stm && trim($find_timestamp_1) <> '')
72 $str.= GetMessage("MAIN_WRONG_TIMESTAMP_FROM")."<br>";
73 else $date_1_ok = true;
74 if (!$date2_stm && trim($find_timestamp_2) <> '')
75 $str.= GetMessage("MAIN_WRONG_TIMESTAMP_TILL")."<br>";
76 elseif ($date_1_ok && $date2_stm <= $date1_stm && $date2_stm <> '')
77 $str.= GetMessage("MAIN_FROM_TILL_TIMESTAMP")."<br>";
78 }
79
80 if(trim($find_last_login_1) <> '' || trim($find_last_login_2) <> '')
81 {
82 $date_1_ok = false;
83 $date1_stm = MkDateTime(FmtDate($find_last_login_1,"D.M.Y"),"d.m.Y");
84 $date2_stm = MkDateTime(FmtDate($find_last_login_2,"D.M.Y")." 23:59","d.m.Y H:i");
85 if(!$date1_stm && trim($find_last_login_1) <> '')
86 $str.= GetMessage("MAIN_WRONG_LAST_LOGIN_FROM")."<br>";
87 else
88 $date_1_ok = true;
89 if(!$date2_stm && trim($find_last_login_2) <> '')
90 $str.= GetMessage("MAIN_WRONG_LAST_LOGIN_TILL")."<br>";
91 elseif($date_1_ok && $date2_stm <= $date1_stm && $date2_stm <> '')
92 $str.= GetMessage("MAIN_FROM_TILL_LAST_LOGIN")."<br>";
93 }
94
95 $strError .= $str;
96 if($str <> '')
97 {
98 global $lAdmin;
99 $lAdmin->AddFilterError($str);
100 return false;
101 }
102
103 return true;
104}
105
106$arFilter = Array();
108{
109 $arFilter = Array(
110 "ID" => $find_id,
111 "TIMESTAMP_1" => $find_timestamp_1,
112 "TIMESTAMP_2" => $find_timestamp_2,
113 "LAST_LOGIN_1" => $find_last_login_1,
114 "LAST_LOGIN_2" => $find_last_login_2,
115 "ACTIVE" => $find_active,
116 "LOGIN" => ($find!='' && $find_type == "login"? $find: $find_login),
117 "NAME" => ($find!='' && $find_type == "name"? $find: $find_name),
118 "EMAIL" => ($find!='' && $find_type == "email"? $find: $find_email),
119 "KEYWORDS" => $find_keywords,
120 "GROUPS_ID" => $find_group_id
121 );
122}
123
124if(!$USER->CanDoOperation('view_all_users'))
125{
126 $arFilter["CHECK_SUBORDINATE"] = CUser::GetSubordinateGroups();
127 if($USER->CanDoOperation('edit_own_profile'))
128 {
129 $arFilter["CHECK_SUBORDINATE_AND_OWN"] = $USER->GetID();
130 }
131}
132
133$rsData = CUser::GetList($oSort->getField(), $oSort->getOrder(), $arFilter, array(
134 "NAV_PARAMS"=> array("nPageSize"=>CAdminResult::GetNavSize($sTableID)),
135));
137$rsData->NavStart();
138
139// установке параметров списка
140$lAdmin->NavText($rsData->GetNavPrint(GetMessage("PAGES")));
141
142// заголовок списка
143$lAdmin->AddHeaders(array(
144 array("id"=>"ID", "content"=>"ID", "sort"=>"id", "default"=>true),
145 array("id"=>"TIMESTAMP_X", "content"=>GetMessage('TIMESTAMP'), "sort"=>"timestamp_x", "default"=>true),
146 array("id"=>"ACTIVE", "content"=>GetMessage('ACTIVE'), "sort"=>"active", "default"=>true),
147 array("id"=>"LOGIN", "content"=>GetMessage("LOGIN"), "sort"=>"login", "default"=>true),
148 array("id"=>"NAME", "content"=>GetMessage("NAME"), "sort"=>"name", "default"=>true),
149 array("id"=>"LAST_NAME", "content"=>GetMessage("LAST_NAME"), "sort"=>"last_name", "default"=>true),
150 array("id"=>"EMAIL", "content"=>GetMessage('EMAIL'), "sort"=>"email", "default"=>true),
151 array("id"=>"LAST_LOGIN", "content"=>GetMessage("LAST_LOGIN"), "sort"=>"last_login", "default"=>true),
152 array("id"=>"DATE_REGISTER", "content"=>GetMessage("DATE_REGISTER"), "sort"=>"date_register"),
153 array("id"=>"PERSONAL_BIRTHDAY", "content"=>GetMessage("PERSONAL_BIRTHDAY"), "sort"=>"personal_birthday"),
154 array("id"=>"PERSONAL_PROFESSION", "content"=>GetMessage("PERSONAL_PROFESSION"), "sort"=>"personal_profession"),
155 array("id"=>"PERSONAL_WWW", "content"=>GetMessage("PERSONAL_WWW"), "sort"=>"personal_www"),
156 array("id"=>"PERSONAL_ICQ", "content"=>GetMessage("PERSONAL_ICQ"), "sort"=>"personal_icq"),
157 array("id"=>"PERSONAL_GENDER", "content"=>GetMessage("PERSONAL_GENDER"), "sort"=>"personal_gender"),
158 array("id"=>"PERSONAL_PHONE", "content"=>GetMessage("PERSONAL_PHONE"), "sort"=>"personal_phone"),
159 array("id"=>"PERSONAL_MOBILE", "content"=>GetMessage("PERSONAL_MOBILE"), "sort"=>"personal_mobile"),
160 array("id"=>"PERSONAL_CITY", "content"=>GetMessage("PERSONAL_CITY"), "sort"=>"personal_city"),
161 array("id"=>"PERSONAL_STREET", "content"=>GetMessage("PERSONAL_STREET"), "sort"=>"personal_street"),
162 array("id"=>"WORK_COMPANY", "content"=>GetMessage("WORK_COMPANY"), "sort"=>"work_company"),
163 array("id"=>"WORK_DEPARTMENT", "content"=>GetMessage("WORK_DEPARTMENT"), "sort"=>"work_department"),
164 array("id"=>"WORK_POSITION", "content"=>GetMessage("WORK_POSITION"), "sort"=>"work_position"),
165 array("id"=>"WORK_WWW", "content"=>GetMessage("WORK_WWW"), "sort"=>"work_www"),
166 array("id"=>"WORK_PHONE", "content"=>GetMessage("WORK_PHONE"), "sort"=>"work_phone"),
167 array("id"=>"WORK_CITY", "content"=>GetMessage("WORK_CITY"), "sort"=>"work_city"),
168 array("id"=>"XML_ID", "content"=>GetMessage("XML_ID"), "sort"=>"external_id"),
169 array("id"=>"EXTERNAL_AUTH_ID", "content"=>GetMessage("EXTERNAL_AUTH_ID")),
170));
171
172// построение списка
173while($arRes = $rsData->GetNext())
174{
175 $f_ID = $arRes['ID'];
176 $row =& $lAdmin->AddRow($f_ID, $arRes);
177 $row->AddViewField("ID", $f_ID);
178 $row->AddCheckField("ACTIVE", false);
179 $row->AddViewField("LOGIN", "<a href=\"javascript:SetValue('".$f_ID."');\" title=\"".GetMessage("MAIN_CHANGE")."\">".$arRes["LOGIN"]."</a>");
180 $row->AddViewField("NAME", $arRes["NAME"]);
181 $row->AddViewField("LAST_NAME", $arRes["LAST_NAME"]);
182 $row->AddViewField("EMAIL", TxtToHtml($arRes["EMAIL"]));
183 $row->AddViewField("PERSONAL_PROFESSION", $arRes["PERSONAL_PROFESSION"]);
184 $row->AddViewField("PERSONAL_WWW", TxtToHtml($arRes["PERSONAL_WWW"]));
185 $row->AddViewField("PERSONAL_ICQ", $arRes["PERSONAL_ICQ"]);
186 $row->AddViewField("PERSONAL_GENDER", $arRes["PERSONAL_GENDER"]);
187 $row->AddViewField("PERSONAL_PHONE", $arRes["PERSONAL_PHONE"]);
188 $row->AddViewField("PERSONAL_MOBILE", $arRes["PERSONAL_MOBILE"]);
189 $row->AddViewField("PERSONAL_CITY", $arRes["PERSONAL_CITY"]);
190 $row->AddViewField("PERSONAL_STREET", $arRes["PERSONAL_STREET"]);
191 $row->AddViewField("WORK_COMPANY", $arRes["WORK_COMPANY"]);
192 $row->AddViewField("WORK_DEPARTMENT", $arRes["WORK_DEPARTMENT"]);
193 $row->AddViewField("WORK_POSITION", $arRes["WORK_POSITION"]);
194 $row->AddViewField("WORK_WWW", TxtToHtml($arRes["WORK_WWW"]));
195 $row->AddViewField("WORK_PHONE", $arRes["WORK_PHONE"]);
196 $row->AddViewField("WORK_CITY", $arRes["WORK_CITY"]);
197 $row->AddViewField("XML_ID", $arRes["XML_ID"]);
198
199 $arActions = array();
200 $arActions[] = array(
201 "ICON"=>"",
202 "TEXT"=>GetMessage("MAIN_CHANGE"),
203 "DEFAULT"=>true,
204 "ACTION"=>"SetValue('".$f_ID."');"
205 );
206 $row->AddActions($arActions);
207}
208
209$lAdmin->AddAdminContextMenu(array());
210
211// проверка на вывод только списка (в случае списка, скрипт дальше выполняться не будет)
212$lAdmin->CheckListMode();
213
214$APPLICATION->SetTitle(GetMessage("MAIN_PAGE_TITLE"));
215require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/prolog_popup_admin.php")
216?>
217<script>
218function SetValue(id)
219{
220 <?if ($JSFUNC <> ''){?>
221 window.opener.SUV<?=$JSFUNC?>(id);
222 <?}else{?>
223 window.opener.document.<?echo $FN;?>["<?echo $FC;?>"].value=id;
224 if (window.opener.BX)
225 window.opener.BX.fireEvent(window.opener.document.<?echo $FN;?>["<?echo $FC;?>"], 'change');
226 window.close();
227 <?}?>
228}
229</script>
230<form name="find_form" method="GET" action="<?echo $APPLICATION->GetCurPage()?>?">
231<?
232$oFilter = new CAdminFilter(
233 $sTableID."_filter",
234 array(
235 GetMessage('MAIN_FLT_USER_ID'),
236 GetMessage('MAIN_FLT_MOD_DATE'),
237 GetMessage('MAIN_FLT_AUTH_DATE'),
238 GetMessage('MAIN_FLT_ACTIVE'),
239 GetMessage('MAIN_FLT_LOGIN'),
240 GetMessage('MAIN_FLT_EMAIL'),
241 GetMessage('MAIN_FLT_FIO'),
242 GetMessage('MAIN_FLT_PROFILE_FIELDS'),
243 GetMessage('MAIN_FLT_USER_GROUP')
244 )
245);
246
247$oFilter->Begin();
248?>
249<tr>
250 <td><b><?=GetMessage("MAIN_FLT_SEARCH")?></b></td>
251 <td nowrap>
252 <input type="text" size="25" name="find" value="<?echo htmlspecialcharsbx($find)?>" title="<?=GetMessage("MAIN_FLT_SEARCH_TITLE")?>">
253 <select name="find_type">
254 <option value="login"<?if($find_type=="login") echo " selected"?>><?=GetMessage('MAIN_FLT_LOGIN')?></option>
255 <option value="email"<?if($find_type=="email") echo " selected"?>><?=GetMessage('MAIN_FLT_EMAIL')?></option>
256 <option value="name"<?if($find_type=="name") echo " selected"?>><?=GetMessage('MAIN_FLT_FIO')?></option>
257 </select>
258 </td>
259</tr>
260<tr>
261 <td><?echo GetMessage("MAIN_F_ID")?></td>
262 <td><input type="text" name="find_id" size="47" value="<?echo htmlspecialcharsbx($find_id)?>"><?=ShowFilterLogicHelp()?></td>
263</tr>
264<tr>
265 <td><?echo GetMessage("MAIN_F_TIMESTAMP").":"?></td>
266 <td><?echo CalendarPeriod("find_timestamp_1", htmlspecialcharsbx($find_timestamp_1), "find_timestamp_2", htmlspecialcharsbx($find_timestamp_2), "find_form","Y")?></td>
267</tr>
268<tr>
269 <td><?echo GetMessage("MAIN_F_LAST_LOGIN").":"?></td>
270 <td><?echo CalendarPeriod("find_last_login_1", htmlspecialcharsbx($find_last_login_1), "find_last_login_2", htmlspecialcharsbx($find_last_login_2), "find_form","Y")?></td>
271</tr>
272<tr>
273 <td><?echo GetMessage("F_ACTIVE")?></td>
274 <td><?
275 $arr = array("reference"=>array(GetMessage("MAIN_YES"), GetMessage("MAIN_NO")), "reference_id"=>array("Y","N"));
276 echo SelectBoxFromArray("find_active", $arr, htmlspecialcharsbx($find_active), GetMessage('MAIN_ALL'));
277 ?>
278 </td>
279</tr>
280<tr>
281 <td><?echo GetMessage("F_LOGIN")?></td>
282 <td><input type="text" name="find_login" size="47" value="<?echo htmlspecialcharsbx($find_login)?>"><?=ShowFilterLogicHelp()?></td>
283</tr>
284<tr>
285 <td><?echo GetMessage("MAIN_F_EMAIL")?></td>
286 <td><input type="text" name="find_email" value="<?echo htmlspecialcharsbx($find_email)?>" size="47"><?=ShowFilterLogicHelp()?></td>
287</tr>
288<tr>
289 <td><?echo GetMessage("F_NAME")?></td>
290 <td><input type="text" name="find_name" value="<?echo htmlspecialcharsbx($find_name)?>" size="47"><?=ShowFilterLogicHelp()?></td>
291</tr>
292<tr>
293 <td><?echo GetMessage("MAIN_F_KEYWORDS")?></td>
294 <td><input type="text" name="find_keywords" value="<?echo htmlspecialcharsbx($find_keywords)?>" size="47"><?=ShowFilterLogicHelp()?></td>
295</tr>
296<tr valign="top">
297 <td><?echo GetMessage("F_GROUP")?><br><img src="/bitrix/images/main/mouse.gif" width="44" height="21" border="0" alt=""></td>
298 <td><?
299 $z = CGroup::GetDropDownList("AND ID!=2");
300 echo SelectBoxM("find_group_id[]", $z, $find_group_id, "", false, 10);
301 ?></td>
302</tr>
303<input type="hidden" name="FN" value="<?echo htmlspecialcharsbx($FN)?>">
304<input type="hidden" name="FC" value="<?echo htmlspecialcharsbx($FC)?>">
305<input type="hidden" name="JSFUNC" value="<?echo htmlspecialcharsbx($JSFUNC)?>">
306<?
307$oFilter->Buttons(array("table_id"=>$sTableID, "url"=>$APPLICATION->GetCurPage(), "form"=>"find_form"));
308$oFilter->End();
309?>
310</form>
311<?
312// место для вывода списка
313$lAdmin->DisplayList();
314
315require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/epilog_popup_admin.php");
return select
Определения access_edit.php:440
global $APPLICATION
Определения include.php:80
Определения admin_filter.php:13
Определения admin_list.php:16
Определения admin_lib.php:2054
static GetNavSize($table_id=false, $nPageSize=20)
Определения admin_lib.php:2097
Определения admin_lib.php:1890
static GetDropDownList($strSqlSearch="and ACTIVE='Y'", $strSqlOrder="ORDER BY C_SORT, NAME, ID")
Определения group.php:114
static GetSubordinateGroups(int $userID=null)
Определения user.php:947
$str
Определения commerceml2.php:63
$f
Определения component_props.php:52
hidden PROPERTY[<?=$propertyIndex?>][CODE]<?=htmlspecialcharsEx( $propertyCode)?> height
Определения file_new.php:759
bx popup label bx width30 PAGE_NEW_MENU_NAME text width
Определения file_new.php:677
$arr
Определения file_new.php:624
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
ShowFilterLogicHelp()
Определения filter_tools.php:349
$_REQUEST["admin_mnu_menu_id"]
Определения get_menu.php:8
$strError
Определения options_user_settings.php:4
$_SERVER["DOCUMENT_ROOT"]
Определения cron_frame.php:9
global $USER
Определения csv_new_run.php:40
$z
Определения options.php:31
CalendarPeriod($sFromName, $sFromVal, $sToName, $sToVal, $sFormName="skform", $show_select="N", $field_select="class=\"typeselect\"", $field_input="class=\"typeinput\"", $size="10")
Определения tools.php:329
SelectBoxM($strBoxName, $a, $arr, $strDetText="", $strDetText_selected=false, $size="5", $field1="class=\"typeselect\"")
Определения tools.php:119
FmtDate($str_date, $format=false, $site=false, $bSearchInSitesOnly=false)
Определения tools.php:745
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
MkDateTime($strDT, $format="d.m.Y H:i:s")
Определения tools.php:1977
SelectBoxFromArray( $strBoxName, $db_array, $strSelectedVal="", $strDetText="", $field1="class='typeselect'", $go=false, $form="form1")
Определения tools.php:216
if( $daysToExpire >=0 &&$daysToExpire< 60 elseif)( $daysToExpire< 0)
Определения prolog_main_admin.php:393
<? endif;?> window document title
Определения prolog_main_admin.php:76
font size
Определения invoice.php:442
$arRes
Определения options.php:104
if(file_exists($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/updater.log") &&is_file($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/updater.log") &&is_readable($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/updater.log")) $rsData
Определения update_log.php:102
$oSort
Определения update_log.php:24
$lAdmin
Определения update_log.php:25
$sTableID
Определения update_log.php:23
$FN
Определения user_search.php:16
CheckFilter($FilterArr)
Определения user_search.php:59
$arFilter
Определения user_search.php:106
$arFilterFields
Определения user_search.php:40
$FC
Определения user_search.php:17