Skip to content
Snippets Groups Projects
Commit 7978ef23 authored by Prasad's avatar Prasad
Browse files

Workaround fix: Bug with Groupby Expected Close Date (month) for report charts

parent 7c24b984
No related branches found
No related tags found
No related merge requests found
......@@ -218,6 +218,14 @@ abstract class Base_Chart extends Vtiger_Base_Model{
$columnSQL = $reportRunObject->getColumnSQL($selectedfields);
// Fix for http://code.vtiger.com/vtiger/vtigercrm/issues/4
switch ($selectedfields[count($selectedfields)-1]) {
case 'MY':
$columnSQL = str_replace('%M', '%m', $columnSQL); // %M (yields Jan), %m - 01
break;
}
// End
$reportRunObject->append_currency_symbol_to_value = $append_currency_symbol_to_value;
return $columnSQL;
}
......@@ -601,4 +609,4 @@ class HorizontalbarChart extends VerticalbarChart {
class LineChart extends VerticalbarChart{
}
\ No newline at end of file
}
......@@ -101,6 +101,13 @@ class Vtiger_Date_UIType extends Vtiger_Base_UIType {
* @return <String>
*/
public static function getDisplayDateValue($date) {
// Fix for http://code.vtiger.com/vtiger/vtigercrm/issues/4
// Handle (MonthNumber Year) format value conversion.
if (preg_match("/([0-9]{1,2}) ([0-9]{1,4})/", $date, $m)) {
return date("M Y", strtotime($m[2].'-'.$m[1].'-'.'1'));
}
// End
$date = new DateTimeField($date);
return $date->getDisplayDate();
}
......@@ -111,6 +118,13 @@ class Vtiger_Date_UIType extends Vtiger_Base_UIType {
* @return <String>
*/
public static function getDisplayDateTimeValue($dateTime) {
// Fix for http://code.vtiger.com/vtiger/vtigercrm/issues/4
// Handle (MonthNumber Year) format value conversion.
if (preg_match("/([0-9]{1,2}) ([0-9]{1,4})/", $date, $m)) {
return date("M Y", strtotime($m[2].'-'.$m[1].'-'.'1'));
}
// End
$date = new DateTimeField($dateTime);
return $date->getDisplayDateTimeValue();
}
......@@ -119,4 +133,4 @@ class Vtiger_Date_UIType extends Vtiger_Base_UIType {
return 'uitypes/DateFieldSearchView.tpl';
}
}
\ No newline at end of file
}
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