diff --git a/src/com_digicom/admin/views/order/view.html.php b/src/com_digicom/admin/views/order/view.html.php
index 3c4370e7..68d68a24 100644
--- a/src/com_digicom/admin/views/order/view.html.php
+++ b/src/com_digicom/admin/views/order/view.html.php
@@ -22,6 +22,12 @@ class DigiComViewOrder extends JViewLegacy
function display( $tpl = null )
{
+ if (!JFactory::getUser()->authorise('core.orders', 'com_digicom'))
+ {
+ return JError::raiseWarning(404, JText::_('JERROR_ALERTNOAUTHOR'));
+ }
+
+
$app = JFactory::getApplication();
$this->state = $this->get('State');
diff --git a/src/com_digicom/admin/views/ordernew/view.html.php b/src/com_digicom/admin/views/ordernew/view.html.php
index e78b20d1..677b33d3 100644
--- a/src/com_digicom/admin/views/ordernew/view.html.php
+++ b/src/com_digicom/admin/views/ordernew/view.html.php
@@ -22,7 +22,11 @@ class DigiComViewOrderNew extends JViewLegacy
function display( $tpl = null )
{
-
+ if (!JFactory::getUser()->authorise('core.orders', 'com_digicom'))
+ {
+ return JError::raiseWarning(404, JText::_('JERROR_ALERTNOAUTHOR'));
+ }
+
$this->state = $this->get('State');
$this->item = $this->get('Item');
diff --git a/src/com_digicom/admin/views/orders/tmpl/default.php b/src/com_digicom/admin/views/orders/tmpl/default.php
index e91109ca..ffb009b1 100644
--- a/src/com_digicom/admin/views/orders/tmpl/default.php
+++ b/src/com_digicom/admin/views/orders/tmpl/default.php
@@ -71,13 +71,15 @@ function OrderlistItemTask(id) {
diff --git a/src/com_digicom/admin/views/orders/view.html.php b/src/com_digicom/admin/views/orders/view.html.php
index 3c7990a0..8a73d15c 100644
--- a/src/com_digicom/admin/views/orders/view.html.php
+++ b/src/com_digicom/admin/views/orders/view.html.php
@@ -16,6 +16,11 @@ class DigiComViewOrders extends JViewLegacy
function display( $tpl = null )
{
+ if (!JFactory::getUser()->authorise('core.orders', 'com_digicom'))
+ {
+ return JError::raiseWarning(404, JText::_('JERROR_ALERTNOAUTHOR'));
+ }
+
$this->app = JFactory::getApplication();
$document = JFactory::getDocument();
diff --git a/src/com_digicom/admin/views/product/tmpl/edit.php b/src/com_digicom/admin/views/product/tmpl/edit.php
index 34e46e91..b872a109 100644
--- a/src/com_digicom/admin/views/product/tmpl/edit.php
+++ b/src/com_digicom/admin/views/product/tmpl/edit.php
@@ -93,17 +93,19 @@
'general')); ?>
+
-
- 'thumb-image')); ?>
+
+
+ form->getControlGroup('image_intro'); ?>
+
+
+
+ form->getControlGroup('image_full'); ?>
+
+
+
diff --git a/src/com_digicom/admin/views/product/view.html.php b/src/com_digicom/admin/views/product/view.html.php
index 87f143ee..c32df8eb 100644
--- a/src/com_digicom/admin/views/product/view.html.php
+++ b/src/com_digicom/admin/views/product/view.html.php
@@ -29,6 +29,11 @@ class DigiComViewProduct extends JViewLegacy
*/
public function display($tpl = null)
{
+ if (!JFactory::getUser()->authorise('core.products', 'com_digicom'))
+ {
+ return JError::raiseWarning(404, JText::_('JERROR_ALERTNOAUTHOR'));
+ }
+
$this->state = $this->get('State');
$this->item = $this->get('Item');
$this->form = $this->get('Form');
diff --git a/src/com_digicom/admin/views/products/tmpl/default.php b/src/com_digicom/admin/views/products/tmpl/default.php
index 8eb3e72c..ded1b1d1 100644
--- a/src/com_digicom/admin/views/products/tmpl/default.php
+++ b/src/com_digicom/admin/views/products/tmpl/default.php
@@ -80,7 +80,7 @@
echo JLayoutHelper::render('joomla.searchtools.default', array('view' => $this));
?>
-
+
@@ -213,6 +213,7 @@
escape($item->category_title); ?>
+
Preview
@@ -253,10 +254,12 @@
-
+
+
-
diff --git a/src/com_digicom/admin/views/products/view.html.php b/src/com_digicom/admin/views/products/view.html.php
index d30fc8d2..d070c78c 100644
--- a/src/com_digicom/admin/views/products/view.html.php
+++ b/src/com_digicom/admin/views/products/view.html.php
@@ -22,6 +22,12 @@ class DigiComViewProducts extends JViewLegacy
function display( $tpl = null )
{
+ if (!JFactory::getUser()->authorise('core.products', 'com_digicom'))
+ {
+ return JError::raiseWarning(404, JText::_('JERROR_ALERTNOAUTHOR'));
+ }
+
+
if ($this->getLayout() !== 'modal')
{
DigiComHelperDigiCom::addSubmenu('products');
@@ -87,7 +93,7 @@ protected function addToolbar()
// Get the toolbar object instance
$bar = JToolBar::getInstance('toolbar');
JToolbarHelper::title(JText::_('COM_DIGICOM_PRODUCTS_TOOLBAR_TITLE_SITE'), 'stack product');
-
+
if ($canDo->get('core.create') || (count($user->getAuthorisedCategories('com_digicom', 'core.create'))) > 0 )
{
//JToolbarHelper::addNew('product.add');
@@ -95,7 +101,6 @@ protected function addToolbar()
$bar->appendButton('Custom', $layout->render(array()), 'products');
}
-
if ($canDo->get('core.edit.state'))
{
JToolbarHelper::publish('products.publish', 'JTOOLBAR_PUBLISH', true);
@@ -114,7 +119,7 @@ protected function addToolbar()
{
JToolbarHelper::trash('products.trash');
}
-
+
// Instantiate a new JLayoutFile instance and render the layout
$layout = new JLayoutFile('toolbar.title');
$title=array(
diff --git a/src/com_digicom/admin/views/reports/view.html.php b/src/com_digicom/admin/views/reports/view.html.php
index e530c4c1..057abe32 100644
--- a/src/com_digicom/admin/views/reports/view.html.php
+++ b/src/com_digicom/admin/views/reports/view.html.php
@@ -37,6 +37,11 @@ class DigiComViewReports extends JViewLegacy {
function display ($tpl = null )
{
+ if (!JFactory::getUser()->authorise('core.reports', 'com_digicom'))
+ {
+ return JError::raiseWarning(404, JText::_('JERROR_ALERTNOAUTHOR'));
+ }
+
$this->latest_orders = DigiComHelperDigiCom::getOrders(5);
$this->most_sold = DigiComHelperDigiCom::getMostSoldProducts(5);
diff --git a/src/com_digicom/media/css/digicom-admin.css b/src/com_digicom/media/css/digicom-admin.css
index 5ebdcb5f..a24889b2 100644
--- a/src/com_digicom/media/css/digicom-admin.css
+++ b/src/com_digicom/media/css/digicom-admin.css
@@ -149,6 +149,7 @@ ul.usergroups li {
margin-top: 18px;
}
.js-stools {
+ height: 30px;
margin-bottom: 10px;
}
.js-stools .clearfix:after {
@@ -202,8 +203,8 @@ body.com_digicom #adminForm {
}
body.com_digicom .chzn-container-single .chzn-single {
padding: 0 0 0 0.875rem;
- height: 1.8rem;
- line-height: 1.8rem;
+ height: 2rem;
+ line-height: 2rem;
border: 1px solid #dfdfdf;
border-radius: 3px;
background: #ffffff;
@@ -429,13 +430,14 @@ body.com_digicom .subhead #toolbar .btn-success {
width: auto;
}
body.com_digicom #digicom {
- background: #253238;
+ background: #f9f9fb;
}
body.com_digicom #j-sidebar-container {
- background: #253238;
+ background: #ffffff;
+ border-right: 1px solid #eaeaea;
margin-left: 0;
- width: 238px;
- color: #c9d1dd;
+ width: 280px;
+ color: #333333;
overflow: hidden;
border: 0;
-webkit-backface-visibility: hidden;
@@ -447,14 +449,14 @@ body.com_digicom #j-sidebar-container #sidebar {
padding: 15px 0;
}
body.com_digicom #j-sidebar-container #sidebar #submenu {
- width: 200px;
+ width: 220px;
box-sizing: border-box;
padding-left: 0px;
padding-right: 0px;
}
body.com_digicom #j-sidebar-container #sidebar .sidebar-nav .nav-list > li > a {
- padding: 5px 12px;
- color: #c9d1dd;
+ padding: 8px 12px;
+ color: #333333;
font-size: 14px;
line-height: 24px;
text-shadow: none;
@@ -464,29 +466,28 @@ body.com_digicom #j-sidebar-container #sidebar .sidebar-nav .nav-list > li > a >
display: inline-block;
}
body.com_digicom #j-sidebar-container #sidebar .sidebar-nav .nav-list > li > a.dglogo {
- background: url(../images/dglogo-white-176x48.png) no-repeat 16px 0;
+ background: url(../images/dglogo-250x68.png) no-repeat 16px 0;
background-size: 80%;
font-size: 0;
text-indent: -9999px;
height: 43px;
- border-bottom: 1px solid rgba(255, 255, 255, 0.1);
- box-shadow: 0 2px 1px rgba(0, 0, 0, 0.15);
+ border-bottom: 1px solid #f6f7f9;
margin-bottom: 5px;
}
body.com_digicom #j-sidebar-container #sidebar .sidebar-nav .nav-list > li > a:hover,
body.com_digicom #j-sidebar-container #sidebar .sidebar-nav .nav-list > li > a:focus {
background-color: inherit;
- color: #fefefe;
+ color: #1976d2;
}
body.com_digicom #j-sidebar-container #sidebar .sidebar-nav .nav-list > li > a:hover [class^="icon-"],
body.com_digicom #j-sidebar-container #sidebar .sidebar-nav .nav-list > li > a:focus [class^="icon-"],
body.com_digicom #j-sidebar-container #sidebar .sidebar-nav .nav-list > li > a:hover [class*=" icon-"],
body.com_digicom #j-sidebar-container #sidebar .sidebar-nav .nav-list > li > a:focus [class*=" icon-"] {
- color: #fefefe;
+ color: #1976d2;
}
body.com_digicom #j-sidebar-container #sidebar .sidebar-nav .nav-list [class^="icon-"],
body.com_digicom #j-sidebar-container #sidebar .sidebar-nav .nav-list [class*=" icon-"] {
- color: #c9d1dd;
+ color: #333333;
margin-right: 15px;
width: auto;
height: auto;
@@ -505,10 +506,10 @@ body.com_digicom #j-sidebar-container #sidebar .sidebar-nav .nav-list > li.activ
display: block;
position: absolute;
right: 0px;
- top: 7px;
+ top: 0px;
border-style: solid;
- border-width: 10px;
- border-color: transparent #f5f5f5 transparent transparent;
+ border-width: 20px;
+ border-color: transparent #fff transparent transparent;
}
body.com_digicom.sidebar-collapse #j-sidebar-container,
body.com_digicom.layout-dgform #j-sidebar-container {
@@ -522,18 +523,18 @@ body.com_digicom.layout-dgform #j-sidebar-container #sidebar .sidebar-nav #subme
}
body.com_digicom.sidebar-collapse #j-sidebar-container #sidebar .sidebar-nav #submenu.nav-list > li > a.dglogo,
body.com_digicom.layout-dgform #j-sidebar-container #sidebar .sidebar-nav #submenu.nav-list > li > a.dglogo {
- background: url(../images/dglogo-white-36x36.png) no-repeat 6px 0px;
- background-size: 50%;
+ background-size: 120px auto;
+ background-position: 5px 0px;
height: 28px;
- width: 30px;
}
body.com_digicom.sidebar-collapse #j-sidebar-container #sidebar .sidebar-nav #submenu.nav-list > li > a > span + span,
body.com_digicom.layout-dgform #j-sidebar-container #sidebar .sidebar-nav #submenu.nav-list > li > a > span + span {
display: none;
}
-body.com_digicom.sidebar-collapse #j-main-container,
-body.com_digicom.layout-dgform #j-main-container {
- margin-left: 0;
+body.com_digicom.sidebar-collapse #j-sidebar-container #sidebar .sidebar-nav #submenu.nav-list > li.active > a:after,
+body.com_digicom.layout-dgform #j-sidebar-container #sidebar .sidebar-nav #submenu.nav-list > li.active > a:after {
+ top: 10px;
+ border-width: 10px;
}
body.com_digicom.sidebar-collapse div#system-debug,
body.com_digicom.layout-dgform div#system-debug,
@@ -712,6 +713,26 @@ body.com_digicom .tabs-left .nav-tabs > li:hover a {
background: #eee;
border: 0;
}
+body.com_digicom #digicom .panel {
+ box-shadow: rgba(102, 119, 136, 0.03) 0px 6px 8px, rgba(102, 119, 136, 0.3) 0px 1px 2px;
+ background: #ffffff;
+ border-width: 0px;
+ border-style: initial;
+ border-color: initial;
+ border-image: initial;
+}
+body.com_digicom #digicom .panel > .panel-heading {
+ font-size: 15px;
+ font-weight: bold;
+ padding: 15px;
+}
+body.com_digicom #digicom .panel .panel-heading,
+body.com_digicom #digicom .panel-default .panel-footer {
+ color: #667788;
+ text-shadow: rgba(255, 255, 255, 0.5) 0px 1px;
+ background: #f6f7f9;
+ border-color: #eaeaea;
+}
body.com_digicom .container-main {
padding: 0;
}
@@ -723,10 +744,14 @@ body.com_digicom #j-main-container {
background-color: #f9f9fb;
padding: 20px;
width: 100%;
- margin-left: 0px;
box-sizing: border-box;
- margin-right: 0;
float: left;
+ color: #667788;
+ text-shadow: rgba(255, 255, 255, 0.5) 0px 1px;
+ background: #f6f7f9;
+ border-color: #eaeaea;
+ box-shadow: rgba(102, 119, 136, 0.03) 0px 6px 8px, rgba(102, 119, 136, 0.3) 0px 1px 2px;
+ margin: 20px;
}
body.com_digicom #j-sidebar-container,
body.com_digicom #j-main-container {
@@ -810,9 +835,6 @@ body.layout-dgform #j-main-container .form-inline .controls {
body.com_digicom #j-sidebar-container {
display: none;
}
- body.com_digicom.sidebar-collapse #j-main-container {
- margin-left: 0px;
- }
body.com_digicom header.header {
display: block;
}
@@ -840,7 +862,7 @@ body.layout-dgform #j-main-container .form-inline .controls {
/* Sidebar right styling */
#toggle_settings_wrap {
background: rgba(25, 118, 210, 0.9);
- color: #c9d1dd;
+ color: #333333;
padding: 20px;
position: fixed;
top: 0;
diff --git a/src/com_digicom/media/css/options.css b/src/com_digicom/media/css/options.css
new file mode 100644
index 00000000..0cc12e21
--- /dev/null
+++ b/src/com_digicom/media/css/options.css
@@ -0,0 +1,20 @@
+#digicom .panel {
+ box-shadow: rgba(102, 119, 136, 0.03) 0px 6px 8px, rgba(102, 119, 136, 0.3) 0px 1px 2px;
+ background: #ffffff;
+ border-width: 0px;
+ border-style: initial;
+ border-color: initial;
+ border-image: initial;
+}
+#digicom .panel > .panel-heading {
+ font-size: 15px;
+ font-weight: bold;
+ padding: 15px;
+}
+#digicom .panel .panel-heading,
+#digicom .panel-default .panel-footer {
+ color: #667788;
+ text-shadow: rgba(255, 255, 255, 0.5) 0px 1px;
+ background: #f6f7f9;
+ border-color: #eaeaea;
+}
diff --git a/src/com_digicom/media/less/components/chosen.less b/src/com_digicom/media/less/components/chosen.less
index 4f283c21..1e1df32c 100644
--- a/src/com_digicom/media/less/components/chosen.less
+++ b/src/com_digicom/media/less/components/chosen.less
@@ -1,7 +1,7 @@
.chzn-container-single .chzn-single {
padding: 0 0 0 0.875rem;
- height: 1.8rem;
- line-height: 1.8rem;
+ height: 2rem;
+ line-height: 2rem;
border: 1px solid #dfdfdf;
border-radius: 3px;
background: #ffffff;
diff --git a/src/com_digicom/media/less/components/options.less b/src/com_digicom/media/less/components/options.less
new file mode 100644
index 00000000..f90185cb
--- /dev/null
+++ b/src/com_digicom/media/less/components/options.less
@@ -0,0 +1,20 @@
+#digicom .panel {
+ box-shadow: rgba(102, 119, 136, 0.03) 0px 6px 8px, rgba(102, 119, 136, 0.3) 0px 1px 2px;
+ background: rgb(255, 255, 255);
+ border-width: 0px;
+ border-style: initial;
+ border-color: initial;
+ border-image: initial;
+}
+#digicom .panel > .panel-heading {
+ font-size: 15px;
+ font-weight: bold;
+ padding: 15px;
+}
+#digicom .panel .panel-heading,
+#digicom .panel-default .panel-footer {
+ color: rgb(102, 119, 136);
+ text-shadow: rgba(255, 255, 255, 0.5) 0px 1px;
+ background: rgb(246, 247, 249);
+ border-color: rgb(234, 234, 234);
+}
\ No newline at end of file
diff --git a/src/com_digicom/media/less/components/sidebar.less b/src/com_digicom/media/less/components/sidebar.less
index e75f7fa7..2c6b8fdc 100644
--- a/src/com_digicom/media/less/components/sidebar.less
+++ b/src/com_digicom/media/less/components/sidebar.less
@@ -1,10 +1,12 @@
#digicom{
- background: @sidebar-background;
+ background: @body-background;
}
#j-sidebar-container {
background: @sidebar-background;
+ border-right: 1px solid rgb(234, 234, 234);
+
margin-left: 0;
- width: 238px;
+ width: 280px;
float: left;
color: @sidebar-text-color;
// position: fixed;
@@ -19,16 +21,15 @@
float: left;
#sidebar {
padding: 15px 0;
-
#submenu {
- width: 200px;
+ width: 220px;
box-sizing: border-box;
padding-left: 0px;
padding-right: 0px;
}
.sidebar-nav .nav-list {
> li > a {
- padding: 5px 12px;
+ padding: 8px 12px;
color: @sidebar-text-color;
font-size: 14px;
line-height: 24px;
@@ -37,20 +38,19 @@
> span + span {display: inline-block;}
&.dglogo {
- background: url(../images/dglogo-white-176x48.png) no-repeat 16px 0;
+ background: url(../images/dglogo-250x68.png) no-repeat 16px 0;
background-size: 80%;
font-size: 0;
text-indent: -9999px;
height: 43px;
- border-bottom: 1px solid rgba(255, 255, 255, 0.1);
- box-shadow: 0 2px 1px rgba(0, 0, 0, 0.15);
+ border-bottom: 1px solid rgb(246, 247, 249);
margin-bottom: 5px;
}
&:hover,&:focus {
background-color: inherit;
- color: @sidebar-active-text-color;
- [class^="icon-"], [class*=" icon-"] {color: @sidebar-active-text-color;}
+ color: @primary-blue;
+ [class^="icon-"], [class*=" icon-"] {color: @primary-blue;}
}
}
[class^="icon-"], [class*=" icon-"] {
@@ -71,10 +71,10 @@
display: block;
position: absolute;
right: 0px;
- top: 7px;
+ top: 0px;
border-style: solid;
- border-width: 10px;
- border-color: transparent #f5f5f5 transparent transparent;
+ border-width: 20px;
+ border-color: transparent #fff transparent transparent;
}
}
}
@@ -94,14 +94,22 @@
> li {
width: @sidebar-collapse-width;
> a.dglogo {
- background: url(../images/dglogo-white-36x36.png) no-repeat 6px 0px;
- background-size: 50%;
+ background-size: 120px auto;
+ background-position: 5px 0px;
+ // background: url(../images/dglogo-white-36x36.png) no-repeat 6px 0px;
+ // background-size: 50%;
height: 28px;
- width: 30px;
+ // width: 30px;
}
> a > span + span {
display: none;
}
+ &.active > a{
+ &:after {
+ top: 10px;
+ border-width: 10px;
+ }
+ }
}
}
}
@@ -110,7 +118,7 @@
}
#j-main-container {
- margin-left: 0;
+ // margin-left: 0;
// margin-left: @sidebar-collapse-width;
}
div#system-debug,
diff --git a/src/com_digicom/media/less/digicom-admin.less b/src/com_digicom/media/less/digicom-admin.less
index fefe71f0..1a19a8e9 100644
--- a/src/com_digicom/media/less/digicom-admin.less
+++ b/src/com_digicom/media/less/digicom-admin.less
@@ -15,12 +15,12 @@
@secondary-blue : #489be0;
@dark-blue : #1E4973;
-@gray : #f9f9fb ;
+@gray : #f9f9fb ;
@body-background: @gray;
-@sidebar-background: #253238;
+@sidebar-background: rgb(255, 255, 255);
@sidebar-active-background: @primary-blue;
-@sidebar-text-color: #c9d1dd;
+@sidebar-text-color: rgb(51, 51, 51);
@sidebar-active-text-color: #fefefe;
@sidebar-collapse-width: 38px;
@@ -158,8 +158,9 @@ ul.usergroups li {
margin-right: 52px;
margin-top: 18px;
}
-// Search tools
+// Search tools.
.js-stools{
+ height: 30px;
margin-bottom: 10px;
.clearfix:after{
clear: none;
@@ -251,6 +252,7 @@ body.com_digicom {
@import "components/sidebar.less";
@import "components/form.less";
@import "components/tabs.less";
+ @import "components/options.less";
.container-main { padding: 0; }
@@ -262,10 +264,17 @@ body.com_digicom {
background-color: @body-background;
padding: 20px;
width: 100%;
- margin-left: 0px;
+ // margin-left: 0px;
box-sizing: border-box;
- margin-right: 0;
+ // margin-right: 0;
float: left;
+
+ color: rgb(102, 119, 136);
+ text-shadow: rgba(255, 255, 255, 0.5) 0px 1px;
+ background: rgb(246, 247, 249);
+ border-color: rgb(234, 234, 234);
+ box-shadow: rgba(102, 119, 136, 0.03) 0px 6px 8px, rgba(102, 119, 136, 0.3) 0px 1px 2px;
+ margin: 20px;
}
#j-sidebar-container,
@@ -363,7 +372,7 @@ body.layout-dgform {
display: none;
}
&.sidebar-collapse #j-main-container{
- margin-left: 0px;
+ // margin-left: 0px;
}
header.header{
display: block;
diff --git a/src/com_digicom/site/controllers/cart.php b/src/com_digicom/site/controllers/cart.php
index 182cf68d..dfd0a7af 100644
--- a/src/com_digicom/site/controllers/cart.php
+++ b/src/com_digicom/site/controllers/cart.php
@@ -507,6 +507,7 @@ function validateInput()
*/
function processPayment()
{
+
$session = JFactory::getSession();
$app = JFactory::getApplication();
$input = $app->input;
@@ -518,11 +519,11 @@ function processPayment()
if($processor == '')
{
- $app->redirect(JRoute::_('index.php?option=com_digicom&view=orders', false),JText::_('COM_DIGICOM_PAYMENT_NO_PROCESSOR_SELECTED'));
+ $app->redirect(JRoute::_('index.php?option=com_digicom&view=orders', false), JText::_('COM_DIGICOM_PAYMENT_NO_PROCESSOR_SELECTED'));
return false;
}
- $post = $input->post->getArray();
+ $post = $input->post->getArray();
// $rawDataPost = $input->post->getArray();
// $rawDataGet = $input->get->getArray();
// $post = array_merge($rawDataGet, $rawDataPost);
@@ -534,8 +535,7 @@ function processPayment()
if( !count($post) ) $post = @file_get_contents('php://input');
$data = $dispatcher->trigger('onDigicom_PayProcesspayment', array($post));
- $data = reset($data);
-
+ $data = $data[0];
$order_id = $input->get('order_id', '', 'int');
$sid = $input->get('sid', '', 'int');
@@ -552,14 +552,30 @@ function processPayment()
}
}
- $param = array();
- $param['params'] = JPluginHelper::getPlugin('digicom_pay', $processor)->params;
- // $param['handle'] = &$this;
-
$configs = $this->_config;
$cart = $this->_model;
$items = $cart->getOrderItems($order_id);
+ /*
+ * new security layer
+ * since 25th dec 2019
+ * make sure order exist
+ */
+ $orderTable = $cart->getTable('Order');
+ $orderTable->load($order_id);
+ if(!$orderTable->id){
+ JFactory::getApplication()->enqueueMessage(JText::_('COM_DIGICOM_PAYMENT_NO_ORDER_PASSED'), 'error');
+ $app->redirect('index.php');
+ return;
+ }
+
+ /************************************/
+
+
+ $param = array();
+ $param['params'] = JPluginHelper::getPlugin('digicom_pay', $processor)->params;
+ // $param['handle'] = &$this;
+
$products = array();
if(isset($items) && count($items) > 0){
foreach($items as $key=>$product){
diff --git a/src/com_digicom/site/controllers/downloads.php b/src/com_digicom/site/controllers/downloads.php
index cd0698de..e6a97b01 100644
--- a/src/com_digicom/site/controllers/downloads.php
+++ b/src/com_digicom/site/controllers/downloads.php
@@ -51,9 +51,14 @@ function go()
}
$fileInfo = $model->getfileinfo();
-
- $access = DigiComSiteHelperDigiCom::checkUserAccessToFile($fileInfo, $customer->_user->id);
- $result = $dispatcher->trigger('onDigicomDownloadCheckAccess',array('com_digicom.download', $fileInfo, $customer->_user));
+
+ if(!isset($fileInfo->product_id) or !$fileInfo->product_id){
+ $access = false;
+ $result = [false];
+ }else{
+ $access = DigiComSiteHelperDigiCom::checkUserAccessToFile($fileInfo, $customer->_user->id);
+ $result = $dispatcher->trigger('onDigicomDownloadCheckAccess',array('com_digicom.download', $fileInfo, $customer->_user));
+ }
if(
(
@@ -79,7 +84,6 @@ function go()
JFactory::getApplication()->close();
}
-
if(empty($fileInfo->url)){
$itemid = JFactory::getApplication()->input->get('itemid',0);
$msg = JText::sprintf('COM_DIGICOM_DOWNLOADS_FILE_DONT_EXIST_DETAILS',$fileInfo->name);
diff --git a/src/com_digicom/site/controllers/orders.php b/src/com_digicom/site/controllers/orders.php
new file mode 100644
index 00000000..03238041
--- /dev/null
+++ b/src/com_digicom/site/controllers/orders.php
@@ -0,0 +1,44 @@
+_model = $this->getModel( "Orders" );
+ }
+
+
+ function cycleStatus()
+ {
+ $app = JFactory::getApplication();
+ $res = $this->_model->cycleStatus();
+ $msg = "";
+ if(!$res){
+ $msg = JText::_('COM_DIGICOM_ORDERS_NOTICE_ORDER_STATUS_CHANGE_ERR');
+ }else{
+ $msg = JText::_('COM_DIGICOM_ORDERS_NOTICE_ORDER_STATUS_CHANGED');
+ }
+
+ $app->enqueueMessage($msg);
+
+ $link_orders = "index.php?option=com_digicom&view=manager";
+ $this->setRedirect($link_orders, $msg);
+ }
+
+}
diff --git a/src/com_digicom/site/helpers/log.php b/src/com_digicom/site/helpers/log.php
index 87b25034..3c4b46e7 100644
--- a/src/com_digicom/site/helpers/log.php
+++ b/src/com_digicom/site/helpers/log.php
@@ -29,7 +29,7 @@ class DigiComSiteHelperLog {
* @info = log details or extra info encoded by json formet
* setLog($type, $hook, $message, $info, $status = 'complete');
* */
- public static function setLog($type, $hook, $callbackid, $message, $info, $status = 'complete', $refid = 0)
+ public static function setLog($type, $hook, $callbackid = '', $message = '', $info = '', $status = 'complete', $refid = 0)
{
$dispatcher = JDispatcher::getInstance();
$config = JComponentHelper::getParams('com_digicom');
diff --git a/src/com_digicom/site/helpers/price.php b/src/com_digicom/site/helpers/price.php
index cf0c497b..3672142d 100644
--- a/src/com_digicom/site/helpers/price.php
+++ b/src/com_digicom/site/helpers/price.php
@@ -16,7 +16,7 @@ class DigiComSiteHelperPrice {
/**
* price formet helper
*/
- public static function format_price( $amount, $ccode, $add_sym = false, $configs )
+ public static function format_price( $amount, $ccode, bool $add_sym = false, $configs )
{
$currency_use = $configs->get('currency_use','symbol');
@@ -115,7 +115,7 @@ public static function get_tax_rate($configs, $country = false, $state = false )
}
if( ! empty( $country ) ) {
- $tax_rates = $configs->get('tax_rates',array());
+ $tax_rates = $configs->get('tax_rates', '');
$json = json_decode($tax_rates, true);
if(is_array($json)){
$tax_rates = self::group_by_key($json);
diff --git a/src/com_digicom/site/language/en-GB/en-GB.com_digicom.ini b/src/com_digicom/site/language/en-GB/en-GB.com_digicom.ini
index 89ad0677..482ce4d2 100644
--- a/src/com_digicom/site/language/en-GB/en-GB.com_digicom.ini
+++ b/src/com_digicom/site/language/en-GB/en-GB.com_digicom.ini
@@ -56,12 +56,14 @@ COM_DIGICOM_DOWNLOAD = "Download"
COM_DIGICOM_FILE_DOESNT_EXIST = "File dosen't exist"
COM_DIGICOM_FILE_DOWNLOAD_FAILED = "The File Download faild
%s. May be file dosent exist of something went wrong. please contact support!"
COM_DIGICOM_FILE_SIZE_EMPTY = "Sorry! file size empty!! Please contact support"
+COM_DIGICOM_CUSTOMER = "Customer"
COM_DIGICOM_CUSTOMER_ID = "Customer ID"
COM_DIGICOM_CUSTOMER_USERNAME = "Customer Username"
COM_DIGICOM_CUSTOMER_SINCE = "Customer since"
COM_DIGICOM_IMAGE = "Image"
COM_DIGICOM_TYPE = "Type"
COM_DIGICOM_TAGS = "Tags"
+COM_DIGICOM_IP = "IP"
COM_DIGICOM_NAME = "Your Name"
COM_DIGICOM_COMPANY = "Company"
@@ -198,6 +200,21 @@ COM_DIGICOM_ORDERS_PAGE_TITLE = "My Orders"
COM_DIGICOM_ORDERS_NO_ORDER_FOUND_NOTICE = "No Order found!"
COM_DIGICOM_SEARCH_ORDER_LABEL = "Order Number"
+;--------------------------------------------
+; MANAGER PAGE
+;--------------------------------------------
+COM_DIGICOM_MANAGER_PAGE_TITLE = "Manager Page"
+COM_DIGICOM_ORDERS_SEARCH_NOTICE = "Quick Search Tips: Example:
email:me@domain.com. Usable codes:
id: and write id of customer
user: and write username or full name of customer
email: and write email of customer. Then hit search"
+
+COM_DIGICOM_ORDER_STATUS_ACTIVE = "Active"
+COM_DIGICOM_ORDER_STATUS_PENDING = "Pending"
+COM_DIGICOM_ORDER_STATUS_CANCEL = "Cancel"
+COM_DIGICOM_ORDER_MAKE_PAID = "Paid & Active"
+COM_DIGICOM_ORDER_MAKE_REFUND = "Refund"
+
+COM_DIGICOM_ORDERS_NOTICE_ORDER_STATUS_CHANGED = "Success! Order status has changed."
+COM_DIGICOM_ORDERS_NOTICE_ORDER_STATUS_CHANGE_ERR = "Fail! Order status has faild to change."
+
;--------------------------------------------
; ORDER PAGE
;--------------------------------------------
diff --git a/src/com_digicom/site/models/cart.php b/src/com_digicom/site/models/cart.php
index b0e18b48..c71320c4 100644
--- a/src/com_digicom/site/models/cart.php
+++ b/src/com_digicom/site/models/cart.php
@@ -216,7 +216,7 @@ function getCartItems($customer, $configs)
{
$dispatcher = JEventDispatcher::getInstance();
- if(!is_null($this->_items)){
+ if(!is_null($this->_items) && count($this->_items)){
return $this->_items;
}
@@ -858,9 +858,10 @@ function checkSuccess( $sid )
function proccessSuccess($post, $pay_plugin, $order_id, $sid, $data, $items)
{
- $app = JFactory::getApplication();
+ $app = JFactory::getApplication();
$session = JFactory::getSession();
$customer = $this->loadCustomer($sid);
+
if(!$customer)
{
$order = $this->getOrder($order_id);
@@ -935,11 +936,12 @@ function proccessSuccess($post, $pay_plugin, $order_id, $sid, $data, $items)
// redirect after payment complete
$afterpurchase = $configs->get('afterpurchase', 2);
+
switch ($afterpurchase) {
case '2':
if('Active' == $status){
- $session->set('com_digicom', array('action' => 'payment_complete', 'id' => $order_id));
- $link = JRoute::_('index.php?option=com_digicom&view=thankyou', false);
+ $session->set('com_digicom', array('action' => 'payment_complete', 'id' => $order_id));
+ $link = JRoute::_('index.php?option=com_digicom&view=thankyou&order_id='.$order_id, false);
}else{
$app->enqueueMessage($msg, 'message');
$link = JRoute::_('index.php?option=com_digicom&view=order&id='.$order_id, false);
@@ -958,7 +960,7 @@ function proccessSuccess($post, $pay_plugin, $order_id, $sid, $data, $items)
}
- $app->redirect($link);
+ $app->redirect($link, 200);
return true;
}
diff --git a/src/com_digicom/site/models/checkout.php b/src/com_digicom/site/models/checkout.php
index 5a6db9d3..a1f1ceb4 100644
--- a/src/com_digicom/site/models/checkout.php
+++ b/src/com_digicom/site/models/checkout.php
@@ -26,4 +26,40 @@ public function getOrder(){
return $this->orders[$order_id];
}
+ public function getOrderItems(){
+ $input = JFactory::getApplication()->input;
+ $order_id = $input->get('id','0');
+
+ $db = JFactory::getDbo();
+ $sql = 'SELECT `p`.*, `od`.quantity FROM
+ `#__digicom_products` AS `p`
+ INNER JOIN
+ `#__digicom_orders_details` AS `od` ON (`od`.`productid` = `p`.`id`)
+ WHERE `orderid` ='.$order_id;
+
+ $db->setQuery($sql);
+ $items = $db->loadObjectList();
+ // print_r($items);die;
+
+ $configs = $this->getConfigs();
+ //change the price of items if needed
+ for ( $i = 0; $i < count( $items ); $i++ )
+ {
+ $item = &$items[$i];
+ $item->discount = 0;
+ $item->currency = $configs->get('currency','USD');
+ $item->price = DigiComSiteHelperPrice::format_price( $item->price, $item->currency, false, $configs ); //sprintf( $price_format, $item->product_price );
+ $item->price_formated = $item->price;
+ $item->subtotal = $item->price * $item->quantity;
+ }
+
+ return $items ;
+
+ }
+
+ function getConfigs() {
+ $comInfo = JComponentHelper::getComponent('com_digicom');
+ return $comInfo->params;
+ }
+
}
diff --git a/src/com_digicom/site/models/downloads.php b/src/com_digicom/site/models/downloads.php
index 0749f844..35b96e68 100644
--- a/src/com_digicom/site/models/downloads.php
+++ b/src/com_digicom/site/models/downloads.php
@@ -123,7 +123,7 @@ protected function _buildItemOrderBy()
*/
public function getItems()
{
- $db = $this->getDbo();
+ $db = $this->getDbo();
// Invoke the parent getItems method to get the main list
$items = parent::getItems();
@@ -144,13 +144,12 @@ public function getItems()
$params->loadString($active->params);
}
}
-
- // trigger events
- $dispatcher = JEventDispatcher::getInstance();
- JPluginHelper::importPlugin('digicom');
- $dispatcher->trigger('onDigicomDownloadItems', array ('com_digicom.downloads', &$items));
-
-
+
+ // trigger events
+ $dispatcher = JEventDispatcher::getInstance();
+ JPluginHelper::importPlugin('digicom');
+ $dispatcher->trigger('onDigicomDownloadItems', array ('com_digicom.downloads', &$items));
+
//products
if ($items)
{
@@ -226,7 +225,7 @@ public function getItems()
//print_r($items);die;
// check and add products files
$configs = JComponentHelper::getComponent('com_digicom')->params;
- $pagination = $configs->get('download_pagination', 0);
+ $pagination = $configs->get('download_page', 0);
if(!$pagination){
$productAdded = array();
@@ -393,7 +392,7 @@ function getfileinfo()
$jinput = JFactory::getApplication()->input;
$fileid = $jinput->get('downloadid', '0');
-
+
if($fileid == '0')
{
$fileid = $jinput->get('token', '0');
diff --git a/src/com_digicom/site/models/manager.php b/src/com_digicom/site/models/manager.php
new file mode 100644
index 00000000..06b6cdff
--- /dev/null
+++ b/src/com_digicom/site/models/manager.php
@@ -0,0 +1,119 @@
+input->get('search', '', 'nohtml');
+ $this->setState('filter.search', $search);
+
+ $user = JFactory::getUser();
+ $this->setState('filter.userid', $user->id);
+
+ $params = $app->getParams();
+ $this->setState('params', $params);
+
+ parent::populateState($ordering, $direction);
+ }
+ /**
+ * Get the master query for retrieving a list of products subject to the model state.
+ *
+ * @return JDatabaseQuery
+ *
+ * @since 1.6
+ */
+ protected function getListQuery()
+ {
+ // Create a new query object.
+ $db = $this->getDbo();
+ $query = $db->getQuery(true);
+
+ // Select the required fields from the table.
+ $query->select('a.*')
+ ->from('#__digicom_orders as a');
+ // ->where('a.userid = ' . $db->quote($this->getState('filter.userid')));
+
+ // Join over the users for the checked out user.
+ $query->select(array('c.name','c.email'))
+ ->join('LEFT', '#__digicom_customers AS c ON c.id=a.userid');
+
+ // Join over the users for the checked out user.
+ $query->select('ju.username')
+ ->join('LEFT', '#__users AS ju ON ju.id=a.userid');
+
+
+ // Filter by search
+ if ($this->getState('filter.search'))
+ {
+ // $query->where('a.id = ' . $db->quote($this->getState('filter.search')));
+ $search = $this->getState('filter.search');
+ // print_r($search);die;
+ if (!empty($search))
+ {
+ if (stripos($search, 'id:') === 0)
+ {
+ $query->where('a.id = ' . (int) substr($search, 3));
+ }
+ elseif (stripos($search, 'user:') === 0)
+ {
+ $search = $db->quote('%' . $db->escape(substr($search, 5), true) . '%');
+ $query->where('(ju.username LIKE ' . $search . ' OR c.name LIKE ' . $search . ' OR ju.name LIKE ' . $search . ')');
+ }
+ elseif (stripos($search, 'email:') === 0)
+ {
+ $search = $db->quote('%' . $db->escape(substr($search, 6), true) . '%');
+ $query->where('(c.email LIKE ' . $search . ')');
+ }
+ elseif (stripos($search, 'processor:') === 0)
+ {
+ $search = $db->quote('%' . $db->escape(substr($search, 10), true) . '%');
+ $query->where('(a.processor LIKE ' . $search . ')');
+ }
+ elseif (stripos($search, 'promocode:') === 0)
+ {
+ $search = $db->quote('%' . $db->escape(substr($search, 10), true) . '%');
+ $query->where('(a.promocode LIKE ' . $search . ')');
+ }
+ else
+ {
+ $query->where('a.id = ' . (int) $search);
+ }
+
+ }
+ }
+
+ $query->order('id desc');
+
+ // echo $query->__toString();die;
+ return $query;
+ }
+
+}
diff --git a/src/com_digicom/site/models/order.php b/src/com_digicom/site/models/order.php
index 23e8f0f4..98847bae 100644
--- a/src/com_digicom/site/models/order.php
+++ b/src/com_digicom/site/models/order.php
@@ -81,6 +81,8 @@ public function getItem($pk = null)
// print_r($prods);die;
$data->products = $prods;
+ $data->logs = $this->getLogs($data->id);
+
$this->_item[$pk] = $data;
}
catch (Exception $e)
@@ -102,4 +104,45 @@ public function getItem($pk = null)
}
+ public function getOrderItems( $order_id ){
+
+ $configs = $this->getConfigs();
+ $customer = new DigiComSiteHelperSession();
+ $db = JFactory::getDbo();
+ $sql = 'SELECT `p`.*, `od`.quantity FROM
+ `#__digicom_products` AS `p`
+ INNER JOIN
+ `#__digicom_orders_details` AS `od` ON (`od`.`productid` = `p`.`id`)
+ WHERE `orderid` ='.$order_id;
+
+ $db->setQuery($sql);
+ $items = $db->loadObjectList();
+
+ //change the price of items if needed
+ for ( $i = 0; $i < count( $items ); $i++ )
+ {
+ $item = &$items[$i];
+ $item->discount = 0;
+ $item->currency = $configs->get('currency','USD');
+ $item->price = DigiComSiteHelperPrice::format_price( $item->price, $item->currency, false, $configs ); //sprintf( $price_format, $item->product_price );
+ $item->subtotal = $item->price * $item->quantity;
+ }
+
+ return $items ;
+
+ }
+
+ public function getLogs($order)
+ {
+ $db = JFactory::getDBO();
+ $sql = "SELECT * FROM #__digicom_log WHERE callbackid='". $order ."'";
+ $db->setQuery($sql);
+ return $db->loadObjectList();
+ }
+
+ function getConfigs() {
+ $comInfo = JComponentHelper::getComponent('com_digicom');
+ return $comInfo->params;
+ }
+
}
diff --git a/src/com_digicom/site/models/orders.php b/src/com_digicom/site/models/orders.php
index 843bb919..db6f165f 100644
--- a/src/com_digicom/site/models/orders.php
+++ b/src/com_digicom/site/models/orders.php
@@ -11,64 +11,168 @@
class DigiComModelOrders extends JModelList
{
- /**
- * Method to auto-populate the model state.
- *
- * This method should only be called once per instantiation and is designed
- * to be called on the first call to the getState() method unless the model
- * configuration flag to ignore the request is set.
- *
- * Note. Calling getState in this method will result in recursion.
- *
- * @param string $ordering An optional ordering field.
- * @param string $direction An optional direction (asc|desc).
- *
- * @return void
- *
- * @since 12.2
- */
- protected function populateState($ordering = 'ordering', $direction = 'ASC')
- {
- $app = JFactory::getApplication();
-
- // Get the parent id if defined.
- $search = $app->input->get('search', '');
- $this->setState('filter.search', $search);
-
- $user = JFactory::getUser();
- $this->setState('filter.userid', $user->id);
-
- $params = $app->getParams();
- $this->setState('params', $params);
-
- parent::populateState($ordering, $direction);
- }
- /**
- * Get the master query for retrieving a list of products subject to the model state.
- *
- * @return JDatabaseQuery
- *
- * @since 1.6
- */
- protected function getListQuery()
- {
- // Create a new query object.
- $db = $this->getDbo();
- $query = $db->getQuery(true);
-
- // Select the required fields from the table.
- $query->select('a.*')
- ->from('#__digicom_orders as a')
- ->where('a.userid = ' . $db->quote($this->getState('filter.userid')));
-
- // Filter by search
- if ($this->getState('filter.search'))
- {
- $query->where('a.id = ' . $db->quote($this->getState('filter.search')));
- }
-
- // echo $query->__toString();die;
- return $query;
- }
-
+ /**
+ * Method to auto-populate the model state.
+ *
+ * This method should only be called once per instantiation and is designed
+ * to be called on the first call to the getState() method unless the model
+ * configuration flag to ignore the request is set.
+ *
+ * Note. Calling getState in this method will result in recursion.
+ *
+ * @param string $ordering An optional ordering field.
+ * @param string $direction An optional direction (asc|desc).
+ *
+ * @return void
+ *
+ * @since 12.2
+ */
+ protected function populateState($ordering = 'ordering', $direction = 'ASC')
+ {
+ $app = JFactory::getApplication();
+
+ // Get the parent id if defined.
+ $search = $app->input->get('search', '');
+ $this->setState('filter.search', $search);
+
+ $user = JFactory::getUser();
+ $this->setState('filter.userid', $user->id);
+
+ $params = $app->getParams();
+ $this->setState('params', $params);
+
+ parent::populateState($ordering, $direction);
+ }
+
+ /**
+ * Get the master query for retrieving a list of products subject to the model state.
+ *
+ * @return JDatabaseQuery
+ *
+ * @since 1.6
+ */
+ protected function getListQuery()
+ {
+ // Create a new query object.
+ $db = $this->getDbo();
+ $query = $db->getQuery(true);
+
+ // Select the required fields from the table.
+ $query->select('a.*')
+ ->from('#__digicom_orders as a')
+ ->where('a.userid = ' . $db->quote($this->getState('filter.userid')));
+
+ // Filter by search
+ if ($this->getState('filter.search')) {
+ $query->where('a.id = ' . $db->quote($this->getState('filter.search')));
+ }
+
+ // Add the list ordering clause.
+ $query->order('a.id DESC');
+
+ // echo $query->__toString();die;
+ return $query;
+ }
+
+ /**
+ * method to cycleStatus
+ * quick action to change order status
+ */
+ public function cycleStatus()
+ {
+ $db = JFactory::getDBO();
+ $input = JFactory::getApplication()->input;
+ //orderstatus
+ //print_r($_POST);die;
+ $orderids = $input->get('cid', null, null);
+ $statuses = $input->post->get('orderstatus', null, null);
+ $status = $statuses['0'];
+ $id = $orderids['0'];
+
+ $table = $this->getTable('order');
+ $table->load($id);
+ $table->status = $status;
+
+ if (empty($table->transaction_number)) {
+ $table->transaction_number = DigiComSiteHelperDigicom::getUniqueTransactionId($table->id);
+ }
+
+ if ($status == 'Paid') {
+ $table->amount_paid = $table->amount;
+ $table->status = 'Active';
+ } elseif ($status == 'Refund') {
+ $table->amount_paid = 0;
+ }
+
+ if (!$table->store()) {
+ return JFactory::getApplication()->enqueueMessage(JText::_('COM_DIGICOM_ORDER_STATUS_CHANGED_FAILED', $table->getErrorMsg()), 'error');
+ }
+
+ if ($status == 'Pending') {
+ $sql = "update #__digicom_orders_details set published=0 where orderid in ('" . $id . "')";
+ $type = 'process_order';
+ } elseif ($status == 'Active' or $status == 'Paid') {
+ $sql = "update #__digicom_orders_details set published=1 where orderid in ('" . $id . "')";
+ $type = 'complete_order';
+ } elseif ($status == 'Cancel') {
+ $sql = "update #__digicom_orders_details set published='-1' where orderid in ('" . $id . "')";
+ $type = 'cancel_order';
+ } elseif ($status == 'Refund') {
+ $sql = "update #__digicom_orders_details set published='-2' where orderid in ('" . $id . "')";
+ $type = 'refund_order';
+ }
+
+ $db->setQuery($sql);
+ $db->execute();
+
+ // based on order status changes, we need to update license too :)
+ $this->updateLicensesStatus($id, $type);
+
+ // sent email as order status has changed
+ DigiComHelperEmail::sendApprovedEmail($id, $type, $status);
+
+ $dispatcher = JDispatcher::getInstance();
+ if ($status == 'Active' or $status == 'Paid') {
+ $orders = $this->getInstance('Order', 'DigiComModel');
+ $items = $orders->getOrderItems($id);
+
+ $dispatcher->trigger('onDigicomAfterPaymentComplete', [$id, $info = [], $table->processor, $items, $table->userid]);
+ } else {
+ $dispatcher->trigger('onDigicomAdminAfterOrderStatusChange', [$table]);
+ }
+
+ return true;
+ }
+
+ /*
+ * create license as we are changng the status
+ * $orderid = id of order
+ * $type = order status; like: complete_order;
+ */
+ public function updateLicensesStatus($orderid, $type)
+ {
+ $order = $this->getOrder($orderid);
+ $items = $order->products;
+ $customer_id = $order->userid;
+ $number_of_products = count($items);
+ DigiComSiteHelperLicense::updateLicenses($orderid, $number_of_products, $items, $customer_id, $type);
+ }
+
+ public function getOrder($id = 0)
+ {
+ $db = JFactory::getDBO();
+ $sql = 'SELECT o.*'
+ . ' FROM #__digicom_orders o'
+ . " WHERE o.id='" . intval($id) . "' AND o.published='1'";
+ $db->setQuery($sql);
+ $order = $db->loadObject();
+
+ $sql = "SELECT p.id, p.name, p.price,p.catid, od.package_type,od.quantity, od.amount_paid FROM #__digicom_products as p, #__digicom_orders_details as od WHERE p.id=od.productid AND od.orderid='" . $order->id . "'";
+ $db->setQuery($sql);
+ $prods = $db->loadObjectList();
+
+ $order->products = $prods;
+
+ return $order;
+ }
}
diff --git a/src/com_digicom/site/router.php b/src/com_digicom/site/router.php
index a991357d..cec4904c 100644
--- a/src/com_digicom/site/router.php
+++ b/src/com_digicom/site/router.php
@@ -59,8 +59,8 @@ public function build(&$query)
{
// there are no menu Itemid found, lets dive into menu finder
$menuItem = $menu->getItems('link', 'index.php?option=com_digicom&view='.$view, true);
- //print_r($menuItem);die;
- if(!is_null($menuItem) && count($menuItem)){
+ $total = count((array)$menuItem);
+ if($total){
$query['Itemid'] = $menuItem->id;
$menuItemGiven = true;
}else{
@@ -91,11 +91,14 @@ public function build(&$query)
&&
$menuItem->query['view'] != $query['view']
){
+
// there are no exact menu Itemid found, lets dive into menu finder
$checkmenu = JMenu::getInstance('site');
- $checkmenuItem = $checkmenu->getItem('link', 'index.php?option=com_digicom&view='.$view, true);
+ $checkmenuItem = $checkmenu->getItems('link', 'index.php?option=com_digicom&view='.$view, true);
+
- if(!is_null($checkmenuItem)){
+ $total = count((array)$checkmenuItem);
+ if($total){
$menu = $checkmenu;
$menuItem = $checkmenuItem;
$query['Itemid'] = $menuItem->id;
@@ -144,7 +147,8 @@ public function build(&$query)
$menu = JMenu::getInstance('site');
$menuItem = $menu->getItems('link', 'index.php?option=com_digicom&view=orders', true);
- if(!is_null($menuItem)){
+ $total = count((array)$menuItem);
+ if($total){
$query['Itemid'] = $menuItem->id;
$menuItemGiven = true;
}else{
@@ -167,21 +171,19 @@ public function build(&$query)
}
}
- elseif ($view == 'dashboard' or $view == 'downloads' or $view == 'download' or $view == 'profile' or $view == 'login' or $view == 'register' or $view == 'billing' or $view == 'thankyou')
+ elseif ($view == 'dashboard' or $view == 'downloads' or $view == 'download' or $view == 'profile' or $view == 'login' or $view == 'register' or $view == 'billing' or $view == 'thankyou' or $view == 'manager')
{
// now check if its downloads details view
- if($view == 'download' or $view == 'downloads'){
+ if($view == 'download'){
// check for downloads menu
$menuItem = $menu->getItems('link', 'index.php?option=com_digicom&view=downloads', true);
-
- if(!is_null($menuItem)) {
+ $total = count((array)$menuItem);
+ if($total){
$query['Itemid'] = $menuItem->id;
$menuItemGiven = true;
- if($view == 'download'){
- $segments[] = $query['id'];
- unset($query['id']);
- }
+ $segments[] = $query['id'];
+ unset($query['id']);
}
}
@@ -201,8 +203,8 @@ public function build(&$query)
$menu = JMenu::getInstance('site');
$menuItem = $menu->getItems('link', 'index.php?option=com_digicom&view=cart', true);
- //print_r($menuItem);die;
- if(!is_null($menuItem)){
+ $total = count((array)$menuItem);
+ if($total){
$query['Itemid'] = $menuItem->id;
$menuItemGiven = true;
}else{
@@ -219,25 +221,14 @@ public function build(&$query)
}
unset($query['view']);
- }
- elseif($view == 'cart')
+ }elseif($view == 'cart')
{
- $menu = JMenu::getInstance('site');
- $menuItem = $menu->getItems('link', 'index.php?option=com_digicom&view=cart', true);
-
if (!$menuItemGiven)
{
- if(!is_null($menuItem)){
- $query['Itemid'] = $menuItem->id;
- $menuItemGiven = true;
- unset($query['view']);
- }else{
- $segments[] = $view;
- }
- }else{
- unset($query['view']);
+ $segments[] = $view;
}
+ unset($query['view']);
}
// echo $view;die;
// Handle product or category
@@ -321,15 +312,14 @@ public function build(&$query)
$menuItem = $menu->getItems('link', 'index.php?option=com_digicom&view=category&id='.$catid, true);
//print_r($menuItem);die;
- if(!is_null($menuItem) && count($menuItem))
- {
+ $total = count((array)$menuItem);
+ if($total){
$query['Itemid'] = $menuItem->id;
$menuItemGiven = true;
}else{
$menuItem = $menu->getItems('link', 'index.php?option=com_digicom&view=category&id=0', true);
- //print_r($menuItem);die;
- if(!is_null($menuItem) && count($menuItem))
- {
+ $total = count((array)$menuItem);
+ if($total){
$query['Itemid'] = $menuItem->id;
$menuItemGiven = true;
}
@@ -377,7 +367,7 @@ public function build(&$query)
// print_r($array);die;
$array = array_reverse($array);
- if (!$advanced && !is_null($array))
+ if (!$advanced && count($array))
{
$array[0] = (int) $catid . ':' . $array[0];
}
@@ -462,7 +452,7 @@ public function build(&$query)
}
}
- $total = !is_null($segments) ? count($segments) : 0;
+ $total = count($segments);
for ($i = 0; $i < $total; $i++)
{
@@ -484,7 +474,7 @@ public function build(&$query)
public function parse(&$segments)
{
$menu = JMenu::getInstance('site');
- $total = !is_null($segments) ? count($segments) : 0;
+ $total = count($segments);
$vars = array();
for ($i = 0; $i < $total; $i++)
@@ -502,7 +492,7 @@ public function parse(&$segments)
$db = JFactory::getDbo();
// Count route segments
- $count = !is_null($segments) ? count($segments) : 0;
+ $count = count($segments);
// we have menu item, Check again if its com_digicom
/*
@@ -542,6 +532,7 @@ public function parse(&$segments)
case "register":
case "billing":
case "thankyou":
+ case "manager":
$vars['view'] = $item->query['view'];
return $vars;
@@ -736,17 +727,7 @@ public function parse(&$segments)
}
$vars['id'] = $cid;
-
-// if ($item->query['view'] == 'archive' && $count != 1)
-// {
-// $vars['year'] = $count >= 2 ? $segments[$count - 2] : null;
-// $vars['month'] = $segments[$count - 1];
-// $vars['view'] = 'archive';
-// }
-// else
-// {
- $vars['view'] = 'product';
- //}
+ $vars['view'] = 'product';
}
$found = 0;
diff --git a/src/com_digicom/site/templates/default/.gitignore b/src/com_digicom/site/templates/default/.gitignore
deleted file mode 100644
index 75ce18e9..00000000
--- a/src/com_digicom/site/templates/default/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-/bower_components
-/node_modules
diff --git a/src/com_digicom/site/templates/default/attribs.xml b/src/com_digicom/site/templates/default/attribs.sample.xml
similarity index 100%
rename from src/com_digicom/site/templates/default/attribs.xml
rename to src/com_digicom/site/templates/default/attribs.sample.xml
diff --git a/src/com_digicom/site/templates/default/downloads.php b/src/com_digicom/site/templates/default/downloads.php
index 8c6968d2..6fbac4b6 100644
--- a/src/com_digicom/site/templates/default/downloads.php
+++ b/src/com_digicom/site/templates/default/downloads.php
@@ -33,7 +33,7 @@
params;
- $pagination = $configs->get('download_pagination', 0);
+ $pagination = $configs->get('download_page', 0);
$this->itemList = $items;
diff --git a/src/com_digicom/site/templates/default/manager.php b/src/com_digicom/site/templates/default/manager.php
new file mode 100644
index 00000000..2791a39f
--- /dev/null
+++ b/src/com_digicom/site/templates/default/manager.php
@@ -0,0 +1,240 @@
+input;
+$configs = $this->configs;
+
+$n = !is_null($this->orders) ? count($this->orders) : 0;
+$k = 0;
+
+JFactory::getDocument()->addScriptDeclaration('
+ Joomla.submitbutton = function(task)
+ {
+ if (task == "orders.cycleStatus")
+ {
+ var c = confirm("You are going to change Order status, Are you sure you want to proceed?");
+ if(c) {Joomla.submitform(task);}
+ else {jQuery("#manager-order-list").removeClass("hide");jQuery("#manager-order-list").addClass("hide");}
+ }
+ };
+');
+
+?>
+
+
+
+
+
+
+
+ trigger('onDigicomManagerAfterTitle',array('com_digicom.manager')); ?>
+
+
+
+
+ trigger('onDigicomManagerAfterList',array('com_digicom.manager')); ?>
+
+
+
+
+
+
+
diff --git a/src/com_digicom/site/templates/default/order.php b/src/com_digicom/site/templates/default/order.php
index 27b5002f..f9461c1e 100644
--- a/src/com_digicom/site/templates/default/order.php
+++ b/src/com_digicom/site/templates/default/order.php
@@ -171,6 +171,14 @@
+ authorise('core.manage', 'com_digicom'))
+ {
+ // Load item template
+ echo $this->loadTemplate('logs');
+ }
+ ?>
+
diff --git a/src/com_digicom/site/templates/default/order_logs.php b/src/com_digicom/site/templates/default/order_logs.php
new file mode 100644
index 00000000..1e46839c
--- /dev/null
+++ b/src/com_digicom/site/templates/default/order_logs.php
@@ -0,0 +1,63 @@
+
+
+
Logs
+
+
+
+
+
+ |
+
+
+ |
+
+
+ |
+
+
+ |
+
+
+ |
+
+
+ |
+
+
+
+ order->logs as $key=>$log): ?>
+
+
+ id;?>
+ |
+
+ type;?>
+ |
+
+ message;?>
+ |
+
+ status;?>
+ |
+
+ created;?>
+ |
+
+ ip;?>
+ |
+
+
+
+
+
+
diff --git a/src/com_digicom/site/views/category/view.html.php b/src/com_digicom/site/views/category/view.html.php
index 88a35bf2..cefba654 100644
--- a/src/com_digicom/site/views/category/view.html.php
+++ b/src/com_digicom/site/views/category/view.html.php
@@ -99,7 +99,8 @@ public function display($tpl = null)
$this->category->event->afterDisplayContent = trim(implode("\n", $results));
// Compute the product slugs and prepare introtext (runs content plugins).
- if(count($this->items))
+ $total = !is_null($this->items) ? count($this->items) : 0;
+ if($total)
{
foreach ($this->items as $item)
{
@@ -369,7 +370,7 @@ public function commonCategoryDisplay()
$children = array($category->id => $children);
// Escape strings for HTML output
- $this->pageclass_sfx = htmlspecialchars($params->get('pageclass_sfx'));
+ $this->pageclass_sfx = htmlspecialchars((string)$params->get('pageclass_sfx'));
$maxLevel = $params->get('maxLevel', -1);
$this->maxLevel = &$maxLevel;
diff --git a/src/com_digicom/site/views/checkout/view.html.php b/src/com_digicom/site/views/checkout/view.html.php
index d81cf267..2c6c489c 100644
--- a/src/com_digicom/site/views/checkout/view.html.php
+++ b/src/com_digicom/site/views/checkout/view.html.php
@@ -50,8 +50,20 @@ function display($tpl = null)
if(!isset($order->id) or $order->id <= 0){
$app->redirect(JRoute::_('index.php?option=com_digicom&view=cart'));
}
+ if(empty($order->params))
+ {
+ $orderItems = $this->get('OrderItems');
+ // print_r($orderItems);die;
+ $params = new stdClass;
+ $params->order_id = $order->id;
+ $params->order_amount = $order->amount;
+ $params->products = $orderItems;
+ }
+ else
+ {
+ $params = json_decode($order->params);//print_r($params);die;
+ }
- $params = json_decode($order->params);//print_r($params);die;
$items = $params->products;//print_r($items);die;
$vars = new stdClass();
diff --git a/src/com_digicom/site/views/manager/index.html b/src/com_digicom/site/views/manager/index.html
new file mode 100644
index 00000000..fa6d84e8
--- /dev/null
+++ b/src/com_digicom/site/views/manager/index.html
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/src/com_digicom/site/views/manager/metadata.xml b/src/com_digicom/site/views/manager/metadata.xml
new file mode 100644
index 00000000..68e18fa2
--- /dev/null
+++ b/src/com_digicom/site/views/manager/metadata.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/com_digicom/site/views/manager/tmpl/default.php b/src/com_digicom/site/views/manager/tmpl/default.php
new file mode 100644
index 00000000..9d3f186f
--- /dev/null
+++ b/src/com_digicom/site/views/manager/tmpl/default.php
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
diff --git a/src/com_digicom/site/views/manager/tmpl/index.html b/src/com_digicom/site/views/manager/tmpl/index.html
new file mode 100644
index 00000000..fa6d84e8
--- /dev/null
+++ b/src/com_digicom/site/views/manager/tmpl/index.html
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/src/com_digicom/site/views/manager/view.html.php b/src/com_digicom/site/views/manager/view.html.php
new file mode 100644
index 00000000..ff4e853b
--- /dev/null
+++ b/src/com_digicom/site/views/manager/view.html.php
@@ -0,0 +1,103 @@
+authorise('core.manage', 'com_digicom'))
+ {
+ return JError::raiseWarning(404, JText::_('JERROR_ALERTNOAUTHOR'));
+ }
+
+ $app = JFactory::getApplication();
+ $input = $app->input;
+ $customer = new DigiComSiteHelperSession();
+
+ $this->orders = $this->get('Items');
+
+ $this->pagination = $this->get('pagination');
+ $this->state = $this->get('State');
+ $this->params = $this->state->get('params');
+ $this->configs = JComponentHelper::getComponent('com_digicom')->params;
+
+
+ $template = new DigiComSiteHelperTemplate($this);
+ $template->rander('manager');
+
+ $this->_prepareDocument();
+ parent::display($tpl);
+ }
+
+ /**
+ * Prepares the document.
+ *
+ * @return void.
+ */
+ protected function _prepareDocument()
+ {
+ $app = JFactory::getApplication();
+ $menus = $app->getMenu();
+ $pathway = $app->getPathway();
+ $title = null;
+
+ // Because the application sets a default page title,
+ // we need to get it from the menu item itself
+ $menu = $menus->getActive();
+
+ if ($menu)
+ {
+ $this->params->def('page_heading', $this->params->get('page_title', $menu->title));
+ }
+ else
+ {
+ $this->params->def('page_heading', JText::_('COM_DIGICOM_MANAGER_PAGE_TITLE'));
+ }
+
+ $title = $this->params->get('page_title', '');
+
+ // Check for empty title and add site name if param is set
+ if (empty($title))
+ {
+ $title = $app->get('sitename');
+ }
+ elseif ($app->get('sitename_pagetitles', 0) == 1)
+ {
+ $title = JText::sprintf('JPAGETITLE', $app->get('sitename'), $title);
+ }
+ elseif ($app->get('sitename_pagetitles', 0) == 2)
+ {
+ $title = JText::sprintf('JPAGETITLE', $title, $app->get('sitename'));
+ }
+
+ $this->document->setTitle($title);
+
+ if ($this->params->get('menu-meta_description'))
+ {
+ $this->document->setDescription($this->params->get('menu-meta_description'));
+ }
+
+ if ($this->params->get('menu-meta_keywords'))
+ {
+ $this->document->setMetadata('keywords', $this->params->get('menu-meta_keywords'));
+ }
+
+ if ($this->params->get('robots'))
+ {
+ $this->document->setMetadata('robots', $this->params->get('robots'));
+ }
+
+ }
+}
diff --git a/src/com_digicom/site/views/order/view.html.php b/src/com_digicom/site/views/order/view.html.php
index 5b31c31c..9f2af0c5 100644
--- a/src/com_digicom/site/views/order/view.html.php
+++ b/src/com_digicom/site/views/order/view.html.php
@@ -37,7 +37,10 @@ function display($tpl = null)
}
elseif($this->order->userid != $this->customer->_customer->id)
{
- return JError::raiseError(203, JText::_('COM_DIGICOM_ORDER_NOT_OWN'));
+ if (!JFactory::getUser()->authorise('core.manage', 'com_digicom'))
+ {
+ return JError::raiseError(203, JText::_('COM_DIGICOM_ORDER_NOT_OWN'));
+ }
}
$layout = $input->get('layout','order');
diff --git a/src/com_digicom/site/views/product/view.html.php b/src/com_digicom/site/views/product/view.html.php
index e48fa481..2f2ff392 100644
--- a/src/com_digicom/site/views/product/view.html.php
+++ b/src/com_digicom/site/views/product/view.html.php
@@ -148,7 +148,7 @@ public function display($tpl = null)
}
// Escape strings for HTML output
- $this->pageclass_sfx = htmlspecialchars($this->item->params->get('pageclass_sfx'));
+ $this->pageclass_sfx = htmlspecialchars((string)$this->item->params->get('pageclass_sfx'));
$this->_prepareDocument();
$this->category->params = $this->category->getParams();
diff --git a/src/com_digicom/site/views/thankyou/view.html.php b/src/com_digicom/site/views/thankyou/view.html.php
index 6116ae94..147eba04 100644
--- a/src/com_digicom/site/views/thankyou/view.html.php
+++ b/src/com_digicom/site/views/thankyou/view.html.php
@@ -17,10 +17,16 @@ class DigiComViewThankYou extends JViewLegacy
function display($tpl = null)
{
- $app = JFactory::getApplication();
+ $app = JFactory::getApplication();
$session = JFactory::getSession();
- $digicom_session = $session->get('com_digicom', array());
$this->state = $this->get('State');
+ $digicom_session = $session->get('com_digicom');
+
+ if(!$digicom_session && $app->input->get('order_id')){
+ $session->set('com_digicom', array('action' => 'payment_complete', 'id' => $app->input->get('order_id')));
+ $digicom_session = $session->get('com_digicom');
+ }
+
if(isset($digicom_session['action']) && $digicom_session['action'] == 'payment_complete' && $digicom_session['id'])
{
diff --git a/src/mod_digicom_menu/language/en-GB/en-GB.mod_digicom_menu.ini b/src/mod_digicom_menu/language/en-GB/en-GB.mod_digicom_menu.ini
index 566c7d2e..321d55bb 100644
--- a/src/mod_digicom_menu/language/en-GB/en-GB.mod_digicom_menu.ini
+++ b/src/mod_digicom_menu/language/en-GB/en-GB.mod_digicom_menu.ini
@@ -3,6 +3,7 @@
; License http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL, see LICENSE.php
; Note : All ini files need to be saved as UTF-8 - No BOM
+COM_DIGICOM = "Digicom"
MOD_DIGICOM_MENU="Administrator DigiCom Menu"
MOD_DIGICOM_MENU_FIELD_SHOW_DIGICOM_MENU_LABEL="Show DigiCom Menu"
MOD_DIGICOM_MENU_FIELD_SHOW_DIGICOM_MENU_DESC="Show or hide the DigiCom Menu on top while in editing sections"
diff --git a/src/mod_digicom_menu/language/en-GB/en-GB.mod_digicom_menu.sys.ini b/src/mod_digicom_menu/language/en-GB/en-GB.mod_digicom_menu.sys.ini
index edb6815e..18f8bf84 100644
--- a/src/mod_digicom_menu/language/en-GB/en-GB.mod_digicom_menu.sys.ini
+++ b/src/mod_digicom_menu/language/en-GB/en-GB.mod_digicom_menu.sys.ini
@@ -3,5 +3,6 @@
; License http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL, see LICENSE.php
; Note : All ini files need to be saved as UTF-8 - No BOM
+COM_DIGICOM = "Digicom"
MOD_DIGICOM_MENU="Administrator DigiCom Menu"
MOD_DIGICOM_MENU_XML_DESCRIPTION="DigiCom Administrator Menu Module"