X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FForm.pm;h=141233d94c94735f3f1efbec418441508cfc4bcc;hb=0550e83adcd91851e9db324b4228d17a58895c26;hp=e7d1425991de56bddb53f215cc59a98fd1ee78de;hpb=bae050e9f3e3aaeab94bbbbed96949edca155346;p=kivitendo-erp.git diff --git a/SL/Form.pm b/SL/Form.pm index e7d142599..141233d94 100644 --- a/SL/Form.pm +++ b/SL/Form.pm @@ -469,16 +469,14 @@ sub header { $layout->use_stylesheet("$_.css") for qw( main menu list_accounts jquery.autocomplete jquery.multiselect2side frame_header/header - ui-lightness/jquery-ui-1.8.12.custom + ui-lightness/jquery-ui jquery-ui.custom - js/jscalendar/calendar-win2k-1 ); - $layout->use_javascript("$_.js") for qw( - jquery common jscalendar/calendar jscalendar/lang/calendar-de - jscalendar/calendar-setup part_selection jquery-ui jquery.cookie jqModal - switchmenuframe - ); + $layout->use_javascript("$_.js") for (qw( + jquery jquery-ui jquery.cookie jqModal jquery.checkall + common part_selection switchmenuframe + ), "jquery/ui/i18n/jquery.ui.datepicker-$::myconfig{countrycode}"); $self->{favicon} ||= "favicon.ico"; $self->{titlebar} = join ' - ', grep $_, $self->{title}, $self->{login}, $::myconfig{dbname}, $self->{version} if $self->{title} || !$self->{titlebar}; @@ -706,6 +704,14 @@ sub show_generic_error { return; } + if ($::request->is_ajax) { + $::lxdebug->message(0, "trying to render AJAX response..."); + SL::ClientJS->new + ->error($error) + ->render(SL::Controller::Base->new); + ::end_of_request(); + } + my $add_params = { 'title_error' => $params{title}, 'label_error' => $error, @@ -757,51 +763,6 @@ sub show_generic_information { ::end_of_request(); } -# write Trigger JavaScript-Code ($qty = quantity of Triggers) -# changed it to accept an arbitrary number of triggers - sschoeling -sub write_trigger { - $main::lxdebug->enter_sub(); - - my $self = shift; - my $myconfig = shift; - my $qty = shift; - - # set dateform for jsscript - # default - my %dateformats = ( - "dd.mm.yy" => "%d.%m.%Y", - "dd/mm/yy" => "%d/%m/%Y", - "mm/dd/yy" => "%m/%d/%Y", - "yyyy-mm-dd" => "%Y-%m-%d", - ); - - my $ifFormat = defined($dateformats{$myconfig->{"dateformat"}}) ? - $dateformats{$myconfig->{"dateformat"}} : "%d.%m.%Y"; - - my @triggers; - while ($#_ >= 2) { - push @triggers, qq| - Calendar.setup( - { - inputField : "| . (shift) . qq|", - ifFormat :"$ifFormat", - align : "| . (shift) . qq|", - button : "| . (shift) . qq|" - } - ); - |; - } - my $jsscript = qq| - - |; - - $main::lxdebug->leave_sub(); - - return $jsscript; -} #end sub write_trigger - sub _store_redirect_info_in_session { my ($self) = @_; @@ -970,6 +931,11 @@ sub parse_amount { my ($self, $myconfig, $amount) = @_; + if (!defined($amount) || ($amount eq '')) { + $main::lxdebug->leave_sub(2); + return 0; + } + if ( ($myconfig->{numberformat} eq '1.000,00') || ($myconfig->{numberformat} eq '1000,00')) { $amount =~ s/\.//g;