Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 6bf8b2c4

Von Moritz Bunkus vor mehr als 10 Jahren hinzugefügt

  • ID 6bf8b2c4e5cc63efda8b90774888a0c49e250c9a
  • Vorgänger e95a205f
  • Nachfolger d157b20f

Verwaltung von Pflichtenheftabnahmestatus

Unterschiede anzeigen:

SL/Controller/RequirementSpecAcceptanceStatus.pm
1
package SL::Controller::RequirementSpecAcceptanceStatus;
2

  
3
use strict;
4

  
5
use parent qw(SL::Controller::Base);
6

  
7
use SL::DB::RequirementSpecAcceptanceStatus;
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_acceptance_status valid_names) ],
15
);
16

  
17
__PACKAGE__->run_before('check_auth');
18
__PACKAGE__->run_before('load_requirement_spec_acceptance_status', only => [ qw(edit update destroy) ]);
19
__PACKAGE__->run_before(sub { $_[0]->valid_names(\@SL::DB::RequirementSpecAcceptanceStatus::valid_names) });
20

  
21
#
22
# actions
23
#
24

  
25
sub action_list {
26
  my ($self) = @_;
27

  
28
  $self->render('requirement_spec_acceptance_status/list',
29
                title                                => t8('Acceptance Statuses'),
30
                REQUIREMENT_SPEC_ACCEPTANCE_STATUSES => SL::DB::Manager::RequirementSpecAcceptanceStatus->get_all_sorted);
31
}
32

  
33
sub action_new {
34
  my ($self) = @_;
35

  
36
  $self->{requirement_spec_acceptance_status} = SL::DB::RequirementSpecAcceptanceStatus->new;
37
  $self->render('requirement_spec_acceptance_status/form', title => t8('Create a new acceptance status'));
38
}
39

  
40
sub action_edit {
41
  my ($self) = @_;
42
  $self->render('requirement_spec_acceptance_status/form', title => t8('Edit acceptance status'));
43
}
44

  
45
sub action_create {
46
  my ($self) = @_;
47

  
48
  $self->{requirement_spec_acceptance_status} = SL::DB::RequirementSpecAcceptanceStatus->new;
49
  $self->create_or_update;
50
}
51

  
52
sub action_update {
53
  my ($self) = @_;
54
  $self->create_or_update;
55
}
56

  
57
sub action_destroy {
58
  my ($self) = @_;
59

  
60
  if (eval { $self->{requirement_spec_acceptance_status}->delete; 1; }) {
61
    flash_later('info',  t8('The acceptance status has been deleted.'));
62
  } else {
63
    flash_later('error', t8('The acceptance status is in use and cannot be deleted.'));
64
  }
65

  
66
  $self->redirect_to(action => 'list');
67
}
68

  
69
sub action_reorder {
70
  my ($self) = @_;
71

  
72
  SL::DB::RequirementSpecAcceptanceStatus->reorder_list(@{ $::form->{requirement_spec_acceptance_status_id} || [] });
73

  
74
  $self->render(\'', { status => 'json' });
75
}
76

  
77
#
78
# filters
79
#
80

  
81
sub check_auth {
82
  $::auth->assert('config');
83
}
84

  
85
#
86
# helpers
87
#
88

  
89
sub create_or_update {
90
  my $self   = shift;
91
  my $is_new = !$self->{requirement_spec_acceptance_status}->id;
92
  my $params = delete($::form->{requirement_spec_acceptance_status}) || { };
93
  my $title  = $is_new ? t8('Create a new acceptance status') : t8('Edit acceptance status');
94

  
95
  $self->{requirement_spec_acceptance_status}->assign_attributes(%{ $params });
96

  
97
  my @errors = $self->{requirement_spec_acceptance_status}->validate;
98

  
99
  if (@errors) {
100
    flash('error', @errors);
101
    $self->render('requirement_spec_acceptance_status/form', title => $title);
102
    return;
103
  }
104

  
105
  $self->{requirement_spec_acceptance_status}->save;
106

  
107
  flash_later('info', $is_new ? t8('The acceptance status has been created.') : t8('The acceptance status has been saved.'));
108
  $self->redirect_to(action => 'list');
109
}
110

  
111
sub load_requirement_spec_acceptance_status {
112
  my ($self) = @_;
113
  $self->{requirement_spec_acceptance_status} = SL::DB::RequirementSpecAcceptanceStatus->new(id => $::form->{id})->load;
114
}
115

  
116
1;
locale/de/all
73 73
  'Abteilung'                   => 'Abteilung',
74 74
  'Access rights'               => 'Zugriffsrechte',
75 75
  'Access to clients'           => 'Zugriff auf Mandanten',
76
  'Acceptance Statuses'         => 'Abnahmestatus',
76 77
  'Acceptance Types'            => 'Abnahmetypen',
77 78
  'Account'                     => 'Konto',
78 79
  'Account Category A'          => 'Aktiva/Mittelverwendung',
......
517 518
  'Create Chart of Accounts'    => 'Zu verwendender Kontenplan',
518 519
  'Create Dataset'              => 'Neue Datenbank anlegen',
519 520
  'Create Date'                 => 'Erstelldatum',
521
  'Create a new acceptance status' => 'Einen neuen Abnahmestatus anlegen',
520 522
  'Create a new background job' => 'Einen neuen Hintergrund-Job anlegen',
521 523
  'Create a new business'       => 'Einen neuen Kunden-/Lieferantentyp erfassen',
522 524
  'Create a new client'         => 'Einen neuen Mandanten anlegen',
......
853 855
  'Edit Vendor'                 => 'Lieferant editieren',
854 856
  'Edit Vendor Invoice'         => 'Einkaufsrechnung bearbeiten',
855 857
  'Edit Warehouse'              => 'Lager bearbeiten',
858
  'Edit acceptance status'      => 'Abnahmestatus bearbeiten',
856 859
  'Edit background job'         => 'Hintergrund-Job bearbeiten',
857 860
  'Edit bank account'           => 'Bankkonto bearbeiten',
858 861
  'Edit business'               => 'Kunden-/Lieferantentyp bearbeiten',
......
1397 1400
  'No Company Name given'       => 'Kein Firmenname hinterlegt!',
1398 1401
  'No Customer was found matching the search parameters.' => 'Zu dem Suchbegriff wurde kein Endkunde gefunden',
1399 1402
  'No Vendor was found matching the search parameters.' => 'Zu dem Suchbegriff wurde kein Händler gefunden',
1403
  'No acceptance statuses has been created yet.' => 'Es wurde noch kein Abnahmestatus angelegt.',
1400 1404
  'No action defined.'          => 'Keine Aktion definiert.',
1401 1405
  'No background job has been created yet.' => 'Es wurden noch keine Hintergrund-Jobs angelegt.',
1402 1406
  'No bank information has been entered in this customer\'s master data entry. You cannot create bank collections unless you enter bank information.' => 'Für diesen Kunden wurden in seinen Stammdaten keine Kontodaten hinterlegt. Solange dies nicht geschehen ist, können Sie keine Überweisungen für den Lieferanten anlegen.',
......
2125 2129
  'The SEPA export has been created.' => 'Der SEPA-Export wurde erstellt',
2126 2130
  'The SEPA strings have been saved.' => 'Die bei SEPA-Überweisungen verwendeten Begriffe wurden gespeichert.',
2127 2131
  'The WebDAV feature has been used.' => 'Das WebDAV-Feature wurde benutzt.',
2132
  'The acceptance status has been created.' => 'Der Abnahmestatus wurde angelegt.',
2133
  'The acceptance status has been deleted.' => 'Der Abnahmestatus wurde gelöscht.',
2134
  'The acceptance status has been saved.' => 'Der Abnahmestatus wurde gespeichert.',
2135
  'The acceptance status is in use and cannot be deleted.' => 'Der Abnahmestatus wird verwendet und kann nicht gelöscht werden.',
2128 2136
  'The access rights a user has within a client instance is still governed by his group membership.' => 'Welche Zugriffsrechte ein Benutzer innerhalb eines Mandanten hat, wird weiterhin über Gruppenmitgliedschaften geregelt.',
2129 2137
  'The access rights have been saved.' => 'Die Zugriffsrechte wurden gespeichert.',
2130 2138
  'The account 3804 already exists, the update will be skipped.' => 'Das Konto 3804 existiert schon, das Update wird übersprungen.',
menus/erp.ini
611 611
module=controller.pl
612 612
action=RequirementSpecRisk/list
613 613

  
614
[System--Requirement specs--Acceptance Types]
614
[System--Requirement specs--Acceptance Statuses]
615 615
module=controller.pl
616
action=RequirementSpecAcceptanceType/list
616
action=RequirementSpecAcceptanceStatus/list
617 617

  
618 618
[System--Languages and translations]
619 619
module=menu.pl
templates/webpages/requirement_spec_acceptance_status/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('Name') %]</td>
11
    <td>[% L.select_tag("requirement_spec_acceptance_status.name",  SELF.valid_names, default = SELF.requirement_spec_acceptance_status.name) %]</td>
12
   </tr>
13

  
14
   <tr>
15
    <td>[% LxERP.t8('Description') %]</td>
16
    <td>[% L.input_tag("requirement_spec_acceptance_status.description", SELF.requirement_spec_acceptance_status.description) %]</td>
17
   </tr>
18
  </table>
19

  
20
  <p>
21
   [% L.hidden_tag("id", SELF.requirement_spec_acceptance_status.id) %]
22
   [% L.hidden_tag("action", "RequirementSpecAcceptanceStatus/dispatch") %]
23
   [% L.submit_tag("action_" _ (SELF.requirement_spec_acceptance_status.id ? "update" : "create"), LxERP.t8('Save')) %]
24
   [%- IF SELF.requirement_spec_acceptance_status.id %]
25
    [% L.submit_tag("action_destroy", LxERP.t8('Delete'), confirm=LxERP.t8('Do you really want to delete this object?')) %]
26
   [%- END %]
27
   <a href="[% SELF.url_for(action => 'list') %]">[%- LxERP.t8('Abort') %]</a>
28
  </p>
29
 </form>
templates/webpages/requirement_spec_acceptance_status/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_ACCEPTANCE_STATUSES.size %]
9
   <p>
10
    [%- LxERP.t8('No acceptance statuses has been created yet.') %]
11
   </p>
12

  
13
  [%- ELSE %]
14
   <table id="requirement_spec_acceptance_status_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('Name') %]</th>
19
     <th>[%- LxERP.t8('Description') %]</th>
20
    </tr>
21
    </thead>
22

  
23
    <tbody>
24
    [%- FOREACH requirement_spec_acceptance_status = REQUIREMENT_SPEC_ACCEPTANCE_STATUSES %]
25
    <tr class="listrow[% loop.count % 2 %]" id="requirement_spec_acceptance_status_id_[% requirement_spec_acceptance_status.id %]">
26
     <td align="center" class="dragdrop"><img src="image/updown.png" alt="[ LxERP.t8('reorder item') %]"></td>
27
     <td>
28
      <a href="[% SELF.url_for(action => 'edit', id => requirement_spec_acceptance_status.id) %]">
29
       [%- HTML.escape(requirement_spec_acceptance_status.name) %]
30
      </a>
31
     </td>
32

  
33
     <td>[%- HTML.escape(requirement_spec_acceptance_status.description) %]</td>
34
    </tr>
35
    [%- END %]
36
    </tbody>
37
   </table>
38
  [%- END %]
39

  
40
  <p>
41
   <a href="[% SELF.url_for(action => 'new') %]">[%- LxERP.t8('Create a new acceptance status') %]</a>
42
  </p>
43
 </form>
44

  
45
 [% L.sortable_element('#requirement_spec_acceptance_status_list tbody', url => 'controller.pl?action=RequirementSpecAcceptanceStatus/reorder', with => 'requirement_spec_acceptance_status_id') %]

Auch abrufbar als: Unified diff