[Vtigercrm-commits] [vtiger-commits] r6530 - in /vtigercrm/trunk: Smarty/templates/ListView.tpl Smarty/templates/ListViewEntries.tpl include/js/ListView.js include/utils/ListViewUtils.php modules/Leads/ListView.php themes/blue/style.css
vtigercrm-commits at vtiger.fosslabs.com
vtigercrm-commits at vtiger.fosslabs.com
Sat May 27 09:45:58 EDT 2006
Author: saraj
Date: Sat May 27 07:45:45 2006
New Revision: 6530
Log:
Search/Pagination issue fixed.Fixes #837 and #874
Modified:
vtigercrm/trunk/Smarty/templates/ListView.tpl
vtigercrm/trunk/Smarty/templates/ListViewEntries.tpl
vtigercrm/trunk/include/js/ListView.js
vtigercrm/trunk/include/utils/ListViewUtils.php
vtigercrm/trunk/modules/Leads/ListView.php
vtigercrm/trunk/themes/blue/style.css
Modified: vtigercrm/trunk/Smarty/templates/ListView.tpl
==============================================================================
--- vtigercrm/trunk/Smarty/templates/ListView.tpl (original)
+++ vtigercrm/trunk/Smarty/templates/ListView.tpl Sat May 27 07:45:45 2006
@@ -32,62 +32,53 @@
function callSearch(searchtype)
{ldelim}
-
- search_fld_val= document.basicSearch.search_field[document.basicSearch.search_field.selectedIndex].value;
- search_type_val=document.basicSearch.searchtype.value;
+ search_fld_val= document.basicSearch.search_field[document.basicSearch.search_field.selectedIndex].value;
search_txt_val=document.basicSearch.search_text.value;
-
- var ajaxObj = new Ajax(ajaxSaveResponse);
- var urlstring = '';
- elements=document.basicSearch;
- for(ii = 0 ; ii < elements.length; ii++)
- {ldelim}
- if(elements[ii].name != 'action')
- urlstring = urlstring+''+elements[ii].name+'='+elements[ii].value+'&';
- else
- urlstring = urlstring+'file=index&';
- {rdelim}
- var no_rows = document.basicSearch.search_cnt.value;
- for(jj = 0 ; jj < no_rows; jj++)
- {ldelim}
- var sfld_name = getObj("Fields"+jj);
- var scndn_name= getObj("Condition"+jj);
- var srchvalue_name = getObj("Srch_value"+jj);
- urlstring = urlstring+'Fields'+jj+'='+sfld_name[sfld_name.selectedIndex].value+'&';
- urlstring = urlstring+'Condition'+jj+'='+scndn_name[scndn_name.selectedIndex].value+'&';
- urlstring = urlstring+'Srch_value'+jj+'='+srchvalue_name.value+'&';
- {rdelim}
- urlstring = urlstring +'action={$MODULE}Ajax&ajax=true';
- ajaxObj.process("index.php?",urlstring);
+ var ajaxObj = new Ajax(ajaxSaveResponse);
+ var urlstring = '';
+ if(searchtype == 'Basic')
+ {ldelim}
+ urlstring = 'search_field='+search_fld_val+'&searchtype=BasicSearch&search_text='+search_txt_val+'&';
+ {rdelim}
+ else if(searchtype == 'Advanced')
+ {ldelim}
+ var no_rows = document.basicSearch.search_cnt.value;
+ for(jj = 0 ; jj < no_rows; jj++)
+ {ldelim}
+ var sfld_name = getObj("Fields"+jj);
+ var scndn_name= getObj("Condition"+jj);
+ var srchvalue_name = getObj("Srch_value"+jj);
+ urlstring = urlstring+'Fields'+jj+'='+sfld_name[sfld_name.selectedIndex].value+'&';
+ urlstring = urlstring+'Condition'+jj+'='+scndn_name[scndn_name.selectedIndex].value+'&';
+ urlstring = urlstring+'Srch_value'+jj+'='+srchvalue_name.value+'&';
+ {rdelim}
+ for (i=0;i<getObj("matchtype").length;i++){ldelim}
+ if (getObj("matchtype")[i].checked==true)
+ urlstring += 'matchtype='+getObj("matchtype")[i].value+'&';
+ {rdelim}
+ urlstring += 'search_cnt='+no_rows+'&';
+ urlstring += 'searchtype=advance&'
+ {rdelim}
+ urlstring = urlstring +'query=true&file=index&module={$MODULE}&action={$MODULE}Ajax&ajax=true';
+ ajaxObj.process("index.php?",urlstring);
+
{rdelim}
-function alphabetic(url)
+function alphabetic(module,url,dataid)
{ldelim}
-
- var ajaxObj = new Ajax(ajaxSaveResponse);
-
- url_param = url.split('&');
- for(plen=0; plen< url_param.length;plen++)
- {ldelim}
- url_var=url_param[plen];
- if(url_var.search(/search_text/gi)!= -1)
- {ldelim}
- name_value = url_var.split('=');
- document.basicSearch.search_text.value = name_value[1];
- {rdelim}
- else if(url_var.search(/search_field/gi)!= -1)
- {ldelim}
- name_value = url_var.split('=');
- var oSfield = getObj("search_field");
- for (os=0; os<oSfield.length;os++)
- {ldelim}
- if(oSfield[os].value == name_value[1])
- oSfield.selectedIndex = os;
- {rdelim}
- {rdelim}
-
- {rdelim}
- ajaxObj.process("index.php?",url);
+ for(i=1;i<=26;i++)
+ {ldelim}
+ var data_td_id = 'alpha_'+ eval(i);
+ getObj(data_td_id).className = 'searchAlph';
+
+ {rdelim}
+ getObj(dataid).className = 'searchAlphselected';
+ show("status");
+ var ajaxObj = new Ajax(ajaxSaveResponse);
+ var urlstring ="module="+module+"&action="+module+"Ajax&file=index&ajax=true&"+url;
+ ajaxObj.process("index.php?",urlstring);
+
{rdelim}
+
</script>
{include file='Buttons_List.tpl'}
@@ -179,7 +170,7 @@
</table>
<table border=0 cellspacing=0 cellpadding=5 width=80% style="border-bottom:1px dashed #CCCCCC;border-left:1px dashed #CCCCCC;border-right:1px dashed #CCCCCC;" align="center">
<tr>
- <td align=center class="dvtCellLabel"><input type="button" class="classBtn" value=" {$APP.LBL_SEARCH_NOW_BUTTON} " onClick="totalnoofrows();callSearch('Basic');">
+ <td align=center class="dvtCellLabel"><input type="button" class="classBtn" value=" {$APP.LBL_SEARCH_NOW_BUTTON} " onClick="totalnoofrows();callSearch('Advanced');">
</td>
</tr>
</table>
@@ -212,6 +203,7 @@
<td class="showPanelBg" valign="top" width=100% style="padding:10px;">
<!-- PUBLIC CONTENTS STARTS-->
<div id="ListViewContents" class="small" style="width:100%;position:relative;">
+ <input name='search_url' id="search_url" type='hidden' value='{$SEARCH_URL}'>
<form name="massdelete" method="POST">
<input name="idlist" type="hidden">
<input name="change_owner" type="hidden">
Modified: vtigercrm/trunk/Smarty/templates/ListViewEntries.tpl
==============================================================================
--- vtigercrm/trunk/Smarty/templates/ListViewEntries.tpl (original)
+++ vtigercrm/trunk/Smarty/templates/ListViewEntries.tpl Sat May 27 07:45:45 2006
@@ -10,6 +10,8 @@
********************************************************************************/
-->*}
&#&#&#{$ERROR}&#&#&#
+
+ <input name='search_url' id="search_url" type='hidden' value='{$SEARCH_URL}'>
<input name='allids' type='hidden' value='{$ALLIDS}'>
<form name="massdelete" method="POST">
<input name="idlist" type="hidden">
Modified: vtigercrm/trunk/include/js/ListView.js
==============================================================================
--- vtigercrm/trunk/include/js/ListView.js (original)
+++ vtigercrm/trunk/include/js/ListView.js Sat May 27 07:45:45 2006
@@ -120,6 +120,8 @@
show("status");
var ajaxObj = new Ajax(ajaxSaveResponse);
var urlstring ="module="+module+"&action="+module+"Ajax&file=index&ajax=true&"+url;
+ if(document.getElementById('search_url').value!='')
+ urlstring = urlstring+document.getElementById('search_url').value;
ajaxObj.process("index.php?",urlstring);
}
Modified: vtigercrm/trunk/include/utils/ListViewUtils.php
==============================================================================
--- vtigercrm/trunk/include/utils/ListViewUtils.php (original)
+++ vtigercrm/trunk/include/utils/ListViewUtils.php Sat May 27 07:45:45 2006
@@ -2161,7 +2161,7 @@
for($var='A',$i =1;$i<=26;$i++,$var++)
// Mike Crowe Mod --------------------------------------------------------added groupid to url
- $list .= '<td class="searchAlph" align="center"><a href="index.php?module='.$module.'&action='.$action.'&viewname='.$viewid.'&gname='.$groupid.'&query='.$query.'&search_field='.$fieldname.'&searchtype=BasicSearch&search_text='.$var.$flag.$popuptypevalue.$returnvalue.$append_url.'">'.$var.'</a></td>';
+ $list .= '<td class="searchAlph" id="alpha_'.$i.'" align="center" onClick=\'alphabetic("'.$module.'","gname='.$groupid.'&query='.$query.'&search_field='.$fieldname.'&searchtype=BasicSearch&search_text='.$var.$flag.$popuptypevalue.$returnvalue.$append_url.'","alpha_'.$i.'")\'>'.$var.'</td>';
$log->debug("Exiting AlphabeticalSearch method ...");
return $list;
Modified: vtigercrm/trunk/modules/Leads/ListView.php
==============================================================================
--- vtigercrm/trunk/modules/Leads/ListView.php (original)
+++ vtigercrm/trunk/modules/Leads/ListView.php Sat May 27 07:45:45 2006
@@ -89,6 +89,7 @@
// we have a query
$url_string .="&query=true".$ustring;
$log->info("Here is the where clause for the list view: $where");
+ $smarty->assign("SEARCH_URL",$url_string);
}
//<<<<cutomview>>>>>>>
@@ -171,7 +172,6 @@
}
$list_result = $adb->query($query);
-
//Retreiving the no of rows
$noofrows = $adb->num_rows($list_result);
Modified: vtigercrm/trunk/themes/blue/style.css
==============================================================================
--- vtigercrm/trunk/themes/blue/style.css (original)
+++ vtigercrm/trunk/themes/blue/style.css Sat May 27 07:45:45 2006
@@ -373,10 +373,17 @@
.searchAlph {
border:1px solid #dadada;
background-color:#ffffff;
+ cursor:pointer;
width:10px
}
-
+.searchAlphselected {
+ border:1px solid #666666;
+ background-color:#bbbbbb;
+ cursor:pointer;
+ width:10px
+
+}
.searchNotFound {
border:2px solid #ff3333;
background-color:#fafafa;
More information about the vtigercrm-commits
mailing list