Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 08844064

Von Moritz Bunkus vor fast 17 Jahren hinzugefügt

  • ID 0884406403ce36af3484924086527ba689807329
  • Vorgänger 596c6378
  • Nachfolger de41ce6f

Projektverwaltung in eine eigene Datei ausgelagert und auf die Verwendung von Template umgestellt.

Unterschiede anzeigen:

SL/Form.pm
763 763
  if (!$template->process($file, $additional_params, \$output)) {
764 764
    print STDERR $template->error();
765 765
  }
766
  $main::lxdebug->message(0, "err " . $template->error());
766 767

  
767 768
  $output = $main::locale->{iconv}->convert($output) if ($main::locale);
768 769

  
SL/PE.pm
28 28
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
29 29
#======================================================================
30 30
#
31
# Project module
32
# also used for partsgroups
31
# Partsgroups and pricegroups
33 32
#
34 33
#======================================================================
35 34

  
......
39 38

  
40 39
use SL::DBUtils;
41 40

  
42
sub projects {
43
  $main::lxdebug->enter_sub();
44

  
45
  my ($self, $myconfig, $form) = @_;
46

  
47
  # connect to database
48
  my $dbh = $form->dbconnect($myconfig);
49

  
50
  my ($where, @values);
51

  
52
  foreach my $column (qw(projectnumber description)) {
53
    if ($form->{$column}) {
54
      $where .= qq|AND $column ILIKE ? |;
55
      push(@values, '%' . $form->{$column} . '%');
56
    }
57
  }
58

  
59
  if ($form->{status} eq 'orphaned') {
60
    my %col_prefix = ("ar" => "global", "ap" => "global", "oe" => "global");
61
    my $first = 1;
62

  
63
    $where .= qq|AND id NOT IN (|;
64
    foreach my $table (qw(acc_trans invoice orderitems rmaitems ar ap oe)) {
65
      $where .= "UNION " unless ($first);
66
      $first = 0;
67
      $where .=
68
        qq|SELECT DISTINCT $col_prefix{$table}project_id FROM $table | .
69
        qq|WHERE NOT $col_prefix{$table}project_id ISNULL |;
70
    }
71
    $where .= qq|) |;
72
  }
73

  
74
  if ($form->{active} eq "active") {
75
    $where .= qq|AND active |;
76
  } elsif ($form->{active} eq "inactive") {
77
    $where .= qq|AND NOT active |;
78
  }
79

  
80
  substr($where, 0, 4) = "WHERE " if ($where);
81

  
82
  my $sortorder = $form->{sort} ? $form->{sort} : "projectnumber";
83
  $sortorder =~ s/[^a-z_]//g;
84
  my $query =
85
    qq|SELECT id, projectnumber, description, active | .
86
    qq|FROM project | .
87
    $where .
88
    qq|ORDER BY $sortorder|;
89

  
90
  $form->{project_list} =
91
    selectall_hashref_query($form, $dbh, $query, @values);
92
  $dbh->disconnect;
93

  
94
  $main::lxdebug->leave_sub();
95

  
96
  return scalar(@{ $form->{project_list} });
97
}
98

  
99
sub get_project {
100
  $main::lxdebug->enter_sub();
101

  
102
  my ($self, $myconfig, $form) = @_;
103

  
104
  # connect to database
105
  my $dbh = $form->dbconnect($myconfig);
106

  
107
  my $query =
108
    qq|SELECT * FROM project | .
109
    qq|WHERE id = ?|;
110
	my @values = ($form->{id});
111
  my $sth = $dbh->prepare($query);
112
  $sth->execute(@values) || $form->dberror($query);
113

  
114
  my $ref = $sth->fetchrow_hashref(NAME_lc);
115

  
116
  map { $form->{$_} = $ref->{$_} } keys %$ref;
117

  
118
  $sth->finish;
119

  
120
  # check if it is orphaned
121
  my %col_prefix = ("ar" => "global", "ap" => "global", "oe" => "global");
122
  @values = ();
123
  $query = qq|SELECT |;
124
  my $first = 1;
125
  foreach my $table (qw(acc_trans invoice orderitems rmaitems ar ap oe)) {
126
    $query .= " + " unless ($first);
127
    $first = 0;
128
    $query .=
129
      qq|(SELECT COUNT(*) FROM $table | .
130
      qq| WHERE $col_prefix{$table}project_id = ?) |;
131
    push(@values, $form->{id});
132
  }
133

  
134
  ($form->{orphaned}) = selectrow_query($form, $dbh, $query, @values);
135
  $form->{orphaned} = !$form->{orphaned};
136

  
137
  $dbh->disconnect;
138

  
139
  $main::lxdebug->leave_sub();
140
}
141

  
142
sub save_project {
143
  $main::lxdebug->enter_sub();
144

  
145
  my ($self, $myconfig, $form) = @_;
146

  
147
  # connect to database
148
  my $dbh = $form->dbconnect($myconfig);
149

  
150
  my @values = ($form->{projectnumber}, $form->{description});
151

  
152
  if ($form->{id}) {
153
    $query =
154
      qq|UPDATE project SET projectnumber = ?, description = ?, active = ? | .
155
      qq|WHERE id = ?|;
156
    push(@values, ($form->{active} ? 't' : 'f'), $form->{id});
157
  } else {
158
    $query =
159
      qq|INSERT INTO project (projectnumber, description, active) | .
160
      qq|VALUES (?, ?, 't')|;
161
  }
162
  do_query($form, $dbh, $query, @values);
163

  
164
  $dbh->disconnect;
165

  
166
  $main::lxdebug->leave_sub();
167
}
168

  
169 41
sub partsgroups {
170 42
  $main::lxdebug->enter_sub();
171 43

  
......
265 137
  # connect to database
266 138
  my $dbh = $form->dbconnect($myconfig);
267 139

  
268
  my $table =
269
    $form->{type} eq "project" ? "project" :
270
    $form->{type} eq "pricegroup" ? "pricegroup" :
271
    "partsgroup";
140
  my $table = $form->{type} eq "pricegroup" ? "pricegroup" : "partsgroup";
272 141

  
273 142
  $query = qq|DELETE FROM $table WHERE id = ?|;
274 143
  do_query($form, $dbh, $query, $form->{id});
SL/Projects.pm
1
#=====================================================================
2
# LX-Office ERP
3
# Copyright (C) 2004
4
# Based on SQL-Ledger Version 2.1.9
5
# Web http://www.lx-office.org
6
#
7
#=====================================================================
8
# SQL-Ledger Accounting
9
# Copyright (C) 1998-2002
10
#
11
#  Author: Dieter Simader
12
#   Email: dsimader@sql-ledger.org
13
#     Web: http://www.sql-ledger.org
14
#
15
#  Contributors:
16
#
17
# This program is free software; you can redistribute it and/or modify
18
# it under the terms of the GNU General Public License as published by
19
# the Free Software Foundation; either version 2 of the License, or
20
# (at your option) any later version.
21
#
22
# This program is distributed in the hope that it will be useful,
23
# but WITHOUT ANY WARRANTY; without even the implied warranty of
24
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
25
# GNU General Public License for more details.
26
# You should have received a copy of the GNU General Public License
27
# along with this program; if not, write to the Free Software
28
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
29
#======================================================================
30
#
31
# Project module
32
#
33
#======================================================================
34

  
35
package Projects;
36

  
37
use Data::Dumper;
38

  
39
use SL::DBUtils;
40

  
41
my %project_id_column_prefixes  = ("ar"              => "global",
42
                                   "ap"              => "global",
43
                                   "oe"              => "global",
44
                                   "delivery_orders" => "global");
45

  
46
my @tables_with_project_id_cols = qw(acc_trans
47
                                     invoice
48
                                     orderitems
49
                                     rmaitems
50
                                     ar
51
                                     ap
52
                                     oe
53
                                     delivery_orders
54
                                     delivery_order_items);
55

  
56
sub search_projects {
57
  $main::lxdebug->enter_sub();
58

  
59
  my $self     = shift;
60
  my %params   = @_;
61

  
62
  my $myconfig = \%main::myconfig;
63
  my $form     = $main::form;
64

  
65
  my $dbh      = $params{dbh} || $form->get_standard_dbh($myconfig);
66

  
67
  my (@filters, @values);
68

  
69
  foreach my $column (qw(projectnumber description)) {
70
    if ($params{$column}) {
71
      push @filters, "$column ILIKE ?";
72
      push @values, '%' . $params{$column} . '%';
73
    }
74
  }
75

  
76
  if ($params{status} eq 'orphaned') {
77
    my @sub_filters;
78

  
79
    foreach my $table (@tables_with_project_id_cols) {
80
      push @sub_filters, qq|SELECT DISTINCT $project_id_column_prefixes{$table}project_id FROM $table
81
                            WHERE NOT $project_id_column_prefixes{$table}project_id ISNULL|;
82
    }
83

  
84
    push @filters, "id NOT IN (" . join(" UNION ", @sub_filters) . ")";
85
  }
86

  
87
  if ($params{active} eq "active") {
88
    push @filters, 'active';
89

  
90
  } elsif ($params{active} eq "inactive") {
91
    push @filters, 'NOT COALESCE(active, FALSE)';
92
  }
93

  
94
  my $where = 'WHERE ' . join(' AND ', map { "($_)" } @filters) if (scalar @filters);
95

  
96
  my $sortorder =  $params{sort} ? $params{sort} : "projectnumber";
97
  $sortorder    =~ s/[^a-z_]//g;
98
  my $query     = qq|SELECT id, projectnumber, description, active
99
                     FROM project
100
                     $where
101
                     ORDER BY $sortorder|;
102

  
103
  $form->{project_list} = selectall_hashref_query($form, $dbh, $query, @values);
104

  
105
  $main::lxdebug->leave_sub();
106

  
107
  return scalar(@{ $form->{project_list} });
108
}
109

  
110
sub get_project {
111
  $main::lxdebug->enter_sub();
112

  
113
  my $self     = shift;
114
  my %params   = @_;
115

  
116
  if (!$params{id}) {
117
    $main::lxdebug->leave_sub();
118
    return { };
119
  }
120

  
121
  my $myconfig = \%main::myconfig;
122
  my $form     = $main::form;
123

  
124
  my $dbh      = $params{dbh} || $form->get_standard_dbh($myconfig);
125

  
126
  my $project  = selectfirst_hashref_query($form, $dbh, qq|SELECT * FROM project WHERE id = ?|, conv_i($params{id})) || { };
127

  
128
  if ($params{orphaned}) {
129
    # check if it is orphaned
130
    my (@values, $query);
131

  
132
    foreach my $table (@tables_with_project_id_cols) {
133
      $query .= " + " if ($query);
134
      $query .= qq|(SELECT COUNT(*) FROM $table
135
                    WHERE $project_id_column_prefixes{$table}project_id = ?) |;
136
      push @values, conv_i($params{id});
137
    }
138

  
139
    $query = 'SELECT ' . $query;
140

  
141
    ($project->{orphaned}) = selectrow_query($form, $dbh, $query, @values);
142
    $project->{orphaned}   = !$project->{orphaned};
143
  }
144

  
145
  $main::lxdebug->leave_sub();
146

  
147
  return $project;
148
}
149

  
150
sub save_project {
151
  $main::lxdebug->enter_sub();
152

  
153
  my $self     = shift;
154
  my %params   = @_;
155

  
156
  my $myconfig = \%main::myconfig;
157
  my $form     = $main::form;
158

  
159
  my $dbh      = $params{dbh} || $form->get_standard_dbh($myconfig);
160

  
161
  my @values;
162

  
163
  if (!$params{id}) {
164
    ($params{id}) = selectfirst_array_query($form, $dbh, qq|SELECT nextval('id')|);
165
    do_query($form, $dbh, qq|INSERT INTO project (id) VALUES (?)|, conv_i($params{id}));
166

  
167
    $params{active} = 1;
168
  }
169

  
170
  $query  = qq|UPDATE project SET projectnumber = ?, description = ?, active = ?
171
               WHERE id = ?|;
172

  
173
  @values = ($params{projectnumber}, $params{description}, $params{active} ? 't' : 'f', conv_i($params{id}));
174
  do_query($form, $dbh, $query, @values);
175

  
176
  $dbh->commit();
177

  
178
  $main::lxdebug->leave_sub();
179

  
180
  return $params{id};
181
}
182

  
183
sub delete_project {
184
  $main::lxdebug->enter_sub();
185

  
186
  my $self     = shift;
187
  my %params   = @_;
188

  
189
  Common::check_params(\%params, qw(id));
190

  
191
  my $myconfig = \%main::myconfig;
192
  my $form     = $main::form;
193

  
194
  my $dbh      = $params{dbh} || $form->get_standard_dbh($myconfig);
195

  
196
  do_query($form, $dbh, qq|DELETE FROM project WHERE id = ?|, conv_i($params{id}));
197

  
198
  $dbh->commit();
199

  
200
  $main::lxdebug->leave_sub();
201
}
202

  
203
1;
204

  
bin/mozilla/arap.pl
30 30
# common routines for gl, ar, ap, is, ir, oe
31 31
#
32 32

  
33
use SL::Projects;
34

  
33 35
# any custom scripts for this one
34 36
if (-f "bin/mozilla/custom_arap.pl") {
35 37
  eval { require "bin/mozilla/custom_arap.pl"; };
......
281 283

  
282 284
        # get new project
283 285
        $form->{projectnumber} = $form->{"${prefix}projectnumber${suffix}"};
284
        if (($rows = PE->projects(\%myconfig, $form)) > 1) {
286
        my %params             = map { $_ => $form->{$_} } qw(projectnumber description active);
287
        if (($rows = Projects->search_projects(%params)) > 1) {
285 288

  
286 289
          # check form->{project_list} how many there are
287 290
          $form->{rownumber} = $i;
bin/mozilla/pe.pl
27 27
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
28 28
#======================================================================
29 29
#
30
# project administration
31
# partsgroup administration
30
# partsgroup, pricegroup administration
32 31
#
33 32
#======================================================================
34 33

  
......
68 67
  #/show hhistory button
69 68
  $form->{title} = "Edit";
70 69

  
71
  if ($form->{type} eq 'project') {
72
    PE->get_project(\%myconfig, \%$form);
73
  }
74 70
  if ($form->{type} eq 'partsgroup') {
75 71
    PE->get_partsgroup(\%myconfig, \%$form);
76 72
  }
......
88 84

  
89 85
  $auth->assert('config');
90 86

  
91
  if ($form->{type} eq 'project') {
92
    $report        = "project_report";
93
    $sort          = 'projectnumber';
94
    $form->{title} = $locale->text('Projects');
95

  
96
    $number = qq|
97
	<tr>
98
	  <th align=right width=1%>| . $locale->text('Number') . qq|</th>
99
	  <td>| . $cgi->textfield('-name' => 'projectnumber', '-size' => 20) . qq|</td>
100
	</tr>
101
	<tr>
102
	  <th align=right>| . $locale->text('Description') . qq|</th>
103
	  <td>| . $cgi->textfield('-name' => 'description', '-size' => 60) . qq|</td>
104
	</tr>
105
  <tr>
106
    <th>&nbsp;</th>
107
    <td>| .
108
    $cgi->radio_group('-name' => 'active', '-default' => 'active',
109
                      '-values' => ['active', 'inactive', 'both'],
110
                      '-labels' => { 'active' => ' ' . $locale->text("Active"),
111
                                     'inactive' => ' ' . $locale->text("Inactive"),
112
                                     'both' => ' ' . $locale->text("Both") })
113
    . qq|</td>
114
  </tr>
115
|;
116

  
117
  }
118 87
  if ($form->{type} eq 'partsgroup') {
119 88
    $report        = "partsgroup_report";
120 89
    $sort          = 'partsgroup';
......
192 161
  $lxdebug->leave_sub();
193 162
}
194 163

  
195
sub project_report {
196
  $lxdebug->enter_sub();
197

  
198
  $auth->assert('config');
199

  
200
  map { $form->{$_} = $form->unescape($form->{$_}) }
201
    (projectnumber, description);
202
  PE->projects(\%myconfig, \%$form);
203

  
204
  $callback =
205
    "$form->{script}?action=project_report&type=$form->{type}&status=$form->{status}&active=" .
206
    E($form->{active});
207
  $href = $callback;
208

  
209
  if ($form->{status} eq 'all') {
210
    $option = $locale->text('All');
211
  }
212
  if ($form->{status} eq 'orphaned') {
213
    $option .= $locale->text('Orphaned');
214
  }
215
  if ($form->{projectnumber}) {
216
    $href     .= "&projectnumber=" . $form->escape($form->{projectnumber});
217
    $callback .= "&projectnumber=$form->{projectnumber}";
218
    $option   .=
219
      "\n<br>" . $locale->text('Project') . " : $form->{projectnumber}";
220
  }
221
  if ($form->{description}) {
222
    $href     .= "&description=" . $form->escape($form->{description});
223
    $callback .= "&description=$form->{description}";
224
    $option   .=
225
      "\n<br>" . $locale->text('Description') . " : $form->{description}";
226
  }
227

  
228
  @column_index = qw(projectnumber description);
229

  
230
  push(@column_index, "active") if ("both" eq $form->{active});
231

  
232
  $column_header{projectnumber} =
233
      qq|<th><a class=listheading href=$href&sort=projectnumber>|
234
    . $locale->text('Number')
235
    . qq|</a></th>|;
236
  $column_header{description} =
237
      qq|<th><a class=listheading href=$href&sort=description>|
238
    . $locale->text('Description')
239
    . qq|</a></th>|;
240
  $column_header{active} =
241
      qq|<th class="listheading">| . $locale->text('Active') . qq|</th>|;
242

  
243
  $form->{title} = $locale->text('Projects');
244

  
245
  $form->header;
246

  
247
  print qq|
248
<body>
249

  
250
<table width=100%>
251
  <tr>
252
    <th class=listtop>$form->{title}</th>
253
  </tr>
254
  <tr height="5"></tr>
255
  <tr>
256
    <td>$option</td>
257
  </tr>
258
  <tr>
259
    <td>
260
      <table width=100%>
261
	<tr class=listheading>
262
|;
263

  
264
  map { print "$column_header{$_}\n" } @column_index;
265

  
266
  print qq|
267
        </tr>
268
|;
269

  
270
  # escape callback
271
  $form->{callback} = $callback .= "&sort=$form->{sort}";
272

  
273
  # escape callback for href
274
  $callback = $form->escape($callback);
275

  
276
  foreach $ref (@{ $form->{project_list} }) {
277

  
278
    $i++;
279
    $i %= 2;
280

  
281
    print qq|
282
        <tr valign=top class=listrow$i>
283
|;
284

  
285
    $column_data{projectnumber} =
286
      qq|<td><a href=$form->{script}?action=edit&type=$form->{type}&status=$form->{status}&id=$ref->{id}&callback=$callback>$ref->{projectnumber}</td>|;
287
    $column_data{description} = qq|<td>$ref->{description}&nbsp;</td>|;
288
    $column_data{active} =
289
      qq|<td>| .
290
      ($ref->{active} ? $locale->text("Yes") : $locale->text("No")) .
291
      qq|</td>|;
292

  
293
    map { print "$column_data{$_}\n" } @column_index;
294

  
295
    print "
296
        </tr>
297
";
298
  }
299

  
300
  print qq|
301
      </table>
302
    </td>
303
  </tr>
304
  <tr>
305
    <td><hr size=3 noshade></td>
306
  </tr>
307
</table>
308

  
309
<br>
310
<form method=post action=$form->{script}>
311

  
312
<input name=callback type=hidden value="$form->{callback}">
313

  
314
<input type=hidden name=type value=$form->{type}>
315

  
316
<input class=submit type=submit name=action value="|
317
    . $locale->text('Add') . qq|">
318

  
319
  </form>
320

  
321
</body>
322
</html>
323
|;
324

  
325
  $lxdebug->leave_sub();
326
}
327

  
328
sub form_project_header {
329
  $lxdebug->enter_sub();
330

  
331
  $auth->assert('config');
332

  
333
  $form->{title} = $locale->text("$form->{title} Project");
334

  
335
  # $locale->text('Add Project')
336
  # $locale->text('Edit Project')
337

  
338
  $form->{description} =~ s/\"/&quot;/g;
339

  
340
  my $projectnumber =
341
    $cgi->textfield('-name' => 'projectnumber', '-size' => 20,
342
                    '-default' => $form->{projectnumber});
343

  
344
  my $description;
345
  if (($rows = $form->numtextrows($form->{description}, 60)) > 1) {
346
    $description =
347
      $cgi->textarea('-name' => 'description', '-rows' => $rows, '-cols' => 60,
348
                     '-style' => 'width: 100%', '-wrap' => 'soft',
349
                     '-default' => $form->{description});
350
  } else {
351
    $description =
352
      $cgi->textfield('-name' => 'description', '-size' => 60,
353
                      '-default' => $form->{description});
354
  }
355

  
356
  my $active;
357
  if ($form->{id}) {
358
    $active =
359
      qq|
360
  <tr>
361
    <th>&nbsp;</th>
362
    <td>| .
363
      $cgi->radio_group('-name' => 'active',
364
                        '-values' => [1, 0],
365
                        '-default' => $form->{active} * 1,
366
                        '-labels' => { 1 => $locale->text("Active"),
367
                                       0 => $locale->text("Inactive") })
368
      . qq|</td>
369
  </tr>
370
|;
371
  }
372

  
373
  $form->header;
374

  
375
  print qq|
376
<body>
377

  
378
<form method=post action=$form->{script}>
379

  
380
<input type=hidden name=id value=$form->{id}>
381
<input type=hidden name=type value=project>
382

  
383
<table width=100%>
384
  <tr>
385
    <th class=listtop>$form->{title}</th>
386
  </tr>
387
  <tr height="5"></tr>
388
  <tr>
389
    <td>
390
      <table>
391
	<tr>
392
	  <th align=right>| . $locale->text('Number') . qq|</th>
393
	  <td>$projectnumber</td>
394
	</tr>
395
	<tr>
396
	  <th align=right>| . $locale->text('Description') . qq|</th>
397
	  <td>$description</td>
398
	</tr>
399
      $active
400
      </table>
401
    </td>
402
  </tr>
403
  <tr>
404
    <td colspan=2><hr size=3 noshade></td>
405
  </tr>
406
</table>
407
|;
408

  
409
  $lxdebug->leave_sub();
410
}
411

  
412
sub form_project_footer {
413
  $lxdebug->enter_sub();
414

  
415
  $auth->assert('config');
416

  
417
  print qq|
418

  
419
<input name=callback type=hidden value="$form->{callback}">
420

  
421
<br><input type=submit class=submit name=action value="|
422
    . $locale->text('Save') . qq|">
423
|;
424

  
425
  if ($form->{id} && $form->{orphaned}) {
426
    print qq|
427
<input type=submit class=submit name=action value="|
428
      . $locale->text('Delete') . qq|">|;
429
  }
430

  
431
  if ($form->{id}) {
432
    # button for saving history
433
    print qq|
434
      <input type=button onclick=set_history_window(|
435
      . $form->{id}
436
      . qq|); name=history id=history value=|
437
      . $locale->text('history')
438
      . qq|>|;
439
    # /button for saving history
440
  }
441

  
442
  print qq|
443
</form>
444

  
445
</body>
446
</html>
447
|;
448

  
449
  $lxdebug->leave_sub();
450
}
451

  
452 164
sub save {
453 165
  $lxdebug->enter_sub();
454 166

  
455 167
  $auth->assert('config');
456 168

  
457
  if ($form->{type} eq 'project') {
458
    $form->isblank("projectnumber", $locale->text('Project Number missing!'));
459
    PE->save_project(\%myconfig, \%$form);
460
    $form->redirect($locale->text('Project saved!'));
461
  }
462 169
  if ($form->{type} eq 'partsgroup') {
463 170
    $form->isblank("partsgroup", $locale->text('Group missing!'));
464 171
    PE->save_partsgroup(\%myconfig, \%$form);
......
489 196

  
490 197
  PE->delete_tuple(\%myconfig, \%$form);
491 198

  
492
  if ($form->{type} eq 'project') {
493
    $form->redirect($locale->text('Project deleted!'));
494
  }
495 199
  if ($form->{type} eq 'partsgroup') {
496 200
    $form->redirect($locale->text('Group deleted!'));
497 201
  }
bin/mozilla/projects.pl
1
#=====================================================================
2
# LX-Office ERP
3
# Copyright (C) 2004
4
# Based on SQL-Ledger Version 2.1.9
5
# Web http://www.lx-office.org
6
#
7
#=====================================================================
8
# SQL-Ledger Accounting
9
# Copyright (c) 1998-2002
10
#
11
#  Author: Dieter Simader
12
#   Email: dsimader@sql-ledger.org
13
#     Web: http://www.sql-ledger.org
14
#
15
#
16
# This program is free software; you can redistribute it and/or modify
17
# it under the terms of the GNU General Public License as published by
18
# the Free Software Foundation; either version 2 of the License, or
19
# (at your option) any later version.
20
#
21
# This program is distributed in the hope that it will be useful,
22
# but WITHOUT ANY WARRANTY; without even the implied warranty of
23
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
24
# GNU General Public License for more details.
25
# You should have received a copy of the GNU General Public License
26
# along with this program; if not, write to the Free Software
27
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
28
#======================================================================
29
#
30
# project administration
31
#======================================================================
32

  
33
use POSIX qw(strftime);
34

  
35
use SL::Projects;
36
use SL::ReportGenerator;
37

  
38
require "bin/mozilla/common.pl";
39
require "bin/mozilla/reportgenerator.pl";
40

  
41
sub add {
42
  $lxdebug->enter_sub();
43

  
44
  $auth->assert('project_edit');
45

  
46
  # construct callback
47
  $form->{callback} = build_std_url('action') unless $form->{callback};
48

  
49
  display_project_form();
50

  
51
  $lxdebug->leave_sub();
52
}
53

  
54
sub edit {
55
  $lxdebug->enter_sub();
56

  
57
  $auth->assert('project_edit');
58

  
59
  # show history button
60
  $form->{javascript} = qq|<script type="text/javascript" src="js/show_history.js"></script>|;
61
  #/show hhistory button
62
  $form->{title} = "Edit";
63

  
64
  $form->{project} = Projects->get_project('id' => $form->{id}, 'orphaned' => 1);
65

  
66
  display_project_form();
67

  
68
  $lxdebug->leave_sub();
69
}
70

  
71
sub search {
72
  $lxdebug->enter_sub();
73

  
74
  $auth->assert('project_edit');
75

  
76
  $form->{title} = $locale->text('Projects');
77

  
78
  $form->header();
79
  print $form->parse_html_template('projects/search');
80

  
81
  $lxdebug->leave_sub();
82
}
83

  
84
sub project_report {
85
  $lxdebug->enter_sub();
86

  
87
  $auth->assert('project_edit');
88

  
89
  $form->{sort} ||= 'projectnumber';
90

  
91
  my $filter      = $form->{filter} || { };
92
  Projects->search_projects(%{ $filter }, 'sort' => $form->{sort});
93

  
94
  my $report      = SL::ReportGenerator->new(\%myconfig, $form);
95

  
96
  my @columns     = qw(projectnumber description active);
97
  my @hidden_vars = ('filter');
98
  my $href        = build_std_url('action=project_report', @hidden_vars);
99

  
100
  my %column_defs = (
101
    'projectnumber'            => { 'text' => $locale->text('Number'), },
102
    'description'              => { 'text' => $locale->text('Description'), },
103
    'active'                   => { 'text' => $locale->text('Active'), 'visible' => 'both' eq $filter->{active}, },
104
    );
105

  
106
  foreach (qw(projectnumber description)) {
107
    $column_defs{$_}->{link}    = $href . "&sort=$_";
108
    $column_defs{$_}->{visible} = 1;
109
  }
110

  
111
  $report->set_columns(%column_defs);
112
  $report->set_column_order(@columns);
113

  
114
  $report->set_export_options('project_report', @hidden_vars);
115

  
116
  $report->set_sort_indicator($form->{sort}, 1);
117

  
118
  my @options;
119
  push @options, $locale->text('All')                                            if ($filter->{all});
120
  push @options, $locale->text('Orphaned')                                       if ($filter->{orphaned});
121
  push @options, $locale->text('Project Number') . " : $filter->{projectnumber}" if ($filter->{projectnumber});
122
  push @options, $locale->text('Description') . " : $filter->{description}"      if ($filter->{description});
123
  push @options, $locale->text('Active')                                         if ($filter->{active} eq 'active');
124
  push @options, $locale->text('Inactive')                                       if ($filter->{active} eq 'inactive');
125
  push @options, $locale->text('Orphaned')                                       if ($filter->{status} eq 'orphaned');
126

  
127
  $form->{title} = $locale->text('Projects');
128

  
129
  $report->set_options('top_info_text'       => join("\n", @options),
130
                       'output_format'       => 'HTML',
131
                       'title'               => $form->{title},
132
                       'attachment_basename' => $locale->text('project_list') . strftime('_%Y%m%d', localtime time),
133
    );
134
  $report->set_options_from_form();
135

  
136
  my $edit_url = build_std_url('action=edit&type=project');
137
  my $callback = $form->escape($href) . '&sort=' . E($form->{sort});
138

  
139
  foreach $project (@{ $form->{project_list} }) {
140
    $project->{active} = $project->{active} ? $locale->text('Yes')  : $locale->text('No');
141

  
142
    my $row = { map { $_ => { 'data' => $project->{$_} } } keys %{ $project } };
143

  
144
    $row->{projectnumber}->{link} = $edit_url . "&id=" . E($project->{id}) . "&callback=${callback}";
145

  
146
    $report->add_data($row);
147
  }
148

  
149
  $report->generate_with_headers();
150

  
151
  $lxdebug->leave_sub();
152
}
153

  
154
sub display_project_form {
155
  $lxdebug->enter_sub();
156

  
157
  $auth->assert('project_edit');
158

  
159
  $form->{project} ||= { };
160

  
161
  $form->{title}     = $form->{project}->{id} ? $locale->text("Edit Project") : $locale->text("Add Project");
162

  
163
  $form->header();
164
  print $form->parse_html_template('projects/project_form');
165

  
166
  $lxdebug->leave_sub();
167
}
168

  
169
sub save {
170
  $lxdebug->enter_sub();
171

  
172
  $auth->assert('project_edit');
173

  
174
  $form->isblank("project.projectnumber", $locale->text('Project Number missing!'));
175

  
176
  my $project    = $form->{project} || { };
177
  my $is_new     = !$project->{id};
178
  $project->{id} = Projects->save_project(%{ $project });
179

  
180
  # saving the history
181
  if(!exists $form->{addition} && $project->{id} ne "") {
182
    $form->{id}       = $project->{id};
183
    $form->{snumbers} = qq|projectnumber_| . $project->{projectnumber};
184
  	$form->{addition} = "SAVED";
185
  	$form->save_history($form->dbconnect(\%myconfig));
186
  }
187
  # /saving the history
188

  
189
  if ($form->{callback}) {
190
    map { $form->{callback} .= "&new_${_}=" . $form->escape($project->{$_}); } qw(projectnumber description id);
191
    my $message              = $is_new ? $locale->text('The project has been added.') : $locale->text('The project has been saved.');
192
    $form->{callback}       .= "&message="  . E($message);
193
  }
194

  
195
  $form->redirect($locale->text('Project saved!'));
196

  
197
  $lxdebug->leave_sub();
198
}
199

  
200
sub save_as_new {
201
  $lxdebug->enter_sub();
202

  
203
  delete $form->{project}->{id} if ($form->{project});
204
  save();
205

  
206
  $lxdebug->leave_sub();
207
}
208

  
209
sub delete {
210
  $lxdebug->enter_sub();
211

  
212
  $auth->assert('project_edit');
213

  
214
  my $project = $form->{project} || { };
215
  Projects->delete_project('id' => $project->{id});
216

  
217
  # saving the history
218
  if(!exists $form->{addition}) {
219
    $form->{snumbers} = qq|projectnumber_| . $project->{projectnumber};
220
  	$form->{addition} = "DELETED";
221
  	$form->save_history($form->dbconnect(\%myconfig));
222
  }
223
  # /saving the history
224

  
225
  $form->redirect($locale->text('Project deleted!'));
226

  
227
  $lxdebug->leave_sub();
228
}
229

  
230
sub continue {
231
  call_sub($form->{nextsub});
232
}
locale/de/all
237 237
  'Body:'                       => 'Text:',
238 238
  'Books are open'              => 'Die B?cher sind ge?ffnet.',
239 239
  'Boolean variables: If the default value is non-empty then the checkbox will be checked by default and unchecked otherwise.' => 'Ja/Nein-Variablen: Wenn der Standardwert nicht leer ist, so wird die Checkbox standardm&auml;&szlig;ig angehakt.',
240
  'Both'                        => 'Sowohl als auch',
240
  'Both'                        => 'Beide',
241 241
  'Bottom'                      => 'Unten',
242 242
  'Bought'                      => 'Gekauft',
243 243
  'Buchungsdatum'               => 'Buchungsdatum',
......
1407 1407
  'The pg_restore process could not be started.' => 'Der pg_restore-Prozess konnte nicht gestartet werden.',
1408 1408
  'The preferred one is to install packages provided by your operating system distribution (e.g. Debian or RPM packages).' => 'Die bevorzugte Art, ein Perl-Modul zu installieren, ist durch Installation eines von Ihrem Betriebssystem zur Verf&uuml;gung gestellten Paketes (z.B. Debian-Pakete oder RPM).',
1409 1409
  'The program\'s exit code was [% HTML.escape(retval) %] (&quot;0&quot; usually means that everything went OK).' => 'Der Exitcode des Programms war [% HTML.escape(retval) %] (&quot;0&quot; bedeutet normalerweise, dass die Wiederherstellung erfolgreich war).',
1410
  'The project has been added.' => 'Das Projekt wurde erfasst.',
1411
  'The project has been saved.' => 'Das Projekt wurde gespeichert.',
1410 1412
  'The restoration process has started. Here\'s the output of the &quot;pg_restore&quot; command:' => 'Der Wiederherstellungsprozess wurde gestartet. Hier ist die Ausgabe des &quot;pg_restore&quot;-Programmes:',
1411 1413
  'The restoration process is complete. Please review &quot;pg_restore&quot;\'s output to find out if the restoration was successful.' => 'Die Wiederherstellung ist abgeschlossen. Bitte sehen Sie sich die Ausgabe von &quot;pg_restore&quot; an, um festzustellen, ob die Wiederherstellung erfolgreich war.',
1412 1414
  'The second way is to use Perl\'s CPAN module and let it download and install the module for you.' => 'Die zweite Variante besteht darin, Perls CPAN-Modul zu benutzen und es das Modul f&uuml;r Sie installieren zu lassen.',
......
1688 1690
  'prices updated!'             => ' Preise aktualisiert!',
1689 1691
  'print'                       => 'drucken',
1690 1692
  'proforma'                    => 'Proforma',
1693
  'project_list'                => 'projektliste',
1691 1694
  'purchase_delivery_order_list' => 'lieferscheinliste_einkauf',
1692 1695
  'purchase_order'              => 'Auftrag',
1693 1696
  'purchase_order_list'         => 'lieferantenauftragsliste',
locale/de/pe
4 4
  'ADDED'                       => 'Hinzugef?gt',
5 5
  'AP'                          => 'Einkauf',
6 6
  'AR'                          => 'Verkauf',
7
  'Active'                      => 'Aktiv',
8 7
  'Add'                         => 'Erfassen',
9 8
  'Add Group'                   => 'Warengruppe erfassen',
10 9
  'Add Pricegroup'              => 'Preisgruppe erfassen',
11
  'Add Project'                 => 'Projekt erfassen',
12 10
  'Address'                     => 'Adresse',
13 11
  'Advance turnover tax return' => 'Umsatzsteuervoranmeldung',
14 12
  'All'                         => 'Alle',
......
17 15
  'Bcc'                         => 'Bcc',
18 16
  'Bin List'                    => 'Lagerliste',
19 17
  'Binding to the LDAP server as "#1" failed. Please check config/authentication.pl.' => 'Die Anmeldung am LDAP-Server als "#1" schlug fehl. Bitte &uuml;berpr&uuml;fen Sie die Angaben in config/authentication.pl.',
20
  'Both'                        => 'Sowohl als auch',
21 18
  'CANCELED'                    => 'Storniert',
22 19
  'Cc'                          => 'Cc',
23 20
  'Change Lx-Office installation settings (all menu entries beneath \'System\')' => 'Ver&auml;ndern der Lx-Office-Installationseinstellungen (Men&uuml;punkte unterhalb von \'System\')',
......
47 44
  'Delete'                      => 'L?schen',
48 45
  'Delivery Order'              => 'Lieferschein',
49 46
  'Dependency loop detected:'   => 'Schleife in den Abh&auml;ngigkeiten entdeckt:',
50
  'Description'                 => 'Beschreibung',
51 47
  'Directory'                   => 'Verzeichnis',
52 48
  'ELSE'                        => 'Zusatz',
53 49
  'Edit Group'                  => 'Warengruppe editieren',
54 50
  'Edit Pricegroup'             => 'Preisgruppe bearbeiten',
55
  'Edit Project'                => 'Projekt bearbeiten',
56 51
  'Enter longdescription'       => 'Langtext eingeben',
57 52
  'Error in database control file \'%s\': %s' => 'Fehler in Datenbankupgradekontrolldatei \'%s\': %s',
58 53
  'File'                        => 'Datei',
......
63 58
  'Group saved!'                => 'Warengruppe gespeichert!',
64 59
  'Groups'                      => 'Warengruppen',
65 60
  'History'                     => 'Historie',
66
  'Inactive'                    => 'Inaktiv',
67 61
  'Invoice'                     => 'Rechnung',
68 62
  'MAILED'                      => 'Gesendet',
69 63
  'Manage license keys'         => 'Lizenzschl&uuml;ssel verwalten',
......
77 71
  'Missing parameter #1 in call to sub #2.' => 'Fehlernder Parameter \'#1\' in Funktionsaufruf \'#2\'.',
78 72
  'More than one control file with the tag \'%s\' exist.' => 'Es gibt mehr als eine Kontrolldatei mit dem Tag \'%s\'.',
79 73
  'Name'                        => 'Name',
80
  'No'                          => 'Nein',
81 74
  'No %s was found matching the search parameters.' => 'Es wurde kein %s gefunden, auf den die Suchparameter zutreffen.',
82 75
  'No Customer was found matching the search parameters.' => 'Zu dem Suchbegriff wurde kein Endkunde gefunden',
83 76
  'No Vendor was found matching the search parameters.' => 'Zu dem Suchbegriff wurde kein H?ndler gefunden',
......
85 78
  'No or an unknown authenticantion module specified in "config/authentication.pl".' => 'Es wurde kein oder ein unbekanntes Authentifizierungsmodul in "config/authentication.pl" angegeben.',
86 79
  'No part was found matching the search parameters.' => 'Es wurde kein Artikel gefunden, auf den die Suchparameter zutreffen.',
87 80
  'No vendor has been selected yet.' => 'Es wurde noch kein Lieferant ausgew?hlt.',
88
  'Number'                      => 'Nummer',
89 81
  'Orphaned'                    => 'Nie benutzt',
90 82
  'Others'                      => 'Andere',
91 83
  'PAYMENT POSTED'              => 'Rechung gebucht',
......
103 95
  'Pricegroup missing!'         => 'Preisgruppe fehlt!',
104 96
  'Pricegroup saved!'           => 'Preisgruppe gespeichert!',
105 97
  'Proforma Invoice'            => 'Proformarechnung',
106
  'Project'                     => 'Projekt',
107
  'Project Number missing!'     => 'Projektnummer fehlt!',
108
  'Project deleted!'            => 'Projekt gel?scht!',
109
  'Project saved!'              => 'Projekt gespeichert!',
110
  'Projects'                    => 'Projekte',
111 98
  'Purchase Order'              => 'Lieferantenauftrag',
112 99
  'Quotation'                   => 'Angebot',
113 100
  'RFQ'                         => 'Anfrage',
......
142 129
  'Vendor details'              => 'Lieferantendetails',
143 130
  'View warehouse content'      => 'Lagerbestand ansehen',
144 131
  'Warehouse management'        => 'Lagerverwaltung/Bestandsver?nderung',
145
  'Yes'                         => 'Ja',
146 132
  'You do not have the permissions to access this function.' => 'Sie verf&uuml;gen nicht &uuml;ber die notwendigen Rechte, um auf diese Funktion zuzugreifen.',
147 133
  '[email]'                     => '[email]',
148 134
  'bin_list'                    => 'Lagerliste',
......
183 169
  'form_partsgroup_header'      => 'form_partsgroup_header',
184 170
  'form_pricegroup_footer'      => 'form_pricegroup_footer',
185 171
  'form_pricegroup_header'      => 'form_pricegroup_header',
186
  'form_project_footer'         => 'form_project_footer',
187
  'form_project_header'         => 'form_project_header',
188 172
  'format_dates'                => 'format_dates',
189 173
  'mark_as_paid_common'         => 'mark_as_paid_common',
190 174
  'part_selection_internal'     => 'part_selection_internal',
191 175
  'partsgroup_report'           => 'partsgroup_report',
192 176
  'pricegroup_report'           => 'pricegroup_report',
193
  'project_report'              => 'project_report',
194 177
  'reformat_numbers'            => 'reformat_numbers',
195 178
  'retrieve_partunits'          => 'retrieve_partunits',
196 179
  'save'                        => 'save',
locale/de/projects
1
#!/usr/bin/perl
2

  
3
$self->{texts} = {
4
  'ADDED'                       => 'Hinzugef?gt',
5
  'AP'                          => 'Einkauf',
6
  'AR'                          => 'Verkauf',
7
  'Active'                      => 'Aktiv',
8
  'Add Project'                 => 'Projekt erfassen',
9
  'Address'                     => 'Adresse',
10
  'Advance turnover tax return' => 'Umsatzsteuervoranmeldung',
11
  'All'                         => 'Alle',
12
  'All reports'                 => 'Alle Berichte (Konten&uuml;bersicht, Summen- u. Saldenliste, GuV, BWA, Bilanz, Projektbuchungen)',
13
  'Attempt to call an undefined sub named \'%s\'' => 'Es wurde versucht, eine nicht definierte Unterfunktion namens \'%s\' aufzurufen.',
14
  'Bcc'                         => 'Bcc',
15
  'Bin List'                    => 'Lagerliste',
16
  'Binding to the LDAP server as "#1" failed. Please check config/authentication.pl.' => 'Die Anmeldung am LDAP-Server als "#1" schlug fehl. Bitte &uuml;berpr&uuml;fen Sie die Angaben in config/authentication.pl.',
17
  'CANCELED'                    => 'Storniert',
18
  'CSV export -- options'       => 'CSV-Export -- Optionen',
19
  'Cc'                          => 'Cc',
20
  'Change Lx-Office installation settings (all menu entries beneath \'System\')' => 'Ver&auml;ndern der Lx-Office-Installationseinstellungen (Men&uuml;punkte unterhalb von \'System\')',
21
  'Confirmation'                => 'Auftragsbest?tigung',
22
  'Contact'                     => 'Kontakt',
23
  'Could not spawn html2ps or GhostScript.' => 'html2ps oder GhostScript konnte nicht gestartet werden.',
24
  'Could not spawn the printer command.' => 'Die Druckanwendung konnte nicht gestartet werden.',
25
  'Could not write the html2ps config file.' => 'Die tempor&auml;re html2ps-Konfigurationsdatei konnte nicht geschrieben werden.',
26
  'Could not write the temporary HTML file.' => 'Eine tempor&auml;re HTML-Datei konnte nicht geschrieben werden.',
27
  'Create and edit RFQs'        => 'Lieferantenanfragen erfassen und bearbeiten',
28
  'Create and edit customers and vendors' => 'Kunden und Lieferanten erfassen und bearbeiten',
29
  'Create and edit dunnings'    => 'Mahnungen erfassen und bearbeiten',
30
  'Create and edit invoices and credit notes' => 'Rechnungen und Gutschriften erfassen und bearbeiten',
31
  'Create and edit parts, services, assemblies' => 'Artikel, Dienstleistungen, Erzeugnisse erfassen und bearbeiten',
32
  'Create and edit projects'    => 'Projekte erfassen und bearbeiten',
33
  'Create and edit purchase delivery orders' => 'Lieferscheine von Lieferanten erfassen und bearbeiten',
34
  'Create and edit purchase orders' => 'Lieferantenauftr&auml;ge erfassen und bearbeiten',
35
  'Create and edit sales delivery orders' => 'Lieferscheine f&uuml;r Kunden erfassen und bearbeiten',
36
  'Create and edit sales orders' => 'Auftragsbest&auml;tigungen erfassen und bearbeiten',
37
  'Create and edit sales quotations' => 'Angebote erfassen und bearbeiten',
38
  'Create and edit vendor invoices' => 'Eingangsrechnungen erfassen und bearbeiten',
39
  'Credit Note'                 => 'Gutschrift',
40
  'Customer Number'             => 'Kundennummer',
41
  'Customer details'            => 'Kundendetails',
42
  'DATEV Export'                => 'DATEV-Export',
43
  'DELETED'                     => 'Gel?scht',
44
  'DUNNING STARTED'             => 'Mahnprozess gestartet',
45
  'Dataset upgrade'             => 'Datenbankaktualisierung',
46
  'Date'                        => 'Datum',
47
  'Delivery Order'              => 'Lieferschein',
48
  'Dependency loop detected:'   => 'Schleife in den Abh&auml;ngigkeiten entdeckt:',
49
  'Description'                 => 'Beschreibung',
50
  'Directory'                   => 'Verzeichnis',
51
  'ELSE'                        => 'Zusatz',
52
  'Edit Project'                => 'Projekt bearbeiten',
53
  'Enter longdescription'       => 'Langtext eingeben',
54
  'Error in database control file \'%s\': %s' => 'Fehler in Datenbankupgradekontrolldatei \'%s\': %s',
55
  'File'                        => 'Datei',
56
  'General ledger and cash'     => 'Finanzbuchhaltung und Zahlungsverkehr',
57
  'History'                     => 'Historie',
58
  'Inactive'                    => 'Inaktiv',
59
  'Invoice'                     => 'Rechnung',
60
  'MAILED'                      => 'Gesendet',
61
  'Manage license keys'         => 'Lizenzschl&uuml;ssel verwalten',
62
  'Mark as paid?'               => 'Als bezahlt markieren?',
63
  'Marked as paid'              => 'Als bezahlt markiert',
64
  'Master Data'                 => 'Stammdaten',
65
  'May set the BCC field when sending emails' => 'Beim Verschicken von Emails das Feld \'BCC\' setzen',
66
  'Message'                     => 'Nachricht',
67
  'Missing \'description\' field.' => 'Fehlendes Feld \'description\'.',
68
  'Missing \'tag\' field.'      => 'Fehlendes Feld \'tag\'.',
69
  'Missing parameter #1 in call to sub #2.' => 'Fehlernder Parameter \'#1\' in Funktionsaufruf \'#2\'.',
70
  'More than one control file with the tag \'%s\' exist.' => 'Es gibt mehr als eine Kontrolldatei mit dem Tag \'%s\'.',
71
  'Name'                        => 'Name',
72
  'No'                          => 'Nein',
73
  'No %s was found matching the search parameters.' => 'Es wurde kein %s gefunden, auf den die Suchparameter zutreffen.',
74
  'No Customer was found matching the search parameters.' => 'Zu dem Suchbegriff wurde kein Endkunde gefunden',
75
  'No Vendor was found matching the search parameters.' => 'Zu dem Suchbegriff wurde kein H?ndler gefunden',
76
  'No customer has been selected yet.' => 'Es wurde noch kein Kunde ausgew?hlt.',
77
  'No or an unknown authenticantion module specified in "config/authentication.pl".' => 'Es wurde kein oder ein unbekanntes Authentifizierungsmodul in "config/authentication.pl" angegeben.',
78
  'No part was found matching the search parameters.' => 'Es wurde kein Artikel gefunden, auf den die Suchparameter zutreffen.',
79
  'No vendor has been selected yet.' => 'Es wurde noch kein Lieferant ausgew?hlt.',
80
  'Number'                      => 'Nummer',
81
  'Orphaned'                    => 'Nie benutzt',
82
  'Others'                      => 'Andere',
83
  'PAYMENT POSTED'              => 'Rechung gebucht',
84
  'PDF export -- options'       => 'PDF-Export -- Optionen',
85
  'POSTED'                      => 'Gebucht',
86
  'POSTED AS NEW'               => 'Als neu gebucht',
87
  'PRINTED'                     => 'Gedruckt',
88
  'Packing List'                => 'Lieferschein',
89
  'Part Number'                 => 'Artikelnummer',
90
  'Part description'            => 'Artikelbeschreibung',
91
  'Pick List'                   => 'Sammelliste',
92
  'Please enter values'         => 'Bitte Werte eingeben',
93
  'Proforma Invoice'            => 'Proformarechnung',
94
  'Project Number'              => 'Projektnummer',
95
  'Project Number missing!'     => 'Projektnummer fehlt!',
96
  'Project deleted!'            => 'Projekt gel?scht!',
97
  'Project saved!'              => 'Projekt gespeichert!',
98
  'Projects'                    => 'Projekte',
99
  'Purchase Order'              => 'Lieferantenauftrag',
100
  'Quotation'                   => 'Angebot',
101
  'RFQ'                         => 'Anfrage',
102
  'Receipt, payment, reconciliation' => 'Zahlungseingang, Zahlungsausgang, Kontenabgleich',
103
  'Reports'                     => 'Berichte',
104
  'SAVED'                       => 'Gespeichert',
105
  'SAVED FOR DUNNING'           => 'Gespeichert',
106
  'SCREENED'                    => 'Angezeigt',
107
  'Select a Customer'           => 'Endkunde ausw?hlen',
108
  'Select a customer'           => 'Einen Kunden ausw&auml;hlen',
109
  'Select a part'               => 'Artikel ausw&auml;hlen',
110
  'Select a vendor'             => 'Einen Lieferanten ausw&auml;hlen',
111
  'Storno Invoice'              => 'Stornorechnung',
112
  'Storno Packing List'         => 'Stornolieferschein',
113
  'Subject'                     => 'Betreff',
114
  'The \'tag\' field must only consist of alphanumeric characters or the carachters - _ ( )' => 'Das Feld \'tag\' darf nur aus alphanumerischen Zeichen und den Zeichen - _ ( ) bestehen.',
115
  'The LDAP server "#1:#2" is unreachable. Please check config/authentication.pl.' => 'Der LDAP-Server "#1:#2" ist nicht erreichbar. Bitte &uuml;berpr&uuml;fen Sie die Angaben in config/authentication.pl.',
116
  'The config file "config/authentication.pl" contained invalid Perl code:' => 'Die Konfigurationsdatei "config/authentication.pl" enthielt ung&uuml;tigen Perl-Code:',
117
  'The config file "config/authentication.pl" was not found.' => 'Die Konfigurationsdatei "config/authentication.pl" wurde nicht gefunden.',
118
  'The connection to the LDAP server cannot be encrypted (SSL/TLS startup failure). Please check config/authentication.pl.' => 'Die Verbindung zum LDAP-Server kann nicht verschl&uuml;sselt werden (Fehler bei SSL/TLS-Initialisierung). Bitte &uuml;berpr&uuml;fen Sie die Angaben in config/authentication.pl.',
119
  'The connection to the authentication database failed:' => 'Die Verbindung zur Authentifizierungsdatenbank schlug fehl:',
120
  'The connection to the template database failed:' => 'Die Verbindung zur Vorlagendatenbank schlug fehl:',
121
  'The creation of the authentication database failed:' => 'Das Anlegen der Authentifizierungsdatenbank schlug fehl:',
122
  'The list has been printed.'  => 'Die Liste wurde ausgedruckt.',
123
  'The project has been added.' => 'Das Projekt wurde erfasst.',
124
  'The project has been saved.' => 'Das Projekt wurde gespeichert.',
125
  'To (email)'                  => 'An',
126
  'Transactions, AR transactions, AP transactions' => 'Dialogbuchen, Debitorenrechnungen, Kreditorenrechnungen',
127
  'Trying to call a sub without a name' => 'Es wurde versucht, eine Unterfunktion ohne Namen aufzurufen.',
128
  'Unit'                        => 'Einheit',
129
  'Unknown dependency \'%s\'.'  => 'Unbekannte Abh&auml;ngigkeit \'%s\'.',
130
  'Value'                       => 'Wert',
131
  'Variable'                    => 'Variable',
132
  'Vendor details'              => 'Lieferantendetails',
133
  'View warehouse content'      => 'Lagerbestand ansehen',
134
  'Warehouse management'        => 'Lagerverwaltung/Bestandsver?nderung',
135
  'Yes'                         => 'Ja',
136
  'You do not have the permissions to access this function.' => 'Sie verf&uuml;gen nicht &uuml;ber die notwendigen Rechte, um auf diese Funktion zuzugreifen.',
137
  '[email]'                     => '[email]',
138
  'bin_list'                    => 'Lagerliste',
139
  'config/authentication.pl: Key "DB_config" is missing.' => 'config/authentication.pl: Das Schl&uuml;sselwort "DB_config" fehlt.',
140
  'config/authentication.pl: Key "LDAP_config" is missing.' => 'config/authentication.pl: Der Schl&uuml;ssel "LDAP_config" fehlt.',
141
  'config/authentication.pl: Missing parameters in "DB_config". Required parameters are "host", "db" and "user".' => 'config/authentication.pl: Fehlende Parameter in "DB_config". Ben&ouml;tigte Parameter sind "host", "db" und "user".',
142
  'config/authentication.pl: Missing parameters in "LDAP_config". Required parameters are "host", "attribute" and "base_dn".' => 'config/authentication.pl: Fehlende Parameter in "LDAP_config". Ben&ouml;tigt werden "host", "attribute" und "base_dn".',
143
  'customer'                    => 'Kunde',
144
  'invoice'                     => 'Rechnung',
145
  'no'                          => 'nein',
146
  'packing_list'                => 'Versandliste',
147
  'pick_list'                   => 'Entnahmeliste',
148
  'proforma'                    => 'Proforma',
149
  'project_list'                => 'projektliste',
150
  'purchase_order'              => 'Auftrag',
151
  'report_generator_dispatch_to is not defined.' => 'report_generator_dispatch_to ist nicht definiert.',
152
  'report_generator_nextsub is not defined.' => 'report_generator_nextsub ist nicht definiert.',
153
  'request_quotation'           => 'Angebotsanforderung',
154
  'sales_order'                 => 'Kundenauftrag',
155
  'sales_quotation'             => 'Verkaufsangebot',
156
  'vendor'                      => 'Lieferant',
157
  'yes'                         => 'ja',
158
};
159

  
160
$self->{subs} = {
161
  'E'                           => 'E',
162
  'H'                           => 'H',
163
  'NTI'                         => 'NTI',
164
  'Q'                           => 'Q',
165
  'add'                         => 'add',
166
  'build_std_url'               => 'build_std_url',
167
  'calculate_qty'               => 'calculate_qty',
168
  'call_sub'                    => 'call_sub',
169
  'continue'                    => 'continue',
170
  'cov_selection_internal'      => 'cov_selection_internal',
171
  'delete'                      => 'delete',
172
  'delivery_customer_selection' => 'delivery_customer_selection',
173
  'display_project_form'        => 'display_project_form',
174
  'edit'                        => 'edit',
175
  'format_dates'                => 'format_dates',
176
  'mark_as_paid_common'         => 'mark_as_paid_common',
177
  'part_selection_internal'     => 'part_selection_internal',
178
  'project_report'              => 'project_report',
179
  'reformat_numbers'            => 'reformat_numbers',
180
  'report_generator_back'       => 'report_generator_back',
181
  'report_generator_dispatcher' => 'report_generator_dispatcher',
182
  'report_generator_do'         => 'report_generator_do',
183
  'report_generator_export_as_csv' => 'report_generator_export_as_csv',
184
  'report_generator_export_as_pdf' => 'report_generator_export_as_pdf',
185
  'retrieve_partunits'          => 'retrieve_partunits',
186
  'save'                        => 'save',
187
  'save_as_new'                 => 'save_as_new',
188
  'search'                      => 'search',
189
  'select_part'                 => 'select_part',
190
  'select_part_internal'        => 'select_part_internal',
191
  'set_longdescription'         => 'set_longdescription',
192
  'show_history'                => 'show_history',
193
  'show_vc_details'             => 'show_vc_details',
194
  'vendor_selection'            => 'vendor_selection',
195
  'weiter'                      => 'continue',
196
  'l?schen'                     => 'delete',
197
  'neue_ware'                   => 'new_part',
198
  'speichern'                   => 'save',
199
  'als_neu_speichern'           => 'save_as_new',
200
};
201

  
202
1;
menu.ini
32 32

  
33 33
[Master Data--Add Project]
34 34
ACCESS=project_edit
35
module=pe.pl
35
module=projects.pl
36 36
action=add
37
type=project
38 37

  
39 38
[Master Data--Update Prices]
40 39
ACCESS=part_service_assembly_edit
......
85 84

  
86 85
[Master Data--Reports--Projects]
87 86
ACCESS=project_edit
88
module=pe.pl
87
module=projects.pl
89 88
action=search
90
type=project
91 89

  
92 90
[Master Data--Reports--Projecttransactions]
93 91
ACCESS=report
projects.pl
1
am.pl
templates/webpages/projects/project_form_de.html
1
[% USE HTML %][% USE LxERP %]<body>
2

  
3
 [%- IF message %]
4
 <p>[% message %]</p>
5

  
6
 <hr>
7
 [%- END %]
8

  
9
 <form method="post" action="projects.pl">
10

  
11
  <input type="hidden" name="project.id" value="[% HTML.escape(project.id) %]">
12

  
13
  <div class="listtop">[% title %]</div>
14

  
15
  <p>
16
   <table>
17
    <tr>
18
     <th align="right">Nummer</th>
19
     <td><input name="project.projectnumber" size="20" value="[% HTML.escape(project.projectnumber) %]"></td>
20
    </tr>
21

  
22
    <tr>
23
     <th align="right">Beschreibung</th>
24
     <td>
25
      [%- SET rows = LxERP.numtextrows(project.description, 60) %]
26
      [%- IF rows > 1 %]
27
      <textarea name="project.description" rows="rows" cols="60" style="width: 100%" wrap="soft">[% HTML.escape(project.description) %]</textarea>
28
      [%- ELSE %]
29
      <input name="project.description" size="60" value="[% HTML.escape(project.description) %]">
30
      [%- END %]
31
     </td>
32
    </tr>
33

  
34
    [%- IF project.id %]
35
    <tr>
36
     <th align="right">&nbsp;</th>
37
     <td>
38
      <input type="radio" name="project.active" id="active_1" value="1"[% IF project.active %] checked[% END %]><label for="active_1">Aktiv</label>
39
      <input type="radio" name="project.active" id="active_0" value="0"[% IF !project.active %] checked[% END %]><label for="active_0">Inaktiv</label>
40
     </td>
41
    </tr>
42
    [%- END %]
43
   </table>
44
  </p>
45

  
46
  <p><hr size="3" noshade></p>
47

  
48
  <input name="callback" type="hidden" value="[% HTML.escape(callback) %]">
49

  
50
  <p>
51
   <input type="submit" class="submit" name="action" value="Speichern">
52
   [%- IF project.id %]
53
   <input type="submit" class="submit" name="action" value="als neu speichern">
54
   [%- IF project.orphaned %]
55
   <input type="submit" class="submit" name="action" value="L?schen">
56
   [%- END %]
57
   <input type="button" onclick="set_history_window([% HTML.escape(project.id) %]);" name="history" id="history" value="Historie">
58
   [%- END %]
59
  </p>
60
 </form>
61

  
62
</body>
63
</html>
templates/webpages/projects/project_form_master.html
1
[% USE HTML %][% USE LxERP %]<body>
2

  
3
 [%- IF message %]
4
 <p>[% message %]</p>
5

  
6
 <hr>
7
 [%- END %]
8

  
9
 <form method="post" action="projects.pl">
10

  
11
  <input type="hidden" name="project.id" value="[% HTML.escape(project.id) %]">
12

  
13
  <div class="listtop">[% title %]</div>
14

  
15
  <p>
16
   <table>
17
    <tr>
18
     <th align="right"><translate>Number</translate></th>
19
     <td><input name="project.projectnumber" size="20" value="[% HTML.escape(project.projectnumber) %]"></td>
20
    </tr>
21

  
22
    <tr>
23
     <th align="right"><translate>Description</translate></th>
24
     <td>
25
      [%- SET rows = LxERP.numtextrows(project.description, 60) %]
26
      [%- IF rows > 1 %]
27
      <textarea name="project.description" rows="rows" cols="60" style="width: 100%" wrap="soft">[% HTML.escape(project.description) %]</textarea>
28
      [%- ELSE %]
29
      <input name="project.description" size="60" value="[% HTML.escape(project.description) %]">
30
      [%- END %]
31
     </td>
32
    </tr>
33

  
34
    [%- IF project.id %]
35
    <tr>
36
     <th align="right">&nbsp;</th>
37
     <td>
38
      <input type="radio" name="project.active" id="active_1" value="1"[% IF project.active %] checked[% END %]><label for="active_1"><translate>Active</translate></label>
39
      <input type="radio" name="project.active" id="active_0" value="0"[% IF !project.active %] checked[% END %]><label for="active_0"><translate>Inactive</translate></label>
40
     </td>
41
    </tr>
42
    [%- END %]
43
   </table>
44
  </p>
45

  
46
  <p><hr size="3" noshade></p>
47

  
48
  <input name="callback" type="hidden" value="[% HTML.escape(callback) %]">
49

  
50
  <p>
51
   <input type="submit" class="submit" name="action" value="<translate>Save</translate>">
52
   [%- IF project.id %]
53
   <input type="submit" class="submit" name="action" value="<translate>Save as new</translate>">
54
   [%- IF project.orphaned %]
55
   <input type="submit" class="submit" name="action" value="<translate>Delete</translate>">
56
   [%- END %]
57
   <input type="button" onclick="set_history_window([% HTML.escape(project.id) %]);" name="history" id="history" value="<translate>history</translate>">
58
   [%- END %]
59
  </p>
60
 </form>
61

  
62
</body>
63
</html>
... Dieser Diff wurde abgeschnitten, weil er die maximale Anzahl anzuzeigender Zeilen überschreitet.

Auch abrufbar als: Unified diff