[Vtigercrm-commits] [vtiger-commits] r4129 - in /vtigercrm/trunk/modules/Settings: AddMailAccount.html AddMailAccount.php SaveMailAccount.php

vtigercrm-commits at vtiger.fosslabs.com vtigercrm-commits at vtiger.fosslabs.com
Fri Mar 10 17:32:42 EST 2006


Author: mmbrich
Date: Fri Mar 10 15:32:40 2006
New Revision: 4129

Log:
added new email options to the settings page.


Modified:
    vtigercrm/trunk/modules/Settings/AddMailAccount.html
    vtigercrm/trunk/modules/Settings/AddMailAccount.php
    vtigercrm/trunk/modules/Settings/SaveMailAccount.php

Modified: vtigercrm/trunk/modules/Settings/AddMailAccount.html
==============================================================================
--- vtigercrm/trunk/modules/Settings/AddMailAccount.html (original)
+++ vtigercrm/trunk/modules/Settings/AddMailAccount.html Fri Mar 10 15:32:40 2006
@@ -60,7 +60,29 @@
 	<tr><td colspan="2" class="formSecHeader">{MOD.LBL_MAIL_SERVER_INFO}</td></tr>
   <tr> 
     <td width="30%" nowrap class="dataLabel">{MOD.LBL_MAIL_PROTOCOL}:</td>
-    <td align="left"> <input class="dataInput" type="radio" name="mailprotocol" value="POP" {POP_SELECT} {POP}/>&nbsp;{MOD.LBL_POP}<input class="dataInput" type="radio" name="mailprotocol" value="IMAP" {IMAP}/>&nbsp;{MOD.LBL_IMAP} 
+	<td><input class="dataInput" type="radio" name="mailprotocol" value="imap" {IMAP}/>&nbsp;{MOD.LBL_IMAP} 
+	<input class="dataInput" type="radio" name="mailprotocol" value="pop3" {POP3}/>&nbsp;{MOD.LBL_POP} 
+	<input class="dataInput" type="radio" name="mailprotocol" value="imap2" {IMAP2}/>&nbsp;IMAP2
+	<input class="dataInput" type="radio" name="mailprotocol" value="IMAP4" {IMAP4}/>&nbsp;IMAP4
+	<input class="dataInput" type="radio" name="mailprotocol" value="imap4rev1" {IMAP4R1}/>&nbsp;IMAP4-rev1
+    </td>
+  </tr>
+  <tr>
+    <td nowrap class="dataLabel"> SSL Options:</td>
+	<td><input class="dataInput" type="radio" name="ssltype" value="notls" {NOTLS} />&nbsp;No TLS
+	<input class="dataInput" type="radio" name="ssltype" value="tls" {TLS} />&nbsp; TLS
+    </td>
+  </tr>
+  <tr>
+    	<td nowrap class="dataLabel">Certificate Validations</td>
+	<td><input class="dataInput" type="radio" name="sslmeth" value="validate-cert" {VALIDATECERT} />&nbsp;Validate SSL Cert
+	<input class="dataInput" type="radio" name="sslmeth" value="novalidate-cert" {NOVALIDATECERT} />&nbsp;Don't Validate SSL Cert
+    </td>
+  </tr>
+  <tr>
+    	<td nowrap class="dataLabel">Show Body in "Quick View"</td>
+	<td><input class="dataInput" type="radio" name="showbody" value="yes" {SHOWBODY} />&nbsp;Yes (slower and marks all emails as "Seen")
+	<input class="dataInput" type="radio" name="showbody" value="no" {NOSHOWBODY} />&nbsp;No
     </td>
   </tr>
   <tr>
@@ -78,22 +100,40 @@
     <td align="left"><input class="dataInput" name="mail_servername" value="{SERVERNAME}" size="30" /> 
     </td>
   </tr>
-
 </table>
 </td>
 </tr>
 </table>
 <br>
-<!--table width="50%" border="0" cellspacing="0" cellpadding="0">
+<table width="100%" border="0" cellspacing="0" cellpadding="0" class="formOuterBorder">
 <tr><td>
 <table width="100%" cellpadding="0" cellspacing="1" border="0">
   <tbody> 
-	<tr><td><input type="checkbox" name="accounttest">&nbsp;&nbsp;{MOD.LBL_TEST_SETTINGS}</td>
-	</tr>
- </table>
- </td>
+	<tr><td colspan="2" class="formSecHeader">Mail Preferences</td></tr>
+  <tr> 
+    <td width="30%" nowrap class="dataLabel">Refresh Timeout:</td>
+	<td>
+		<select name="box_refresh">
+			<option value="60000">1 minute
+			<option value="120000">2 minutes
+			<option value="240000">3 minutes
+			<option value="360000">4 minutes
+			<option value="480000">5 minutes
+		</select>
+	</td>
+  </tr>
+  <tr>
+    <td nowrap class="dataLabel"><FONT class="required">{APP.LBL_REQUIRED_SYMBOL}</FONT> Emails per page:</td>
+    <td align="left"><input class="dataInput" name="mails_per_page" value="{MAILS_PER_PAGE}" size="10" /> 
+    </td>
+  </tr>
+    </td>
+  </tr>
+</table>
+</td>
 </tr>
-</table-->
+</table>
+<br>
 <br>
 <table width="65%" cellpadding="0" cellspacing="0" border="0" align="center"><tbody>
 	<tr>
@@ -104,7 +144,7 @@
 	</form>
 </table>
 {JAVASCRIPT}
-<a href=index.php?module=Settings&action=ListMailAccount>{MOD.LBL_LIST_MAIL_ACCOUNT}</a>
+<!-- <a href=index.php?module=Settings&action=ListMailAccount>{MOD.LBL_LIST_MAIL_ACCOUNT}</a> -->
 
 <!-- END: main -->
 

Modified: vtigercrm/trunk/modules/Settings/AddMailAccount.php
==============================================================================
--- vtigercrm/trunk/modules/Settings/AddMailAccount.php (original)
+++ vtigercrm/trunk/modules/Settings/AddMailAccount.php Fri Mar 10 15:32:40 2006
@@ -29,7 +29,6 @@
 $xtpl=new XTemplate ('modules/Settings/AddMailAccount.html');
 $xtpl->assign("MOD", $mod_strings);
 $xtpl->assign("APP", $app_strings);
-$xtpl->assign("POP_SELECT", "CHECKED");
 
 if(isset($_REQUEST['record']) && $_REQUEST['record']!='')
 {
@@ -48,29 +47,42 @@
 			$xtpl->assign("SERVERPASSWORD", $temprow['mail_password']);
 			$xtpl->assign("SERVERNAME", $temprow['mail_servername']);
 			$xtpl->assign("RECORD_ID", $temprow['account_id']);
+			$xtpl->assign("BOX_REFRESH", $temprow['box_refresh']);
+			$xtpl->assign("MAILS_PER_PAGE", $temprow['mails_per_page']);
 			$xtpl->assign("EDIT", "TRUE");
+
+			if(strtolower($temprow['mail_protocol']) == "imap")
+				$xtpl->assign("IMAP", "CHECKED");
+			if(strtolower($temprow['mail_protocol']) == "imap2")
+				$xtpl->assign("IMAP2", "CHECKED");
+			if(strtolower($temprow['mail_protocol']) == "imap4")
+				$xtpl->assign("IMAP4", "CHECKED");
+			if(strtolower($temprow['mail_protocol']) == "imap4rev1")
+				$xtpl->assign("IMAP4R1", "CHECKED");
+			if(strtolower($temprow['mail_protocol']) == "pop3")
+				$xtpl->assign("POP3", "CHECKED");
+
+			if(strtolower($temprow['ssltype']) == "notls")
+				$xtpl->assign("NOTLS", "CHECKED");
+			if(strtolower($temprow['ssltype']) == "tls")
+				$xtpl->assign("TLS", "CHECKED");
+
+			if(strtolower($temprow['sslmeth']) == "validate-cert")
+				$xtpl->assign("VALIDATECERT", "CHECKED");
+			if(strtolower($temprow['sslmeth']) == "novalidate-cert")
+				$xtpl->assign("NOVALIDATECERT", "CHECKED");
+
+			if(strtolower($temprow['showbody']) == "yes")
+				$xtpl->assign("SHOWBODY", "CHECKED");
+			if(strtolower($temprow['showbody']) == "no")
+				$xtpl->assign("NOSHOWBODY", "CHECKED");
 		}
 	}
 }	
 
-/*$sql="select * from systems where server_type = 'email'";
-$result = $adb->query($sql);
-$mail_server = $adb->query_result($result,0,'server');
-$mail_server_username = $adb->query_result($result,0,'server_username');
-$mail_server_password = $adb->query_result($result,0,'server_password');
-*/
-
 $xtpl->assign("RETURN_MODULE","Settings");
 $xtpl->assign("RETURN_ACTION","index");
 $xtpl->assign("JAVASCRIPT", get_validate_record_js());
-/*if (isset($mail_server))
-	$xtpl->assign("MAILSERVER",$mail_server);
-if (isset($mail_server_username))
-	$xtpl->assign("USERNAME",$mail_server_username);
-if (isset($mail_server_password))
-	$xtpl->assign("PASSWORD",$mail_server_password);
-*/
 $xtpl->parse("main");
 $xtpl->out("main");
-
 ?>

Modified: vtigercrm/trunk/modules/Settings/SaveMailAccount.php
==============================================================================
--- vtigercrm/trunk/modules/Settings/SaveMailAccount.php (original)
+++ vtigercrm/trunk/modules/Settings/SaveMailAccount.php Fri Mar 10 15:32:40 2006
@@ -19,6 +19,11 @@
 $server_username = $_REQUEST['server_username'];
 $server_password = $_REQUEST['server_password'];
 $mail_servername = $_REQUEST['mail_servername'];
+$box_refresh = $_REQUEST['box_refresh'];
+$mails_per_page = $_REQUEST['mails_per_page'];
+$ssltype = $_REQUEST["ssltype"];
+$sslmeth = $_REQUEST["sslmeth"];
+$showbody = $_REQUEST["showbody"];
 
 if(isset($_REQUEST['record']) && $_REQUEST['record']!='')
 {
@@ -29,12 +34,12 @@
 
 if(isset($_REQUEST['edit']) && $_REQUEST['edit'] && $_REQUEST['record']!='')
 {
-	$sql="update mail_accounts set display_name = '".$displayname."', mail_id = '".$email."', account_name = '".$account_name."', mail_protocol = '".$mailprotocol."', mail_username = '".$server_username."', mail_password='".$server_password."', mail_servername='".$mail_servername."' where account_id = ".$id;
+	$sql="update mail_accounts set display_name = '".$displayname."', mail_id = '".$email."', account_name = '".$account_name."', mail_protocol = '".$mailprotocol."', mail_username = '".$server_username."', mail_password='".$server_password."', mail_servername='".$mail_servername."',  box_refresh='".$box_refresh."',  mails_per_page='".$mails_per_page."', ssltype='".$ssltype."' , sslmeth='".$sslmeth."', showbody='".$showbody."' where account_id = '".$id."'";
 }
 else
 {
 	$account_id = $adb->getUniqueID("mail_accounts");
-	$sql="insert into mail_accounts values(" .$account_id .",'".$current_user->id."','".$displayname."','".$email."','".$account_name."','".$mailprotocol."','".$server_username."','".$server_password."','".$mail_servername."',1,0)";
+	$sql="insert into mail_accounts values(" .$account_id .",'".$current_user->id."','".$displayname."','".$email."','".$account_name."','".$mailprotocol."','".$server_username."','".$server_password."','".$mail_servername."',1,0,'".$box_refresh."','".$mails_per_page."', '".$ssltype."', '".$sslmeth."', '".$showbody."')";
 }
 
 $adb->query($sql);





More information about the vtigercrm-commits mailing list