3 * FusionForge Generic Tracker facility
5 * Copyright 1999-2001 (c) VA Linux Systems - Sourceforge
6 * Copyright 2010 (c) Fusionforge Team
7 * http://fusionforge.org
9 * This file is part of FusionForge.
11 * FusionForge is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
16 * FusionForge is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with FusionForge; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 US
26 require_once $gfcommon.'tracker/ArtifactType.class.php';
27 require_once $gfcommon.'tracker/ArtifactExtraField.class.php';
28 require_once $gfcommon.'tracker/ArtifactExtraFieldElement.class.php';
29 require_once $gfcommon.'tracker/ArtifactWorkflow.class.php';
30 require_once $gfcommon.'include/utils_crossref.php';
32 class ArtifactTypeHtml extends ArtifactType {
35 * ArtifactType() - constructor
37 * @param $group object
38 * @param $artifact_type_id - the id # assigned to this artifact type in the db
40 function ArtifactTypeHtml(&$group,$artifact_type_id=false, $arr=false) {
41 return $this->ArtifactType($group,$artifact_type_id,$arr);
44 function header($params) {
46 if (!forge_get_config('use_tracker')) {
49 $group_id= $this->Group->getID();
51 //required by new site_project_header
52 $params['group']=$group_id;
53 $params['toptab']='tracker';
54 $params['tabtext']=$this->getName();
56 site_project_header($params);
57 echo '<h1>' . $params['title'] . '</h1>';
62 $labels[] = $this->getName().': '._('Browse');
63 $links[] = '/tracker/?func=browse&group_id='.$group_id.'&atid='. $this->getID();
64 $labels[] = _('Download .csv');
65 $links[] = '/tracker/?func=downloadcsv&group_id='.$group_id.'&atid='. $this->getID();
66 if ($this->allowsAnon() || session_loggedin()) {
67 $labels[] = _('Submit New');
68 $links[] = '/tracker/?func=add&group_id='.$group_id.'&atid='. $this->getID();
71 if (session_loggedin()) {
72 $labels[] = _('Reporting');
73 $links[] = '/tracker/reporting/?group_id='.$group_id.'&atid='. $this->getID();
74 if ($this->isMonitoring()) {
75 $labels[] = _('Stop Monitor');
76 $links[] = '/tracker/?group_id='.$group_id.'&atid='. $this->getID().'&func=monitor&stop=1';
78 $labels[] = _('Monitor');
79 $links[] = '/tracker/?group_id='.$group_id.'&atid='. $this->getID().'&func=monitor&start=1';
82 if (forge_check_perm ('tracker', $this->getID(), 'manager')) {
83 $labels[] = _('Admin');
84 $links[] = '/tracker/admin/?group_id='.$group_id.'&atid='.$this->getID();
87 $labels[] = _('Monitor');
88 $links[] = '/tracker/?group_id='.$group_id.'&atid='. $this->getID().'&func=monitor&start=1';
91 echo $HTML->subMenu($labels,$links);
94 plugin_hook ("blocks", "tracker_".$this->getName());
98 function footer($params) {
99 site_project_footer($params);
102 function adminHeader($params) {
104 $this->header($params);
105 $group_id= $this->Group->getID();
107 $links_arr[]='/tracker/admin/?group_id='.$group_id;
108 $title_arr[]=_('New Tracker');
110 $links_arr[]='/tracker/admin/?group_id='.$group_id.'&atid='.$this->getID().'&update_type=1';
111 $title_arr[]=_('Update Settings');
113 $links_arr[]='/tracker/admin/?group_id='.$group_id.'&atid='.$this->getID().'&add_extrafield=1';
114 $title_arr[]=_('Manage Custom Fields');
116 $links_arr[]='/tracker/admin/?group_id='.$group_id.'&atid='.$this->getID().'&workflow=1';
117 $title_arr[]=_('Manage Workflow');
119 $links_arr[]='/tracker/admin/?group_id='.$group_id.'&atid='.$this->getID().'&customize_list=1';
120 $title_arr[]=_('Customize List');
122 $links_arr[]='/tracker/admin/?group_id='.$group_id.'&atid='.$this->getID().'&add_canned=1';
123 $title_arr[]=_('Add/Update Canned Responses');
125 $links_arr[]='/tracker/admin/?group_id='.$group_id.'&atid='.$this->getID().'&clone_tracker=1';
126 $title_arr[]=_('Clone Tracker');
128 $links_arr[]='/tracker/admin/?group_id='.$group_id.'&atid='.$this->getID().'&delete=1';
129 $title_arr[]=_('Delete');
131 echo $HTML->printSubMenu($title_arr,$links_arr);
134 function adminFooter($params) {
135 echo $this->footer($params);
138 function renderSubmitInstructions() {
139 $msg = $this->getSubmitInstructions();
140 return str_replace("\n","<br />", $msg);
143 function renderBrowseInstructions() {
144 $msg = $this->getBrowseInstructions();
145 return str_replace("\n","<br />", $msg);
148 function renderExtraFields($selected=array(),$show_100=false,$text_100='none',$show_any=false,$text_any='Any',$types=array(),$status_show_100=false,$mode='') {
149 $efarr = $this->getExtraFields($types);
150 //each two columns, we'll reset this and start a new row
152 $template = $this->getRenderHTML($types, $mode);
154 if ($mode=='QUERY') {
155 $keys=array_keys($efarr);
156 for ($k=0; $k<count($keys); $k++) {
158 if ($efarr[$i]['field_type'] == ARTIFACT_EXTRAFIELDTYPE_SELECT ||
159 $efarr[$i]['field_type'] == ARTIFACT_EXTRAFIELDTYPE_CHECKBOX ||
160 $efarr[$i]['field_type'] == ARTIFACT_EXTRAFIELDTYPE_RADIO ||
161 $efarr[$i]['field_type'] == ARTIFACT_EXTRAFIELDTYPE_STATUS ||
162 $efarr[$i]['field_type'] == ARTIFACT_EXTRAFIELDTYPE_MULTISELECT) {
163 $efarr[$i]['field_type'] = ARTIFACT_EXTRAFIELDTYPE_MULTISELECT;
165 $efarr[$i]['field_type'] = ARTIFACT_EXTRAFIELDTYPE_TEXT;
170 // 'DISPLAY' mode is for renderding in 'read-only' mode (for detail view).
171 if ($mode === 'DISPLAY') {
172 $keys=array_keys($efarr);
173 for ($k=0; $k<count($keys); $k++) {
176 if (!isset($selected[$efarr[$i]['extra_field_id']]))
177 $selected[$efarr[$i]['extra_field_id']] = '';
179 $value = @$selected[$efarr[$i]['extra_field_id']];
181 if ($efarr[$i]['field_type'] == ARTIFACT_EXTRAFIELDTYPE_SELECT ||
182 $efarr[$i]['field_type'] == ARTIFACT_EXTRAFIELDTYPE_CHECKBOX ||
183 $efarr[$i]['field_type'] == ARTIFACT_EXTRAFIELDTYPE_RADIO ||
184 $efarr[$i]['field_type'] == ARTIFACT_EXTRAFIELDTYPE_STATUS ||
185 $efarr[$i]['field_type'] == ARTIFACT_EXTRAFIELDTYPE_MULTISELECT) {
189 $arr = $this->getExtraFieldElements($efarr[$i]['extra_field_id']);
191 // Convert the values (ids) to names in the ids order.
193 for ($j=0; $j<count($arr); $j++) {
194 if (is_array($value)) {
195 if (in_array($arr[$j]['element_id'],$value))
196 $new[]= $arr[$j]['element_name'];
197 } elseif ($arr[$j]['element_id'] === $value) {
198 $new[] = $arr[$j]['element_name'];
201 $value = join('<br />', $new);
203 } else if ($efarr[$i]['field_type'] == ARTIFACT_EXTRAFIELDTYPE_TEXT ||
204 $efarr[$i]['field_type'] == ARTIFACT_EXTRAFIELDTYPE_TEXTAREA) {
205 $value = preg_replace('/((http|https|ftp):\/\/\S+)/',
206 "<a href=\"\\1\" target=\"_blank\">\\1</a>", $value);
207 } else if ($efarr[$i]['field_type'] == ARTIFACT_EXTRAFIELDTYPE_RELATION) {
208 // Convert artifact id to links.
209 $value = preg_replace('/\b(\d+)\b/e', "_artifactid2url('\\1')", $value);
211 $template = str_replace('{$PostName:'.$efarr[$i]['field_name'].'}',$post_name,$template);
212 $template = str_replace('{$'.$efarr[$i]['field_name'].'}',$value,$template);
218 $keys=array_keys($efarr);
219 for ($k=0; $k<count($keys); $k++) {
223 if (!isset($selected[$efarr[$i]['extra_field_id']]))
224 $selected[$efarr[$i]['extra_field_id']] = '';
226 if ($efarr[$i]['field_type'] == ARTIFACT_EXTRAFIELDTYPE_SELECT) {
227 $str = $this->renderSelect($efarr[$i]['extra_field_id'],$selected[$efarr[$i]['extra_field_id']],$show_100,$text_100,$show_any,$text_any);
229 } elseif ($efarr[$i]['field_type'] == ARTIFACT_EXTRAFIELDTYPE_CHECKBOX) {
231 $str = $this->renderCheckbox($efarr[$i]['extra_field_id'],$selected[$efarr[$i]['extra_field_id']],$show_100,$text_100);
233 } elseif ($efarr[$i]['field_type'] == ARTIFACT_EXTRAFIELDTYPE_RADIO) {
235 $str = $this->renderRadio($efarr[$i]['extra_field_id'],$selected[$efarr[$i]['extra_field_id']],$show_100,$text_100,$show_any,$text_any);
237 } elseif ($efarr[$i]['field_type'] == ARTIFACT_EXTRAFIELDTYPE_TEXT ||
238 $efarr[$i]['field_type'] == ARTIFACT_EXTRAFIELDTYPE_INTEGER) {
240 $str = $this->renderTextField($efarr[$i]['extra_field_id'],$selected[$efarr[$i]['extra_field_id']],$efarr[$i]['attribute1'],$efarr[$i]['attribute2']);
241 if ($mode == 'QUERY') {
242 $post_name = ' <i>'._('(%% for wildcards)').'</i> ';
245 } elseif ($efarr[$i]['field_type'] == ARTIFACT_EXTRAFIELDTYPE_TEXTAREA) {
247 $str = $this->renderTextArea($efarr[$i]['extra_field_id'],$selected[$efarr[$i]['extra_field_id']],$efarr[$i]['attribute1'],$efarr[$i]['attribute2']);
248 if ($mode == 'QUERY') {
249 $post_name = ' <i>'._('(%% for wildcards)').'</i> ';
252 } elseif ($efarr[$i]['field_type'] == ARTIFACT_EXTRAFIELDTYPE_MULTISELECT) {
254 $str = $this->renderMultiSelectBox ($efarr[$i]['extra_field_id'],$selected[$efarr[$i]['extra_field_id']],$show_100,$text_100);
256 } elseif ($efarr[$i]['field_type'] == ARTIFACT_EXTRAFIELDTYPE_STATUS) {
258 // Get the allowed values from the workflow.
259 $atw = new ArtifactWorkflow($this, $efarr[$i]['extra_field_id']);
261 // Special treatement for the initial step (Submit).
262 // In this case, the initial value is the first value.
263 if ($selected === true) {
264 $selected_node = 100;
265 } elseif (isset($selected[$efarr[$i]['extra_field_id']]) && $selected[$efarr[$i]['extra_field_id']]) {
266 $selected_node = $selected[$efarr[$i]['extra_field_id']];
268 $selected_node = 100;
271 $allowed = $atw->getNextNodes($selected_node);
272 $allowed[] = $selected_node;
273 $str = $this->renderSelect($efarr[$i]['extra_field_id'],$selected_node,$status_show_100,$text_100,$show_any,$text_any, $allowed);
275 } elseif ($efarr[$i]['field_type'] == ARTIFACT_EXTRAFIELDTYPE_RELATION) {
277 $str = $this->renderRelationField($efarr[$i]['extra_field_id'],$selected[$efarr[$i]['extra_field_id']],$efarr[$i]['attribute1'],$efarr[$i]['attribute2']);
278 if ($mode == 'UPDATE') {
279 $post_name = html_image('ic/forum_edit.gif','37','15',array('title'=>"Click to edit", 'alt'=>"Click to edit", 'onclick'=>"switch2edit(this, 'show$i', 'edit$i')"));
282 $template = str_replace('{$PostName:'.$efarr[$i]['field_name'].'}',$post_name,$template);
283 $template = str_replace('{$'.$efarr[$i]['field_name'].'}',$str,$template);
285 if($template != NULL){
290 function renderRelatedTasks($group, $ah) {
292 if (!$group->usesPM()) {
296 $taskcount = db_numrows($ah->getRelatedTasks());
298 if ($taskcount > 0) {
299 echo '<tr><td colspan="2">';
300 echo '<b>'._("Related Tasks").':</b>'.'<br/>';
301 echo '<table cellspacing="0">';
302 for ($i = 0; $i < $taskcount; $i++) {
303 $taskinfo = db_fetch_array($ah->relatedtasks, $i);
304 $taskid = $taskinfo['project_task_id'];
305 $projectid = $taskinfo['group_project_id'];
306 $groupid = $taskinfo['group_id'];
307 $summary = util_unconvert_htmlspecialchars($taskinfo['summary']);
308 $startdate = date(_('Y-m-d H:i'), $taskinfo['start_date']);
309 $enddate = date(_('Y-m-d H:i'), $taskinfo['end_date']);
311 <td><a href="/pm/task.php?func=detailtask&project_task_id='.$taskid.
312 '&group_id='.$groupid.'&group_project_id='.$projectid.'">[T'.$taskid.'] '.$summary.'</a></td>
313 <td>'.$startdate.'</td>
314 <td>'.$enddate.'</td>
322 function renderFiles($group_id, $ah) {
324 $file_list =& $ah->getFiles();
325 $count=count($file_list);
328 echo '<tr><td colspan="2">';
329 echo '<b>'._("Attachments").':</b>'.'<br/>';
330 echo '<table cellspacing="0">';
331 for ($i=0; $i<$count; $i++) {
333 <td><a href="/tracker/download.php/'.$group_id.'/'. $this->getID().'/'. $ah->getID() .'/'.$file_list[$i]->getID().'/'.$file_list[$i]->getName() .'">'. htmlspecialchars($file_list[$i]->getName()) .'</a></td>';
334 // <td><input type="checkbox" name="delete_file[]" value="'. $file_list[$i]->getID() .'">'._("Delete").' </td>
345 * @return string HTML template.
347 function getRenderHTML($types=array(), $mode='') {
348 // Use template only for the browse (not for query or mass update)
349 if (($mode === 'DISPLAY' || $mode === 'DETAIL' || $mode === 'UPDATE')
350 && $this->data_array['custom_renderer']) {
351 return preg_replace('/<!--(\S+.*?)-->/','{$\\1}',$this->data_array['custom_renderer']);
353 return $this->generateRenderHTML($types, $mode);
360 * @return string HTML template.
362 function generateRenderHTML($types=array(), $mode) {
363 $efarr = $this->getExtraFields($types);
364 //each two columns, we'll reset this and start a new row
367 <!-- Start Extra Fields Rendering -->
371 $keys=array_keys($efarr);
373 if ($count == 0) return '';
375 for ($k=0; $k<$count; $k++) {
378 // Do not show the required star in query mode (creating/updating a query).
379 $is_required = ($mode == 'QUERY' || $mode == 'DISPLAY') ? 0 : $efarr[$i]['is_required'];
380 $name = $efarr[$i]['field_name'].($is_required ? utils_requiredField() : '').': ';
381 $name = '<strong>'.$name.'</strong>';
383 if ($efarr[$i]['field_type'] == ARTIFACT_EXTRAFIELDTYPE_SELECT) {
386 <td width="50%" valign="top">'.$name.'<br />{$'.$efarr[$i]['field_name'].'}</td>';
388 } elseif ($efarr[$i]['field_type'] == ARTIFACT_EXTRAFIELDTYPE_CHECKBOX) {
391 <td width="50%" valign="top">'.$name.'<br />{$'.$efarr[$i]['field_name'].'}</td>';
393 } elseif ($efarr[$i]['field_type'] == ARTIFACT_EXTRAFIELDTYPE_RADIO) {
396 <td width="50%" valign="top">'.$name.'<br />{$'.$efarr[$i]['field_name'].'}</td>';
398 } elseif ($efarr[$i]['field_type'] == ARTIFACT_EXTRAFIELDTYPE_TEXT ||
399 $efarr[$i]['field_type'] == ARTIFACT_EXTRAFIELDTYPE_INTEGER) {
401 //text fields might be really wide, so need a row to themselves.
402 if (($col_count == 1) && ($efarr[$i]['attribute1'] > 30)) {
412 <td width="'.(50*$colspan).'%" colspan="'.$colspan.'" valign="top">'.$name.'{$PostName:'.$efarr[$i]['field_name'].'}<br />{$'.$efarr[$i]['field_name'].'}</td>';
414 } elseif ($efarr[$i]['field_type'] == ARTIFACT_EXTRAFIELDTYPE_TEXTAREA) {
416 //text areas might be really wide, so need a row to themselves.
417 if (($col_count == 1) && ($efarr[$i]['attribute2'] > 30)) {
427 <td width="'.(50*$colspan).'%" colspan="'.$colspan.'" valign="top">'.$name.'{$PostName:'.$efarr[$i]['field_name'].'}<br />{$'.$efarr[$i]['field_name'].'}</td>';
429 } elseif ($efarr[$i]['field_type'] == ARTIFACT_EXTRAFIELDTYPE_MULTISELECT) {
432 <td width="50%" valign="top">'.$name.'<br />{$'.$efarr[$i]['field_name'].'}</td>';
434 } elseif ($efarr[$i]['field_type'] == ARTIFACT_EXTRAFIELDTYPE_STATUS) {
437 <td width="50%" valign="top">'.$name.'<br />{$'.$efarr[$i]['field_name'].'}</td>';
439 } elseif ($efarr[$i]['field_type'] == ARTIFACT_EXTRAFIELDTYPE_RELATION) {
441 //text fields might be really wide, so need a row to themselves.
442 if (($col_count == 1) && ($efarr[$i]['attribute1'] > 30)) {
452 <td width="'.(50*$colspan).'%" colspan="'.$colspan.'" valign="top">'.$name.'{$PostName:'.$efarr[$i]['field_name'].'}<br />{$'.$efarr[$i]['field_name'].'}</td>';
456 //we've done two columns - if there are more to do, start a new row
457 if (($col_count == 2) && ($k != $count-1)) {
464 if ($col_count == 1) {
470 <!-- End Extra Fields Rendering -->';
475 * renderSelect - this function builds pop up
478 * @param int The ID of this field.
479 * @param string The item that should be checked
480 * @param string Whether to show the '100 row'
481 * @param string What to call the '100 row'
482 * @return box and choices
484 function renderSelect ($extra_field_id,$checked='xzxz',$show_100=false,$text_100='none',$show_any=false,$text_any='Any', $allowed=false) {
485 if ($text_100 == 'none'){
488 $arr = $this->getExtraFieldElements($extra_field_id);
489 for ($i=0; $i<count($arr); $i++) {
490 $keys[$i]=$arr[$i]['element_id'];
491 $vals[$i]=$arr[$i]['element_name'];
493 return html_build_select_box_from_arrays ($keys,$vals,'extra_fields['.$extra_field_id.']',$checked,$show_100,$text_100,$show_any,$text_any, $allowed);
497 * renderRadio - this function builds radio buttons.
499 * @param int The ID of this field.
500 * @param string The item that should be checked
501 * @param string Whether to show the '100 row'
502 * @param string What to call the '100 row'
503 * @return radio buttons
505 function renderRadio ($extra_field_id,$checked='xzxz',$show_100=false,$text_100='none',$show_any=false,$text_any='Any') {
506 $arr = $this->getExtraFieldElements($extra_field_id);
507 for ($i=0; $i<count($arr); $i++) {
508 $keys[$i]=$arr[$i]['element_id'];
509 $vals[$i]=$arr[$i]['element_name'];
511 return html_build_radio_buttons_from_arrays ($keys,$vals,'extra_fields['.$extra_field_id.']',$checked,$show_100,$text_100,$show_any,$text_any);
515 * renderCheckbox - this function builds checkboxes.
517 * @param int The ID of this field.
518 * @param array The items that should be checked
519 * @param string Whether to show the '100 row'
520 * @param string What to call the '100 row'
521 * @return radio buttons
523 function renderCheckbox ($extra_field_id,$checked=array(),$show_100=false,$text_100='none') {
524 if ($text_100 == 'none'){
527 if (!$checked || !is_array($checked)) {
530 $arr = $this->getExtraFieldElements($extra_field_id);
534 <input type="checkbox" name="extra_fields['.$extra_field_id.'][]" value="100" '.
535 ((in_array(100,$checked)) ? 'checked="checked"' : '').'/> '.$text_100.'<br />';
537 for ($i=0; $i<count($arr); $i++) {
539 <input type="checkbox" name="extra_fields['.$extra_field_id.'][]" value="'.$arr[$i]['element_id'].'" '.
540 ((in_array($arr[$i]['element_id'],$checked)) ? 'checked="checked"' : '').'/> '.$arr[$i]['element_name'].'<br />';
546 * renderMultiSelectBox - this function builds checkboxes.
548 * @param int The ID of this field.
549 * @param array The items that should be checked
550 * @param string Whether to show the '100 row'
551 * @param string What to call the '100 row'
552 * @return radio multiselectbox
554 function renderMultiSelectBox ($extra_field_id,$checked=array(),$show_100=false,$text_100='none') {
555 $arr =$this->getExtraFieldElements($extra_field_id);
559 if (!is_array($checked)) {
560 $checked = explode(',',$checked);
564 $arr = $this->getExtraFieldElements($extra_field_id);
565 for ($i=0; $i<count($arr); $i++) {
566 $keys[]=$arr[$i]['element_id'];
567 $vals[]=$arr[$i]['element_name'];
569 $size = min( count($arr)+1, 15);
570 return html_build_multiple_select_box_from_arrays($keys,$vals,"extra_fields[$extra_field_id][]",$checked,$size,$show_100,$text_100);
574 * renderTextField - this function builds a text field.
576 * @param int The ID of this field.
577 * @param string The data for this field.
578 * @return text area and data.
580 function renderTextField ($extra_field_id,$contents,$size,$maxlength) {
582 <input type="text" name="extra_fields['.$extra_field_id.']" value="'.$contents.'" size="'.$size.'" maxlength="'.$maxlength.'"/>';
586 * renderRelationField - this function builds a relation field.
588 * @param int The ID of this field.
589 * @param string The data for this field.
590 * @return text area and data.
592 function renderRelationField ($extra_field_id,$contents,$size,$maxlength) {
593 $arr = $this->getExtraFieldElements($extra_field_id);
594 for ($i=0; $i<count($arr); $i++) {
595 $keys[$i]=$arr[$i]['element_id'];
596 $vals[$i]=$arr[$i]['element_name'];
598 // Convert artifact id to links.
599 $html_contents = preg_replace('/\b(\d+)\b/e', "_artifactid2url('\\1','title')", $contents);
600 $edit_contents = $this->renderTextField ($extra_field_id,$contents,$size,$maxlength);
601 $edit_tips = '<br/><span class="tips">'._('Tip: Enter a space-separated list of artifact ids ([#NNN] also accepted)').'</span>';
603 <div id="edit'.$extra_field_id.'" style="display: none;">'.$edit_contents.$edit_tips.'</div>
604 <div id="show'.$extra_field_id.'" style="display: block;">'.$html_contents.'</div>';
608 * renderTextArea - this function builds a text area.
610 * @param int The ID of this field.
611 * @param string The data for this field.
612 * @return text area and data.
614 function renderTextArea ($extra_field_id,$contents,$rows,$cols) {
616 <textarea name="extra_fields['.$extra_field_id.']" rows="'.$rows.'" cols="'.$cols.'">'.$contents.'</textarea>';
619 function technicianBox ($name='assigned_to[]',$checked='xzxz',$show_100=true,$text_100='none',$extra_id='-1',$extra_name='',$multiple=false) {
620 if ($text_100=='none'){
621 $text_100=_('Nobody');
624 $engine = RBACEngine::getInstance () ;
625 $techs = $engine->getUsersByAllowedAction ('tracker', $this->getID(), 'tech') ;
630 foreach ($techs as $tech) {
631 $ids[] = $tech->getID() ;
632 $names[] = $tech->getRealName() ;
635 if ($extra_id != '-1') {
637 $names[]=$extra_name;
641 if (!is_array($checked)) {
642 $checked = explode(',',$checked);
644 $size = min( count($ids)+1, 15);
645 return html_build_multiple_select_box_from_arrays ($ids,$names,$name,$checked,$size,$show_100,$text_100);
647 return html_build_select_box_from_arrays ($ids,$names,$name,$checked,$show_100,$text_100);
651 function cannedResponseBox ($name='canned_response',$checked='xzxz') {
652 return html_build_select_box ($this->getCannedResponses(),$name,$checked);
656 * statusBox - show the statuses - automatically shows the "custom statuses" if they exist
660 function statusBox ($name='status_id',$checked='xzxz',$show_100=false,$text_100='none') {
661 if ($text_100=='none'){
664 return html_build_select_box($this->getStatuses(),$name,$checked,$show_100,$text_100);
671 // c-file-style: "bsd"