X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FController%2FCustomVariableConfig.pm;h=1b780e5fc0441ef78616639b825bceb6e7508bd7;hb=862bc8ce30cd40b67d2856ac7f1d11d5e4322f09;hp=ed7e844c19315b650585ef22648311a7c425ba48;hpb=5e96049428deceda2ef857930bbf67311deccbcb;p=kivitendo-erp.git diff --git a/SL/Controller/CustomVariableConfig.pm b/SL/Controller/CustomVariableConfig.pm index ed7e844c1..1b780e5fc 100644 --- a/SL/Controller/CustomVariableConfig.pm +++ b/SL/Controller/CustomVariableConfig.pm @@ -158,12 +158,14 @@ sub init_translated_types { sub init_modules { my ($self, %params) = @_; - return [ - { module => 'CT', description => t8('Customers and vendors') }, - { module => 'Contacts', description => t8('Contact persons') }, - { module => 'IC', description => t8('Parts, services and assemblies') }, - { module => 'Projects', description => t8('Projects') }, - ]; + return [ sort { $a->{description}->translated cmp $b->{description}->translated } ( + { module => 'CT', description => t8('Customers and vendors') }, + { module => 'Contacts', description => t8('Contact persons') }, + { module => 'IC', description => t8('Parts, services and assemblies') }, + { module => 'Projects', description => t8('Projects') }, + { module => 'RequirementSpecs', description => t8('Requirement Specs') }, + { module => 'ShipTo', description => t8('Shipping Address') }, + )]; } sub create_or_update { @@ -195,13 +197,13 @@ sub create_or_update { return; } - my $dbh = $self->config->db; - $dbh->begin_work; + SL::DB->client->with_transaction(sub { + my $dbh = SL::DB->client->dbh; - $self->config->save; - $self->_set_cvar_validity() if $is_new; - - $dbh->commit; + $self->config->save; + $self->_set_cvar_validity() if $is_new; + 1; + }) or do { die SL::DB->client->error }; flash_later('info', $is_new ? t8('The custom variable has been created.') : t8('The custom variable has been saved.')); $self->redirect_to(action => 'list', module => $self->module);