17 require_once SQ_INCLUDE_PATH.
'/general_occasional.inc';
51 public static function evaluate($settings, &$state)
55 if (empty($state[
'asset'])) {
57 if (empty($state[
'assetid'])) {
60 $state[
'asset'] = $GLOBALS[
'SQ_SYSTEM']->am->getAsset($state[
'assetid']);
64 if (empty($settings[
'statii'])) {
70 if (in_array($state[
'event'][
'data'][
'new_status'], $settings[
'statii']))
return TRUE;
87 public static function getInterface($settings, $prefix, $write_access=FALSE)
89 if (empty($settings[
'statii'])) {
91 $selected_status = Array();
93 $selected_status = $settings[
'statii'];
96 $status_list = self::_getStatusList();
99 $form_element_extras =
'disabled="disabled"';
101 $form_element_extras =
'';
107 combo_box($prefix.
'[statii]', $status_list, TRUE, $selected_status, NULL, $form_element_extras);
110 foreach($selected_status as $print_status) {
111 echo
'<tr><td>'.get_asset_status_icon($print_status).
'<strong>'. get_status_description($print_status).
'</strong></td></tr>';
115 $basic_part_1 = ob_get_contents();
118 return translate(
'trigger_status_change_to_basic', $basic_part_1);
134 $statii = array_get_index($request_data,
'statii', Array());
135 if (!$statii)
return 'No status selected';
137 $status_list = self::_getStatusList();
140 foreach($statii as $status) {
141 if (isset($status_list[$status])) {
142 $settings[
'statii'][] = $status;
144 return translate(
'trigger_selected_status_invalid');
162 foreach (get_constant_values(
'SQ_STATUS_') as $status_value) {
163 $status[$status_value] = get_status_description($status_value);