Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 6c1536aa

Von Sven Schöling vor mehr als 16 Jahren hinzugefügt

  • ID 6c1536aad4882e22fe0be62f295749d436e0f49d
  • Vorgänger ee82a6ce
  • Nachfolger 100158ee

Contacts loeschbar gemacht (gibt noch kleinere probleme mit dem javascript)

Unterschiede anzeigen:

SL/CT.pm
827 827

  
828 828
  map { $form->{$_} = $ref->{$_} } keys %$ref;
829 829

  
830
  $query = qq|SELECT COUNT(cp_id) AS used FROM (
831
    SELECT cp_id FROM oe UNION
832
    SELECT cp_id FROM ar UNION
833
    SELECT cp_id FROM ap UNION
834
    SELECT cp_id FROM delivery_orders
835
  ) AS cpid WHERE cp_id = ? OR ? = 0|;
836
  ($form->{cp_used}) = selectfirst_array_query($form, $dbh, $query, ($form->{cp_id})x2);
837

  
830 838
  $sth->finish;
831 839
  $dbh->disconnect;
832 840

  
......
1003 1011
  $main::lxdebug->leave_sub();
1004 1012
}
1005 1013

  
1014
sub delete_shipto {
1015
  $main::lxdebug->enter_sub();
1016

  
1017
  my $self      = shift;
1018
  my $shipto_id = shift;
1019

  
1020
  my $form      = $main::form;
1021
  my %myconfig  = %main::myconfig;
1022
  my $dbh       = $form->get_standard_dbh(\%myconfig);
1023

  
1024
  do_query($form, $dbh, qq|UPDATE contacts SET cp_cv_id = NULL WHERE cp_id = ?|, $shipto_id);
1025

  
1026
  $dbh->commit();
1027

  
1028
  $main::lxdebug->leave_sub();
1029
}
1030

  
1006 1031
1;
bin/mozilla/ct.pl
565 565

  
566 566
  CT->get_contact(\%myconfig, \%$form);
567 567
  print $cgi->header(), join '__pjx__', map $form->{"cp_$_"}, 
568
    qw(name greeting title givenname phone1 phone2 email abteilung fax mobile1 mobile2 satphone satfax project privatphone privatemail birthday);
568
    qw(name greeting title givenname phone1 phone2 email abteilung fax mobile1 mobile2 satphone satfax project privatphone privatemail birthday used);
569 569
  $lxdebug->leave_sub();
570 570

  
571 571
}
......
603 603

  
604 604
  @$form{ grep /^shipto/, keys %$form } = undef;
605 605

  
606
  display();
606
  edit();
607

  
608
  $main::lxdebug->leave_sub();
609
}
610

  
611
sub delete_contact {
612
  $main::lxdebug->enter_sub();
613

  
614
  $auth->assert('customer_vendor_edit');
615

  
616
  CT->delete_shipto($form->{cp_id});
617

  
618
  @$form{ grep /^cp_/, keys %$form } = undef;
619

  
620
  edit();
607 621

  
608 622
  $main::lxdebug->leave_sub();
609 623
}
locale/de/all
437 437
  'Defaults saved.'             => 'Die Standardeinstellungen wurden gespeichert.',
438 438
  'Delete'                      => 'L?schen',
439 439
  'Delete Account'              => 'Konto l?schen',
440
  'Delete Contact'              => 'Ansprechpartner l?schen',
440 441
  'Delete Dataset'              => 'Datenbank l?schen',
441 442
  'Delete Shipto'               => 'Lieferadresse l?schen',
442 443
  'Delete delivery order'       => 'Lieferschein löschen',
locale/de/ct
236 236
  'erfassen'                    => 'add',
237 237
  'weiter'                      => 'continue',
238 238
  'l?schen'                     => 'delete',
239
  'ansprechpartner_l?schen'     => 'delete_contact',
239 240
  'lieferadresse_l?schen'       => 'delete_shipto',
240 241
  'neue_ware'                   => 'new_part',
241 242
  'speichern'                   => 'save',
templates/webpages/ct/form_header_de.html
316 316
             name       = 'cp_id',
317 317
             id         = 'cp_id',
318 318
             DATA       = CONTACTS,
319
             onChange   = "get_contact(['cp_id__' + this.value], ['cp_name', 'cp_greeting', 'cp_title', 'cp_givenname', 'cp_phone1', 'cp_phone2', 'cp_email', 'cp_abteilung', 'cp_fax', 'cp_mobile1', 'cp_mobile2', 'cp_satphone', 'cp_satfax', 'cp_project', 'cp_privatphone', 'cp_privatemail', 'cp_birthday'])",
319
             onChange   = "get_contact(['cp_id__'+this.value],['cp_name','cp_greeting','cp_title','cp_givenname','cp_phone1','cp_phone2','cp_email','cp_abteilung','cp_fax','cp_mobile1','cp_mobile2','cp_satphone','cp_satfax','cp_project','cp_privatphone','cp_privatemail','cp_birthday',enable_delete_contact])",
320 320
             id_key     = 'cp_id',
321 321
             label_sub  = 'contacts_label',
322 322
       -%]
......
445 445
     </tr>
446 446
    </table>
447 447

  
448
    <input type="submit" id="delete_contact" name="action" value="Ansprechpartner l?schen" disabled>
448 449
    <br style="clear: left" />
449 450
   </div>
450 451

  
......
595 596
       Calendar.setup({ inputField : "FU_date", ifFormat :"[% myconfig_jsc_dateformat %]", align : "BR", button : "FU_date_trigger" });
596 597
       //-->
597 598

  
598
   function enable_delete_shipto(used){ var s=document.getElementById('delete_shipto'); if (s) s.disabled = (used > 0 ? true : false); }
599
   function enable_delete_shipto(used) { var s=document.getElementById('delete_shipto');  if (s) s.disabled = (used > 0 ? true : false); }
600
   function enable_delete_contact(used){ var s=document.getElementById('delete_contact'); if (s) s.disabled = (used > 0 ? true : false); }
599 601
  </script>
templates/webpages/ct/form_header_master.html
316 316
             name       = 'cp_id',
317 317
             id         = 'cp_id',
318 318
             DATA       = CONTACTS,
319
             onChange   = "get_contact(['cp_id__' + this.value], ['cp_name', 'cp_greeting', 'cp_title', 'cp_givenname', 'cp_phone1', 'cp_phone2', 'cp_email', 'cp_abteilung', 'cp_fax', 'cp_mobile1', 'cp_mobile2', 'cp_satphone', 'cp_satfax', 'cp_project', 'cp_privatphone', 'cp_privatemail', 'cp_birthday'])",
319
             onChange   = "get_contact(['cp_id__'+this.value],['cp_name','cp_greeting','cp_title','cp_givenname','cp_phone1','cp_phone2','cp_email','cp_abteilung','cp_fax','cp_mobile1','cp_mobile2','cp_satphone','cp_satfax','cp_project','cp_privatphone','cp_privatemail','cp_birthday',enable_delete_contact])",
320 320
             id_key     = 'cp_id',
321 321
             label_sub  = 'contacts_label',
322 322
       -%]
......
445 445
     </tr>
446 446
    </table>
447 447

  
448
    <input type="submit" id="delete_contact" name="action" value="<translate>Delete Contact</translate>" disabled>
448 449
    <br style="clear: left" />
449 450
   </div>
450 451

  
......
595 596
       Calendar.setup({ inputField : "FU_date", ifFormat :"[% myconfig_jsc_dateformat %]", align : "BR", button : "FU_date_trigger" });
596 597
       //-->
597 598

  
598
   function enable_delete_shipto(used){ var s=document.getElementById('delete_shipto'); if (s) s.disabled = (used > 0 ? true : false); }
599
   function enable_delete_shipto(used) { var s=document.getElementById('delete_shipto');  if (s) s.disabled = (used > 0 ? true : false); }
600
   function enable_delete_contact(used){ var s=document.getElementById('delete_contact'); if (s) s.disabled = (used > 0 ? true : false); }
599 601
  </script>

Auch abrufbar als: Unified diff