[Vtigercrm-developers] Yet another postgres8 patch
Jens Hamisch
jens at Strawberry.COM
Tue Jul 18 11:44:48 PDT 2006
Hi,
yet another patch addressing postgres8
Kind regards
-- Jens
--------------------------------------------------------------------------------
/
+##+|##+ STRAWBERRY Jens Hamisch
+v#+v v##+ EDV-Systeme GmbH Managing director
/ v v\v
| . . . | Waldeckstr. 9a Car (Voice): (+49 172) 81 04 162
| . | D-82515 Wolfratshausen Voice: (+49 8171) 41805-0
| . | Fax: (+49 8171) 41805-59
\ . / Tel.: (+49 8171) 41805-0 Email: jens at Strawberry.COM
\____/ Strawberry at Strawberry.COM
-------------- next part --------------
*** vtiger_crm/include/database/Postgres8.php.rev8092 Tue Jul 18 20:37:05 2006
--- vtiger_crm/include/database/Postgres8.php Tue Jul 18 20:38:50 2006
***************
*** 122,127 ****
--- 122,131 ----
elseif( $table == "vtiger_profile2field")
$subfields = array ( "profileid", "tabid", "fieldid", "visible", "readonly");
+ //vtiger_field
+ elseif( $table == "vtiger_field")
+ $subfields = array ( "tabid", "fieldid", "columnname", "tablename", "generatedtype", "uitype", "fieldname", "fieldlabel", "readonly", "presence", "selected", "maximumlength", "sequence", "block", "displaytype", "typeofdata", "quickcreate", "quickcreatesequence", "info_type");
+
//fields of the requested array still undefined
else
$log->info("function expandRecord: please add structural information for table '".$table."'");
*** vtiger_crm/include/utils/CommonUtils.php.rev8092 Tue Jul 18 20:25:23 2006
--- vtiger_crm/include/utils/CommonUtils.php Tue Jul 18 20:36:01 2006
***************
*** 960,971 ****
{
if($is_admin == true || $profileGlobalPermission[1] == 0 || $profileGlobalPermission[2] == 0 || $module == "Users")
{
! $sql = "select vtiger_field.* from vtiger_field where vtiger_field.tabid=".$tabid." and vtiger_field.block in $blockid_list and vtiger_field.displaytype in (1,2,4) order by block,sequence";
}
else
{
$profileList = getCurrentUserProfileList();
! $sql = "select vtiger_field.* 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 where vtiger_field.tabid=".$tabid." and vtiger_field.block in ".$blockid_list." and vtiger_field.displaytype in (1,2,4) and vtiger_profile2field.visible=0 and vtiger_def_org_field.visible=0 and vtiger_profile2field.profileid in ".$profileList." group by vtiger_field.fieldid order by block,sequence";
}
$result = $adb->query($sql);
$getBlockInfo=getDetailBlockInformation($module,$result,$col_fields,$tabid,$block_label);
--- 960,974 ----
{
if($is_admin == true || $profileGlobalPermission[1] == 0 || $profileGlobalPermission[2] == 0 || $module == "Users")
{
! $sql = "SELECT vtiger_field.* FROM vtiger_field WHERE vtiger_field.tabid=".$tabid." AND vtiger_field.block IN $blockid_list AND vtiger_field.displaytype IN (1,2,4) ORDER BY block,sequence";
}
else
{
$profileList = getCurrentUserProfileList();
! $sql = "SELECT vtiger_field.* 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 WHERE vtiger_field.tabid=".$tabid." AND vtiger_field.block IN ".$blockid_list." AND vtiger_field.displaytype IN (1,2,4) AND vtiger_profile2field.visible=0 AND vtiger_def_org_field.visible=0 AND vtiger_profile2field.profileid IN ".$profileList." GROUP BY vtiger_field.fieldid ORDER BY block,sequence";
! //Postgres 8 fixes
! if( $adb->dbType == "pgsql")
! $sql = fixPostgresQuery( $sql, $log, 0);
}
$result = $adb->query($sql);
$getBlockInfo=getDetailBlockInformation($module,$result,$col_fields,$tabid,$block_label);
***************
*** 976,987 ****
{
if($is_admin==true || $profileGlobalPermission[1] == 0 || $profileGlobalPermission[2]== 0 || $module == 'Users')
{
! $sql = "select vtiger_field.* from vtiger_field where vtiger_field.tabid=".$tabid." and vtiger_field.block in ".$blockid_list ." and ".$display_type_check." and info_type = '".$info_type."' order by block,sequence";
}
else
{
$profileList = getCurrentUserProfileList();
! $sql = "select vtiger_field.* 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 where vtiger_field.tabid=".$tabid." and vtiger_field.block in ".$blockid_list." and ".$display_type_check." and info_type = '".$info_type."' and vtiger_profile2field.visible=0 and vtiger_def_org_field.visible=0 and vtiger_profile2field.profileid in ".$profileList.=" group by vtiger_field.fieldid order by block,sequence";
}
}
else
--- 979,993 ----
{
if($is_admin==true || $profileGlobalPermission[1] == 0 || $profileGlobalPermission[2]== 0 || $module == 'Users')
{
! $sql = "SELECT vtiger_field.* FROM vtiger_field WHERE vtiger_field.tabid=".$tabid." AND vtiger_field.block IN ".$blockid_list ." AND ".$display_type_check." AND info_type = '".$info_type."' ORDER BY block,sequence";
}
else
{
$profileList = getCurrentUserProfileList();
! $sql = "SELECT vtiger_field.* 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 WHERE vtiger_field.tabid=".$tabid." AND vtiger_field.block IN ".$blockid_list." AND ".$display_type_check." AND info_type = '".$info_type."' AND vtiger_profile2field.visible=0 AND vtiger_def_org_field.visible=0 AND vtiger_profile2field.profileid IN ".$profileList.=" GROUP BY vtiger_field.fieldid ORDER BY block,sequence";
! //Postgres 8 fixes
! if( $adb->dbType == "pgsql")
! $sql = fixPostgresQuery( $sql, $log, 0);
}
}
else
***************
*** 988,999 ****
{
if($is_admin==true || $profileGlobalPermission[1] == 0 || $profileGlobalPermission[2] == 0 || $module == 'Users')
{
! $sql = "select vtiger_field.* from vtiger_field where vtiger_field.tabid=".$tabid." and vtiger_field.block in ".$blockid_list." and ".$display_type_check." order by block,sequence";
}
else
{
$profileList = getCurrentUserProfileList();
! $sql = "select vtiger_field.* 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 where vtiger_field.tabid=".$tabid." and vtiger_field.block in ".$blockid_list." and ".$display_type_check." and vtiger_profile2field.visible=0 and vtiger_def_org_field.visible=0 and vtiger_profile2field.profileid in ".$profileList.=" group by vtiger_field.fieldid order by block,sequence";
}
}
$result = $adb->query($sql);
--- 994,1008 ----
{
if($is_admin==true || $profileGlobalPermission[1] == 0 || $profileGlobalPermission[2] == 0 || $module == 'Users')
{
! $sql = "SELECT vtiger_field.* FROM vtiger_field WHERE vtiger_field.tabid=".$tabid." AND vtiger_field.block IN ".$blockid_list." AND ".$display_type_check." ORDER BY block,sequence";
}
else
{
$profileList = getCurrentUserProfileList();
! $sql = "SELECT vtiger_field.* 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 WHERE vtiger_field.tabid=".$tabid." AND vtiger_field.block IN ".$blockid_list." AND ".$display_type_check." AND vtiger_profile2field.visible=0 AND vtiger_def_org_field.visible=0 AND vtiger_profile2field.profileid IN ".$profileList.=" GROUP BY vtiger_field.fieldid ORDER BY block,sequence";
! //Postgres 8 fixes
! if( $adb->dbType == "pgsql")
! $sql = fixPostgresQuery( $sql, $log, 0);
}
}
$result = $adb->query($sql);
***************
*** 1789,1796 ****
}
else
{
! $profileList = getCurrentUserProfileList();
! $quickcreate_query = "select vtiger_field.* 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 where vtiger_field.tabid=".$tabid." and quickcreate=0 and vtiger_profile2field.visible=0 and vtiger_def_org_field.visible=0 and vtiger_profile2field.profileid in ".$profileList." order by quickcreatesequence";
}
$category = getParentTab();
--- 1798,1808 ----
}
else
{
! $profileList = getCurrentUserProfileList();
! $quickcreate_query = "SELECT vtiger_field.* 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 WHERE vtiger_field.tabid=".$tabid." AND quickcreate=0 AND vtiger_profile2field.visible=0 AND vtiger_def_org_field.visible=0 AND vtiger_profile2field.profileid IN ".$profileList." ORDER BY quickcreatesequence";
! //Postgres 8 fixes
! if( $adb->dbType == "pgsql")
! $quickcreate_query = fixPostgresQuery( $quickcreate_query, $log, 0);
}
$category = getParentTab();
*** vtiger_crm/modules/Users/Authenticate.php.rev8092 Tue Jul 18 19:55:38 2006
--- vtiger_crm/modules/Users/Authenticate.php Tue Jul 18 19:57:24 2006
***************
*** 40,47 ****
{
//Inserting entries for audit trail during login
! $date_var = date('YmdHis');
! $query = "insert into vtiger_audit_trial values(".$adb->getUniqueID('vtiger_audit_trial').",".$focus->id.",'Users','Authenticate',0,$date_var)";
$adb->query($query);
--- 40,47 ----
{
//Inserting entries for audit trail during login
! $date_var = date('Y-m-d H:i:s');
! $query = "insert into vtiger_audit_trial values(".$adb->getUniqueID('vtiger_audit_trial').",".$focus->id.",'Users','Authenticate',0,'$date_var')";
$adb->query($query);
More information about the vtigercrm-developers
mailing list