[Vtigercrm-commits] [vtiger-commits] r5132 - in /vtigercrm/trunk/modules/Contacts: Contact.php ListView.php
vtigercrm-commits at vtiger.fosslabs.com
vtigercrm-commits at vtiger.fosslabs.com
Sat Apr 15 04:00:38 EDT 2006
Author: saraj
Date: Sat Apr 15 02:00:33 2006
New Revision: 5132
Log:
Changes made for Advance search
Modified:
vtigercrm/trunk/modules/Contacts/Contact.php
vtigercrm/trunk/modules/Contacts/ListView.php
Modified: vtigercrm/trunk/modules/Contacts/Contact.php
==============================================================================
--- vtigercrm/trunk/modules/Contacts/Contact.php (original)
+++ vtigercrm/trunk/modules/Contacts/Contact.php Sat Apr 15 02:00:33 2006
@@ -152,7 +152,28 @@
$this->column_fields = getColumnFields('Contacts');
}
-
+ // Mike Crowe Mod --------------------------------------------------------Default ordering for us
+ function getSortOrder()
+ {
+ if(isset($_REQUEST['sorder']))
+ $sorder = $_REQUEST['sorder'];
+ else
+ $sorder = (($_SESSION['CONTACTS_SORT_ORDER'] != '')?($_SESSION['CONTACTS_SORT_ORDER']):($this->default_sort_order));
+
+ return $sorder;
+ }
+
+ function getOrderBy()
+ {
+ if (isset($_REQUEST['order_by']))
+ $order_by = $_REQUEST['order_by'];
+ else
+ $order_by = (($_SESSION['CONTACTS_ORDER_BY'] != '')?($_SESSION['CONTACTS_ORDER_BY']):($this->default_order_by));
+
+ return $order_by;
+ }
+ // Mike Crowe Mod --------------------------------------------------------
+
function getCount($user_name)
{
$query = "select count(*) from contactdetails inner join crmentity on crmentity.crmid=contactdetails.contactid inner join users on users.id=crmentity.smownerid where user_name='" .$user_name ."' and crmentity.deleted=0";
Modified: vtigercrm/trunk/modules/Contacts/ListView.php
==============================================================================
--- vtigercrm/trunk/modules/Contacts/ListView.php (original)
+++ vtigercrm/trunk/modules/Contacts/ListView.php Sat Apr 15 02:00:33 2006
@@ -41,15 +41,8 @@
$other_text = Array();
//<<<<<<<<<<<<<<<<<<< sorting - stored in session >>>>>>>>>>>>>>>>>>>>
-if($_REQUEST['order_by'] != '')
- $order_by = $_REQUEST['order_by'];
-else
- $order_by = (($_SESSION['CONTACTS_ORDER_BY'] != '')?($_SESSION['CONTACTS_ORDER_BY']):($focus->default_order_by));
-
-if($_REQUEST['sorder'] != '')
- $sorder = $_REQUEST['sorder'];
-else
- $sorder = (($_SESSION['CONTACTS_SORT_ORDER'] != '')?($_SESSION['CONTACTS_SORT_ORDER']):($focus->default_sort_order));
+$sorder = $focus->getSortOrder();
+$order_by = $focus->getOrderBy();
$_SESSION['CONTACTS_ORDER_BY'] = $order_by;
$_SESSION['CONTACTS_SORT_ORDER'] = $sorder;
@@ -63,7 +56,7 @@
{
// we have a query
$url_string .="&query=true";
- $where=Search($currentModule);
+ $where=getWhereCondition($currentModule);
//Added for Custom Field Search
$sql="select * from field where tablename='contactscf' order by fieldlabel";
$result=$adb->query($sql);
@@ -230,9 +223,12 @@
$smarty->assign("LISTENTITY", $listview_entries);
$smarty->assign("SELECT_SCRIPT", $view_script);
-
$navigationOutput = getTableHeaderNavigation($navigation_array, $url_string,"Contacts","index",$viewid);
$alphabetical = AlphabeticalSearch($currentModule,'index','lastname','true','basic',"","","","",$viewid);
+$fieldnames = getAdvSearchfields($module);
+$criteria = getcriteria_options();
+$smarty->assign("CRITERIA", $criteria);
+$smarty->assign("FIELDNAMES", $fieldnames);
$smarty->assign("NAVIGATION", $navigationOutput);
$smarty->assign("ALPHABETICAL", $alphabetical);
$smarty->assign("RECORD_COUNTS", $record_string);
More information about the vtigercrm-commits
mailing list