17 require_once SQ_INCLUDE_PATH.
'/asset_edit/asset_edit_fns.inc';
40 parent::__construct();
42 $this->static_screens = Array(
45 'force_unlock' => FALSE,
46 'lock_type' =>
'menu',
48 'permissions' => Array(
49 'name' =>
'Permissions',
50 'force_unlock' => TRUE,
51 'lock_type' =>
'permissions',
55 'force_unlock' => TRUE,
56 'lock_type' =>
'links',
60 'force_unlock' => TRUE,
61 'lock_type' =>
'none',
80 $write_access = $asset->writeAccess(
'attributes');
82 $settings = $asset->attr(
'settings');
83 $current = (isset($settings[
'root'])) ? $settings[
'root'] : Array();
86 multiple_asset_finder($prefix.
'_roots', $current);
88 ?><ul style=
"margin: 1px 15px"><?php
89 foreach ($current as $assetid) {
90 if (!empty($assetid)) {
91 ?><li><?php echo get_asset_tag_line($assetid) ?></li><?php
93 echo translate(
'sch_folder_no_search_root');
117 if (!$asset->writeAccess(
'attributes'))
return FALSE;
119 $settings = $asset->attr(
'settings');
120 $settings[
'root'] = Array();
122 if (is_array($_POST[$prefix.
'_roots'])) {
123 foreach ($_POST[$prefix.
'_roots'] as $root_node) {
124 if (!empty($root_node[
'assetid'])) {
125 $settings[
'root'][] = $root_node[
'assetid'];
130 return $asset->setAttrValue(
'settings', $settings);
147 $write_access = $asset->writeAccess(
'attributes');
149 $settings = $asset->attr(
'settings');
150 $current = (isset($settings[
'phrase'])) ? $settings[
'phrase'] :
'';
153 text_box($prefix.
'_phrase', $current, 50);
155 if (empty($current)) {
156 echo translate(
'sch_folder_no_search_phrase');
162 return $write_access;
180 if (!$asset->writeAccess(
'attributes'))
return FALSE;
182 $settings = $asset->attr(
'settings');
184 if (isset($_POST[$prefix.
'_phrase'])) {
185 $settings[
'phrase'] = trim($_POST[$prefix.
'_phrase']);
187 $settings[
'phrase'] =
'';
190 return $asset->setAttrValue(
'settings', $settings);
207 $write_access = $asset->writeAccess(
'attributes');
209 $settings = $asset->attr(
'settings');
210 $current = (isset($settings[
'logic'])) ? $settings[
'logic'] :
'and';
213 combo_box($prefix.
'_logic', Array(
'and' => translate(
'sch_folder_logic_and'),
'or' => translate(
'sch_folder_logic_or')), FALSE, $current);
215 echo translate(
'sch_folder_logic_'.$current);
218 return $write_access;
236 if (!$asset->writeAccess(
'attributes'))
return FALSE;
238 $settings = $asset->attr(
'settings');
240 if (isset($_POST[$prefix.
'_logic'])) {
241 $settings[
'logic'] = trim($_POST[$prefix.
'_logic']);
243 $settings[
'logic'] =
'';
246 return $asset->setAttrValue(
'settings', $settings);
263 require_once SQ_INCLUDE_PATH.
'/general_occasional.inc';
264 $write_access = $asset->writeAccess(
'attributes');
266 $settings = $asset->attr(
'settings');
267 $current = (isset($settings[
'statuses'])) ? $settings[
'statuses'] : Array();
270 require_once SQ_LIB_PATH.
'/html_form/html_form.inc';
271 $statuses = get_constant_values(
'SQ_STATUS');
274 foreach ($statuses as $constant => $value) {
275 $options[$value] = get_status_description($value);
278 combo_box($prefix.
'_statuses', $options, TRUE, $current);
280 if (empty($current)) {
281 echo translate(
'no_status_selected');
283 ?><ul style=
"margin: 1px 15px"><?php
284 foreach ($current as $status) {
286 echo get_asset_status_icon($status);
287 echo get_status_description($status);
294 return $write_access;
312 if (!$asset->writeAccess(
'attributes'))
return FALSE;
314 $settings = $asset->attr(
'settings');
316 if (isset($_POST[$prefix.
'_statuses'])) {
317 $settings[
'statuses'] = Array();
318 foreach ($_POST[$prefix.
'_statuses'] as $status) {
319 $settings[
'statuses'][] = $status;
321 $settings[
'statuses'] = array_unique($settings[
'statuses']);
323 $settings[
'statuses'] = Array();
326 return $asset->setAttrValue(
'settings', $settings);
343 $settings = $asset->attr(
'settings');
344 $types = array_get_index($settings,
'types', Array());
345 if ($asset->writeAccess(
'attributes')) {
347 $display_values = Array(
'type_code' => Array(),
'inherit' => Array());
348 foreach ($types as $type => $inherit) {
349 $display_values[
'type_code'][] = $type;
350 $display_values[
'inherit'][] = $inherit;
352 asset_type_chooser($prefix.
'_types', TRUE, $display_values, NULL, FALSE, TRUE);
357 echo
'<p class="sq-backend-warning">'.translate(
'sch_no_asset_types_selected').
'</p>';
359 $type_names = $GLOBALS[
'SQ_SYSTEM']->am->getTypeInfo(array_keys($types),
'name');
361 <table
class=
"sq-backend-table">
363 <th><?php echo translate(
'type'); ?></th>
364 <th><?php echo translate(
'inherit_question'); ?></th>
367 $inherit_image_path = sq_web_path(
'lib').
'/web/images/';
368 foreach ($types as $type => $inherit) {
369 $inherit_image = $inherit_image_path.($inherit ?
'tick' :
'cross').
'.gif';
370 $inherit_alt = $inherit ? translate(
'yes') : translate(
'no');
373 <td><?php echo get_asset_type_icon($type).$type_names[$type]; ?></td>
374 <td><img src=
"<?php echo $inherit_image; ?>" alt=
"<?php echo $inherit_alt; ?>" /></td>
400 $settings = $asset->attr(
'settings');
402 $submitted_types = Array();
403 foreach ($_POST[$prefix.
'_types'][
'type_code'] as $i => $type_code) {
404 if (!empty($type_code)) {
405 $submitted_types[$type_code] = $_POST[$prefix.
'_types'][
'inherit'][$i];
409 $settings[
'types'] = $submitted_types;
410 return $asset->setAttrValue(
'settings', $settings);