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.
25 // FORM TO ADD CANNED RESPONSES
27 $title = sprintf(_('Manage Canned Responses to %s'), $ath->getName());
28 $ath->adminHeader(array('title'=>$title, 'modal'=>1));
31 List of existing canned responses
33 $result=$ath->getCannedResponses();
34 $rows=db_numrows($result);
36 if ($result && $rows > 0) {
37 //code to show existing responses and link to update page
38 echo '<h2>'._('Existing Responses').'</h2>';
41 $title_arr[]=_('Title');
42 $title_arr[]=_('Operation');
44 echo $GLOBALS['HTML']->listTableTop ($title_arr);
46 for ($i=0; $i < $rows; $i++) {
47 echo '<tr '. $GLOBALS['HTML']->boxGetAltRowStyle($i) .'>'.
48 '<td>'.db_result($result, $i, 'id').'</td>'.
49 '<td><a href="'.getStringFromServer('PHP_SELF').'?update_canned=1&id='.
50 db_result($result, $i, 'id').'&group_id='.$group_id.'&atid='. $ath->getID() .'">'.
51 db_result($result, $i, 'title').'</a></td>
52 <td><a href="'.getStringFromServer('PHP_SELF').'?delete_canned=1&id='.
53 db_result($result, $i, 'id').'&group_id='.$group_id.'&atid='. $ath->getID() .'">['.
54 _('Delete').']</a></td></tr>';
57 echo $GLOBALS['HTML']->listTableBottom();
60 echo '<p class="information">'._('No responses set up in this group').'</p>';
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>
66 <form action="<?php echo getStringFromServer('PHP_SELF').'?group_id='.$group_id.'&atid='.$ath->getID(); ?>" method="post">
67 <input type="hidden" name="add_canned" value="y" />
68 <strong><?php echo _('Title') . _(':') ?></strong><?php echo utils_requiredField(); ?><br />
69 <input type="text" name="title" required="required" value="" size="80" maxlength="80" />
71 <strong><?php echo _('Message Body') . _(':') ?></strong><?php echo utils_requiredField(); ?><br />
72 <textarea name="body" required="required" rows="15" cols="80"></textarea></p>
74 <input type="submit" name="post_changes" value="<?php echo _('Submit') ?>" /></p>
78 $ath->footer(array());
82 // c-file-style: "bsd"