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 COPY Choices configured by admin for extra_field BOXES
28 $id = getIntFromRequest('id');
29 $fb= new ArtifactExtraField($ath,$id);
31 // Get a list of all extra fields in trackers and groups that you have perms to admin
33 $res = db_query_params ('SELECT g.unix_group_name, agl.name AS tracker_name, aefl.field_name, aefl.extra_field_id
35 artifact_group_list agl,
36 artifact_extra_field_list aefl,
40 (ug.admin_flags=$1 OR ug.artifact_flags=2 OR ap.perm_level>=2)
42 AND ug.group_id=g.group_id
43 AND g.group_id=agl.group_id
44 AND agl.group_artifact_id=ap.group_artifact_id
46 AND aefl.group_artifact_id=agl.group_artifact_id
47 AND aefl.extra_field_id != $3
48 AND aefl.field_type IN (1,2,3,5,7)',
52 if (db_numrows($res) < 1) {
53 exit_error(_('Cannot find a destination tracker where you have administration rights.'),'tracker');
56 $title = sprintf(_('Copy choices from custom field %1$s'), $fb->getName());
57 $ath->adminHeader(array ('title'=>$title));
58 echo "<h3>".$title."</h3>";
60 $efearr = $ath->getExtraFieldElements($id);
61 for ($i=0; $i<count($efearr); $i++) {
62 $field_id_arr[] = $efearr[$i]['element_id'];
63 $field_arr[] = $efearr[$i]['element_name'];
66 <form action="<?php echo getStringFromServer('PHP_SELF') .'?group_id='.$group_id.'&atid='.$ath->getID(); ?>" method="post" >
69 <td></td><td><center><strong>
70 <?php echo _('Copy From') ?>
72 <?php echo $fb->getName() ?>
73 </strong></center></td>
76 <?php echo _('Into trackers and custom fields') ?>
77 </strong></center></td></tr>
80 <input type="hidden" name="copy_opt" value="copy" />
81 <input type="hidden" name="id" value="<?php echo $id; ?>" />
83 echo html_build_multiple_select_box_from_arrays($field_id_arr,$field_arr,'copyid[]',array(),10,false);
84 echo '</td><td><center><strong>';
86 while($arr =db_fetch_array($res)) {
87 $name_arr[]=$arr['unix_group_name']. '::'. $arr['tracker_name'] . '::'. $arr['field_name'];
88 $id_arr[]=$arr['extra_field_id'];
90 echo '</strong></center></td>';
91 echo '<td valign="top">';
93 echo html_build_select_box_from_arrays($id_arr,$name_arr,'selectid',$selectid,false);
98 <input type="submit" name="post_changes" value="<?php echo _('Submit') ?>" />
99 </td></tr></table></form>
102 $ath->footer(array());
106 // c-file-style: "bsd"