18 require_once SQ_INCLUDE_PATH.
'/asset_management.inc';
44 'bodycopy_points' => Array(
46 'type' =>
'serialise',
65 'event_name' =>
'requestKeywords',
66 'broadcast_type_code' =>
'content_type',
67 'broadcast_strict_type_code' => FALSE,
69 'side_of_link' =>
'major',
71 'is_exclusive' => NULL,
72 'is_dependant' => TRUE,
74 'link_type' => SQ_LINK_TYPE_2,
92 if (!parent::_upgrade($current_version))
return FALSE;
94 if (version_compare($current_version,
'0.2',
'<')) {
95 pre_echo(
'UPGRADING DECISION TREE FROM v < 0.2');
97 $page_ids = $GLOBALS[
'SQ_SYSTEM']->am->getTypeAssetids(
'page_decision_tree', TRUE, TRUE);
98 foreach ($page_ids as $page_id => $type) {
99 $page = $GLOBALS[
'SQ_SYSTEM']->am->getAsset($page_id, $type[
'type_code']);
101 $first_link = $GLOBALS[
'SQ_SYSTEM']->am->getLink($page->id, SQ_LINK_TYPE_2,
'decision_tree_question', FALSE,
'first_question',
'major', TRUE);
102 if (!empty($first_link)){
103 $first_question = $GLOBALS[
'SQ_SYSTEM']->am->getAsset($first_link[
'minorid']);
104 if ($GLOBALS[
'SQ_SYSTEM']->am->createAssetLink($page, $first_question, SQ_LINK_NOTICE,
'first_question')){
105 $GLOBALS[
'SQ_SYSTEM']->am->updateLink($first_link[
'linkid'], NULL,
'');
109 $GLOBALS[
'SQ_SYSTEM']->am->forgetAsset($page);