[Vtigercrm-commits] [vtiger-commits] r4924 - in /vtigercrm/trunk: Smarty/templates/Settings/ modules/Users/

vtigercrm-commits at vtiger.fosslabs.com vtigercrm-commits at vtiger.fosslabs.com
Wed Apr 5 23:33:59 EDT 2006


Author: saraj
Date: Wed Apr  5 21:33:49 2006
New Revision: 4924

Log:
files added and changes made accordingly to integrate new UI for Inventory notification

Added:
    vtigercrm/trunk/Smarty/templates/Settings/EditInventoryNotify.tpl
    vtigercrm/trunk/Smarty/templates/Settings/InventoryNotify.tpl   (with props)
    vtigercrm/trunk/Smarty/templates/Settings/InventoryNotifyContents.tpl
Modified:
    vtigercrm/trunk/modules/Users/EditInventoryNotification.php
    vtigercrm/trunk/modules/Users/SaveInventoryNotification.php
    vtigercrm/trunk/modules/Users/listinventorynotifications.php

Modified: vtigercrm/trunk/modules/Users/EditInventoryNotification.php
==============================================================================
--- vtigercrm/trunk/modules/Users/EditInventoryNotification.php (original)
+++ vtigercrm/trunk/modules/Users/EditInventoryNotification.php Wed Apr  5 21:33:49 2006
@@ -9,13 +9,10 @@
 *
  ********************************************************************************/
 
-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['INVENTORYNOTIFICATION'], true);
-echo '<br><br>';
 
 global $adb;
 global $theme;
@@ -23,14 +20,10 @@
 $image_path=$theme_path."images/";
 require_once($theme_path.'layout_utils.php');
 
+$smarty = new vtigerCRM_Smarty;
 if(isset($_REQUEST['record']) && $_REQUEST['record']!='') 
 {
     $id = $_REQUEST['record'];
-    $mode = 'edit'; 	
-	$xtpl=new XTemplate ('modules/Users/EditInventoryNotification.html');
-	$xtpl->assign("MOD", $mod_strings);
-	$xtpl->assign("APP", $app_strings);
-
 	$sql="select * from inventorynotification where notificationid = ".$id;
 	$result = $adb->query($sql);
 	if($adb->num_rows($result) ==1);
@@ -38,23 +31,24 @@
 		$label = $mod_strings[$adb->query_result($result,0,'notificationname')];
 		$notification_subject = $adb->query_result($result,0,'notificationsubject');
 		$notification_body = $adb->query_result($result,0,'notificationbody');
+		$notification_id = $adb->query_result($result,0,'notificationid');
 
-		$xtpl->assign("RETURN_MODULE","Users");
-		$xtpl->assign("RETURN_ACTION","listinventorynotifications");
-		$xtpl->assign("RECORD_ID",$id);
-
-		if (isset($label))
-			$xtpl->assign("LABEL",$label);
-		if (isset($notification_subject))
-			$xtpl->assign("SUBNOTIFY",$notification_subject);
-		if (isset($notification_body))
-			$xtpl->assign("BODYNOTIFY",$notification_body);
+		$notification = Array();
+		$notification['label'] = $label;
+		$notification['subject'] = $notification_subject;
+		$notification['body'] = $notification_body;
+		$notification['id'] = $notification_id;
 	}
-	$xtpl->parse("main");
-	$xtpl->out("main");
+	
+	$smarty->assign("NOTIFY_DETAILS",$notification);
+	$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/EditInventoryNotify.tpl");
 }
 else
 {
-	header("Location:index.php?module=Users&action=listnotificationschedulers");
+	header("Location:index.php?module=Users&action=listnotificationschedulers&directmode=ajax");
 }
 ?>

Modified: vtigercrm/trunk/modules/Users/SaveInventoryNotification.php
==============================================================================
--- vtigercrm/trunk/modules/Users/SaveInventoryNotification.php (original)
+++ vtigercrm/trunk/modules/Users/SaveInventoryNotification.php Wed Apr  5 21:33:49 2006
@@ -17,6 +17,6 @@
 	$query="UPDATE inventorynotification set notificationsubject='".$_REQUEST['notifysubject']."', notificationbody='".$_REQUEST['notifybody']."' where notificationid=".$_REQUEST['record'];
 	$adb->query($query);	
 }
-$loc = "Location: index.php?action=listinventorynotifications&module=Users";
+$loc = "Location: index.php?action=UsersAjax&file=listinventorynotifications&module=Users&directmode=ajax";
 header($loc);
 ?>

Modified: vtigercrm/trunk/modules/Users/listinventorynotifications.php
==============================================================================
--- vtigercrm/trunk/modules/Users/listinventorynotifications.php (original)
+++ vtigercrm/trunk/modules/Users/listinventorynotifications.php Wed Apr  5 21:33:49 2006
@@ -11,55 +11,35 @@
  ********************************************************************************/
 
 require_once('include/database/PearDatabase.php');
+require_once('Smarty_setup.php');
 
 global $theme;
 $theme_path="themes/".$theme."/";
 $image_path=$theme_path."images/";
 
-?>
-<html>
-<head>
-<title>Untitled Document</title>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-</head>
-<body>
-<?php echo get_module_title($_REQUEST["module"],$mod_strings['INVENTORYNOTIFICATION'],false);?>
-<br>
-<?php echo $mod_strings['LBL_INV_NOT_DESC'];?>
-<br><br>
-  <table width="80%" border="0" cellspacing="1" cellpadding="0" class="FormBorder">
-    <tr height="20"> 
-      <td class="moduleListTitle" style="padding:0px 3px 0px 3px;"><b><?php echo $mod_strings['LBL_NOTIFICATION'];?></b></td>
-      <td class="moduleListTitle" style="padding:0px 3px 0px 3px;"><b><?php echo $mod_strings['LBL_DESCRIPTION'];?></b></td>
-    </tr>
-<?
-
+$smarty = new vtigerCRM_Smarty;
 $query = "SELECT * FROM inventorynotification";
 $result = $adb->query($query);
 $num_rows = $adb->num_rows($result);
-$out = '';
+$output = Array();
 for($i=0; $i<$num_rows; $i++)
 {
+	$out = Array();
 	$not_id = $adb->query_result($result,$i,'notificationid');
 	$not_mod = $adb->query_result($result,$i,'notificationname');	
 	$not_des = $adb->query_result($result,$i,'label');
-	if($row_list%2 ==1)
-	{
-		$ListRow = "oddListRow";
-	}
-	else
-	{
-		$ListRow = "evenListRow";
-	}
-	$out .= '<tr class="'.$ListRow.'" height="70">';
-	$out .='<td valign="top" nowrap style="padding:0px 3px 0px 3px;"><a href="index.php?module=Users&action=EditInventoryNotification&record='.$not_id.'">'.$mod_strings[$not_mod].'</a></td>';
-	$out .= '<td valign="top" style="padding:0px 3px 0px 3px;">'.$mod_strings[$not_des].'</td>';
-	$out .= '</tr>';
+	$out ['notificationname'] = $mod_strings[$not_mod];
+	$out ['label'] = $mod_strings[$not_des];
+	$out ['id'] = $not_id;
+	$output [] = $out;
 }
-	
-	echo $out;
-?>
-  </table>
-</form>
-</body>
-</html>
+$smarty->assign("NOTIFICATION",$output);
+$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);
+
+if($_REQUEST['directmode'] != '')
+	$smarty->display("Settings/InventoryNotifyContents.tpl");
+else
+	$smarty->display("Settings/InventoryNotify.tpl");





More information about the vtigercrm-commits mailing list