diff --git a/.gitignore b/.gitignore index c233733bf48..7487fabbf7c 100644 --- a/.gitignore +++ b/.gitignore @@ -23,12 +23,15 @@ /app/etc/modules/Cm_RedisSession.xml /lib/Credis -# flow.js library -/js/lib/uploader +# ChartJs library +/js/lib/chartjs # TinyMCE library /js/lib/tinymce +# flow.js library +/js/lib/uploader + # Add development environment setup files and README # https://github.com/OpenMage/magento-lts/pull/1012 /dev/openmage/docker-magento diff --git a/app/code/core/Mage/Adminhtml/Block/Dashboard.php b/app/code/core/Mage/Adminhtml/Block/Dashboard.php index 73a86b54ad5..b92ad182556 100644 --- a/app/code/core/Mage/Adminhtml/Block/Dashboard.php +++ b/app/code/core/Mage/Adminhtml/Block/Dashboard.php @@ -24,6 +24,9 @@ class Mage_Adminhtml_Block_Dashboard extends Mage_Adminhtml_Block_Template /** * Location of the "Enable Chart" config param + * + * @deprecated + * @see Mage_Adminhtml_Helper_Dashboard_Data::XML_PATH_ENABLE_CHARTS */ public const XML_PATH_ENABLE_CHARTS = 'admin/dashboard/enable_charts'; @@ -60,7 +63,9 @@ protected function _prepareLayout() $this->getLayout()->createBlock('adminhtml/dashboard_searches_top'), ); - if (Mage::getStoreConfig(self::XML_PATH_ENABLE_CHARTS)) { + /** @var Mage_Adminhtml_Helper_Dashboard_Data $helper */ + $helper = Mage::helper('adminhtml/dashboard_data'); + if ($helper->isChartEnabled()) { $block = $this->getLayout()->createBlock('adminhtml/dashboard_diagrams'); } else { $block = $this->getLayout()->createBlock('adminhtml/template') diff --git a/app/code/core/Mage/Adminhtml/Block/Dashboard/Graph.php b/app/code/core/Mage/Adminhtml/Block/Dashboard/Graph.php index 108de96bb23..a5e02008bc1 100644 --- a/app/code/core/Mage/Adminhtml/Block/Dashboard/Graph.php +++ b/app/code/core/Mage/Adminhtml/Block/Dashboard/Graph.php @@ -1,17 +1,12 @@ setTemplate('dashboard/graph.phtml'); + $this->setDataHelperName('adminhtml/dashboard_order'); + + /** @var Mage_Adminhtml_Helper_Dashboard_Order $dataHelper */ + $dataHelper = $this->getDataHelper(); + + /** @var Mage_Core_Controller_Request_Http $request */ + $request = $this->getRequest(); + + $dataHelper->setParam('store', $request->getParam('store')); + $dataHelper->setParam('website', $request->getParam('website')); + $dataHelper->setParam('group', $request->getParam('group')); } /** @@ -163,23 +148,20 @@ public function getAllSeries() } /** - * Get chart url - * - * @param bool $directUrl - * @return string + * @deprecated + */ + public function getChartUrl($directUrl = true) + { + return ''; + } + + /** * @throws Mage_Core_Model_Store_Exception * @throws Zend_Date_Exception */ - public function getChartUrl($directUrl = true) + public function generateChart(): array { - $params = [ - 'cht' => 'lc', - 'chf' => 'bg,s,f4f4f4|c,lg,90,ffffff,0.1,ededed,0', - 'chm' => 'B,f4d4b2,0,0,0', - 'chco' => 'db4814', - 'chxs' => '0,0,11|1,0,11', - 'chma' => '15,15,15,15', - ]; + $params = []; $this->_allSeries = $this->getRowsData($this->_dataRows); @@ -187,6 +169,69 @@ public function getChartUrl($directUrl = true) $this->setAxisLabels($axis, $this->getRowsData($attr, true)); } + list($datas, $dates) = $this->getChartDatasAndDates(); + $this->_axisLabels['x'] = $dates; + $this->_allSeries = $datas; + + // Image-Charts Awesome data format values + $params['chd'] = 'a:'; + $params['chd'] .= $this->getChartDataFromAllSeries(); + + $valueBuffer = []; + + if (!array_key_exists(self::AXIS_X, $this->_axisLabels) || + !array_key_exists(self::AXIS_Y, $this->_axisLabels) + ) { + return $params; + } + + $params['chxt'] = implode(',', array_keys($this->_axisLabels)); + + $indexid = 0; + foreach (array_keys($this->_axisLabels) as $idx) { + if ($idx === self::AXIS_X) { + foreach ($this->_axisLabels[$idx] as $_index => $_label) { + $this->_axisLabels[$idx][$_index] = ''; + switch ($this->getDataHelper()->getParam('period')) { + case Mage_Reports_Helper_Data::PERIOD_24_HOURS: + $this->_axisLabels[$idx][$_index] = $this->formatTime( + new Zend_Date($_label, 'yyyy-MM-dd HH:00'), + 'short', + ); + break; + case Mage_Reports_Helper_Data::PERIOD_7_DAYS: + case Mage_Reports_Helper_Data::PERIOD_1_MONTH: + $this->_axisLabels[$idx][$_index] = $this->formatDate( + new Zend_Date($_label, 'yyyy-MM-dd'), + ); + break; + case Mage_Reports_Helper_Data::PERIOD_1_YEAR: + case Mage_Reports_Helper_Data::PERIOD_2_YEARS: + $formats = Mage::app()->getLocale()->getTranslationList('datetime'); + $format = $formats['yyMM'] ?? 'MM/yyyy'; + $format = str_replace(['yyyy', 'yy', 'MM'], ['Y', 'y', 'm'], $format); + $this->_axisLabels[$idx][$_index] = date($format, strtotime($_label)); + break; + } + } + + $tmpstring = implode('|', $this->_axisLabels[$idx]); + $valueBuffer[] = $indexid . ':|' . $tmpstring; + } + + if ($idx === self::AXIS_Y) { + $valueBuffer[] = $indexid . ':|' . implode('|', $this->getChartYLabels()); + } + + $indexid++; + } + $params['chxl'] = implode('|', $valueBuffer); + + return $params; + } + + private function getChartDatasAndDates(): array + { $timezoneLocal = Mage::app()->getStore()->getConfig(Mage_Core_Model_Locale::XML_PATH_DEFAULT_TIMEZONE); list($dateStart, $dateEnd) = Mage::getResourceModel('reports/order_collection') @@ -195,69 +240,69 @@ public function getChartUrl($directUrl = true) $dateStart->setTimezone($timezoneLocal); $dateEnd->setTimezone($timezoneLocal); - $d = ''; + $date = ''; $dates = []; $datas = []; while ($dateStart->compare($dateEnd) < 0) { switch ($this->getDataHelper()->getParam('period')) { - case '24h': - $d = $dateStart->toString('yyyy-MM-dd HH:00'); + case Mage_Reports_Helper_Data::PERIOD_24_HOURS: + $date = $dateStart->toString('yyyy-MM-dd HH:00'); $dateStart->addHour(1); break; - case '7d': - case '1m': - $d = $dateStart->toString('yyyy-MM-dd'); + case Mage_Reports_Helper_Data::PERIOD_7_DAYS: + case Mage_Reports_Helper_Data::PERIOD_1_MONTH: + $date = $dateStart->toString('yyyy-MM-dd'); $dateStart->addDay(1); break; - case '1y': - case '2y': - $d = $dateStart->toString('yyyy-MM'); + case Mage_Reports_Helper_Data::PERIOD_1_YEAR: + case Mage_Reports_Helper_Data::PERIOD_2_YEARS: + $date = $dateStart->toString('yyyy-MM'); $dateStart->addMonth(1); break; } foreach (array_keys($this->getAllSeries()) as $index) { - if (in_array($d, $this->_axisLabels['x'])) { + if (in_array($date, $this->_axisLabels['x'])) { $datas[$index][] = (float) array_shift($this->_allSeries[$index]); } else { $datas[$index][] = 0; } } - $dates[] = $d; + $dates[] = $date; } - /** - * setting skip step - */ - if (count($dates) > 8 && count($dates) < 15) { - $c = 1; - } elseif (count($dates) >= 15) { - $c = 2; - } else { - $c = 0; - } - /** - * skipping some x labels for good reading - */ - $i = 0; - foreach ($dates as $k => $d) { - if ($i == $c) { - $dates[$k] = $d; - $i = 0; - } else { - $dates[$k] = ''; - $i++; + return [$datas, $dates]; + } + + private function getChartDataFromAllSeries(): string + { + $yorigin = 0; + $chartdata = []; + + foreach ($this->getAllSeries() as $serie) { + $thisdataarray = $serie; + $thisdataarrayCount = count($thisdataarray); + for ($j = 0; $j < $thisdataarrayCount; $j++) { + $currentvalue = $thisdataarray[$j]; + if (is_numeric($currentvalue)) { + $ylocation = $yorigin + $currentvalue; + $chartdata[] = $ylocation . $this->dataDelimiter; + } else { + $chartdata[] = $this->dataMissing . $this->dataDelimiter; + } } + $chartdata[] = $this->dataSetdelimiter; } - $this->_axisLabels['x'] = $dates; - $this->_allSeries = $datas; + $buffer = implode('', $chartdata); + $buffer = rtrim($buffer, $this->dataSetdelimiter); + $buffer = rtrim($buffer, $this->dataDelimiter); - // Image-Charts Awesome data format values - $params['chd'] = 'a:'; - $dataDelimiter = ','; - $dataSetdelimiter = '|'; - $dataMissing = '_'; + return str_replace(($this->dataDelimiter . $this->dataDelimiter), $this->dataSetdelimiter, $buffer); + } + + private function getChartYLabels(): array + { $localmaxlength = []; $localmaxvalue = []; $localminvalue = []; @@ -282,10 +327,6 @@ public function getChartUrl($directUrl = true) // default values $yLabels = []; - $miny = 0; - $maxy = 0; - $yorigin = 0; - if ($minvalue >= 0 && $maxvalue >= 0) { $miny = 0; if ($maxvalue > 10) { @@ -298,109 +339,7 @@ public function getChartUrl($directUrl = true) } } - $chartdata = []; - - foreach ($this->getAllSeries() as $serie) { - $thisdataarray = $serie; - $thisdataarrayCount = count($thisdataarray); - for ($j = 0; $j < $thisdataarrayCount; $j++) { - $currentvalue = $thisdataarray[$j]; - if (is_numeric($currentvalue)) { - $ylocation = $yorigin + $currentvalue; - $chartdata[] = $ylocation . $dataDelimiter; - } else { - $chartdata[] = $dataMissing . $dataDelimiter; - } - } - $chartdata[] = $dataSetdelimiter; - } - $buffer = implode('', $chartdata); - - $buffer = rtrim($buffer, $dataSetdelimiter); - $buffer = rtrim($buffer, $dataDelimiter); - $buffer = str_replace(($dataDelimiter . $dataSetdelimiter), $dataSetdelimiter, $buffer); - - $params['chd'] .= $buffer; - - $valueBuffer = []; - - if (count($this->_axisLabels)) { - $params['chxt'] = implode(',', array_keys($this->_axisLabels)); - $indexid = 0; - foreach (array_keys($this->_axisLabels) as $idx) { - if ($idx === 'x') { - /** - * Format date - */ - foreach ($this->_axisLabels[$idx] as $_index => $_label) { - if ($_label != '') { - switch ($this->getDataHelper()->getParam('period')) { - case '24h': - $this->_axisLabels[$idx][$_index] = $this->formatTime( - new Zend_Date($_label, 'yyyy-MM-dd HH:00'), - 'short', - ); - break; - case '7d': - case '1m': - $this->_axisLabels[$idx][$_index] = $this->formatDate( - new Zend_Date($_label, 'yyyy-MM-dd'), - ); - break; - case '1y': - case '2y': - $formats = Mage::app()->getLocale()->getTranslationList('datetime'); - $format = $formats['yyMM'] ?? 'MM/yyyy'; - $format = str_replace(['yyyy', 'yy', 'MM'], ['Y', 'y', 'm'], $format); - $this->_axisLabels[$idx][$_index] = date($format, strtotime($_label)); - break; - } - } else { - $this->_axisLabels[$idx][$_index] = ''; - } - } - - $tmpstring = implode('|', $this->_axisLabels[$idx]); - - $valueBuffer[] = $indexid . ':|' . $tmpstring; - if (count($this->_axisLabels[$idx]) > 1) { - $deltaX = 100 / (count($this->_axisLabels[$idx]) - 1); - } else { - $deltaX = 100; - } - } elseif ($idx === 'y') { - $valueBuffer[] = $indexid . ':|' . implode('|', $yLabels); - if (count($yLabels) - 1) { - $deltaY = 100 / (count($yLabels) - 1); - } else { - $deltaY = 100; - } - } - $indexid++; - } - $params['chxl'] = implode('|', $valueBuffer); - } - - // chart size - $params['chs'] = $this->getWidth() . 'x' . $this->getHeight(); - - if (isset($deltaX, $deltaY)) { - $params['chg'] = $deltaX . ',' . $deltaY . ',1,0'; - } - - // return the encoded data - if ($directUrl) { - $p = []; - foreach ($params as $name => $value) { - $p[] = $name . '=' . urlencode($value); - } - return self::API_URL . '?' . implode('&', $p); - } - - $gaData = urlencode(base64_encode(json_encode($params))); - $gaHash = Mage::helper('adminhtml/dashboard_data')->getChartDataHash($gaData); - $params = ['ga' => $gaData, 'h' => $gaHash]; - return $this->getUrl('*/*/tunnel', ['_query' => $params]); + return $yLabels; } /** @@ -506,9 +445,45 @@ protected function _prepareData() $availablePeriods = array_keys($helper->getDatePeriods()); $period = $this->getRequest()->getParam('period'); + $this->setChartId($this->getHtmlId() . random_int(0, 100)); $this->getDataHelper()->setParam( 'period', ($period && in_array($period, $availablePeriods)) ? $period : '24h', ); } + + public function getChartData(): string + { + return json_encode($this->_allSeries[array_key_first($this->_allSeries)]); + } + + public function getChartLabels(): string + { + return json_encode($this->_axisLabels['x']); + } + + public function getChartType(): string + { + return 'bar'; + } + + public function getChartId(): string + { + return $this->getDataByKey('chart_id'); + } + + public function setChartId(string $chartId): self + { + return $this->setData('chart_id', $chartId); + } + + public function getChartBackgroundColor(): string + { + return 'rgba(113,121,142,0.7)'; + } + + public function getChartHoverBackgroundColor(): string + { + return 'rgba(113,121,142,1.0)'; + } } diff --git a/app/code/core/Mage/Adminhtml/Block/Dashboard/Tab/Amounts.php b/app/code/core/Mage/Adminhtml/Block/Dashboard/Tab/Amounts.php index a882f2c49c4..e7117d531fe 100644 --- a/app/code/core/Mage/Adminhtml/Block/Dashboard/Tab/Amounts.php +++ b/app/code/core/Mage/Adminhtml/Block/Dashboard/Tab/Amounts.php @@ -22,6 +22,11 @@ */ class Mage_Adminhtml_Block_Dashboard_Tab_Amounts extends Mage_Adminhtml_Block_Dashboard_Graph { + protected $_axisMaps = [ + 'x' => 'range', + 'y' => 'revenue', + ]; + /** * Initialize object */ @@ -38,17 +43,7 @@ public function __construct() */ protected function _prepareData() { - $this->setDataHelperName('adminhtml/dashboard_order'); - $this->getDataHelper()->setParam('store', $this->getRequest()->getParam('store')); - $this->getDataHelper()->setParam('website', $this->getRequest()->getParam('website')); - $this->getDataHelper()->setParam('group', $this->getRequest()->getParam('group')); - $this->setDataRows('revenue'); - $this->_axisMaps = [ - 'x' => 'range', - 'y' => 'revenue', - ]; - parent::_prepareData(); } } diff --git a/app/code/core/Mage/Adminhtml/Block/Dashboard/Tab/Orders.php b/app/code/core/Mage/Adminhtml/Block/Dashboard/Tab/Orders.php index 00b690c36da..74af61ed4d0 100644 --- a/app/code/core/Mage/Adminhtml/Block/Dashboard/Tab/Orders.php +++ b/app/code/core/Mage/Adminhtml/Block/Dashboard/Tab/Orders.php @@ -22,6 +22,11 @@ */ class Mage_Adminhtml_Block_Dashboard_Tab_Orders extends Mage_Adminhtml_Block_Dashboard_Graph { + protected $_axisMaps = [ + 'x' => 'range', + 'y' => 'quantity', + ]; + public function __construct() { $this->setHtmlId('orders'); @@ -35,17 +40,7 @@ public function __construct() */ protected function _prepareData() { - $this->setDataHelperName('adminhtml/dashboard_order'); - $this->getDataHelper()->setParam('store', $this->getRequest()->getParam('store')); - $this->getDataHelper()->setParam('website', $this->getRequest()->getParam('website')); - $this->getDataHelper()->setParam('group', $this->getRequest()->getParam('group')); - $this->setDataRows('quantity'); - $this->_axisMaps = [ - 'x' => 'range', - 'y' => 'quantity', - ]; - parent::_prepareData(); } } diff --git a/app/code/core/Mage/Adminhtml/Helper/Dashboard/Data.php b/app/code/core/Mage/Adminhtml/Helper/Dashboard/Data.php index 7bcaeed611a..024c575c0d9 100644 --- a/app/code/core/Mage/Adminhtml/Helper/Dashboard/Data.php +++ b/app/code/core/Mage/Adminhtml/Helper/Dashboard/Data.php @@ -14,6 +14,8 @@ * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +use Composer\InstalledVersions; + /** * Data helper for dashboard * @@ -22,11 +24,24 @@ */ class Mage_Adminhtml_Helper_Dashboard_Data extends Mage_Core_Helper_Data { + /** + * Location of the "Enable Chart" config param + */ + public const XML_PATH_ENABLE_CHARTS = 'admin/dashboard/enable_charts'; + protected $_moduleName = 'Mage_Adminhtml'; protected $_locale = null; protected $_stores = null; + public function isChartEnabled(): bool + { + if (!InstalledVersions::isInstalled('nnnick/chartjs')) { + return false; + } + return Mage::getStoreConfigFlag(self::XML_PATH_ENABLE_CHARTS); + } + /** * Retrieve stores configured in system. * @@ -54,16 +69,16 @@ public function countStores() /** * Prepare array with periods for dashboard graphs * - * @return array + * @return string[] */ public function getDatePeriods() { return [ - '24h' => $this->__('Last 24 Hours'), - '7d' => $this->__('Last 7 Days'), - '1m' => $this->__('Current Month'), - '1y' => $this->__('YTD'), - '2y' => $this->__('2YTD'), + Mage_Reports_Helper_Data::PERIOD_24_HOURS => $this->__('Last 24 Hours'), + Mage_Reports_Helper_Data::PERIOD_7_DAYS => $this->__('Last 7 Days'), + Mage_Reports_Helper_Data::PERIOD_1_MONTH => $this->__('Current Month'), + Mage_Reports_Helper_Data::PERIOD_1_YEAR => $this->__('YTD'), + Mage_Reports_Helper_Data::PERIOD_2_YEARS => $this->__('2YTD'), ]; } @@ -73,6 +88,7 @@ public function getDatePeriods() * * @param string $data * @return string + * @deprecated */ public function getChartDataHash($data) { diff --git a/app/code/core/Mage/Adminhtml/controllers/DashboardController.php b/app/code/core/Mage/Adminhtml/controllers/DashboardController.php index c8927590a7c..a2b77fef199 100644 --- a/app/code/core/Mage/Adminhtml/controllers/DashboardController.php +++ b/app/code/core/Mage/Adminhtml/controllers/DashboardController.php @@ -74,29 +74,4 @@ public function ajaxBlockAction() } $this->getResponse()->setBody($output); } - - public function tunnelAction() - { - $httpClient = new Varien_Http_Client(); - $gaData = $this->getRequest()->getParam('ga'); - $gaHash = $this->getRequest()->getParam('h'); - if ($gaData && $gaHash) { - $newHash = Mage::helper('adminhtml/dashboard_data')->getChartDataHash($gaData); - if (hash_equals($newHash, $gaHash)) { - $params = json_decode(base64_decode(urldecode($gaData)), true); - if ($params) { - $response = $httpClient->setUri(Mage_Adminhtml_Block_Dashboard_Graph::API_URL) - ->setParameterGet($params) - ->setConfig(['timeout' => 5]) - ->request('GET'); - - $headers = $response->getHeaders(); - - $this->getResponse() - ->setHeader('Content-type', $headers['Content-type']) - ->setBody($response->getBody()); - } - } - } - } } diff --git a/app/code/core/Mage/Install/Model/Installer.php b/app/code/core/Mage/Install/Model/Installer.php index c743ab52857..d7e9ba7d52d 100644 --- a/app/code/core/Mage/Install/Model/Installer.php +++ b/app/code/core/Mage/Install/Model/Installer.php @@ -141,9 +141,9 @@ public function installDb() } if (!empty($data['enable_charts'])) { - $setupModel->setConfigData(Mage_Adminhtml_Block_Dashboard::XML_PATH_ENABLE_CHARTS, 1); + $setupModel->setConfigData(Mage_Adminhtml_Helper_Dashboard_Data::XML_PATH_ENABLE_CHARTS, 1); } else { - $setupModel->setConfigData(Mage_Adminhtml_Block_Dashboard::XML_PATH_ENABLE_CHARTS, 0); + $setupModel->setConfigData(Mage_Adminhtml_Helper_Dashboard_Data::XML_PATH_ENABLE_CHARTS, 0); } $unsecureBaseUrl = Mage::getBaseUrl('web'); diff --git a/app/code/core/Mage/Reports/Helper/Data.php b/app/code/core/Mage/Reports/Helper/Data.php index 7adac525d11..a60fcda5e34 100644 --- a/app/code/core/Mage/Reports/Helper/Data.php +++ b/app/code/core/Mage/Reports/Helper/Data.php @@ -24,6 +24,15 @@ class Mage_Reports_Helper_Data extends Mage_Core_Helper_Abstract public const REPORT_PERIOD_TYPE_MONTH = 'month'; public const REPORT_PERIOD_TYPE_YEAR = 'year'; + public const PERIOD_CUSTOM = 'custom'; + public const PERIOD_24_HOURS = '24h'; + public const PERIOD_7_DAYS = '7d'; + public const PERIOD_1_MONTH = '1m'; + public const PERIOD_3_MONTH = '3m'; + public const PERIOD_6_MONTH = '6m'; + public const PERIOD_1_YEAR = '1y'; + public const PERIOD_2_YEARS = '2y'; + public const XML_PATH_REPORTS_ENABLED = 'reports/general/enabled'; protected $_moduleName = 'Mage_Reports'; diff --git a/app/code/core/Mage/Reports/Model/Resource/Order/Collection.php b/app/code/core/Mage/Reports/Model/Resource/Order/Collection.php index 867ffd517af..64a0d4fb57e 100644 --- a/app/code/core/Mage/Reports/Model/Resource/Order/Collection.php +++ b/app/code/core/Mage/Reports/Model/Resource/Order/Collection.php @@ -222,25 +222,25 @@ protected function _prepareSummaryAggregated($range, $customStart, $customEnd) /** * Get range expression * - * @param string $range + * @param Mage_Reports_Helper_Data::PERIOD_* $range * @return Zend_Db_Expr */ protected function _getRangeExpression($range) { switch ($range) { - case '24h': + case Mage_Reports_Helper_Data::PERIOD_24_HOURS: $expression = $this->getConnection()->getConcatSql([ $this->getConnection()->getDateFormatSql('{{attribute}}', '%Y-%m-%d %H:'), $this->getConnection()->quote('00'), ]); break; - case '7d': - case '1m': + case Mage_Reports_Helper_Data::PERIOD_7_DAYS: + case Mage_Reports_Helper_Data::PERIOD_1_MONTH: $expression = $this->getConnection()->getDateFormatSql('{{attribute}}', '%Y-%m-%d'); break; - case '1y': - case '2y': - case 'custom': + case Mage_Reports_Helper_Data::PERIOD_1_YEAR: + case Mage_Reports_Helper_Data::PERIOD_2_YEARS: + case Mage_Reports_Helper_Data::PERIOD_CUSTOM: default: $expression = $this->getConnection()->getDateFormatSql('{{attribute}}', '%Y-%m'); break; @@ -306,7 +306,7 @@ protected function _getTZRangeExpressionForAttribute($range, $attribute, $tzFrom /** * Calculate From and To dates (or times) by given period * - * @param string $range + * @param Mage_Reports_Helper_Data::PERIOD_* $range * @param string $customStart * @param string $customEnd * @param bool $returnObjects @@ -327,30 +327,30 @@ public function getDateRange($range, $customStart, $customEnd, $returnObjects = $dateStart->setSecond(0); switch ($range) { - case '24h': + case Mage_Reports_Helper_Data::PERIOD_24_HOURS: $dateEnd = Mage::app()->getLocale()->date(); $dateEnd->addHour(1); $dateStart = clone $dateEnd; $dateStart->subDay(1); break; - case '7d': + case Mage_Reports_Helper_Data::PERIOD_7_DAYS: // subtract 6 days we need to include // only today and not the last one from range $dateStart->subDay(6); break; - case '1m': + case Mage_Reports_Helper_Data::PERIOD_1_MONTH: $dateStart->setDay(Mage::getStoreConfig('reports/dashboard/mtd_start')); break; - case 'custom': - $dateStart = $customStart ? $customStart : $dateEnd; - $dateEnd = $customEnd ? $customEnd : $dateEnd; + case Mage_Reports_Helper_Data::PERIOD_CUSTOM: + $dateStart = $customStart ?: $dateEnd; + $dateEnd = $customEnd ?: $dateEnd; break; - case '1y': - case '2y': + case Mage_Reports_Helper_Data::PERIOD_1_YEAR: + case Mage_Reports_Helper_Data::PERIOD_2_YEARS: $startMonthDay = explode(',', Mage::getStoreConfig('reports/dashboard/ytd_start')); $startMonth = isset($startMonthDay[0]) ? (int) $startMonthDay[0] : 1; $startDay = isset($startMonthDay[1]) ? (int) $startMonthDay[1] : 1; diff --git a/app/design/adminhtml/default/default/template/dashboard/graph.phtml b/app/design/adminhtml/default/default/template/dashboard/graph.phtml index dac97837c6f..4d72d519357 100644 --- a/app/design/adminhtml/default/default/template/dashboard/graph.phtml +++ b/app/design/adminhtml/default/default/template/dashboard/graph.phtml @@ -1,16 +1,11 @@ __('Select Range') ?>:


- getWidth()}px;height:{$this->getHeight()}px; margin:0 auto;"; - ?> + getWidth()};height:{$this->getHeight()}; margin:0 auto;"; ?> getCount()): ?> -

chart

+ generateChart() ?> +
+ +
+

__('No Data Found') ?>

diff --git a/composer.json b/composer.json index 7a8d4664719..b567819e1c0 100644 --- a/composer.json +++ b/composer.json @@ -24,13 +24,15 @@ "ext-simplexml": "*", "ext-soap": "*", "ext-zlib": "*", + "composer-runtime-api": "^2", "colinmollenhour/cache-backend-redis": "^1.14", "colinmollenhour/magento-redis-session": "^3.2.0", "cweagans/composer-patches": "^1.7", "ezyang/htmlpurifier": "^4.17", "flowjs/flowjs": "dev-master", "magento-hackathon/magento-composer-installer": "^3.1 || ^2.1 || ^4.0", - "mklkj/tinymce-i18n": "^25.2", + "mklkj/tinymce-i18n": "^24.11", + "nnnick/chartjs": "^4.4.7", "openmage/composer-plugin": "^3.0", "pelago/emogrifier": "^7.0", "phpseclib/mcrypt_compat": "^2.0.3", @@ -48,7 +50,6 @@ }, "require-dev": { "ext-xmlreader": "*", - "composer/composer": "^2.7", "dealerdirect/phpcodesniffer-composer-installer": "^1.0.0", "friendsofphp/php-cs-fixer": "^3.6", "macopedia/phpstan-magento1": "^1.1", diff --git a/composer.lock b/composer.lock index 5df0e1b6762..00dd47f9ede 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "a2bb45fc20fd05cec1e2e1e3dc9503d7", + "content-hash": "8268e3b3eb5cf0745500ba1d7d80a602", "packages": [ { "name": "colinmollenhour/cache-backend-redis", @@ -53,16 +53,16 @@ }, { "name": "colinmollenhour/credis", - "version": "v1.16.2", + "version": "v1.16.0", "source": { "type": "git", "url": "https://github.com/colinmollenhour/credis.git", - "reference": "db2c0323292e360fdba39bf98c7a405fe3cb05b0" + "reference": "5641140e14a9679f5a6f66c97268727f9558b881" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/colinmollenhour/credis/zipball/db2c0323292e360fdba39bf98c7a405fe3cb05b0", - "reference": "db2c0323292e360fdba39bf98c7a405fe3cb05b0", + "url": "https://api.github.com/repos/colinmollenhour/credis/zipball/5641140e14a9679f5a6f66c97268727f9558b881", + "reference": "5641140e14a9679f5a6f66c97268727f9558b881", "shasum": "" }, "require": { @@ -94,9 +94,9 @@ "homepage": "https://github.com/colinmollenhour/credis", "support": { "issues": "https://github.com/colinmollenhour/credis/issues", - "source": "https://github.com/colinmollenhour/credis/tree/v1.16.2" + "source": "https://github.com/colinmollenhour/credis/tree/v1.16.0" }, - "time": "2024-12-17T02:24:03+00:00" + "time": "2023-10-26T17:02:51+00:00" }, { "name": "colinmollenhour/magento-redis-session", @@ -139,7 +139,7 @@ }, { "name": "colinmollenhour/php-redis-session-abstract", - "version": "v1.7.0", + "version": "v1.5.5", "source": { "type": "git", "url": "https://github.com/colinmollenhour/php-redis-session-abstract.git", @@ -177,7 +177,7 @@ "homepage": "https://github.com/colinmollenhour/php-redis-session-abstract", "support": { "issues": "https://github.com/colinmollenhour/php-redis-session-abstract/issues", - "source": "https://github.com/colinmollenhour/php-redis-session-abstract/tree/v1.7.0" + "source": "https://github.com/colinmollenhour/php-redis-session-abstract/tree/v1.5.5" }, "time": "2024-02-03T06:04:45+00:00" }, @@ -604,16 +604,16 @@ }, { "name": "mklkj/tinymce-i18n", - "version": "25.2.3", + "version": "24.12.30", "source": { "type": "git", "url": "https://github.com/mklkj/tinymce-i18n.git", - "reference": "e3f20d04fdf6d590019c319fd96a1a9fc02325e1" + "reference": "5bb5d9b172b5dbfe05607a6d4c7988d2844fa8c9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/mklkj/tinymce-i18n/zipball/e3f20d04fdf6d590019c319fd96a1a9fc02325e1", - "reference": "e3f20d04fdf6d590019c319fd96a1a9fc02325e1", + "url": "https://api.github.com/repos/mklkj/tinymce-i18n/zipball/5bb5d9b172b5dbfe05607a6d4c7988d2844fa8c9", + "reference": "5bb5d9b172b5dbfe05607a6d4c7988d2844fa8c9", "shasum": "" }, "type": "library", @@ -635,9 +635,54 @@ ], "support": { "issues": "https://github.com/mklkj/tinymce-i18n/issues", - "source": "https://github.com/mklkj/tinymce-i18n/tree/25.2.3" + "source": "https://github.com/mklkj/tinymce-i18n/tree/24.12.30" + }, + "time": "2024-12-30T10:42:10+00:00" + }, + { + "name": "nnnick/chartjs", + "version": "v4.4.7", + "source": { + "type": "git", + "url": "https://github.com/chartjs/Chart.js.git", + "reference": "57b5c5b78fb2d8504f556bef6e4177735d9929ea" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/chartjs/Chart.js/zipball/57b5c5b78fb2d8504f556bef6e4177735d9929ea", + "reference": "57b5c5b78fb2d8504f556bef6e4177735d9929ea", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "release/2.0": "v2.0-dev" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "NICK DOWNIE", + "email": "hello@nickdownie.com" + } + ], + "description": "Simple HTML5 charts using the canvas element.", + "homepage": "https://www.chartjs.org/", + "keywords": [ + "JS", + "chart" + ], + "support": { + "issues": "https://github.com/chartjs/Chart.js/issues", + "source": "https://github.com/chartjs/Chart.js/tree/v4.4.7" }, - "time": "2025-02-03T10:42:25+00:00" + "time": "2024-12-01T16:35:13+00:00" }, { "name": "openmage/composer-plugin", @@ -2032,8 +2077,8 @@ "type": "library", "extra": { "thanks": { - "url": "https://github.com/symfony/polyfill", - "name": "symfony/polyfill" + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" } }, "autoload": { @@ -2265,8 +2310,8 @@ "type": "library", "extra": { "thanks": { - "url": "https://github.com/symfony/polyfill", - "name": "symfony/polyfill" + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" } }, "autoload": { @@ -2341,8 +2386,8 @@ "type": "library", "extra": { "thanks": { - "url": "https://github.com/symfony/polyfill", - "name": "symfony/polyfill" + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" } }, "autoload": { @@ -2417,8 +2462,8 @@ "type": "library", "extra": { "thanks": { - "url": "https://github.com/symfony/polyfill", - "name": "symfony/polyfill" + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" } }, "autoload": { @@ -2845,338 +2890,6 @@ ], "time": "2022-12-23T10:58:28+00:00" }, - { - "name": "composer/ca-bundle", - "version": "1.5.5", - "source": { - "type": "git", - "url": "https://github.com/composer/ca-bundle.git", - "reference": "08c50d5ec4c6ced7d0271d2862dec8c1033283e6" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/composer/ca-bundle/zipball/08c50d5ec4c6ced7d0271d2862dec8c1033283e6", - "reference": "08c50d5ec4c6ced7d0271d2862dec8c1033283e6", - "shasum": "" - }, - "require": { - "ext-openssl": "*", - "ext-pcre": "*", - "php": "^7.2 || ^8.0" - }, - "require-dev": { - "phpstan/phpstan": "^1.10", - "phpunit/phpunit": "^8 || ^9", - "psr/log": "^1.0 || ^2.0 || ^3.0", - "symfony/process": "^4.0 || ^5.0 || ^6.0 || ^7.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "Composer\\CaBundle\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be", - "homepage": "http://seld.be" - } - ], - "description": "Lets you find a path to the system CA bundle, and includes a fallback to the Mozilla CA bundle.", - "keywords": [ - "cabundle", - "cacert", - "certificate", - "ssl", - "tls" - ], - "support": { - "irc": "irc://irc.freenode.org/composer", - "issues": "https://github.com/composer/ca-bundle/issues", - "source": "https://github.com/composer/ca-bundle/tree/1.5.5" - }, - "funding": [ - { - "url": "https://packagist.com", - "type": "custom" - }, - { - "url": "https://github.com/composer", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/composer/composer", - "type": "tidelift" - } - ], - "time": "2025-01-08T16:17:16+00:00" - }, - { - "name": "composer/class-map-generator", - "version": "1.5.0", - "source": { - "type": "git", - "url": "https://github.com/composer/class-map-generator.git", - "reference": "4b0a223cf5be7c9ee7e0ef1bc7db42b4a97c9915" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/composer/class-map-generator/zipball/4b0a223cf5be7c9ee7e0ef1bc7db42b4a97c9915", - "reference": "4b0a223cf5be7c9ee7e0ef1bc7db42b4a97c9915", - "shasum": "" - }, - "require": { - "composer/pcre": "^2.1 || ^3.1", - "php": "^7.2 || ^8.0", - "symfony/finder": "^4.4 || ^5.3 || ^6 || ^7" - }, - "require-dev": { - "phpstan/phpstan": "^1.12 || ^2", - "phpstan/phpstan-deprecation-rules": "^1 || ^2", - "phpstan/phpstan-phpunit": "^1 || ^2", - "phpstan/phpstan-strict-rules": "^1.1 || ^2", - "phpunit/phpunit": "^8", - "symfony/filesystem": "^5.4 || ^6" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "Composer\\ClassMapGenerator\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be", - "homepage": "https://seld.be" - } - ], - "description": "Utilities to scan PHP code and generate class maps.", - "keywords": [ - "classmap" - ], - "support": { - "issues": "https://github.com/composer/class-map-generator/issues", - "source": "https://github.com/composer/class-map-generator/tree/1.5.0" - }, - "funding": [ - { - "url": "https://packagist.com", - "type": "custom" - }, - { - "url": "https://github.com/composer", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/composer/composer", - "type": "tidelift" - } - ], - "time": "2024-11-25T16:11:06+00:00" - }, - { - "name": "composer/composer", - "version": "2.8.5", - "source": { - "type": "git", - "url": "https://github.com/composer/composer.git", - "reference": "ae208dc1e182bd45d99fcecb956501da212454a1" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/composer/composer/zipball/ae208dc1e182bd45d99fcecb956501da212454a1", - "reference": "ae208dc1e182bd45d99fcecb956501da212454a1", - "shasum": "" - }, - "require": { - "composer/ca-bundle": "^1.5", - "composer/class-map-generator": "^1.4.0", - "composer/metadata-minifier": "^1.0", - "composer/pcre": "^2.2 || ^3.2", - "composer/semver": "^3.3", - "composer/spdx-licenses": "^1.5.7", - "composer/xdebug-handler": "^2.0.2 || ^3.0.3", - "justinrainbow/json-schema": "^5.3", - "php": "^7.2.5 || ^8.0", - "psr/log": "^1.0 || ^2.0 || ^3.0", - "react/promise": "^2.11 || ^3.2", - "seld/jsonlint": "^1.4", - "seld/phar-utils": "^1.2", - "seld/signal-handler": "^2.0", - "symfony/console": "^5.4.35 || ^6.3.12 || ^7.0.3", - "symfony/filesystem": "^5.4.35 || ^6.3.12 || ^7.0.3", - "symfony/finder": "^5.4.35 || ^6.3.12 || ^7.0.3", - "symfony/polyfill-php73": "^1.24", - "symfony/polyfill-php80": "^1.24", - "symfony/polyfill-php81": "^1.24", - "symfony/process": "^5.4.35 || ^6.3.12 || ^7.0.3" - }, - "require-dev": { - "phpstan/phpstan": "^1.11.8", - "phpstan/phpstan-deprecation-rules": "^1.2.0", - "phpstan/phpstan-phpunit": "^1.4.0", - "phpstan/phpstan-strict-rules": "^1.6.0", - "phpstan/phpstan-symfony": "^1.4.0", - "symfony/phpunit-bridge": "^6.4.3 || ^7.0.1" - }, - "suggest": { - "ext-openssl": "Enabling the openssl extension allows you to access https URLs for repositories and packages", - "ext-zip": "Enabling the zip extension allows you to unzip archives", - "ext-zlib": "Allow gzip compression of HTTP requests" - }, - "bin": [ - "bin/composer" - ], - "type": "library", - "extra": { - "phpstan": { - "includes": [ - "phpstan/rules.neon" - ] - }, - "branch-alias": { - "dev-main": "2.8-dev" - } - }, - "autoload": { - "psr-4": { - "Composer\\": "src/Composer/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nils Adermann", - "email": "naderman@naderman.de", - "homepage": "https://www.naderman.de" - }, - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be", - "homepage": "https://seld.be" - } - ], - "description": "Composer helps you declare, manage and install dependencies of PHP projects. It ensures you have the right stack everywhere.", - "homepage": "https://getcomposer.org/", - "keywords": [ - "autoload", - "dependency", - "package" - ], - "support": { - "irc": "ircs://irc.libera.chat:6697/composer", - "issues": "https://github.com/composer/composer/issues", - "security": "https://github.com/composer/composer/security/policy", - "source": "https://github.com/composer/composer/tree/2.8.5" - }, - "funding": [ - { - "url": "https://packagist.com", - "type": "custom" - }, - { - "url": "https://github.com/composer", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/composer/composer", - "type": "tidelift" - } - ], - "time": "2025-01-21T14:23:40+00:00" - }, - { - "name": "composer/metadata-minifier", - "version": "1.0.0", - "source": { - "type": "git", - "url": "https://github.com/composer/metadata-minifier.git", - "reference": "c549d23829536f0d0e984aaabbf02af91f443207" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/composer/metadata-minifier/zipball/c549d23829536f0d0e984aaabbf02af91f443207", - "reference": "c549d23829536f0d0e984aaabbf02af91f443207", - "shasum": "" - }, - "require": { - "php": "^5.3.2 || ^7.0 || ^8.0" - }, - "require-dev": { - "composer/composer": "^2", - "phpstan/phpstan": "^0.12.55", - "symfony/phpunit-bridge": "^4.2 || ^5" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "Composer\\MetadataMinifier\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be", - "homepage": "http://seld.be" - } - ], - "description": "Small utility library that handles metadata minification and expansion.", - "keywords": [ - "composer", - "compression" - ], - "support": { - "issues": "https://github.com/composer/metadata-minifier/issues", - "source": "https://github.com/composer/metadata-minifier/tree/1.0.0" - }, - "funding": [ - { - "url": "https://packagist.com", - "type": "custom" - }, - { - "url": "https://github.com/composer", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/composer/composer", - "type": "tidelift" - } - ], - "time": "2021-04-07T13:37:33+00:00" - }, { "name": "composer/pcre", "version": "3.3.2", @@ -3337,86 +3050,6 @@ ], "time": "2024-09-19T14:15:21+00:00" }, - { - "name": "composer/spdx-licenses", - "version": "1.5.8", - "source": { - "type": "git", - "url": "https://github.com/composer/spdx-licenses.git", - "reference": "560bdcf8deb88ae5d611c80a2de8ea9d0358cc0a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/composer/spdx-licenses/zipball/560bdcf8deb88ae5d611c80a2de8ea9d0358cc0a", - "reference": "560bdcf8deb88ae5d611c80a2de8ea9d0358cc0a", - "shasum": "" - }, - "require": { - "php": "^5.3.2 || ^7.0 || ^8.0" - }, - "require-dev": { - "phpstan/phpstan": "^0.12.55", - "symfony/phpunit-bridge": "^4.2 || ^5" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "Composer\\Spdx\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nils Adermann", - "email": "naderman@naderman.de", - "homepage": "http://www.naderman.de" - }, - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be", - "homepage": "http://seld.be" - }, - { - "name": "Rob Bast", - "email": "rob.bast@gmail.com", - "homepage": "http://robbast.nl" - } - ], - "description": "SPDX licenses list and validation library.", - "keywords": [ - "license", - "spdx", - "validator" - ], - "support": { - "irc": "ircs://irc.libera.chat:6697/composer", - "issues": "https://github.com/composer/spdx-licenses/issues", - "source": "https://github.com/composer/spdx-licenses/tree/1.5.8" - }, - "funding": [ - { - "url": "https://packagist.com", - "type": "custom" - }, - { - "url": "https://github.com/composer", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/composer/composer", - "type": "tidelift" - } - ], - "time": "2023-11-20T07:44:33+00:00" - }, { "name": "composer/xdebug-handler", "version": "3.0.5", @@ -3741,16 +3374,16 @@ }, { "name": "friendsofphp/php-cs-fixer", - "version": "v3.68.5", + "version": "v3.68.1", "source": { "type": "git", "url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git", - "reference": "7bedb718b633355272428c60736dc97fb96daf27" + "reference": "b9db2b2ea3cdba7201067acee46f984ef2397cff" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/7bedb718b633355272428c60736dc97fb96daf27", - "reference": "7bedb718b633355272428c60736dc97fb96daf27", + "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/b9db2b2ea3cdba7201067acee46f984ef2397cff", + "reference": "b9db2b2ea3cdba7201067acee46f984ef2397cff", "shasum": "" }, "require": { @@ -3832,7 +3465,7 @@ ], "support": { "issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues", - "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.68.5" + "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.68.1" }, "funding": [ { @@ -3840,7 +3473,7 @@ "type": "github" } ], - "time": "2025-01-30T17:00:50+00:00" + "time": "2025-01-17T09:20:36+00:00" }, { "name": "macopedia/phpstan-magento1", @@ -3920,16 +3553,16 @@ }, { "name": "myclabs/deep-copy", - "version": "1.12.1", + "version": "1.11.1", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "123267b2c49fbf30d78a7b2d333f6be754b94845" + "reference": "7284c22080590fb39f2ffa3e9057f10a4ddd0e0c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/123267b2c49fbf30d78a7b2d333f6be754b94845", - "reference": "123267b2c49fbf30d78a7b2d333f6be754b94845", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/7284c22080590fb39f2ffa3e9057f10a4ddd0e0c", + "reference": "7284c22080590fb39f2ffa3e9057f10a4ddd0e0c", "shasum": "" }, "require": { @@ -3937,12 +3570,11 @@ }, "conflict": { "doctrine/collections": "<1.6.8", - "doctrine/common": "<2.13.3 || >=3 <3.2.2" + "doctrine/common": "<2.13.3 || >=3,<3.2.2" }, "require-dev": { "doctrine/collections": "^1.6.8", "doctrine/common": "^2.13.3 || ^3.2.2", - "phpspec/prophecy": "^1.10", "phpunit/phpunit": "^7.5.20 || ^8.5.23 || ^9.5.13" }, "type": "library", @@ -3968,7 +3600,7 @@ ], "support": { "issues": "https://github.com/myclabs/DeepCopy/issues", - "source": "https://github.com/myclabs/DeepCopy/tree/1.12.1" + "source": "https://github.com/myclabs/DeepCopy/tree/1.11.1" }, "funding": [ { @@ -3976,20 +3608,20 @@ "type": "tidelift" } ], - "time": "2024-11-08T17:47:46+00:00" + "time": "2023-03-08T13:26:56+00:00" }, { "name": "nikic/php-parser", - "version": "v5.4.0", + "version": "v5.0.2", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "447a020a1f875a434d62f2a401f53b82a396e494" + "reference": "139676794dc1e9231bf7bcd123cfc0c99182cb13" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/447a020a1f875a434d62f2a401f53b82a396e494", - "reference": "447a020a1f875a434d62f2a401f53b82a396e494", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/139676794dc1e9231bf7bcd123cfc0c99182cb13", + "reference": "139676794dc1e9231bf7bcd123cfc0c99182cb13", "shasum": "" }, "require": { @@ -4000,7 +3632,7 @@ }, "require-dev": { "ircmaxell/php-yacc": "^0.0.7", - "phpunit/phpunit": "^9.0" + "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0" }, "bin": [ "bin/php-parse" @@ -4032,9 +3664,9 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v5.4.0" + "source": "https://github.com/nikic/PHP-Parser/tree/v5.0.2" }, - "time": "2024-12-30T11:07:19+00:00" + "time": "2024-03-05T20:51:40+00:00" }, { "name": "openmage/dev-copyright", @@ -4114,12 +3746,12 @@ "source": { "type": "git", "url": "https://github.com/OpenMage/dev-translations.git", - "reference": "609f0aca73d32883d128400b8b2763c13b95ad6a" + "reference": "668a04605a09945f1e40d555293553c31fb339b3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/OpenMage/dev-translations/zipball/609f0aca73d32883d128400b8b2763c13b95ad6a", - "reference": "609f0aca73d32883d128400b8b2763c13b95ad6a", + "url": "https://api.github.com/repos/OpenMage/dev-translations/zipball/668a04605a09945f1e40d555293553c31fb339b3", + "reference": "668a04605a09945f1e40d555293553c31fb339b3", "shasum": "" }, "require": { @@ -4142,7 +3774,7 @@ "issues": "https://github.com/OpenMage/dev-translations/issues", "source": "https://github.com/OpenMage/dev-translations/tree/main" }, - "time": "2024-12-07T17:45:49+00:00" + "time": "2024-11-25T12:50:51+00:00" }, { "name": "pdepend/pdepend", @@ -4582,16 +4214,16 @@ }, { "name": "phpstan/phpstan", - "version": "2.1.3", + "version": "2.1.2", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "64ae44e48214f3deebdaeebf2694297a10a2bea9" + "reference": "7d08f569e582ade182a375c366cbd896eccadd3a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/64ae44e48214f3deebdaeebf2694297a10a2bea9", - "reference": "64ae44e48214f3deebdaeebf2694297a10a2bea9", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/7d08f569e582ade182a375c366cbd896eccadd3a", + "reference": "7d08f569e582ade182a375c366cbd896eccadd3a", "shasum": "" }, "require": { @@ -4636,7 +4268,7 @@ "type": "github" } ], - "time": "2025-02-07T15:05:24+00:00" + "time": "2025-01-21T14:54:06+00:00" }, { "name": "phpstan/phpstan-phpunit", @@ -4691,35 +4323,35 @@ }, { "name": "phpunit/php-code-coverage", - "version": "9.2.32", + "version": "9.2.31", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "85402a822d1ecf1db1096959413d35e1c37cf1a5" + "reference": "48c34b5d8d983006bd2adc2d0de92963b9155965" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/85402a822d1ecf1db1096959413d35e1c37cf1a5", - "reference": "85402a822d1ecf1db1096959413d35e1c37cf1a5", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/48c34b5d8d983006bd2adc2d0de92963b9155965", + "reference": "48c34b5d8d983006bd2adc2d0de92963b9155965", "shasum": "" }, "require": { "ext-dom": "*", "ext-libxml": "*", "ext-xmlwriter": "*", - "nikic/php-parser": "^4.19.1 || ^5.1.0", + "nikic/php-parser": "^4.18 || ^5.0", "php": ">=7.3", - "phpunit/php-file-iterator": "^3.0.6", - "phpunit/php-text-template": "^2.0.4", - "sebastian/code-unit-reverse-lookup": "^2.0.3", - "sebastian/complexity": "^2.0.3", - "sebastian/environment": "^5.1.5", - "sebastian/lines-of-code": "^1.0.4", - "sebastian/version": "^3.0.2", - "theseer/tokenizer": "^1.2.3" + "phpunit/php-file-iterator": "^3.0.3", + "phpunit/php-text-template": "^2.0.2", + "sebastian/code-unit-reverse-lookup": "^2.0.2", + "sebastian/complexity": "^2.0", + "sebastian/environment": "^5.1.2", + "sebastian/lines-of-code": "^1.0.3", + "sebastian/version": "^3.0.1", + "theseer/tokenizer": "^1.2.0" }, "require-dev": { - "phpunit/phpunit": "^9.6" + "phpunit/phpunit": "^9.3" }, "suggest": { "ext-pcov": "PHP extension that provides line coverage", @@ -4728,7 +4360,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "9.2.x-dev" + "dev-master": "9.2-dev" } }, "autoload": { @@ -4757,7 +4389,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", "security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.32" + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.31" }, "funding": [ { @@ -4765,7 +4397,7 @@ "type": "github" } ], - "time": "2024-08-22T04:23:01+00:00" + "time": "2024-03-02T06:37:42+00:00" }, { "name": "phpunit/php-file-iterator", @@ -5010,45 +4642,45 @@ }, { "name": "phpunit/phpunit", - "version": "9.6.22", + "version": "9.6.19", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "f80235cb4d3caa59ae09be3adf1ded27521d1a9c" + "reference": "a1a54a473501ef4cdeaae4e06891674114d79db8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/f80235cb4d3caa59ae09be3adf1ded27521d1a9c", - "reference": "f80235cb4d3caa59ae09be3adf1ded27521d1a9c", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/a1a54a473501ef4cdeaae4e06891674114d79db8", + "reference": "a1a54a473501ef4cdeaae4e06891674114d79db8", "shasum": "" }, "require": { - "doctrine/instantiator": "^1.5.0 || ^2", + "doctrine/instantiator": "^1.3.1 || ^2", "ext-dom": "*", "ext-json": "*", "ext-libxml": "*", "ext-mbstring": "*", "ext-xml": "*", "ext-xmlwriter": "*", - "myclabs/deep-copy": "^1.12.1", - "phar-io/manifest": "^2.0.4", - "phar-io/version": "^3.2.1", + "myclabs/deep-copy": "^1.10.1", + "phar-io/manifest": "^2.0.3", + "phar-io/version": "^3.0.2", "php": ">=7.3", - "phpunit/php-code-coverage": "^9.2.32", - "phpunit/php-file-iterator": "^3.0.6", + "phpunit/php-code-coverage": "^9.2.28", + "phpunit/php-file-iterator": "^3.0.5", "phpunit/php-invoker": "^3.1.1", - "phpunit/php-text-template": "^2.0.4", - "phpunit/php-timer": "^5.0.3", - "sebastian/cli-parser": "^1.0.2", - "sebastian/code-unit": "^1.0.8", + "phpunit/php-text-template": "^2.0.3", + "phpunit/php-timer": "^5.0.2", + "sebastian/cli-parser": "^1.0.1", + "sebastian/code-unit": "^1.0.6", "sebastian/comparator": "^4.0.8", - "sebastian/diff": "^4.0.6", - "sebastian/environment": "^5.1.5", - "sebastian/exporter": "^4.0.6", - "sebastian/global-state": "^5.0.7", - "sebastian/object-enumerator": "^4.0.4", - "sebastian/resource-operations": "^3.0.4", - "sebastian/type": "^3.2.1", + "sebastian/diff": "^4.0.3", + "sebastian/environment": "^5.1.3", + "sebastian/exporter": "^4.0.5", + "sebastian/global-state": "^5.0.1", + "sebastian/object-enumerator": "^4.0.3", + "sebastian/resource-operations": "^3.0.3", + "sebastian/type": "^3.2", "sebastian/version": "^3.0.2" }, "suggest": { @@ -5093,7 +4725,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", "security": "https://github.com/sebastianbergmann/phpunit/security/policy", - "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.22" + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.19" }, "funding": [ { @@ -5109,7 +4741,7 @@ "type": "tidelift" } ], - "time": "2024-12-05T13:48:26+00:00" + "time": "2024-04-05T04:35:58+00:00" }, { "name": "psr/event-dispatcher", @@ -5739,21 +5371,21 @@ }, { "name": "rector/rector", - "version": "2.0.8", + "version": "2.0.7", "source": { "type": "git", "url": "https://github.com/rectorphp/rector.git", - "reference": "3c70238bc677eb98866000a05b19a34f12955954" + "reference": "e70d681f6a0c361a63e6825897cd97746436f015" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/rectorphp/rector/zipball/3c70238bc677eb98866000a05b19a34f12955954", - "reference": "3c70238bc677eb98866000a05b19a34f12955954", + "url": "https://api.github.com/repos/rectorphp/rector/zipball/e70d681f6a0c361a63e6825897cd97746436f015", + "reference": "e70d681f6a0c361a63e6825897cd97746436f015", "shasum": "" }, "require": { "php": "^7.4|^8.0", - "phpstan/phpstan": "^2.1.2" + "phpstan/phpstan": "^2.1.1" }, "conflict": { "rector/rector-doctrine": "*", @@ -5786,7 +5418,7 @@ ], "support": { "issues": "https://github.com/rectorphp/rector/issues", - "source": "https://github.com/rectorphp/rector/tree/2.0.8" + "source": "https://github.com/rectorphp/rector/tree/2.0.7" }, "funding": [ { @@ -5794,7 +5426,7 @@ "type": "github" } ], - "time": "2025-02-06T14:02:49+00:00" + "time": "2025-01-19T09:41:28+00:00" }, { "name": "sebastian/cli-parser", @@ -6759,179 +6391,6 @@ ], "time": "2020-09-28T06:39:44+00:00" }, - { - "name": "seld/jsonlint", - "version": "1.11.0", - "source": { - "type": "git", - "url": "https://github.com/Seldaek/jsonlint.git", - "reference": "1748aaf847fc731cfad7725aec413ee46f0cc3a2" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Seldaek/jsonlint/zipball/1748aaf847fc731cfad7725aec413ee46f0cc3a2", - "reference": "1748aaf847fc731cfad7725aec413ee46f0cc3a2", - "shasum": "" - }, - "require": { - "php": "^5.3 || ^7.0 || ^8.0" - }, - "require-dev": { - "phpstan/phpstan": "^1.11", - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0 || ^8.5.13" - }, - "bin": [ - "bin/jsonlint" - ], - "type": "library", - "autoload": { - "psr-4": { - "Seld\\JsonLint\\": "src/Seld/JsonLint/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be", - "homepage": "https://seld.be" - } - ], - "description": "JSON Linter", - "keywords": [ - "json", - "linter", - "parser", - "validator" - ], - "support": { - "issues": "https://github.com/Seldaek/jsonlint/issues", - "source": "https://github.com/Seldaek/jsonlint/tree/1.11.0" - }, - "funding": [ - { - "url": "https://github.com/Seldaek", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/seld/jsonlint", - "type": "tidelift" - } - ], - "time": "2024-07-11T14:55:45+00:00" - }, - { - "name": "seld/phar-utils", - "version": "1.2.1", - "source": { - "type": "git", - "url": "https://github.com/Seldaek/phar-utils.git", - "reference": "ea2f4014f163c1be4c601b9b7bd6af81ba8d701c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Seldaek/phar-utils/zipball/ea2f4014f163c1be4c601b9b7bd6af81ba8d701c", - "reference": "ea2f4014f163c1be4c601b9b7bd6af81ba8d701c", - "shasum": "" - }, - "require": { - "php": ">=5.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "Seld\\PharUtils\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be" - } - ], - "description": "PHAR file format utilities, for when PHP phars you up", - "keywords": [ - "phar" - ], - "support": { - "issues": "https://github.com/Seldaek/phar-utils/issues", - "source": "https://github.com/Seldaek/phar-utils/tree/1.2.1" - }, - "time": "2022-08-31T10:31:18+00:00" - }, - { - "name": "seld/signal-handler", - "version": "2.0.2", - "source": { - "type": "git", - "url": "https://github.com/Seldaek/signal-handler.git", - "reference": "04a6112e883ad76c0ada8e4a9f7520bbfdb6bb98" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Seldaek/signal-handler/zipball/04a6112e883ad76c0ada8e4a9f7520bbfdb6bb98", - "reference": "04a6112e883ad76c0ada8e4a9f7520bbfdb6bb98", - "shasum": "" - }, - "require": { - "php": ">=7.2.0" - }, - "require-dev": { - "phpstan/phpstan": "^1", - "phpstan/phpstan-deprecation-rules": "^1.0", - "phpstan/phpstan-phpunit": "^1", - "phpstan/phpstan-strict-rules": "^1.3", - "phpunit/phpunit": "^7.5.20 || ^8.5.23", - "psr/log": "^1 || ^2 || ^3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "2.x-dev" - } - }, - "autoload": { - "psr-4": { - "Seld\\Signal\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be", - "homepage": "http://seld.be" - } - ], - "description": "Simple unix signal handler that silently fails where signals are not supported for easy cross-platform development", - "keywords": [ - "posix", - "sigint", - "signal", - "sigterm", - "unix" - ], - "support": { - "issues": "https://github.com/Seldaek/signal-handler/issues", - "source": "https://github.com/Seldaek/signal-handler/tree/2.0.2" - }, - "time": "2023-09-03T09:24:00+00:00" - }, { "name": "squizlabs/php_codesniffer", "version": "3.11.3", @@ -7018,16 +6477,16 @@ }, { "name": "symfony/config", - "version": "v5.4.46", + "version": "v5.4.35", "source": { "type": "git", "url": "https://github.com/symfony/config.git", - "reference": "977c88a02d7d3f16904a81907531b19666a08e78" + "reference": "6b763438a22a4f20885e994ad6702f6a3f25430e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/977c88a02d7d3f16904a81907531b19666a08e78", - "reference": "977c88a02d7d3f16904a81907531b19666a08e78", + "url": "https://api.github.com/repos/symfony/config/zipball/6b763438a22a4f20885e994ad6702f6a3f25430e", + "reference": "6b763438a22a4f20885e994ad6702f6a3f25430e", "shasum": "" }, "require": { @@ -7077,7 +6536,7 @@ "description": "Helps you find, load, combine, autofill and validate configuration values of any kind", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/config/tree/v5.4.46" + "source": "https://github.com/symfony/config/tree/v5.4.35" }, "funding": [ { @@ -7093,20 +6552,20 @@ "type": "tidelift" } ], - "time": "2024-10-30T07:58:02+00:00" + "time": "2024-01-23T13:51:25+00:00" }, { "name": "symfony/dependency-injection", - "version": "v5.4.48", + "version": "v5.4.35", "source": { "type": "git", "url": "https://github.com/symfony/dependency-injection.git", - "reference": "e5ca16dee39ef7d63e552ff0bf0a2526a1142c92" + "reference": "45474d527212ca67cdb93f6c5e6da68f4bc67118" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/e5ca16dee39ef7d63e552ff0bf0a2526a1142c92", - "reference": "e5ca16dee39ef7d63e552ff0bf0a2526a1142c92", + "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/45474d527212ca67cdb93f6c5e6da68f4bc67118", + "reference": "45474d527212ca67cdb93f6c5e6da68f4bc67118", "shasum": "" }, "require": { @@ -7166,7 +6625,7 @@ "description": "Allows you to standardize and centralize the way objects are constructed in your application", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/dependency-injection/tree/v5.4.48" + "source": "https://github.com/symfony/dependency-injection/tree/v5.4.35" }, "funding": [ { @@ -7182,7 +6641,7 @@ "type": "tidelift" } ], - "time": "2024-11-20T10:51:57+00:00" + "time": "2024-01-29T20:37:36+00:00" }, { "name": "symfony/event-dispatcher", @@ -7659,7 +7118,8 @@ "ext-pdo_mysql": "*", "ext-simplexml": "*", "ext-soap": "*", - "ext-zlib": "*" + "ext-zlib": "*", + "composer-runtime-api": "^2" }, "platform-dev": { "ext-xmlreader": "*" @@ -7667,5 +7127,5 @@ "platform-overrides": { "php": "7.4" }, - "plugin-api-version": "2.3.0" + "plugin-api-version": "2.6.0" } diff --git a/tests/unit/Base/DefaultConfigTest.php b/tests/unit/Base/DefaultConfigTest.php index c38e7ed783a..36735a2ed74 100644 --- a/tests/unit/Base/DefaultConfigTest.php +++ b/tests/unit/Base/DefaultConfigTest.php @@ -19,7 +19,7 @@ use Generator; use Mage; -use Mage_Adminhtml_Block_Dashboard; +use Mage_Adminhtml_Helper_Dashboard_Data; use PHPUnit\Framework\TestCase; class DefaultConfigTest extends TestCase @@ -37,9 +37,9 @@ public function testGetStoreConfig(string $expectedResult, string $path, $store public function provideGetStoreConfig(): Generator { - yield Mage_Adminhtml_Block_Dashboard::XML_PATH_ENABLE_CHARTS => [ + yield Mage_Adminhtml_Helper_Dashboard_Data::XML_PATH_ENABLE_CHARTS => [ '1', - Mage_Adminhtml_Block_Dashboard::XML_PATH_ENABLE_CHARTS, + Mage_Adminhtml_Helper_Dashboard_Data::XML_PATH_ENABLE_CHARTS, ]; } }