17 require_once SQ_CORE_PACKAGE_PATH.
'/page/page_edit_fns.inc';
40 parent::__construct();
41 $this->static_screens[
'details'][
'lock_type'] =
'content';
58 $report_path = $asset->data_path.
'/report.xml';
59 if (!is_file($report_path)) {
60 $o->
note(translate(
'report_not_generated'));
62 $o->
note(translate(
'core_report_last_generated', $asset->
attr(
'generated_date'), $asset->
attr(
'generated_user')));
66 check_box($prefix.
'_regenerate');
67 label(translate(
'core_generate_report'), $prefix.
'_regenerate');
87 if (!isset($_POST[$prefix.
'_regenerate']) || !$_POST[$prefix.
'_regenerate']) {
91 $user = $GLOBALS[
'SQ_SYSTEM']->user;
92 $hh = $GLOBALS[
'SQ_SYSTEM']->getHipoHerder();
94 'assetid' => $asset->id,
95 'userid' => $user->id,
96 'generated_date' => date(
'F j, Y, g:i a'),
98 $hh->queueHipo(
'hipo_job_generate_report', $vars);
102 $asset->
setAttrValue(
'generated_date', date(
'F j, Y, g:i a'));
103 $asset->
setAttrValue(
'generated_user', $user->name.
' (#'.$user->id.
')');
122 $root_link = $GLOBALS[
'SQ_SYSTEM']->am->getLink($asset->id, SQ_LINK_NOTICE,
'', FALSE,
'root');
125 if (!$write_access) {
126 if (!empty($root_link)) {
127 echo get_asset_tag_line($root_link[
'minorid']);
129 echo translate(
'core_no_selected_root_node');
132 asset_finder($prefix.
'_rootid', (!empty($root_link)) ? $root_link[
'minorid'] :
'');
135 return $write_access;
152 if (!isset($_POST[$prefix.
'_rootid'][
'assetid']) || (isset($asset->_tmp[
'reverting_to_system_version']) && $asset->_tmp[
'reverting_to_system_version']) ) {
157 $new_root = $_POST[$prefix.
'_rootid'][
'assetid'];
160 $root_link = $GLOBALS[
'SQ_SYSTEM']->am->getLink($asset->id, SQ_LINK_NOTICE,
'', FALSE,
'root');
163 if (!empty($root_link) && $root_link[
'minorid'] == $new_root) {
169 $GLOBALS[
'SQ_SYSTEM']->changeDatabaseConnection(
'db2');
170 $GLOBALS[
'SQ_SYSTEM']->doTransaction(
'BEGIN');
173 if (!empty($root_link) && !$GLOBALS[
'SQ_SYSTEM']->am->deleteAssetLink($root_link[
'linkid'])) {
175 }
else if ($new_root) {
176 $root = $GLOBALS[
'SQ_SYSTEM']->am->getAsset($new_root);
177 if (!is_null($root)) {
178 if (!$asset->
createLink($root, SQ_LINK_NOTICE,
'root')) {
180 trigger_localised_error(
'CORE0029', E_USER_WARNING, $root->name);
186 $GLOBALS[
'SQ_SYSTEM']->doTransaction(
'COMMIT');
188 $GLOBALS[
'SQ_SYSTEM']->doTransaction(
'ROLLBACK');
191 $GLOBALS[
'SQ_SYSTEM']->restoreDatabaseConnection();
207 $root_link = $GLOBALS[
'SQ_SYSTEM']->am->getLink($asset->id, SQ_LINK_NOTICE,
'', FALSE,
'root');
208 if (!empty($root_link))
return $root_link[
'minorid'];
228 echo translate(
'core_no_visual_report');
264 trigger_localised_error(
'CORE0079', E_USER_WARNING);
265 $step_data[
'percent_done'] = 100;
266 $step_data[
'complete'] = TRUE;