5 * Copyright 2010 (c) FusionForge Team
6 * http://fusionforge.org
8 * This file is part of FusionForge. FusionForge is free software;
9 * you can redistribute it and/or modify it under the terms of the
10 * GNU General Public License as published by the Free Software
11 * Foundation; either version 2 of the Licence, or (at your option)
14 * FusionForge is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License along
20 * with FusionForge; if not, write to the Free Software Foundation, Inc.,
21 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
26 // FORM TO ADD ELEMENTS TO EXTRA FIELD
28 $boxid = getIntFromRequest('boxid');
29 $ac = new ArtifactExtraField($ath,$boxid);
30 if (!$ac || !is_object($ac)) {
31 exit_error(_('Unable to create ArtifactExtraField Object'),'tracker');
32 } elseif ($ac->isError()) {
33 exit_error($ac->getErrorMessage(),'tracker');
35 $efearr=$ath->getExtraFieldElements($boxid);
36 $title = sprintf(_('Add/Update Custom Field Elements in %s'), $ath->getName());
37 $ath->adminHeader(array ('title'=>$title));
43 <form action="<?php echo 'index.php?group_id='.$group_id.'&atid='.$ath->getID().'&boxid='.$boxid; ?>" method="post">
46 $title_arr[]=_('Current / New positions');
47 $title_arr[]=_('Up/Down positions');
48 $title_arr[]=_('Elements Defined');
49 if ($ac->getType() == ARTIFACT_EXTRAFIELDTYPE_STATUS) {
50 $title_arr[] = _('Mapping');
54 echo $GLOBALS['HTML']->listTableTop ($title_arr,false, ' ');
56 for ($i=0; $i < $rows; $i++) {
57 echo '<tr '. $GLOBALS['HTML']->boxGetAltRowStyle($i) .'>'.
58 '<td class="align-right">'.
59 ($i + 1).' --> <input type="text" name="order['. $efearr[$i]['element_id'] .']" value="" size="3" maxlength="3" />'.
61 if ($ac->getType() == ARTIFACT_EXTRAFIELDTYPE_STATUS) {
63 $ath->getStatusName($efearr[$i]['status_id']) .
66 echo '<td class="align-center">'.
67 '<a href="index.php?group_id='.$group_id.'&atid='.$ath->getID().'&boxid='.$boxid.'&id='.$efearr[$i]['element_id'].
68 '&updownorder_opt=1&new_pos='.(($i == 0)? $i + 1 : $i).'">'.html_image('ic/btn_up.png','19','18',array('alt'=>"Up")).'</a>'.
69 '<a href="index.php?group_id='.$group_id.'&atid='.$ath->getID().'&boxid='.$boxid.'&id='.$efearr[$i]['element_id'].
70 '&updownorder_opt=1&new_pos='.(($i == $rows - 1)? $i + 1 : $i + 2).'">'.html_image('ic/btn_down.png','19','18',array('alt'=>"Down")).'</a>'.
71 '</td>'."\n".'<td>'.$efearr[$i]['element_name'].
72 '</td>'."\n".'<td class="align-center">'.
73 '<a href="'.getStringFromServer('PHP_SELF').'?update_opt=1&id='.
74 $efearr[$i]['element_id'].'&boxid='.
75 $boxid.'&group_id='.$group_id.'&atid='. $ath->getID() .'">'.
76 html_image('ic/forum_edit.gif','37','15',array('alt'=>"Edit")).'</a>'.
79 // echo $GLOBALS['HTML']->listTableBottom();
82 <td class="align-right">
83 <input type="submit" name="post_changes_order" value="<?php echo _('Reorder') ?>" />
87 <td class="align-left">
88 <input type="submit" name="post_changes_alphaorder" value="<?php echo _('Alphabetical order') ?>" />
91 <?php echo $GLOBALS['HTML']->listTableBottom(); ?>
96 echo "\n<strong>"._('You have not defined any elements')."</strong>";
99 <form action="<?php echo getStringFromServer('PHP_SELF').'?group_id='.$group_id.'&boxid='.$boxid.'&atid='.$ath->getID(); ?>" method="post">
100 <input type="hidden" name="add_opt" value="y" />
102 <strong><?php echo _('Add New Element') ?>:</strong>
103 <input type="text" name="name" value="" size="15" maxlength="30" />
105 Show a pop-up box to choose the possible statuses that this element will map to
107 <?php if ($ac->getType() == ARTIFACT_EXTRAFIELDTYPE_STATUS) { ?>
108 <strong><?php echo _('Status'); ?></strong>
109 <?php echo $ath->statusBox('status_id',1,false,false); ?>
111 <input type="submit" name="post_changes" value="<?php echo _('Submit') ?>" />
114 $ath->footer(array());
118 // c-file-style: "bsd"