From 21d4aaf83b5d9f1cd664b997d685cf9007cc91c8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bernd=20Ble=C3=9Fmann?= Date: Mon, 28 Dec 2020 18:07:40 +0100 Subject: [PATCH] Zeiterfassung: Keine Zeiterfassungstypen mehr --- SL/Controller/TimeRecording.pm | 12 +++------- SL/DB/Helper/ALL.pm | 1 - SL/DB/Helper/Mappings.pm | 1 - SL/DB/Manager/TimeRecordingType.pm | 21 ------------------ SL/DB/MetaSetup/TimeRecording.pm | 6 ----- SL/DB/MetaSetup/TimeRecordingType.pm | 22 ------------------- SL/DB/TimeRecordingType.pm | 15 ------------- locale/de/all | 4 ---- locale/en/all | 4 ---- .../time_recordings_remove_type.sql | 6 +++++ templates/webpages/time_recording/form.html | 2 -- 11 files changed, 9 insertions(+), 85 deletions(-) delete mode 100644 SL/DB/Manager/TimeRecordingType.pm delete mode 100644 SL/DB/MetaSetup/TimeRecordingType.pm delete mode 100644 SL/DB/TimeRecordingType.pm create mode 100644 sql/Pg-upgrade2/time_recordings_remove_type.sql diff --git a/SL/Controller/TimeRecording.pm b/SL/Controller/TimeRecording.pm index 44d54ca99..e3e2aabbc 100644 --- a/SL/Controller/TimeRecording.pm +++ b/SL/Controller/TimeRecording.pm @@ -18,7 +18,7 @@ use SL::ReportGenerator; use Rose::Object::MakeMethods::Generic ( # scalar => [ qw() ], - 'scalar --get_set_init' => [ qw(time_recording models all_time_recording_types all_employees can_view_all can_edit_all) ], + 'scalar --get_set_init' => [ qw(time_recording models all_employees can_view_all can_edit_all) ], ); @@ -34,7 +34,6 @@ my %sort_columns = ( start_time => t8('Start'), end_time => t8('End'), customer => t8('Customer'), - type => t8('Type'), project => t8('Project'), description => t8('Description'), staff_member => t8('Mitarbeiter'), @@ -151,14 +150,10 @@ sub init_models { sorted => \%sort_columns, disable_plugin => 'paginated', query => \@where, - with_objects => [ 'customer', 'type', 'project', 'staff_member', 'employee' ], + with_objects => [ 'customer', 'project', 'staff_member', 'employee' ], ); } -sub init_all_time_recording_types { - SL::DB::Manager::TimeRecordingType->get_all_sorted(query => [obsolete => 0]); -} - sub init_all_employees { SL::DB::Manager::Employee->get_all_sorted(query => [ deleted => 0 ]); } @@ -181,7 +176,7 @@ sub prepare_report { my $report = SL::ReportGenerator->new(\%::myconfig, $::form); $self->{report} = $report; - my @columns = qw(start_time end_time customer type project description staff_member duration); + my @columns = qw(start_time end_time customer project description staff_member duration); my %column_defs = ( start_time => { text => t8('Start'), sub => sub { $_[0]->start_time_as_timestamp }, @@ -189,7 +184,6 @@ sub prepare_report { end_time => { text => t8('End'), sub => sub { $_[0]->end_time_as_timestamp }, obj_link => sub { $self->url_for(action => 'edit', 'id' => $_[0]->id, callback => $self->models->get_callback) } }, customer => { text => t8('Customer'), sub => sub { $_[0]->customer->displayable_name } }, - type => { text => t8('Type'), sub => sub { $_[0]->type && $_[0]->type->abbreviation } }, project => { text => t8('Project'), sub => sub { $_[0]->project && $_[0]->project->displayable_name } }, description => { text => t8('Description'), sub => sub { $_[0]->description_as_stripped_html }, raw_data => sub { $_[0]->description_as_restricted_html }, # raw_data only used for html(?) diff --git a/SL/DB/Helper/ALL.pm b/SL/DB/Helper/ALL.pm index 30ae80282..52f132107 100644 --- a/SL/DB/Helper/ALL.pm +++ b/SL/DB/Helper/ALL.pm @@ -135,7 +135,6 @@ use SL::DB::TaxKey; use SL::DB::TaxZone; use SL::DB::TaxzoneChart; use SL::DB::TimeRecording; -use SL::DB::TimeRecordingType; use SL::DB::TodoUserConfig; use SL::DB::TransferType; use SL::DB::Translation; diff --git a/SL/DB/Helper/Mappings.pm b/SL/DB/Helper/Mappings.pm index 4abed608a..7b69b53ec 100644 --- a/SL/DB/Helper/Mappings.pm +++ b/SL/DB/Helper/Mappings.pm @@ -214,7 +214,6 @@ my %kivitendo_package_names = ( taxkeys => 'tax_key', tax_zones => 'tax_zone', taxzone_charts => 'taxzone_chart', - time_recording_types => 'time_recording_type', time_recordings => 'time_recording', todo_user_config => 'todo_user_config', transfer_type => 'transfer_type', diff --git a/SL/DB/Manager/TimeRecordingType.pm b/SL/DB/Manager/TimeRecordingType.pm deleted file mode 100644 index e1e1b4ca5..000000000 --- a/SL/DB/Manager/TimeRecordingType.pm +++ /dev/null @@ -1,21 +0,0 @@ -# This file has been auto-generated only because it didn't exist. -# Feel free to modify it at will; it will not be overwritten automatically. - -package SL::DB::Manager::TimeRecordingType; - -use strict; - -use parent qw(SL::DB::Helper::Manager); - -use SL::DB::Helper::Sorted; - -sub object_class { 'SL::DB::TimeRecordingType' } - -__PACKAGE__->make_manager_methods; - -sub _sort_spec { - return ( default => [ 'position', 1 ], - columns => { SIMPLE => 'ALL' }); -} - -1; diff --git a/SL/DB/MetaSetup/TimeRecording.pm b/SL/DB/MetaSetup/TimeRecording.pm index cb3bdd50a..e35141b44 100644 --- a/SL/DB/MetaSetup/TimeRecording.pm +++ b/SL/DB/MetaSetup/TimeRecording.pm @@ -21,7 +21,6 @@ __PACKAGE__->meta->columns( project_id => { type => 'integer' }, staff_member_id => { type => 'integer', not_null => 1 }, start_time => { type => 'timestamp', not_null => 1 }, - type_id => { type => 'integer' }, ); __PACKAGE__->meta->primary_key_columns([ 'id' ]); @@ -48,11 +47,6 @@ __PACKAGE__->meta->foreign_keys( class => 'SL::DB::Employee', key_columns => { staff_member_id => 'id' }, }, - - type => { - class => 'SL::DB::TimeRecordingType', - key_columns => { type_id => 'id' }, - }, ); 1; diff --git a/SL/DB/MetaSetup/TimeRecordingType.pm b/SL/DB/MetaSetup/TimeRecordingType.pm deleted file mode 100644 index 2852d46fe..000000000 --- a/SL/DB/MetaSetup/TimeRecordingType.pm +++ /dev/null @@ -1,22 +0,0 @@ -# This file has been auto-generated. Do not modify it; it will be overwritten -# by rose_auto_create_model.pl automatically. -package SL::DB::TimeRecordingType; - -use strict; - -use parent qw(SL::DB::Object); - -__PACKAGE__->meta->table('time_recording_types'); - -__PACKAGE__->meta->columns( - abbreviation => { type => 'text', not_null => 1 }, - description => { type => 'text' }, - id => { type => 'serial', not_null => 1 }, - obsolete => { type => 'boolean', default => 'false', not_null => 1 }, - position => { type => 'integer', not_null => 1 }, -); - -__PACKAGE__->meta->primary_key_columns([ 'id' ]); - -1; -; diff --git a/SL/DB/TimeRecordingType.pm b/SL/DB/TimeRecordingType.pm deleted file mode 100644 index 06c1b5f2f..000000000 --- a/SL/DB/TimeRecordingType.pm +++ /dev/null @@ -1,15 +0,0 @@ -# This file has been auto-generated only because it didn't exist. -# Feel free to modify it at will; it will not be overwritten automatically. - -package SL::DB::TimeRecordingType; - -use strict; - -use SL::DB::MetaSetup::TimeRecordingType; -use SL::DB::Manager::TimeRecordingType; - -use SL::DB::Helper::ActsAsList; - -__PACKAGE__->meta->initialize; - -1; diff --git a/locale/de/all b/locale/de/all index f4847d2a4..cb1dd1ac3 100755 --- a/locale/de/all +++ b/locale/de/all @@ -97,7 +97,6 @@ $self->{texts} = { 'ATTENTION! If you enabled this feature you can not simply turn it off again without taking care that best_before fields are emptied in the database.' => 'ACHTUNG! Wenn Sie diese Einstellung aktivieren, dann können Sie sie später nicht ohne Weiteres deaktivieren, ohne dafür zu sorgen, dass die Felder der Mindeshaltbarkeitsdaten in der Datenbank leer gemacht werden.', 'ATTENTION! You can not simply change it from periodic to perpetual once you started posting.' => 'ACHTUNG! Es kann nicht ohne Weiteres im laufenden Betrieb von der Aufwandsmethode zur Bestandsmethode gewechselt werden.', 'AUTOMATICALLY MATCH BINS' => 'LAGERPLÄTZE AUTOMATISCH ZUWEISEN', - 'Abbreviation' => 'Abkürzung', 'Abbreviation Legend' => 'Beschreibung der Typ-Abkürzungen (1 Zeichen Typ, 1-2 Zeichen Klassifizierung)', 'Abort' => 'Abbrechen', 'Abrechnungsnummer' => 'Abrechnungsnummer', @@ -242,7 +241,6 @@ $self->{texts} = { 'Add sub function block' => 'Unterfunktionsblock hinzufügen', 'Add taxzone' => 'Steuerzone hinzufügen', 'Add text block' => 'Textblock erfassen', - 'Add time recording type' => 'Typ für Zeiterfassung erfassen', 'Add title' => 'Titel hinzufügen', 'Add unit' => 'Einheit hinzufügen', 'Added sections and function blocks: #1' => 'Hinzugefügte Abschnitte und Funktionsblöcke: #1', @@ -1275,7 +1273,6 @@ $self->{texts} = { 'Edit the request_quotation' => 'Bearbeiten der Preisanfrage', 'Edit the sales_order' => 'Bearbeiten des Auftrags', 'Edit the sales_quotation' => 'Bearbeiten des Angebots', - 'Edit time recording type' => 'Typ für Zeiterfassung bearbeiten', 'Edit time recordings of all staff members' => 'Zeiterfassungseinträge aller Mitarbeiter bearbeiten', 'Edit title' => 'Titiel bearbeiten', 'Edit units' => 'Einheiten bearbeiten', @@ -3756,7 +3753,6 @@ $self->{texts} = { 'Time' => 'Zeit', 'Time Format' => 'Uhrzeitformat', 'Time Recording' => 'Zeiterfassung', - 'Time Recording Types' => 'Typen für Zeiterfassung', 'Time Recordings' => 'Zeiterfassung', 'Time and price estimate' => 'Zeit- und Preisschätzung', 'Time estimate' => 'Zeitschätzung', diff --git a/locale/en/all b/locale/en/all index cc6990536..ee4f24f34 100644 --- a/locale/en/all +++ b/locale/en/all @@ -97,7 +97,6 @@ $self->{texts} = { 'ATTENTION! If you enabled this feature you can not simply turn it off again without taking care that best_before fields are emptied in the database.' => '', 'ATTENTION! You can not simply change it from periodic to perpetual once you started posting.' => '', 'AUTOMATICALLY MATCH BINS' => '', - 'Abbreviation' => '', 'Abbreviation Legend' => '', 'Abort' => '', 'Abrechnungsnummer' => '', @@ -242,7 +241,6 @@ $self->{texts} = { 'Add sub function block' => '', 'Add taxzone' => '', 'Add text block' => '', - 'Add time recording type' => '', 'Add title' => '', 'Add unit' => '', 'Added sections and function blocks: #1' => '', @@ -1275,7 +1273,6 @@ $self->{texts} = { 'Edit the request_quotation' => '', 'Edit the sales_order' => '', 'Edit the sales_quotation' => '', - 'Edit time recording type' => '', 'Edit time recordings of all staff members' => '', 'Edit title' => '', 'Edit units' => '', @@ -3754,7 +3751,6 @@ $self->{texts} = { 'Time' => '', 'Time Format' => '', 'Time Recording' => '', - 'Time Recording Types' => '', 'Time Recordings' => '', 'Time and price estimate' => '', 'Time estimate' => '', diff --git a/sql/Pg-upgrade2/time_recordings_remove_type.sql b/sql/Pg-upgrade2/time_recordings_remove_type.sql new file mode 100644 index 000000000..db79bba7c --- /dev/null +++ b/sql/Pg-upgrade2/time_recordings_remove_type.sql @@ -0,0 +1,6 @@ +-- @tag: time_recordings_remove_type +-- @description: Zeiterfassungs-Typen entfernen +-- @depends: time_recordings time_recordings2 + +ALTER TABLE time_recordings DROP column type_id; +DROP TABLE time_recording_types; diff --git a/templates/webpages/time_recording/form.html b/templates/webpages/time_recording/form.html index 0493b2d04..08a871f97 100644 --- a/templates/webpages/time_recording/form.html +++ b/templates/webpages/time_recording/form.html @@ -18,7 +18,6 @@ [% 'Start' | $T8 %] [% 'End' | $T8 %] [% 'Customer' | $T8 %] - [% 'Type' | $T8 %] [% 'Project' | $T8 %] [% 'Description' | $T8 %] [% 'Mitarbeiter' | $T8 %] @@ -37,7 +36,6 @@ [% P.button_tag('kivi.TimeRecording.set_current_date_time("end")', LxERP.t8('now')) %] [% P.customer_vendor.picker('time_recording.customer_id', SELF.time_recording.customer_id, type='customer', style='width: 300px', "data-validate"="required", "data-title"=LxERP.t8('Customer')) %] - [% P.select_tag('time_recording.type_id', SELF.all_time_recording_types, default=SELF.time_recording.type.id, with_empty=1, title_key='abbreviation') %] [% P.project.picker('time_recording.project_id', SELF.time_recording.project_id, style='width: 300px') %] [% L.textarea_tag('time_recording.description', SELF.time_recording.description, wrap="soft", style="width: 350px; height: 150px", class="texteditor", "data-validate"="required", "data-title"=LxERP.t8('Description')) %] -- 2.20.1