Migrate 4 builtin fields to fields2: priority, resolution, severity, status.
[bugdar.git] / includes / class_admin_navigation.php
1 <?php
2 /*=====================================================================*\
3 || ###################################################################
4 || # Bugdar
5 || # Copyright (c)2002-2007 Blue Static
6 || #
7 || # This program is free software; you can redistribute it and/or modify
8 || # it under the terms of the GNU General Public License as published by
9 || # the Free Software Foundation; version 2 of the License.
10 || #
11 || # This program is distributed in the hope that it will be useful, but
12 || # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13 || # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14 || # more details.
15 || #
16 || # You should have received a copy of the GNU General Public License along
17 || # with this program; if not, write to the Free Software Foundation, Inc.,
18 || # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
19 || ###################################################################
20 \*=====================================================================*/
21
22 /**
23 * Navigation Link System
24 *
25 * A static class whose methods are called to generate the common navigation
26 * links for the Admin CP.
27 *
28 * @author Blue Static
29 * @copyright Copyright (c)2002 - 2007, Blue Static
30 * @version $Revision$
31 * @package Bugdar
32 *
33 */
34 class NavLinks
35 {
36 // ###################################################################
37 /**
38 * All the different locations under the "Options" tab
39 *
40 * @access public
41 */
42 function optionsPages()
43 {
44 global $navigator;
45
46 $navigator->add_component('section', 'options-pages', 'options', T('Options'), null);
47 $navigator->add_component('link', 'options-pages-home', 'options-pages', T('Home'), 'index.php');
48 $navigator->add_component('link', 'options-pages-settings', 'options-pages', T('Bugdar Settings'), 'setting.php');
49 $navigator->add_component('link', 'options-pages-languages', 'options-pages', T('Languages'), 'language.php');
50 $navigator->add_component('link', 'options-pages-userhelp', 'options-pages', T('User Help Items'), 'userhelp.php');
51 }
52
53 // ###################################################################
54 /**
55 * Adding a new language
56 *
57 * @access public
58 */
59 function languagesAdd()
60 {
61 global $navigator;
62
63 $navigator->add_component('section', 'options-languages', 'options', T('Languages'), null);
64 $navigator->add_component('link', 'options-languages-add', 'options-languages', T('Add New Language'), 'language.php?do=add');
65 }
66
67 // ###################################################################
68 /**
69 * Edit a language
70 *
71 * @access public
72 *
73 * @param integer Language ID
74 */
75 function languagesEdit($id)
76 {
77 global $navigator;
78
79 NavLinks::languagesAdd();
80 $navigator->add_component('link', 'options-languages-edit', 'options-languages', T('Edit Language'), 'language.php?do=edit&amp;languageid=' . $id);
81 $navigator->add_component('link', 'options-languages-delete', 'options-languages', T('Delete'), 'language.php?do=delete&amp;languageid=' . $id);
82 }
83
84 // ###################################################################
85 /**
86 * Adding a new user help item
87 *
88 * @access public
89 */
90 function userhelpAdd()
91 {
92 global $navigator;
93
94 $navigator->add_component('section', 'options-userhelp', 'options', T('User Help Items'), null);
95 $navigator->add_component('link', 'options-userhelp-add', 'options-userhelp', T('Add New Item'), 'userhelp.php?do=add');
96 }
97
98 // ###################################################################
99 /**
100 * Adding a new product
101 *
102 * @access public
103 */
104 function productsAdd()
105 {
106 global $navigator;
107
108 $navigator->add_component('section', 'products', 'products', T('Products'), null);
109 $navigator->add_component('link', 'products-manage', 'products', T('Manage Products'), 'product.php');
110 $navigator->add_component('link', 'products-add', 'products', T('Add New Product'), 'product.php?do=addproduct');
111 }
112
113 // ###################################################################
114 /**
115 * Editing a product
116 *
117 * @access public
118 *
119 * @param integer Product ID
120 */
121 function productsEdit($id)
122 {
123 global $navigator;
124
125 NavLinks::productsAdd();
126 $navigator->add_component('section', 'products-edit', 'products', T('Edit Product'), null);
127 $navigator->add_component('link', 'products-edit', 'products-edit', T('Edit Product'), 'product.php?do=editproduct&amp;productid=' . $id);
128 $navigator->add_component('link', 'products-edit-version', 'products-edit', T('Add New Version'), 'product.php?do=addversion&amp;productid=' . $id);
129 $navigator->add_component('link', 'products-edit-delete', 'products-edit', T('Delete Product'), 'product.php?do=deleteproduct&amp;productid=' . $id);
130 }
131
132 // ###################################################################
133 /**
134 * Fields tab pages
135 *
136 * @access public
137 */
138 function fieldsPages()
139 {
140 global $navigator;
141
142 $navigator->add_component('section', 'fields-pages', 'fields', T('Fields'), null);
143 $navigator->add_component('link', 'fields-pages-fields', 'fields-pages', T('Custom Fields'), 'field.php');
144 }
145
146 // ###################################################################
147 /**
148 * Adding an new custom field
149 *
150 * @access public
151 */
152 function fieldsAdd()
153 {
154 global $navigator;
155
156 $navigator->add_component('section', 'fields', 'fields', T('Custom Fields'), null);
157 $navigator->add_component('link', 'fields-add', 'fields', T('Add New Custom Field'), 'field.php?do=add');
158 }
159
160 // ###################################################################
161 /**
162 * Edit a custom field
163 *
164 * @access public
165 *
166 * @param integer Field ID
167 */
168 function fieldsEdit($id)
169 {
170 global $navigator;
171
172 NavLinks::fieldsAdd();
173 $navigator->add_component('link', 'fields-delete', 'fields', T('Delete'), 'field.php?do=delete&amp;fieldid=' . $id);
174 }
175
176 // ###################################################################
177 /**
178 * Adding an new automation
179 *
180 * @access public
181 */
182 function automationsAdd()
183 {
184 global $navigator;
185
186 $navigator->add_component('section', 'automations', 'fields', T('Automations'), null);
187 $navigator->add_component('link', 'automations-add', 'automations', T('Add New Automation'), 'automation.php?do=add');
188 }
189
190 // ###################################################################
191 /**
192 * Edit an automation
193 *
194 * @access public
195 *
196 * @param integer Action ID
197 */
198 function automationsEdit($id)
199 {
200 global $navigator;
201
202 NavLinks::automationsAdd();
203 $navigator->add_component('link', 'automations-delete', 'automations', T('Delete'), 'automation.php?do=delete&amp;actionid=' . $id);
204 }
205
206 // ###################################################################
207 /**
208 * User tab pages
209 *
210 * @access public
211 */
212 function usersPages()
213 {
214 global $navigator;
215
216 $navigator->add_component('section', 'users-pages', 'users', T('Users &amp; Permissions'), null);
217 $navigator->add_component('link', 'users-pages-users', 'users-pages', T('Users'), 'user.php');
218 $navigator->add_component('link', 'users-pages-usergroups', 'users-pages', T('Usergroups'), 'usergroup.php');
219 $navigator->add_component('link', 'users-pages-permissions', 'users-pages', T('Product-Level Permissions'), 'permission.php');
220 }
221
222 // ###################################################################
223 /**
224 * Add a new user
225 *
226 * @access public
227 */
228 function usersAdd()
229 {
230 global $navigator;
231
232 $navigator->add_component('section', 'users', 'users', T('Users'), null);
233 $navigator->add_component('link', 'users-showall', 'users', T('Show All Users'), 'user.php?do=showall');
234 $navigator->add_component('link', 'users-add', 'users', T('Add New User'), 'user.php?do=add');
235 }
236
237 // ###################################################################
238 /**
239 * Edit a user
240 *
241 * @access public
242 *
243 * @param integer User ID
244 */
245 function usersEdit($id)
246 {
247 global $navigator;
248
249 NavLinks::usersAdd();
250 $navigator->add_component('link', 'users-delete', 'users', T('Delete'), 'user.php?do=delete&amp;userid=' . $id);
251 }
252
253 // ###################################################################
254 /**
255 * Add a new usergroup
256 *
257 * @access public
258 */
259 function usergroupsAdd()
260 {
261 global $navigator;
262
263 $navigator->add_component('section', 'usergroups', 'users', T('Usergroups'), null);
264 $navigator->add_component('link', 'usergroups-add', 'usergroups', T('Add New Usergroup'), 'usergroup.php?do=add');
265 $navigator->add_component('link', 'usergroups-approve', 'usergroups', T('Moderate Awaiting Users'), 'usergroup.php?do=approve');
266 }
267
268 // ###################################################################
269 /**
270 * Edit a usergroup
271 *
272 * @access public
273 *
274 * @param integer User ID
275 */
276 function usergroupsEdit($id)
277 {
278 global $navigator;
279
280 NavLinks::usergroupsAdd();
281 $navigator->add_component('link', 'usergroups-delete', 'usergroups', T('Delete'), 'usergroup.php?do=delete&amp;userid=' . $id);
282 }
283 }
284