[Vtigercrm-commits] [vtiger-commits] r4308 - in /vtigercrm/trunk: Smarty/templates/ListView.tpl modules/Leads/Lead.js modules/Leads/LeadsAjax.php modules/Leads/ListView.php modules/Users/massdelete.php

vtigercrm-commits at vtiger.fosslabs.com vtigercrm-commits at vtiger.fosslabs.com
Mon Mar 20 02:18:48 EST 2006


Author: saraj
Date: Mon Mar 20 00:18:39 2006
New Revision: 4308

Log:
massdelete ajaxified in leads listview

Modified:
    vtigercrm/trunk/Smarty/templates/ListView.tpl
    vtigercrm/trunk/modules/Leads/Lead.js
    vtigercrm/trunk/modules/Leads/LeadsAjax.php
    vtigercrm/trunk/modules/Leads/ListView.php
    vtigercrm/trunk/modules/Users/massdelete.php

Modified: vtigercrm/trunk/Smarty/templates/ListView.tpl
==============================================================================
--- vtigercrm/trunk/Smarty/templates/ListView.tpl (original)
+++ vtigercrm/trunk/Smarty/templates/ListView.tpl Mon Mar 20 00:18:39 2006
@@ -23,6 +23,11 @@
 {/if}
 <script language="JavaScript" type="text/javascript" src="modules/{$MODULE}/{$SINGLE_MOD}.js"></script>
 <script language="javascript">
+function ajaxSaveResponse(response)
+{ldelim}
+	hide("status");
+	document.getElementById("ListViewContents").innerHTML=response.responseText;
+{rdelim}
 
 function callSearch(searchtype)
 {ldelim}
@@ -158,7 +163,6 @@
                                                 <input type="hidden" name="parenttab" value="{$CATEGORY}">
 						<input type="hidden" name="action" value="index">
                                                 <input type="hidden" name="query" value="true">
-						<input type="hidden" name="search_cnt">
 
 
                                         </td>
@@ -201,15 +205,15 @@
 					<div id="fixed" style="position:relative;top:0px;left:0px;width:95%;height:95px;overflow:auto;" class="padTab">
 					<table width="95%"  border="0" cellpadding="5" cellspacing="0" id="adSrc" align="left">
 					<tr  class="dvtCellInfo">
-					<td width="31%"><select name="Fields0" class="detailedViewTextBox">
+					<td width="31%"><select name="Fields" class="detailedViewTextBox">
 					{$FIELDNAMES}
 					</select>
 					</td>
-					<td width="32%"><select name="Condition0" class="detailedViewTextBox">
+					<td width="32%"><select name="Condition" class="detailedViewTextBox">
 					{$CRITERIA}
 					</select>
 					</td>
-					<td width="32%"><input type="text" name="Srch_value0" class="detailedViewTextBox"></td>
+					<td width="32%"><input type="text" name="srch" class="detailedViewTextBox"></td>
 					</tr>
 					</table>
 					</div>	
@@ -217,7 +221,7 @@
 					</tr>
 					<tr>
 
-					<td><input type="button" name="more" value="More" onClick="fnAddSrch('{$FIELDNAMES}','{$CRITERIA}')">
+					<td><input type="button" name="more" value="More" onClick="fnAddSrch('{$FIELDNAMES}')">
 					&nbsp;&nbsp;
 					<input name="button" type="button" value="Fewer" onclick="delRow()"></td>
 					<td>&nbsp;</td>
@@ -256,17 +260,17 @@
 			
 
 {*<!-- Contents -->*}
-<form name="massdelete" method="POST">
 <table border=0 cellspacing=0 cellpadding=0 width=98% align=center>
+     <tr>
+        <td valign=top><img src="{$IMAGE_PATH}showPanelTopLeft.gif"></td>
+
+	<td class="showPanelBg" valign=top width=100%>
+	   <!-- PUBLIC CONTENTS STARTS-->
+	   <div id="ListViewContents" class="small" style="padding:20px">
+     <form name="massdelete" method="POST">
      <input name="idlist" type="hidden">
      <input name="change_owner" type="hidden">
      <input name="change_status" type="hidden">
-     <tr>
-        <td valign=top><img src="{$IMAGE_PATH}showPanelTopLeft.gif"></td>
-
-	<td class="showPanelBg" valign=top width=100%>
-	   <!-- PUBLIC CONTENTS STARTS-->
-	   <div class="small" style="padding:20px">
                <table border=0 cellspacing=1 cellpadding=0 width=100% class="lvtBg">
 	            <tr style="background-color:#efefef">
 		      <td>
@@ -275,7 +279,7 @@
 				 <td style="padding-right:20px" nowrap>
                                  {foreach key=button_check item=button_label from=$BUTTONS}
                                         {if $button_check eq 'del'}
-                                             <input class="small" type="submit" value="{$button_label}" onclick="return massDelete()"/>
+                                             <input class="small" type="button" value="{$button_label}" onclick="return massDelete()"/>
                                         {elseif $button_check eq 's_mail'}
                                              <input class="small" type="submit" value="{$button_label}" onclick="return eMail()"/>
                                         {elseif $button_check eq 's_cmail'}
@@ -355,11 +359,14 @@
 		       </td>
 		   </tr>
 	    </table>
+
+   </form>	
+{$SELECT_SCRIPT}
 	</div>
 
      </td>
    </tr>
 </table>
-</form>	
-{$SELECT_SCRIPT}
-
+<div id="status" style="display:none;position:absolute;background-color:#bbbbbb;left:887px;top:0px;height:17px;white-space:nowrap;"">Processing Request...</div>
+
+

Modified: vtigercrm/trunk/modules/Leads/Lead.js
==============================================================================
--- vtigercrm/trunk/modules/Leads/Lead.js (original)
+++ vtigercrm/trunk/modules/Leads/Lead.js Mon Mar 20 00:18:39 2006
@@ -144,7 +144,7 @@
 			if(document.massdelete.selected_id[i].checked)
 			{
 				idstring = document.massdelete.selected_id[i].value +";"+idstring
-			xx++	
+				xx++;	
 			}
 		}
 		if (xx != 0)
@@ -158,8 +158,11 @@
 		}
 	}
 	if(confirm("Are you sure you want to delete the selected "+xx+" records ?"))
-	{	
-		document.massdelete.action="index.php?module=Users&action=massdelete&return_module=Leads&return_action=index&viewname="+viewid;
+	{
+		show("status");
+		var ajaxObj = new Ajax(ajaxSaveResponse);
+		var urlstring ="module=Users&action=massdelete&return_module=Leads&viewname="+viewid+"&idlist="+idstring;
+	    ajaxObj.process("index.php?",urlstring);
 	}
 	else
 	{

Modified: vtigercrm/trunk/modules/Leads/LeadsAjax.php
==============================================================================
--- vtigercrm/trunk/modules/Leads/LeadsAjax.php (original)
+++ vtigercrm/trunk/modules/Leads/LeadsAjax.php Mon Mar 20 00:18:39 2006
@@ -17,8 +17,11 @@
 $local_log =& LoggerManager::getLogger('LeadsAjax');
 
 $ajaxaction = $_REQUEST["ajxaction"];
-
-if($ajaxaction == "DETAILVIEW")
+if($_REQUEST['file'] != '')
+{
+	require_once('modules/Leads/'.$_REQUEST['file'].'.php');
+}
+elseif($ajaxaction == "DETAILVIEW")
 {
      $crmid = $_REQUEST["recordid"];
      $tablename = $_REQUEST["tableName"];

Modified: vtigercrm/trunk/modules/Leads/ListView.php
==============================================================================
--- vtigercrm/trunk/modules/Leads/ListView.php (original)
+++ vtigercrm/trunk/modules/Leads/ListView.php Mon Mar 20 00:18:39 2006
@@ -263,6 +263,9 @@
 $smarty->assign("ALPHABETICAL", $alphabetical);
 $smarty->assign("NAVIGATION", $navigationOutput);
 $smarty->assign("RECORD_COUNTS", $record_string);
-$smarty->display("ListView.tpl");
+if(isset($_REQUEST['ajax']) && $_REQUEST['ajax'] != '')
+	$smarty->display("ListViewEntries.tpl");
+else	
+	$smarty->display("ListView.tpl");
 
 ?>

Modified: vtigercrm/trunk/modules/Users/massdelete.php
==============================================================================
--- vtigercrm/trunk/modules/Users/massdelete.php (original)
+++ vtigercrm/trunk/modules/Users/massdelete.php Mon Mar 20 00:18:39 2006
@@ -18,11 +18,12 @@
 
 
 require_once('include/database/PearDatabase.php');
-$idlist = $_POST['idlist'];
+$idlist = $_REQUEST['idlist'];
 $viewid = $_REQUEST['viewname'];
 $returnmodule=$_REQUEST['return_module'];
 //split the string and store in an array
 $storearray = explode(";",$idlist);
+
 foreach($storearray as $id)
 {
 	$sql="update crmentity set crmentity.deleted=1 where crmentity.crmid='" .$id ."'";
@@ -33,7 +34,9 @@
 	$smod = "&smodule=".$_REQUEST['smodule'];
 }
 if($returnmodule!='Faq')
-	header("Location: index.php?module=".$returnmodule."&action=index&viewname=".$viewid.$smod);
+{
+	header("Location: index.php?module=".$returnmodule."&action=".$returnmodule."Ajax&ajax=delete&file=ListView&viewname=".$viewid);
+}
 else
 	header("Location: index.php?module=".$returnmodule."&action=index".$smod);
 ?>





More information about the vtigercrm-commits mailing list