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(_('Add/Update Canned Responses to %s'), $ath->getName()) ;
28 $ath->adminHeader(array ('title'=>$title));
31 List of existing canned responses
33 $result=$ath->getCannedResponses();
34 $rows=db_numrows($result);
37 if ($result && $rows > 0) {
38 //code to show existing responses and link to update page
39 echo '<h2>'._('Existing Responses').'</h2>';
42 $title_arr[]=_('Title');
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></tr>';
54 echo $GLOBALS['HTML']->listTableBottom();
57 echo '<p class="warning_msg">'._('No responses set up in this group').'</p>';
60 <p><?php echo _('Creating useful generic messages can save you a lot of time when handling common artifact requests.') ?></p>
61 <form action="<?php echo getStringFromServer('PHP_SELF').'?group_id='.$group_id.'&atid='.$ath->getID(); ?>" method="post">
62 <input type="hidden" name="add_canned" value="y" />
63 <strong><?php echo _('Title') ?>:</strong><br />
64 <input type="text" name="title" value="" size="50" maxlength="50" />
66 <strong><?php echo _('Message Body') ?>:</strong><br />
67 <textarea name="body" rows="30" cols="65"></textarea></p>
69 <input type="submit" name="post_changes" value="<?php echo _('Submit') ?>" /></p>
73 $ath->footer(array());
77 // c-file-style: "bsd"