17 require_once SQ_CORE_PACKAGE_PATH.
'/system/triggers/trigger_condition/trigger_condition.inc';
48 public static function evaluate($settings, &$state)
50 if (empty($settings[
'trigger_metadata_date_fieldid']))
return FALSE;
51 if (empty($state[
'asset']))
return FALSE;
55 $mdata_fieldid = isset($state[
'event'][
'data'][
'trigger_metadata_date_fieldid']) ? $state[
'event'][
'data'][
'trigger_metadata_date_fieldid'] :
'';
57 if (!empty($mdata_fieldid) && ($settings[
'trigger_metadata_date_fieldid'] == $mdata_fieldid)) {
76 public static function getInterface($settings, $prefix, $write_access=FALSE)
78 require_once SQ_LIB_PATH.
'/html_form/html_form.inc';
82 echo translate(
'trigger_metadata_date_fieldid');
83 $fieldid = array_get_index($settings,
'trigger_metadata_date_fieldid', 0);
85 asset_finder($prefix.
'[trigger_metadata_date_fieldid]', $fieldid, Array(
'metadata_field_date' =>
'D'));
87 echo
'<b>#'.$fieldid.
'</b>';
89 $ret = ob_get_clean();
108 if (empty($request_data)) {
109 return translate(
'trigger_input_data_error');
112 $settings[
'trigger_metadata_date_fieldid'] = empty($request_data[
'trigger_metadata_date_fieldid'][
'assetid']) ? 0 : $request_data[
'trigger_metadata_date_fieldid'][
'assetid'];