18 require_once SQ_INCLUDE_PATH.
'/asset_edit/asset_edit_fns.inc';
40 parent::__construct();
41 $this->static_screens[
'details'][
'force_unlock'] = FALSE;
58 $link_value = $asset->attr(
'code');
78 $link_value = $asset->getOldAttrValue(
'code');
97 $rules = $asset->attr(
'rules');
99 $rules[] = Array(
'rule_type_code' =>
'promotional_rule_type_quantity',
'rule_data' => NULL);
102 $am = $GLOBALS[
'SQ_SYSTEM']->am;
103 $write_access = $asset->writeAccess(
'attributes');
105 for ($i = 0; $i < count($rules); $i++) {
107 $rule_type_code = $rule[
'rule_type_code'];
108 $am->includeAsset($rule_type_code);
109 $rule_asset =
new $rule_type_code();
110 $rule_edit_fns = $rule_asset->getEditFns();
113 $o->openSection($am->getTypeInfo($rule_type_code,
'name'));
114 $rule_edit_fns->paintRule($rule_asset, $o, $prefix.
'_rule_'.$i, $rule[
'rule_data'], $write_access);
133 if (!$asset->writeAccess(
'attributes'))
return FALSE;
135 $rules = $asset->attr(
'rules');
137 $rules[] = Array(
'rule_type_code' =>
'promotional_rule_type_quantity',
'rule_data' => NULL);
141 for ($i = 0; $i < count($rules); $i++) {
143 $rule_type_code = $rule[
'rule_type_code'];
144 $GLOBALS[
'SQ_SYSTEM']->am->includeAsset($rule_type_code);
145 $rule_asset =
new $rule_type_code();
146 $rule_edit_fns = $rule_asset->getEditFns();
148 if (!$rule_edit_fns->processRule($rule_asset, $o, $prefix.
'_rule_'.$i, $rule[
'rule_data'])) {
154 return $success && $asset->setAttrValue(
'rules', $rules);