1 | <?php
|
---|
2 | /*
|
---|
3 | $Id: taskgroup_edit.php 2301 2009-08-25 09:15:52Z andrewsimpson $
|
---|
4 |
|
---|
5 | (c) 2002 - 2009 Andrew Simpson <andrew.simpson at paradise.net.nz>
|
---|
6 |
|
---|
7 | WebCollab
|
---|
8 | ---------------------------------------
|
---|
9 |
|
---|
10 | This program is free software; you can redistribute it and/or modify it under the
|
---|
11 | terms of the GNU General Public License as published by the Free Software Foundation;
|
---|
12 | either version 2 of the License, or (at your option) any later version.
|
---|
13 |
|
---|
14 | This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
---|
15 | WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
---|
16 | PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
---|
17 |
|
---|
18 | You should have received a copy of the GNU General Public License along with this
|
---|
19 | program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave,
|
---|
20 | Cambridge, MA 02139, USA.
|
---|
21 |
|
---|
22 | Function:
|
---|
23 | ---------
|
---|
24 |
|
---|
25 | Edit taskgroups
|
---|
26 |
|
---|
27 | */
|
---|
28 |
|
---|
29 | //security check
|
---|
30 | if(! defined('UID' ) ) {
|
---|
31 | die('Direct file access not permitted' );
|
---|
32 | }
|
---|
33 |
|
---|
34 | //admins only
|
---|
35 | if(! ADMIN ){
|
---|
36 | error('Unauthorised access', 'This function is for admins only.' );
|
---|
37 | }
|
---|
38 |
|
---|
39 | //secure
|
---|
40 | if(! @safe_integer($_GET['taskgroupid']) ){
|
---|
41 | error('Taskgroup edit', 'There is no taskgroupid specified.' );
|
---|
42 | }
|
---|
43 | $taskgroupid = $_GET['taskgroupid'];
|
---|
44 |
|
---|
45 | //get taskgroup information
|
---|
46 | if(! ($q = db_query('SELECT * FROM '.PRE.'taskgroups WHERE id='.$taskgroupid, 0 ) ) ) {
|
---|
47 | error('Taskgroup edit', 'There was an error in the data query.' );
|
---|
48 | }
|
---|
49 |
|
---|
50 | if(! ($row = db_fetch_array( $q, 0 ) ) ) {
|
---|
51 | error('Taskgroup edit', 'Taskgroup does not exist' );
|
---|
52 | }
|
---|
53 |
|
---|
54 | $content = "<form method=\"post\" action=\"taskgroups.php\">\n".
|
---|
55 | "<fieldset><input type=\"hidden\" name=\"x\" value=\"".X."\" />\n".
|
---|
56 | "<input type=\"hidden\" name=\"taskgroupid\" value=\"".$taskgroupid."\" />\n".
|
---|
57 | "<input type=\"hidden\" name=\"action\" value=\"submit_edit\" />\n".
|
---|
58 | "<input type=\"hidden\" name=\"token\" value=\"".TOKEN."\" /></fieldset>\n".
|
---|
59 | "<table class=\"celldata\">\n".
|
---|
60 | "<tr><td>".$lang['taskgroup_name']."</td> <td><input type=\"text\" name=\"name\" value=\"".$row['name']." \"size=\"30\" /></td></tr>\n".
|
---|
61 | "<tr><td>".$lang['taskgroup_description']."</td><td><input type=\"text\" name=\"description\" value=\"".$row['description']." \"size=\"30\" /></td></tr>\n".
|
---|
62 | "</table>\n".
|
---|
63 | "<p><input type=\"submit\" value=\"".$lang['submit_changes']."\" /></p>\n".
|
---|
64 | "</form>\n".
|
---|
65 | "<form method=\"post\" action=\"taskgroups.php\" ".
|
---|
66 | "onsubmit=\"return confirm( '".$lang['confirm_del_javascript']."')\">\n".
|
---|
67 | "<fieldset><input type=\"hidden\" name=\"x\" value=\"".X."\" />\n".
|
---|
68 | "<input type=\"hidden\" name=\"taskgroupid\" value=\"".$taskgroupid."\" />\n".
|
---|
69 | "<input type=\"hidden\" name=\"action\" value=\"submit_del\" />\n".
|
---|
70 | "<input type=\"hidden\" name=\"token\" value=\"".TOKEN."\" /></fieldset>\n".
|
---|
71 | "<p><input type=\"submit\" value=\"".$lang['delete']."\"/></p>\n".
|
---|
72 | "</form>\n";
|
---|
73 |
|
---|
74 | new_box($lang['edit_taskgroup'], $content );
|
---|
75 |
|
---|
76 | ?>
|
---|