[Vtigercrm-commits] [vtiger-commits] r4828 - in /vtigercrm/trunk/modules: Settings/ Settings/language/ Users/

vtigercrm-commits at vtiger.fosslabs.com vtigercrm-commits at vtiger.fosslabs.com
Mon Apr 3 07:52:34 EDT 2006


Author: don
Date: Mon Apr  3 05:52:19 2006
New Revision: 4828

Log:
new UI integrated for settings

Modified:
    vtigercrm/trunk/modules/Settings/BackupServerConfig.php
    vtigercrm/trunk/modules/Settings/EditCompanyDetails.php
    vtigercrm/trunk/modules/Settings/EmailConfig.php
    vtigercrm/trunk/modules/Settings/OrganizationConfig.php
    vtigercrm/trunk/modules/Settings/Save.php
    vtigercrm/trunk/modules/Settings/add2db.php
    vtigercrm/trunk/modules/Settings/language/en_us.lang.php
    vtigercrm/trunk/modules/Users/Announcements.php
    vtigercrm/trunk/modules/Users/OrganizationTermsandConditions.php
    vtigercrm/trunk/modules/Users/UsersAjax.php

Modified: vtigercrm/trunk/modules/Settings/BackupServerConfig.php
==============================================================================
Binary files - no diff available.

Modified: vtigercrm/trunk/modules/Settings/EditCompanyDetails.php
==============================================================================
--- vtigercrm/trunk/modules/Settings/EditCompanyDetails.php (original)
+++ vtigercrm/trunk/modules/Settings/EditCompanyDetails.php Mon Apr  3 05:52:19 2006
@@ -9,37 +9,40 @@
 *
  ********************************************************************************/
 
-require_once('XTemplate/xtpl.php');
+require_once('Smarty_setup.php');
 global $mod_strings;
 global $app_strings;
 global $app_list_strings;
 
-$filetype=$_REQUEST['file_type'];
-$filesize=$_REQUEST['file_size'];
-$logo_value=$_REQUEST['logo_value'];
-
-echo get_module_title($mod_strings['LBL_MODULE_NAME'], $mod_strings['LBL_SETTINGS'].' : '. $mod_strings['LBL_COMPANY_INFO'], true);
-echo '<br><br>';
+$smarty = new vtigerCRM_Smarty;
 //error handling
-$flag = $_REQUEST['flag'];
-if($flag ==1)echo "<font color='red'><B> Logo has to be an Image of type jpeg/png</B></font>"; 
-	
-if($flag == 3)echo "<B><font color='red'>Sorry, the uploaded file exceeds the maximum filesize limit. Please try a file smaller than 800000 bytes</font></B> <br>";
-
-if($flag == 4 )echo "<b>Problems in file upload. Please try again! </b><br>";
-
-if($flag == 2)echo "<font color='red'><B>Error Message<ul><li><font color='red'>Invalid file OR</font><li><font color='red'>File has no data</font></ul></B></font> <br>";
-
+if(isset($_REQUEST['flag']) && $_REQUEST['flag'] != '')
+{
+	$flag = $_REQUEST['flag'];
+	switch($flag)
+	{
+		case 1:
+			$smarty->assign("ERRORFLAG","<font color='red'><B> Logo has to be an Image of type jpeg/png</B></font>");
+			break;
+		case 2:
+			$smarty->assign("ERRORFLAG","<font color='red'><B>Error Message<ul><li><font color='red'>Invalid file OR</font><li><font color='red'>File has no data</font></ul></B></font>");
+			break;
+		case 3:
+			$smarty->assign("ERRORFLAG","<B><font color='red'>Sorry, the uploaded file exceeds the maximum filesize limit. Please try a file smaller than 800000 bytes</font></B>");
+			break;
+		case 4:
+			$smarty->assign("ERRORFLAG","<b>Problems in file upload. Please try again! </b><br>");
+			break;
+		default:
+			$smarty->assign("ERRORFLAG","");
+		
+	}
+}
 global $adb;
 global $theme;
 $theme_path="themes/".$theme."/";
 $image_path=$theme_path."images/";
 require_once($theme_path.'layout_utils.php');
-
-$xtpl=new XTemplate ('modules/Settings/EditCompanyDetails.html');
-//$xtpl=new XTemplate ('modules/Settings/add2db');
-$xtpl->assign("MOD", $mod_strings);
-$xtpl->assign("APP", $app_strings);
 
 $sql="select * from organizationdetails";
 $result = $adb->query($sql);
@@ -55,40 +58,33 @@
 $organization_logoname = $adb->query_result($result,0,'logoname');
 
 
-$xtpl->assign("RETURN_MODULE","Settings");
-$xtpl->assign("RETURN_ACTION","index");
-
-$xtpl->assign("FILE_NAME",$filename);
-$xtpl->assign("FILE_TYPE",$filetype);
-$xtpl->assign("FILE_SIZE",$filesize);
-$xtpl->assign("LOGO_VALUE",$logo_value);
-
 if (isset($organization_name))
-	$xtpl->assign("ORGANIZATIONNAME",$organization_name);
+	$smarty->assign("ORGANIZATIONNAME",$organization_name);
 if (isset($organization_address))
-	$xtpl->assign("ORGANIZATIONADDRESS",$organization_address);
+	$smarty->assign("ORGANIZATIONADDRESS",$organization_address);
 if (isset($organization_city))
-	$xtpl->assign("ORGANIZATIONCITY",$organization_city);
+	$smarty->assign("ORGANIZATIONCITY",$organization_city);
 if (isset($organization_state))
-	$xtpl->assign("ORGANIZATIONSTATE",$organization_state);
+	$smarty->assign("ORGANIZATIONSTATE",$organization_state);
 if (isset($organization_code))
-	$xtpl->assign("ORGANIZATIONCODE",$organization_code);
+	$smarty->assign("ORGANIZATIONCODE",$organization_code);
 if (isset($organization_country))
-	$xtpl->assign("ORGANIZATIONCOUNTRY",$organization_country);
+	$smarty->assign("ORGANIZATIONCOUNTRY",$organization_country);
 if (isset($organization_phone))
-	$xtpl->assign("ORGANIZATIONPHONE",$organization_phone);
+	$smarty->assign("ORGANIZATIONPHONE",$organization_phone);
 if (isset($organization_fax))
-	$xtpl->assign("ORGANIZATIONFAX",$organization_fax);
+	$smarty->assign("ORGANIZATIONFAX",$organization_fax);
 if (isset($organization_website))
-	$xtpl->assign("ORGANIZATIONWEBSITE",$organization_website);
+	$smarty->assign("ORGANIZATIONWEBSITE",$organization_website);
 if ($organization_logoname == '') 
 	$organization_logoname = $_REQUEST['prev_name'];
 if (isset($organization_logoname)) 
-	$xtpl->assign("ORGANIZATIONLOGONAME",$organization_logoname);
+	$smarty->assign("ORGANIZATIONLOGONAME",$organization_logoname);
 
 
-$xtpl->parse("main");
-$xtpl->out("main");
-
-
+$smarty->assign("MOD", return_module_language($current_language,'Settings'));
+$smarty->assign("IMAGE_PATH",$image_path);
+$smarty->assign("APP", $app_strings);
+$smarty->assign("CMOD", $mod_strings);
+$smarty->display('Settings/EditCompanyInfo.tpl');
 ?>

Modified: vtigercrm/trunk/modules/Settings/EmailConfig.php
==============================================================================
Binary files - no diff available.

Modified: vtigercrm/trunk/modules/Settings/OrganizationConfig.php
==============================================================================
--- vtigercrm/trunk/modules/Settings/OrganizationConfig.php (original)
+++ vtigercrm/trunk/modules/Settings/OrganizationConfig.php Mon Apr  3 05:52:19 2006
@@ -10,28 +10,30 @@
 ********************************************************************************/
 
 	
-require_once('XTemplate/xtpl.php');
+require_once('Smarty_setup.php');
+
 global $mod_strings;
 global $app_strings;
 global $app_list_strings;
-
-
-echo get_module_title($mod_strings['LBL_MODULE_NAME'], $mod_strings['LBL_SETTINGS'].' : '. $mod_strings['LBL_COMPANY_INFO'], true);
-echo '<br><br>';
 global $adb;
 global $theme;
 $theme_path="themes/".$theme."/";
 $image_path=$theme_path."images/";
 require_once($theme_path.'layout_utils.php');
 
-$xtpl=new XTemplate('modules/Settings/OrganizationConfig.html');
-$xtpl->assign("MOD", $mod_strings);
-$xtpl->assign("APP", $app_strings);
+global $mod_strings;
+global $app_strings;
+global $app_list_strings;
 
 
-	 $xtpl->assign("EDITCOMPANYDETAILS","<td align=center><input title=\"$app_strings[LBL_EDIT_BUTTON_TITLE]\" accessKey=\"$app_strings[LBL_EDIT_BUTTON_KEY]\" class=\"button\" onclick=\"this.form.action.value='EditCompanyDetails'\" type=\"submit\" name=\"Edit\" value=\"$app_strings[LBL_EDIT_BUTTON_LABEL]\">");
-	 
-	 $xtpl->assign("CANCELCOMPANYDETAILS","<input title=\"$app_strings[LBL_CANCEL_BUTTON_TITLE]\" accessKey=\"$app_strings[LBL_CANCEL_BUTTON_KEY]\" class=\"button\"; onclick=\"this.form.action.value='index'\" type=\"submit\" name=\"Cancel\" value=\"$app_strings[LBL_CANCEL_BUTTON_LABEL]\"></td>");
+global $adb;
+global $theme;
+$theme_path="themes/".$theme."/";
+$image_path=$theme_path."images/";
+require_once($theme_path.'layout_utils.php');
+
+
+$smarty = new vtigerCRM_Smarty;
 
 $sql="select * from organizationdetails";
 $result = $adb->query($sql);
@@ -47,30 +49,26 @@
 $organization_logo = $adb->query_result($result,0,'logo');
 $organization_logoname = $adb->query_result($result,0,'logoname');
 
-$xtpl->assign("RETURN_MODULE","Settings");
-$xtpl->assign("RETURN_ACTION","index");
-
-
 if (isset($organization_name))
-	$xtpl->assign("ORGANIZATIONNAME",$organization_name);
+	$smarty->assign("ORGANIZATIONNAME",$organization_name);
 if (isset($organization_address))
-	$xtpl->assign("ORGANIZATIONADDRESS",$organization_address);
+	$smarty->assign("ORGANIZATIONADDRESS",$organization_address);
 if (isset($organization_city))
-	$xtpl->assign("ORGANIZATIONCITY",$organization_city);
+	$smarty->assign("ORGANIZATIONCITY",$organization_city);
 if (isset($organization_state))
-	$xtpl->assign("ORGANIZATIONSTATE",$organization_state);
+	$smarty->assign("ORGANIZATIONSTATE",$organization_state);
 if (isset($organization_code))
-	$xtpl->assign("ORGANIZATIONCODE",$organization_code);
+	$smarty->assign("ORGANIZATIONCODE",$organization_code);
 if (isset($organization_country))
-        $xtpl->assign("ORGANIZATIONCOUNTRY",$organization_country);
+    $smarty->assign("ORGANIZATIONCOUNTRY",$organization_country);
 if (isset($organization_phone))
-	$xtpl->assign("ORGANIZATIONPHONE",$organization_phone);
+	$smarty->assign("ORGANIZATIONPHONE",$organization_phone);
 if (isset($organization_fax))
-	$xtpl->assign("ORGANIZATIONFAX",$organization_fax);
+	$smarty->assign("ORGANIZATIONFAX",$organization_fax);
 if (isset($organization_website))
-	$xtpl->assign("ORGANIZATIONWEBSITE",$organization_website);
+	$smarty->assign("ORGANIZATIONWEBSITE",$organization_website);
 if (isset($organization_logo))
-	$xtpl->assign("ORGANIZATIONLOGO",$organization_logo);
+	$smarty->assign("ORGANIZATIONLOGO",$organization_logo);
 
 $path = "test/logo";
 $dir_handle = @opendir($path) or die("Unable to open directory $path");
@@ -95,12 +93,14 @@
 
 
 if (isset($organization_logopath))
-	$xtpl->assign("ORGANIZATIONLOGOPATH",$path);
+	$smarty->assign("ORGANIZATIONLOGOPATH",$path);
 if (isset($organization_logoname))
-	$xtpl->assign("ORGANIZATIONLOGONAME",$logo_name);
+	$smarty->assign("ORGANIZATIONLOGONAME",$logo_name);
 closedir($dir_handle);
 
-$xtpl->parse("main");
-$xtpl->out("main");
-
+$smarty->assign("MOD", return_module_language($current_language,'Settings'));
+$smarty->assign("IMAGE_PATH",$image_path);
+$smarty->assign("APP", $app_strings);
+$smarty->assign("CMOD", $mod_strings);
+$smarty->display('Settings/CompanyInfo.tpl');
 ?>

Modified: vtigercrm/trunk/modules/Settings/Save.php
==============================================================================
Binary files - no diff available.

Modified: vtigercrm/trunk/modules/Settings/add2db.php
==============================================================================
--- vtigercrm/trunk/modules/Settings/add2db.php (original)
+++ vtigercrm/trunk/modules/Settings/add2db.php Mon Apr  3 05:52:19 2006
@@ -36,7 +36,6 @@
 			{
 				$savelogo="false";
 				$error_flag ="1";
-				//$errormessage = "<font color='red'><B> Logo has to be an Image of type jpeg/png</B></font>";
 			}		
 			else if($result!=false)
 			{
@@ -47,7 +46,6 @@
 		{
 			$savelogo="false";
 			$error_flag ="1";
-			//$errormessage = "<font color='red'><B> Logo has to be an Image of type jpeg/png</B></font>";
 		}
 		
 	}
@@ -56,10 +54,6 @@
 		$savelogo="false";
 		if($filename != "") 
 			$error_flag ="2";
-		//$errormessage = "<font color='red'><B>Error Message<ul>
-		//<li><font color='red'>Invalid file OR</font>
-		//<li><font color='red'>File has no data</font>
-		//</ul></B></font> <br>" ;
 	}
 		
 	$errorCode =  $_FILES['binFile']['error'];
@@ -73,14 +67,12 @@
 	else if($errorCode == 2)
 	{
 	   	$error_flag ="3";
-		//$errormessage = "<B><font color='red'>Sorry, the uploaded file exceeds the maximum filesize limit. Please try a file smaller than 800000 bytes</font></B> <br>";
 	   	$savelogo="false";	    	
 		$nologo_specified="false";
 	}
 	else if($errorCode == 3 )
 	{
 		$error_flag ="4";
-		//$errormessage = "<b>Problems in file upload. Please try again! </b><br>";
   		$savelogo="false";
 		$nologo_specified="false";
 	}

Modified: vtigercrm/trunk/modules/Settings/language/en_us.lang.php
==============================================================================
--- vtigercrm/trunk/modules/Settings/language/en_us.lang.php (original)
+++ vtigercrm/trunk/modules/Settings/language/en_us.lang.php Mon Apr  3 05:52:19 2006
@@ -539,7 +539,8 @@
 //Added fields after 5.0 Alpha
 'LBL_REQUIRE_SMTP_AUTHENTICATION'=>'Require SMTP Authentication?',
 'LBL_ANNOUNCEMENT'=>'Announcements',
-'LBL_SETTING_ANNOUNCEMENT'=>'Announcements',
+'LBL_SETTING_ANNOUNCEMENT'=>'Announcement',
+'LBL_ANNOUNCEMENT_INFO'=>'Type the announcement text below, and click the save button.',
 );
 
 

Modified: vtigercrm/trunk/modules/Users/Announcements.php
==============================================================================
--- vtigercrm/trunk/modules/Users/Announcements.php (original)
+++ vtigercrm/trunk/modules/Users/Announcements.php Mon Apr  3 05:52:19 2006
@@ -9,6 +9,7 @@
  *
  ********************************************************************************/
 
+require_once('XTemplate/xtpl.php');
 global $adb;
 global $current_user;
 global $theme;
@@ -19,46 +20,13 @@
 $announcement=$adb->query_result($result,0,'announcement');
 $title_prev=$adb->query_result($result,0,'title');
 $id=$adb->query_result($result,0,'creatorid');
-if($id != $current_user->id)
-	$announcement='';
 
-	$html='<script>
-	function ajaxSaveResponse(response)
-	{
-		document.getElementById("announcement").innerHTML=response.responseText;
-		hide("an_busy");
-	}
-	function Announcement()
-	{
-	show("an_busy");	
-	var ajaxObj = new Ajax(ajaxSaveResponse);
-	//alert(document.getElementById("announcement").value);
-	var announcement=document.getElementById("announcement").value;
-	var title=document.getElementById("title_announce").value;
-	var urlstring = "module=Users&action=UsersAjax&announcement="+announcement+"&announce_save=yes&title_announcement="+title;
-		ajaxObj.process("index.php?",urlstring);
-	}
-	</script>
-	<br><br><table align="center"><tbody><tr style="height: 40px;">
-	<td class="dvtSelectedCell" align="center" nowrap="nowrap" colspan="4">Announcements<div id="an_busy" style="display:none;float:left;position:relative;"><img src="'.$image_path.'vtbusy.gif" align="right"></div></td>
-	</tr>
-	<tr style="height: 25px;"><td class="dvtCellLabel" align="right" width="20%">Title</td>
-	<td><input name="title_announce" id="title_announce" class="detailedViewTextBox" onfocus="this.className=\'detailedViewTextBoxOn\'" onblur="this.className=\'detailedViewTextBox\'" type="text" value="'.$title_prev.'"></td></tr>
-	<tr style="height: 25px;">
-	<td class="dvtCellLabel" align="right" width="20%">
-	Create Announcement</td>	
-	<td colspan="3"><textarea class="detailedViewTextBox" onfocus="this.className=\'detailedViewTextBoxOn\'" id= "announcement" name="announcement" onblur="this.className=\'detailedViewTextBox\'" cols="100" rows="8">'.$announcement.'</textarea>
-	</td>
-	</tr>
-	<tr style="height: 25px;"><td colspan="4">&nbsp;</td></tr>
-	<tr>
-	<td colspan="4" style="padding: 5px;">
-	<div align="center">
-	<input title="Save [Alt+S]" accesskey="S" class="small" onclick="javascript:Announcement();" name="button" value="  Save  " style="width: 70px;" type="submit">
-	<input title="Cancel [Alt+X]" accesskey="X" class="small" onclick="window.history.back()" name="button" value="  Cancel  " style="width: 70px;" type="button">
-	</div>
-	</td>
-	</tr>
-	</tbody></table>';
-	echo $html;
+$smarty->assign("ANNOUNCE",$announcement);
+$smarty->assign("MOD", return_module_language($current_language,'Settings'));
+$smarty->assign("IMAGE_PATH",$image_path);
+$smarty->assign("APP", $app_strings);
+$smarty->assign("CMOD", $mod_strings);
+
+$smarty->display("Settings/Announcements.tpl");
+
 ?>

Modified: vtigercrm/trunk/modules/Users/OrganizationTermsandConditions.php
==============================================================================
--- vtigercrm/trunk/modules/Users/OrganizationTermsandConditions.php (original)
+++ vtigercrm/trunk/modules/Users/OrganizationTermsandConditions.php Mon Apr  3 05:52:19 2006
@@ -10,54 +10,36 @@
 ********************************************************************************/
 
 
-require_once('XTemplate/xtpl.php');
-//require_once('data/Tracker.php');
-//require_once('include/utils/UserInfoUtil.php');
 require_once('include/database/PearDatabase.php');
+require_once('Smarty_setup.php');
 
 global $mod_strings;
 global $app_strings;
 global $app_list_strings;
 
-echo get_module_title($mod_strings['LBL_MODULE_NAME'],$mod_strings['INV_TERMSANDCONDITIONS'],true);
-echo '<br><br>';
 global $adb;
 global $theme;
 $theme_path="themes/".$theme."/";
 $image_path=$theme_path."images/";
 require_once($theme_path.'layout_utils.php');
 
-$xtpl=new XTemplate('modules/Users/OrganizationTermsandConditions.html');
-$xtpl->assign("MOD", $mod_strings);
-$xtpl->assign("APP", $app_strings);
-
-
+$smarty = new vtigerCRM_Smarty;
 $sql="select * from inventory_tandc";
 $result = $adb->query($sql);
-//$inventoryResult = $adb->fetch_array($result);
 $inventory_id = $adb->query_result($result,0,'id');
 $inventory_type = $adb->query_result($result,0,'type');
 $inventory_tandc = $adb->query_result($result,0,'tandc');
 
-if(isset($inventory_id))
-       $xtpl->assign("INVENTORYID",$inventory_id);
-if (isset($inventory_type))
-        $xtpl->assign("INVENTORYTYPE",$inventory_type);
 if (isset($inventory_tandc))
-        $xtpl->assign("INV_TERMSANDCONDITIONS",$inventory_tandc);
-
-
-/*
-        $xtpl->assign("INVENTORYID",$inventoryResult["id"]);  
-//if (isset($inventory_type))
-        $xtpl->assign("INVENTORYTYPE",$inventoryResult["type"]);
-//if (isset($inventory_tandc))
-        $xtpl->assign("INV_TERMSANDCONDITIONS",$inventoryResult["tandc"]);*/
-
-
-$xtpl->parse("main");
-$xtpl->out("main");
-
+        $smarty->assign("INV_TERMSANDCONDITIONS",$inventory_tandc);
+if(isset($_REQUEST['inv_terms_mode']) && $_REQUEST['inv_terms_mode'] != '')
+	$smarty->assign("INV_TERMS_MODE",$_REQUEST['inv_terms_mode']);
+else
+	$smarty->assign("INV_TERMS_MODE",'view');
+	
+$smarty->assign("MOD", return_module_language($current_language,'Settings'));
+$smarty->assign("IMAGE_PATH",$image_path);
+$smarty->assign("APP", $app_strings);
+$smarty->assign("CMOD", $mod_strings);
+$smarty->display("Settings/InventoryTerms.tpl");
 ?>
-
-	

Modified: vtigercrm/trunk/modules/Users/UsersAjax.php
==============================================================================
--- vtigercrm/trunk/modules/Users/UsersAjax.php (original)
+++ vtigercrm/trunk/modules/Users/UsersAjax.php Mon Apr  3 05:52:19 2006
@@ -41,9 +41,9 @@
 	$sql="select * from announcement where creatorid=".$current_user->id;
 	$is_announce=$adb->query($sql);
 	if($adb->num_rows($is_announce) > 0)
-		$query="update announcement set announcement=".$adb->formatString("announcement","announcement",$announcement).",time=".$adb->formatString("announcement","time",$date_var).",title=".$adb->formatString("announcement","title",$title)." where creatorid=".$current_user->id;
+		$query="update announcement set announcement=".$adb->formatString("announcement","announcement",$announcement).",time=".$adb->formatString("announcement","time",$date_var).",title='announcement' where creatorid=".$current_user->id;
 	else
-		$query="insert into announcement values (".$current_user->id.",".$adb->formatString("announcement","announcement",$announcement).",".$adb->formatString("announcement","time",$date_var).",'".$date_var."')";
+		$query="insert into announcement values (".$current_user->id.",".$adb->formatString("announcement","announcement",$announcement).",'announcement','".$date_var."')";
 	$result=$adb->query($query);
 	echo $announcement;
 }





More information about the vtigercrm-commits mailing list