From baec2b27041db30bf08a8d421553eb8cc6b68a60 Mon Sep 17 00:00:00 2001
From: filip <filip@ispconfig3>
Date: Thu, 4 Nov 2010 17:47:50 +0000
Subject: [PATCH] Adding company_id attribute for client.

(It's used in several countries to identify company)
---
 install/sql/incremental/upd_0005.sql                  |  2 ++
 install/sql/ispconfig3.sql                            |  2 ++
 interface/web/client/form/client.tform.php            | 11 +++++++++++
 interface/web/client/lib/lang/cz_client.lng           |  1 +
 interface/web/client/lib/lang/en_client.lng           |  1 +
 .../web/client/templates/client_edit_address.htm      |  4 ++++
 6 files changed, 21 insertions(+)
 create mode 100644 install/sql/incremental/upd_0005.sql

diff --git a/install/sql/incremental/upd_0005.sql b/install/sql/incremental/upd_0005.sql
new file mode 100644
index 0000000000..6694ed9c6f
--- /dev/null
+++ b/install/sql/incremental/upd_0005.sql
@@ -0,0 +1,2 @@
+ALTER TABLE client ADD COLUMN company_id varchar(30);
+
diff --git a/install/sql/ispconfig3.sql b/install/sql/ispconfig3.sql
index 2361d9db7d..8dbd915f22 100644
--- a/install/sql/ispconfig3.sql
+++ b/install/sql/ispconfig3.sql
@@ -1649,6 +1649,8 @@ CREATE TABLE `help_faq` (
 
 INSERT INTO `help_faq` VALUES (1,1,0,'I\'d like to know ...','Yes, of course.',1,1,'riud','riud','r');
 
+ALTER TABLE client ADD COLUMN company_id varchar(30);
+
 -- --------------------------------------------------------
 
 SET FOREIGN_KEY_CHECKS = 1;
diff --git a/interface/web/client/form/client.tform.php b/interface/web/client/form/client.tform.php
index f4777ae539..2b832aaa7e 100644
--- a/interface/web/client/form/client.tform.php
+++ b/interface/web/client/form/client.tform.php
@@ -305,6 +305,17 @@ $form["tabs"]['address'] = array (
 			'rows'		=> '',
 			'cols'		=> ''
 		),
+		'company_id' => array (
+			'datatype'	=> 'VARCHAR',
+			'formtype'	=> 'TEXT',
+			'default'	=> '',
+			'value'		=> '',
+			'separator'	=> '',
+			'width'		=> '30',
+			'maxlength'	=> '20',
+			'rows'		=> '',
+			'cols'		=> ''
+		),
 		'notes' => array (
 			'datatype'	=> 'TEXT',
 			'formtype'	=> 'TEXTAREA',
diff --git a/interface/web/client/lib/lang/cz_client.lng b/interface/web/client/lib/lang/cz_client.lng
index 9c5164328e..145d8680c1 100644
--- a/interface/web/client/lib/lang/cz_client.lng
+++ b/interface/web/client/lib/lang/cz_client.lng
@@ -98,4 +98,5 @@ $wb['limit_webdav_user_error_notint'] = 'The webdav user limit must be a number.
 $wb['customer_no_txt'] = 'Customer No.';
 $wb['vat_id_txt'] = 'VAT ID';
 $wb['required_fields_txt'] = '* Required fields';
+$wb['company_id_txt'] = 'IÄŒO';
 ?>
diff --git a/interface/web/client/lib/lang/en_client.lng b/interface/web/client/lib/lang/en_client.lng
index aa8578048b..656968c420 100644
--- a/interface/web/client/lib/lang/en_client.lng
+++ b/interface/web/client/lib/lang/en_client.lng
@@ -101,4 +101,5 @@ $wb["limit_trafficquota_error_notint"] = 'Traffic Quota must be a number.';
 $wb["customer_no_txt"] = 'Customer No.';
 $wb["vat_id_txt"] = 'VAT ID';
 $wb["required_fields_txt"] = '* Required fields';
+$wb['company_id_txt'] = 'Company/Entrepreneur ID';
 ?>
diff --git a/interface/web/client/templates/client_edit_address.htm b/interface/web/client/templates/client_edit_address.htm
index 485d0f121f..520c3fa32c 100644
--- a/interface/web/client/templates/client_edit_address.htm
+++ b/interface/web/client/templates/client_edit_address.htm
@@ -92,6 +92,10 @@
       	<label for="vat_id">{tmpl_var name='vat_id_txt'}</label>
         <input name="vat_id" id="vat_id" value="{tmpl_var name='vat_id'}" size="30" maxlength="255" type="text" class="textInput" />
 	  </div>
+	  <div class="ctrlHolder">
+      	<label for="company_id">{tmpl_var name='company_id_txt'}</label>
+        <input name="company_id" id="company_id" value="{tmpl_var name='company_id'}" size="30" maxlength="255" type="text" class="textInput" />
+	  </div>
       <div class="ctrlHolder">
       	<label for="notes">{tmpl_var name='notes_txt'}</label>
         <textarea name="notes" id="notes" rows='10' cols='30'>{tmpl_var name='notes'}</textarea>
-- 
GitLab