eMail wird nur angekreuzt wenn email in der Konfiguration gesetzt ist
[kivitendo-erp.git] / bin / mozilla / ct.pl
index 49672ab..a04cf5e 100644 (file)
@@ -543,14 +543,8 @@ sub list_names {
 <input type=hidden name=password value=$form->{password}>
 
 <input class=submit type=submit name=action value="|
-    . $locale->text('Add') . qq|">|;
+    . $locale->text('Add') . qq|">
 
-  if ($form->{menubar}) {
-    require "$form->{path}/menu.pl";
-    &menubar;
-  }
-
-  print qq|
   </form>
 
 </body>
@@ -1167,10 +1161,10 @@ $shipto
     <tr>
       <th align=left nowrap>| . $locale->text('From') . qq|</th>
       <td><input id=from name=from size=10 maxlength=10 value="$form->{from}">
-        <input type="button" name="from" id="trigger_from" value="?"></td>
+        <input type="button" name="fromB" id="trigger_from" value="?"></td>
       <th align=left nowrap>| . $locale->text('To (time)') . qq|</th>
       <td><input id=to name=to size=10 maxlength=10 value="$form->{to}">
-        <input type="button" name="to" id="trigger_to" value="?"></td>
+        <input type="button" name="toB" id="trigger_to" value="?"></td>
     </tr>       
     <tr>
      <td colspan=4>
@@ -1183,8 +1177,8 @@ $shipto
 
 </div>
 
-| . $form->write_trigger(\%myconfig, 2, "from", "BL", "trigger_from",
-                         "to", "BL", "trigger_to");
+| . $form->write_trigger(\%myconfig, 2, "fromB", "BL", "trigger_from",
+                         "toB", "BL", "trigger_to");
 
   $lxdebug->leave_sub();
 }
@@ -1249,11 +1243,6 @@ $update_button
       . qq|">\n|;
   }
 
-  if ($form->{menubar}) {
-    require "$form->{path}/menu.pl";
-    &menubar;
-  }
-
   print qq|
 
   </form>
@@ -1382,8 +1371,16 @@ sub save {
   if ($vertreter && $form->{db} eq "customer") {
     $form->isblank("salesman_id", $locale->text("Salesman missing!"));
   }
-  print(STDERR "SHIPTO in sub save $form->{shipto_id}\n");
-  &{"CT::save_$form->{db}"}("", \%myconfig, \%$form);
+
+  my $res = &{"CT::save_$form->{db}"}("", \%myconfig, \%$form);
+
+  if (3 == $res) {
+    if ($form->{"db"} eq "customer") {
+      $form->error($locale->text('This customer number is already in use.'));
+    } else {
+      $form->error($locale->text('This vendor number is already in use.'));
+    }
+  }
 
   &edit;
   exit;