Revision 6c1536aa
Von Sven Schöling vor etwa 17 Jahren hinzugefügt
SL/CT.pm | ||
---|---|---|
|
||
map { $form->{$_} = $ref->{$_} } keys %$ref;
|
||
|
||
$query = qq|SELECT COUNT(cp_id) AS used FROM (
|
||
SELECT cp_id FROM oe UNION
|
||
SELECT cp_id FROM ar UNION
|
||
SELECT cp_id FROM ap UNION
|
||
SELECT cp_id FROM delivery_orders
|
||
) AS cpid WHERE cp_id = ? OR ? = 0|;
|
||
($form->{cp_used}) = selectfirst_array_query($form, $dbh, $query, ($form->{cp_id})x2);
|
||
|
||
$sth->finish;
|
||
$dbh->disconnect;
|
||
|
||
... | ... | |
$main::lxdebug->leave_sub();
|
||
}
|
||
|
||
sub delete_shipto {
|
||
$main::lxdebug->enter_sub();
|
||
|
||
my $self = shift;
|
||
my $shipto_id = shift;
|
||
|
||
my $form = $main::form;
|
||
my %myconfig = %main::myconfig;
|
||
my $dbh = $form->get_standard_dbh(\%myconfig);
|
||
|
||
do_query($form, $dbh, qq|UPDATE contacts SET cp_cv_id = NULL WHERE cp_id = ?|, $shipto_id);
|
||
|
||
$dbh->commit();
|
||
|
||
$main::lxdebug->leave_sub();
|
||
}
|
||
|
||
1;
|
bin/mozilla/ct.pl | ||
---|---|---|
|
||
CT->get_contact(\%myconfig, \%$form);
|
||
print $cgi->header(), join '__pjx__', map $form->{"cp_$_"},
|
||
qw(name greeting title givenname phone1 phone2 email abteilung fax mobile1 mobile2 satphone satfax project privatphone privatemail birthday);
|
||
qw(name greeting title givenname phone1 phone2 email abteilung fax mobile1 mobile2 satphone satfax project privatphone privatemail birthday used);
|
||
$lxdebug->leave_sub();
|
||
|
||
}
|
||
... | ... | |
|
||
@$form{ grep /^shipto/, keys %$form } = undef;
|
||
|
||
display();
|
||
edit();
|
||
|
||
$main::lxdebug->leave_sub();
|
||
}
|
||
|
||
sub delete_contact {
|
||
$main::lxdebug->enter_sub();
|
||
|
||
$auth->assert('customer_vendor_edit');
|
||
|
||
CT->delete_shipto($form->{cp_id});
|
||
|
||
@$form{ grep /^cp_/, keys %$form } = undef;
|
||
|
||
edit();
|
||
|
||
$main::lxdebug->leave_sub();
|
||
}
|
locale/de/all | ||
---|---|---|
'Defaults saved.' => 'Die Standardeinstellungen wurden gespeichert.',
|
||
'Delete' => 'L?schen',
|
||
'Delete Account' => 'Konto l?schen',
|
||
'Delete Contact' => 'Ansprechpartner l?schen',
|
||
'Delete Dataset' => 'Datenbank l?schen',
|
||
'Delete Shipto' => 'Lieferadresse l?schen',
|
||
'Delete delivery order' => 'Lieferschein löschen',
|
locale/de/ct | ||
---|---|---|
'erfassen' => 'add',
|
||
'weiter' => 'continue',
|
||
'l?schen' => 'delete',
|
||
'ansprechpartner_l?schen' => 'delete_contact',
|
||
'lieferadresse_l?schen' => 'delete_shipto',
|
||
'neue_ware' => 'new_part',
|
||
'speichern' => 'save',
|
templates/webpages/ct/form_header_de.html | ||
---|---|---|
name = 'cp_id',
|
||
id = 'cp_id',
|
||
DATA = CONTACTS,
|
||
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'])",
|
||
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])",
|
||
id_key = 'cp_id',
|
||
label_sub = 'contacts_label',
|
||
-%]
|
||
... | ... | |
</tr>
|
||
</table>
|
||
|
||
<input type="submit" id="delete_contact" name="action" value="Ansprechpartner l?schen" disabled>
|
||
<br style="clear: left" />
|
||
</div>
|
||
|
||
... | ... | |
Calendar.setup({ inputField : "FU_date", ifFormat :"[% myconfig_jsc_dateformat %]", align : "BR", button : "FU_date_trigger" });
|
||
//-->
|
||
|
||
function enable_delete_shipto(used){ var s=document.getElementById('delete_shipto'); if (s) s.disabled = (used > 0 ? true : false); }
|
||
function enable_delete_shipto(used) { var s=document.getElementById('delete_shipto'); if (s) s.disabled = (used > 0 ? true : false); }
|
||
function enable_delete_contact(used){ var s=document.getElementById('delete_contact'); if (s) s.disabled = (used > 0 ? true : false); }
|
||
</script>
|
templates/webpages/ct/form_header_master.html | ||
---|---|---|
name = 'cp_id',
|
||
id = 'cp_id',
|
||
DATA = CONTACTS,
|
||
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'])",
|
||
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])",
|
||
id_key = 'cp_id',
|
||
label_sub = 'contacts_label',
|
||
-%]
|
||
... | ... | |
</tr>
|
||
</table>
|
||
|
||
<input type="submit" id="delete_contact" name="action" value="<translate>Delete Contact</translate>" disabled>
|
||
<br style="clear: left" />
|
||
</div>
|
||
|
||
... | ... | |
Calendar.setup({ inputField : "FU_date", ifFormat :"[% myconfig_jsc_dateformat %]", align : "BR", button : "FU_date_trigger" });
|
||
//-->
|
||
|
||
function enable_delete_shipto(used){ var s=document.getElementById('delete_shipto'); if (s) s.disabled = (used > 0 ? true : false); }
|
||
function enable_delete_shipto(used) { var s=document.getElementById('delete_shipto'); if (s) s.disabled = (used > 0 ? true : false); }
|
||
function enable_delete_contact(used){ var s=document.getElementById('delete_contact'); if (s) s.disabled = (used > 0 ? true : false); }
|
||
</script>
|
Auch abrufbar als: Unified diff
Contacts loeschbar gemacht (gibt noch kleinere probleme mit dem javascript)