From a0206f6e870bd32c4eb39e4da723655f8cd9f46c Mon Sep 17 00:00:00 2001
From: Falko Timme <ft@falkotimme.com>
Date: Wed, 23 Oct 2013 10:19:24 -0400
Subject: [PATCH] - Make sure a client cannot be deleted if he has records in the billing module.

---
 interface/lib/classes/tform_actions.inc.php |    3 ++-
 interface/lib/lang/en.lng                   |    1 +
 interface/lib/lang/de.lng                   |    1 +
 3 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/interface/lib/classes/tform_actions.inc.php b/interface/lib/classes/tform_actions.inc.php
index b181be0..4db3157 100644
--- a/interface/lib/classes/tform_actions.inc.php
+++ b/interface/lib/classes/tform_actions.inc.php
@@ -313,7 +313,8 @@
 						$this->dataRecord = $app->tform->getDataRecord($this->id);
 						
 						$this->onBeforeDelete();
-
+						$app->plugin->raiseEvent($_SESSION['s']['module']['name'].':'.$app->tform->formDef['name'].':'.'on_before_delete',$this);
+						
                         // Saving record to datalog when db_history enabled
                         if($app->tform->formDef["db_history"] == 'yes') {
 							//$old_data_record = $app->tform->getDataRecord($this->id);
diff --git a/interface/lib/lang/de.lng b/interface/lib/lang/de.lng
index 46fcb84..0ccdb30 100644
--- a/interface/lib/lang/de.lng
+++ b/interface/lib/lang/de.lng
@@ -136,4 +136,5 @@
 $wb['client_you_are_locked'] = 'Sie haben keine Berechtigung, Einstellungen zu verändern.';
 $wb['gender_m_txt'] = 'Herr';
 $wb['gender_f_txt'] = 'Frau';
+$wb['client_cannot_be_deleted_because_of_billing_module_txt'] = 'Für den Kunden existieren Einträge im Billing-Modul, daher kann er nicht gelöscht werden.';
 ?>
\ No newline at end of file
diff --git a/interface/lib/lang/en.lng b/interface/lib/lang/en.lng
index 1d689f0..1ce525b 100644
--- a/interface/lib/lang/en.lng
+++ b/interface/lib/lang/en.lng
@@ -138,4 +138,5 @@
 $wb['client_you_are_locked'] = 'You have no permission to change any settings.';
 $wb['gender_m_txt'] = 'Mr.';
 $wb['gender_f_txt'] = 'Ms.';
+$wb['client_cannot_be_deleted_because_of_billing_module_txt'] = 'This client has records in the billing module, therefore he cannot be deleted.';
 ?>

--
Gitblit v1.9.1