Revision 1b0c7d3f
Von Sven Schöling vor etwa 15 Jahren hinzugefügt
bin/mozilla/projects.pl | ||
---|---|---|
39 | 39 |
require "bin/mozilla/common.pl"; |
40 | 40 |
require "bin/mozilla/reportgenerator.pl"; |
41 | 41 |
|
42 |
use strict; |
|
43 |
|
|
42 | 44 |
sub add { |
43 |
$lxdebug->enter_sub(); |
|
45 |
$main::lxdebug->enter_sub(); |
|
46 |
|
|
47 |
$main::auth->assert('project_edit'); |
|
44 | 48 |
|
45 |
$auth->assert('project_edit'); |
|
49 |
my $form = $main::form; |
|
50 |
my $locale = $main::locale; |
|
46 | 51 |
|
47 | 52 |
# construct callback |
48 | 53 |
$form->{callback} = build_std_url('action') unless $form->{callback}; |
49 | 54 |
|
50 | 55 |
display_project_form(); |
51 | 56 |
|
52 |
$lxdebug->leave_sub(); |
|
57 |
$main::lxdebug->leave_sub();
|
|
53 | 58 |
} |
54 | 59 |
|
55 | 60 |
sub edit { |
56 |
$lxdebug->enter_sub(); |
|
61 |
$main::lxdebug->enter_sub(); |
|
62 |
|
|
63 |
$main::auth->assert('project_edit'); |
|
57 | 64 |
|
58 |
$auth->assert('project_edit'); |
|
65 |
my $form = $main::form; |
|
66 |
my $locale = $main::locale; |
|
59 | 67 |
|
60 | 68 |
# show history button |
61 | 69 |
$form->{javascript} = qq|<script type="text/javascript" src="js/show_history.js"></script>|; |
... | ... | |
66 | 74 |
|
67 | 75 |
display_project_form(); |
68 | 76 |
|
69 |
$lxdebug->leave_sub(); |
|
77 |
$main::lxdebug->leave_sub();
|
|
70 | 78 |
} |
71 | 79 |
|
72 | 80 |
sub search { |
73 |
$lxdebug->enter_sub(); |
|
81 |
$main::lxdebug->enter_sub();
|
|
74 | 82 |
|
75 |
$auth->assert('project_edit'); |
|
83 |
$main::auth->assert('project_edit'); |
|
84 |
|
|
85 |
my $form = $main::form; |
|
86 |
my $locale = $main::locale; |
|
76 | 87 |
|
77 | 88 |
$form->{title} = $locale->text('Projects'); |
78 | 89 |
|
... | ... | |
85 | 96 |
$form->header(); |
86 | 97 |
print $form->parse_html_template('projects/search'); |
87 | 98 |
|
88 |
$lxdebug->leave_sub(); |
|
99 |
$main::lxdebug->leave_sub();
|
|
89 | 100 |
} |
90 | 101 |
|
91 | 102 |
sub project_report { |
92 |
$lxdebug->enter_sub(); |
|
103 |
$main::lxdebug->enter_sub(); |
|
104 |
|
|
105 |
$main::auth->assert('project_edit'); |
|
93 | 106 |
|
94 |
$auth->assert('project_edit'); |
|
107 |
my $form = $main::form; |
|
108 |
my %myconfig = %main::myconfig; |
|
109 |
my $locale = $main::locale; |
|
95 | 110 |
|
96 | 111 |
$form->{sort} ||= 'projectnumber'; |
97 | 112 |
my $filter = $form->{filter} || { }; |
... | ... | |
163 | 178 |
my $edit_url = build_std_url('action=edit&type=project'); |
164 | 179 |
my $callback = $form->escape($href) . '&sort=' . E($form->{sort}); |
165 | 180 |
|
166 |
foreach $project (@{ $form->{project_list} }) { |
|
181 |
foreach my $project (@{ $form->{project_list} }) {
|
|
167 | 182 |
$project->{active} = $project->{active} ? $locale->text('Yes') : $locale->text('No'); |
168 | 183 |
|
169 | 184 |
my $row = { map { $_ => { 'data' => $project->{$_} } } keys %{ $project } }; |
... | ... | |
175 | 190 |
|
176 | 191 |
$report->generate_with_headers(); |
177 | 192 |
|
178 |
$lxdebug->leave_sub(); |
|
193 |
$main::lxdebug->leave_sub();
|
|
179 | 194 |
} |
180 | 195 |
|
181 | 196 |
sub display_project_form { |
182 |
$lxdebug->enter_sub(); |
|
197 |
$main::lxdebug->enter_sub();
|
|
183 | 198 |
|
184 |
$auth->assert('project_edit'); |
|
199 |
$main::auth->assert('project_edit'); |
|
200 |
|
|
201 |
my $form = $main::form; |
|
202 |
my $locale = $main::locale; |
|
185 | 203 |
|
186 | 204 |
$form->{project} ||= { }; |
187 | 205 |
|
... | ... | |
194 | 212 |
$form->header(); |
195 | 213 |
print $form->parse_html_template('projects/project_form'); |
196 | 214 |
|
197 |
$lxdebug->leave_sub(); |
|
215 |
$main::lxdebug->leave_sub();
|
|
198 | 216 |
} |
199 | 217 |
|
200 | 218 |
sub save { |
201 |
$lxdebug->enter_sub(); |
|
219 |
$main::lxdebug->enter_sub(); |
|
220 |
|
|
221 |
$main::auth->assert('project_edit'); |
|
202 | 222 |
|
203 |
$auth->assert('project_edit'); |
|
223 |
my $form = $main::form; |
|
224 |
my %myconfig = %main::myconfig; |
|
225 |
my $locale = $main::locale; |
|
204 | 226 |
|
205 | 227 |
$form->isblank("project.projectnumber", $locale->text('Project Number missing!')); |
206 | 228 |
|
... | ... | |
225 | 247 |
|
226 | 248 |
$form->redirect($locale->text('Project saved!')); |
227 | 249 |
|
228 |
$lxdebug->leave_sub(); |
|
250 |
$main::lxdebug->leave_sub();
|
|
229 | 251 |
} |
230 | 252 |
|
231 | 253 |
sub save_as_new { |
232 |
$lxdebug->enter_sub(); |
|
254 |
$main::lxdebug->enter_sub(); |
|
255 |
|
|
256 |
my $form = $main::form; |
|
257 |
my $locale = $main::locale; |
|
233 | 258 |
|
234 | 259 |
delete $form->{project}->{id} if ($form->{project}); |
235 | 260 |
save(); |
236 | 261 |
|
237 |
$lxdebug->leave_sub(); |
|
262 |
$main::lxdebug->leave_sub();
|
|
238 | 263 |
} |
239 | 264 |
|
240 | 265 |
sub delete { |
241 |
$lxdebug->enter_sub(); |
|
266 |
$main::lxdebug->enter_sub(); |
|
267 |
|
|
268 |
$main::auth->assert('project_edit'); |
|
242 | 269 |
|
243 |
$auth->assert('project_edit'); |
|
270 |
my $form = $main::form; |
|
271 |
my %myconfig = %main::myconfig; |
|
272 |
my $locale = $main::locale; |
|
244 | 273 |
|
245 | 274 |
my $project = $form->{project} || { }; |
246 | 275 |
Projects->delete_project('id' => $project->{id}); |
... | ... | |
255 | 284 |
|
256 | 285 |
$form->redirect($locale->text('Project deleted!')); |
257 | 286 |
|
258 |
$lxdebug->leave_sub(); |
|
287 |
$main::lxdebug->leave_sub();
|
|
259 | 288 |
} |
260 | 289 |
|
261 | 290 |
sub continue { |
262 |
call_sub($form->{nextsub}); |
|
291 |
call_sub($main::form->{nextsub});
|
|
263 | 292 |
} |
Auch abrufbar als: Unified diff
projects strict