From 59118c7c296fd8f0224f39404320223ac6f31762 Mon Sep 17 00:00:00 2001
From: ftimme <ft@falkotimme.com>
Date: Fri, 11 May 2012 07:14:55 -0400
Subject: [PATCH] - Added further tables to global search. - Added translations to global search.

---
 interface/web/mail/form/mail_transport.tform.php        |   11 +
 interface/web/mail/form/mail_domain_catchall.tform.php  |   11 +
 interface/web/mail/lib/lang/en_mail_forward.lng         |    1 
 interface/web/mail/lib/lang/en_mail_transport.lng       |    1 
 interface/web/themes/default/templates/main.tpl.htm     |    6 +
 interface/web/mail/lib/lang/en_mail_alias.lng           |    1 
 interface/web/mail/form/mail_get.tform.php              |   17 ++
 interface/web/mail/lib/lang/de_mail_transport.lng       |    1 
 interface/web/mail/form/mail_aliasdomain.tform.php      |   11 +
 interface/web/mail/lib/lang/de_mail_forward.lng         |    3 
 interface/web/mail/lib/lang/de_mail_domain_catchall.lng |    1 
 interface/web/mail/lib/lang/en_mail_domain_catchall.lng |    1 
 interface/lib/lang/en.lng                               |    5 +
 interface/web/mail/form/mail_forward.tform.php          |   11 +
 interface/web/mail/form/mail_mailinglist.tform.php      |   14 ++
 interface/lib/lang/de.lng                               |    5 +
 interface/web/mail/lib/lang/de_mail_alias.lng           |    1 
 interface/lib/app.inc.php                               |    7 +
 interface/web/client/form/reseller.tform.php            |   44 ++++++--
 interface/web/dashboard/ajax_get_json.php               |   64 +++++++++---
 interface/web/mail/form/mail_alias.tform.php            |   11 +
 interface/web/js/jquery.ispconfigsearch.js              |   14 ++
 22 files changed, 187 insertions(+), 54 deletions(-)

diff --git a/interface/lib/app.inc.php b/interface/lib/app.inc.php
index 432fdab..ff344d0 100755
--- a/interface/lib/app.inc.php
+++ b/interface/lib/app.inc.php
@@ -246,6 +246,13 @@
 			$this->tpl->setVar('cpuser', $_SESSION['s']['user']['username']);
 			$this->tpl->setVar('logout_txt', $this->lng('logout_txt'));
 		}
+		
+		/* Global Search */
+		$this->tpl->setVar('globalsearch_resultslimit_of_txt', $this->lng('globalsearch_resultslimit_of_txt'));
+		$this->tpl->setVar('globalsearch_resultslimit_results_txt', $this->lng('globalsearch_resultslimit_results_txt'));
+		$this->tpl->setVar('globalsearch_noresults_text_txt', $this->lng('globalsearch_noresults_text_txt'));
+		$this->tpl->setVar('globalsearch_noresults_limit_txt', $this->lng('globalsearch_noresults_limit_txt'));
+		$this->tpl->setVar('globalsearch_searchfield_watermark_txt', $this->lng('globalsearch_searchfield_watermark_txt'));
 	}
 
 } // end class
diff --git a/interface/lib/lang/de.lng b/interface/lib/lang/de.lng
index fddee77..dfaad28 100644
--- a/interface/lib/lang/de.lng
+++ b/interface/lib/lang/de.lng
@@ -70,4 +70,9 @@
 $wb['datepicker_prevText'] = 'Zur&uuml;ck';
 $wb['logout_txt'] = 'LOGOUT';
 $wb['submit_confirmation'] = 'Wollen Sie diese Aktion wirlich ausführen?';
+$wb['globalsearch_resultslimit_of_txt'] = "von";
+$wb['globalsearch_resultslimit_results_txt'] = "Treffern";
+$wb['globalsearch_noresults_text_txt'] = "Keine Treffer.";
+$wb['globalsearch_noresults_limit_txt'] = "0 Treffer";
+$wb['globalsearch_searchfield_watermark_txt'] = "Suche";
 ?>
diff --git a/interface/lib/lang/en.lng b/interface/lib/lang/en.lng
index bdd5d67..4673a70 100644
--- a/interface/lib/lang/en.lng
+++ b/interface/lib/lang/en.lng
@@ -71,4 +71,9 @@
 $wb['datepicker_nextText'] = "Next";
 $wb['datepicker_prevText'] = "Prev";
 $wb['submit_confirmation'] = "Do you really want to perform this action?";
+$wb['globalsearch_resultslimit_of_txt'] = "of";
+$wb['globalsearch_resultslimit_results_txt'] = "results";
+$wb['globalsearch_noresults_text_txt'] = "No results.";
+$wb['globalsearch_noresults_limit_txt'] = "0 results";
+$wb['globalsearch_searchfield_watermark_txt'] = "Search";
 ?>
diff --git a/interface/web/client/form/reseller.tform.php b/interface/web/client/form/reseller.tform.php
index f78e98a..fe38159 100644
--- a/interface/web/client/form/reseller.tform.php
+++ b/interface/web/client/form/reseller.tform.php
@@ -29,6 +29,11 @@
 	Hint:
 	The ID field of the database table is not part of the datafield definition.
 	The ID field must be always auto incement (int or bigint).
+	
+	Search:
+	- searchable = 1 or searchable = 2 include the field in the search
+	- searchable = 1: this field will be the title of the search result
+	- searchable = 2: this field will be included in the description of the search result
 
 
 */
@@ -90,7 +95,8 @@
 			'width'		=> '30',
 			'maxlength'	=> '255',
 			'rows'		=> '',
-			'cols'		=> ''
+			'cols'		=> '',
+			'searchable' => 2
 		),
 		'contact_name' => array (
 			'datatype'	=> 'VARCHAR',
@@ -104,7 +110,8 @@
 			'width'		=> '30',
 			'maxlength'	=> '255',
 			'rows'		=> '',
-			'cols'		=> ''
+			'cols'		=> '',
+			'searchable' => 1
 		),
 		'customer_no' => array (
 			'datatype'	=> 'VARCHAR',
@@ -115,7 +122,8 @@
 			'width'		=> '30',
 			'maxlength'	=> '255',
 			'rows'		=> '',
-			'cols'		=> ''
+			'cols'		=> '',
+			'searchable' => 2
 		),
 		'username' => array (
 			'datatype'	=> 'VARCHAR',
@@ -140,7 +148,8 @@
 			'width'		=> '30',
 			'maxlength'	=> '255',
 			'rows'		=> '',
-			'cols'		=> ''
+			'cols'		=> '',
+			'searchable' => 2
 		),
 		'password' => array (
 			'datatype'	=> 'VARCHAR',
@@ -185,7 +194,8 @@
 			'width'		=> '30',
 			'maxlength'	=> '255',
 			'rows'		=> '',
-			'cols'		=> ''
+			'cols'		=> '',
+			'searchable' => 2
 		),
 		'zip' => array (
 			'datatype'	=> 'VARCHAR',
@@ -196,7 +206,8 @@
 			'width'		=> '10',
 			'maxlength'	=> '255',
 			'rows'		=> '',
-			'cols'		=> ''
+			'cols'		=> '',
+			'searchable' => 2
 		),
 		'city' => array (
 			'datatype'	=> 'VARCHAR',
@@ -207,7 +218,8 @@
 			'width'		=> '30',
 			'maxlength'	=> '255',
 			'rows'		=> '',
-			'cols'		=> ''
+			'cols'		=> '',
+			'searchable' => 2
 		),
 		'state' => array (
 			'datatype'	=> 'VARCHAR',
@@ -218,7 +230,8 @@
 			'width'		=> '30',
 			'maxlength'	=> '255',
 			'rows'		=> '',
-			'cols'		=> ''
+			'cols'		=> '',
+			'searchable' => 2
 		),
 		'country' => array (
 			'datatype'	=> 'VARCHAR',
@@ -241,7 +254,8 @@
 			'width'		=> '30',
 			'maxlength'	=> '255',
 			'rows'		=> '',
-			'cols'		=> ''
+			'cols'		=> '',
+			'searchable' => 2
 		),
 		'mobile' => array (
 			'datatype'	=> 'VARCHAR',
@@ -252,7 +266,8 @@
 			'width'		=> '30',
 			'maxlength'	=> '255',
 			'rows'		=> '',
-			'cols'		=> ''
+			'cols'		=> '',
+			'searchable' => 2
 		),
 		'fax' => array (
 			'datatype'	=> 'VARCHAR',
@@ -263,7 +278,8 @@
 			'width'		=> '30',
 			'maxlength'	=> '255',
 			'rows'		=> '',
-			'cols'		=> ''
+			'cols'		=> '',
+			'searchable' => 2
 		),
 		'email' => array (
 			'datatype'	=> 'VARCHAR',
@@ -274,7 +290,8 @@
 			'width'		=> '30',
 			'maxlength'	=> '255',
 			'rows'		=> '',
-			'cols'		=> ''
+			'cols'		=> '',
+			'searchable' => 2
 		),
 		'internet' => array (
 			'datatype'	=> 'VARCHAR',
@@ -285,7 +302,8 @@
 			'width'		=> '30',
 			'maxlength'	=> '255',
 			'rows'		=> '',
-			'cols'		=> ''
+			'cols'		=> '',
+			'searchable' => 2
 		),
 		'icq' => array (
 			'datatype'	=> 'VARCHAR',
diff --git a/interface/web/dashboard/ajax_get_json.php b/interface/web/dashboard/ajax_get_json.php
index 18cd1e4..817853d 100644
--- a/interface/web/dashboard/ajax_get_json.php
+++ b/interface/web/dashboard/ajax_get_json.php
@@ -46,17 +46,22 @@
 		$authsql = " AND ".$app->tform->getAuthSQL('r');
 		$modules = explode(',', $_SESSION['s']['user']['modules']);
 		
+		$result = array();
+		
 		// clients
-		$result_clients = _search('client', 'client');
+		$result[] = _search('client', 'client', "AND limit_client = 0");
+		
+		// resellers
+		$result[] = _search('client', 'reseller', "AND limit_client != 0");
 		
 		// web sites
-		$result_webs = _search('sites', 'web_domain');
+		$result[] = _search('sites', 'web_domain');
 		
 		// FTP users
-		$result_ftp_users = _search('sites', 'ftp_user');
+		$result[] = _search('sites', 'ftp_user');
 		
 		// shell users
-		$result_shell_users = _search('sites', 'shell_user');
+		$result[] = _search('sites', 'shell_user');
 		
 		// databases
 		/*
@@ -81,42 +86,60 @@
 			}
 		}
 		*/
-		$result_databases = _search('sites', 'database');
+		$result[] = _search('sites', 'database');
 		
 		// email domains
-		$result_email_domains = _search('mail', 'mail_domain');
+		$result[] = _search('mail', 'mail_domain');
+		
+		// email alias domains
+		$result[] = _search('mail', 'mail_aliasdomain', "AND type = 'aliasdomain'");
 		
 		// email mailboxes
-		$result_email_mailboxes = _search('mail', 'mail_user');
+		$result[] = _search('mail', 'mail_user');
+		
+		// email aliases
+		$result[] = _search('mail', 'mail_alias', "AND type = 'alias'");
+		
+		// email forwards
+		$result[] = _search('mail', 'mail_forward', "AND type = 'forward'");
+		
+		// email catchalls
+		$result[] = _search('mail', 'mail_domain_catchall', "AND type = 'catchall'");
+		
+		// email transports
+		$result[] = _search('mail', 'mail_transport');
+		
+		// mailinglists
+		$result[] = _search('mail', 'mail_mailinglist');
+		
+		// getmails
+		$result[] = _search('mail', 'mail_get');
 		
 		// dns zones
-		$result_dns_zones = _search('dns', 'dns_soa');
+		$result[] = _search('dns', 'dns_soa');
 		
 		// secondary dns zones
-		$result_secondary_dns_zones = _search('dns', 'dns_slave');
+		$result[] = _search('dns', 'dns_slave');
 		
 		// virtual machines
-		$result_vms = _search('vm', 'openvz_vm');
+		$result[] = _search('vm', 'openvz_vm');
 		
 		// virtual machines os templates
-		$result_vm_ostemplates = _search('vm', 'openvz_ostemplate');
+		$result[] = _search('vm', 'openvz_ostemplate');
 		
 		// virtual machines vm templates
-		$result_vm_vmtemplates = _search('vm', 'openvz_template');
+		$result[] = _search('vm', 'openvz_template');
 		
 		// virtual machines ip addresses
-		$result_vm_ip_addresses = _search('vm', 'openvz_ip');
+		$result[] = _search('vm', 'openvz_ip');
 
-		$json = $app->functions->json_encode(array($result_clients, $result_webs, $result_ftp_users, $result_shell_users, $result_databases, $result_email_domains, $result_email_mailboxes, $result_dns_zones, $result_secondary_dns_zones, $result_vms, $result_vm_ostemplates, $result_vm_vmtemplates, $result_vm_ip_addresses));
+		$json = $app->functions->json_encode($result);
 	}
 
 //}
 
-function _search($module, $section){
+function _search($module, $section, $additional_sql = ''){
 	global $app, $q, $authsql, $modules;
-	//$q = $app->db->quote($_GET["q"]);
-	//$authsql = " AND ".$app->tform->getAuthSQL('r');
-	//$user_modules = explode(',', $_SESSION['s']['user']['modules']);
 
 	$result_array = array('cheader' => array(), 'cdata' => array());
 	if(in_array($module, $modules)){
@@ -159,10 +182,13 @@
 			// valid SQL query which returns an empty result set
 			$where_clause = '1 = 0';
 		}
+		if($where_clause != '') $where_clause = '('.$where_clause.')';
+		if($additional_sql != '') $where_clause .= ' '.$additional_sql.' ';
 		$order_clause = '';
 		if($order_by != '') $order_clause = ' ORDER BY '.$order_by;
 		
-		$results = $app->db->queryAllRecords("SELECT * FROM ".$db_table." WHERE ".$where_clause.$authsql.$order_clause);
+		$sql = "SELECT * FROM ".$db_table." WHERE ".$where_clause.$authsql.$order_clause." LIMIT 0,10";
+		$results = $app->db->queryAllRecords($sql);
 		
 		if(is_array($results) && !empty($results)){	
 			$lng_file = '../'.$module.'/lib/lang/'.$_SESSION['s']['language'].'_'.$section.'.lng';
diff --git a/interface/web/js/jquery.ispconfigsearch.js b/interface/web/js/jquery.ispconfigsearch.js
index 211dcd7..5ef54d1 100644
--- a/interface/web/js/jquery.ispconfigsearch.js
+++ b/interface/web/js/jquery.ispconfigsearch.js
@@ -36,8 +36,10 @@
 			cssPrefix: 'gs-',
 			fillSearchField: false,
 			fillSearchFieldWith: 'title',
-			resultsText: '$ of % results',
+			resultsLimit: '$ of % results',
 			noResultsText: 'No results.',
+			noResultsLimit: '0 results',
+			searchFieldWatermark: 'Search',
 			displayEmptyCategories: false,
 			runJS: true
 		};
@@ -48,6 +50,7 @@
 		settings.resultBox = $(this).attr('id')+settings.resultBox;
 		
 		$(this).attr('autocomplete', 'off');
+		$(this).val(settings.searchFieldWatermark);
 		$(this).wrap('<div class="'+settings.cssPrefix+'container" />');
 		$(this).after('<ul id="'+settings.resultBox+'" class="'+settings.cssPrefix+'resultbox" style="display:none;"></ul>');
 		var searchField = $(this);
@@ -91,7 +94,7 @@
 								}
 
 								if (!resultsFound){
-									output += '<li class="'+settings.cssPrefix+'cheader"><p class="'+settings.cssPrefix+'cheader-title">'+settings.noResultsText+'</p><p class="'+settings.cssPrefix+'cheader-limit">0 results</p></li>';
+									output += '<li class="'+settings.cssPrefix+'cheader"><p class="'+settings.cssPrefix+'cheader-title">'+settings.noResultsText+'</p><p class="'+settings.cssPrefix+'cheader-limit">'+settings.noResultsLimit+'</p></li>';
 								} else {
 								
 									$.each(data, function(i, category){
@@ -100,7 +103,7 @@
 											var limit = category['cheader']['limit'];
 											var cnt = 0;
 
-											output += '<li class="'+settings.cssPrefix+'cheader"><p class="'+settings.cssPrefix+'cheader-title">'+category['cheader']['title']+'</p><p class="'+settings.cssPrefix+'cheader-limit">'+settings.resultsText.replace("%", category['cheader']['total']).replace("$", (category['cheader']['limit'] < category['cdata'].length ? category['cheader']['limit'] : category['cdata'].length))+'</p></li>';
+											output += '<li class="'+settings.cssPrefix+'cheader"><p class="'+settings.cssPrefix+'cheader-title">'+category['cheader']['title']+'</p><p class="'+settings.cssPrefix+'cheader-limit">'+settings.resultsLimit.replace("%", category['cheader']['total']).replace("$", (category['cheader']['limit'] < category['cdata'].length ? category['cheader']['limit'] : category['cdata'].length))+'</p></li>';
 
 											var fillSearchFieldCode = (settings.fillSearchField) ? 'document.getElementById(\''+searchField.attr('id')+'\').value = \'%\';' : '';
 											//var fillSearchFieldCode = 'document.getElementById(\''+searchField.attr('id')+'\').value = \'%\';';
@@ -137,11 +140,16 @@
 		
 		searchField.blur(function(){
 			resultBox.fadeOut();
+			if (searchField.val() == ''){
+				searchField.val(settings.searchFieldWatermark);
+			}
 		});
 
 		searchField.focus(function(){
 			if (searchField.val() == previousQ && searchField.val() != ''){
 				resultBox.fadeIn();
+			} else if(searchField.val() == settings.searchFieldWatermark){
+				searchField.val('');
 			} else if (searchField.val() != ''){
 				searchField.trigger('keyup');
 			}
diff --git a/interface/web/mail/form/mail_alias.tform.php b/interface/web/mail/form/mail_alias.tform.php
index 6676998..072f622 100644
--- a/interface/web/mail/form/mail_alias.tform.php
+++ b/interface/web/mail/form/mail_alias.tform.php
@@ -29,6 +29,11 @@
 	Hint:
 	The ID field of the database table is not part of the datafield definition.
 	The ID field must be always auto incement (int or bigint).
+	
+	Search:
+	- searchable = 1 or searchable = 2 include the field in the search
+	- searchable = 1: this field will be the title of the search result
+	- searchable = 2: this field will be included in the description of the search result
 
 
 */
@@ -75,7 +80,8 @@
 			'default'	=> '',
 			'value'		=> '',
 			'width'		=> '30',
-			'maxlength'	=> '255'
+			'maxlength'	=> '255',
+			'searchable' => 1
 		),
 		'destination' => array (
 			'datatype'	=> 'VARCHAR',
@@ -89,7 +95,8 @@
 			'validators'	=> array ( 	0 => array (	'type'	=> 'ISEMAIL',
 														'errmsg'=> 'destination_error_isemail'),
 									),
-			'value'		=> ''
+			'value'		=> '',
+			'searchable' => 2
 		),
 		'type' => array (
 			'datatype'	=> 'VARCHAR',
diff --git a/interface/web/mail/form/mail_aliasdomain.tform.php b/interface/web/mail/form/mail_aliasdomain.tform.php
index d194029..754209f 100644
--- a/interface/web/mail/form/mail_aliasdomain.tform.php
+++ b/interface/web/mail/form/mail_aliasdomain.tform.php
@@ -29,6 +29,11 @@
 	Hint:
 	The ID field of the database table is not part of the datafield definition.
 	The ID field must be always auto incement (int or bigint).
+	
+	Search:
+	- searchable = 1 or searchable = 2 include the field in the search
+	- searchable = 1: this field will be the title of the search result
+	- searchable = 2: this field will be included in the description of the search result
 
 
 */
@@ -80,7 +85,8 @@
 			'default'	=> '',
 			'value'		=> '',
 			'width'		=> '30',
-			'maxlength'	=> '255'
+			'maxlength'	=> '255',
+			'searchable' => 1
 		),
 		'destination' => array (
 			'datatype'	=> 'VARCHAR',
@@ -88,7 +94,8 @@
 			'default'	=> '',
 			'value'		=> '',
 			'width'		=> '30',
-			'maxlength'	=> '255'
+			'maxlength'	=> '255',
+			'searchable' => 2
 		),
 		'type' => array (
 			'datatype'	=> 'VARCHAR',
diff --git a/interface/web/mail/form/mail_domain_catchall.tform.php b/interface/web/mail/form/mail_domain_catchall.tform.php
index 5d2b447..b2a40fe 100644
--- a/interface/web/mail/form/mail_domain_catchall.tform.php
+++ b/interface/web/mail/form/mail_domain_catchall.tform.php
@@ -29,6 +29,11 @@
 	Hint:
 	The ID field of the database table is not part of the datafield definition.
 	The ID field must be always auto incement (int or bigint).
+	
+	Search:
+	- searchable = 1 or searchable = 2 include the field in the search
+	- searchable = 1: this field will be the title of the search result
+	- searchable = 2: this field will be included in the description of the search result
 
 
 */
@@ -80,7 +85,8 @@
 			'default'	=> '',
 			'value'		=> '',
 			'width'		=> '30',
-			'maxlength'	=> '255'
+			'maxlength'	=> '255',
+			'searchable' => 1
 		),
 		'destination' => array (
 			'datatype'	=> 'VARCHAR',
@@ -94,7 +100,8 @@
 			'validators'	=> array ( 	0 => array (	'type'	=> 'ISEMAIL',
 														'errmsg'=> 'destination_error_isemail'),
 									),
-			'value'		=> ''
+			'value'		=> '',
+			'searchable' => 2
 		),
 		'type' => array (
 			'datatype'	=> 'VARCHAR',
diff --git a/interface/web/mail/form/mail_forward.tform.php b/interface/web/mail/form/mail_forward.tform.php
index e6fd4d6..b8f2575 100644
--- a/interface/web/mail/form/mail_forward.tform.php
+++ b/interface/web/mail/form/mail_forward.tform.php
@@ -29,6 +29,11 @@
 	Hint:
 	The ID field of the database table is not part of the datafield definition.
 	The ID field must be always auto incement (int or bigint).
+	
+	Search:
+	- searchable = 1 or searchable = 2 include the field in the search
+	- searchable = 1: this field will be the title of the search result
+	- searchable = 2: this field will be included in the description of the search result
 
 
 */
@@ -75,7 +80,8 @@
 			'default'	=> '',
 			'value'		=> '',
 			'width'		=> '30',
-			'maxlength'	=> '255'
+			'maxlength'	=> '255',
+			'searchable' => 1
 		),
 		'destination' => array (
 			'datatype'	=> 'VARCHAR',
@@ -83,7 +89,8 @@
 			'default'	=> '',
 			'value'		=> '',
 			'width'		=> '30',
-			'maxlength'	=> '255'
+			'maxlength'	=> '255',
+			'searchable' => 2
 		),
 		'type' => array (
 			'datatype'	=> 'VARCHAR',
diff --git a/interface/web/mail/form/mail_get.tform.php b/interface/web/mail/form/mail_get.tform.php
index 0d08055..4086eb9 100644
--- a/interface/web/mail/form/mail_get.tform.php
+++ b/interface/web/mail/form/mail_get.tform.php
@@ -29,6 +29,11 @@
 	Hint:
 	The ID field of the database table is not part of the datafield definition.
 	The ID field must be always auto incement (int or bigint).
+	
+	Search:
+	- searchable = 1 or searchable = 2 include the field in the search
+	- searchable = 1: this field will be the title of the search result
+	- searchable = 2: this field will be included in the description of the search result
 
 
 */
@@ -73,7 +78,8 @@
 			'datatype'	=> 'VARCHAR',
 			'formtype'	=> 'SELECT',
 			'default'	=> '',
-			'value' => array('pop3' => 'POP3','imap'=>'IMAP','pop3ssl' => 'POP3SSL','imapssl'=>'IMAPSSL')
+			'value' => array('pop3' => 'POP3','imap'=>'IMAP','pop3ssl' => 'POP3SSL','imapssl'=>'IMAPSSL'),
+			'searchable' => 2
 		),
 		'source_server' => array (
 			'datatype'	=> 'VARCHAR',
@@ -87,7 +93,8 @@
 			'default'	=> '',
 			'value'		=> '',
 			'width'		=> '30',
-			'maxlength'	=> '255'
+			'maxlength'	=> '255',
+			'searchable' => 2
 		),
 		'source_username' => array (
 			'datatype'	=> 'VARCHAR',
@@ -98,7 +105,8 @@
 			'default'	=> '',
 			'value'		=> '',
 			'width'		=> '30',
-			'maxlength'	=> '255'
+			'maxlength'	=> '255',
+			'searchable' => 2
 		),
 		'source_password' => array (
 			'datatype'	=> 'VARCHAR',
@@ -135,7 +143,8 @@
 			'validators'	=> array ( 	0 => array (	'type'	=> 'ISEMAIL',
 														'errmsg'=> 'destination_error_isemail'),
 									),
-			'value'		=> ''
+			'value'		=> '',
+			'searchable' => 1
 		),
 		'active' => array (
 			'datatype'	=> 'VARCHAR',
diff --git a/interface/web/mail/form/mail_mailinglist.tform.php b/interface/web/mail/form/mail_mailinglist.tform.php
index b0e390b..93bd8c2 100644
--- a/interface/web/mail/form/mail_mailinglist.tform.php
+++ b/interface/web/mail/form/mail_mailinglist.tform.php
@@ -29,6 +29,11 @@
 	Hint:
 	The ID field of the database table is not part of the datafield definition.
 	The ID field must be always auto incement (int or bigint).
+	
+	Search:
+	- searchable = 1 or searchable = 2 include the field in the search
+	- searchable = 1: this field will be the title of the search result
+	- searchable = 2: this field will be included in the description of the search result
 
 
 */
@@ -81,7 +86,8 @@
 			'default'	=> '',
 			'value'		=> '',
 			'width'		=> '30',
-			'maxlength'	=> '255'
+			'maxlength'	=> '255',
+			'searchable' => 2
 		),
 		'listname' => array (
 			'datatype'	=> 'VARCHAR',
@@ -92,7 +98,8 @@
 			'default'	=> '',
 			'value'		=> '',
 			'width'		=> '30',
-			'maxlength'	=> '255'
+			'maxlength'	=> '255',
+			'searchable' => 1
 		),
 		'email' => array (
 			'datatype'	=> 'VARCHAR',
@@ -103,7 +110,8 @@
 			'default'	=> '',
 			'value'		=> '',
 			'width'		=> '30',
-			'maxlength'	=> '255'
+			'maxlength'	=> '255',
+			'searchable' => 2
 		),
 		'password' => array (
 			'datatype'	=> 'VARCHAR',
diff --git a/interface/web/mail/form/mail_transport.tform.php b/interface/web/mail/form/mail_transport.tform.php
index 3734e04..d7935a6 100644
--- a/interface/web/mail/form/mail_transport.tform.php
+++ b/interface/web/mail/form/mail_transport.tform.php
@@ -29,6 +29,11 @@
 	Hint:
 	The ID field of the database table is not part of the datafield definition.
 	The ID field must be always auto incement (int or bigint).
+	
+	Search:
+	- searchable = 1 or searchable = 2 include the field in the search
+	- searchable = 1: this field will be the title of the search result
+	- searchable = 2: this field will be included in the description of the search result
 
 
 */
@@ -75,7 +80,8 @@
 			'default'	=> '',
 			'value'		=> '',
 			'width'		=> '30',
-			'maxlength'	=> '255'
+			'maxlength'	=> '255',
+			'searchable' => 1
 		),
 		'transport' => array (
 			'datatype'	=> 'VARCHAR',
@@ -83,7 +89,8 @@
 			'default'	=> '',
 			'value'		=> '',
 			'width'		=> '30',
-			'maxlength'	=> '255'
+			'maxlength'	=> '255',
+			'searchable' => 2
 		),
 		'sort_order' => array (
 			'datatype'	=> 'INTEGER',
diff --git a/interface/web/mail/lib/lang/de_mail_alias.lng b/interface/web/mail/lib/lang/de_mail_alias.lng
index 45a564a..2eb21de 100644
--- a/interface/web/mail/lib/lang/de_mail_alias.lng
+++ b/interface/web/mail/lib/lang/de_mail_alias.lng
@@ -10,4 +10,5 @@
 $wb['duplicate_mailbox_txt'] = 'Es existiert bereits eine Mailbox mit dieser E-Mail-Adresse.';
 $wb['domain_txt'] = 'Domain';
 $wb['duplicate_email_alias_txt'] = 'Dieser E-Mail-Alias existiert bereits.';
+$wb["source_txt"] = 'Alias';
 ?>
diff --git a/interface/web/mail/lib/lang/de_mail_domain_catchall.lng b/interface/web/mail/lib/lang/de_mail_domain_catchall.lng
index 3a4e74e..f2b397e 100644
--- a/interface/web/mail/lib/lang/de_mail_domain_catchall.lng
+++ b/interface/web/mail/lib/lang/de_mail_domain_catchall.lng
@@ -6,4 +6,5 @@
 $wb['no_domain_perm'] = 'Sie haben keine Berechtigung für diese Domain.';
 $wb['domain_error_regex'] = 'Ungültiger Domainname oder ungültige Zeichen im Domainnamen.';
 $wb['limit_mailcatchall_txt'] = 'Die maximale Anzahl an Catchall Einträgen für ihr Konto wurde erreicht.';
+$wb["source_txt"] = 'Quelle';
 ?>
diff --git a/interface/web/mail/lib/lang/de_mail_forward.lng b/interface/web/mail/lib/lang/de_mail_forward.lng
index 3a6415c..05d94a6 100644
--- a/interface/web/mail/lib/lang/de_mail_forward.lng
+++ b/interface/web/mail/lib/lang/de_mail_forward.lng
@@ -1,8 +1,9 @@
 <?php
 $wb['email_txt'] = 'E-Mail-Adresse';
-$wb['destination_txt'] = 'Ziel E-Mail-Adresse';
+$wb['destination_txt'] = 'Ziel-E-Mail-Adresse';
 $wb['active_txt'] = 'Aktiv';
 $wb['limit_mailforward_txt'] = 'Die maximale Anzahl an E-Mail-Weiterleitungen für ihr Konto wurde erreicht.';
 $wb['duplicate_mailbox_txt'] = 'Es existiert bereits eine Mailbox mit dieser Adresse.';
 $wb['domain_txt'] = 'Domain';
+$wb["source_txt"] = 'Quell-E-Mail-Adresse';
 ?>
diff --git a/interface/web/mail/lib/lang/de_mail_transport.lng b/interface/web/mail/lib/lang/de_mail_transport.lng
index 16d1e64..918ddcf 100644
--- a/interface/web/mail/lib/lang/de_mail_transport.lng
+++ b/interface/web/mail/lib/lang/de_mail_transport.lng
@@ -7,4 +7,5 @@
 $wb['sort_order_txt'] = 'Sortiert nach';
 $wb['active_txt'] = 'Aktiv';
 $wb['limit_mailrouting_txt'] = 'Die maximale Anzahl an Routen für ihr Konto wurde erreicht.';
+$wb["transport_txt"] = 'Transport';
 ?>
diff --git a/interface/web/mail/lib/lang/en_mail_alias.lng b/interface/web/mail/lib/lang/en_mail_alias.lng
index 02f753c..bcdafb3 100644
--- a/interface/web/mail/lib/lang/en_mail_alias.lng
+++ b/interface/web/mail/lib/lang/en_mail_alias.lng
@@ -10,4 +10,5 @@
 $wb["duplicate_mailbox_txt"] = 'There is already a mailbox with this email address.';
 $wb['domain_txt'] = 'Domain';
 $wb["duplicate_email_alias_txt"] = 'This email alias does already exist.';
+$wb["source_txt"] = 'Alias';
 ?>
diff --git a/interface/web/mail/lib/lang/en_mail_domain_catchall.lng b/interface/web/mail/lib/lang/en_mail_domain_catchall.lng
index 0df663d..c8348a9 100644
--- a/interface/web/mail/lib/lang/en_mail_domain_catchall.lng
+++ b/interface/web/mail/lib/lang/en_mail_domain_catchall.lng
@@ -7,4 +7,5 @@
 $wb["domain_error_regex"] = 'Invalid domain name od domain contains invalid characters.';
 $wb["limit_mailcatchall_txt"] = 'The max. number of email catchall accounts for your account is reached.';
 $wb['domain_txt'] = 'Domain';
+$wb["source_txt"] = 'Source';
 ?>
diff --git a/interface/web/mail/lib/lang/en_mail_forward.lng b/interface/web/mail/lib/lang/en_mail_forward.lng
index d088b6e..4482593 100644
--- a/interface/web/mail/lib/lang/en_mail_forward.lng
+++ b/interface/web/mail/lib/lang/en_mail_forward.lng
@@ -5,4 +5,5 @@
 $wb["limit_mailforward_txt"] = 'The max. number of email forwarders for your account is reached.';
 $wb["duplicate_mailbox_txt"] = 'There is already a mailbox with this email address';
 $wb['domain_txt'] = 'Domain';
+$wb["source_txt"] = 'Source Email';
 ?>
diff --git a/interface/web/mail/lib/lang/en_mail_transport.lng b/interface/web/mail/lib/lang/en_mail_transport.lng
index 152c2eb..0bae85a 100644
--- a/interface/web/mail/lib/lang/en_mail_transport.lng
+++ b/interface/web/mail/lib/lang/en_mail_transport.lng
@@ -7,4 +7,5 @@
 $wb["sort_order_txt"] = 'Sort by';
 $wb["active_txt"] = 'Active';
 $wb["limit_mailrouting_txt"] = 'The max. number of routes for your account is reached.';
+$wb["transport_txt"] = 'Transport';
 ?>
\ No newline at end of file
diff --git a/interface/web/themes/default/templates/main.tpl.htm b/interface/web/themes/default/templates/main.tpl.htm
index b012c06..a8c389b 100644
--- a/interface/web/themes/default/templates/main.tpl.htm
+++ b/interface/web/themes/default/templates/main.tpl.htm
@@ -84,7 +84,11 @@
 			});
 			
 			jQuery('#globalsearch').ispconfigSearch({
-				dataSrc: '/dashboard/ajax_get_json.php?type=globalsearch'
+				dataSrc: '/dashboard/ajax_get_json.php?type=globalsearch',
+				resultsLimit: '$ <tmpl_var name="globalsearch_resultslimit_of_txt"> % <tmpl_var name="globalsearch_resultslimit_results_txt">',
+				noResultsText: '<tmpl_var name="globalsearch_noresults_text_txt">',
+				noResultsLimit: '<tmpl_var name="globalsearch_noresults_limit_txt">',
+				searchFieldWatermark: '<tmpl_var name="globalsearch_searchfield_watermark_txt">'
 			});
 
 		});

--
Gitblit v1.9.1