kivi.Validator: check_right_*_format in display_row auf Validator geƤndert
[kivitendo-erp.git] / bin / mozilla / io.pl
index 5bd5a25..19f0c9a 100644 (file)
@@ -393,7 +393,7 @@ sub display_row {
       '-labels' => \%projectnumber_labels,
       '-default' => $form->{"project_id_$i"}
     ));
-    $column_data{reqdate}   = qq|<input name="reqdate_$i" size="11" onchange="check_right_date_format(this)" value="$form->{"reqdate_$i"}">|;
+    $column_data{reqdate}   = qq|<input name="reqdate_$i" size="11" data-validate="date" value="$form->{"reqdate_$i"}">|;
     $column_data{subtotal}  = sprintf qq|<input type="checkbox" name="subtotal_$i" value="1" %s>|, $form->{"subtotal_$i"} ? 'checked' : '';
 
 # begin marge calculations
@@ -1670,6 +1670,7 @@ sub _update_part_information {
 }
 
 sub _update_ship {
+  return unless $::form->{id};
   my $helper = SL::Helper::ShippedQty->new->calculate($::form->{id});
 
   for my $i (1..$::form->{rowcount}) {
@@ -1968,14 +1969,19 @@ sub show_sales_purchase_email_dialog {
   my $email = '';
   if ($::form->{cp_id}) {
     $email = SL::DB::Contact->load_cached($::form->{cp_id})->cp_email;
-  } elsif ($::form->{vc} && $::form->{vc_id}) {
+  }
+
+  if (!$email && $::form->{vc} && $::form->{vc_id}) {
     $email = SL::DB::Customer->load_cached($::form->{vc_id})->email if 'customer' eq $::form->{vc};
     $email = SL::DB::Vendor  ->load_cached($::form->{vc_id})->email if 'vendor'   eq $::form->{vc};
   }
 
+  $email = '' if $::form->{type} eq 'purchase_delivery_order';
+
   my $email_form = {
     to                  => $email,
     subject             => $::form->generate_email_subject,
+    message             => $::form->generate_email_body,
     attachment_filename => $::form->generate_attachment_filename,
   };