17 require_once SQ_INCLUDE_PATH.
'/general_occasional.inc';
18 require_once SQ_CORE_PACKAGE_PATH.
'/system/triggers/trigger_action/trigger_action.inc';
53 public static function execute($settings, &$state)
56 if (empty($settings[
'version']))
return FALSE;
58 if (empty($state[
'asset'])) {
60 if (empty($state[
'assetid'])) {
63 $state[
'asset'] = $GLOBALS[
'SQ_SYSTEM']->am->getAsset($state[
'assetid']);
72 'assetid' => $state[
'asset']->
id,
73 'version_set' => $settings[
'version'],
74 'new_version' => $state[
'asset']->version,
90 public static function getInterface($settings, $prefix, $write_access=FALSE)
92 if (empty($settings[
'version'])) {
94 $selected_status =
'major';
96 $selected_status = $settings[
'version'];
99 $version_list = Array(
105 if (!$write_access) {
106 $form_element_extras =
'disabled="disabled"';
108 $form_element_extras =
'';
112 combo_box($prefix.
'[version]', $version_list, FALSE, $selected_status, NULL, $form_element_extras);
113 $basic_part_1 = ob_get_contents();
117 return translate(
'trigger_increment_version', $basic_part_1);
135 $version = array_get_index($request_data,
'version', FALSE);
136 if (!$version)
return 'Version has not been specified';
138 $version_list = Array(
145 if (isset($version_list[$version])) {
146 $settings[
'version'] = $version;
149 return 'Specified version is invalid';