Skip to content

Commit

Permalink
Merge pull request #26 from mageplaza/2.4-develop
Browse files Browse the repository at this point in the history
Clean code
  • Loading branch information
haitv282 authored Jan 20, 2021
2 parents 5580d57 + da806e6 commit 13e5f9c
Show file tree
Hide file tree
Showing 8 changed files with 109 additions and 109 deletions.
52 changes: 26 additions & 26 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
{
"name": "mageplaza/module-reports",
"description": "Magento 2 Reports Extension",
"require": {
"mageplaza/module-core": "^1.4.5"
},
"type": "magento2-module",
"version": "1.3.3",
"license": "proprietary",
"authors": [
{
"name": "Mageplaza",
"email": "[email protected]",
"homepage": "https://www.mageplaza.com",
"role": "Technical Support"
}
],
"autoload": {
"files": [
"registration.php"
],
"psr-4": {
"Mageplaza\\Reports\\": ""
}
}
}
{
"name": "mageplaza/module-reports",
"description": "Magento 2 Reports Extension",
"require": {
"mageplaza/module-core": "^1.4.5"
},
"type": "magento2-module",
"version": "4.0.0",
"license": "proprietary",
"authors": [
{
"name": "Mageplaza",
"email": "[email protected]",
"homepage": "https://www.mageplaza.com",
"role": "Technical Support"
}
],
"autoload": {
"files": [
"registration.php"
],
"psr-4": {
"Mageplaza\\Reports\\": ""
}
}
}
122 changes: 61 additions & 61 deletions i18n/en_US.csv
Original file line number Diff line number Diff line change
@@ -1,61 +1,61 @@
"Average Order","Average Order"
"Average Order Value","Average Order Value"
Bestsellers,Bestsellers
"Conversion Funnel","Conversion Funnel"
Customers,Customers
"Last Order","Last Order"
"Last Search Terms","Last Search Terms"
"Lifetime Sales","Lifetime Sales"
"Most Viewed Products","Most Viewed Products"
"New Customers","New Customers"
Orders,Orders
first,first
repeat,repeat
"Repeat Customer Rate","Repeat Customer Rate"
"Sales By Location","Sales By Location"
Shipping,Shipping
Tax,Tax
"Top Search Terms","Top Search Terms"
Totals,Totals
"Can not be load Card","Can not be load Card"
Dashboard,Dashboard
"All Websites","All Websites"
"compare with","compare with"
Card,Card
"Please upgrade to %1 version to see more detail","Please upgrade to %1 version to see more detail"
"View Details","View Details"
"Something went wrong while loading %1 card","Something went wrong while loading %1 card"
"Chart is disabled. To enable the chart, click <a href='%1'>here</a>","Chart is disabled. To enable the chart, click <a href='%1'>here</a>"
"Product Viewed: %1","Product Viewed: %1"
"Add To Cart: %1","Add To Cart: %1"
"Ordered: %1","Ordered: %1"
"We couldn't find any records.","We couldn't find any records."
Period,Period
Day,Day
Week,Week
Month,Month
Year,Year
"Order Status","Order Status"
--Select--,--Select--
"Date Used","Date Used"
"Created At","Created At"
"Updated At","Updated At"
"Let’s experience your new dashboard","Let’s experience your new dashboard"
"Hello there! Better reports are available","Hello there! Better reports are available"
"Mageplaza Advanced Reporting","Mageplaza Advanced Reporting"
"The better reports provides ecommerce insights across performance metrics, product sales, customers, and cost of goods sold. Instantly measure metrics like customer lifetime value, gross margin, net profit, and more to build and automate high-quality ecommerce reports.","The better reports provides ecommerce insights across performance metrics, product sales, customers, and cost of goods sold. Instantly measure metrics like customer lifetime value, gross margin, net profit, and more to build and automate high-quality ecommerce reports."
"Try to use new Dashboard","Try to use new Dashboard"
"Change Key","Change Key"
"Generate Url","Generate Url"
Copied!,Copied!
Continue,Continue
"Mageplaza Reports Dashboard","Mageplaza Reports Dashboard"
Reports,Reports
"General Configuration","General Configuration"
"Module Enable","Module Enable"
"Enable Dashboard","Enable Dashboard"
"Enable Chart","Enable Chart"
"Enable Comparison","Enable Comparison"
"Mobile Dashboard","Mobile Dashboard"
"Access Key","Access Key"
"You must save config to apply change.","You must save config to apply change."
"Average Order","Average Order"
"Average Order Value","Average Order Value"
Bestsellers,Bestsellers
"Conversion Funnel","Conversion Funnel"
Customers,Customers
"Last Order","Last Order"
"Last Search Terms","Last Search Terms"
"Lifetime Sales","Lifetime Sales"
"Most Viewed Products","Most Viewed Products"
"New Customers","New Customers"
Orders,Orders
first,first
repeat,repeat
"Repeat Customer Rate","Repeat Customer Rate"
"Sales By Location","Sales By Location"
Shipping,Shipping
Tax,Tax
"Top Search Terms","Top Search Terms"
Totals,Totals
"Can not be load Card","Can not be load Card"
Dashboard,Dashboard
"All Websites","All Websites"
"compare with","compare with"
Card,Card
"Please upgrade to %1 version to see more detail","Please upgrade to %1 version to see more detail"
"View Details","View Details"
"Something went wrong while loading %1 card","Something went wrong while loading %1 card"
"Chart is disabled. To enable the chart, click <a href='%1'>here</a>","Chart is disabled. To enable the chart, click <a href='%1'>here</a>"
"Product Viewed: %1","Product Viewed: %1"
"Add To Cart: %1","Add To Cart: %1"
"Ordered: %1","Ordered: %1"
"We couldn't find any records.","We couldn't find any records."
Period,Period
Day,Day
Week,Week
Month,Month
Year,Year
"Order Status","Order Status"
--Select--,--Select--
"Date Used","Date Used"
"Created At","Created At"
"Updated At","Updated At"
"Let’s experience your new dashboard","Let’s experience your new dashboard"
"Hello there! Better reports are available","Hello there! Better reports are available"
"Mageplaza Advanced Reporting","Mageplaza Advanced Reporting"
"The better reports provides ecommerce insights across performance metrics, product sales, customers, and cost of goods sold. Instantly measure metrics like customer lifetime value, gross margin, net profit, and more to build and automate high-quality ecommerce reports.","The better reports provides ecommerce insights across performance metrics, product sales, customers, and cost of goods sold. Instantly measure metrics like customer lifetime value, gross margin, net profit, and more to build and automate high-quality ecommerce reports."
"Try to use new Dashboard","Try to use new Dashboard"
"Change Key","Change Key"
"Generate Url","Generate Url"
Copied!,Copied!
Continue,Continue
"Mageplaza Reports Dashboard","Mageplaza Reports Dashboard"
Reports,Reports
"General Configuration","General Configuration"
"Module Enable","Module Enable"
"Enable Dashboard","Enable Dashboard"
"Enable Chart","Enable Chart"
"Enable Comparison","Enable Comparison"
"Mobile Dashboard","Mobile Dashboard"
"Access Key","Access Key"
"You must save config to apply change.","You must save config to apply change."
8 changes: 4 additions & 4 deletions view/adminhtml/templates/dashboard.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ $cards = $block->getCards();
<span></span>
<i class="fa fa-caret-down"></i>
</div>
<?php if ($block->isCompare()) : ?>
<?php if ($block->isCompare()): ?>
<div class="compare"><?= $block->escapeHtml(__('compare with')) ?></div>
<div id="compare-daterange">
<i class="fa fa-calendar"></i>
Expand All @@ -53,7 +53,7 @@ $cards = $block->getCards();
<div class="admin__action-dropdown-menu admin__data-grid-action-columns-menu _overflow">
<div class="admin__action-dropdown-menu-header"></div>
<div class="admin__action-dropdown-menu-content">
<?php foreach ($cards as $card) : ?>
<?php foreach ($cards as $card): ?>
<div class="admin__field-option" data-repeat-index="0">
<input class="admin__control-checkbox"
type="checkbox" <?= $card->getVisible() ? 'checked' : '' ?>
Expand All @@ -74,8 +74,8 @@ $cards = $block->getCards();
<div style="clear: both; height: 20px"></div>
<div class="grid-stack"
data-mage-init='{"initGridStack":<?= \Mageplaza\Reports\Helper\Data::jsonEncode($block->getGridStackConfig()) ?>}'>
<?php foreach ($cards as $card) : ?>
<?php if ($card->getVisible()) : ?>
<?php foreach ($cards as $card): ?>
<?php if ($card->getVisible()): ?>
<?= $block->getChildBlock('mp_card')->setCard($card)->toHtml() ?>
<?php endif; ?>
<?php endforeach; ?>
Expand Down
16 changes: 8 additions & 8 deletions view/adminhtml/templates/dashboard/card.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -37,25 +37,25 @@ $card = $block->getCard();
<div class="not-draggable">
<div class="dashboard-item-container">
<div class="dashboard-item-header">
<?php if ($title = $card->getTitle()) : ?>
<?php if ($title = $card->getTitle()): ?>
<div class="dashboard-item-title"><?= $block->escapeHtml($title) ?></div>
<?php endif; ?>
<?php if ($card->canShowDetail()) : ?>
<?php if ($card->canShowDetail()): ?>
<div class="view-detail">
<a href="<?= /** @noEscape */ $card->getDetailUrl() ?>"
target="_blank"><?= $block->escapeHtml(__('View Details')) ?></a>
</div>
<?php endif; ?>
<div style="clear: both"></div>
<?php if ($block->getRequest()->isAjax() && $block->getRequest()->getFullActionName() === 'mpreports_cards_loadcard') : ?>
<?php if ($block->getRequest()->isAjax() && $block->getRequest()->getFullActionName() === 'mpreports_cards_loadcard'): ?>
<?php
$totalLabel = $card->getTotal();
if ($totalLabel !== '') : ?>
if ($totalLabel !== ''): ?>
<div class="dashboard-sales-value">
<?= /** @noEscape */ $totalLabel ?>
<?php
$rate = $card->getRate();
if (($rate !== '') && $block->isCompare()) : ?>
if (($rate !== '') && $block->isCompare()): ?>
<div class="chart-rate <?= $rate > 0 ? 'up-rate mp-green' : ($rate < 0 ? 'down-rate mp-red' : '') ?>">
<?= /** @noEscape */ abs($rate) . '%' ?>
</div>
Expand All @@ -64,14 +64,14 @@ $card = $block->getCard();
<?php endif; ?>
<?php endif; ?>
</div>
<?php if ($block->getRequest()->isAjax() && $block->getRequest()->getFullActionName() === 'mpreports_cards_loadcard') : ?>
<?php if ($block->getRequest()->isAjax() && $block->getRequest()->getFullActionName() === 'mpreports_cards_loadcard'): ?>
<?= $card->getContentHtml() ?>
<?php else : ?>
<?php else: ?>
<div class="mp-card loading-mask">
<img src="<?= /** @noEscape */ $block->getViewFileUrl('images/loader-1.gif') ?>" alt="Loading..."/>
</div>
<?php endif; ?>
<?php if ($block->getRequest()->getFullActionName() !== 'mpreports_cards_loadcard') : ?>
<?php if ($block->getRequest()->getFullActionName() !== 'mpreports_cards_loadcard'): ?>
<script>
require([
'jquery'
Expand Down
4 changes: 2 additions & 2 deletions view/adminhtml/templates/dashboard/chart.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@
*/
?>
<div class="dashboard-item-content-chart">
<?php if ($block->isEnabledChart()) : ?>
<?php if ($block->isEnabledChart()): ?>
<?php $chartData = $block->getChartData(); ?>
<canvas id="<?= /** @noEscape */ $chartData['name'] ?>-chart"
data-mage-init='{"initChart":{"chartData":<?= \Mageplaza\Reports\Helper\Data::jsonEncode($chartData) ?>}}'></canvas>
<?php else : ?>
<?php else: ?>
<div class="ar-empty-text empty-text">
<?= /** @noEscape */ __("Chart is disabled. To enable the chart, click <a href='%1'>here</a>", $block->getUrl('adminhtml/system_config/edit', ['section' => 'mageplaza_reports', 'store' => $block->getRequest()->getParam('store')])) ?>
</div>
Expand Down
8 changes: 4 additions & 4 deletions view/adminhtml/templates/dashboard/sales_by_location.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,21 @@
*/
?>
<div class="dashboard-item-content">
<?php if (count($block->getCollection())) : ?>
<?php if (count($block->getCollection())): ?>
<table class="admin__table-primary dashboard-data" id="sales_by_location_table">
<tbody>
<?php foreach ($block->getCollection() as $item) : ?>
<?php foreach ($block->getCollection() as $item): ?>
<tr title="">
<td class=""><?= /** @noEscape */ $item['country'] ?></td>
<td class=""><?= /** @noEscape */ $item['count'] ?></td>
<?php if ($block->isCompare()) : ?>
<?php if ($block->isCompare()): ?>
<td class="<?= $item['rate'] > 0 ? 'up-rate mp-green' : ($item['rate'] < 0 ? 'down-rate mp-red' : '') ?>"><?= /** @noEscape */ abs($item['rate']) . '%' ?></td>
<?php endif; ?>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<?php else : ?>
<?php else: ?>
<div class="empty-text"><?= $block->escapeHtml(__('We couldn\'t find any records.')) ?></div>
<?php endif; ?>
</div>
6 changes: 3 additions & 3 deletions view/adminhtml/templates/menu.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ $storeFilterUrl = $block->getUrl('mpreports/details/storefilter', ['form_key' =>
<i class="fa fa-bars"></i>
</a>
<ul class="admin__action-dropdown-menu">
<?php foreach ($menu as $item) : ?>
<?php foreach ($menu as $item): ?>
<li><a href="<?= /** @noEscape */ $item['path'] ?>"><?= /** @noEscape */ $item['label'] ?></a></li>
<?php endforeach; ?>
</ul>
Expand All @@ -61,7 +61,7 @@ $storeFilterUrl = $block->getUrl('mpreports/details/storefilter', ['form_key' =>
</div>
<div class="customer-group">
<select id="customer-group-id">
<?php foreach ($block->getCustomerGroup() as $group) : ?>
<?php foreach ($block->getCustomerGroup() as $group): ?>
<option value="<?= /** @noEscape */ $group['value'] ?>"><?= /** @noEscape */ $group['label'] ?></option>
<?php endforeach; ?>
</select>
Expand All @@ -85,7 +85,7 @@ $storeFilterUrl = $block->getUrl('mpreports/details/storefilter', ['form_key' =>
<div class="admin__action-dropdown-menu _overflow" id="order_status">
<div class="admin__action-dropdown-menu-header"></div>
<div class="admin__action-dropdown-menu-content">
<?php foreach ($block->getOrderStatusList() as $status) : ?>
<?php foreach ($block->getOrderStatusList() as $status): ?>
<div class="admin__field-option" data-repeat-index="0">
<input class="admin__control-checkbox"
type="checkbox"
Expand Down
2 changes: 1 addition & 1 deletion view/adminhtml/templates/system/config/link_builder.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
display: none;
}

<?php if (!$block->getAccessKey()) : ?>
<?php if (!$block->getAccessKey()): ?>
.mp-reports-link-builder {
display: none;
}
Expand Down

0 comments on commit 13e5f9c

Please sign in to comment.