[Vtigercrm-commits] [vtiger-commits] r6005 - in /vtigercrm/branches/5.0_postgresql_integration: data/ include/ include/utils/ modules/Activities/ modules/Calendar/ modules/Contacts/ modules/Users/
vtigercrm-commits at vtiger.fosslabs.com
vtigercrm-commits at vtiger.fosslabs.com
Mon May 15 21:41:34 EDT 2006
Author: allanbush
Date: Mon May 15 19:41:27 2006
New Revision: 6005
Log:
Misc database fixes. Refs #752.
Modified:
vtigercrm/branches/5.0_postgresql_integration/data/CRMEntity.php
vtigercrm/branches/5.0_postgresql_integration/include/RelatedListView.php
vtigercrm/branches/5.0_postgresql_integration/include/utils/utils.php
vtigercrm/branches/5.0_postgresql_integration/modules/Activities/RenderRelatedListUI.php
vtigercrm/branches/5.0_postgresql_integration/modules/Calendar/Appointment.php
vtigercrm/branches/5.0_postgresql_integration/modules/Contacts/Contact.php
vtigercrm/branches/5.0_postgresql_integration/modules/Users/CreateUserPrivilegeFile.php
vtigercrm/branches/5.0_postgresql_integration/modules/Users/LoginHistory.php
Modified: vtigercrm/branches/5.0_postgresql_integration/data/CRMEntity.php
==============================================================================
--- vtigercrm/branches/5.0_postgresql_integration/data/CRMEntity.php (original)
+++ vtigercrm/branches/5.0_postgresql_integration/data/CRMEntity.php Mon May 15 19:41:27 2006
@@ -345,7 +345,7 @@
$adb->query($sql1);
if($ownerid != $current_user->id)
{
- $sql1 = "insert into ownernotify values(".$this->id.",".$ownerid.",'')";
+ $sql1 = "insert into ownernotify values(".$this->id.",".$ownerid.",null)";
$adb->query($sql1);
}
}
Modified: vtigercrm/branches/5.0_postgresql_integration/include/RelatedListView.php
==============================================================================
--- vtigercrm/branches/5.0_postgresql_integration/include/RelatedListView.php (original)
+++ vtigercrm/branches/5.0_postgresql_integration/include/RelatedListView.php Mon May 15 19:41:27 2006
@@ -80,12 +80,6 @@
if(isset($where) && $where != '')
{
$query .= ' and '.$where;
- }
-
- //Appending the group by for Jaguar/Don
- if($relatedmodule == 'Activities')
- {
- $query .= ' group by crmentity.crmid';
}
Modified: vtigercrm/branches/5.0_postgresql_integration/include/utils/utils.php
==============================================================================
--- vtigercrm/branches/5.0_postgresql_integration/include/utils/utils.php (original)
+++ vtigercrm/branches/5.0_postgresql_integration/include/utils/utils.php Mon May 15 19:41:27 2006
@@ -1161,7 +1161,7 @@
function ChangeStatus($status,$activityid,$activity_mode='')
{
global $log;
- $log->debug("Entering ChangeStatus(".$status.",".$activityid.",".$activity_mode=''.") method ...");
+ $log->debug("Entering ChangeStatus(".$status.",".$activityid.",".$activity_mode."='') method ...");
$log->info("in ChangeStatus ".$status. ' activityid is '.$activityid);
global $adb;
@@ -1173,7 +1173,9 @@
{
$query = "Update activity set eventstatus='".$status."' where activityid = ".$activityid;
}
- $adb->query($query);
+ if($query) {
+ $adb->query($query);
+ }
$log->debug("Exiting ChangeStatus method ...");
}
@@ -1278,7 +1280,7 @@
function getProductImageName($id,$deleted_array='')
{
global $log;
- $log->debug("Entering getProductImageName(".$id.",".$deleted_array=''.") method ...");
+ $log->debug("Entering getProductImageName(".$id.",".$deleted_array."='') method ...");
global $adb;
$image_array=array();
$query = "select imagename from products where productid=".$id;
Modified: vtigercrm/branches/5.0_postgresql_integration/modules/Activities/RenderRelatedListUI.php
==============================================================================
--- vtigercrm/branches/5.0_postgresql_integration/modules/Activities/RenderRelatedListUI.php (original)
+++ vtigercrm/branches/5.0_postgresql_integration/modules/Activities/RenderRelatedListUI.php Mon May 15 19:41:27 2006
@@ -64,7 +64,7 @@
if( $owner != $userid)
{
- $usr_query="select activityid,activity.date_start,activity.due_date, activity.time_start,activity.duration_hours,activity.duration_minutes,crmentity.smownerid from activity,crmentity where crmentity.crmid=activity.activityid and ('".$avail_date."' like date_start) and crmentity.smownerid=".$userid." and activity.activityid !=".$activity_id." and crmentity.deleted=0 group by crmid;";
+ $usr_query="select activityid,activity.date_start,activity.due_date, activity.time_start,activity.duration_hours,activity.duration_minutes,crmentity.smownerid from activity,crmentity where crmentity.crmid=activity.activityid and ('".$avail_date."' like date_start) and crmentity.smownerid=".$userid." and activity.activityid !=".$activity_id." and crmentity.deleted=0";
}
else
{
Modified: vtigercrm/branches/5.0_postgresql_integration/modules/Calendar/Appointment.php
==============================================================================
--- vtigercrm/branches/5.0_postgresql_integration/modules/Calendar/Appointment.php (original)
+++ vtigercrm/branches/5.0_postgresql_integration/modules/Calendar/Appointment.php Mon May 15 19:41:27 2006
@@ -48,8 +48,6 @@
}
$q.=" ((activity.date_start < '". $to_datetime->get_formatted_date() ."' AND activity.date_start >= '". $from_datetime->get_formatted_date()."')";
- $q.=" and (activity.date_start like (activity.due_date) or (activity.date_start != '0000-00-00' ))";
-
if(!is_admin($current_user))
{
$q .= " ) AND ((crmentity.smownerid ='".$current_user->id."' and salesmanactivityrel.smid = '".$current_user->id."') or (crmentity.smownerid in ($shared_ids) and salesmanactivityrel.smid in ($shared_ids) and activity.visibility='Public'))";
Modified: vtigercrm/branches/5.0_postgresql_integration/modules/Contacts/Contact.php
==============================================================================
--- vtigercrm/branches/5.0_postgresql_integration/modules/Contacts/Contact.php (original)
+++ vtigercrm/branches/5.0_postgresql_integration/modules/Contacts/Contact.php Mon May 15 19:41:27 2006
@@ -316,7 +316,7 @@
$log->info("Activity Related List for Contact Displayed");
- $query = "SELECT contactdetails.lastname, contactdetails.firstname, activity.activityid , activity.subject, activity.activitytype, activity.date_start, activity.due_date, cntactivityrel.contactid, crmentity.crmid, crmentity.smownerid, crmentity.modifiedtime, recurringevents.recurringtype from contactdetails inner join cntactivityrel on cntactivityrel.contactid = contactdetails.contactid inner join activity on cntactivityrel.activityid=activity.activityid inner join crmentity on crmentity.crmid = cntactivityrel.activityid left outer join recurringevents on recurringevents.activityid=activity.activityid left join activitygrouprelation on activitygrouprelation.activityid=crmentity.crmid left join groups on groups.groupname=activitygrouprelation.groupname where contactdetails.contactid=".$id." and crmentity.deleted = 0 and (activity.activitytype = 'Meeting' or activity.activitytype='Call' or activity.activitytype='Task') AND ( activity.status is NULL || activity.status != 'Completed' ) and ( activity.eventstatus is NULL || activity.eventstatus != 'Held') and ( activity.eventstatus is NULL || activity.eventstatus != 'Not Held' )"; //recurring type is added in Query -Jaguar
+ $query = "SELECT contactdetails.lastname, contactdetails.firstname, activity.activityid , activity.subject, activity.activitytype, activity.date_start, activity.due_date, cntactivityrel.contactid, crmentity.crmid, crmentity.smownerid, crmentity.modifiedtime, recurringevents.recurringtype from contactdetails inner join cntactivityrel on cntactivityrel.contactid = contactdetails.contactid inner join activity on cntactivityrel.activityid=activity.activityid inner join crmentity on crmentity.crmid = cntactivityrel.activityid left outer join recurringevents on recurringevents.activityid=activity.activityid left join activitygrouprelation on activitygrouprelation.activityid=crmentity.crmid left join groups on groups.groupname=activitygrouprelation.groupname where contactdetails.contactid=".$id." and crmentity.deleted = 0 and (activity.activitytype = 'Meeting' or activity.activitytype='Call' or activity.activitytype='Task') AND ( activity.status is NULL OR activity.status != 'Completed' ) and ( activity.eventstatus is NULL OR activity.eventstatus != 'Held') and ( activity.eventstatus is NULL OR activity.eventstatus != 'Not Held' )"; //recurring type is added in Query -Jaguar
$log->debug("Exiting get_activities method ...");
return GetRelatedList('Contacts','Activities',$focus,$query,$button,$returnset);
@@ -366,10 +366,10 @@
{
global $log;
$log->debug("Entering get_attachments(".$id.") method ...");
- $query = "select notes.title,'Notes ' ActivityType,
- notes.filename, attachments.type FileType,crm2.modifiedtime lastmodified,
- seattachmentsrel.attachmentsid attachmentsid, notes.notesid crmid,
- crm2.createdtime, notes.notecontent description, users.user_name
+ $query = "select notes.title,'Notes ' AS ActivityType,
+ notes.filename, attachments.type AS FileType,crm2.modifiedtime AS lastmodified,
+ seattachmentsrel.attachmentsid AS attachmentsid, notes.notesid AS crmid,
+ crm2.createdtime, notes.notecontent AS description, users.user_name
from notes
inner join crmentity on crmentity.crmid= notes.contact_id
inner join crmentity crm2 on crm2.crmid=notes.notesid and crm2.deleted=0
@@ -378,9 +378,9 @@
inner join users on crm2.smcreatorid= users.id
where crmentity.crmid=".$id;
$query .= " union all ";
- $query .= "select attachments.description title,'Attachments' ActivityType,
- attachments.name filename, attachments.type FileType,crm2.modifiedtime lastmodified,
- attachments.attachmentsid attachmentsid, seattachmentsrel.attachmentsid crmid,
+ $query .= "select attachments.description AS title,'Attachments' AS ActivityType,
+ attachments.name AS filename, attachments.type AS FileType,crm2.modifiedtime AS lastmodified,
+ attachments.attachmentsid AS attachmentsid, seattachmentsrel.attachmentsid AS crmid,
crm2.createdtime, attachments.description, users.user_name
from attachments
inner join seattachmentsrel on seattachmentsrel.attachmentsid= attachments.attachmentsid
@@ -500,7 +500,7 @@
$log->info("Email Related List for Contact Displayed");
- $query = 'select activity.activityid, activity.activityid, activity.subject, activity.activitytype, users.user_name, crmentity.modifiedtime, crmentity.crmid, crmentity.smownerid, activity.date_start from activity, seactivityrel, contactdetails, users, crmentity left join activitygrouprelation on activitygrouprelation.activityid=crmentity.crmid left join groups on groups.groupname=activitygrouprelation.groupname where seactivityrel.activityid = activity.activityid and contactdetails.contactid = seactivityrel.crmid and users.id=crmentity.smownerid and crmentity.crmid = activity.activityid and contactdetails.contactid = '.$id.' and activity.activitytype="Emails" and crmentity.deleted = 0';
+ $query = "select activity.activityid, activity.activityid, activity.subject, activity.activitytype, users.user_name, crmentity.modifiedtime, crmentity.crmid, crmentity.smownerid, activity.date_start from activity, seactivityrel, contactdetails, users, crmentity left join activitygrouprelation on activitygrouprelation.activityid=crmentity.crmid left join groups on groups.groupname=activitygrouprelation.groupname where seactivityrel.activityid = activity.activityid and contactdetails.contactid = seactivityrel.crmid and users.id=crmentity.smownerid and crmentity.crmid = activity.activityid and contactdetails.contactid = ".$id." and activity.activitytype='Emails' and crmentity.deleted = 0";
$log->debug("Exiting get_emails method ...");
return GetRelatedList('Contacts','Emails',$focus,$query,$button,$returnset);
}
Modified: vtigercrm/branches/5.0_postgresql_integration/modules/Users/CreateUserPrivilegeFile.php
==============================================================================
--- vtigercrm/branches/5.0_postgresql_integration/modules/Users/CreateUserPrivilegeFile.php (original)
+++ vtigercrm/branches/5.0_postgresql_integration/modules/Users/CreateUserPrivilegeFile.php Mon May 15 19:41:27 2006
@@ -1232,7 +1232,7 @@
$code = 'array(';
foreach ($var as $key => $value)
{
- $code .= $key.'=>'.$value.',';
+ $code .= "'".$key."'=>".$value.',';
}
$code .= ')';
return $code;
Modified: vtigercrm/branches/5.0_postgresql_integration/modules/Users/LoginHistory.php
==============================================================================
--- vtigercrm/branches/5.0_postgresql_integration/modules/Users/LoginHistory.php (original)
+++ vtigercrm/branches/5.0_postgresql_integration/modules/Users/LoginHistory.php Mon May 15 19:41:27 2006
@@ -69,7 +69,7 @@
function user_logout(&$usname,&$usip,&$outtime)
{
- $logid_qry = "SELECT max(login_id) login_id from loginhistory where user_name='$usname' and user_ip='$usip'";
+ $logid_qry = "SELECT max(login_id) AS login_id from loginhistory where user_name='$usname' and user_ip='$usip'";
$result = $this->db->query($logid_qry);
$loginid = $this->db->query_result($result,0,"login_id");
if ($loginid == '')
More information about the vtigercrm-commits
mailing list