5 * Copyright 1999-2001 (c) VA Linux Systems
6 * Copyright 2010 Roland Mas
7 * Copyright (C) 2011-2012 Alain Peyrat - Alcatel-Lucent
8 * Copyright 2011, Iñigo Martinez
9 * Copyright 2012, Thorsten “mirabilos” Glaser <t.glaser@tarent.de>
10 * Copyright 2012-2017, Franck Villaume - TrivialDev
11 * Copyright 2014, Stéphane-Eymeric Bredthauer
12 * Copyright 2016-2017, Stéphane-Eymeric Bredthauer - TrivialDev
13 * http://fusionforge.org
15 * This file is part of FusionForge. FusionForge is free software;
16 * you can redistribute it and/or modify it under the terms of the
17 * GNU General Public License as published by the Free Software
18 * Foundation; either version 2 of the Licence, or (at your option)
21 * FusionForge is distributed in the hope that it will be useful,
22 * but WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 * GNU General Public License for more details.
26 * You should have received a copy of the GNU General Public License along
27 * with FusionForge; if not, write to the Free Software Foundation, Inc.,
28 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
31 require_once $gfcommon.'tracker/ArtifactFactory.class.php';
32 require_once $gfcommon.'tracker/ArtifactQuery.class.php';
41 // make sure this person has permission to view artifacts
43 session_require_perm('tracker', $ath->getID(), 'read');
45 $query_id = getIntFromRequest('query_id');
46 $start = getIntFromRequest('start');
49 // The browse page can be powered by a pre-saved query
50 // or by select boxes chosen by the user
52 // If there is a $query_id coming from the request OR the pref
53 // was already saved, use the artifact factory that way.
55 // If the query_id = -1, unset the pref and use regular browse boxes
57 if (session_loggedin()) {
58 if (getStringFromRequest('setpaging')) {
59 /* store paging preferences */
60 $paging = getIntFromRequest('nres');
64 $LUSER->setPreference("paging", $paging);
66 /* logged in users get configurable paging */
67 $paging = $LUSER->getPreference("paging");
70 if ($query_id == '-1') {
71 $LUSER->setPreference('art_query'.$ath->getID(), '');
73 $aq = new ArtifactQuery($ath,$query_id);
74 if (!$aq || !is_object($aq)) {
75 exit_error($aq->getErrorMessage(),'tracker');
80 $query_id = $LUSER->getPreference('art_query'.$ath->getID(), '');
82 } elseif ($query_id) {
83 // If user is not logged, then use a cookie to store the current query.
84 if (isset($_COOKIE["GFTrackerQuery"])) {
85 $gf_tracker = unserialize($_COOKIE["GFTrackerQuery"]);
87 $gf_tracker = array();
89 $gf_tracker[$ath->getID()] = $query_id;
90 // Send the query_id as a cookie to save it.
91 setcookie("GFTrackerQuery", serialize($gf_tracker));
92 $_COOKIE["GFTrackerQuery"] = serialize($gf_tracker);
93 } elseif (isset($_COOKIE["GFTrackerQuery"])) {
94 $gf_tracker = unserialize($_COOKIE["GFTrackerQuery"]);
95 if (isset($gf_tracker[$ath->getID()])) {
96 $query_id = (int)$gf_tracker[$ath->getID()];
100 if(!isset($paging) || !$paging)
103 $af = new ArtifactFactory($ath);
105 if (!$af || !is_object($af)) {
106 exit_error(_('Could Not Get Factory'),'tracker');
107 } elseif ($af->isError()) {
108 exit_error($af->getErrorMessage(),'tracker');
111 if (!isset($_sort_col)) {
112 /* default sort order: highest priority first */
113 $_sort_col = 'priority';
117 if (!isset($_changed)) {
118 $_changed = 0x7fffffff;
121 $_sort_col = getStringFromRequest('_sort_col',$_sort_col);
122 $_sort_ord = getStringFromRequest('_sort_ord',$_sort_ord);
123 $_changed = getStringFromRequest('_changed', $_changed);
124 $_last_modified_by = getIntFromRequest('_last_modified_by');
125 $_priority = getIntFromRequest('_priority');
126 $set = getStringFromRequest('set');
127 $_assigned_to = getIntFromRequest('_assigned_to');
128 $_status = getIntFromRequest('_status');
129 $_extra_fields = array() ;
130 $aux_extra_fields = array() ;
132 if ($set == 'custom') {
133 /* may be past in next/prev url */
134 $i = $ath->getCustomStatusField();
135 $tmp_extra_fields = getArrayFromRequest('extra_fields');
136 if (isset($tmp_extra_fields[$i])) {
137 $_extra_fields[$i] = $tmp_extra_fields[$i];
141 if (isset($_extra_fields) && is_array($_extra_fields)) {
142 $keys=array_keys($_extra_fields);
143 foreach ($keys as $key) {
144 if ($_extra_fields[$key] != 'Array') {
145 $aux_extra_fields[$key] = $_extra_fields[$key];
149 if (isset($_extra_fields)) {
150 $aux_extra_fields = $_extra_fields;
152 $aux_extra_fields = '';
156 $af->setup($start, $_sort_col, $_sort_ord, $paging, $set, $_assigned_to, $_status, $aux_extra_fields, time() - $_changed, $_last_modified_by, $_priority);
158 // These vals are sanitized and/or retrieved from ArtifactFactory stored settings
160 $_sort_col=$af->order_col;
161 $_sort_ord=$af->sort;
162 $_status=$af->status;
163 $_assigned_to=$af->assigned_to;
164 $_extra_fields=$af->extra_fields;
166 $art_arr = $af->getArtifacts();
168 if (!$art_arr && $af->isError()) {
169 exit_error($af->getErrorMessage(),'tracker');
172 //build page title to make bookmarking easier
173 //if a user was selected, add the user_name to the title
176 html_use_coolfieldset();
178 $ath->header(array('atid'=>$ath->getID(), 'title'=>$ath->getName()));
181 * Build the powerful browsing options pop-up boxes
185 // creating a custom technician box which includes "any" and "unassigned"
187 if (is_array($_assigned_to)) {
190 $tech_box = $ath->technicianBox('_assigned_to', $_assigned_to, true, _('Unassigned'), '0', _('Any'));
193 // custom order by arrays to build a pop-up box
195 $order_name_arr=array();
196 $order_name_arr[]=_('Id');
197 $order_name_arr[]=_('Priority');
198 $order_name_arr[]=_('Summary');
199 $order_name_arr[]=_('Open Date');
200 $order_name_arr[]=_('Last Modified Date');
201 $order_name_arr[]=_('Last Modifier');
202 $order_name_arr[]=_('Close Date');
203 $order_name_arr[]=_('Submitter');
204 $order_name_arr[]=_('Assignee');
205 $order_name_arr[]=_('# Votes');
206 $order_name_arr[]=_('# Voters');
207 $order_name_arr[]=_('% Votes');
210 $order_arr[]='artifact_id';
211 $order_arr[]='priority';
212 $order_arr[]='summary';
213 $order_arr[]='open_date';
214 $order_arr[]='last_modified_date';
215 $order_arr[]='last_modified_by';
216 $order_arr[]='close_date';
217 $order_arr[]='submitted_by';
218 $order_arr[]='assigned_to';
219 $order_arr[]='_votes';
220 $order_arr[]='_voters';
221 $order_arr[]='_votage';
224 // custom sort arrays to build pop-up box
226 $sort_name_arr=array();
227 $sort_name_arr[]=_('Ascending');
228 $sort_name_arr[]=_('Descending');
235 // custom changed arrays to build pop-up box
237 $changed_name_arr=array();
238 $changed_name_arr[]=_('Any');
239 $changed_name_arr[]=_('Last 24 h');
240 $changed_name_arr[]=_('Last 7 days');
241 $changed_name_arr[]=_('Last 2 weeks');
242 $changed_name_arr[]=_('Last month');
244 $changed_arr=array();
245 $changed_arr[]= 0x7fffffff; // Any
246 $changed_arr[]= 3600 * 24; // 24 hour
247 $changed_arr[]= 3600 * 24 * 7; // 1 week
248 $changed_arr[]= 3600 * 24 * 14;// 2 week
249 $changed_arr[]= 3600 * 24 * 30;// 1 month
251 if ($art_arr && ($art_cnt = count($art_arr)) > 0) {
252 $focus = getIntFromRequest('focus');
261 for ($i = 0; $i < $art_cnt; ++$i)
262 if ($art_arr[$i]->getID() == $focus) {
267 $max = ($art_cnt > ($start + $paging)) ? ($start + $paging) : $art_cnt;
272 echo $HTML->paging_top($start, $paging, $art_cnt, $max, '/tracker/?group_id='.$group_id.'&atid='.$ath->getID());
276 * Show the free-form text submitted by the project admin
278 echo $ath->renderBrowseInstructions();
280 if ($ath->usesCustomStatuses()) {
281 $aux_extra_fields = array();
282 if (is_array($_extra_fields)) {
283 $keys=array_keys($_extra_fields);
284 foreach ($keys as $key) {
285 if (!is_array($_extra_fields[$key])) {
286 $aux_extra_fields[$key] = $_extra_fields[$key];
290 $aux_extra_fields = $_extra_fields;
292 $checked_status = isset($aux_extra_fields[$ath->getCustomStatusField()]) ? $aux_extra_fields[$ath->getCustomStatusField()] : '';
293 $status_box = $ath->renderSelect ($ath->getCustomStatusField(), $checked_status, false, '', true, _('Any'));
295 if (is_array($_status)) {
298 $status_box = $ath->statusBox('_status', $_status, true, _('Any'));
302 $proj_name = $group->getUnixName();
303 $proj_url = util_make_url_g($group->getUnixName(),$group_id);
304 // the tracker's URIs are constructed in order to support addition of an OSLC-CM REST server
305 // inside /tracker/cm/. There each tracker has a URL in the form .../project/PROJ_NAME/atid/ATID
306 $tracker_stdzd_uri = util_make_url('/tracker/cm/project/'. $proj_name .'/atid/'. $ath->getID());
307 print '<div about="'. $tracker_stdzd_uri
308 .'" typeof="sioc:Container">'."\n";
309 print '<span rel="http://www.w3.org/2002/07/owl#sameAs" resource="" ></span>'."\n";
310 print '<span rev="doap:bug-database sioc:space_of" resource="'. $proj_url .'" ></span>'."\n";
311 print "</div>\n"; // end of about
313 if ($af->query_type == 'custom') {
314 $javascript = 'jQuery(document).ready(function() {jQuery("#tabber").tabs({active: 1});});';
315 echo html_e('script', array( 'type'=>'text/javascript'), '//<![CDATA['."\n".$javascript."\n".'//]]>');
317 echo '<div id="tabber" class="tabber">';
318 $elementLi[] = array('content' => util_make_link('#tabber-advancedquery', _('Advanced queries'), array('title' => _('Use project queries or build and use your own queries.')), true));
319 $elementLi[] = array('content' => util_make_link('#tabber-simplefiltering', _('Simple Filtering and Sorting'), array('title' => _('Filtering by assignee, state, priority.')), true));
320 echo $HTML->html_list($elementLi);
321 echo '<div id="tabber-advancedquery">';
323 if (session_loggedin()) {
324 $res = db_query_params ('SELECT artifact_query_id,query_name, CASE WHEN query_type>0 THEN 1 ELSE 0 END as type
326 WHERE group_artifact_id=$1 AND (user_id=$2 OR query_type>0)
327 ORDER BY type ASC, query_name ASC',
328 array ($ath->getID(),
331 $res = db_query_params ('SELECT artifact_query_id,query_name, CASE WHEN query_type>0 THEN 1 ELSE 0 END as type
333 WHERE group_artifact_id=$1 AND query_type>0
334 ORDER BY type ASC, query_name ASC',
335 array ($ath->getID()));
338 if (db_numrows($res)>0) {
339 echo $HTML->openForm(array('action' => '/tracker/', 'method' => 'get'));
340 echo '<input type="hidden" name="group_id" value="'.$group_id.'" />';
341 echo '<input type="hidden" name="atid" value="'.$ath->getID().'" />';
342 echo '<input type="hidden" name="power_query" value="1" />';
343 echo $HTML->listTableTop().
345 $selected = $af->getDefaultQuery();
346 $value_arr = array();
348 $opt_group_arr = array();
349 while ($row = db_fetch_array($res)) {
350 $value_arr[] = $row['artifact_query_id'];
351 $text_arr[] = $row['query_name'];
352 $opt_group_arr[] = ($row['type'] ? _('Project') : _('Private'));
354 echo html_build_select_box_from_arrays($value_arr, $text_arr, 'query_id', $af->getDefaultQuery(), true, _('Select One'), false, '', false, array('id' => 'query_id'), array(), array(), $opt_group_arr);
355 echo '<noscript><input type="submit" name="run" value="'._('Power Query').'" /></noscript>
356 '.util_make_link('/tracker/?atid='. $ath->getID().'&group_id='.$group_id.'&func=query', _('Build Query')).'
357 </td></tr>'.$HTML->listTableBottom();
358 echo $HTML->closeForm();
359 $javascript = 'jQuery("#query_id").change(function() {location.href = "'.util_make_url('/tracker/?group_id='.$group_id.'&atid='.$ath->getID().'&power_query=1&query_id=').'"+jQuery("#query_id").val();});';
360 echo html_e('script', array( 'type'=>'text/javascript'), '//<![CDATA['."\n".$javascript."\n".'//]]>');
363 echo util_make_link('/tracker/?atid='.$ath->getID().'&group_id='.$group_id.'&func=query','<strong>'._('Build Query').'</strong>');
366 <div id="tabber-simplefiltering">';
367 $sort_fields = explode(',', $ath->getBrowseList());
368 // Get the list of fields which can be sorted.
369 $efarr = $ath->getExtraFields(array(ARTIFACT_EXTRAFIELDTYPE_TEXT,
370 ARTIFACT_EXTRAFIELDTYPE_TEXTAREA,
371 ARTIFACT_EXTRAFIELDTYPE_INTEGER,
372 ARTIFACT_EXTRAFIELDTYPE_SELECT,
373 ARTIFACT_EXTRAFIELDTYPE_RADIO,
374 ARTIFACT_EXTRAFIELDTYPE_STATUS,
375 ARTIFACT_EXTRAFIELDTYPE_DATE,
376 ARTIFACT_EXTRAFIELDTYPE_DATETIME,
377 ARTIFACT_EXTRAFIELDTYPE_EFFORT));
378 echo $HTML->openForm(array('action' => '/tracker/?group_id='.$group_id.'&atid='.$ath->getID(), 'method' => 'post'));
380 <input type="hidden" name="query_id" value="-1" />
381 <input type="hidden" name="set" value="custom" />
384 foreach ($sort_fields as $sort_field) {
385 switch ($sort_field) {
387 echo '<td>'._('Assignee')._(':').html_e('br').$tech_box.'</td>';
389 case 'last_modified_by':
390 echo '<td>'._('Modified by')._(':').html_e('br').$ath->lastModifierBox('_last_modified_by', $_last_modified_by, false, false, '0', _('Any')).'</td>';
392 case 'last_modified_date':
393 echo '<td>'._('Changed')._(':').html_e('br').html_build_select_box_from_arrays($changed_arr, $changed_name_arr, '_changed', $_changed, false).'<td>';
396 echo '<td>'._('State')._(':').'<br>'. $status_box.'</td>';
407 //no ordering on these columns yet.
409 if (intval($sort_field) > 0 && isset($efarr[$sort_field])) {
410 if ($efarr[$sort_field]['field_type'] == ARTIFACT_EXTRAFIELDTYPE_STATUS) {
411 echo '<td>'.$ath->getExtraFieldName($sort_field)._(':').'<br>'.$status_box.'</td>';
414 //build a box for extrafield ?
420 $keys=array_keys($efarr);
421 for ($k=0; $k<count($keys); $k++) {
423 $order_name_arr[] = $efarr[$i]['field_name'];
424 $order_arr[] = $efarr[$i]['extra_field_id'];
426 echo '<td>'._('Priority')._(':').html_e('br').
427 html_build_priority_select_box('_priority', $_priority, false, array(), true).'</td>';
428 echo '<td>'._('Order by')._(':').'<br>'.
429 html_build_select_box_from_arrays($order_arr,$order_name_arr,'_sort_col',$_sort_col,false) .
430 html_build_select_box_from_arrays($sort_arr,$sort_name_arr,'_sort_ord',$_sort_ord,false) .
432 <td><br><input type="submit" name="submit" value="'._('Quick Browse').'" /></td>';
437 echo $HTML->closeForm();
439 if ($af->query_type == 'default') {
440 echo '<div class="tabbertab tabbertabdefault" >';
442 echo sprintf(_('Viewing only opened records by default, use “%1$s” or “%2$s” to change.'),
443 _('Advanced queries'),
444 _('Simple Filtering and Sorting'));
446 echo '</div>' . "\n";
448 echo '</div>' . "\n";
450 $art_cnt = count($art_arr);
451 if ($art_arr && $art_cnt > 0) {
454 $aq = new ArtifactQuery($ath,$query_id);
455 $has_bargraph = (in_array('bargraph', $aq->getQueryOptions()));
457 $has_bargraph = false;
461 // Display the roadmap block based on the values of the Status field.
462 $colors = array('#a71d16', '#ffa0a0', '#f5f5b5', '#bae0ba', '#16a716');
465 foreach($art_arr as $art) {
466 if ($ath->usesCustomStatuses()) {
467 $custom_id = $ath->getCustomStatusField();
468 $extra_data = $art->getExtraFieldDataText();
469 @$count[ $extra_data[$custom_id]['value'] ]++;
471 @$count[ $art->getStatusName()]++;
474 foreach($count as $n => $c) {
475 $percent[$n] = round(100*$c/$art_cnt);
477 if ($ath->getCustomStatusField()) {
478 $efarr = $ath->getExtraFields(array(ARTIFACT_EXTRAFIELDTYPE_STATUS));
479 $keys=array_keys($efarr);
480 $field_id = $keys[0];
481 $custom_states = $ath->getExtraFieldElements($field_id);
483 if (is_array($custom_states)) {
484 foreach($custom_states as $state) {
485 $states[] = $state['element_name'];
489 $colors = array('#ffa0a0', '#bae0ba');
490 $res = $ath->getStatuses();
491 while ($row = db_fetch_array($res)) {
492 $states[] = $row['status_name'];
499 if (is_array($states)) {
500 foreach($states as $name) {
501 if (isset($count[$name]) && $count[$name]) {
502 $graph .= '<td style="background: '.$colors[$i].'; width: '.$percent[$name].'%;"> </td>';
503 $legend .= '<td style="white-space: nowrap; width: '.$percent[$name].'%;">'."<i>$name: $count[$name] ($percent[$name]%)</i></td>";
511 <table class="progress">
513 <tr><?php echo $graph; ?></tr>
516 <table class="progress_legend">
517 <tr><?php echo $legend ?></tr>
523 if ($set=='custom') {
524 $set .= '&_assigned_to='.$_assigned_to.'&_status='.$_status.'&_sort_col='.$_sort_col.'&_sort_ord='.$_sort_ord;
525 if (array_key_exists($ath->getCustomStatusField(),$_extra_fields)) {
526 $set .= '&extra_fields['.$ath->getCustomStatusField().']='.$_extra_fields[$ath->getCustomStatusField()];
531 $IS_ADMIN = forge_check_perm ('tracker', $ath->getID(), 'manager') ;
534 echo $HTML->openForm(array('name' => 'artifactList', 'action' => '/tracker/?group_id='.$group_id.'&atid='.$ath->getID(), 'method' => 'post'));
535 echo '<input type="hidden" name="form_key" value="'.form_generate_key().'" />
536 <input type="hidden" name="func" value="massupdate" />';
542 <a href="javascript:checkAllArtifacts(1)">'._('Check all').'</a>
544 <a href="javascript:checkAllArtifacts(0)">'._('Clear all').'</a>';
548 $browse_fields = explode(',', "id,".$ath->getBrowseList());
549 if (!in_array($_sort_col,$browse_fields) && $_sort_col!='artifact_id') {
550 $browse_fields[] = $_sort_col;
554 foreach ($browse_fields as $f) {
564 $title=_('Description');
567 $title=_('Open Date');
570 $title=_('Close Date');
576 $title=_('Priority');
579 $title=_('Assigned to');
582 $title=_('Submitted by');
584 case 'related_tasks':
585 $title=_('Related Tasks');
587 case 'last_modified_date':
588 $title=_('Last Modified Date');
590 case 'last_modified_by':
591 $title=_('Last Modifier');
594 $title = _('# Votes');
597 $title = _('# Voters');
600 $title = _('% Voted');
603 if (intval($f) > 0) {
604 $title = $ath->getExtraFieldName($f);
607 $title_arr[] = $title;
611 echo $HTML->listTableTop($title_arr, array(), 'full');
614 $then=(time()-$ath->getDuePeriod());
615 $voters = count($ath->getVoters());
617 for ($i=$start; $i<$max; $i++) {
618 $extra_data = $art_arr[$i]->getExtraFieldDataText();
620 <tr class=priority'. $art_arr[$i]->getPriority().'>';
621 foreach ($browse_fields as $f) {
624 echo '<td style="white-space: nowrap;">'.
625 ($IS_ADMIN?'<input type="checkbox" name="artifact_id_list[]" value="'.
626 $art_arr[$i]->getID() .'" /> ':'').
627 util_make_link('/tracker/?func=detail&aid='.
628 $art_arr[$i]->getID().
629 '&group_id='. $group_id .'&atid='.
631 $art_arr[$i]->getID()).
636 util_make_link('/tracker/?func=detail&aid='.
637 $art_arr[$i]->getID() .
638 '&group_id='. $group_id .'&atid='.
640 $art_arr[$i]->getSummary()).
644 echo '<td>'. (($set != 'closed' && $art_arr[$i]->getOpenDate() < $then)?'* ':' ') .
645 date(_('Y-m-d H:i'),$art_arr[$i]->getOpenDate()) .'</td>';
648 echo '<td>'. $art_arr[$i]->getStatusName() .'</td>';
651 echo '<td class="priority'.$art_arr[$i]->getPriority() .'">'. $art_arr[$i]->getPriority() .'</td>';
654 if($art_arr[$i]->getAssignedTo() != 100) {
655 echo '<td>'.util_display_user($art_arr[$i]->getAssignedUnixName(), $art_arr[$i]->getAssignedTo(), $art_arr[$i]->getAssignedRealName()).'</td>';
657 echo '<td>'. $art_arr[$i]->getAssignedRealName() .'</td>';
661 if($art_arr[$i]->getSubmittedBy() != 100) {
662 echo '<td>'.util_display_user($art_arr[$i]->getSubmittedUnixName(), $art_arr[$i]->getSubmittedBy(), $art_arr[$i]->getSubmittedRealName()).'</td>';
664 echo '<td>'.$art_arr[$i]->getSubmittedRealName().'</td>';
667 case 'last_modified_by':
668 if($art_arr[$i]->getLastModifiedRealName() != 100) {
669 echo '<td>'.util_display_user($art_arr[$i]->getLastModifiedUnixName(), $art_arr[$i]->getLastModifiedBy(), $art_arr[$i]->getLastModifiedRealName()).'</td>';
671 echo '<td>'.$art_arr[$i]->getLastModifiedRealName().'</td>';
675 echo '<td>'. ($art_arr[$i]->getCloseDate() ?
676 date(_('Y-m-d H:i'),$art_arr[$i]->getCloseDate()) :' ') .'</td>';
679 echo '<td>'. $art_arr[$i]->getDetails() .'</td>';
681 case 'related_tasks':
683 $tasks_res = $art_arr[$i]->getRelatedTasks();
685 while ($rest = db_fetch_array($tasks_res)) {
686 $link = '/pm/task.php?func=detailtask&project_task_id='.$rest['project_task_id'].
687 '&group_id='.$group_id.'&group_project_id='.$rest['group_project_id'];
688 $title = '[T'.$rest['project_task_id'].']';
689 if ($rest['status_id'] == 2) {
690 $title = '<span class="strike">'.$title.'</span>';
692 echo $s.util_make_link($link, $title, array( 'title' => util_html_secure($rest['summary'])));
697 case 'last_modified_date':
698 echo '<td>'. ($art_arr[$i]->getLastModifiedDate() ?
699 date(_('Y-m-d H:i'),$art_arr[$i]->getLastModifiedDate()) :' ') .'</td>';
702 $v = $art_arr[$i]->getVotes();
703 echo html_e('td', array(), $v[0], false);
706 echo html_e('td', array(), $voters, false);
709 $v = $art_arr[$i]->getVotes();
710 echo html_e('td', array(), $v[2], false);
713 if (intval($f) > 0) {
714 // Now display extra-fields (fields are numbers).
715 $value = $extra_data[$f]['value'];
716 if ($extra_data[$f]['type'] == ARTIFACT_EXTRAFIELDTYPE_RELATION) {
717 $value = preg_replace('/\b(\d+)\b/e', "_artifactid2url('\\1')", $value);
718 } elseif ($extra_data[$f]['type'] == ARTIFACT_EXTRAFIELDTYPE_STATUS) {
719 if ($art_arr[$i]->getStatusID() == 2) {
720 $value = '<span class="strike">'.$value.'</span>';
722 } elseif ($extra_data[$f]['type'] == ARTIFACT_EXTRAFIELDTYPE_EFFORT) {
723 if (!isset($effortUnitSet)) {
724 $effortUnitSet = new EffortUnitSet($ath, $ath->getEffortUnitSet());
725 $effortUnitFactory = new EffortUnitFactory($effortUnitSet);
727 $value = $effortUnitFactory->encodedToString($value);
729 echo '<td>' . $value .'</td>';
731 // Display ? for unknown values.
740 echo $HTML->listTableBottom();
742 echo $HTML->paging_bottom($start, $paging, $art_cnt, '/tracker/?func=browse&group_id='.$group_id.'&atid='.$ath->getID().'&set='. $set);
744 echo '<div style="display:table;width:100%">';
745 echo '<div style="display:table-row">';
747 echo '<div style="display:table-cell">';
748 printf(_('* Denotes requests > %s Days Old'), ($ath->getDuePeriod()/86400));
751 if (in_array('priority', $browse_fields)) {
752 echo '<div style="display:table-cell;text-align:right">';
753 echo $HTML->show_priority_colors_key();
758 echo '<div style="display:table-row">';
760 echo '<div style="display:table-cell">'.$check_all.'</div>';
761 echo '<div style="display:table-cell;text-align:right">'.$pager.'</div>'."\n";
770 echo '<fieldset id="fieldset1_closed" class="coolfieldset">
771 <legend>'._('Mass Update').'</legend>
773 echo $HTML->listTableTop(array(), array(), 'fullwidth', 'admin_mass_update');
774 echo ' <tr><td colspan="2">';
775 echo $HTML->information(_('If you wish to apply changes to all items selected above, use these controls to change their properties and click once on “Mass Update”.')).'
779 // build custom fields
781 $ef = $ath->getExtraFields(array(ARTIFACT_EXTRAFIELD_FILTER_INT));
782 $keys=array_keys($ef);
785 for ($i=0; $i<count($keys); $i++) {
786 if (($ef[$keys[$i]]['field_type']==ARTIFACT_EXTRAFIELDTYPE_CHECKBOX) || ($ef[$keys[$i]]['field_type']==ARTIFACT_EXTRAFIELDTYPE_MULTISELECT)) {
787 $sel[$keys[$i]]=array('100');
789 $sel[$keys[$i]]='100';
792 $ath->renderExtraFields($sel,true,_('No Change'),false,'', array(ARTIFACT_EXTRAFIELD_FILTER_INT),true,'UPDATE');
794 echo '<td><strong>'._('Priority')._(':').'</strong><br />';
795 echo build_priority_select_box ('priority', '100', true);
802 echo '<td><strong>'._('Assigned to')._(':').'</strong><br />';
803 echo $ath->technicianBox ('assigned_to','100.1',true,_('Nobody'),'100.1',_('No Change'));
806 if (!$ath->usesCustomStatuses()) {
807 echo '<strong>'._('State')._(': ').'</strong>
808 <br />'. $ath->statusBox ('status_id','xzxz',true,_('No Change'));
814 echo '<td colspan="2"><strong>'._('Canned Response')._(':').'</strong><br />';
815 echo $ath->cannedResponseBox ('canned_response') .'</td></tr>
817 <tr><td colspan="2" class="align-center"><input type="submit" name="submit" value="'._('Mass Update').'" /></td></tr>';
818 echo $HTML->listTableBottom();
819 echo '</div></fieldset>';
820 echo $HTML->closeForm();
824 echo $HTML->information(_('No items found'));
832 // c-file-style: "bsd"