[Vtigercrm-commits] [vtiger-commits] r9943 - in /vtigercrm/branches/5.0.3: include/utils/CommonUtils.php include/utils/ListViewUtils.php modules/CustomView/CustomView.php modules/Reports/ReportRun.php modules/Reports/Reports.php
vtigercrm-commits at vtiger.fosslabs.com
vtigercrm-commits at vtiger.fosslabs.com
Thu Dec 7 00:52:56 EST 2006
Author: richie
Date: Wed Dec 6 22:52:47 2006
New Revision: 9943
Log:
modifed customview column headers for activities
Modified:
vtigercrm/branches/5.0.3/include/utils/CommonUtils.php
vtigercrm/branches/5.0.3/include/utils/ListViewUtils.php
vtigercrm/branches/5.0.3/modules/CustomView/CustomView.php
vtigercrm/branches/5.0.3/modules/Reports/ReportRun.php
vtigercrm/branches/5.0.3/modules/Reports/Reports.php
Modified: vtigercrm/branches/5.0.3/include/utils/CommonUtils.php
==============================================================================
--- vtigercrm/branches/5.0.3/include/utils/CommonUtils.php (original)
+++ vtigercrm/branches/5.0.3/include/utils/CommonUtils.php Wed Dec 6 22:52:47 2006
@@ -329,6 +329,27 @@
return $tabid;
}
+/**
+ * Function to get the CustomViewName
+ * Takes the input as $cvid - customviewid
+ * returns the cvname string fromat
+ */
+
+function getCVname($cvid)
+{
+ global $log;
+ $log->debug("Entering getCVname method ...");
+
+ global $adb;
+ $sql = "select viewname from vtiger_customview where cvid=".$cvid;
+ $result = $adb->query($sql);
+ $cvname = $adb->query_result($result,0,"viewname");
+
+ $log->debug("Exiting getCVname method ...");
+ return $cvname;
+
+}
+
/**
@@ -2053,7 +2074,7 @@
}
function getUserslist()
{
- global $log;
+ global $log,$current_user;
$log->debug("Entering getUserslist() method ...");
global $adb;
$result=$adb->query("select * from vtiger_users");
@@ -2062,7 +2083,7 @@
$useridlist[$i]=$adb->query_result($result,$i,'id');
$usernamelist[$useridlist[$i]]=$adb->query_result($result,$i,'user_name');
}
- $change_owner = get_select_options_with_id($usernamelist,'admin');
+ $change_owner = get_select_options_with_id($usernamelist,$current_user->user_name);
$log->debug("Exiting getUserslist method ...");
return $change_owner;
}
Modified: vtigercrm/branches/5.0.3/include/utils/ListViewUtils.php
==============================================================================
--- vtigercrm/branches/5.0.3/include/utils/ListViewUtils.php (original)
+++ vtigercrm/branches/5.0.3/include/utils/ListViewUtils.php Wed Dec 6 22:52:47 2006
@@ -984,8 +984,11 @@
global $log;
$log->debug("Entering getValue(".$field_result.",". $list_result.",".$fieldname.",".$focus.",".$module.",".$entity_id.",".$list_result_count.",".$mode.",".$popuptype.",".$returnset.",".$viewid.") method ...");
global $adb,$current_user;
+
+ $viewname = getCVname($viewid);
require('user_privileges/user_privileges_'.$current_user->id.'.php');
$tabname = getParentTab();
+ $tabid = getTabid($module);
$uicolarr=$field_result[$fieldname];
foreach($uicolarr as $key=>$value)
{
@@ -1020,6 +1023,12 @@
else
{
$value = $temp_val;
+ }
+ //Added to get both start date & time
+ if(($tabid == 9 || $tabid == 16) && $uitype == 6 && $viewname != 'All')
+ {
+ $timestart = $adb->query_result($list_result,$list_result_count,'time_start');
+ $value = $value .' '.$timestart;
}
}
@@ -2542,6 +2551,7 @@
//code added by raju ends
$log->debug("Exiting getRelatedTo method ...");
return $parent_value;
+
}
Modified: vtigercrm/branches/5.0.3/modules/CustomView/CustomView.php
==============================================================================
--- vtigercrm/branches/5.0.3/modules/CustomView/CustomView.php (original)
+++ vtigercrm/branches/5.0.3/modules/CustomView/CustomView.php Wed Dec 6 22:52:47 2006
@@ -184,6 +184,8 @@
{
global $adb;
$tabid = getTabid($module);
+ if($tabid == 9)
+ $tabid ="9,16";
global $current_user;
require('user_privileges/user_privileges_'.$current_user->id.'.php');
if($tabid == 4 || $tabid ==7)
@@ -197,7 +199,7 @@
if($is_admin == true || $profileGlobalPermission[1] == 0 || $profileGlobalPermission[2] == 0)
{
$sql = "select * from vtiger_field ";
- $sql.= " where vtiger_field.tabid=".$tabid." and vtiger_field.block in (".$block.") and";
+ $sql.= " where vtiger_field.tabid in (".$tabid.") and vtiger_field.block in (".$block.") and";
$sql.= $display_type;
$sql.= " order by sequence";
}
@@ -206,13 +208,12 @@
$profileList = getCurrentUserProfileList();
$sql = "select * from vtiger_field inner join vtiger_profile2field on vtiger_profile2field.fieldid=vtiger_field.fieldid inner join vtiger_def_org_field on vtiger_def_org_field.fieldid=vtiger_field.fieldid ";
- $sql.= " where vtiger_field.tabid=".$tabid." and vtiger_field.block in (".$block.") and";
+ $sql.= " where vtiger_field.tabid in (".$tabid.") and vtiger_field.block in (".$block.") and";
$sql.= "$display_type and vtiger_profile2field.visible=0";
- $sql.= " and vtiger_def_org_field.visible=0 and vtiger_profile2field.profileid in ".$profileList." order by sequence";
+ $sql.= " and vtiger_def_org_field.visible=0 and vtiger_profile2field.profileid in ".$profileList." order by sequence group by columnname";
}
-
-
-
+ if($tabid == '9,16')
+ $tabid ="9";
$result = $adb->query($sql);
$noofrows = $adb->num_rows($result);
//Added on 14-10-2005 -- added ticket id in list
@@ -287,6 +288,7 @@
foreach($this->module_list[$module] as $key=>$value)
{
$columnlist = $this->getColumnsListbyBlock($module,$value);
+
if(isset($columnlist))
{
$ret_module_list[$module][$key] = $columnlist;
@@ -1429,6 +1431,7 @@
{
if($viewid != "" && $listquery != "")
{
+
$listviewquery = substr($listquery, strpos($listquery,'FROM'),strlen($listquery));
if($module == "Calendar" || $module == "Emails")
{
@@ -1539,8 +1542,14 @@
global $current_language;
$current_mod_strings = return_specified_module_language($current_language, $module);
$block_info = Array();
- $Sql = "select distinct block,vtiger_field.tabid,name,blocklabel from vtiger_field inner join vtiger_blocks on vtiger_blocks.blockid=vtiger_field.block inner join vtiger_tab on vtiger_tab.tabid=vtiger_field.tabid where displaytype != 3 and vtiger_field.block not in(40,6,75,35,30,54,60,66,72) and vtiger_tab.name='$module' order by block";
+ if($module == "Calendar")
+ $module = "Calendar','Events";
+
+ $Sql = "select distinct block,vtiger_field.tabid,name,blocklabel from vtiger_field inner join vtiger_blocks on vtiger_blocks.blockid=vtiger_field.block inner join vtiger_tab on vtiger_tab.tabid=vtiger_field.tabid where displaytype != 3 and vtiger_field.block not in(40,6,75,35,30,54,60,66,72) and vtiger_tab.name in ('".$module."') order by block";
$result = $adb->query($Sql);
+ if($module == "Calendar','Events")
+ $module = "Calendar";
+
while($block_result = $adb->fetch_array($result))
{
$block_label = $block_result['blocklabel'];
Modified: vtigercrm/branches/5.0.3/modules/Reports/ReportRun.php
==============================================================================
--- vtigercrm/branches/5.0.3/modules/Reports/ReportRun.php (original)
+++ vtigercrm/branches/5.0.3/modules/Reports/ReportRun.php Wed Dec 6 22:52:47 2006
@@ -1081,6 +1081,29 @@
}
if($module == "Calendar")
{
+ //Added Leads,Accounts,Potentials as secondarymodule for Calendar
+
+ if($secmodule == "Leads")
+ {
+ $query = "left join vtiger_leaddetails on vtiger_leaddetails.leadid = vtiger_seactivityrel.crmid
+ left join vtiger_crmentity as vtiger_crmentityLeads on vtiger_crmentityLeads.crmid = vtiger_leaddetails.leadid
+ left join vtiger_leadaddress on vtiger_leaddetails.leadid = vtiger_leadaddress.leadaddressid
+ left join vtiger_leadsubdetails on vtiger_leadsubdetails.leadsubscriptionid = vtiger_leaddetails.leadid
+ left join vtiger_leadscf on vtiger_leadscf.leadid = vtiger_leaddetails.leadid
+ left join vtiger_users as vtiger_usersLeads on vtiger_usersLeads.id = vtiger_crmentityLeads.smownerid ";
+
+ }
+ if($secmodule == "Accounts")
+ {
+ $query = "left join vtiger_account on vtiger_account.accountid = vtiger_seactivityrel.crmid
+ left join vtiger_crmentity as vtiger_crmentityAccounts on vtiger_crmentityAccounts.crmid=vtiger_account.accountid
+ left join vtiger_accountbillads on vtiger_account.accountid=vtiger_accountbillads.accountaddressid
+ left join vtiger_accountshipads on vtiger_account.accountid=vtiger_accountshipads.accountaddressid
+ left join vtiger_accountscf on vtiger_account.accountid = vtiger_accountscf.accountid
+ left join vtiger_account as vtiger_accountAccounts on vtiger_accountAccounts.accountid = vtiger_account.parentid
+ left join vtiger_users as vtiger_usersAccounts on vtiger_usersAccounts.id = vtiger_crmentityAccounts.smownerid ";
+
+ }
if($secmodule == "Contacts")
{
$query = "left join vtiger_contactdetails on vtiger_contactdetails.contactid = vtiger_cntactivityrel.contactid
@@ -1093,6 +1116,14 @@
left join vtiger_contactscf on vtiger_contactdetails.contactid = vtiger_contactscf.contactid
left join vtiger_users as vtiger_usersContacts on vtiger_usersContacts.id = vtiger_crmentityContacts.smownerid ";
}
+ if($secmodule == "Potentials")
+ {
+ $query = "left join vtiger_potential on vtiger_potential.potentialid = vtiger_seactivityrel.crmid
+ left join vtiger_crmentity as vtiger_crmentityPotentials on vtiger_crmentityPotentials.crmid=vtiger_potential.potentialid
+ left join vtiger_potentialscf on vtiger_potentialscf.potentialid = vtiger_potential.potentialid
+ left join vtiger_users as vtiger_usersPotentials on vtiger_usersPotentials.id = vtiger_crmentityPotentials.smownerid ";
+
+ }
}
if($module == 'Campaigns')
{
Modified: vtigercrm/branches/5.0.3/modules/Reports/Reports.php
==============================================================================
--- vtigercrm/branches/5.0.3/modules/Reports/Reports.php (original)
+++ vtigercrm/branches/5.0.3/modules/Reports/Reports.php Wed Dec 6 22:52:47 2006
@@ -41,7 +41,7 @@
'Accounts'=>Array('Potentials','Contacts','Products','Quotes','Invoice'),
'Contacts'=>Array('Accounts','Potentials','Quotes','PurchaseOrder'),
'Potentials'=>Array('Accounts','Contacts','Quotes'),
- 'Calendar'=>Array('Contacts'),
+ 'Calendar'=>Array('Leads','Accounts','Contacts','Potentials'),
'Products'=>Array('Accounts','Contacts'),
'HelpDesk'=>Array('Products'),
'Quotes'=>Array('Accounts','Contacts','Potentials'),
More information about the vtigercrm-commits
mailing list