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[
'status'])) {
70 if ($state[
'asset']->status == $settings[
'status']) {
89 public static function getInterface($settings, $prefix, $write_access=FALSE)
91 if (empty($settings[
'status'])) {
93 $selected_status = SQ_STATUS_UNDER_CONSTRUCTION;
95 $selected_status = $settings[
'status'];
98 $status_list = trigger_condition_status::_getStatusList();
100 if (!$write_access) {
101 $form_element_extras =
'disabled="disabled"';
103 $form_element_extras =
'';
109 combo_box($prefix.
'[status]', $status_list, FALSE, $selected_status, NULL, $form_element_extras);
111 echo get_asset_status_icon($selected_status).
'<strong>'. get_status_description($selected_status).
'</strong>';
113 $basic_part_1 = ob_get_contents();
116 return translate(
'trigger_has_status_basic', $basic_part_1);
132 $status = array_get_index($request_data,
'status', FALSE);
133 if (!$status)
return 'No status selected';
135 $status_list = trigger_condition_status::_getStatusList();
138 if (isset($status_list[$status])) {
139 $settings[
'status'] = $status;
142 return translate(
'trigger_selected_status_invalid');
157 foreach (get_constant_values(
'SQ_STATUS_') as $status_value) {
158 $status[$status_value] = get_status_description($status_value);