Skip to content
Snippets Groups Projects
Commit 5a479bba authored by Prasad's avatar Prasad
Browse files

Fixed - php errors for dashboard widgets

parent aa366b16
No related branches found
No related tags found
1 merge request!1233E_ALL fixes across modules for PHP 8.x
...@@ -916,6 +916,8 @@ class CustomView extends CRMEntity { ...@@ -916,6 +916,8 @@ class CustomView extends CRMEntity {
$advft_criteria = Vtiger_Cache::get('advftCriteria',$cvid); $advft_criteria = Vtiger_Cache::get('advftCriteria',$cvid);
if(!$advft_criteria){ if(!$advft_criteria){
$advft_criteria = array();
// Not a good approach to get all the fields if not required(May leads to Performance issue) // Not a good approach to get all the fields if not required(May leads to Performance issue)
$sql = 'SELECT groupid,group_condition FROM vtiger_cvadvfilter_grouping WHERE cvid = ? ORDER BY groupid'; $sql = 'SELECT groupid,group_condition FROM vtiger_cvadvfilter_grouping WHERE cvid = ? ORDER BY groupid';
$groupsresult = $adb->pquery($sql, array($cvid)); $groupsresult = $adb->pquery($sql, array($cvid));
......
...@@ -28,9 +28,12 @@ class Install_Index_view extends Vtiger_View_Controller { ...@@ -28,9 +28,12 @@ class Install_Index_view extends Vtiger_View_Controller {
} }
protected function applyInstallFriendlyEnv() { protected function applyInstallFriendlyEnv() {
// config.inc.php - will not be ready to control this yet. // config.inc.php - will not be ready to control this yet
// version_compare(PHP_VERSION, '5.5.0') <= 0 ? error_reporting(E_ERROR & ~E_NOTICE & ~E_DEPRECATED) : error_reporting(E_ERROR & ~E_NOTICE & ~E_DEPRECATED & ~E_STRICT); // Production // if overriden in dev mode skip changes.
// version_compare(PHP_VERSION, '7.0.0') >= 0 ? error_reporting(E_WARNING & ~E_NOTICE) : error_reporting(E_WARNING & ~E_NOTICE & ~E_DEPRECATED & E_ERROR & ~E_STRICT); // Debug if (error_reporting() != E_ALL) {
version_compare(PHP_VERSION, '5.5.0') <= 0 ? error_reporting(E_ERROR & ~E_NOTICE & ~E_DEPRECATED) : error_reporting(E_ERROR & ~E_NOTICE & ~E_DEPRECATED & ~E_STRICT); // Production
// version_compare(PHP_VERSION, '7.0.0') >= 0 ? error_reporting(E_WARNING & ~E_NOTICE) : error_reporting(E_WARNING & ~E_NOTICE & ~E_DEPRECATED & E_ERROR & ~E_STRICT); // Debug
}
set_time_limit(0); // override limits on execution time to allow install to finish set_time_limit(0); // override limits on execution time to allow install to finish
} }
......
...@@ -233,6 +233,8 @@ class Leads_Module_Model extends Vtiger_Module_Model { ...@@ -233,6 +233,8 @@ class Leads_Module_Model extends Vtiger_Module_Model {
} }
$params = array(); $params = array();
$dateFilterSql = '';
if(!empty($dateFilter)) { if(!empty($dateFilter)) {
$dateFilterSql = ' AND createdtime BETWEEN ? AND ? '; $dateFilterSql = ' AND createdtime BETWEEN ? AND ? ';
//appended time frame and converted to db time zone in showwidget.php //appended time frame and converted to db time zone in showwidget.php
......
...@@ -28,7 +28,10 @@ class Migration_Index_View extends Vtiger_View_Controller { ...@@ -28,7 +28,10 @@ class Migration_Index_View extends Vtiger_View_Controller {
public function process(Vtiger_Request $request) { public function process(Vtiger_Request $request) {
// Override error reporting to production mode // Override error reporting to production mode
// version_compare(PHP_VERSION, '5.5.0') <= 0 ? error_reporting(E_WARNING & ~E_NOTICE & ~E_DEPRECATED) : error_reporting(E_WARNING & ~E_NOTICE & ~E_DEPRECATED & ~E_STRICT); // if not set to strict development.
if (error_reporting() != E_ALL) {
version_compare(PHP_VERSION, '5.5.0') <= 0 ? error_reporting(E_WARNING & ~E_NOTICE & ~E_DEPRECATED) : error_reporting(E_WARNING & ~E_NOTICE & ~E_DEPRECATED & ~E_STRICT);
}
// Migration could be heavy at-times. // Migration could be heavy at-times.
set_time_limit(0); set_time_limit(0);
......
...@@ -56,6 +56,8 @@ class Potentials_Module_Model extends Vtiger_Module_Model { ...@@ -56,6 +56,8 @@ class Potentials_Module_Model extends Vtiger_Module_Model {
$ownerSql = ' AND smownerid = ? '; $ownerSql = ' AND smownerid = ? ';
$params[] = $owner; $params[] = $owner;
} }
$dateFilterSql = '';
if(!empty($dateFilter)) { if(!empty($dateFilter)) {
$dateFilterSql = ' AND closingdate BETWEEN ? AND ? '; $dateFilterSql = ' AND closingdate BETWEEN ? AND ? ';
$params[] = $dateFilter['start']; $params[] = $dateFilter['start'];
...@@ -141,6 +143,8 @@ class Potentials_Module_Model extends Vtiger_Module_Model { ...@@ -141,6 +143,8 @@ class Potentials_Module_Model extends Vtiger_Module_Model {
'INNER JOIN vtiger_sales_stage ON vtiger_potential.sales_stage = vtiger_sales_stage.sales_stage 'INNER JOIN vtiger_sales_stage ON vtiger_potential.sales_stage = vtiger_sales_stage.sales_stage
WHERE vtiger_potential.sales_stage IN ('.generateQuestionMarks($picklistvaluesmap).') WHERE vtiger_potential.sales_stage IN ('.generateQuestionMarks($picklistvaluesmap).')
GROUP BY smownerid, sales_stage ORDER BY vtiger_sales_stage.sortorderid', $params); GROUP BY smownerid, sales_stage ORDER BY vtiger_sales_stage.sortorderid', $params);
$data = array();
for($i=0; $i<$db->num_rows($result); $i++) { for($i=0; $i<$db->num_rows($result); $i++) {
$row = $db->query_result_rowdata($result, $i); $row = $db->query_result_rowdata($result, $i);
$row['link'] = decode_html($row['sales_stage']); $row['link'] = decode_html($row['sales_stage']);
...@@ -161,6 +165,8 @@ class Potentials_Module_Model extends Vtiger_Module_Model { ...@@ -161,6 +165,8 @@ class Potentials_Module_Model extends Vtiger_Module_Model {
//TODO need to handle security //TODO need to handle security
$params = array(); $params = array();
$params[] = 'Closed Won'; $params[] = 'Closed Won';
$dateFilterSql = '';
if(!empty($dateFilter)) { if(!empty($dateFilter)) {
$dateFilterSql = ' AND createdtime BETWEEN ? AND ? '; $dateFilterSql = ' AND createdtime BETWEEN ? AND ? ';
//appended time frame and converted to db time zone in showwidget.php //appended time frame and converted to db time zone in showwidget.php
......
...@@ -27,6 +27,7 @@ class Vtiger_History_Dashboard extends Vtiger_IndexAjax_View { ...@@ -27,6 +27,7 @@ class Vtiger_History_Dashboard extends Vtiger_IndexAjax_View {
$modifiedTime = $request->get('modifiedtime'); $modifiedTime = $request->get('modifiedtime');
//Date conversion from user to database format //Date conversion from user to database format
$dates = array();
if(!empty($modifiedTime)) { if(!empty($modifiedTime)) {
$startDate = Vtiger_Date_UIType::getDBInsertedValue($modifiedTime['start']); $startDate = Vtiger_Date_UIType::getDBInsertedValue($modifiedTime['start']);
$dates['start'] = getValidDBInsertDateTimeValue($startDate . ' 00:00:00'); $dates['start'] = getValidDBInsertDateTimeValue($startDate . ' 00:00:00');
......
...@@ -269,6 +269,7 @@ class Vtiger_Util_Helper { ...@@ -269,6 +269,7 @@ class Vtiger_Util_Helper {
$dateTimeInUserFormat = Vtiger_Datetime_UIType::getDisplayDateTimeValue($dateTime); $dateTimeInUserFormat = Vtiger_Datetime_UIType::getDisplayDateTimeValue($dateTime);
} }
if (substr_count($dateTimeInUserFormat,' ') == 1) $dateTimeInUserFormat .= ' '; // init for meridiem if not present
list($dateInUserFormat, $timeInUserFormat, $meridiem) = explode(' ', $dateTimeInUserFormat); list($dateInUserFormat, $timeInUserFormat, $meridiem) = explode(' ', $dateTimeInUserFormat);
if($meridiem && $currentUser->get('hour_format') === '12' ){ if($meridiem && $currentUser->get('hour_format') === '12' ){
$displayTime = $timeInUserFormat.' '.$meridiem; $displayTime = $timeInUserFormat.' '.$meridiem;
......
...@@ -118,7 +118,7 @@ class Vtiger_DashBoard_Model extends Vtiger_Base_Model { ...@@ -118,7 +118,7 @@ class Vtiger_DashBoard_Model extends Vtiger_Base_Model {
for($i=0, $len=$db->num_rows($result); $i<$len; $i++) { for($i=0, $len=$db->num_rows($result); $i<$len; $i++) {
$row = $db->query_result_rowdata($result, $i); $row = $db->query_result_rowdata($result, $i);
$data = json_decode(decode_html($row['data']), true); $data = json_decode(decode_html($row['data']), true);
$sourceModule = $data['module']; $sourceModule = $data && isset($data['module']) ? $data['module'] : "";
if(!empty($sourceModule) && !vtlib_isModuleActive($sourceModule)) { if(!empty($sourceModule) && !vtlib_isModuleActive($sourceModule)) {
continue; continue;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment