1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
operation.php
См. документацию.
1
<?php
2
9
10
class
CAllOperation
11
{
12
public
static
function
GetList
($arOrder = [
'MODULE_ID'
=>
'asc'
],
$arFilter
= [])
13
{
14
global
$DB
;
15
16
static
$arFields
= [
17
"ID"
=> [
"FIELD_NAME"
=>
"O.ID"
,
"FIELD_TYPE"
=>
"int"
],
18
"NAME"
=> [
"FIELD_NAME"
=>
"O.NAME"
,
"FIELD_TYPE"
=>
"string"
],
19
"MODULE_ID"
=> [
"FIELD_NAME"
=>
"O.MODULE_ID"
,
"FIELD_TYPE"
=>
"string"
],
20
"BINDING"
=> [
"FIELD_NAME"
=>
"O.BINDING"
,
"FIELD_TYPE"
=>
"string"
],
21
];
22
23
$arSqlSearch = [];
24
if
(is_array(
$arFilter
))
25
{
26
foreach
(
$arFilter
as
$n
=>
$val
)
27
{
28
$n
= strtoupper(
$n
);
29
if
((
string
)
$val
==
''
|| strval(
$val
) ==
"NOT_REF"
)
30
{
31
continue
;
32
}
33
if
(
$n
==
'ID'
||
$n
==
'MODULE_ID'
||
$n
==
'BINDING'
)
34
{
35
$arSqlSearch[] =
GetFilterQuery
(
$arFields
[
$n
][
"FIELD_NAME"
],
$val
,
'N'
);
36
}
37
elseif
(isset(
$arFields
[
$n
]))
38
{
39
$arSqlSearch[] =
GetFilterQuery
(
$arFields
[
$n
][
"FIELD_NAME"
],
$val
);
40
}
41
}
42
}
43
44
$strOrderBy =
''
;
45
foreach
($arOrder as $by =>
$order
)
46
{
47
if
(isset(
$arFields
[strtoupper($by)]))
48
{
49
$strOrderBy .=
$arFields
[strtoupper($by)][
"FIELD_NAME"
] .
' '
. (strtolower(
$order
) ==
'desc'
?
'desc'
:
'asc'
) .
','
;
50
}
51
}
52
53
if
($strOrderBy <>
''
)
54
{
55
$strOrderBy =
"ORDER BY "
. rtrim($strOrderBy,
","
);
56
}
57
58
$strSqlSearch =
GetFilterSqlSearch
($arSqlSearch);
59
$strSql =
"
60
SELECT *
61
FROM
62
b_operation O
63
WHERE
64
"
. $strSqlSearch .
"
65
"
. $strOrderBy;
66
67
$res
=
$DB
->Query($strSql);
68
return
$res
;
69
}
70
71
public
static
function
GetAllowedModules
()
72
{
73
global
$DB
;
74
$sql_str =
'SELECT DISTINCT O.MODULE_ID FROM b_operation O'
;
75
$z
=
$DB
->Query($sql_str);
76
$arr
= [];
77
while
($r =
$z
->Fetch())
78
{
79
$arr
[] = $r[
'MODULE_ID'
];
80
}
81
return
$arr
;
82
}
83
84
public
static
function
GetBindingList
()
85
{
86
global
$DB
;
87
$sql_str =
'SELECT DISTINCT O.MODULE_ID, O.BINDING FROM b_operation O'
;
88
$z
=
$DB
->Query($sql_str);
89
$arr
= [];
90
while
($r =
$z
->Fetch())
91
{
92
$arr
[] = $r;
93
}
94
return
$arr
;
95
}
96
97
public
static
function
GetIDByName
(
$name
)
98
{
99
$z
= static::GetList([
'MODULE_ID'
=>
'asc'
], [
"NAME"
=>
$name
]);
100
if
($r =
$z
->Fetch())
101
{
102
return
$r[
'ID'
];
103
}
104
return
false
;
105
}
106
107
protected
static
function
GetDescriptions
($module)
108
{
109
static
$descriptions = [];
110
111
if
(preg_match(
"/[^a-z0-9._]/i"
, $module))
112
{
113
return
[];
114
}
115
116
if
(!isset($descriptions[$module]))
117
{
118
if
((
$path
=
getLocalPath
(
"modules/"
. $module .
"/admin/operation_description.php"
)) !==
false
)
119
{
120
$descriptions[$module] = include(
$_SERVER
[
"DOCUMENT_ROOT"
] .
$path
);
121
}
122
else
123
{
124
$descriptions[$module] = [];
125
}
126
}
127
128
return
$descriptions[$module];
129
}
130
131
public
static
function
GetLangTitle
(
$name
, $module =
"main"
)
132
{
133
$descriptions = static::GetDescriptions($module);
134
135
$nameUpper = strtoupper(
$name
);
136
137
if
(isset($descriptions[$nameUpper][
"title"
]))
138
{
139
return
$descriptions[$nameUpper][
"title"
];
140
}
141
142
return
$name
;
143
}
144
145
public
static
function
GetLangDescription
(
$name
,
$desc
, $module =
"main"
)
146
{
147
$descriptions = static::GetDescriptions($module);
148
149
$nameUpper = strtoupper(
$name
);
150
151
if
(isset($descriptions[$nameUpper][
"description"
]))
152
{
153
return
$descriptions[$nameUpper][
"description"
];
154
}
155
156
return
$desc
;
157
}
158
}
159
160
class
COperation
extends
CAllOperation
161
{
162
}
$path
$path
Определения
access_edit.php:21
CAllOperation
Определения
operation.php:11
CAllOperation\GetLangTitle
static GetLangTitle($name, $module="main")
Определения
operation.php:131
CAllOperation\GetLangDescription
static GetLangDescription($name, $desc, $module="main")
Определения
operation.php:145
CAllOperation\GetIDByName
static GetIDByName($name)
Определения
operation.php:97
CAllOperation\GetAllowedModules
static GetAllowedModules()
Определения
operation.php:71
CAllOperation\GetDescriptions
static GetDescriptions($module)
Определения
operation.php:107
CAllOperation\GetBindingList
static GetBindingList()
Определения
operation.php:84
CAllOperation\GetList
static GetList($arOrder=['MODULE_ID'=> 'asc'], $arFilter=[])
Определения
operation.php:12
COperation
Определения
operation.php:161
$arFields
$arFields
Определения
dblapprove.php:5
$arr
$arr
Определения
file_new.php:624
$res
$res
Определения
filter_act.php:7
GetFilterSqlSearch
GetFilterSqlSearch($arSqlSearch=array(), $FilterLogic="FILTER_logic")
Определения
filter_tools.php:397
GetFilterQuery
GetFilterQuery($field, $val, $procent="Y", $ex_sep=array(), $clob="N", $div_fields="Y", $clob_upper="N")
Определения
filter_tools.php:383
$_SERVER
$_SERVER["DOCUMENT_ROOT"]
Определения
cron_frame.php:9
$DB
global $DB
Определения
cron_frame.php:29
$z
$z
Определения
options.php:31
getLocalPath
getLocalPath($path, $baseFolder="/bitrix")
Определения
tools.php:5092
$name
$name
Определения
menu_edit.php:35
$order
$order
Определения
payment.php:8
$desc
if(mb_strlen($order)< 6) $desc
Определения
payment.php:44
elseif
if( $daysToExpire >=0 &&$daysToExpire< 60 elseif)( $daysToExpire< 0)
Определения
prolog_main_admin.php:393
$val
$val
Определения
options.php:1793
$n
$n
Определения
update_log.php:107
$arFilter
$arFilter
Определения
user_search.php:106
bitrix
modules
main
classes
general
operation.php
Создано системой
1.14.0