17 require_once SQ_SYSTEM_ROOT.
'/core/hipo/hipo_job.inc';
67 return parent::getCodeName().
'-'.md5(implode(
'-',array_keys($this->_running_vars[
'assets'])));
80 return translate(
'hipo_name_create_links');
96 'name' => translate(
'hipo_confirmation'),
97 'function_call' => Array(
98 'paint_function' =>
'paintConfirmation',
99 'process_function' =>
'processConfirmation',
101 'running_mode' =>
'web',
102 'auto_step' => FALSE,
103 'skip_step' => FALSE,
104 'allow_cancel' => TRUE,
110 'name' => translate(
'hipo_creating_links'),
111 'function_call' => Array(
112 'process_function' =>
'processCreateLinks',
114 'running_mode' =>
'server',
116 'skip_step' => FALSE,
117 'allow_cancel' => TRUE,
123 'name' => translate(
'hipo_updating_lookups'),
125 'init_details_function' =>
'updateLookups',
127 'running_mode' =>
'server',
129 'skip_step' => FALSE,
130 'allow_cancel' => TRUE,
136 'name' => translate(
'hipo_cascading_options'),
137 'function_call' => Array(
138 'paint_function' =>
'paintInterface',
139 'process_function' =>
'processInterface',
141 'running_mode' =>
'web',
142 'auto_step' => FALSE,
143 'skip_step' => FALSE,
144 'allow_cancel' => FALSE,
150 'name' => translate(
'hipo_cascading_permissions'),
152 'init_details_function' =>
'cascadePermissions',
154 'running_mode' =>
'server',
156 'skip_step' => FALSE,
157 'allow_cancel' => FALSE,
163 'name' => translate(
'hipo_cascading_metadata'),
165 'init_details_function' =>
'cascadeMetadata',
167 'running_mode' =>
'server',
169 'skip_step' => FALSE,
170 'allow_cancel' => FALSE,
176 'name' => translate(
'hipo_cascading_workflow'),
178 'init_details_function' =>
'cascadeWorkflow',
180 'running_mode' =>
'server',
182 'skip_step' => FALSE,
183 'allow_cancel' => FALSE,
189 'name' => translate(
'hipo_cascading_content_tags'),
191 'init_details_function' =>
'cascadeTags',
193 'running_mode' =>
'server',
195 'skip_step' => FALSE,
196 'allow_cancel' => FALSE,
202 'name' => translate(
'hipo_cascading_roles'),
204 'init_details_function' =>
'cascadeRoles',
206 'running_mode' =>
'server',
208 'skip_step' => FALSE,
209 'allow_cancel' => FALSE,
215 'name' => translate(
'hipo_refreshing_asset_map'),
216 'function_call' => Array(
217 'paint_function' =>
'paintRefresh',
218 'process_function' =>
'processRefresh',
220 'running_mode' =>
'web',
222 'skip_step' => FALSE,
223 'allow_cancel' => FALSE,
242 if (empty($this->_running_vars[
'assets'])) {
243 trigger_localised_error(
'HIPO0026', E_USER_WARNING);
246 if (!isset($this->_running_vars[
'to_parent_assetid'])) {
247 trigger_localised_error(
'HIPO0025', E_USER_WARNING);
250 if (!isset($this->_running_vars[
'to_parent_pos'])) {
251 trigger_localised_error(
'HIPO0024', E_USER_WARNING);
255 $this->_running_vars[
'assets_children'] = Array();
258 $this->_running_vars[
'do_not_trash'] = Array();
262 for (reset($this->_running_vars[
'assets']); NULL !== ($assetid = key($this->_running_vars[
'assets'])); next($this->_running_vars[
'assets'])) {
263 $links = current($this->_running_vars[
'assets']);
264 if (isset($links[
'linkid']) || isset($links[
'link_type']) || isset($links[
'parentid'])) {
265 $this->_running_vars[
'assets'][$assetid] = Array($links);
269 return parent::prepare();
287 if ($this->_running_vars[
'link_action'] ==
'move') {
288 $new_parent = $GLOBALS[
'SQ_SYSTEM']->am->getAsset($this->_running_vars[
'to_parent_assetid']);
289 $assets = $this->_running_vars[
'assets'];
290 $trash_folder = $GLOBALS[
'SQ_SYSTEM']->am->getSystemAsset(
'trash_folder');
292 if ($new_parent->id == $trash_folder->id) {
294 $safe_trash = $GLOBALS[
'SQ_SYSTEM']->getUserPrefs(
'user',
'SQ_USER_SAFE_TYPE3_TRASH');
299 for (reset($assets); NULL !== ($assetid = key($assets)); next($assets)) {
300 $links = current($assets);
302 for (reset($links); NULL !== ($link_idx = key($links)); next($links)) {
303 $current = current($links);
305 $asset = $GLOBALS[
'SQ_SYSTEM']->am->getAsset($assetid);
306 $trash_link = $GLOBALS[
'SQ_SYSTEM']->am->getLinkByAsset($trash_folder->id, $asset->id, SQ_LINK_TYPE_1 | SQ_LINK_TYPE_2);
307 $num_other_links = $GLOBALS[
'SQ_SYSTEM']->am->countLinks($asset->id,
'minor', SQ_LINK_TYPE_1 | SQ_LINK_TYPE_2,
'', TRUE, $current[
'linkid']);
309 if (!empty($trash_link)) $num_other_links--;
310 if (!$num_other_links) {
315 $affected_links = $GLOBALS[
'SQ_SYSTEM']->am->getLinks($asset->id, SQ_LINK_TYPE_3 | SQ_LINK_NOTICE,
'', TRUE,
'minor');
316 $safe_trash_cron_job = $GLOBALS[
'SQ_SYSTEM']->am->getLinks($asset->id, SQ_LINK_TYPE_3 | SQ_LINK_NOTICE,
'cron_job_attempt_safe_trash', TRUE,
'minor');
321 foreach ($affected_links as $linkid => $affected_link) {
322 if (!($affected_link[
'link_type'] & (SQ_LINK_TYPE_3 | SQ_LINK_NOTICE))) {
323 unset($affected_links[$linkid]);
330 if (!empty($safe_trash_cron_job)) {
331 foreach (array_keys($affected_links) as $affected_link_key) {
332 if ($affected_links[$affected_link_key][
'linkid'] == $safe_trash_cron_job[0][
'linkid']) {
333 unset($affected_links[$affected_link_key]);
339 if (!empty($affected_links)) {
340 $this->_running_vars[
'affected_links'][$assetid] = $affected_links;
348 $trash_errors = $GLOBALS[
'SQ_SYSTEM']->am->canSafeTrashAsset($assetid, $current[
'linkid'], FALSE);
350 $this->_running_vars[
'do_not_trash'][$assetid] = $trash_errors;
351 $this->_running_vars[
'do_not_trash'][$assetid][
'name'] = $asset->name;
360 $this->_running_vars[
'can_skip_cascade'] = TRUE;
362 return parent::initialise($source_code_name);
382 $new_parent = $GLOBALS[
'SQ_SYSTEM']->am->getAsset($this->_running_vars[
'to_parent_assetid']);
383 $assets = $this->_running_vars[
'assets'];
384 if (isset($this->_running_vars[
'reordered_assets'])) {
385 $reordered_assets = $this->_running_vars[
'reordered_assets'];
388 if ($this->_running_vars[
'link_action'] ==
'create') {
391 $o->openSection(translate(
'new_link_confirmation'));
392 if (!empty($this->_tmp[
'message'])) {
393 $o->openField(
'<span style="color: #FF0000;">Error</span>');
394 echo $this->_tmp[
'message'];
399 echo
'<p>'.translate(
'hipo_confirm_new_links', htmlentities($new_parent->name, ENT_COMPAT, SQ_CONF_DEFAULT_CHARACTER_SET)).
'</p>';
401 for (reset($assets); NULL !== ($assetid = key($assets)); next($assets)) {
402 $asset = $GLOBALS[
'SQ_SYSTEM']->am->getAsset($assetid);
403 $current = current($assets);
404 foreach ($current as $link) {
405 $parent = $GLOBALS[
'SQ_SYSTEM']->am->getAsset($link[
'parentid']);
406 echo
'<li>"'.translate(
'hipo_from_under', htmlentities($asset->name, ENT_COMPAT, SQ_CONF_DEFAULT_CHARACTER_SET), htmlentities($parent->name, ENT_COMPAT, SQ_CONF_DEFAULT_CHARACTER_SET)).
'</li>';
407 $GLOBALS[
'SQ_SYSTEM']->am->forgetAsset($parent);
409 $GLOBALS[
'SQ_SYSTEM']->am->forgetAsset($asset);
412 echo
'<p>'.translate(
'hipo_confirm_abort').
'</p>';
416 }
else if ($this->_running_vars[
'link_action'] ==
'move') {
419 $o->openSection(translate(
'hipo_move_confirmation'));
421 if (!empty($this->_tmp[
'message'])) {
422 $o->openField(
'<span style="color: #FF0000;">'.translate(
'error').
'</span>');
423 echo $this->_tmp[
'message'];
429 if (!empty($reordered_assets)) {
430 $o->openField(
' ');
431 echo
'<p>'.translate(
'hipo_assets_not_require_move', htmlentities($new_parent->name, ENT_COMPAT, SQ_CONF_DEFAULT_CHARACTER_SET)).
'</p>';
433 for (reset($reordered_assets); NULL !== ($assetid = key($reordered_assets)); next($reordered_assets)) {
434 $asset = $GLOBALS[
'SQ_SYSTEM']->am->getAsset($assetid);
435 echo
'<li>"'.htmlentities($asset->name, ENT_COMPAT, SQ_CONF_DEFAULT_CHARACTER_SET).
'".</li>';
436 $GLOBALS[
'SQ_SYSTEM']->am->forgetAsset($asset);
442 if ($new_parent->id == $GLOBALS[
'SQ_SYSTEM']->am->getSystemAssetid(
'trash_folder')) {
451 echo
'<p>'.translate(
'hipo_confirm_move_under', htmlentities($new_parent->name, ENT_COMPAT, SQ_CONF_DEFAULT_CHARACTER_SET)).
'</p>';
453 for (reset($assets); NULL !== ($assetid = key($assets)); next($assets)) {
454 $asset = $GLOBALS[
'SQ_SYSTEM']->am->getAsset($assetid);
455 $current = current($assets);
456 foreach ($current as $link) {
457 $parent = $GLOBALS[
'SQ_SYSTEM']->am->getAsset($link[
'parentid']);
458 echo
'<li>'.translate(
'hipo_from_under', htmlentities($asset->name, ENT_COMPAT, SQ_CONF_DEFAULT_CHARACTER_SET), htmlentities($parent->name, ENT_COMPAT, SQ_CONF_DEFAULT_CHARACTER_SET)).
'</li>';
459 $GLOBALS[
'SQ_SYSTEM']->am->forgetAsset($parent);
461 $GLOBALS[
'SQ_SYSTEM']->am->forgetAsset($asset);
472 $o->addHiddenField(
'form_submitted', 1);
489 if (!empty($this->_running_vars[
'remap_choices'])) {
497 $safe_trash = $GLOBALS[
'SQ_SYSTEM']->getUserPrefs(
'user',
'SQ_USER_SAFE_TYPE3_TRASH');
498 $assets = $this->_running_vars[
'assets'];
503 $nothing_to_trash = FALSE;
506 $to_trash = count($assets);
507 $not_to_trash = count($this->_running_vars[
'do_not_trash']);
508 $nothing_to_trash = ($not_to_trash == $to_trash);
514 if (count($assets) - $not_to_trash > 0) {
515 echo translate(
'hipo_confirm_move_trash', count($assets) - $not_to_trash).
'</p>';
516 if (isset($this->_hipo_vars[
'no_next']) && $this->_hipo_vars[
'no_next']) {
518 echo
'<p>'.translate(
'hipo_abort').
'</p>';
520 echo
'<p>'.translate(
'hipo_confirm_abort').
'</p>';
525 if ($safe_trash && $not_to_trash > 0) {
526 if (count($assets)== $not_to_trash) {
527 ?><p><strong
class=
"sq-backend-warning"><?php echo translate(
'hipo_warning_safe_trash_all');?></strong></p><?php
529 ?><p><strong
class=
"sq-backend-warning"><?php echo translate(
'hipo_warning_safe_trash_few', count($assets), $not_to_trash);?></strong></p><?php
534 $shadow_assets = Array();
535 foreach ($assets as $one_id => $one_info) {
536 if (strpos($one_id,
':')) $shadow_assets[] = $one_id;
538 if (!empty($shadow_assets)) {
539 $shadow_info_array = $GLOBALS[
'SQ_SYSTEM']->am->getAssetInfo($shadow_assets);
540 echo
'<p><strong class="sq-backend-warning">'.translate(
'hipo_immediate_delete_shadow').
':</strong>';
542 foreach ($shadow_info_array as $shadow_info) {
543 echo
'<li>'.$shadow_info[
'short_name'].
'</li>';
553 $affected_title = translate(
'hipo_safe_trash_linking_title');
554 $warning_msg = translate(
'hipo_safe_trash_linking_msg');
556 $affected_title = translate(
'hipo_trash_warning_affected_title');
557 $warning_msg = translate(
'hipo_trash_warning_affected_msg');
561 if ($safe_trash && !empty($this->_running_vars[
'do_not_trash'])) {
568 if (!$nothing_to_trash) {
594 $affected_links = array_get_index($this->_running_vars,
'affected_links', Array());
595 if (!empty($affected_links)) {
596 $o->addJsInclude(sq_web_path(
'lib').
'/js/tooltip.js');
597 $o->openField($title,
'new_line');
598 echo
'<p>'.$warning_msg.
'</p>';
599 foreach ($affected_links as $assetid => $links) {
600 echo
'<br />'.translate(
'hipo_trash_warning_asset_linked_to', get_asset_tag_line($assetid),
'<u class="clickable" onclick="toggleNextElt(this, \'TABLE\')" title="'.translate(
'click_to_toggle_details').
'">'.translate(
'n_assets', count($links)).
'</u>');
602 <table
class=
"sq-backend-table" style=
"width: 80%; margin-left: 20px; display: none;">
604 foreach ($links as $link_data) {
605 $major = $GLOBALS[
'SQ_SYSTEM']->am->getAsset($link_data[
'majorid'], $link_data[
'major_type_code']);
606 $link_description = $major->describeLink($link_data[
'linkid']);
609 <td><?php echo get_asset_tag_line($major->id); ?></td>
610 <td><?php echo (!empty($link_description)) ? $link_description :
''; ?></td>
636 $warning_painted = FALSE;
637 foreach ($this->_running_vars[
'do_not_trash'] as $id => $data) {
638 if (isset($data[
'status'])) {
639 if (!$warning_painted) {
640 $o->openField(translate(
'hipo_safe_trash_status_title'),
'new_line');
641 ?><p><?php echo translate(
'hipo_safe_trash_status_msg') ?></p><?php
643 $warning_painted = TRUE;
646 echo translate(
'asset_format', $data[
'name'], $id).
' - ';
647 echo translate(
'current_status').
': ';
648 echo get_asset_status_icon($data[
'status']).get_status_description($data[
'status']).
'<br />';
652 if ($warning_painted) {
670 $warning_painted = FALSE;
671 foreach ($this->_running_vars[
'do_not_trash'] as $id => $data) {
672 if (isset($data[
'children'])) {
673 if (!$warning_painted) {
674 $o->openField(translate(
'hipo_safe_trash_children_title'),
'new_line');
675 echo
'<p>'.translate(
'hipo_safe_trash_children_msg').
'</p>';
677 $warning_painted = TRUE;
680 $details =
'<ul style="display: none">';
681 $problem_child_count = 0;
682 foreach ($data[
'children'] as $child_info) {
683 $details .=
'<li>'.translate(
'asset_format', $child_info[
'name'], $child_info[
'minorid']);
684 if ($child_info[
'link_type'] == SQ_LINK_TYPE_3 || $child_info[
'link_type'] == SQ_LINK_NOTICE) {
685 $details .=
' - '.translate(
'hipo_warning_safe_trash_link');
686 $problem_child_count++;
687 }
else if ($child_info[
'status'] >= SQ_STATUS_LIVE) {
688 $details .=
' - '.translate(
'current_status').
': '.get_asset_status_icon($child_info[
'status']).get_status_description($child_info[
'status']);
689 $problem_child_count++;
695 $code = ($problem_child_count == 1) ?
'hipo_safe_trash_child_label_one' :
'hipo_safe_trash_child_label_many';
696 $sub_code = ($problem_child_count == 1) ?
'1_child' :
'n_children';
697 echo
'<li>'.translate($code, translate(
'asset_format', $data[
'name'], $id),
'<u class="clickable" onclick="toggleNextElt(this, \'UL\')" title="'.translate(
'click_to_toggle_details').
'">'.translate($sub_code, $problem_child_count).
'</u>');
702 if ($warning_painted) {
721 $o->openField(translate(
'hipo_safe_trash_mark_future_title'),
'new_line');
723 $assetids = array_keys($this->_running_vars[
'do_not_trash']);
724 $asset_info = $GLOBALS[
'SQ_SYSTEM']->am->getAssetInfo($assetids);
726 ?><p>The assets that cannot be trashed due to Safe-Trash rules are listed below. Selecting assets from
this list will mark them
for future trashing. This creates a cron job that will automatically trash the asset as soon as the Safe-Trash rules are satisfied.</p>
728 <div
id=
"<?php echo $prefix ?>_mark">
730 if (count($assetids) > 1) {
733 <input type=
"checkbox" id=
"<?php echo $prefix ?>_mark_all" onclick=
"inputs = this.parentNode.getElementsByTagName('INPUT'); for (i = 0; i < inputs.length; i++) { if ((inputs[i].type == 'checkbox') && (inputs[i]!= this)) inputs[i].checked = this.checked; }">
734 <label
for=
"<?php echo $prefix ?>_mark_all"><em><?php echo translate(
'select_all'); ?></em></label>
737 $onclick =
'onclick="selall = document.getElementById(\''.$prefix.
'_mark_all\'); inputs = this.parentNode.parentNode.getElementsByTagName(\'INPUT\'); sel_value = true; for (i = 0; i < inputs.length; i++) { if ((inputs[i].type == \'checkbox\') && (inputs[i] != selall)) { sel_value = sel_value && inputs[i].checked; } if (!sel_value) break; } selall.checked = sel_value;"';
741 foreach ($assetids as $assetid) {
744 <input type=
"checkbox" name=
"<?php echo $prefix ?>_mark[<?php echo $assetid ?>]" id=
"<?php echo $prefix ?>_mark_<?php echo $assetid ?>" value=
"1" <?php echo $onclick; ?> >
745 <label
for=
"<?php echo $prefix ?>_mark_<?php echo $assetid ?>">
747 echo get_asset_type_icon($asset_info[$assetid][
'type_code']);
748 echo translate(
'asset_format', $asset_info[$assetid][
'name'], $assetid);
775 $existing_urls = $GLOBALS[
'SQ_SYSTEM']->am->getAssetURL(array_keys($this->_running_vars[
'assets']));
776 foreach ($existing_urls as $url) {
779 $o->openField(translate(
'hipo_trash_url_remapping_title'),
'new_line');
780 echo
'<p>'.translate(
'hipo_trash_url_remapping_msg').
'</p>';
781 asset_finder($prefix.
'_remap_new_url', NULL, Array(),
'sq_sidenav', isset($_GET[
'SQ_BACKEND_PAGE'])? FALSE : TRUE);
802 echo
'<p>'.translate(
'hipo_trash_url_remapping_choose_url').
':</p>';
803 foreach ($this->_running_vars[
'remap_choices'] as $i => $url) {
804 radio_button($prefix.
'_chosen_remap_url', $i, ($i==0));
805 label($url[
'url'], $prefix.
'_chosen_remap_url_'.$i);
827 if (isset($_POST[
'form_submitted'])) {
828 if (isset($_POST[$prefix.
'_chosen_remap_url'])) {
829 $dest_url_data = $this->_running_vars[
'remap_choices'][(int)$_POST[$prefix.
'_chosen_remap_url']];
830 $remap_url = ($dest_url_data[
'http'] ?
'http' :
'https').
'://'.$dest_url_data[
'url'];
831 $rm = $GLOBALS[
'SQ_SYSTEM']->am->getSystemAsset(
'remap_manager');
832 foreach ($this->_running_vars[
'assets'] as $source_assetid => $links) {
833 if (isset($this->_running_vars[
'do_not_trash'][$source_assetid])) {
836 if (!$rm->remapAllURLs($source_assetid, $remap_url)) {
837 $source_asset =$GLOBALS[
'SQ_SYSTEM']->am->getAsset($source_assetid);
838 $this->_tmp[
'message'] =
'<span style="color: #FF0000;">'.translate(
'hipo_cannot_remap_urls', htmlentities($source_asset->name, ENT_COMPAT, SQ_CONF_DEFAULT_CHARACTER_SET), $remap_url).
'</span>';
839 $GLOBALS[
'SQ_SYSTEM']->am->forgetAsset($remap_asset);
845 if (!empty($_POST[$prefix.
'_remap_new_url'][
'assetid'])) {
846 $dest_assetid = $_POST[$prefix.
'_remap_new_url'][
'assetid'];
847 $dest_urls = $GLOBALS[
'SQ_SYSTEM']->am->getURLs($dest_assetid);
848 switch (count($dest_urls)) {
851 $dest_url_data = reset($dest_urls);
852 $rm = $GLOBALS[
'SQ_SYSTEM']->am->getSystemAsset(
'remap_manager');
853 foreach ($this->_running_vars[
'assets'] as $source_assetid => $links) {
854 if (isset($this->_running_vars[
'do_not_trash'][$source_assetid])) {
857 if (!$rm->remapAllURLs($source_assetid, ($dest_url_data[
'http'] ?
'http' :
'https').
'://'.$dest_url_data[
'url'])) {
858 $source_asset =$GLOBALS[
'SQ_SYSTEM']->am->getAsset($source_assetid);
859 $this->_tmp[
'message'] =
'<span style="color: #FF0000;">'.translate(
'hipo_cannot_remap_urls', htmlentities($source_asset->name, ENT_COMPAT, SQ_CONF_DEFAULT_CHARACTER_SET), $dest_url_data[
'url']).
'</span>';
860 $GLOBALS[
'SQ_SYSTEM']->am->forgetAsset($remap_asset);
867 $remap_asset =$GLOBALS[
'SQ_SYSTEM']->am->getAsset($dest_assetid);
868 $this->_tmp[
'message'] =
'<span style="color: #FF0000;">'.translate(
'hipo_cannot_remap_links_without_destination_url', htmlentities($remap_asset->name, ENT_COMPAT, SQ_CONF_DEFAULT_CHARACTER_SET)).
'</span>';
869 $GLOBALS[
'SQ_SYSTEM']->am->forgetAsset($remap_asset);
874 $this->_running_vars[
'remap_choices'] = $dest_urls;
875 $step_data[
'percent_done'] = 75;
876 $ste_data[
'complete'] = FALSE;
882 if (isset($_POST[$prefix.
'_mark'])) {
883 $this->_running_vars[
'mark_for_deletion'] = $_POST[$prefix.
'_mark'];
889 if ($step_data[
'percent_done'] == 0) {
890 $step_data[
'percent_done'] = 50;
892 $step_data[
'percent_done'] = 100;
893 $step_data[
'complete'] = TRUE;
912 $GLOBALS[
'SQ_SYSTEM']->changeDatabaseConnection(
'db2');
913 $GLOBALS[
'SQ_SYSTEM']->doTransaction(
'BEGIN');
915 if (!isset($this->_running_vars[
'process_create_links'])) {
916 $this->_running_vars[
'process_create_links'] = $this->_running_vars[
'assets'];
918 if (!isset($this->_running_vars[
'done_links'])) {
919 $this->_running_vars[
'done_links'] = Array();
922 if (!isset($this->_running_vars[
'link_count'])) {
924 foreach ($this->_running_vars[
'assets'] as $assetid => $links) {
925 $link_count += count($links);
927 $this->_running_vars[
'link_count'] = $link_count;
930 $assets = $this->_running_vars[
'process_create_links'];
931 $assetid = key($assets);
932 $asset = $GLOBALS[
'SQ_SYSTEM']->am->getAsset($assetid);
933 $links = reset($assets);
935 $value = reset($links);
936 $link_idx = key($links);
937 unset($this->_running_vars[
'process_create_links'][$assetid][$link_idx]);
939 if ($this->_running_vars[
'link_action'] ==
'create') {
941 $new_parent = $GLOBALS[
'SQ_SYSTEM']->am->getAsset($this->_running_vars[
'to_parent_assetid']);
943 if (is_null($new_parent)) {
944 trigger_localised_error(
'HIPO0023', E_USER_WARNING, $this->_running_vars[
'to_parent_assetid']);
945 $GLOBALS[
'SQ_SYSTEM']->doTransaction(
'ROLLBACK');
946 $GLOBALS[
'SQ_SYSTEM']->restoreDatabaseConnection();
950 if (is_null($asset)) {
951 trigger_localised_error(
'HIPO0022', E_USER_WARNING, $assetid);
952 $GLOBALS[
'SQ_SYSTEM']->doTransaction(
'ROLLBACK');
953 $GLOBALS[
'SQ_SYSTEM']->restoreDatabaseConnection();
960 $trash_folder = $GLOBALS[
'SQ_SYSTEM']->am->getSystemAsset(
'trash_folder');
961 if ($new_parent->id != $trash_folder->id) {
962 if (($value[
'link_type'] & SQ_SC_LINK_SIGNIFICANT) && $GLOBALS[
'SQ_SYSTEM']->am->getLinkByAsset($new_parent->id, $asset->id, SQ_SC_LINK_SIGNIFICANT)) {
963 $to_parent_asset = $GLOBALS[
'SQ_SYSTEM']->am->getAsset($this->_running_vars[
'to_parent_assetid']);
964 trigger_localised_error(
'SYS0329', E_USER_WARNING, $asset->name, $asset->id, $to_parent_asset->name, $to_parent_asset->id);
965 $GLOBALS[
'SQ_SYSTEM']->am->forgetAsset($to_parent_asset);
966 $GLOBALS[
'SQ_SYSTEM']->doTransaction(
'ROLLBACK');
967 $GLOBALS[
'SQ_SYSTEM']->restoreDatabaseConnection();
972 $step_data[
'message'] =
'Creating a link between "'.htmlentities($asset->name, ENT_COMPAT, SQ_CONF_DEFAULT_CHARACTER_SET).
'" and "'.htmlentities($new_parent->name, ENT_COMPAT, SQ_CONF_DEFAULT_CHARACTER_SET).
'".';
974 if (isset($this->_running_vars[
'link_value']) && !empty($this->_running_vars[
'link_value'])) {
975 $value[
'value'] = $this->_running_vars[
'link_value'];
977 $value[
'value'] =
'';
980 $linkid = $new_parent->createLink($asset, $value[
'link_type'], $value[
'value'], $this->_running_vars[
'to_parent_pos']);
983 trigger_localised_error(
'HIPO0021', E_USER_WARNING, htmlentities($asset->name, ENT_COMPAT, SQ_CONF_DEFAULT_CHARACTER_SET), htmlentities($new_parent->name, ENT_COMPAT, SQ_CONF_DEFAULT_CHARACTER_SET));
984 $GLOBALS[
'SQ_SYSTEM']->doTransaction(
'ROLLBACK');
985 $GLOBALS[
'SQ_SYSTEM']->restoreDatabaseConnection();
989 $this->_running_vars[
'to_parent_pos']++;
990 $GLOBALS[
'SQ_SYSTEM']->doTransaction(
'COMMIT');
991 $GLOBALS[
'SQ_SYSTEM']->restoreDatabaseConnection();
992 $GLOBALS[
'SQ_SYSTEM']->am->forgetAsset($new_parent);
996 if ($this->_running_vars[
'can_skip_cascade']) {
998 $this->_running_vars[
'can_skip_cascade'] = FALSE;
1002 }
else if ($this->_running_vars[
'link_action'] ==
'move') {
1004 $link_info = $GLOBALS[
'SQ_SYSTEM']->am->getLinkById($value[
'linkid']);
1005 if ($link_info[
'locked'] ==
'1') {
1006 trigger_localised_error(
'HIPO0087', E_USER_WARNING, $assetid);
1007 $GLOBALS[
'SQ_SYSTEM']->doTransaction(
'ROLLBACK');
1008 $GLOBALS[
'SQ_SYSTEM']->restoreDatabaseConnection();
1015 $safe_trash = $GLOBALS[
'SQ_SYSTEM']->getUserPrefs(
'user',
'SQ_USER_SAFE_TYPE3_TRASH');
1016 $moving_to_trash = FALSE;
1019 $trash_folder = $GLOBALS[
'SQ_SYSTEM']->am->getSystemAsset(
'trash_folder');
1020 if ($this->_running_vars[
'to_parent_assetid'] == $trash_folder->id) {
1028 $moving_to_trash = TRUE;
1030 $id_parts = explode(
':', $assetid);
1031 if (isset($id_parts[1])) $bridge_id = $id_parts[0];
1033 $children = $GLOBALS[
'SQ_SYSTEM']->am->getChildren($assetid);
1038 if (!isset($this->_running_vars[
'do_not_trash'][$assetid])) {
1039 $this->_running_vars[
'assets_children'] = array_merge($this->_running_vars[
'assets_children'], array_keys($children));
1043 $affected_links = array_get_index(array_get_index($this->_running_vars,
'affected_links',Array()),$assetid,Array());
1044 foreach ($affected_links as $link) {
1047 if ($link[
'linkid'] !== $value[
'linkid'] && !$safe_trash) {
1048 $success = $GLOBALS[
'SQ_SYSTEM']->am->deleteAssetLink($link[
'linkid'], FALSE);
1057 if ($moving_to_trash && !is_null($bridge_id)) {
1059 $link = $GLOBALS[
'SQ_SYSTEM']->am->getLinkById($value[
'linkid'], $assetid,
'minor');
1063 if (!empty($link) && (FALSE === strpos($link[
'majorid'],
':')) && !implements_interface($asset,
'bridge')) {
1065 if (!$safe_trash || ($safe_trash && !in_array($assetid, array_keys($this->_running_vars[
'do_not_trash'])))) {
1067 if (!$GLOBALS[
'SQ_SYSTEM']->am->deleteAssetLink($value[
'linkid'], FALSE)) {
1068 trigger_localised_error(
'HIPO0019', E_USER_WARNING, $assetid);
1069 $GLOBALS[
'SQ_SYSTEM']->doTransaction(
'ROLLBACK');
1070 $GLOBALS[
'SQ_SYSTEM']->restoreDatabaseConnection();
1078 $bridge = $GLOBALS[
'SQ_SYSTEM']->am->getAsset($bridge_id);
1079 if (!$safe_trash || ($safe_trash && !in_array($assetid, array_keys($this->_running_vars[
'do_not_trash'])))) {
1081 if (!$bridge->deleteAssetLink($value[
'linkid'])) {
1082 trigger_localised_error(
'HIPO0019', E_USER_WARNING, $assetid);
1083 $GLOBALS[
'SQ_SYSTEM']->doTransaction(
'ROLLBACK');
1084 $GLOBALS[
'SQ_SYSTEM']->restoreDatabaseConnection();
1088 $GLOBALS[
'SQ_SYSTEM']->am->forgetAsset($bridge);
1092 $not_to_trash = !$moving_to_trash;
1093 $safe_to_trash = $moving_to_trash && (!$safe_trash || ($safe_trash && !in_array($assetid, array_keys($this->_running_vars[
'do_not_trash']))));
1096 if ($not_to_trash || $safe_to_trash) {
1098 $link = $GLOBALS[
'SQ_SYSTEM']->am->getLinkById($value[
'linkid'], $value[
'parentid']);
1099 $new_parent_info = $GLOBALS[
'SQ_SYSTEM']->am->getAssetInfo(Array($this->_running_vars[
'to_parent_assetid']));
1104 if ($not_to_trash) {
1105 if (($link[
'link_type'] & SQ_SC_LINK_SIGNIFICANT) && $GLOBALS[
'SQ_SYSTEM']->am->getLinkByAsset($this->_running_vars[
'to_parent_assetid'], $asset->id, SQ_SC_LINK_SIGNIFICANT)) {
1106 trigger_localised_error(
'SYS0329', E_USER_WARNING, $asset->name, $asset->id, $new_parent_info[$this->_running_vars[
'to_parent_assetid']][
'name'], $this->_running_vars[
'to_parent_assetid']);
1107 $GLOBALS[
'SQ_SYSTEM']->doTransaction(
'ROLLBACK');
1108 $GLOBALS[
'SQ_SYSTEM']->restoreDatabaseConnection();
1114 if ($this->_running_vars[
'can_skip_cascade']) {
1116 $this->_running_vars[
'can_skip_cascade'] = FALSE;
1120 $linkid = $GLOBALS[
'SQ_SYSTEM']->am->moveLink($value[
'linkid'], $this->_running_vars[
'to_parent_assetid'], $link[
'link_type'], $this->_running_vars[
'to_parent_pos']);
1122 trigger_localised_error(
'HIPO0020', E_USER_WARNING, $assetid, $this->_running_vars[
'to_parent_assetid']);
1123 $GLOBALS[
'SQ_SYSTEM']->doTransaction(
'ROLLBACK');
1124 $GLOBALS[
'SQ_SYSTEM']->restoreDatabaseConnection();
1128 $new_link = $GLOBALS[
'SQ_SYSTEM']->am->getLinkById($linkid);
1129 $asset = $GLOBALS[
'SQ_SYSTEM']->am->getAsset($new_link[
'minorid'], $new_link[
'minor_type_code']);
1131 if (is_null($asset)) {
1132 trigger_localised_error(
'HIPO0019', E_USER_WARNING, $assetid);
1133 $GLOBALS[
'SQ_SYSTEM']->doTransaction(
'ROLLBACK');
1134 $GLOBALS[
'SQ_SYSTEM']->restoreDatabaseConnection();
1138 $step_data[
'message'] = translate(
'hipo_move', htmlentities($asset->name, ENT_COMPAT, SQ_CONF_DEFAULT_CHARACTER_SET), htmlentities($new_parent_info[$this->_running_vars[
'to_parent_assetid']][
'name'], ENT_COMPAT, SQ_CONF_DEFAULT_CHARACTER_SET));
1140 $this->_running_vars[
'to_parent_pos']++;
1145 if (!$safe_to_trash) {
1146 $cron_manager = $GLOBALS[
'SQ_SYSTEM']->am->getSystemAsset(
'cron_manager');
1147 $GLOBALS[
'SQ_SYSTEM']->am->includeAsset(
'cron_job_attempt_safe_trash');
1149 if (isset($this->_running_vars[
'mark_for_deletion'][$asset->id])) {
1150 $link = $GLOBALS[
'SQ_SYSTEM']->am->getLink($assetid, SQ_LINK_NOTICE,
'cron_job_attempt_safe_trash', TRUE, NULL,
'minor');
1154 $cron_job->setAssetToUpdate($asset);
1156 $GLOBALS[
'SQ_SYSTEM']->changeDatabaseConnection(
'db2');
1157 $GLOBALS[
'SQ_SYSTEM']->doTransaction(
'BEGIN');
1158 if ($cron_manager->addJob($cron_job, $GLOBALS[
'SQ_SYSTEM']->user)) {
1159 $GLOBALS[
'SQ_SYSTEM']->doTransaction(
'COMMIT');
1161 $GLOBALS[
'SQ_SYSTEM']->doTransaction(
'ROLLBACK');
1163 $GLOBALS[
'SQ_SYSTEM']->restoreDatabaseConnection();
1165 $GLOBALS[
'SQ_SYSTEM']->am->forgetAsset($cron_job);
1169 $step_data[
'message'] = translate(
'hipo_creating_safe_trash_job', $asset->id);
1171 $step_data[
'message'] = translate(
'hipo_skipping_asset', $asset->id);
1177 $GLOBALS[
'SQ_SYSTEM']->doTransaction(
'COMMIT');
1178 $GLOBALS[
'SQ_SYSTEM']->restoreDatabaseConnection();
1182 if (empty($this->_running_vars[
'process_create_links'][$assetid])) {
1183 unset($this->_running_vars[
'process_create_links'][$assetid]);
1184 $this->_running_vars[
'done_links'][] = $assetid;
1187 if (empty($this->_running_vars[
'process_create_links'])) {
1188 unset($this->_running_vars[
'done_links']);
1189 $step_data[
'percent_done'] = 100;
1190 $step_data[
'complete'] = TRUE;
1192 if ($this->_running_vars[
'can_skip_cascade']) {
1202 $step_data[
'percent_done'] = ((count($this->_running_vars[
'done_links']) * 100) / $this->_running_vars[
'link_count']);
1203 $step_data[
'complete'] = FALSE;
1206 $GLOBALS[
'SQ_SYSTEM']->am->forgetAsset($asset);
1209 if (count(array_diff(array_keys($this->_running_vars[
'assets']), array_keys($this->_running_vars[
'do_not_trash']))) == 0) {
1210 if (empty($this->_running_vars[
'assets_children'])) {
1232 $hh = $GLOBALS[
'SQ_SYSTEM']->getHipoHerder();
1233 if (is_null($hh))
return FALSE;
1235 $assets = $this->_running_vars[
'assets'];
1238 for (reset($assets); NULL !== ($assetid = key($assets)); next($assets)) {
1239 $o->addHiddenField(
'link_assetid['.$c.
']', $assetid);
1243 $o->addHiddenField(
'link_parentid', $this->_running_vars[
'to_parent_assetid']);
1245 $parent = $GLOBALS[
'SQ_SYSTEM']->am->getAsset($this->_running_vars[
'to_parent_assetid']);
1246 if (is_null($parent)) {
1247 trigger_localised_error(
'HIPO0018', E_USER_WARNING, $this->_running_vars[
'to_parent_assetid']);
1251 $o->openSection(translate(
'note'));
1252 $o->openField(
' ');
1253 $o->addHiddenField(
'link_completed',
'0');
1255 if (count($this->_running_vars[
'assets']) > 0) {
1256 if ($this->_running_vars[
'link_action'] ==
'move') {
1257 $success_msg = translate(
'hipo_asset_move_successful', htmlentities($parent->name, ENT_COMPAT, SQ_CONF_DEFAULT_CHARACTER_SET));
1259 $success_msg = translate(
'hipo_asset_link_successful', htmlentities($parent->name, ENT_COMPAT, SQ_CONF_DEFAULT_CHARACTER_SET));
1261 echo
'<p><b>'.$success_msg.
'</b></p>';
1263 for (reset($assets); NULL !== ($assetid = key($assets)); next($assets)) {
1264 $asset_info = $GLOBALS[
'SQ_SYSTEM']->am->getAssetInfo(Array($assetid,));
1265 echo
'<li>"'.$asset_info[$assetid][
'name'].
'"</li>';
1272 <p><?php echo translate(
'hipo_permission_workflow_metadata_display', htmlentities($parent->name, ENT_COMPAT, SQ_CONF_DEFAULT_CHARACTER_SET)); ?></p>
1273 <p><?php echo translate(
'hipo_permission_workflow_metadata_cascade_select', htmlentities($parent->name, ENT_COMPAT, SQ_CONF_DEFAULT_CHARACTER_SET)); ?></p>
1274 <p><?php echo translate(
'hipo_permission_workflow_metadata_cascade_none'); ?></p>
1276 $ei = $parent->getEI();
1278 $ei->includeStaticScreen(
'permissions');
1279 $pe = paintInlinePermissions($parent, $o, $ei);
1281 $ei->includeStaticScreen(
'workflow');
1282 $wf = paintInlineWorkflow($parent, $o, $ei);
1284 $ei->includeStaticScreen(
'metadataSchemas');
1285 $ms = paintInlineMetadataSchemas($parent, $o, $ei);
1287 $ei->includeStaticScreen(
'tagging');
1288 $ta = paintInlineTagging($parent, $o, $ei);
1290 $ei->includeStaticScreen(
'roles');
1291 $ro = paintInlineRoles($parent, $o, $ei);
1293 $o->addHiddenField(
'form_submitted', 1);
1297 $o->openSection(translate(
'cascade'));
1298 $o->openField(
'',
'cascade');
1299 echo ($pe) ? translate(
'permissions').
' '.check_box(
'cascade[]',
'cascade_pe').
'<br />' :
'';
1300 echo ($ms) ? translate(
'metadata_schemas').
' '.check_box(
'cascade[]',
'cascade_ms').
'<br />' :
'';
1301 echo ($wf) ? translate(
'workflow').
' '.check_box(
'cascade[]',
'cascade_wf').
'<br />' :
'';
1302 echo ($ta) ? translate(
'content_tags').
' '.check_box(
'cascade[]',
'cascade_ta').
'<br />' :
'';
1303 echo ($ro) ? translate(
'roles').
' '.check_box(
'cascade[]',
'cascade_ro').
'<br />' :
'';
1307 $GLOBALS[
'SQ_SYSTEM']->am->forgetAsset($parent);
1327 if (isset($_REQUEST[
'form_submitted'])) {
1328 if (isset($_REQUEST[
'cascade'])) {
1330 if (!in_array(
'cascade_pe', $_REQUEST[
'cascade'])) {
1334 if (!in_array(
'cascade_ms', $_REQUEST[
'cascade'])) {
1338 if (!in_array(
'cascade_wf', $_REQUEST[
'cascade'])) {
1342 if (!in_array(
'cascade_ta', $_REQUEST[
'cascade'])) {
1346 if (!in_array(
'cascade_ro', $_REQUEST[
'cascade'])) {
1356 $step_data[
'percent_done'] = 100;
1357 $step_data[
'complete'] = TRUE;
1378 $perms = Array(
'Read' => SQ_PERMISSION_READ,
'Write' => SQ_PERMISSION_WRITE,
'Administrator' => SQ_PERMISSION_ADMIN);
1379 foreach ($perms as $title => $perm) {
1380 $permissions = $GLOBALS[
'SQ_SYSTEM']->am->getAssetPermissionByCascade($assetid, $perm, NULL, NULL);
1381 $ppermissions = $GLOBALS[
'SQ_SYSTEM']->am->getAssetPermissionByCascade($parentid, $perm, NULL, TRUE);
1382 $diff = array_diff_assoc($ppermissions, $permissions);
1383 if (!empty($diff))
return FALSE;
1387 $wfm = $GLOBALS[
'SQ_SYSTEM']->getWorkflowManager();
1388 $schemas = $wfm->getSchemas($assetid, NULL, NULL);
1389 $pschemas = $wfm->getSchemas($parentid, NULL, TRUE);
1390 $diff = array_diff_assoc($pschemas, $schemas);
1391 if (!empty($diff))
return FALSE;
1395 $mm = $GLOBALS[
'SQ_SYSTEM']->getMetadataManager();
1396 $schemas = $mm->getSchemas($assetid, NULL, NULL);
1397 $pschemas = $mm->getSchemas($parentid, NULL, TRUE);
1398 $diff = array_diff_assoc($pschemas, $schemas);
1399 if (!empty($diff))
return FALSE;
1402 $tag_manager = $GLOBALS[
'SQ_SYSTEM']->getTagManager();
1403 $tls = $tag_manager->getTagLinks($assetid);
1404 $ptls = $tag_manager->getTagLinks($parentid);
1406 $num_ptls = count($ptls);
1407 if ($num_ptls != 0) {
1408 if ($num_ptls == count($tls)) {
1409 foreach ($ptls as $pkey => $plink_details) {
1411 foreach ($tls as $tkey => $tlink_details) {
1412 if ($plink_details[
'minorid'] == $tlink_details[
'minorid']) {
1416 if (!$tag_found)
return FALSE;
1424 $roles = $GLOBALS[
'SQ_SYSTEM']->am->getRole($assetid);
1425 $proles = $GLOBALS[
'SQ_SYSTEM']->am->getRole($parentid);
1426 $diff = array_diff_assoc($proles, $roles);
1427 if (!empty($diff))
return FALSE;
1449 $job_type =
'hipo_job_update_lookups';
1450 $options[
'auto_complete'] = TRUE;
1452 $assetids = Array();
1453 $assets = $this->_running_vars[
'assets'];
1454 for (reset($assets); NULL !== ($assetid = key($assets)); next($assets)) {
1455 if (!isset($this->_running_vars[
'do_not_trash'][$assetid])) {
1456 $assetids[] = $assetid;
1460 if (!empty($this->_running_vars[
'assets_children'])) {
1461 $assetids = array_merge($assetids, $this->_running_vars[
'assets_children']);
1464 $running_vars[
'assetids'] = $assetids;
1481 $job_type =
'hipo_job_edit_permissions';
1482 $permission_vars = Array();
1484 foreach (Array(SQ_PERMISSION_READ, SQ_PERMISSION_WRITE, SQ_PERMISSION_ADMIN) as $perm) {
1485 $set_perms = $GLOBALS[
'SQ_SYSTEM']->am->getAssetPermissionByCascade($this->_running_vars[
'to_parent_assetid'], $perm, NULL, TRUE);
1487 foreach ($set_perms as $userid => $perm_data) {
1488 $permission_vars[] = Array(
1489 'permission' => $perm,
1490 'granted' => $perm_data[
'granted'],
1491 'userid' => $perm_data[
'userid'],
1492 'previous_access' => NULL,
1493 'assetids' => array_keys($this->_running_vars[
'assets']),
1499 $running_vars[
'permission_changes'] = $permission_vars;
1516 $job_type =
'hipo_job_edit_metadata_schemas';
1517 $mm = $GLOBALS[
'SQ_SYSTEM']->getMetadataManager();
1518 $schemas = $mm->getSchemas($this->_running_vars[
'to_parent_assetid'], NULL, TRUE);
1519 $schema_vars = Array();
1521 foreach ($schemas as $schemaid => $granted) {
1522 $schema_vars[] = Array(
1523 'assetids' => array_keys($this->_running_vars[
'assets']),
1524 'granted' => $granted,
1525 'schemaid' => $schemaid,
1527 'previous_access' => NULL,
1530 $running_vars[
'schema_changes'] = $schema_vars;
1531 $running_vars[
'assets'] = $this->_running_vars[
'assets'];
1548 $job_type =
'hipo_job_edit_workflow_schemas';
1549 $wfm = $GLOBALS[
'SQ_SYSTEM']->getWorkflowManager();
1550 $schemas = $wfm->getSchemas($this->_running_vars[
'to_parent_assetid'], NULL, FALSE, TRUE);
1551 $schema_vars = Array();
1553 foreach ($schemas as $schemaid => $granted) {
1554 $schema_vars[] = Array(
1555 'assetids' => array_keys($this->_running_vars[
'assets']),
1556 'granted' => $granted,
1557 'schemaid' => $schemaid,
1559 'previous_access' => NULL,
1562 $running_vars[
'schema_changes'] = $schema_vars;
1579 $job_type =
'hipo_job_edit_tags';
1580 $tag_manager = $GLOBALS[
'SQ_SYSTEM']->getTagManager();
1581 $current_tag_links = $tag_manager->getTagLinks($this->_running_vars[
'to_parent_assetid']);
1582 $tag_vars = Array();
1584 foreach ($current_tag_links as $link) {
1585 $tag_vars[] = Array(
1586 'tag_id' => $link[
'minorid'],
1588 'weight' => $link[
'value'],
1592 $running_vars[
'tag_changes'] = $tag_vars;
1593 $running_vars[
'assets'] = $this->_running_vars[
'assets'];
1610 $job_type =
'hipo_job_edit_roles';
1611 $roles = $GLOBALS[
'SQ_SYSTEM']->am->getRole($this->_running_vars[
'to_parent_assetid']);
1612 $roles_vars = Array();
1614 foreach ($roles as $roleid => $users) {
1615 $role_vars[
'add'][$roleid] = $users;
1617 $running_vars[
'role_changes'] = $role_vars;
1618 $running_vars[
'assets'] = $this->_running_vars[
'assets'];
1637 if ($step_data[
'percent_done'] > 0) {
1638 $o->addOnLoad(
'if (window.opener.parent.frames["sq_sidenav"] && window.opener.parent.frames["sq_sidenav"].reload_asset) window.opener.parent.frames["sq_sidenav"].reload_asset("'.$this->_running_vars[
'to_parent_assetid'].
'");');
1640 $refreshids = Array();
1642 foreach ($this->_running_vars[
'assets'] as $links) {
1643 foreach ($links as $link) {
1644 $refreshids[] = $link[
'parentid'];
1647 $refreshids = array_unique($refreshids);
1649 foreach ($refreshids as $refreshid) {
1650 $o->addOnLoad(
'if (window.opener.parent.frames["sq_sidenav"] && window.opener.parent.frames["sq_sidenav"].reload_asset) window.opener.parent.frames["sq_sidenav"].reload_asset("'.$refreshid.
'");');
1670 if ($step_data[
'percent_done'] == 0) {
1671 $step_data[
'percent_done'] = 50;
1673 $step_data[
'percent_done'] = 100;
1674 $step_data[
'complete'] = TRUE;
1690 $step_data = Array();
1691 $this->_running_vars[
'can_skip_cascade'] = FALSE;
1695 while ($result && !array_get_index($step_data,
'complete')) {
1699 $this->
_addError(
'creating links failed');
1704 $hh = $GLOBALS[
'SQ_SYSTEM']->getHipoHerder();
1705 $vars = Array(
'assetids' => array_keys($this->_running_vars[
'assets']));
1707 $lookup_errors = $hh->freestyleHipo(
'hipo_job_update_lookups', $vars);
1708 if (!empty($lookup_errors)) {
1709 $this->
_addError(
'hipo_job_update_lookups failed');
1714 $cascading_list = Array(
1715 'cascadePermissions' =>
'cascade_pe',
1716 'cascadeMetadata' =>
'cascade_ms',
1717 'cascadeWorkflow' =>
'cascade_wf',
1718 'cascadeTags' =>
'cascade_ta',
1721 foreach ($cascading_list as $fn_name => $value) {
1723 $running_vars = Array();
1726 if (isset($this->_running_vars[$value]) && $this->_running_vars[$value]) {
1727 $this->$fn_name($job_type, $running_vars, $options);
1728 $errors = $hh->freestyleHipo($job_type, $running_vars);
1731 if (!empty($errors)) {
1732 $this->
_addError(
'error occured during '.$fn_name);