5 * Copyright 2010 (c) FusionForge Team
6 * Copyright 2015, Franck Villaume - TrivialDev
7 * http://fusionforge.org
9 * This file is part of FusionForge. FusionForge is free software;
10 * you can redistribute it and/or modify it under the terms of the
11 * GNU General Public License as published by the Free Software
12 * Foundation; either version 2 of the Licence, or (at your option)
15 * FusionForge is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License along
21 * with FusionForge; if not, write to the Free Software Foundation, Inc.,
22 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
28 // FORM TO ADD CANNED RESPONSES
30 $title = sprintf(_('Manage Canned Responses to %s'), $ath->getName());
31 $ath->adminHeader(array('title'=>$title, 'modal'=>1));
34 List of existing canned responses
36 $result=$ath->getCannedResponses();
37 $rows=db_numrows($result);
39 if ($result && $rows > 0) {
40 //code to show existing responses and link to update page
41 echo '<h2>'._('Existing Responses').'</h2>';
44 $title_arr[]=_('Title');
45 $title_arr[]=_('Operation');
47 echo $HTML->listTableTop($title_arr);
49 for ($i=0; $i < $rows; $i++) {
50 $id = db_result($result, $i, 'id');
51 echo '<tr '. $HTML->boxGetAltRowStyle($i) .'>'.
53 '<td>'.util_make_link('/tracker/admin/?update_canned=1&id='.$id.'&group_id='.$group_id.'&atid='.$ath->getID(), db_result($result, $i, 'title')).'</td>
54 <td>'.util_make_link('/tracker/admin/?delete_canned=1&id='.$id.'&group_id='.$group_id.'&atid='. $ath->getID(), _('Delete')).'</td></tr>';
57 echo $HTML->listTableBottom();
60 echo $HTML->information(_('No Canned Responses set up in this Project'));
63 echo '<h2>'._('Add New Canned Response').'</h2>';
65 <p><?php echo _('Creating useful generic messages can save you a lot of time when handling common artifact requests.') ?></p>
67 echo $HTML->openForm(array('action' => '/tracker/admin/?group_id='.$group_id.'&atid='.$ath->getID().'&add_canned=1', 'method' => 'post'));
69 <input type="hidden" name="add_canned" value="y" />
71 <strong><?php echo _('Title').utils_requiredField()._(':') ?></strong><br />
73 <input id="title" type="text" name="title" required="required" value="" size="80" maxlength="80" />
76 <strong><?php echo _('Message Body').utils_requiredField()._(':') ?></strong><br />
78 <textarea id="body" name="body" required="required" rows="15" cols="80"></textarea></p>
80 <input type="submit" name="post_changes" value="<?php echo _('Submit') ?>" /></p>
82 echo $HTML->closeForm();
87 // c-file-style: "bsd"