From fd7b50a9760eea420aa173063ca7e3233899d439 Mon Sep 17 00:00:00 2001
From: tbrehm <t.brehm@ispconfig.org>
Date: Wed, 3 Mar 2010 11:19:28 +0000
Subject: [PATCH] Implemented: FS#1094 - Add a realname field to the mailbox
 settings.

---
 interface/web/mail/form/mail_user.tform.php           |  8 ++++++++
 interface/web/mail/lib/lang/en_mail_user.lng          |  2 ++
 interface/web/mail/lib/lang/en_mail_user_list.lng     | 11 ++++++-----
 interface/web/mail/list/mail_user.list.php            |  9 +++++++++
 interface/web/mail/templates/mail_user_list.htm       |  7 +++++--
 .../web/mail/templates/mail_user_mailbox_edit.htm     |  4 ++++
 6 files changed, 34 insertions(+), 7 deletions(-)

diff --git a/interface/web/mail/form/mail_user.tform.php b/interface/web/mail/form/mail_user.tform.php
index 920d834722..5214b62090 100644
--- a/interface/web/mail/form/mail_user.tform.php
+++ b/interface/web/mail/form/mail_user.tform.php
@@ -88,6 +88,14 @@ $form["tabs"]['mailuser'] = array (
 			'width'		=> '30',
 			'maxlength'	=> '255'
 		),
+		'name' => array (
+			'datatype'	=> 'VARCHAR',
+			'formtype'	=> 'TEXT',
+			'default'	=> '',
+			'value'		=> '',
+			'width'		=> '30',
+			'maxlength'	=> '255'
+		),
 		'quota' => array (
 			'datatype'	=> 'INTEGER',
 			'formtype'	=> 'TEXT',
diff --git a/interface/web/mail/lib/lang/en_mail_user.lng b/interface/web/mail/lib/lang/en_mail_user.lng
index 6690819d3a..7414208507 100644
--- a/interface/web/mail/lib/lang/en_mail_user.lng
+++ b/interface/web/mail/lib/lang/en_mail_user.lng
@@ -34,4 +34,6 @@ $wb["disablepop3_txt"] = 'Disable POP3';
 $wb["duplicate_alias_or_forward_txt"] = 'There is already an alias or forwrd with this email address.';
 $wb["quota_error_value"] = 'Invalid quota value. Allowed values are: 0 for unlimited or numbers > 1';
 $wb["move_junk_txt"] = 'Move Spam Emails to Junk directory';
+$wb["name_txt"] = 'Realname';
+$wb["name_optional_txt"] = '(Optional)';
 ?>
diff --git a/interface/web/mail/lib/lang/en_mail_user_list.lng b/interface/web/mail/lib/lang/en_mail_user_list.lng
index 4bd4b2ac48..70497def66 100644
--- a/interface/web/mail/lib/lang/en_mail_user_list.lng
+++ b/interface/web/mail/lib/lang/en_mail_user_list.lng
@@ -1,6 +1,7 @@
-<?php
-$wb["list_head_txt"] = 'Mailbox';
-$wb["email_txt"] = 'Email';
-$wb["autoresponder_txt"] = 'Autoresponder';
-$wb["add_new_record_txt"] = 'Add new Mailbox';
+<?php
+$wb["list_head_txt"] = 'Mailbox';
+$wb["email_txt"] = 'Email';
+$wb["autoresponder_txt"] = 'Autoresponder';
+$wb["add_new_record_txt"] = 'Add new Mailbox';
+$wb["name_txt"] = 'Realname';
 ?>
\ No newline at end of file
diff --git a/interface/web/mail/list/mail_user.list.php b/interface/web/mail/list/mail_user.list.php
index 27249e0393..f3e8c42384 100644
--- a/interface/web/mail/list/mail_user.list.php
+++ b/interface/web/mail/list/mail_user.list.php
@@ -56,6 +56,15 @@ $liste["item"][] = array(	'field'		=> "email",
 							'width'		=> "",
 							'value'		=> "");
 
+$liste["item"][] = array(	'field'		=> "name",
+							'datatype'	=> "VARCHAR",
+							'formtype'	=> "TEXT",
+							'op'		=> "like",
+							'prefix'	=> "%",
+							'suffix'	=> "%",
+							'width'		=> "",
+							'value'		=> "");
+
 $liste["item"][] = array(	'field'		=> "autoresponder",
 							'datatype'	=> "VARCHAR",
 							'formtype'	=> "TEXT",
diff --git a/interface/web/mail/templates/mail_user_list.htm b/interface/web/mail/templates/mail_user_list.htm
index fc0440690c..fe3838b228 100644
--- a/interface/web/mail/templates/mail_user_list.htm
+++ b/interface/web/mail/templates/mail_user_list.htm
@@ -19,11 +19,13 @@
         <thead>
           <tr>
             <th class="tbl_col_email" scope="col"><tmpl_var name="email_txt"></th>
+			<th class="tbl_col_name" scope="col"><tmpl_var name="name_txt"></th>
             <th class="tbl_col_autoresponder" scope="col"><tmpl_var name="autoresponder_txt"></th>
             <th class="tbl_col_buttons" scope="col">&nbsp;</th>
           </tr>
           <tr>
             <td class="tbl_col_email"><input type="text" name="search_email" value="{tmpl_var name='search_email'}" /></td>
+			<td class="tbl_col_name"><input type="text" name="search_name" value="{tmpl_var name='search_name'}" /></td>
             <td class="tbl_col_autoresponder"><input type="text" name="search_autoresponder" value="{tmpl_var name='search_autoresponder'}" /></td>
             <td class="tbl_col_buttons"><div class="buttons"><button type="button" class="icons16 icoFilter" name="Filter" id="Filter" value="{tmpl_var name="filter_txt"}" onClick="submitForm('pageForm','mail/mail_user_list.php');"><span>{tmpl_var name="filter_txt"}</span></button></div></td>
           </tr>
@@ -32,7 +34,8 @@
           <tmpl_loop name="records">
           <tr class="tbl_row_<tmpl_if name='__EVEN__'}even<tmpl_else>uneven</tmpl_if>">
             <td class="tbl_col_email"><a href="#" onClick="loadContent('mail/mail_user_edit.php?id={tmpl_var name='id'}');">{tmpl_var name="email"}</a></td>
-            <td class="tbl_col_autoresponder"><a href="#" onClick="loadContent('mail/mail_user_edit.php?id={tmpl_var name='id'}');">{tmpl_var name="autoresponder"}</a></td>
+            <td class="tbl_col_name"><a href="#" onClick="loadContent('mail/mail_user_edit.php?id={tmpl_var name='id'}');">{tmpl_var name="name"}</a></td>
+			<td class="tbl_col_autoresponder"><a href="#" onClick="loadContent('mail/mail_user_edit.php?id={tmpl_var name='id'}');">{tmpl_var name="autoresponder"}</a></td>
             <td class="tbl_col_buttons">
               <div class="buttons icons16">    
                 <tmpl_if name="mailboxlist_webmail_link"><a class="icons16 icoWebmailer" href="mail/webmailer.php?id={tmpl_var name='id'}" target="webmail"><span>{tmpl_var name='delete_txt'}</span></a></tmpl_if>
@@ -45,7 +48,7 @@
 
         <tfoot>
           <tr>
-            <td class="tbl_footer tbl_paging" colspan="3"><tmpl_var name="paging"></td>
+            <td class="tbl_footer tbl_paging" colspan="4"><tmpl_var name="paging"></td>
           </tr>
         </tfoot>
       </table>
diff --git a/interface/web/mail/templates/mail_user_mailbox_edit.htm b/interface/web/mail/templates/mail_user_mailbox_edit.htm
index b6279cefde..708ff8a9e7 100644
--- a/interface/web/mail/templates/mail_user_mailbox_edit.htm
+++ b/interface/web/mail/templates/mail_user_mailbox_edit.htm
@@ -5,6 +5,10 @@
 
   <div class="pnl_formsarea">
     <fieldset class="inlineLabels">
+	  <div class="ctrlHolder">
+      	<label for="name">{tmpl_var name='name_txt'}</label>
+        <input name="name" id="name" value="{tmpl_var name='name'}" size="30" maxlength="255" type="text" class="textInput" /> &nbsp; {tmpl_var name='name_optional_txt'}
+			</div>
       <div class="ctrlHolder">
         <p class="label"><em>*</em> {tmpl_var name='email_txt'}</p>
         <div class="multiField">
-- 
GitLab