Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 9c7262bf

Von Sven Schöling vor fast 11 Jahren hinzugefügt

  • ID 9c7262bf1daa8ca9bb1c81a11be0e47cbcf1b533
  • Vorgänger bf2f7ae2
  • Nachfolger ce213a0a

Projekttypen verwaltbar gemacht

Unterschiede anzeigen:

SL/Controller/FinancialControllingReport.pm
6 6
use List::Util qw(sum);
7 7

  
8 8
use SL::DB::Order;
9
use SL::DB::ProjectType;
9 10
use SL::Controller::Helper::GetModels;
10 11
use SL::Controller::Helper::Paginated;
11 12
use SL::Controller::Helper::Sorted;
......
37 38
  customer                => t8('Customer'),
38 39
  transaction_description => t8('Transaction description'),
39 40
  globalprojectnumber     => t8('Project'),
41
  globalproject_type      => t8('Project Type'),
40 42
  netamount               => t8('Order amount'),
41 43
);
42 44

  
......
62 64
  my ($self) = @_;
63 65

  
64 66
  $self->{filter} = {};
65
  my %args     = ( parse_filter($::form->{filter}, with_objects => [ 'customer', 'globalproject' ], launder_to => $self->{filter}));
67
  my %args     = ( parse_filter($::form->{filter}, with_objects => [ 'customer', 'globalproject', 'globalproject.project_type' ], launder_to => $self->{filter}));
66 68
  $args{query} = [
67 69
    @{ $args{query} || [] },
68 70
    SL::DB::Manager::Order->type_filter('sales_order'),
......
77 79
  my $report      = SL::ReportGenerator->new(\%::myconfig, $::form);
78 80
  $self->{report} = $report;
79 81

  
80
  my @columns     = qw(customer globalprojectnumber project_type ordnumber netamount delivered_amount delivered_amount_p billed_amount billed_amount_p paid_amount paid_amount_p
82
  my @columns     = qw(customer globalprojectnumber globalproject_type ordnumber netamount delivered_amount delivered_amount_p billed_amount billed_amount_p paid_amount paid_amount_p
81 83
                       billable_amount billable_amount_p other_amount);
82
  my @sortable    = qw(ordnumber transdate customer netamount globalprojectnumber);
84
  my @sortable    = qw(ordnumber transdate customer netamount globalprojectnumber globalproject_type);
83 85
  $self->{number_columns} = [ qw(netamount billed_amount billed_amount_p delivered_amount delivered_amount_p paid_amount paid_amount_p other_amount billable_amount billable_amount_p) ];
84 86

  
85 87
  my %column_defs           = (
......
97 99
    customer                => {      sub => sub { $_[0]->customer->name                                              },
98 100
                                 obj_link => sub { $self->link_to($_[0]->customer)                                    }  },
99 101
    globalprojectnumber     => {      sub => sub { $_[0]->globalproject_id ? $_[0]->globalproject->projectnumber : '' }  },
100
    project_type            => { text     => $::locale->text('Project type'),
101
                                 sub      => sub { $_[0]->globalproject_id ? $_[0]->globalproject->type          : '' }  },
102
    globalproject_type      => { text     => $::locale->text('Project type'),
103
                                 sub      => sub { $_[0]->globalproject_id ? $_[0]->globalproject->project_type->description : '' }  },
102 104
  );
103 105

  
104 106
  map { $column_defs{$_}->{text} ||= $::locale->text( $self->get_sort_spec->{$_}->{title} ) } keys %column_defs;
SL/Controller/Project.pm
16 16
use SL::DB::Order;
17 17
use SL::DB::Project;
18 18
use SL::DB::PurchaseInvoice;
19
use SL::DB::ProjectType;
19 20
use SL::Helper::Flash;
20 21
use SL::Locale::String;
21 22

  
......
26 27
);
27 28

  
28 29
__PACKAGE__->run_before('check_auth');
29
__PACKAGE__->run_before('load_project', only => [ qw(edit update destroy) ]);
30
__PACKAGE__->run_before('load_project',       only => [ qw(edit update destroy) ]);
30 31

  
31 32
#
32 33
# actions
......
37 38

  
38 39
  my %params;
39 40

  
40
  $params{CUSTOM_VARIABLES} = CVar->get_configs(module => 'Projects');
41
  $params{ALL_PROJECT_TYPES} = SL::DB::Manager::ProjectType->get_all_sorted;
42
  $params{CUSTOM_VARIABLES}  = CVar->get_configs(module => 'Projects');
41 43
  ($params{CUSTOM_VARIABLES_FILTER_CODE}, $params{CUSTOM_VARIABLES_INCLUSION_CODE})
42 44
    = CVar->render_search_options(variables      => $params{CUSTOM_VARIABLES},
43 45
                                  include_prefix => 'l_',
......
121 123
sub display_form {
122 124
  my ($self, %params) = @_;
123 125

  
124
  $params{ALL_CUSTOMERS}    = SL::DB::Manager::Customer->get_all_sorted(where => [ or => [ obsolete => 0, obsolete => undef, id => $self->project->customer_id ]]);
125
  $params{CUSTOM_VARIABLES} = CVar->get_custom_variables(module => 'Projects', trans_id => $self->project->id);
126
  $params{ALL_CUSTOMERS}     = SL::DB::Manager::Customer->get_all_sorted(where => [ or => [ obsolete => 0, obsolete => undef, id => $self->project->customer_id ]]);
127
  $params{ALL_PROJECT_TYPES} = SL::DB::Manager::ProjectType->get_all_sorted;
128
  $params{CUSTOM_VARIABLES}  = CVar->get_custom_variables(module => 'Projects', trans_id => $self->project->id);
126 129
  CVar->render_inputs(variables => $params{CUSTOM_VARIABLES}) if @{ $params{CUSTOM_VARIABLES} };
127 130

  
128 131
  $self->render('project/form', %params);
......
171 174
  $self->{filter} = {};
172 175
  my %args = parse_filter(
173 176
    $self->_pre_parse_filter($::form->{filter}, $self->{filter}),
174
    with_objects => [ 'customer' ],
177
    with_objects => [ 'customer', 'project_type' ],
175 178
    launder_to   => $self->{filter},
176 179
  );
177 180

  
......
186 189
  my $report      = SL::ReportGenerator->new(\%::myconfig, $::form);
187 190
  $self->{report} = $report;
188 191

  
189
  my @columns     = qw(projectnumber description customer active valid type);
190
  my @sortable    = qw(projectnumber description customer              type);
192
  my @columns     = qw(projectnumber description customer active valid project_type);
193
  my @sortable    = qw(projectnumber description customer              project_type);
191 194

  
192 195
  my %column_defs = (
193 196
    projectnumber => { obj_link => sub { $self->url_for(action => 'edit', id => $_[0]->id, callback => $callback) } },
194 197
    description   => { obj_link => sub { $self->url_for(action => 'edit', id => $_[0]->id, callback => $callback) } },
195
    type          => { },
198
    project_type  => { sub  => sub { $_[0]->project_type->description } },
196 199
    customer      => { sub  => sub { $_[0]->customer ? $_[0]->customer->name     : '' } },
197 200
    active        => { sub  => sub { $_[0]->active   ? $::locale->text('Active') : $::locale->text('Inactive') },
198 201
                       text => $::locale->text('Active') },
......
235 238
      customer      => t8('Customer'),
236 239
      description   => t8('Description'),
237 240
      projectnumber => t8('Project Number'),
238
      type          => t8('Type'),
241
      project_type  => t8('Project Type'),
239 242
    },
240 243
    with_objects => [ 'customer' ],
241 244
  );
SL/Controller/ProjectType.pm
1
package SL::Controller::ProjectType;
2

  
3
use strict;
4

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

  
7
use SL::DB::ProjectType;
8
use SL::Helper::Flash;
9

  
10
use Rose::Object::MakeMethods::Generic
11
(
12
 scalar => [ qw(project_type) ],
13
);
14

  
15
__PACKAGE__->run_before('check_auth');
16
__PACKAGE__->run_before('load_project_type', only => [ qw(edit update destroy) ]);
17

  
18
#
19
# actions
20
#
21

  
22
sub action_list {
23
  my ($self) = @_;
24

  
25
  $self->render('project_type/list',
26
                title         => $::locale->text('Project Types'),
27
                PROJECT_TYPES => SL::DB::Manager::ProjectType->get_all_sorted);
28
}
29

  
30
sub action_new {
31
  my ($self) = @_;
32

  
33
  $self->{project_type} = SL::DB::ProjectType->new;
34
  $self->render('project_type/form', title => $::locale->text('Create a new project type'));
35
}
36

  
37
sub action_edit {
38
  my ($self) = @_;
39
  $self->render('project_type/form', title => $::locale->text('Edit project type'));
40
}
41

  
42
sub action_create {
43
  my ($self) = @_;
44

  
45
  $self->{project_type} = SL::DB::ProjectType->new;
46
  $self->create_or_update;
47
}
48

  
49
sub action_update {
50
  my ($self) = @_;
51
  $self->create_or_update;
52
}
53

  
54
sub action_destroy {
55
  my ($self) = @_;
56

  
57
  if (eval { $self->{project_type}->delete; 1; }) {
58
    flash_later('info',  $::locale->text('The project type has been deleted.'));
59
  } else {
60
    flash_later('error', $::locale->text('The project type is in use and cannot be deleted.'));
61
  }
62

  
63
  $self->redirect_to(action => 'list');
64
}
65

  
66
sub action_reorder {
67
  my ($self) = @_;
68

  
69
  my @ids = @{ $::form->{project_type_id} || [] };
70
  my $result = SL::DB::ProjectType->new->db->do_transaction(sub {
71
    foreach my $idx (0 .. scalar(@ids) - 1) {
72
      SL::DB::ProjectType->new(id => $ids[$idx])->load->update_attributes(position => $idx + 1);
73
    }
74
  });
75

  
76
  $self->render('1;', { type => 'js', inline => 1 });
77
}
78

  
79
#
80
# filters
81
#
82

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

  
87
#
88
# helpers
89
#
90

  
91
sub create_or_update {
92
  my $self   = shift;
93
  my $is_new = !$self->{project_type}->id;
94
  my $params = delete($::form->{project_type}) || { };
95

  
96
  $self->{project_type}->assign_attributes(%{ $params });
97

  
98
  my @errors = $self->{project_type}->validate;
99

  
100
  if (@errors) {
101
    flash('error', @errors);
102
    $self->render('project_type/form', title => $is_new ? $::locale->text('Create a new project type') : $::locale->text('Edit project type'));
103
    return;
104
  }
105

  
106
  $self->{project_type}->save;
107

  
108
  flash_later('info', $is_new ? $::locale->text('The project type has been created.') : $::locale->text('The project type has been saved.'));
109
  $self->redirect_to(action => 'list');
110
}
111

  
112
sub load_project_type {
113
  my ($self) = @_;
114
  $self->{project_type} = SL::DB::ProjectType->new(id => $::form->{id})->load;
115
}
116

  
117
1;
SL/DB/Helper/ALL.pm
70 70
use SL::DB::Price;
71 71
use SL::DB::Printer;
72 72
use SL::DB::Project;
73
use SL::DB::ProjectType;
73 74
use SL::DB::PurchaseInvoice;
74 75
use SL::DB::RecordLink;
75 76
use SL::DB::SchemaInfo;
SL/DB/Helper/Mappings.pm
151 151
  pricegroup                     => 'pricegroup',
152 152
  printers                       => 'printer',
153 153
  project                        => 'project',
154
  project_types                  => 'ProjectType',
154 155
  record_links                   => 'record_link',
155 156
  sepa_export                    => 'sepa_export',
156 157
  sepa_export_items              => 'sepa_export_item',
SL/DB/Manager/Order.pm
38 38
      customer                => 'customer.name',
39 39
      vendor                  => 'vendor.name',
40 40
      globalprojectnumber     => 'lower(globalproject.projectnumber)',
41

  
42
      # Bug in Rose::DB::Object: the next should be
43
      # "globalproject.project_type.description". This workaround will
44
      # only work if no other table with "project_type" is visible in
45
      # the current query
46
      globalproject_type      => 'lower(project_type.description)',
47

  
41 48
      map { ( $_ => "lower(oe.$_)" ) } qw(ordnumber quonumber cusordnumber shippingpoint shipvia notes intnotes transaction_description),
42 49
    });
43 50
}
SL/DB/Manager/Project.pm
43 43

  
44 44
sub _sort_spec {
45 45
  return (
46
    default    => [ 'projectnumber', 1 ],
47
    columns    => {
48
      SIMPLE   => 'ALL',
49
      customer => 'customer.name',
46
    default        => [ 'projectnumber', 1 ],
47
    columns        => {
48
      SIMPLE       => 'ALL',
49
      customer     => 'customer.name',
50
      project_type => 'project_type.description',
50 51
    });
51 52
}
52 53

  
SL/DB/Manager/ProjectType.pm
1
package SL::DB::Manager::ProjectType;
2

  
3
use strict;
4

  
5
use parent qw(SL::DB::Helper::Manager);
6

  
7
use SL::DB::Helper::Paginated;
8
use SL::DB::Helper::Sorted;
9

  
10
sub object_class { 'SL::DB::ProjectType' }
11

  
12
__PACKAGE__->make_manager_methods;
13

  
14
sub _sort_spec {
15
  return (
16
    default       => [ 'position', 1 ],
17
    columns       => {
18
      SIMPLE      => 'ALL',
19
      description => 'lower(project_types.description)',
20
    });
21
}
22

  
23
1;
24
__END__
25

  
26
=pod
27

  
28
=encoding utf8
29

  
30
=head1 NAME
31

  
32
SL::DB::Manager::ProjectType - Manager for models for the 'project_types' table
33

  
34
=head1 SYNOPSIS
35

  
36
This is a standard Rose::DB::Manager based model manager and can be
37
used as such.
38

  
39
=head1 FUNCTIONS
40

  
41
None yet.
42

  
43
=head1 BUGS
44

  
45
Nothing here yet.
46

  
47
=head1 AUTHOR
48

  
49
Moritz Bunkus E<lt>m.bunkus@linet-services.deE<gt>
50

  
51
=cut
SL/DB/MetaSetup/Project.pm
9 9
__PACKAGE__->meta->table('project');
10 10

  
11 11
__PACKAGE__->meta->columns(
12
  active        => { type => 'boolean', default => 'true' },
13
  customer_id   => { type => 'integer' },
14
  description   => { type => 'text' },
15
  id            => { type => 'integer', not_null => 1, sequence => 'id' },
16
  itime         => { type => 'timestamp', default => 'now()' },
17
  mtime         => { type => 'timestamp' },
18
  projectnumber => { type => 'text' },
19
  type          => { type => 'text' },
20
  valid         => { type => 'boolean', default => 'true' },
12
  active          => { type => 'boolean', default => 'true' },
13
  customer_id     => { type => 'integer' },
14
  description     => { type => 'text' },
15
  id              => { type => 'integer', not_null => 1, sequence => 'id' },
16
  itime           => { type => 'timestamp', default => 'now()' },
17
  mtime           => { type => 'timestamp' },
18
  project_type_id => { type => 'integer', not_null => 1 },
19
  projectnumber   => { type => 'text' },
20
  type            => { type => 'text' },
21
  valid           => { type => 'boolean', default => 'true' },
21 22
);
22 23

  
23 24
__PACKAGE__->meta->primary_key_columns([ 'id' ]);
......
31 32
    class       => 'SL::DB::Customer',
32 33
    key_columns => { customer_id => 'id' },
33 34
  },
35

  
36
  project_type => {
37
    class       => 'SL::DB::ProjectType',
38
    key_columns => { project_type_id => 'id' },
39
  },
34 40
);
35 41

  
36 42
1;
SL/DB/MetaSetup/ProjectType.pm
1
# This file has been auto-generated. Do not modify it; it will be overwritten
2
# by rose_auto_create_model.pl automatically.
3
package SL::DB::ProjectType;
4

  
5
use strict;
6

  
7
use base qw(SL::DB::Object);
8

  
9
__PACKAGE__->meta->setup(
10
  table   => 'project_types',
11

  
12
  columns => [
13
    id          => { type => 'serial', not_null => 1 },
14
    position    => { type => 'integer', not_null => 1 },
15
    description => { type => 'text' },
16
  ],
17

  
18
  primary_key_columns => [ 'id' ],
19
);
20

  
21
1;
22
;
SL/DB/ProjectType.pm
1
package SL::DB::ProjectType;
2

  
3
use strict;
4

  
5
use SL::DB::MetaSetup::ProjectType;
6
use SL::DB::Manager::ProjectType;
7

  
8
use SL::DB::Helper::ActsAsList;
9

  
10
__PACKAGE__->meta->add_relationship(
11
  projects => {
12
    type         => 'many to one',
13
    class        => 'SL::DB::Project',
14
    column_map   => { id => 'project_type_id' },
15
  },
16
);
17

  
18
__PACKAGE__->meta->initialize;
19

  
20
sub validate {
21
  my ($self) = @_;
22

  
23
  my @errors;
24
  push @errors, $::locale->text('The description is missing.') if !$self->description;
25

  
26
  return @errors;
27
}
28

  
29
1;
locale/de/all
516 516
  'Create a new payment term'   => 'Neue Zahlungsbedingungen anlegen',
517 517
  'Create a new printer'        => 'Einen neuen Drucker anlegen',
518 518
  'Create a new project'        => 'Neues Projekt anlegen',
519
  'Create a new project type'   => 'Einen neuen Projekttypen anlegen',
519 520
  'Create a new user'           => 'Einen neuen Benutzer anlegen',
520 521
  'Create a new user group'     => 'Eine neue Benutzergruppe erfassen',
522
  'Create a standard group'     => 'Eine Standard-Benutzergruppe anlegen',
521 523
  'Create and edit RFQs'        => 'Lieferantenanfragen erfassen und bearbeiten',
522 524
  'Create and edit dunnings'    => 'Mahnungen erfassen und bearbeiten',
523 525
  'Create and edit invoices and credit notes' => 'Rechnungen und Gutschriften erfassen und bearbeiten',
......
544 546
  'Create new department'       => 'Neue Abteilung erfassen',
545 547
  'Create new payment term'     => 'Neue Zahlungsbedingung anlegen',
546 548
  'Create new templates from master templates' => 'Neue Druckvorlagen aus Vorlagensatz erstellen',
549
  'Create new project type'     => 'Neuen Projekttypen anlegen',
547 550
  'Create tables'               => 'Tabellen anlegen',
548 551
  'Created by'                  => 'Erstellt von',
549 552
  'Created for'                 => 'Erstellt f&uuml;r',
......
852 855
  'Edit prices and discount (if not used, textfield is ONLY set readonly)' => 'Preise und Rabatt in Formularen frei anpassen (falls deaktiviert, wird allerdings NUR das textfield auf READONLY gesetzt / kann je nach Browserversion und technischen Fähigkeiten des Anwenders noch umgangen werden)',
853 856
  'Edit project'                => 'Projekt bearbeiten',
854 857
  'Edit project #1'             => 'Projekt #1 bearbeiten',
858
  'Edit project type'           => 'Projekttypen bearbeiten',
855 859
  'Edit templates'              => 'Vorlagen bearbeiten',
856 860
  'Edit the Delivery Order'     => 'Lieferschein bearbeiten',
857 861
  'Edit the configuration for periodic invoices' => 'Konfiguration für wiederkehrende Rechnungen bearbeiten',
......
1394 1398
  'No print templates have been created for this client yet. Please do so in the client configuration.' => 'Für diesen Mandanten wurden noch keine Druckvorlagen angelegt. Bitte holen Sie dies in der Mandantenkonfiguration nach.',
1395 1399
  'No printers have been created yet.' => 'Es wurden noch keine Drucker angelegt.',
1396 1400
  'No problems were recognized.' => 'Es wurden keine Probleme gefunden.',
1401
  'No project type has been created yet.' => 'Es wurden noch keine Projekttypen angelegt.',
1397 1402
  'No report with id #1'        => 'Es gibt keinen Report mit der Id #1',
1398 1403
  'No shipto selected to delete' => 'Keine Lieferadresse zum Löschen ausgewählt',
1399 1404
  'No summary account'          => 'Kein Sammelkonto',
......
1662 1667
  'Project Number'              => 'Projektnummer',
1663 1668
  'Project Numbers'             => 'Projektnummern',
1664 1669
  'Project Transactions'        => 'Projektbuchungen',
1670
  'Project Type'                => 'Projekttyp',
1671
  'Project Types'               => 'Projekttypen',
1665 1672
  'Project type'                => 'Projekttyp',
1666 1673
  'Projects'                    => 'Projekte',
1667 1674
  'Projecttransactions'         => 'Projektbuchungen',
......
2211 2218
  'The project is in use and cannot be deleted.' => 'Das Projekt ist in Verwendung und kann nicht gelöscht werden.',
2212 2219
  'The project number is already in use.' => 'Die Projektnummer wird bereits verwendet.',
2213 2220
  'The project number is missing.' => 'Die Projektnummer fehlt.',
2221
  'The project type has been created.' => 'Der Projekttyp wurde angelegt.',
2222
  'The project type has been deleted.' => 'Der Projekttyp wurde gelöscht.',
2223
  'The project type has been saved.' => 'Der Projekttyp wurde gespeichert.',
2224
  'The project type is in use and cannot be deleted.' => 'Der Projekttyp wird verwendet und kann nicht gelöscht werden.',
2214 2225
  'The second reason is that kivitendo allowed the user to enter the tax amount manually regardless of the taxkey used.' => 'Der zweite Grund war, dass kivitendo zuließ, dass die Benutzer beliebige, von den tatsächlichen Steuerschlüsseln unabhängige Steuerbeträge eintrugen.',
2215 2226
  '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.',
2216 2227
  'The selected bank account does not exist anymore.' => 'Das ausgewählte Bankkonto existiert nicht mehr.',
menus/erp.ini
581 581
module=am.pl
582 582
action=list_lead
583 583

  
584
[System--Project Types]
585
module=controller.pl
586
action=ProjectType/list
587

  
584 588
[System--Languages and translations]
585 589
module=menu.pl
586 590
action=acc_menu
sql/Pg-upgrade2/project_types.sql
1
-- @tag: project_types
2
-- @description: Tabelle für Projekttypen
3
-- @depends: release_3_0_0
4
-- @charset: utf-8
5
CREATE TABLE project_types (
6
       id                       SERIAL,
7
       position                 INTEGER NOT NULL,
8
       description              TEXT,
9

  
10
       PRIMARY KEY (id)
11
);
12

  
13
INSERT INTO project_types (position, description) VALUES (1, 'Standard');
14
INSERT INTO project_types (position, description) VALUES (2, 'Festpreis');
15
INSERT INTO project_types (position, description) VALUES (3, 'Support');
16

  
17
ALTER TABLE project ADD COLUMN project_type_id INTEGER;
18
ALTER TABLE project ADD FOREIGN KEY (project_type_id) REFERENCES project_types (id);
19

  
20
UPDATE project SET project_type_id = (SELECT id FROM project_types WHERE description = 'Festpreis') WHERE type = 'Festpreis';
21
UPDATE project SET project_type_id = (SELECT id FROM project_types WHERE description = 'Support')   WHERE type = 'Support';
22
UPDATE project SET project_type_id = (SELECT id FROM project_types WHERE description = 'Standard')  WHERE project_type_id IS NULL;
23

  
24
ALTER TABLE project ALTER COLUMN project_type_id SET NOT NULL;
25
ALTER TABLE project DROP COLUMN type;
templates/webpages/project/form.html
42 42
     </tr>
43 43

  
44 44
     <tr>
45
      <th align="right">[% 'Type' | $T8 %]</th>
46
      <td>[% L.input_tag('project.type', SELF.project.type, size=60) %]</td>
45
      <th align="right">[% 'Project Type' | $T8 %]</th>
46
      <td>[% L.select_tag('project.project_type_id', ALL_PROJECT_TYPES, default=SELF.project.project_type_id, title_key='description', style='width: 300px') %]</td>
47 47
     </tr>
48 48

  
49 49
     <tr>
templates/webpages/project/search.html
27 27
    </tr>
28 28

  
29 29
    <tr>
30
     <th align="right">[% 'Type' | $T8 %]</th>
31
     <td>[% L.input_tag('filter.type:substr::ilike', filter.type_substr__ilike, size=20) %]</td>
30
     <th align="right">[% 'Project Type' | $T8 %]</th>
31
     <td>[% L.select_tag('filter.project_type_id', ALL_PROJECT_TYPES, default=filter.project_type_id, title_key='description', with_empty=1) %]</td>
32 32
    </tr>
33 33

  
34 34
    [% CUSTOM_VARIABLES_FILTER_CODE %]
templates/webpages/project_type/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("project_type.description" SELF.project_type.description) %]</td>
12
   </tr>
13
  </table>
14

  
15
  <p>
16
   [% L.hidden_tag("id", SELF.project_type.id) %]
17
   [% L.hidden_tag("action", "ProjectType/dispatch") %]
18
   [% L.submit_tag("action_" _ (SELF.project_type.id ? 'update' : 'create'), LxERP.t8('Save')) %]
19
   [%- IF SELF.project_type.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

  
25
 </form>
templates/webpages/project_type/list.html
1
[% USE HTML %][% USE T8 %][% 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 !PROJECT_TYPES.size %]
9
   <p>
10
    [%- 'No project type has been created yet.' | $T8 %]
11
   </p>
12

  
13
  [%- ELSE %]
14
   <table id="project_type_list">
15
    <thead>
16
    <tr class="listheading">
17
     <th align="center"><img src="image/updown.png" alt="[ LxERP.t8('reorder item') %]"></th>
18
     <th>[%- 'Description' | $T8 %]</th>
19
    </tr>
20
    </thead>
21

  
22
    <tbody>
23
    [%- FOREACH project_type = PROJECT_TYPES %]
24
    <tr class="listrow[% loop.count % 2 %]" id="project_type_id_[% project_type.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 => project_type.id) %]">
28
       [%- HTML.escape(project_type.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') %]">[%- 'Create new project type' | $T8 %]</a>
39
  </p>
40
 </form>
41

  
42
 [% L.sortable_element('#project_type_list tbody', url => 'controller.pl?action=ProjectType/reorder', with => 'project_type_id') %]

Auch abrufbar als: Unified diff