first commit

This commit is contained in:
2025-01-06 20:47:25 +01:00
commit 3bdbd78c2f
25591 changed files with 3586440 additions and 0 deletions

View File

@@ -0,0 +1,35 @@
<?php
/*
* 2007-2011 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2011 PrestaShop SA
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache');
header('Location: ../');
exit;

View File

@@ -0,0 +1,185 @@
/**
* NOTICE OF LICENSE
*
* This source file is subject to a trade license awared by
* Garamo Online L.T.D.
*
* Any use, reproduction, modification or distribution
* of this source file without the written consent of
* Garamo Online L.T.D It Is prohibited.
*
* @author ReactionCode <info@reactioncode.com>
* @copyright 2015-2020 Garamo Online L.T.D
* @license Commercial license
*/
(function() {
'use strict';
// Initialize all user events when DOM ready
document.addEventListener('DOMContentLoaded', initRcGaContentOrder, false);
function initRcGaContentOrder() {
var orderDetailNode;
var detailSentNode;
var detailByNode;
var stStatusMessageNode;
var notSendMessageNode;
var sendButtonNode;
var removeButtonNode;
orderDetailNode = document.querySelector('.js-rcga-order-detail');
detailSentNode = document.querySelector('.js-rcga-detail-sent');
detailByNode = document.querySelector('.js-rcga-detail-by');
stStatusMessageNode = document.querySelector('.js-rcga-st-status');
notSendMessageNode = document.querySelector('.js-rcga-not-send');
sendButtonNode = document.querySelector('.js-rcga-send');
removeButtonNode = document.querySelector('.js-rcga-remove');
// bind action on node to handle it on event method
sendButtonNode.action = 'forceTransaction';
// bind event listener to button node
sendButtonNode.addEventListener('click', rcAjaxAction, false);
removeButtonNode.action = 'deleteFromControlTable';
removeButtonNode.addEventListener('click', rcAjaxAction, false);
// handle display depending actual status
if (rcTrackingReport) {
orderDetailNode.classList.remove('hidden');
detailSentNode.innerText = rcTrackingReport.sent_at;
detailByNode.innerText = rcTrackingStatuses[rcTrackingReport.sent_from];
removeButtonNode.classList.remove('hidden');
if (rcTrackingReport.sent_from === 'st') {
stStatusMessageNode.classList.remove('hidden');
}
} else {
notSendMessageNode.classList.remove('hidden');
sendButtonNode.classList.remove('hidden');
}
}
function rcAjaxAction(event) {
var req = new XMLHttpRequest();
var url = rcGaModuleUrl + 'rc_pganalytics-ajax.php';
var action = event.target.action;
var data = {
'action': action,
'id_order': rcOrderId,
'id_shop': rcOrderIdShop
};
var formData;
formData = new FormData();
formData.append('data', JSON.stringify(data));
formData.append('token', rcGaToken);
animateIcon('refresh');
req.open('POST', url, true);
req.onreadystatechange = function () {
var response;
var type;
if (req.readyState === 4 && req.status === 200) {
type = req.getResponseHeader('Content-Type');
if (type === 'application/json') {
response = JSON.parse(req.responseText);
if (typeof response === 'object') {
if (action === 'deleteFromControlTable') {
afterDeleteInControlTable(response);
} else if (action === 'forceTransaction') {
afterForceTransaction(response);
}
}
}
}
};
req.send(formData);
}
function animateIcon(action) {
var iconNode;
iconNode = document.querySelector('.js-rcga-icon i');
if (action === 'refresh') {
iconNode.className = 'icon-refresh icon-spin';
} else if (action === 'ok') {
iconNode.className = 'icon-check-circle';
} else if (action === 'ko') {
iconNode.className = 'icon-times-circle';
}
}
function afterDeleteInControlTable(response) {
var orderDetailNode;
var detailSentNode;
var detailByNode;
var stStatusMessageNode;
var notSendMessageNode;
var sendButtonNode;
var removeButtonNode;
if (response && response.result) {
// get all nodes
orderDetailNode = document.querySelector('.js-rcga-order-detail');
detailSentNode = document.querySelector('.js-rcga-detail-sent');
detailByNode = document.querySelector('.js-rcga-detail-by');
stStatusMessageNode = document.querySelector('.js-rcga-st-status');
notSendMessageNode = document.querySelector('.js-rcga-not-send');
sendButtonNode = document.querySelector('.js-rcga-send');
removeButtonNode = document.querySelector('.js-rcga-remove');
// wipe old data from detail
detailSentNode.innerText = '';
detailByNode.innerText = '';
// hidden all other nodes
orderDetailNode.classList.add('hidden');
stStatusMessageNode.classList.add('hidden');
removeButtonNode.classList.add('hidden');
// display required nodes
notSendMessageNode.classList.remove('hidden');
sendButtonNode.classList.remove('hidden');
animateIcon('ko');
}
}
function afterForceTransaction(response) {
var orderDetailNode;
var detailSentNode;
var detailByNode;
var stStatusMessageNode;
var notSendMessageNode;
var sendButtonNode;
var removeButtonNode;
if (response) {
// get all nodes
orderDetailNode = document.querySelector('.js-rcga-order-detail');
detailSentNode = document.querySelector('.js-rcga-detail-sent');
detailByNode = document.querySelector('.js-rcga-detail-by');
stStatusMessageNode = document.querySelector('.js-rcga-st-status');
notSendMessageNode = document.querySelector('.js-rcga-not-send');
sendButtonNode = document.querySelector('.js-rcga-send');
removeButtonNode = document.querySelector('.js-rcga-remove');
// wipe old data from detail
detailSentNode.innerText = response.sent_at;
detailByNode.innerText = rcTrackingStatuses[response.sent_from];
// hidden all other nodes
notSendMessageNode.classList.add('hidden');
sendButtonNode.classList.add('hidden');
stStatusMessageNode.classList.add('hidden');
// display required nodes
orderDetailNode.classList.remove('hidden');
removeButtonNode.classList.remove('hidden');
animateIcon('ok');
}
}
})();

View File

@@ -0,0 +1,35 @@
<?php
/*
* 2007-2011 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2011 PrestaShop SA
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache');
header('Location: ../');
exit;