17 require_once SQ_LIB_PATH.
'/html_form/html_form.inc';
39 function paintDependants(&$owner, &$o, &$ei, $keywords=NULL)
45 if (SQ_IN_LIMBO)
return FALSE;
46 $o->openSection(translate(
'current_lock_status'));
47 $o->openField(
' ');
49 $locks = $GLOBALS[
'SQ_SYSTEM']->am->getLockInfo($owner->id,
'all');
50 $locks_acquired = Array();
51 foreach ($locks as $lock_type => $lock) {
53 $locks_acquired[] = ucwords(str_replace(
'_',
' ', $lock_type));
57 if (!empty($locks_acquired)) {
58 $lock_message = translate(
'locked_types',
'<span style="color:red"><b>[',
']</b></span> (', implode(
', ', $locks_acquired).
')');
60 $lock_message =
'<span style="color:green"><b>['.translate(
'unlocked').
']</b></span>';
64 <table cellpadding=
"0" cellspacing=
"0" border=
"0" width=
"100%">
66 <td
class=
"sq-backend-data">
67 <table cellpadding=
"0" cellspacing=
"0" border=
"0">
69 <td
class=
"sq-backend-data"><img src=
"<?php echo $o->filesPath('/images/blank.gif');?>" width=
"20" height=
"20" border=
"0" alt=
"" /></td>
70 <td
class=
"sq-backend-data" nowrap=
"nowrap">
71 <!-- <a href=
"<?php echo $owner->getBackendHref('dependants'); ?>"><b><?php echo $owner->name; ?></b></a> -->
72 <?php echo get_asset_tag_line($owner->id,
'dependants'); ?>
77 <td><img src=
"<?php echo $o->filesPath('/images/blank.gif');?>" width=
"5" height=
"1" border=
"0" alt=
"" /></td>
78 <td
class=
"sq-backend-data" nowrap=
"nowrap">
79 <?php echo $lock_message; ?>
81 <td background=
"<?php echo $o->filesPath('/images/tree/stalk.gif'); ?>"><img src=
"<?php echo $o->filesPath('/images/blank.gif');?>" width=
"20" height=
"1" border=
"0" alt=
"" /></td>
82 <td
class=
"sq-backend-data" colspan=
"3" nowrap=
"nowrap">
83 <?php echo $owner->getStatusDescription(); ?>
85 <td width=
"100%"> </td>
87 <?php _recursePaintDependants($owner, $owner, $o); ?>
91 <td
class=
"sq-backend-data"><span style=
"color:red"><b>*</b></span></td>
92 <td
class=
"sq-backend-data">
93 <?php echo translate(
'status_dependence_higher', htmlspecialchars($owner->name, ENT_COMPAT, SQ_CONF_DEFAULT_CHARACTER_SET)); ?>
97 <td
class=
"sq-backend-data"><span style=
"color:red"><b>**</b></span></td>
98 <td
class=
"sq-backend-data">
99 <?php echo translate(
'status_dependence_lower', htmlspecialchars($owner->name, ENT_COMPAT, SQ_CONF_DEFAULT_CHARACTER_SET)); ?>
124 function _recursePaintDependants(&$owner, &$asset, &$o, $levels=1, $print_stalks_at=Array())
126 $dependant_links = $GLOBALS[
'SQ_SYSTEM']->am->getLinks($asset->id, SQ_SC_LINK_SIGNIFICANT,
'', TRUE,
'major', NULL, 1);
127 $num_kids = count($dependant_links);
128 for ($i = 0; $i < $num_kids; $i++) {
129 $dep_asset = $GLOBALS[
'SQ_SYSTEM']->am->getAsset($dependant_links[$i][
'minorid'], $dependant_links[$i][
'minor_type_code']);
130 $end = ($i == $num_kids - 1);
131 $stalk =
'background="'.$o->filesPath(
'/images/tree/stalk.gif').
'"';
132 $bg = ($end) ?
'' : $stalk;
134 $locks = $GLOBALS[
'SQ_SYSTEM']->am->getLockInfo($dep_asset->id,
'all');
135 $locks_acquired = Array();
136 foreach ($locks as $lock_type => $lock) {
138 $locks_acquired[] = ucwords(str_replace(
'_',
' ', $lock_type));
142 if (!empty($locks_acquired)) {
143 $lock_message = translate(
'locked_types',
'<span style="color:red"><b>[',
']</b></span> (', implode(
', ', $locks_acquired).
')');
145 $lock_message =
'<span style="color:green"><b>['.translate(
'unlocked').
']</b></span>';
148 $status_message =
'';
149 if ($dep_asset->status < $owner->status) {
150 $status_message =
'<span style="color:red"><b>**</b></span>';
151 }
else if ($dep_asset->status > $owner->status) {
152 $status_message =
'<span style="color:red"><b>*</b></span>';
155 $new_print_stalks_at = Array();
159 <td
class=
"sq-backend-data">
160 <table cellpadding=
"0" cellspacing=
"0" border=
"0">
163 for ($x = 0; $x < $levels; $x++) {
165 if (in_array($x, $print_stalks_at)) {
167 $new_print_stalks_at[] = $x;
170 <td
class=
"sq-backend-data" <?php echo $stalk_bg; ?>><img src=
"<?php echo $o->filesPath('/images/blank.gif'); ?>" width=
"20" height=
"1" alt=
"blank" /></td>
174 <td
class=
"sq-backend-data" <?php echo $bg; ?>><img src=
"<?php echo $o->filesPath('/images/tree/branch.gif');?>" width=
"20" height=
"20" border=
"0" alt=
"branch" /></td>
175 <td
class=
"sq-backend-data" nowrap=
"nowrap">
178 echo get_asset_tag_line($dependant_links[$i][
'minorid'],
'dependants'); ?>
179 <!-- <a href=
"<?php echo $dep_asset->getBackendHref('dependants'); ?>"><b><?php echo $dep_asset->name; ?></b></a> -->
184 <td><img src=
"<?php echo $o->filesPath('/images/blank.gif');?>" width=
"5" height=
"1" border=
"0" alt=
"" /></td>
185 <td
class=
"sq-backend-data" nowrap=
"nowrap">
186 <?php echo $lock_message; ?>
188 <td background=
"<?php echo $o->filesPath('/images/tree/stalk.gif'); ?>"><img src=
"<?php echo $o->filesPath('/images/blank.gif');?>" width=
"20" height=
"1" border=
"0" alt=
"" /></td>
189 <td
class=
"sq-backend-data" nowrap=
"nowrap">
190 <?php echo $dep_asset->getStatusDescription(); ?>
192 <td><img src=
"<?php echo $o->filesPath('/images/blank.gif');?>" width=
"5" height=
"1" border=
"0" alt=
"" /></td>
193 <td
class=
"sq-backend-data" nowrap=
"nowrap">
194 <?php echo $status_message; ?>
198 $child_deps = $GLOBALS[
'SQ_SYSTEM']->am->getLinks($dep_asset->id, SQ_SC_LINK_SIGNIFICANT,
'', TRUE,
'major', NULL, 1);
200 if (!empty($bg)) $new_print_stalks_at[] = $levels;
202 if (!empty($child_deps)) {
203 _recursePaintDependants($owner, $dep_asset, $o, ($levels+1), $new_print_stalks_at);
221 function processDependants(&$owner, &$o, &$ei)