Version to 3.5.1
Compatible with GLPI 9.3
This commit is contained in:
@@ -61,15 +61,22 @@ if (empty($_REQUEST['searchText'])) {
|
||||
}
|
||||
|
||||
$processall = (isset($_REQUEST['specific_tags']['process_restrict']) && !$_REQUEST['specific_tags']['process_restrict']);
|
||||
$count_cases_per_item = isset($_REQUEST['specific_tags']['count_cases_per_item']) ? $_REQUEST['specific_tags']['count_cases_per_item'] : [];
|
||||
|
||||
$result = PluginProcessmakerProcess::getSqlSearchResult(false, $search);
|
||||
|
||||
if ($DB->numrows($result)) {
|
||||
while ($data = $DB->fetch_array($result)) {
|
||||
$process_entities = PluginProcessmakerProcess::getEntitiesForProfileByProcess($data["id"], $_SESSION['glpiactiveprofile']['id'], true);
|
||||
if ($processall || in_array( $_REQUEST["entity_restrict"], $process_entities)) {
|
||||
array_push( $processes, [ 'id' => $data["id"],
|
||||
'text' => $data["name"] ]);
|
||||
$can_add = $data['max_cases_per_item'] == 0 || !isset($count_cases_per_item[$data["id"]]) || $count_cases_per_item[$data["id"]] < $data['max_cases_per_item'];
|
||||
if ($processall
|
||||
|| ($data['maintenance'] != 1
|
||||
&& in_array( $_REQUEST["entity_restrict"], $process_entities)
|
||||
&& $can_add) ) {
|
||||
|
||||
array_push( $processes, ['id' => $data["id"],
|
||||
'text' => $data["name"]
|
||||
]);
|
||||
$count++;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -57,8 +57,9 @@ if (!isset($_REQUEST['page'])) {
|
||||
if ($one_item < 0) {
|
||||
$start = ($_REQUEST['page']-1)*$_REQUEST['page_limit'];
|
||||
$LIMIT = "LIMIT $start,".$_REQUEST['page_limit'];
|
||||
$searchText = isset($_REQUEST['searchText']) ? $_REQUEST['searchText'] : "";
|
||||
$result = PluginProcessmakerUser::getSqlSearchResult( $_REQUEST['specific_tags']['taskGuid'], false, $_REQUEST['right'], $_REQUEST["entity_restrict"],
|
||||
$_REQUEST['value'], $used, $_REQUEST['searchText'], $LIMIT);
|
||||
$_REQUEST['value'], $used, $searchText, $LIMIT);
|
||||
} else {
|
||||
$query = "SELECT DISTINCT `glpi_users`.*
|
||||
FROM `glpi_users`
|
||||
|
||||
Reference in New Issue
Block a user