Revision 21f24006
Von Moritz Bunkus vor mehr als 10 Jahren hinzugefügt
SL/Controller/RequirementSpecComplexity.pm | ||
---|---|---|
1 |
package SL::Controller::RequirementSpecComplexity; |
|
2 |
|
|
3 |
use strict; |
|
4 |
|
|
5 |
use parent qw(SL::Controller::Base); |
|
6 |
|
|
7 |
use SL::DB::RequirementSpecComplexity; |
|
8 |
use SL::DB::Language; |
|
9 |
use SL::Helper::Flash; |
|
10 |
use SL::Locale::String; |
|
11 |
|
|
12 |
use Rose::Object::MakeMethods::Generic |
|
13 |
( |
|
14 |
scalar => [ qw(requirement_spec_complexity) ], |
|
15 |
); |
|
16 |
|
|
17 |
__PACKAGE__->run_before('check_auth'); |
|
18 |
__PACKAGE__->run_before('load_requirement_spec_complexity', only => [ qw(edit update destroy) ]); |
|
19 |
|
|
20 |
# |
|
21 |
# actions |
|
22 |
# |
|
23 |
|
|
24 |
sub action_list { |
|
25 |
my ($self) = @_; |
|
26 |
|
|
27 |
$self->render('requirement_spec_complexity/list', |
|
28 |
title => t8('Complexities'), |
|
29 |
REQUIREMENT_SPEC_COMPLEXITIES => SL::DB::Manager::RequirementSpecComplexity->get_all_sorted); |
|
30 |
} |
|
31 |
|
|
32 |
sub action_new { |
|
33 |
my ($self) = @_; |
|
34 |
|
|
35 |
$self->{requirement_spec_complexity} = SL::DB::RequirementSpecComplexity->new; |
|
36 |
$self->render('requirement_spec_complexity/form', title => t8('Create a new complexity')); |
|
37 |
} |
|
38 |
|
|
39 |
sub action_edit { |
|
40 |
my ($self) = @_; |
|
41 |
$self->render('requirement_spec_complexity/form', title => t8('Edit complexity')); |
|
42 |
} |
|
43 |
|
|
44 |
sub action_create { |
|
45 |
my ($self) = @_; |
|
46 |
|
|
47 |
$self->{requirement_spec_complexity} = SL::DB::RequirementSpecComplexity->new; |
|
48 |
$self->create_or_update; |
|
49 |
} |
|
50 |
|
|
51 |
sub action_update { |
|
52 |
my ($self) = @_; |
|
53 |
$self->create_or_update; |
|
54 |
} |
|
55 |
|
|
56 |
sub action_destroy { |
|
57 |
my ($self) = @_; |
|
58 |
|
|
59 |
if (eval { $self->{requirement_spec_complexity}->delete; 1; }) { |
|
60 |
flash_later('info', t8('The complexity has been deleted.')); |
|
61 |
} else { |
|
62 |
flash_later('error', t8('The complexity is in use and cannot be deleted.')); |
|
63 |
} |
|
64 |
|
|
65 |
$self->redirect_to(action => 'list'); |
|
66 |
} |
|
67 |
|
|
68 |
sub action_reorder { |
|
69 |
my ($self) = @_; |
|
70 |
|
|
71 |
SL::DB::RequirementSpecComplexity->reorder_list(@{ $::form->{requirement_spec_complexity_id} || [] }); |
|
72 |
|
|
73 |
$self->render('1;', { type => 'js', inline => 1 }); |
|
74 |
} |
|
75 |
|
|
76 |
# |
|
77 |
# filters |
|
78 |
# |
|
79 |
|
|
80 |
sub check_auth { |
|
81 |
$::auth->assert('config'); |
|
82 |
} |
|
83 |
|
|
84 |
# |
|
85 |
# helpers |
|
86 |
# |
|
87 |
|
|
88 |
sub create_or_update { |
|
89 |
my $self = shift; |
|
90 |
my $is_new = !$self->{requirement_spec_complexity}->id; |
|
91 |
my $params = delete($::form->{requirement_spec_complexity}) || { }; |
|
92 |
my $title = $is_new ? t8('Create a new complexity') : t8('Edit complexity'); |
|
93 |
|
|
94 |
$self->{requirement_spec_complexity}->assign_attributes(%{ $params }); |
|
95 |
|
|
96 |
my @errors = $self->{requirement_spec_complexity}->validate; |
|
97 |
|
|
98 |
if (@errors) { |
|
99 |
flash('error', @errors); |
|
100 |
$self->render('requirement_spec_complexity/form', title => $title); |
|
101 |
return; |
|
102 |
} |
|
103 |
|
|
104 |
$self->{requirement_spec_complexity}->save; |
|
105 |
|
|
106 |
flash_later('info', $is_new ? t8('The complexity has been created.') : t8('The complexity has been saved.')); |
|
107 |
$self->redirect_to(action => 'list'); |
|
108 |
} |
|
109 |
|
|
110 |
sub load_requirement_spec_complexity { |
|
111 |
my ($self) = @_; |
|
112 |
$self->{requirement_spec_complexity} = SL::DB::RequirementSpecComplexity->new(id => $::form->{id})->load; |
|
113 |
} |
|
114 |
|
|
115 |
1; |
SL/DB/RequirementSpecComplexity.pm | ||
---|---|---|
11 | 11 |
my ($self) = @_; |
12 | 12 |
|
13 | 13 |
my @errors; |
14 |
push @errors, t8('The description is missing.') if !$self->description; |
|
14 |
push @errors, t8('The description is missing.') if !$self->description; |
|
15 |
push @errors, t8('The description is not unique.') if $self->get_first_conflicting('description'); |
|
15 | 16 |
|
16 | 17 |
return @errors; |
17 | 18 |
} |
locale/de/all | ||
---|---|---|
520 | 520 |
'Create a new background job' => 'Einen neuen Hintergrund-Job anlegen', |
521 | 521 |
'Create a new business' => 'Einen neuen Kunden-/Lieferantentyp erfassen', |
522 | 522 |
'Create a new client' => 'Einen neuen Mandanten anlegen', |
523 |
'Create a new complexity' => 'Einen Komplexitätsgrad anlegen', |
|
523 | 524 |
'Create a new delivery term' => 'Neue Lieferbedingungen anlegen', |
524 | 525 |
'Create a new department' => 'Eine neue Abteilung erfassen', |
525 | 526 |
'Create a new group' => 'Neue Benutzergruppe erfassen', |
... | ... | |
854 | 855 |
'Edit background job' => 'Hintergrund-Job bearbeiten', |
855 | 856 |
'Edit bank account' => 'Bankkonto bearbeiten', |
856 | 857 |
'Edit business' => 'Kunden-/Lieferantentyp bearbeiten', |
858 |
'Edit complexity' => 'Komplexitätsgrad bearbeiten', |
|
857 | 859 |
'Edit custom variable' => 'Benutzerdefinierte Variable bearbeiten', |
858 | 860 |
'Edit delivery term' => 'Lieferbedingungen bearbeiten', |
859 | 861 |
'Edit department' => 'Abteilung bearbeiten', |
... | ... | |
1399 | 1401 |
'No bins have been added to this warehouse yet.' => 'Es wurden zu diesem Lager noch keine Lagerplätze angelegt.', |
1400 | 1402 |
'No business has been created yet.' => 'Es wurden noch kein Kunden-/Lieferantentyp erfasst.', |
1401 | 1403 |
'No clients have been created yet.' => 'Es wurden noch keine Mandanten angelegt.', |
1404 |
'No complexities has been created yet.' => 'Es wurden noch keine Komplexitätsgrade angelegt.', |
|
1402 | 1405 |
'No contact selected to delete' => 'Keine Ansprechperson zum Löschen ausgewählt', |
1403 | 1406 |
'No customer has been selected yet.' => 'Es wurde noch kein Kunde ausgewählt.', |
1404 | 1407 |
'No data was found.' => 'Es wurden keine Daten gefunden.', |
... | ... | |
2153 | 2156 |
'The columns "Dunning Duedate", "Total Fees" and "Interest" show data for the previous dunning created for this invoice.' => 'Die Spalten "Zahlbar bis", "Kumulierte Gebühren" und "Zinsen" zeigen Daten der letzten für diese Rechnung erzeugten Mahnung.', |
2154 | 2157 |
'The combination of database host, port and name is not unique.' => 'Die Kombination aus Datenbankhost, -port und -name ist nicht eindeutig.', |
2155 | 2158 |
'The command is missing.' => 'Der Befehl fehlt.', |
2159 |
'The complexity has been created.' => 'Der Komplexitätsgrad wurde angelegt.', |
|
2160 |
'The complexity has been deleted.' => 'Der Komplexitätsgrad wurde gelöscht.', |
|
2161 |
'The complexity has been saved.' => 'Der Komplexitätsgrad wurde gespeichert.', |
|
2162 |
'The complexity is in use and cannot be deleted.' => 'Der Komplexitätsgrad wird verwendet und kann nicht gelöscht werden.', |
|
2156 | 2163 |
'The connection to the LDAP server cannot be encrypted (SSL/TLS startup failure). Please check config/kivitendo.conf.' => 'Die Verbindung zum LDAP-Server kann nicht verschlüsselt werden (Fehler bei SSL/TLS-Initialisierung). Bitte überprüfen Sie die Angaben in config/kivitendo.conf.', |
2157 | 2164 |
'The connection to the authentication database failed:' => 'Die Verbindung zur Authentifizierungsdatenbank schlug fehl:', |
2158 | 2165 |
'The connection to the configured client database "#1" on host "#2:#3" failed.' => 'Die Verbindung zur konfigurierten Datenbank "#1" auf Host "#2:#3" schlug fehl.', |
templates/webpages/requirement_spec_complexity/form.html | ||
---|---|---|
1 |
[% USE HTML %][% USE L %][% USE LxERP %] |
|
2 |
|
|
3 |
<form method="post" action="controller.pl"> |
|
4 |
<div class="listtop">[% FORM.title %]</div> |
|
5 |
|
|
6 |
[%- INCLUDE 'common/flash.html' %] |
|
7 |
|
|
8 |
<table> |
|
9 |
<tr> |
|
10 |
<td>[% LxERP.t8("Description") %]</td> |
|
11 |
<td>[% L.input_tag("requirement_spec_complexity.description", SELF.requirement_spec_complexity.description) %]</td> |
|
12 |
</tr> |
|
13 |
</table> |
|
14 |
|
|
15 |
<p> |
|
16 |
[% L.hidden_tag("id", SELF.requirement_spec_complexity.id) %] |
|
17 |
[% L.hidden_tag("action", "RequirementSpecComplexity/dispatch") %] |
|
18 |
[% L.submit_tag("action_" _ (SELF.requirement_spec_complexity.id ? "update" : "create"), LxERP.t8('Save')) %] |
|
19 |
[%- IF SELF.requirement_spec_complexity.id %] |
|
20 |
[% L.submit_tag("action_destroy", LxERP.t8('Delete'), confirm=LxERP.t8('Do you really want to delete this object?')) %] |
|
21 |
[%- END %] |
|
22 |
<a href="[% SELF.url_for(action => 'list') %]">[%- LxERP.t8('Abort') %]</a> |
|
23 |
</p> |
|
24 |
</form> |
templates/webpages/requirement_spec_complexity/list.html | ||
---|---|---|
1 |
[% USE HTML %][% USE L %][% USE LxERP %] |
|
2 |
|
|
3 |
<div class="listtop">[% FORM.title %]</div> |
|
4 |
|
|
5 |
[%- INCLUDE "common/flash.html" %] |
|
6 |
|
|
7 |
<form method="post" action="controller.pl"> |
|
8 |
[% IF !REQUIREMENT_SPEC_COMPLEXITIES.size %] |
|
9 |
<p> |
|
10 |
[%- LxERP.t8("No complexities has been created yet.") %] |
|
11 |
</p> |
|
12 |
|
|
13 |
[%- ELSE %] |
|
14 |
<table id="requirement_spec_complexity_list"> |
|
15 |
<thead> |
|
16 |
<tr class="listheading"> |
|
17 |
<th align="center"><img src="image/updown.png" alt="[ LxERP.t8("reorder item") %]"></th> |
|
18 |
<th>[%- LxERP.t8("Description") %]</th> |
|
19 |
</tr> |
|
20 |
</thead> |
|
21 |
|
|
22 |
<tbody> |
|
23 |
[%- FOREACH requirement_spec_complexity = REQUIREMENT_SPEC_COMPLEXITIES %] |
|
24 |
<tr class="listrow[% loop.count % 2 %]" id="requirement_spec_complexity_id_[% requirement_spec_complexity.id %]"> |
|
25 |
<td align="center" class="dragdrop"><img src="image/updown.png" alt="[ LxERP.t8("reorder item") %]"></td> |
|
26 |
<td> |
|
27 |
<a href="[% SELF.url_for(action => "edit", id => requirement_spec_complexity.id) %]"> |
|
28 |
[%- HTML.escape(requirement_spec_complexity.description) %] |
|
29 |
</a> |
|
30 |
</td> |
|
31 |
</tr> |
|
32 |
[%- END %] |
|
33 |
</tbody> |
|
34 |
</table> |
|
35 |
[%- END %] |
|
36 |
|
|
37 |
<p> |
|
38 |
<a href="[% SELF.url_for(action => "new") %]">[%- LxERP.t8("Create a new complexity") %]</a> |
|
39 |
</p> |
|
40 |
</form> |
|
41 |
|
|
42 |
[% L.sortable_element("#requirement_spec_complexity_list tbody", url => "controller.pl?action=RequirementSpecComplexity/reorder", with => "requirement_spec_complexity_id") %] |
templates/webpages/requirement_spec_status/form.html | ||
---|---|---|
7 | 7 |
|
8 | 8 |
<table> |
9 | 9 |
<tr> |
10 |
<td>[% LxERP.t8('Name') %]</sup></td>
|
|
10 |
<td>[% LxERP.t8('Name') %]</td> |
|
11 | 11 |
<td>[% L.select_tag("requirement_spec_status.name", SELF.valid_names, default = SELF.requirement_spec_status.name) %]</td> |
12 | 12 |
</tr> |
13 | 13 |
|
Auch abrufbar als: Unified diff
Verwaltung von Pflichtenheftkomplexitätsgraden