X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/945bae4c8dc3846f772642cba692b46b8f70bf6c..459574b971b01d2cc88c5d4cbe1ad14c11b19ec7:/SL/Controller/SimpleSystemSetting.pm diff --git a/SL/Controller/SimpleSystemSetting.pm b/SL/Controller/SimpleSystemSetting.pm index 429d2879b..de0feb073 100644 --- a/SL/Controller/SimpleSystemSetting.pm +++ b/SL/Controller/SimpleSystemSetting.pm @@ -40,6 +40,75 @@ my %supported_types = ( ], }, + business => { + # Make locales.pl happy: $self->render("simple_system_setting/_business_form") + class => 'Business', + titles => { + list => t8('Businesses'), + add => t8('Add business'), + edit => t8('Edit business'), + }, + list_attributes => [ + { method => 'description', title => t8('Description'), }, + { title => t8('Discount'), formatter => sub { $_[0]->discount_as_percent . ' %' }, align => 'right' }, + { method => 'customernumberinit', title => t8('Customernumberinit'), }, + ], + }, + + department => { + class => 'Department', + titles => { + list => t8('Departments'), + add => t8('Add department'), + edit => t8('Edit department'), + }, + }, + + part_classification => { + # Make locales.pl happy: $self->render("simple_system_setting/_part_classification_form") + class => 'PartClassification', + titles => { + list => t8('Part classifications'), + add => t8('Add part classification'), + edit => t8('Edit part classification'), + }, + list_attributes => [ + { title => t8('Description'), formatter => sub { t8($_[0]->description) } }, + { title => t8('Type abbreviation'), formatter => sub { t8($_[0]->abbreviation) } }, + { title => t8('Used for Purchase'), formatter => sub { $_[0]->used_for_purchase ? t8('yes') : t8('no') } }, + { title => t8('Used for Sale'), formatter => sub { $_[0]->used_for_sale ? t8('yes') : t8('no') } }, + { title => t8('Report separately'), formatter => sub { $_[0]->report_separate ? t8('yes') : t8('no') } }, + ], + }, + + parts_group => { + # Make locales.pl happy: $self->render("simple_system_setting/_parts_group_form") + class => 'PartsGroup', + titles => { + list => t8('Partsgroups'), + add => t8('Add partsgroup'), + edit => t8('Edit partsgroup'), + }, + list_attributes => [ + { method => 'partsgroup', title => t8('Description') }, + { method => 'obsolete', title => t8('Obsolete'), formatter => sub { $_[0]->obsolete ? t8('yes') : t8('no') } }, + ], + }, + + price_factor => { + # Make locales.pl happy: $self->render("simple_system_setting/_price_factor_form") + class => 'PriceFactor', + titles => { + list => t8('Price Factors'), + add => t8('Add Price Factor'), + edit => t8('Edit Price Factor'), + }, + list_attributes => [ + { method => 'description', title => t8('Description') }, + { method => 'factor_as_number', title => t8('Factor'), align => 'right' }, + ], + }, + pricegroup => { # Make locales.pl happy: $self->render("simple_system_setting/_pricegroup_form") class => 'Pricegroup', @@ -53,6 +122,103 @@ my %supported_types = ( { method => 'obsolete', title => t8('Obsolete'), formatter => sub { $_[0]->obsolete ? t8('yes') : t8('no') } }, ], }, + + project_status => { + class => 'ProjectStatus', + titles => { + list => t8('Project statuses'), + add => t8('Add project status'), + edit => t8('Edit project status'), + }, + }, + + project_type => { + class => 'ProjectType', + titles => { + list => t8('Project types'), + add => t8('Add project type'), + edit => t8('Edit project type'), + }, + }, + + requirement_spec_acceptance_status => { + # Make locales.pl happy: $self->render("simple_system_setting/_requirement_spec_acceptance_status_form") + class => 'RequirementSpecAcceptanceStatus', + titles => { + list => t8('Acceptance Statuses'), + add => t8('Add acceptance status'), + edit => t8('Edit acceptance status'), + }, + list_attributes => [ + { method => 'name', title => t8('Name') }, + { method => 'description', title => t8('Description') }, + ], + }, + + requirement_spec_complexity => { + class => 'RequirementSpecComplexity', + titles => { + list => t8('Complexities'), + add => t8('Add complexity'), + edit => t8('Edit complexity'), + }, + }, + + requirement_spec_predefined_text => { + # Make locales.pl happy: $self->render("simple_system_setting/_requirement_spec_predefined_text_form") + class => 'RequirementSpecPredefinedText', + titles => { + list => t8('Pre-defined Texts'), + add => t8('Add pre-defined text'), + edit => t8('Edit pre-defined text'), + }, + list_attributes => [ + { method => 'description', title => t8('Description') }, + { method => 'title', title => t8('Title') }, + { title => t8('Content'), formatter => sub { my $t = $_[0]->text_as_stripped_html; length($t) > 50 ? substr($t, 0, 50) . '…' : $t } }, + { title => t8('Useable for text blocks'), formatter => sub { $_[0]->useable_for_text_blocks ? t8('yes') : t8('no') } }, + { title => t8('Useable for sections'), formatter => sub { $_[0]->useable_for_sections ? t8('yes') : t8('no') } }, + ], + }, + + requirement_spec_risk => { + class => 'RequirementSpecRisk', + titles => { + list => t8('Risk levels'), + add => t8('Add risk level'), + edit => t8('Edit risk level'), + }, + }, + + requirement_spec_status => { + # Make locales.pl happy: $self->render("simple_system_setting/_requirement_spec_status_form") + class => 'RequirementSpecStatus', + titles => { + list => t8('Requirement Spec Statuses'), + add => t8('Add requirement spec status'), + edit => t8('Edit requirement spec status'), + }, + list_attributes => [ + { method => 'name', title => t8('Name') }, + { method => 'description', title => t8('Description') }, + ], + }, + + requirement_spec_type => { + # Make locales.pl happy: $self->render("simple_system_setting/_requirement_spec_type_form") + class => 'RequirementSpecType', + titles => { + list => t8('Requirement Spec Types'), + add => t8('Add requirement spec type'), + edit => t8('Edit requirement spec type'), + }, + list_attributes => [ + { method => 'description', title => t8('Description') }, + { method => 'section_number_format', title => t8('Section number format') }, + { method => 'function_block_number_format', title => t8('Function block number format') }, + ], + }, + ); my @default_list_attributes = ( @@ -204,6 +370,20 @@ sub render_form { # type-specific helper functions # +sub setup_requirement_spec_acceptance_status { + my ($self) = @_; + + no warnings 'once'; + $self->{valid_names} = \@SL::DB::RequirementSpecAcceptanceStatus::valid_names; +} + +sub setup_requirement_spec_status { + my ($self) = @_; + + no warnings 'once'; + $self->{valid_names} = \@SL::DB::RequirementSpecStatus::valid_names; +} + 1; __END__