Changeset 10423
- Timestamp:
- Mar 13, 2007 2:21:18 PM (13 years ago)
- Location:
- vtigercrm/branches/5.0.3
- Files:
-
- 3 edited
-
include/utils/SearchUtils.php (modified) (2 diffs)
-
modules/Potentials/Charts.php (modified) (12 diffs)
-
modules/Potentials/Potentials.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
vtigercrm/branches/5.0.3/include/utils/SearchUtils.php
r10381 r10423 650 650 if (isset($_REQUEST['closingdate_start'])) $date_closed_start = $_REQUEST['closingdate_start']; 651 651 if (isset($_REQUEST['closingdate_end'])) $date_closed_end = $_REQUEST['closingdate_end']; 652 if (isset($_REQUEST['assigned_user_id'])) $assigned_user_id = $_REQUEST['assigned_user_id'];653 652 654 653 … … 670 669 $url_string .= "&leadsource=".$lead_source; 671 670 } 672 if(isset($assigned_user_id) && $assigned_user_id != "") {673 array_push($where_clauses, "vtiger_crmentity.smownerid = ".$assigned_user_id);674 $url_string .= "&assigned_user_id=".$assigned_user_id;675 }676 671 if(isset($date_closed) && $date_closed != "") { 677 672 array_push($where_clauses, $adb->getDBDateString("vtiger_potential.closingdate")." like ".$adb->quote($date_closed.'%').""); -
vtigercrm/branches/5.0.3/modules/Potentials/Charts.php
r9762 r10423 87 87 88 88 //build the where clause for the query that matches $user 89 $where = " (";89 $where = ""; 90 90 $first = true; 91 91 $current = 0; 92 foreach ($user_id as $the_id) {92 /*foreach ($user_id as $the_id) { 93 93 if (!$first) $where .= "OR "; 94 94 $first = false; 95 95 $where .= "vtiger_crmentity.smcreatorid='$the_id' "; 96 96 } 97 $where .= ") "; 97 $where .= ") ";*/ 98 98 99 99 //build the where clause for the query that matches $date_start and $date_end 100 $where .= " ANDclosingdate >= '$date_start' AND closingdate <= '$date_end'";100 $where .= " closingdate >= '$date_start' AND closingdate <= '$date_end'"; 101 101 $subtitle = $current_module_strings['LBL_DATE_RANGE']." ".getDisplayDate($date_start)." ".$current_module_strings['LBL_DATE_RANGE_TO']." ".getDisplayDate($date_end)."\n"; 102 102 … … 104 104 //query for opportunity data that matches $datay and $user 105 105 $opp = new Potentials(); 106 $opp_list = $opp->get_full_list(" amount DESC,closingdate DESC", $where);106 $opp_list = $opp->get_full_list("vtiger_potential.amount DESC, vtiger_potential.closingdate DESC", $where); 107 107 108 108 //build pipeline by sales stage data … … 413 413 $where=""; 414 414 //build the where clause for the query that matches $user 415 $count = count($user_id);415 /*$count = count($user_id); 416 416 if ($count>0) { 417 417 $where = "("; … … 424 424 } 425 425 $where .= ") "; 426 } 426 }*/ 427 427 428 428 //build the where clause for the query that matches $datay 429 429 $count = count($datay); 430 430 if ($count>0) { 431 $where .= " AND( ";431 $where .= " ( "; 432 432 unset($first); 433 433 $first = true; … … 443 443 //query for opportunity data that matches $datay and $user 444 444 $opp = new Potentials(); 445 $opp_list = $opp->get_full_list(" amount DESC,closingdate DESC", $where);445 $opp_list = $opp->get_full_list("vtiger_potential.amount DESC, vtiger_potential.closingdate DESC", $where); 446 446 447 447 //build pipeline by sales stage data … … 744 744 $where=""; 745 745 //build the where clause for the query that matches $user 746 $count = count($user_id);746 /*$count = count($user_id); 747 747 if ($count>0) { 748 748 $where = "("; … … 758 758 } 759 759 $where .= ") "; 760 } 760 }*/ 761 761 762 762 //build the where clause for the query that matches $datax 763 763 $count = count($datax); 764 764 if ($count>0) { 765 $where .= " AND( ";765 $where .= " ( "; 766 766 unset($first); 767 767 $first = true; … … 781 781 //query for opportunity data that matches $datax and $user 782 782 $opp = new Potentials(); 783 $opp_list = $opp->get_full_list(" amount DESC,closingdate DESC", $where);783 $opp_list = $opp->get_full_list("vtiger_potential.amount DESC, vtiger_potential.closingdate DESC", $where); 784 784 785 785 //build pipeline by sales stage data … … 832 832 array_push($aAlts[$the_id], ""); 833 833 } 834 array_push($aTargets[$the_id], "index.php?module=Potentials&action=ListView& assigned_user_id=$the_id&sales_stage=".urlencode($stage_key)."&closingdate_start=".urlencode($date_start)."&closingdate_end=".urlencode($date_end)."&query=true&type=dbrd");834 array_push($aTargets[$the_id], "index.php?module=Potentials&action=ListView&sales_stage=".urlencode($stage_key)."&closingdate_start=".urlencode($date_start)."&closingdate_end=".urlencode($date_end)."&query=true&type=dbrd"); 835 835 } 836 836 array_push($legend,$stage_translation); … … 1033 1033 $where=""; 1034 1034 //build the where clause for the query that matches $user 1035 $count = count($user_id);1035 /*$count = count($user_id); 1036 1036 if ($count>0) { 1037 1037 $where = "("; … … 1043 1043 } 1044 1044 $where .= ") "; 1045 } 1045 }*/ 1046 1046 1047 1047 //build the where clause for the query that matches $datax 1048 1048 $count = count($legends); 1049 1049 if ($count>0) { 1050 $where .= " AND( ";1050 $where .= " ( "; 1051 1051 $first = true; 1052 1052 foreach ($legends as $key=>$value) { … … 1059 1059 1060 1060 $opp = new Potentials(); 1061 $opp_list = $opp->get_full_list(" amount DESC,closingdate DESC", $where);1061 $opp_list = $opp->get_full_list("vtiger_potential.amount DESC, vtiger_potential.closingdate DESC", $where); 1062 1062 1063 1063 //build pipeline by lead source data -
vtigercrm/branches/5.0.3/modules/Potentials/Potentials.php
r10174 r10423 143 143 function create_list_query($order_by, $where) 144 144 { 145 global $log; 145 global $log,$current_user; 146 require('user_privileges/user_privileges_'.$current_user->id.'.php'); 147 require('user_privileges/sharing_privileges_'.$current_user->id.'.php'); 148 $tab_id = getTabid("Potentials"); 146 149 $log->debug("Entering create_list_query(".$order_by.",". $where.") method ..."); 147 150 // Determine if the vtiger_account name is present in the where clause. … … 155 158 else 156 159 { 157 $query = 'SELECT potentialid, potentialname, smcreatorid, closingdate FROM vtiger_potential inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_potential.potentialid ';158 $where_auto = 'AND vtiger_crmentity.deleted=0 ';160 $query = 'SELECT vtiger_potential.potentialid, vtiger_potential.potentialname, vtiger_crmentity.smcreatorid, vtiger_potential.closingdate FROM vtiger_potential inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_potential.potentialid LEFT JOIN vtiger_potentialgrouprelation on vtiger_potential.potentialid = vtiger_potentialgrouprelation.potentialid LEFT JOIN vtiger_groups on vtiger_groups.groupname = vtiger_potentialgrouprelation.groupname left join vtiger_users on vtiger_users.id = vtiger_crmentity.smownerid '; 161 $where_auto = 'AND vtiger_crmentity.deleted=0 '; 159 162 } 160 163 … … 163 166 else 164 167 $query .= "where ".$where_auto; 168 if($is_admin==false && $profileGlobalPermission[1] == 1 && $profileGlobalPermission[2] == 1 && $defaultOrgSharingPermission[$tab_id] == 3) 169 { 170 $sec_parameter=getListViewSecurityParameter("Potentials"); 171 $query .= $sec_parameter; 172 173 } 165 174 166 175 if($order_by != "") 167 $query .= " ORDER BY vtiger_potential.$order_by";168 else 169 $query .= " ORDER BY vtiger_potential.potentialname ";176 $query .= " ORDER BY $order_by"; 177 else 178 $query .= " ORDER BY vtiger_potential.potentialname "; 170 179 171 180
Note: See TracChangeset
for help on using the changeset viewer.
