first commit
This commit is contained in:
11
modules/x13import/views/index.php
Normal file
11
modules/x13import/views/index.php
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
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;
|
||||
11
modules/x13import/views/js/index.php
Normal file
11
modules/x13import/views/js/index.php
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
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;
|
||||
232
modules/x13import/views/js/x13import.js
Normal file
232
modules/x13import/views/js/x13import.js
Normal file
@@ -0,0 +1,232 @@
|
||||
var x13Import = (function ($, module) {
|
||||
|
||||
$(function() {
|
||||
$(document).on('keyup x-cast', '.x-cast', function() {
|
||||
$(this).val(module.castNumber($(this).val()));
|
||||
});
|
||||
|
||||
$(document).on('focusout x-cast', '.x-cast', function() {
|
||||
var value = $(this).val();
|
||||
|
||||
if (!value.length) {
|
||||
value = 0;
|
||||
}
|
||||
|
||||
if ($(this).hasClass('x-cast-float')) {
|
||||
value = module.castFloat(value);
|
||||
} else {
|
||||
value = module.castInt(value);
|
||||
}
|
||||
|
||||
if ($(this).hasClass('x-cast-blank') && (value === 0 || value === '0.00')) {
|
||||
value = '';
|
||||
}
|
||||
|
||||
$(this).val(value);
|
||||
});
|
||||
|
||||
$('.x-cast').trigger('x-cast');
|
||||
});
|
||||
|
||||
module.getWholesalers = function (callback) {
|
||||
var ajaxData = {
|
||||
action: 'getWholesalers'
|
||||
};
|
||||
|
||||
x13Import.ajax(
|
||||
ajaxData,
|
||||
null,
|
||||
function(json) {
|
||||
json.wholesalers.forEach(function(value) {
|
||||
x13Import.progressBlock.wholesaler(value);
|
||||
});
|
||||
|
||||
callback(json.wholesalers);
|
||||
},
|
||||
function() {
|
||||
callback([]);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
module.disableButton = function(button) {
|
||||
button.addClass('disabled').attr('disabled', 'disabled');
|
||||
button.find('i').attr('data-class', button.find('i').attr('class')).attr('class', 'process-icon-loading');
|
||||
}
|
||||
|
||||
module.enableButton = function(button) {
|
||||
button.removeClass('disabled').removeAttr('disabled');
|
||||
button.find('i').attr('class', button.find('i').attr('data-class')).removeAttr('data-class');
|
||||
}
|
||||
|
||||
module.castNumber = function(value) {
|
||||
return value.replace(/[^0-9,.\-]/g, '').replace(',', '.');
|
||||
}
|
||||
|
||||
module.castInt = function(value) {
|
||||
return parseInt(value);
|
||||
}
|
||||
|
||||
module.castFloat = function(value) {
|
||||
value = parseFloat(value).toFixed(10);
|
||||
|
||||
var pow = Math.pow(10, 2);
|
||||
value *= pow;
|
||||
|
||||
var nextDigit = Math.floor(value * 10) - 10 * Math.floor(value);
|
||||
value = (nextDigit >= 5 ? Math.ceil(value) : Math.floor(value));
|
||||
|
||||
return (value / pow).toFixed(2);
|
||||
}
|
||||
|
||||
module.redirect = function(controller, params) {
|
||||
var ajaxData = {
|
||||
action: 'getRedirectLink',
|
||||
linkController: controller,
|
||||
linkParams: params
|
||||
};
|
||||
|
||||
this.ajax(
|
||||
ajaxData,
|
||||
null,
|
||||
function(json) {
|
||||
if (json.redirectLink) {
|
||||
setTimeout(function() {
|
||||
location.replace(json.redirectLink);
|
||||
}, 1000);
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
module.ajax = function(data, beforeSend, success, error) {
|
||||
var defaultData = {
|
||||
token: x13importToken,
|
||||
ajax: true
|
||||
};
|
||||
|
||||
$.ajax({
|
||||
url: currentIndex,
|
||||
method: 'POST',
|
||||
async: true,
|
||||
dataType: 'json',
|
||||
data: $.extend(defaultData, data),
|
||||
beforeSend: beforeSend,
|
||||
success: function(json) {
|
||||
if (success) {
|
||||
success(json);
|
||||
}
|
||||
},
|
||||
error: error
|
||||
});
|
||||
}
|
||||
|
||||
return module;
|
||||
|
||||
}(jQuery, x13Import || {}));
|
||||
|
||||
x13Import.progressBlock = (function ($) {
|
||||
|
||||
var progressBlockElement,
|
||||
progressBlockPattern;
|
||||
|
||||
$(function() {
|
||||
progressBlockElement = $('#ximport_progress_block');
|
||||
progressBlockPattern = $('#_pattern_ximport_progress_block');
|
||||
|
||||
progressBlockElement.find('.x-close a').on('click', function (e) {
|
||||
e.preventDefault();
|
||||
progressBlockElement.slideUp('slow');
|
||||
});
|
||||
});
|
||||
|
||||
var progressBlock = {};
|
||||
progressBlock.wholesalerActionProcess = 'badge';
|
||||
progressBlock.wholesalerActionSuccess = 'badge badge-success';
|
||||
progressBlock.wholesalerActionError = 'badge badge-danger';
|
||||
|
||||
progressBlock.init = function (header, description)
|
||||
{
|
||||
progressBlockElement.find('.x-header').text(header);
|
||||
progressBlockElement.find('.x-description').text((description ? description : ''));
|
||||
progressBlockElement.find('.x-bar').hide();
|
||||
progressBlockElement.find('.x-bar-visual > div').css('width', 0);
|
||||
progressBlockElement.find('.x-form').empty();
|
||||
progressBlockElement.find('.x-content').html(progressBlockPattern.find('#_pattern_content').html());
|
||||
progressBlockElement.find('.x-close').hide();
|
||||
progressBlockElement.slideDown('slow');
|
||||
}
|
||||
|
||||
progressBlock.description = function (description) {
|
||||
if (description === undefined) {
|
||||
progressBlockElement.find('.x-description').hide();
|
||||
} else {
|
||||
progressBlockElement.find('.x-description').text(description).show();
|
||||
}
|
||||
}
|
||||
|
||||
progressBlock.bar = function (value) {
|
||||
if (value === undefined) {
|
||||
progressBlockElement.find('.x-bar').hide();
|
||||
} else {
|
||||
progressBlockElement.find('.x-bar').show();
|
||||
progressBlockElement.find('.x-bar-visual > div').css('width', value + '%');
|
||||
}
|
||||
}
|
||||
|
||||
progressBlock.messageBefore = function (message) {
|
||||
if (message === undefined) {
|
||||
progressBlockElement.find('.x-message-before').hide();
|
||||
} else {
|
||||
progressBlockElement.find('.x-message-before').text(message).show();
|
||||
}
|
||||
}
|
||||
|
||||
progressBlock.messageAfter = function (message) {
|
||||
if (message === undefined) {
|
||||
progressBlockElement.find('.x-message-after').hide();
|
||||
} else {
|
||||
progressBlockElement.find('.x-message-after').text(message).show();
|
||||
}
|
||||
}
|
||||
|
||||
progressBlock.form = function (html) {
|
||||
if (html === undefined) {
|
||||
progressBlockElement.find('.x-form').hide();
|
||||
} else {
|
||||
progressBlockElement.find('.x-form').html(html).show();
|
||||
}
|
||||
}
|
||||
|
||||
progressBlock.refreshButton = function (message) {
|
||||
if (message === undefined) {
|
||||
progressBlockElement.find('.x-refresh-button').hide();
|
||||
} else {
|
||||
progressBlockElement.find('.x-refresh-button').show().find('a').append(' ' + message);
|
||||
}
|
||||
}
|
||||
|
||||
progressBlock.wholesaler = function (wholesalerName) {
|
||||
var block = progressBlockPattern.find('#_pattern_list_wholesalers > li').clone();
|
||||
|
||||
$('.x-list-wholesaler', block).text(wholesalerName);
|
||||
block.attr('id', 'wholesaler' + wholesalerName);
|
||||
block.appendTo(progressBlockElement.find('.x-list'));
|
||||
}
|
||||
|
||||
progressBlock.wholesalerAction = function (wholesalerName, action, message) {
|
||||
var wholesalerElement = progressBlockElement.find('.x-list #wholesaler' + wholesalerName).find('.x-list-wholesaler-action');
|
||||
wholesalerElement.addClass(action);
|
||||
|
||||
if (message !== undefined) {
|
||||
wholesalerElement.text(message);
|
||||
}
|
||||
}
|
||||
|
||||
progressBlock.close = function () {
|
||||
progressBlockElement.find('.x-close').show();
|
||||
}
|
||||
|
||||
return progressBlock;
|
||||
|
||||
}(jQuery));
|
||||
281
modules/x13import/views/js/x13importCategories.js
Normal file
281
modules/x13import/views/js/x13importCategories.js
Normal file
@@ -0,0 +1,281 @@
|
||||
(function ($, x13Import) {
|
||||
|
||||
var IMPORT_LIMIT = 10;
|
||||
|
||||
$(function () {
|
||||
var buttonCategoriesDownload = $('.x-categories-download').parent();
|
||||
var buttonCategoriesImport = $('.x-categories-import').parent();
|
||||
|
||||
$(buttonCategoriesDownload).on('click', function(e) {
|
||||
if ($(this).attr('disabled')) {
|
||||
return false;
|
||||
}
|
||||
|
||||
e.preventDefault();
|
||||
x13Import.disableButton($(this));
|
||||
window.scrollTo(0, 0);
|
||||
|
||||
x13Import.progressBlock.init('Pobieranie kategorii z hurtowni');
|
||||
|
||||
var self = $(this);
|
||||
x13Import.getWholesalers(function(wholesalers) {
|
||||
var requestStatus = true;
|
||||
var requestLoop = function(index) {
|
||||
if (index in wholesalers) {
|
||||
categoriesDownload(wholesalers[index], function(status) {
|
||||
requestStatus &= status;
|
||||
requestLoop(++index);
|
||||
});
|
||||
} else {
|
||||
x13Import.enableButton(self);
|
||||
if (requestStatus) {
|
||||
x13Import.redirect(help_class_name, 'categoriesDownloadSuccess');
|
||||
} else {
|
||||
x13Import.progressBlock.messageBefore('W jednej z hurtowni wystąpił błąd podczas pobierania kategorii');
|
||||
x13Import.progressBlock.refreshButton('Przeładuj stronę');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (wholesalers.length) {
|
||||
requestLoop(0);
|
||||
} else {
|
||||
x13Import.progressBlock.description('Brak hurtowni');
|
||||
x13Import.enableButton(self);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$(buttonCategoriesImport).on('click', function(e) {
|
||||
if ($(this).attr('disabled')) {
|
||||
return false;
|
||||
}
|
||||
|
||||
e.preventDefault();
|
||||
window.scrollTo(0, 0);
|
||||
|
||||
x13Import.progressBlock.init('Import kategorii do sklepu', 'Wybierz metodę importu kategorii');
|
||||
categoriesImportForm();
|
||||
|
||||
var self = $(this);
|
||||
$(document).on('click', 'button[name="submitCategoriesImportForm"]', function(e) {
|
||||
e.preventDefault();
|
||||
|
||||
var categoriesInput; // PS 1.5 backward compatibility
|
||||
var categoriesImportMode = parseInt($('input[name="categoriesImportMode"]:checked').val());
|
||||
var categoriesImportDefault = parseInt($('select[name="categoriesImportDefault"]').val());
|
||||
var categoriesOverwrite = $('input[name="categoriesOverwrite"]:checked').length;
|
||||
var categoriesAssigned = [];
|
||||
var categoriesToAssign = [];
|
||||
|
||||
if ($('#categoriesAssigned').length) {
|
||||
categoriesInput = '#categoriesAssigned input:checked';
|
||||
} else {
|
||||
categoriesInput = '#categories-treeview input:checked';
|
||||
}
|
||||
|
||||
$(categoriesInput).each(function() {
|
||||
categoriesAssigned.push(parseInt($(this).val()));
|
||||
});
|
||||
|
||||
$('input[name="ximport_categoryBox[]"]:checked').each(function() {
|
||||
categoriesToAssign.push(parseInt($(this).val()));
|
||||
});
|
||||
|
||||
if (categoriesImportMode !== 1) {
|
||||
if (categoriesAssigned.length === 0) {
|
||||
alert('Wybierz kategorie sklepu do przypisania');
|
||||
}
|
||||
else if (categoriesToAssign.length === 0) {
|
||||
alert('Wybierz kategorie z hurtowni do importu');
|
||||
}
|
||||
else {
|
||||
var requestLoopSelected = function(index) {
|
||||
x13Import.progressBlock.bar(Math.min(100, (index * 100) / categoriesToAssign.length));
|
||||
|
||||
if (index < categoriesToAssign.length) {
|
||||
categoriesImportSelected(
|
||||
categoriesImportMode,
|
||||
categoriesOverwrite,
|
||||
categoriesAssigned,
|
||||
categoriesToAssign.slice(index, index + IMPORT_LIMIT),
|
||||
categoriesImportDefault,
|
||||
function() {
|
||||
requestLoopSelected(index + IMPORT_LIMIT);
|
||||
}
|
||||
);
|
||||
} else {
|
||||
finishImport();
|
||||
}
|
||||
}
|
||||
|
||||
prepareProgressBlock();
|
||||
requestLoopSelected(0);
|
||||
}
|
||||
} else {
|
||||
prepareProgressBlock();
|
||||
|
||||
categoriesImportCount(function(count) {
|
||||
var requestLoop = function(index) {
|
||||
x13Import.progressBlock.bar(Math.min(100, (index * 100) / count));
|
||||
|
||||
if (index < count) {
|
||||
categoriesImport(IMPORT_LIMIT, function(finish) {
|
||||
if (!finish) {
|
||||
requestLoop(index + IMPORT_LIMIT);
|
||||
} else {
|
||||
finishImport();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
finishImport();
|
||||
}
|
||||
}
|
||||
|
||||
if (count) {
|
||||
requestLoop(0);
|
||||
} else {
|
||||
x13Import.progressBlock.description('Brak kategorii do importu');
|
||||
x13Import.progressBlock.bar();
|
||||
x13Import.enableButton(self);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function prepareProgressBlock() {
|
||||
x13Import.disableButton(self);
|
||||
$('#categories_import_form').hide();
|
||||
x13Import.progressBlock.description();
|
||||
x13Import.progressBlock.bar(0);
|
||||
}
|
||||
|
||||
function finishImport() {
|
||||
categoriesRegenerateTree(function() {
|
||||
x13Import.redirect(help_class_name, 'categoriesImportSuccess');
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
function categoriesDownload(wholesaler, callback) {
|
||||
var ajaxData = {
|
||||
action: 'categoriesDownload',
|
||||
wholesaler: wholesaler
|
||||
};
|
||||
|
||||
x13Import.ajax(
|
||||
ajaxData,
|
||||
function() {
|
||||
x13Import.progressBlock.wholesalerAction(wholesaler, x13Import.progressBlock.wholesalerActionProcess, 'pobieranie kategorii');
|
||||
},
|
||||
function(json) {
|
||||
if (typeof json.status === "undefined" && json.error) {
|
||||
// backport to old wholesalers versions with die(['error'])
|
||||
x13Import.progressBlock.wholesalerAction(wholesaler, x13Import.progressBlock.wholesalerActionError, json.error);
|
||||
} else if (json.status === true) {
|
||||
x13Import.progressBlock.wholesalerAction(wholesaler, x13Import.progressBlock.wholesalerActionSuccess, 'zakończono');
|
||||
} else {
|
||||
x13Import.progressBlock.wholesalerAction(wholesaler, x13Import.progressBlock.wholesalerActionError, json.message);
|
||||
}
|
||||
|
||||
callback(json.status);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
function categoriesImportForm() {
|
||||
var ajaxData = {
|
||||
action: 'categoriesImportForm'
|
||||
};
|
||||
|
||||
x13Import.ajax(
|
||||
ajaxData,
|
||||
null,
|
||||
function(json) {
|
||||
x13Import.progressBlock.form(json.form);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
function categoriesImportCount(callback) {
|
||||
var ajaxData = {
|
||||
action: 'categoriesImportCount'
|
||||
};
|
||||
|
||||
x13Import.ajax(
|
||||
ajaxData,
|
||||
null,
|
||||
function(json) {
|
||||
callback(json.count);
|
||||
},
|
||||
function() {
|
||||
callback(0);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
function categoriesImport(limit, callback) {
|
||||
var ajaxData = {
|
||||
action: 'categoriesImport',
|
||||
limit: limit
|
||||
};
|
||||
|
||||
x13Import.ajax(
|
||||
ajaxData,
|
||||
null,
|
||||
function(json) {
|
||||
if (json.status !== true) {
|
||||
// @todo
|
||||
}
|
||||
|
||||
callback(json.finish);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
function categoriesImportSelected(
|
||||
categoriesImportMode,
|
||||
categoriesOverwrite,
|
||||
categoriesAssigned,
|
||||
categoriesToAssign,
|
||||
categoriesImportDefault,
|
||||
callback
|
||||
) {
|
||||
var ajaxData = {
|
||||
action: 'categoriesImportSelected',
|
||||
categoriesImportMode: categoriesImportMode,
|
||||
categoriesOverwrite: categoriesOverwrite,
|
||||
categoriesAssigned: categoriesAssigned,
|
||||
categoriesToAssign: categoriesToAssign,
|
||||
categoriesImportDefault: categoriesImportDefault
|
||||
};
|
||||
|
||||
x13Import.ajax(
|
||||
ajaxData,
|
||||
null,
|
||||
function(json) {
|
||||
if (json.status !== true) {
|
||||
// @todo
|
||||
}
|
||||
|
||||
callback();
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
function categoriesRegenerateTree(callback) {
|
||||
var ajaxData = {
|
||||
action: 'categoriesRegenerateTree'
|
||||
};
|
||||
|
||||
x13Import.ajax(
|
||||
ajaxData,
|
||||
null,
|
||||
function() {
|
||||
callback();
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
}(jQuery, x13Import || {}));
|
||||
220
modules/x13import/views/js/x13importWholesalers.js
Normal file
220
modules/x13import/views/js/x13importWholesalers.js
Normal file
@@ -0,0 +1,220 @@
|
||||
(function ($, x13Import) {
|
||||
|
||||
var DELETE_LIMIT = 25;
|
||||
|
||||
$(function () {
|
||||
$(document).on('change', 'input[name*="AUTO_META_TITLE"]', function () {
|
||||
if (parseInt($('input[name*="AUTO_META_TITLE"]:checked').val()) === 1) {
|
||||
$('input[name="wholesaler[' + $(this).attr('data-wholesaler') + '][AUTO_META_TITLE_SCHEMA]"]').closest('.form-group').show();
|
||||
} else {
|
||||
$('input[name="wholesaler[' + $(this).attr('data-wholesaler') + '][AUTO_META_TITLE_SCHEMA]"]').closest('.form-group').hide();
|
||||
}
|
||||
});
|
||||
|
||||
$('input[name*="AUTO_META_TITLE"]').trigger('change');
|
||||
|
||||
var buttonProductsDelete = $('.x-products-delete').parent();
|
||||
var buttonProductsOff = $('.x-products-off').parent();
|
||||
|
||||
$(buttonProductsDelete).on('click', function(e) {
|
||||
if ($(this).attr('disabled')) {
|
||||
return false;
|
||||
}
|
||||
|
||||
var wholesalerName = $(this).data('wholesaler');
|
||||
var wholesalerCode = $(this).data('wholesaler-code');
|
||||
var self = $(this);
|
||||
|
||||
if (!confirm('Czy na pewno chcesz usunąć wszystkie produkty' + (wholesalerCode !== undefined ? ' z tej hurtowni' : '') + '?')) {
|
||||
return false;
|
||||
}
|
||||
|
||||
e.preventDefault();
|
||||
x13Import.disableButton($(this));
|
||||
window.scrollTo(0, 0);
|
||||
|
||||
x13Import.progressBlock.init('Usuwanie produktów z hurtowni');
|
||||
|
||||
if (wholesalerCode !== undefined) {
|
||||
countProducts(wholesalerCode, function(count) {
|
||||
var requestLoop = function(index) {
|
||||
x13Import.progressBlock.bar(Math.min(100, (index * 100) / count));
|
||||
|
||||
if (index < count) {
|
||||
productsDelete(wholesalerName, wholesalerCode, DELETE_LIMIT, function(finish) {
|
||||
if (!finish) {
|
||||
requestLoop(index + DELETE_LIMIT);
|
||||
} else {
|
||||
x13Import.enableButton(self);
|
||||
x13Import.progressBlock.wholesalerAction(wholesalerName, x13Import.progressBlock.wholesalerActionSuccess, 'zakończono, usunięte produkty: ' + count);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
x13Import.enableButton(self);
|
||||
x13Import.progressBlock.wholesalerAction(wholesalerName, x13Import.progressBlock.wholesalerActionSuccess, 'zakończono, usunięte produkty: ' + count);
|
||||
}
|
||||
}
|
||||
|
||||
if (count) {
|
||||
x13Import.progressBlock.wholesaler(wholesalerName);
|
||||
requestLoop(0);
|
||||
} else {
|
||||
x13Import.progressBlock.description('Brak produktów do usunięcia');
|
||||
x13Import.progressBlock.bar();
|
||||
x13Import.progressBlock.close();
|
||||
x13Import.enableButton(self);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
countProducts('', function(count) {
|
||||
var requestLoopAll = function(index) {
|
||||
x13Import.progressBlock.bar(Math.min(100, (index * 100) / count));
|
||||
|
||||
if (index < count) {
|
||||
productsDeleteAll(DELETE_LIMIT, function(finish) {
|
||||
if (!finish) {
|
||||
requestLoopAll(index + DELETE_LIMIT);
|
||||
} else {
|
||||
x13Import.enableButton(self);
|
||||
x13Import.progressBlock.close();
|
||||
x13Import.progressBlock.description('Zakończono, usunięte produkty: ' + count);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
x13Import.enableButton(self);
|
||||
x13Import.progressBlock.close();
|
||||
x13Import.progressBlock.description('Zakończono, usunięte produkty: ' + count);
|
||||
}
|
||||
}
|
||||
|
||||
if (count) {
|
||||
requestLoopAll(0);
|
||||
} else {
|
||||
x13Import.progressBlock.description('Brak produktów do usunięcia');
|
||||
x13Import.progressBlock.bar();
|
||||
x13Import.progressBlock.close();
|
||||
x13Import.enableButton(self);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
$(buttonProductsOff).on('click', function(e) {
|
||||
if ($(this).attr('disabled')) {
|
||||
return false;
|
||||
}
|
||||
|
||||
var wholesalerName = $(this).data('wholesaler');
|
||||
var wholesalerCode = $(this).data('wholesaler-code');
|
||||
var self = $(this);
|
||||
|
||||
if (!confirm('Czy na pewno chcesz wyłączyć wszystkie produkty' + (wholesalerCode !== undefined ? ' z tej hurtowni' : '') + '?')) {
|
||||
return false;
|
||||
}
|
||||
|
||||
e.preventDefault();
|
||||
x13Import.disableButton($(this));
|
||||
window.scrollTo(0, 0);
|
||||
|
||||
x13Import.progressBlock.init('Wyłączanie produktów z hurtowni');
|
||||
|
||||
if (wholesalerCode !== undefined) {
|
||||
x13Import.progressBlock.wholesaler(wholesalerName);
|
||||
productsOff(wholesalerName, wholesalerCode, function() {
|
||||
x13Import.progressBlock.close();
|
||||
x13Import.enableButton(self);
|
||||
});
|
||||
} else {
|
||||
productsOffAll(function() {
|
||||
x13Import.progressBlock.close();
|
||||
x13Import.enableButton(self);
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
function countProducts(wholesalerCode, callback) {
|
||||
var ajaxData = {
|
||||
action: 'countProducts',
|
||||
wholesalerCode: wholesalerCode
|
||||
};
|
||||
|
||||
x13Import.ajax(
|
||||
ajaxData,
|
||||
null,
|
||||
function(json) {
|
||||
callback(json.count);
|
||||
},
|
||||
function() {
|
||||
callback(0);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
function productsDelete(wholesalerName, wholesalerCode, limit, callback) {
|
||||
var ajaxData = {
|
||||
action: 'productsDelete',
|
||||
wholesalerCode: wholesalerCode,
|
||||
limit: limit
|
||||
};
|
||||
|
||||
x13Import.ajax(
|
||||
ajaxData,
|
||||
function() {
|
||||
x13Import.progressBlock.wholesalerAction(wholesalerName, x13Import.progressBlock.wholesalerActionProcess, 'usuwanie produktów');
|
||||
},
|
||||
function(json) {
|
||||
callback(json.finish);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
function productsDeleteAll(limit, callback) {
|
||||
var ajaxData = {
|
||||
action: 'productsDelete',
|
||||
limit: limit
|
||||
};
|
||||
|
||||
x13Import.ajax(
|
||||
ajaxData,
|
||||
null,
|
||||
function(json) {
|
||||
callback(json.finish);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
function productsOff(wholesalerName, wholesalerCode, callback) {
|
||||
var ajaxData = {
|
||||
action: 'productsOff',
|
||||
wholesalerCode: wholesalerCode
|
||||
};
|
||||
|
||||
x13Import.ajax(
|
||||
ajaxData,
|
||||
function() {
|
||||
x13Import.progressBlock.wholesalerAction(wholesalerName, x13Import.progressBlock.wholesalerActionProcess, 'wyłącznie produktów');
|
||||
},
|
||||
function(json) {
|
||||
x13Import.progressBlock.wholesalerAction(wholesalerName, x13Import.progressBlock.wholesalerActionSuccess, 'zakończono, wyłączone produkty: ' + json.count);
|
||||
callback();
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
function productsOffAll(callback) {
|
||||
var ajaxData = {
|
||||
action: 'productsOff'
|
||||
};
|
||||
|
||||
x13Import.ajax(
|
||||
ajaxData,
|
||||
null,
|
||||
function(json) {
|
||||
x13Import.progressBlock.description('Zakończono, wyłączone produkty: ' + json.count);
|
||||
callback();
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
}(jQuery, x13Import || {}));
|
||||
225
modules/x13import/views/js/ximport.js
Normal file
225
modules/x13import/views/js/ximport.js
Normal file
@@ -0,0 +1,225 @@
|
||||
(function($) {
|
||||
$.XImport = function() {
|
||||
|
||||
categoriesList = function() {
|
||||
var activeMarkup = false;
|
||||
|
||||
$(document).on('mouseup', function(e) {
|
||||
var markupContainer = $('.markup_container');
|
||||
if (activeMarkup !== false && !activeMarkup.is(e.target) && activeMarkup.has(e.target).length === 0) {
|
||||
updateMarkup();
|
||||
}
|
||||
});
|
||||
|
||||
$('span.markup_edit, span.markup_type_edit').on('click', function() {
|
||||
activeMarkup = $(this).parent();
|
||||
activeMarkup.find('span.markup_edit').hide().next().attr('x-focus', true).show().css('display', 'inline-block').trigger('focus').trigger('x-cast');
|
||||
activeMarkup.find('span.markup_type_edit').hide().next().show().css('display', 'inline-block');
|
||||
});
|
||||
|
||||
function updateMarkup()
|
||||
{
|
||||
var input = activeMarkup.find('input.markup_edit');
|
||||
var select = activeMarkup.find('select.markup_type_edit');
|
||||
|
||||
input.trigger('x-cast');
|
||||
input.removeAttr('x-focus').hide().prev().text(input.val()).show();
|
||||
select.hide().prev().text(select.find('option:selected').text()).show();
|
||||
activeMarkup = false;
|
||||
|
||||
doAdminAjax({
|
||||
controller: help_class_name,
|
||||
action: 'updateMarkup',
|
||||
token: $('input[name=token]').val(),
|
||||
ajax: true,
|
||||
id: input.attr('x-id'),
|
||||
markup: input.val(),
|
||||
markupType: select.val()
|
||||
},
|
||||
function(response) {
|
||||
var data = $.parseJSON(response);
|
||||
showSuccessMessage(data.confirmations);
|
||||
});
|
||||
}
|
||||
|
||||
$('.x-import a').on('click', function() {
|
||||
var self = $(this);
|
||||
|
||||
doAdminAjax(
|
||||
{
|
||||
controller: help_class_name,
|
||||
action: 'updateImport',
|
||||
token: $('input[name=token]').val(),
|
||||
id: $(this).parents('tr').find('input[name="ximport_categoryBox[]"]').val(),
|
||||
ajax: true
|
||||
},
|
||||
function(response)
|
||||
{
|
||||
var data = $.parseJSON(response);
|
||||
showSuccessMessage(data.confirmations);
|
||||
changeStatus(self);
|
||||
}
|
||||
);
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
var bulkMarkup = false;
|
||||
if ($('.bulkMarkup').length > 0) {
|
||||
bulkMarkup = $('.bulkMarkup').parent();
|
||||
}
|
||||
else if ($('[name="submitBulkmarkupximport_category"]').length > 0) {
|
||||
bulkMarkup = $('[name="submitBulkmarkupximport_category"]');
|
||||
}
|
||||
|
||||
var bulkTittlePattern = false;
|
||||
if ($('.bulkTittlePattern').length > 0) {
|
||||
bulkTittlePattern = $('.bulkTittlePattern').parent();
|
||||
}
|
||||
else if ($('[name="submitBulktittlePatternximport_category"]').length > 0) {
|
||||
bulkTittlePattern = $('[name="submitBulktittlePatternximport_category"]');
|
||||
}
|
||||
|
||||
if (bulkMarkup) {
|
||||
bulkMarkup.removeAttr('onclick');
|
||||
bulkMarkup.on('click', function(e) {
|
||||
e.preventDefault();
|
||||
|
||||
if ($('[name="ximport_categoryBox[]"]:checked').length > 0) {
|
||||
$("#bulk_markup_hidden").empty();
|
||||
$('[name="ximport_categoryBox[]"]:checked').each(function() {
|
||||
$("#bulk_markup_hidden").prepend('<input type="hidden" name="ximport_categoryBox[]" value="' + $(this).val() + '">');
|
||||
});
|
||||
|
||||
$.fancybox({
|
||||
content : $("#ximport_bulk_popup_markup").html(),
|
||||
autoResize: true,
|
||||
autoDimensions: true,
|
||||
helpers: {
|
||||
overlay: {
|
||||
locked: false
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
else {
|
||||
alert('Nie wybrano kategorii.');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (bulkTittlePattern) {
|
||||
bulkTittlePattern.removeAttr('onclick');
|
||||
bulkTittlePattern.on('click', function(e) {
|
||||
e.preventDefault();
|
||||
|
||||
if ($('[name="ximport_categoryBox[]"]:checked').length > 0) {
|
||||
$("#bulk_title_pattern_hidden").empty();
|
||||
$('[name="ximport_categoryBox[]"]:checked').each(function() {
|
||||
$("#bulk_title_pattern_hidden").prepend('<input type="hidden" name="ximport_categoryBox[]" value="' + $(this).val() + '">');
|
||||
});
|
||||
|
||||
$.fancybox({
|
||||
content : $("#ximport_bulk_popup_title_pattern").html(),
|
||||
autoResize: true,
|
||||
autoDimensions: true,
|
||||
helpers: {
|
||||
overlay: {
|
||||
locked: false
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
else {
|
||||
alert('Nie wybrano kategorii.');
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
excludeList = function() {
|
||||
$('.x-exclude a').on('click', function() {
|
||||
var self = $(this);
|
||||
|
||||
doAdminAjax(
|
||||
{
|
||||
controller: help_class_name,
|
||||
action: 'excludeProducts',
|
||||
token: $('input[name=token]').val(),
|
||||
id: $(this).parents('tr').find('input[name="ximport_productBox[]"]').val(),
|
||||
ajax: true
|
||||
},
|
||||
function(response)
|
||||
{
|
||||
var data = $.parseJSON(response);
|
||||
showSuccessMessage(data.confirmations);
|
||||
changeStatus(self);
|
||||
}
|
||||
);
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
$('.x-exclude-price a').on('click', function() {
|
||||
var self = $(this);
|
||||
|
||||
doAdminAjax(
|
||||
{
|
||||
controller: help_class_name,
|
||||
action: 'excludeProductsPrices',
|
||||
token: $('input[name=token]').val(),
|
||||
id: $(this).parents('tr').find('input[name="ximport_productBox[]"]').val(),
|
||||
ajax: true
|
||||
},
|
||||
function(response)
|
||||
{
|
||||
var data = $.parseJSON(response);
|
||||
showSuccessMessage(data.confirmations);
|
||||
changeStatus(self);
|
||||
}
|
||||
);
|
||||
|
||||
return false;
|
||||
});
|
||||
};
|
||||
|
||||
changeStatus = function (object) {
|
||||
//Prestashop 1.5
|
||||
if (object.find('img').length) {
|
||||
var status = object.find('img').attr('src').split('/');
|
||||
if (status[3] === 'enabled.gif') {
|
||||
object.attr('title', 'Wyłączone')
|
||||
.children('img')
|
||||
.attr('src', '../img/admin/disabled.gif')
|
||||
.attr('title', 'Wyłączone')
|
||||
.blur();
|
||||
}
|
||||
else {
|
||||
object.attr('title', 'Włączone')
|
||||
.children('img')
|
||||
.attr('src', '../img/admin/enabled.gif')
|
||||
.attr('title', 'Włączone')
|
||||
.blur();
|
||||
}
|
||||
}
|
||||
// bootstrap
|
||||
else {
|
||||
if (object.hasClass('action-disabled')) {
|
||||
object.removeClass('action-disabled')
|
||||
.addClass('action-enabled')
|
||||
.children('.icon-check').removeClass('hidden')
|
||||
.siblings('.icon-remove').addClass('hidden');
|
||||
}
|
||||
else if (object.hasClass('action-enabled')) {
|
||||
object.removeClass('action-enabled')
|
||||
.addClass('action-disabled')
|
||||
.children('.icon-remove').removeClass('hidden')
|
||||
.siblings('.icon-check').addClass('hidden');
|
||||
}
|
||||
object.blur();
|
||||
}
|
||||
};
|
||||
|
||||
return self;
|
||||
}
|
||||
})(jQuery);
|
||||
77
modules/x13import/views/templates/admin/progress_block.tpl
Normal file
77
modules/x13import/views/templates/admin/progress_block.tpl
Normal file
@@ -0,0 +1,77 @@
|
||||
<style>
|
||||
#ximport_progress_block {
|
||||
display: none;
|
||||
padding: 5px 15px 10px;
|
||||
margin-bottom: 30px;
|
||||
border-radius: 3px;
|
||||
border-left: 3px solid #2794AB;
|
||||
background: #DCF4F9;
|
||||
}
|
||||
|
||||
#ximport_progress_block h2 {
|
||||
margin: 10px 0;
|
||||
}
|
||||
|
||||
#ximport_progress_block .x-list {
|
||||
margin: 10px 0;
|
||||
}
|
||||
|
||||
#ximport_progress_block .x-bar {
|
||||
display: none;
|
||||
margin: 10px 0;
|
||||
}
|
||||
#ximport_progress_block .x-bar .x-bar-visual {
|
||||
height: 20px;
|
||||
background: #FFF;
|
||||
border-bottom: 1px solid #2794AB;
|
||||
}
|
||||
#ximport_progress_block .x-bar .x-bar-visual > div {
|
||||
width: 0;
|
||||
height: 100%;
|
||||
background: #2794AB;
|
||||
}
|
||||
|
||||
#ximport_progress_block .x-list .x-list-element {
|
||||
margin-bottom: 2px;
|
||||
}
|
||||
#ximport_progress_block .x-list .x-list-element .x-list-wholesaler {
|
||||
font-size: 13px;
|
||||
font-weight: bold;
|
||||
}
|
||||
#ximport_progress_block .x-list .x-list-element .x-list-wholesaler-action {
|
||||
font-size: 12px;
|
||||
font-style: italic;
|
||||
}
|
||||
#ximport_progress_block .x-list .x-list-element .x-list-wholesaler-action.badge {
|
||||
padding: 1px 8px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div id="ximport_progress_block">
|
||||
<h2 class="x-header"></h2>
|
||||
<h4 class="x-description"></h4>
|
||||
|
||||
<div class="x-bar">
|
||||
<div class="x-bar-visual"><div></div></div>
|
||||
</div>
|
||||
|
||||
<div class="x-form"></div>
|
||||
<div class="x-content"></div>
|
||||
<div class="x-close"><a href="#" class="btn btn-default">{l s='Zamknij' mod='x13import'}</a></div>
|
||||
</div>
|
||||
<div id="_pattern_ximport_progress_block" style="display: none;">
|
||||
<ul id="_pattern_list_wholesalers">
|
||||
<li class="x-list-element">
|
||||
<span class="x-list-wholesaler"></span>:
|
||||
<span class="x-list-wholesaler-action">{l s='oczekiwanie' mod='x13import'}...</span>
|
||||
</li>
|
||||
</ul>
|
||||
<div id="_pattern_content">
|
||||
<p class="x-message-before"></p>
|
||||
<ul class="x-list"></ul>
|
||||
<p class="x-message-after"></p>
|
||||
<p class="x-refresh-button" style="display: none;">
|
||||
<a href="{$currentIndex}&token={$token}" class="btn btn-warning"><i class="icon-refresh"></i></a>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,101 @@
|
||||
<form id="categories_import_form" action="#" method="post">
|
||||
<div class="form-group{if version_compare($smarty.const._PS_VERSION_, '1.6.0.0', '<')} clearfix{/if}">
|
||||
<div class="radio">
|
||||
<label for="categoriesImportMode_1">
|
||||
<input type="radio" name="categoriesImportMode" value="1" id="categoriesImportMode_1" checked="checked">
|
||||
{l s='Importuj kategorie hurtowni do kategorii głównej sklepu [1](domyślnie)[/1]' tags=['<strong>'] mod='x13import'}
|
||||
</label>
|
||||
</div>
|
||||
<div class="radio">
|
||||
<label for="categoriesImportMode_2">
|
||||
<input type="radio" name="categoriesImportMode" value="2" id="categoriesImportMode_2">
|
||||
{l s='Importuj kategorie hurtowni do wybranej kategorii' mod='x13import'}
|
||||
</label>
|
||||
</div>
|
||||
<div class="radio">
|
||||
<label for="categoriesImportMode_3">
|
||||
<input type="radio" name="categoriesImportMode" value="3" id="categoriesImportMode_3">
|
||||
{l s='Importuj najgłębszą kategorie hurtowni do wybranej kategorii' mod='x13import'}
|
||||
</label>
|
||||
</div>
|
||||
{if version_compare($smarty.const._PS_VERSION_, '1.6.0.0', '>')}
|
||||
<div class="radio">
|
||||
<label for="categoriesImportMode_4">
|
||||
<input type="radio" name="categoriesImportMode" value="4" id="categoriesImportMode_4">
|
||||
{l s='Przypisz najgłębszą kategorie hurtowni do wybranej kategorii' mod='x13import'}
|
||||
</label>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
<div class="form-group{if version_compare($smarty.const._PS_VERSION_, '1.6.0.0', '<')} clearfix{/if}">
|
||||
<div id="categoriesImportMode_tree" style="display: none;">
|
||||
{$categoryTree}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group{if version_compare($smarty.const._PS_VERSION_, '1.6.0.0', '<')} clearfix{/if}" style="display: none;">
|
||||
<label for="categoriesImportDefault" class="control-label">Kategoria główna:</label>
|
||||
<select name="categoriesImportDefault" class="fixed-width-xxl" id="categoriesImportDefault"></select>
|
||||
</div>
|
||||
|
||||
<div class="form-group{if version_compare($smarty.const._PS_VERSION_, '1.6.0.0', '<')} clearfix{/if}" style="display: none;">
|
||||
<div class="checkbox">
|
||||
<label for="categoriesOverwrite">
|
||||
<input type="checkbox" name="categoriesOverwrite" value="1" id="categoriesOverwrite">
|
||||
{l s='Nadpisz już przypisane kategorie' mod='x13import'}
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<button type="submit" name="submitCategoriesImportForm" class="btn btn-default">
|
||||
<i class="icon-download"></i> Importuj kategorie do sklepu
|
||||
</button>
|
||||
</form>
|
||||
|
||||
<script>
|
||||
$(document).on('change', 'input[name="categoriesImportMode"]', function () {
|
||||
var importMode = parseInt($(this).val());
|
||||
|
||||
if (importMode === 1) {
|
||||
$('#categoriesImportMode_tree').hide();
|
||||
$('input[name="categoriesOverwrite"]').closest('.form-group').hide();
|
||||
|
||||
} else {
|
||||
$('#categoriesImportMode_tree').show();
|
||||
$('input[name="categoriesOverwrite"]').closest('.form-group').show();
|
||||
}
|
||||
|
||||
if (importMode === 4) {
|
||||
$('select[name="categoriesImportDefault"]').closest('.form-group').show();
|
||||
$('#categoriesAssigned input').removeAttr('checked').attr('type', 'checkbox').attr('name', 'categoriesAssigned[]');
|
||||
removeSelectedCategories();
|
||||
} else {
|
||||
$('select[name="categoriesImportDefault"]').closest('.form-group').hide();
|
||||
$('#categoriesAssigned input').removeAttr('checked').attr('type', 'radio').attr('name', 'categoriesAssigned');
|
||||
removeSelectedCategories();
|
||||
}
|
||||
});
|
||||
|
||||
$(document).on('change', '#categoriesAssigned input', function () {
|
||||
changeCategoriesDefault();
|
||||
});
|
||||
|
||||
function removeSelectedCategories() {
|
||||
$('.tree-folder-name').removeClass('tree-selected');
|
||||
$('.tree-item-name').removeClass('tree-selected');
|
||||
changeCategoriesDefault();
|
||||
}
|
||||
|
||||
function changeCategoriesDefault() {
|
||||
var defaultCategorySelect = $('#categoriesImportDefault');
|
||||
defaultCategorySelect.empty();
|
||||
|
||||
$('#categoriesAssigned input:checked').each(function() {
|
||||
defaultCategorySelect.append(
|
||||
'<option ' + (($(this).attr('value') == defaultCategorySelect.val()) ? 'selected="selected"' : '') +
|
||||
' value="' + $(this).attr('value') + '">' + $(this).siblings('label').text() +
|
||||
'</option>');
|
||||
});
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,39 @@
|
||||
{extends file="helpers/form/form.tpl"}
|
||||
|
||||
{block name="script"}
|
||||
{if $is_bootstrap}
|
||||
$(document).ready(function(){
|
||||
|
||||
$(document).on('change', '#categories-tree input', function(){
|
||||
load_import_categories();
|
||||
});
|
||||
|
||||
$(document).on('click', '#check-all-categories-tree, #uncheck-all-categories-tree, .tt-suggestion.tt-is-under-cursor', function(){
|
||||
load_import_categories();
|
||||
});
|
||||
|
||||
load_import_categories()
|
||||
|
||||
function load_import_categories() {
|
||||
var _select = $('#id_category');
|
||||
var selected_value = $('#id_category').val();
|
||||
_select.empty();
|
||||
$('#categories-tree input:checked, #categories-treeview input:checked').each(function(){
|
||||
_select.append('<option '+(($(this).attr('value') == selected_value) ? 'selected="selected"' : '')+' value="'+$(this).attr('value')+'">'+$(this).siblings('label').text()+'</option>');
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
{else}
|
||||
$('#categories-treeview').on('change', 'input', function() {
|
||||
if ($(this).is(':checked')) {
|
||||
$('select#id_category').append('<option value="'+$(this).val()+'">'+($(this).val() !=1 ? $(this).parent().find('span').html() : home)+'</option>');
|
||||
updateNbSubCategorySelected($(this), true);
|
||||
}
|
||||
else {
|
||||
$('select#id_category option[value='+$(this).val()+']').remove();
|
||||
updateNbSubCategorySelected($(this), false);
|
||||
}
|
||||
});
|
||||
{/if}
|
||||
{/block}
|
||||
@@ -0,0 +1,18 @@
|
||||
{extends file="helpers/list/list_content.tpl"}
|
||||
|
||||
{block name="td_content"}
|
||||
{if $key == 'markup'}
|
||||
<div class="markup_container" style="float: left;">
|
||||
<span style="display: block; height: 100%; float: left; cursor: pointer; margin-right: 3px;" class="markup_edit">{$tr.$key|escape:'htmlall':'UTF-8'|number_format:2:".":""}</span>
|
||||
<input style="width: 60px; display: none;" type="text" value="{$tr.$key|escape:'htmlall':'UTF-8'|number_format:2:".":""}" x-id="{$tr.id_ximport_category}" class="markup_edit x-cast x-cast-float" />
|
||||
|
||||
<span class="markup_type_edit" style="cursor: pointer;">{if $tr.markup_type == 'percent'}%{else}zł{/if}</span>
|
||||
<select name="markup_type" class="markup_type_edit" style="width: 70px; display: none;">
|
||||
<option value="percent" {if $tr.markup_type == 'percent'}selected="selected"{/if}>%</option>
|
||||
<option value="amount" {if $tr.markup_type == 'amount'}selected="selected"{/if}>zł</option>
|
||||
</select>
|
||||
</div>
|
||||
{else}
|
||||
{$smarty.block.parent}
|
||||
{/if}
|
||||
{/block}
|
||||
@@ -0,0 +1,97 @@
|
||||
{extends file="helpers/list/list_footer.tpl"}
|
||||
|
||||
{block name="after"}
|
||||
<div id="ximport_bulk_popup_markup" style="display: none;">
|
||||
<form action="{$currentIndex}&token={$token}" method="post" id="bulk_popup_markup_form" class="bootstrap">
|
||||
<div class="clearfix" style="max-width: 600px;">
|
||||
<div style="margin-bottom: 30px;">
|
||||
<h3 style="margin: 0;">{l s='Ustaw narzut kategorii' mod='x13import'}</h3>
|
||||
</div>
|
||||
|
||||
<div id="bulk_markup_hidden"></div>
|
||||
|
||||
<div class="clearfix">
|
||||
<label for="bulk_markup_type" class="control-label t col-lg-12">{l s='Rodzaj narzutu' mod='x13import'}:</label>
|
||||
<div class="col-lg-12">
|
||||
<select id="bulk_markup_type" name="bulk_markup_type">
|
||||
<option value="percent">{l s='procent' mod='x13import'}</option>
|
||||
<option value="amount">{l s='kwota' mod='x13import'}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="clearfix">
|
||||
<label for="bulk_markup" class="control-label t col-lg-12">{l s='Narzut' mod='x13import'}:</label>
|
||||
<div class="col-lg-12">
|
||||
<input type="text" name="bulk_markup" id="bulk_markup" value="0" class="x-cast x-cast-float">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="clearfix" style="margin-top: 30px;">
|
||||
<button class="button btn btn-success pull-right" type="submit" name="submitBulkmarkupximport_category" value="1"><i class="icon-save"></i> {l s='Zapisz' mod='x13import'}</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div id="ximport_bulk_popup_title_pattern" style="display: none;">
|
||||
<form action="{$currentIndex}&token={$token}" method="post" id="bulk_popup_title_pattern_form" class="bootstrap">
|
||||
<div class="clearfix" style="min-width: 680px;">
|
||||
<div style="margin-bottom: 30px;">
|
||||
<h3 style="margin: 0;">{l s='Ustaw wzorzec nazwy produktu' mod='x13import'}</h3>
|
||||
</div>
|
||||
|
||||
<div id="bulk_title_pattern_hidden"></div>
|
||||
|
||||
<div class="clearfix">
|
||||
<label for="bulk_title_pattern" class="control-label t col-lg-12">{l s='Wzorzec nazwy produktu' mod='x13import'}:</label>
|
||||
<div class="col-lg-12">
|
||||
<input type="text" name="bulk_title_pattern" id="bulk_title_pattern" value="" style="width: 100%;">
|
||||
<p class="help-block">
|
||||
{l s='Wzorzec nazwy produktu może zawierać dowolne znaki alfanumeryczne oraz zmienne' mod='x13import'}:<br>
|
||||
- <b>{literal}{%name%}{/literal}</b> - {l s='która zostanie zastąpiona nazwą produktu' mod='x13import'}<br>
|
||||
- <b>{literal}{%reference%}{/literal}</b> - {l s='która zostanie zastąpiona kodem referencyjnym' mod='x13import'}<br>
|
||||
- <b>{literal}{%manufacturer%}{/literal}</b> - {l s='która zostanie zastąpiona nazwą producenta' mod='x13import'}<br>
|
||||
- <b>{literal}[%feature%]{/literal}</b> - {l s='która zostanie zastapiona wartością podanej cechy, np. [%Materiał%]' mod='x13import'}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="clearfix" style="margin-top: 30px;">
|
||||
<button class="button btn btn-success pull-right" type="submit" name="submitBulktittlePatternximport_category" value="1"><i class="icon-save"></i> {l s='Zapisz' mod='x13import'}</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<style>
|
||||
#form-ximport_category table thead > tr > th.word-break > span {
|
||||
word-wrap: normal !important;
|
||||
white-space: normal !important;
|
||||
}
|
||||
|
||||
#form-ximport_category .panel-footer {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
i.x-categories-import:before {
|
||||
content: '\f019' !important;
|
||||
}
|
||||
|
||||
{if version_compare($smarty.const._PS_VERSION_, '1.6.0.0', '<')}
|
||||
.toolbarBox .x-categories-download {
|
||||
background-image: url("./themes/default/img/process-icon-import.png");
|
||||
}
|
||||
.toolbarBox .x-categories-import {
|
||||
background-image: url("./themes/default/img/process-icon-new.png");
|
||||
}
|
||||
{/if}
|
||||
</style>
|
||||
|
||||
{literal}
|
||||
<script>
|
||||
var X13Import = new $.XImport();
|
||||
X13Import.categoriesList();
|
||||
</script>
|
||||
{/literal}
|
||||
{/block}
|
||||
@@ -0,0 +1,5 @@
|
||||
{extends file="helpers/list/list_header.tpl"}
|
||||
|
||||
{block name="override_header"}
|
||||
{include file="../../../progress_block.tpl"}
|
||||
{/block}
|
||||
@@ -0,0 +1,167 @@
|
||||
{extends file="helpers/options/options.tpl"}
|
||||
|
||||
{block name="leadin"}
|
||||
{if $ionCubeLicenseInfo !== false}
|
||||
<div class="panel">
|
||||
<div class="panel-heading">
|
||||
<i class="icon-cogs"></i> {l s='Licencja' mod='x13import'}
|
||||
</div>
|
||||
|
||||
<div class="form-wrapper clearfix">
|
||||
<div class="form-group">
|
||||
<div class="col-lg-9 col-lg-offset-3">
|
||||
{$ionCubeLicenseInfo.html_content}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
{/block}
|
||||
|
||||
{block name="input"}
|
||||
{if $field.type == 'select'}
|
||||
<div class="col-lg-9">
|
||||
{if $field['list']}
|
||||
<select class="form-control fixed-width-xxl {if isset($field['class'])}{$field['class']}{/if}" name="{$key}"{if isset($field['js'])} onchange="{$field['js']}"{/if} id="{$key}" {if isset($field['size'])} size="{$field['size']}"{/if} {if isset($field['disabled']) && $field['disabled']} disabled="disabled"{/if}>
|
||||
{foreach $field['list'] AS $k => $option}
|
||||
<option value="{$option[$field['identifier']]}"{if $field['value'] == $option[$field['identifier']]} selected="selected"{/if}>{$option['name']}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
{elseif isset($input.empty_message)}
|
||||
{$input.empty_message}
|
||||
{/if}
|
||||
</div>
|
||||
{if isset($field['desc']) && !empty($field['desc'])}
|
||||
<div class="col-lg-9 col-lg-offset-3">
|
||||
<div class="help-block">
|
||||
{if is_array($field['desc'])}
|
||||
{foreach $field['desc'] as $p}
|
||||
{if is_array($p)}
|
||||
<span id="{$p.id}">{$p.text}</span><br />
|
||||
{else}
|
||||
{$p}<br />
|
||||
{/if}
|
||||
{/foreach}
|
||||
{else}
|
||||
{$field['desc']}
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
{elseif $field.type == 'disabled'}
|
||||
{if isset($is_bootstrap) && $is_bootstrap}<div class="col-lg-9">{/if}
|
||||
<input type="text" value="{$field.disabled|date_format:"%H:%M:%S %d-%m-%Y"}" readonly="readonly" disabled="disabled" size="{if isset($field.size)}{$field.size|intval}{else}5{/if}" />
|
||||
{if isset($is_bootstrap) && $is_bootstrap}</div>
|
||||
{if isset($field['desc']) && !empty($field['desc'])}
|
||||
<div class="col-lg-9 col-lg-offset-3">
|
||||
<div class="help-block">
|
||||
{if is_array($field['desc'])}
|
||||
{foreach $field['desc'] as $p}
|
||||
{if is_array($p)}
|
||||
<span id="{$p.id}">{$p.text}</span><br />
|
||||
{else}
|
||||
{$p}<br />
|
||||
{/if}
|
||||
{/foreach}
|
||||
{else}
|
||||
{$field['desc']}
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
{/if}
|
||||
{elseif $field.type == 'readonly'}
|
||||
{if isset($is_bootstrap) && $is_bootstrap}<div class="col-lg-9">{/if}
|
||||
<input type="text" value="{$field.readonly}" readonly="readonly" size="{if isset($field.size)}{$field.size|intval}{else}5{/if}" />
|
||||
{if isset($is_bootstrap) && $is_bootstrap}</div>
|
||||
{if isset($field['desc']) && !empty($field['desc'])}
|
||||
<div class="col-lg-9 col-lg-offset-3">
|
||||
<div class="help-block">
|
||||
{if is_array($field['desc'])}
|
||||
{foreach $field['desc'] as $p}
|
||||
{if is_array($p)}
|
||||
<span id="{$p.id}">{$p.text}</span><br />
|
||||
{else}
|
||||
{$p}<br />
|
||||
{/if}
|
||||
{/foreach}
|
||||
{else}
|
||||
{$field['desc']}
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
{/if}
|
||||
{elseif $field['type'] == 'hr'}
|
||||
<hr />
|
||||
{else}
|
||||
{$smarty.block.parent}
|
||||
{/if}
|
||||
{/block}
|
||||
|
||||
{block name="after"}
|
||||
<script>
|
||||
$(document).on('change', 'input[name="IMPORT_UNAVAILABLE"]', function () {
|
||||
var optionsList = [
|
||||
'MOD_ADVANCED_STOCK_NEW'
|
||||
];
|
||||
var selected = (parseInt($('input[name="IMPORT_UNAVAILABLE"]:checked').val()) === 1);
|
||||
|
||||
optionsList.forEach(function (value) {
|
||||
if (selected) {
|
||||
$('select[name="' + value + '"], input[name="' + value + '"]').removeAttr('disabled').trigger('xchange');
|
||||
} else {
|
||||
$('select[name="' + value + '"], input[name="' + value + '"]').attr('disabled', 'disabled').trigger('xchange');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$(document).on('change', 'input[name="MOD_ADVANCED_STOCK_NEW"]', function () {
|
||||
var optionsList = [
|
||||
'MOD_ADVANCED_STOCK_NEW_ACTIVE',
|
||||
'MOD_ADVANCED_STOCK_NEW_VIS',
|
||||
'MOD_ADVANCED_STOCK_NEW_OOS',
|
||||
'MOD_ADVANCED_STOCK_NEW_AFO'
|
||||
];
|
||||
var selectedParent = (parseInt($('input[name="IMPORT_UNAVAILABLE"]:checked').val()) === 1);
|
||||
var selected = (parseInt($('input[name="MOD_ADVANCED_STOCK_NEW"]:checked').val()) === 1);
|
||||
|
||||
optionsList.forEach(function (value) {
|
||||
if (!selected || !selectedParent) {
|
||||
$('select[name="' + value + '"], input[name="' + value + '"]').attr('disabled', 'disabled');
|
||||
} else if (selected) {
|
||||
$('select[name="' + value + '"], input[name="' + value + '"]').removeAttr('disabled');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$(document).on('change', 'input[name="MOD_ADVANCED_STOCK_UPD"]', function () {
|
||||
var optionsList = [
|
||||
'MOD_ADVANCED_STOCK_UPD_ACTIVE',
|
||||
'MOD_ADVANCED_STOCK_UPD_VIS',
|
||||
'MOD_ADVANCED_STOCK_UPD_OOS',
|
||||
'MOD_ADVANCED_STOCK_UPD_AFO',
|
||||
'MOD_ADVANCED_STOCK_UPD_QTY_ZERO'
|
||||
];
|
||||
var selected = (parseInt($('input[name="MOD_ADVANCED_STOCK_UPD"]:checked').val()) === 1);
|
||||
|
||||
optionsList.forEach(function (value) {
|
||||
if (!selected) {
|
||||
$('select[name="' + value + '"], input[name="' + value + '"]').attr('disabled', 'disabled');
|
||||
} else {
|
||||
$('select[name="' + value + '"], input[name="' + value + '"]').removeAttr('disabled');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$(document).on('change', 'input[name="UPDATE_PRICE"]', function () {
|
||||
var selected = (parseInt($('input[name="UPDATE_PRICE"]:checked').val()) === 1);
|
||||
|
||||
if (!selected) {
|
||||
$('select[name="UPDATE_UNIT_PRICE"], input[name="UPDATE_UNIT_PRICE"]').attr('disabled', 'disabled');
|
||||
} else {
|
||||
$('select[name="UPDATE_UNIT_PRICE"], input[name="UPDATE_UNIT_PRICE"]').removeAttr('disabled');
|
||||
}
|
||||
});
|
||||
</script>
|
||||
{/block}
|
||||
@@ -0,0 +1 @@
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
{extends file="helpers/list/list_footer.tpl"}
|
||||
|
||||
{block name="after"}
|
||||
<style>
|
||||
#form-ximport_product table thead > tr > th.word-break > span {
|
||||
word-wrap: normal !important;
|
||||
white-space: normal !important;
|
||||
}
|
||||
|
||||
#form-ximport_product .panel-footer {
|
||||
display: none !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
{literal}
|
||||
<script>
|
||||
var X13Import = new $.XImport();
|
||||
X13Import.excludeList();
|
||||
</script>
|
||||
{/literal}
|
||||
{/block}
|
||||
@@ -0,0 +1,556 @@
|
||||
{extends file="helpers/options/options.tpl"}
|
||||
|
||||
{block name="leadin"}
|
||||
{include file="../../../progress_block.tpl"}
|
||||
{/block}
|
||||
|
||||
{block name="input"}
|
||||
{if $field['type'] == 'hr'}
|
||||
<hr />
|
||||
{elseif $category == 'general'}
|
||||
{if version_compare($smarty.const._PS_VERSION_, '1.6.0.0', '<')}<div id="tabs_ps_15">{/if}
|
||||
<input type="hidden" name="tabWholesaler" value="{$tab_wholesaler}">
|
||||
<input type="hidden" name="tabWholesalerOption" value="{$tab_wholesaler_option}">
|
||||
|
||||
<ul class="nav nav-tabs nav-tab-wholesaler" id="tabWholesaler">
|
||||
{if !empty($wholesalers)}
|
||||
{foreach from=$wholesalers item=wholesale name=wholesale}
|
||||
<li{if $smarty.foreach.wholesale.index == 0} class="active"{/if}><a href="#{$wholesale.name}" aria-controls="{$wholesale.name}" role="tab" data-toggle="tab">{$wholesale.name}</a></li>
|
||||
{/foreach}
|
||||
{/if}
|
||||
<li{if empty($wholesalers)} class="active"{/if}><a href="#addNewWholesaler" aria-controls="addNewWholesaler" role="tab" data-toggle="tab">{l s='Dodaj hurtownię' mod='x13import'} <i class="icon-plus-sign"></i></a></li>
|
||||
</ul>
|
||||
|
||||
<div role="tabpanel" class="tab-content tab-wholesaler panel clearfix" id="tabContentWholesaler">
|
||||
{if !empty($wholesalers)}
|
||||
{foreach from=$wholesalers item=wholesale name=wholesale}
|
||||
{if version_compare($smarty.const._PS_VERSION_, '1.6.0.0', '<')}<div id="tabs_ps_15_{$wholesale.name}">{/if}
|
||||
<div class="tab-pane{if $smarty.foreach.wholesale.index == 0} active{/if}" id="{$wholesale.name}">
|
||||
{if $maintenance_mode && ($wholesale.info || $wholesale.version)}
|
||||
<div class="alert alert-info">
|
||||
{if $wholesale.info}<p><b>info</b>: {$wholesale.info}</p>{/if}
|
||||
{if $wholesale.version}<p><b>version</b>: {$wholesale.version}</p>{/if}
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
{if !$wholesale.code}
|
||||
<div class="alert alert-warning">
|
||||
<p><b>{l s='Plik hurtowni nie jest zgodny z najnowszą wersją modułu' mod='x13import'}</b> <i><small>(INVALID STATIC CODE)</small></i>.</p>
|
||||
<p>{l s='Skontaktuj się z działem supportu, aby uzyskać aktualizacje.' mod='x13import'}</p>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
<div class="col-lg-2">
|
||||
<ul class="list-group nav-tab-wholesaler-option" id="tabWholesaler{$wholesale.name}">
|
||||
<li class="list-group-item active"><a href="#{$wholesale.name}_baseOptions" aria-controls="{$wholesale.name}_baseOptions" role="tab" data-toggle="tab"><i class="icon-cogs"></i> {l s='Konfiguracja podstawowa' mod='x13import'}</a></li>
|
||||
<li class="list-group-item"><a href="#{$wholesale.name}_availabilityOptions" aria-controls="{$wholesale.name}_availabilityOptions" role="tab" data-toggle="tab"><i class="icon-calendar"></i> {l s='Informacje o dostępności' mod='x13import'}</a></li>
|
||||
<li class="list-group-item"><a href="#{$wholesale.name}_descriptionOptions" aria-controls="{$wholesale.name}_descriptionOptions" role="tab" data-toggle="tab"><i class="icon-indent"></i> {l s='Opis produktu i SEO' mod='x13import'}</a></li>
|
||||
<li class="list-group-item"><a href="#{$wholesale.name}_additionalOptions" aria-controls="{$wholesale.name}_additionalOptions" role="tab" data-toggle="tab"><i class="icon-asterisk"></i> {l s='Dodatkowe ustawienia' mod='x13import'}</a></li>
|
||||
<li class="list-group-item"><a href="#{$wholesale.name}_importRestrictionOptions" aria-controls="{$wholesale.name}_importRestrictionOptions" role="tab" data-toggle="tab"><i class="icon-ban"></i> {l s='Ograniczenia importu' mod='x13import'}</a></li>
|
||||
<li class="list-group-item"><a href="#{$wholesale.name}_productManagement" aria-controls="{$wholesale.name}_productManagement" role="tab" data-toggle="tab"><i class="icon-book"></i> {l s='Zarządzanie produktami' mod='x13import'}</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="col-lg-10">
|
||||
<div role="tabpanel" class="tab-content tab-wholesaler-option panel" id="tabWholesaler{$wholesale.name}">
|
||||
<div class="tab-pane active" id="{$wholesale.name}_baseOptions">
|
||||
<div class="panel-heading">{$wholesale.name} - {l s='Konfiguracja podstawowa' mod='x13import'}</div>
|
||||
|
||||
{if empty($wholesale.baseOptions)}
|
||||
<div class="form-wrapper">
|
||||
<div class="form-group">
|
||||
<p>{l s='Dla hurtowni [1]%s[/1] nie przewidzano ustawień indywidualnych.' sprintf=[$wholesale.name] tags=['<strong>'] mod='x13import'}</p>
|
||||
</div>
|
||||
</div>
|
||||
{else}
|
||||
{include file="./options_fields.tpl" optionsFields=$wholesale.baseOptions}
|
||||
{/if}
|
||||
|
||||
{if !empty($wholesale.descriptionOptions.cleanerRecommended) || !empty($wholesale.recommendedOptions)}
|
||||
<hr>
|
||||
|
||||
{if !empty($wholesale.descriptionOptions.cleanerRecommended)}
|
||||
<div class="alert alert-info">
|
||||
<p>{l s='Sugerujemy dla tej hurtowni ustawienie poprawienia opisu. Przejdź' mod='x13import'} <a href="#{$wholesale.name}_descriptionOptions" class="link-recommendations" data-wholesaler="{$wholesale.name}">{l s='TUTAJ' mod='x13import'}</a></p>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
{if !empty($wholesale.recommendedOptions)}
|
||||
<div class="alert alert-info">
|
||||
<p>{l s='Sugerujemy dla tej hurtowni ustawienie następujących opcji. Przejdź' mod='x13import'} <a href="#{$wholesale.name}_descriptionOptions" class="link-recommendations" data-wholesaler="{$wholesale.name}">{l s='TUTAJ' mod='x13import'}</a></p>
|
||||
<ul>
|
||||
{foreach $wholesale.recommendedOptions as $recommendedOption}
|
||||
<li>{$recommendedOption}</li>
|
||||
{/foreach}
|
||||
</ul>
|
||||
</div>
|
||||
{/if}
|
||||
{/if}
|
||||
</div>
|
||||
<div class="tab-pane" id="{$wholesale.name}_availabilityOptions">
|
||||
<div class="panel-heading">{$wholesale.name} - {l s='Informacje o dostępności' mod='x13import'}</div>
|
||||
{include file="./options_fields.tpl" optionsFields=$wholesale.availabilityOptions}
|
||||
</div>
|
||||
<div class="tab-pane" id="{$wholesale.name}_descriptionOptions">
|
||||
<div class="panel-heading">{$wholesale.name} - {l s='Opis produktu i SEO' mod='x13import'}</div>
|
||||
|
||||
{if !empty($wholesale.descriptionOptions.cleanerRecommended)}
|
||||
<div class="col-lg-4 col-lg-offset-3"><div class="cleaner-recommended">Rekomendowane ustawienia dla tej hurtowni</div></div>
|
||||
<div class="clearfix"></div>
|
||||
{include file="./options_fields.tpl" optionsFields=$wholesale.descriptionOptions.cleanerRecommended}
|
||||
{/if}
|
||||
|
||||
{if !empty($wholesale.descriptionOptions.cleanerDefault)}
|
||||
{if !empty($wholesale.descriptionOptions.cleanerRecommended)}
|
||||
<div class="col-lg-4 col-lg-offset-3"><a href="#" class="cleaner-default">Pokaż więcej ustawień</a></div>
|
||||
<div class="clearfix"></div>
|
||||
<div class="cleaner-default-fields" style="display: none;">
|
||||
<hr/>
|
||||
{include file="./options_fields.tpl" optionsFields=$wholesale.descriptionOptions.cleanerDefault}
|
||||
|
||||
{if !empty($wholesale.descriptionOptions.cleanerDisabled)}
|
||||
{include file="./options_fields.tpl" optionsFields=$wholesale.descriptionOptions.cleanerDisabled}
|
||||
{/if}
|
||||
</div>
|
||||
{else}
|
||||
{include file="./options_fields.tpl" optionsFields=$wholesale.descriptionOptions.cleanerDefault}
|
||||
{/if}
|
||||
{/if}
|
||||
|
||||
{if empty($wholesale.descriptionOptions.cleanerRecommended) && !empty($wholesale.descriptionOptions.cleanerDisabled)}
|
||||
{include file="./options_fields.tpl" optionsFields=$wholesale.descriptionOptions.cleanerDisabled}
|
||||
{/if}
|
||||
|
||||
<div class="form-group"><hr /></div>
|
||||
{include file="./options_fields.tpl" optionsFields=$wholesale.descriptionOptions.general}
|
||||
</div>
|
||||
<div class="tab-pane" id="{$wholesale.name}_additionalOptions">
|
||||
<div class="panel-heading">{$wholesale.name} - {l s='Dodatkowe ustawienia' mod='x13import'}</div>
|
||||
{include file="./options_fields.tpl" optionsFields=$wholesale.additionalOptions}
|
||||
</div>
|
||||
<div class="tab-pane" id="{$wholesale.name}_importRestrictionOptions">
|
||||
<div class="panel-heading">{$wholesale.name} - {l s='Ograniczenia importu' mod='x13import'}</div>
|
||||
{include file="./options_fields.tpl" optionsFields=$wholesale.importRestrictionOptions}
|
||||
</div>
|
||||
<div class="tab-pane" id="{$wholesale.name}_productManagement">
|
||||
<div class="panel-heading">{$wholesale.name} - {l s='Zarządzanie produktami' mod='x13import'}</div>
|
||||
<div class="alert alert-info">
|
||||
<p>{l s='W przypadku wyłączenia produktów, pozostaną one wyłączone do kolejnego uruchomienia zadania cron.php' mod='x13import'}<br/>
|
||||
{l s='Jeśli produkt dostępny jest w hurtowni, w pobranej, aktywnej oraz zmapowanej / zaimportowanej kategorii zostanie ponownie włączony.' mod='x13import'}<br/>
|
||||
{l s='Jeśli produkt ma być na stałe wyłączony mimo jego dostępności w hurtowni, nalezy wyłaczyć go a następnie wykluczyć w zakładce "Wykluczenie produktów".' mod='x13import'}</p>
|
||||
</div>
|
||||
|
||||
<div class="form-wrapper">
|
||||
<a href="#" data-wholesaler="{$wholesale.name}" data-wholesaler-code="{$wholesale.code}" class="btn btn-default" {if !$wholesale.code}disabled="disabled"{/if}><i class="process-icon-off x-products-off"></i> {l s='Wyłącz produkty z hurtowni' mod='x13import'}</a>
|
||||
<a href="#" data-wholesaler="{$wholesale.name}" data-wholesaler-code="{$wholesale.code}" class="btn btn-default" {if !$wholesale.code}disabled="disabled"{/if}><i class="process-icon-delete x-products-delete"></i> {l s='Usuń produkty z hurtowni' mod='x13import'}</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{if version_compare($smarty.const._PS_VERSION_, '1.6.0.0', '<')}</div>{/if}
|
||||
{/foreach}
|
||||
{/if}
|
||||
|
||||
<div class="tab-pane{if empty($wholesalers)} active{/if}" id="addNewWholesaler">
|
||||
<div class="form-group">
|
||||
<div class="alert alert-info">
|
||||
{if empty($wholesalers)}
|
||||
<p>{l s='W tym miejscu można wgrać pierwszą hurtownię do modułu' mod='x13import'} <strong>{l s='integracji XML / CSV / API' mod='x13import'}.</strong><br/>
|
||||
{l s='Gdy zamówienie zostanie opłacone, otrzymasz maila z pytaniem o hurtownie którą mamy przygotować.' mod='x13import'}<br/>
|
||||
{l s='Ustawiona wersja PHP to' mod='x13import'}: <strong>{phpversion()}</strong><br/>
|
||||
{l s='Po otrzymaniu pliku, należy wgrać go poniżej, a następnie przejść do konfiguracji modułu.' mod='x13import'}</p>
|
||||
{else}
|
||||
<p>{l s='W tym miejscu można dodać kolejną hurtownię do modułu' mod='x13import'} <strong>{l s='integracji XML / CSV / API' mod='x13import'}.</strong><br/>
|
||||
{l s='Skontaktuj się z nami mailowo, prześlij informację z jaką hurtownię chcesz się zintegrować.' mod='x13import'}<br/>
|
||||
{l s='Po otrzymaniu informacji o posiadanej gotowej integracji lub możliwości jej realizacji z dostarczonego pliku, dokonaj zakupu dodania dodatkowej hurtowni' mod='x13import'}
|
||||
<a href="https://x13.pl/integracje-prestashop/dodatkowa-hurtownia-do-modulu-import-xml.html" target="_blank">{l s='- TUTAJ' mod='x13import'}</a><br/><br/>
|
||||
{l s='Ustawiona wersja PHP to' mod='x13import'}: <strong>{phpversion()}</strong>
|
||||
</p>
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
<div class="alert alert-danger">
|
||||
<p>
|
||||
{l s='Pamiętaj aby w tym miejscu wgrywać tylko i wyłącznie pliki hurtowni dostarczone od' mod='x13import'} <strong>x13.pl</strong>{l s=', mailowo lub z adresu URL.' mod='x13import'}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-lg-3">{l s='Plik hurtowni' mod='x13import'}</label>
|
||||
<div class="col-lg-4">
|
||||
<input id="wholesaler_file" type="file" name="wholesaler_file" style="display: none;" />
|
||||
<div class="dummyfile input-group">
|
||||
<span class="input-group-addon"><i class="icon-file"></i></span>
|
||||
<input id="wholesaler_file-name" type="text" name="wholesaler_file" readonly />
|
||||
<span class="input-group-btn">
|
||||
<button id="wholesaler_file-selectbutton" type="button" class="btn btn-default">
|
||||
<i class="icon-folder-open"></i> {l s='Add file'}
|
||||
</button>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-6 col-lg-offset-3">
|
||||
<div class="help-block">{l s='Plik hurtowni o rozszerzeniu ".php" lub paczka ".zip" otrzymana od x13.pl' mod='x13import'}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div class="col-lg-9 col-lg-push-3">
|
||||
<button class="btn btn-default" type="submit" name="submitAddNewWholesaler">
|
||||
<i class="icon-upload-alt"></i> {l s='Wgraj hurtownię' mod='x13import'}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{if version_compare($smarty.const._PS_VERSION_, '1.6.0.0', '<')}</div>{/if}
|
||||
{else}
|
||||
{$smarty.block.parent}
|
||||
{/if}
|
||||
{/block}
|
||||
|
||||
{block name="after"}
|
||||
<style>
|
||||
{if version_compare($smarty.const._PS_VERSION_, '1.6.0.0', '>=')}
|
||||
.nav-tab-wholesaler-option .list-group-item {
|
||||
padding: 0;
|
||||
}
|
||||
.nav-tab-wholesaler-option .list-group-item a {
|
||||
color: #555;
|
||||
text-decoration: none;
|
||||
display: block;
|
||||
padding: 10px 15px;
|
||||
}
|
||||
.nav-tab-wholesaler-option .list-group-item.active a {
|
||||
color: #fff;
|
||||
}
|
||||
.nav-tab-wholesaler-option .list-group-item a:hover {
|
||||
background-color: #f5f5f5;
|
||||
}
|
||||
.nav-tab-wholesaler-option .list-group-item.active a:hover {
|
||||
background-color: #00aff0;
|
||||
}
|
||||
|
||||
.tab-wholesaler-option .cleaner-recommended {
|
||||
font-weight: bold;
|
||||
font-style: italic;
|
||||
margin-bottom: 8px;
|
||||
border-bottom: 1px solid #eee;
|
||||
}
|
||||
|
||||
.tab-wholesaler-option .mce-container iframe {
|
||||
min-height: 60px;
|
||||
}
|
||||
{else}
|
||||
.toolbarBox .x-products-off {
|
||||
background-image: url("./themes/default/img/icon-cancel.png");
|
||||
}
|
||||
.toolbarBox .x-products-delete {
|
||||
background-image: url("./themes/default/img/process-icon-delete.png");
|
||||
}
|
||||
{/if}
|
||||
</style>
|
||||
<script>
|
||||
var wholesalersAdminLink = '{$wholesalers_link}';
|
||||
var tabWholesaler = getUrlParam('tabWholesaler');
|
||||
var tabWholesalerOption = getUrlParam('tabWholesalerOption');
|
||||
|
||||
$(document).ready(function() {
|
||||
handleFieldDependencies();
|
||||
var $fieldDependencies = getFieldDependencies();
|
||||
for (var i = 0; i < $fieldDependencies.length; i++) {
|
||||
$(document).off($fieldDependencies[i]).on('change', '[name="'+ $fieldDependencies[i] +'"]', function () {
|
||||
handleFieldDependencies($fieldDependencies[i]);
|
||||
}).bind(i);
|
||||
}
|
||||
|
||||
if (tabWholesaler) {
|
||||
$('.nav-tab-wholesaler li a[aria-controls="' + tabWholesaler + '"]').trigger('click');
|
||||
if (tabWholesalerOption) {
|
||||
$('.tab-wholesaler #' + tabWholesaler + ' .nav-tab-wholesaler-option li a[aria-controls="' + tabWholesalerOption + '"]').trigger('click');
|
||||
}
|
||||
}
|
||||
|
||||
$('a.link-recommendations').on('click', function(e) {
|
||||
e.preventDefault();
|
||||
$('ul#tabWholesaler' + $(this).attr('data-wholesaler')).find('a[href="' + $(this).attr('href') + '"]').click();
|
||||
});
|
||||
|
||||
$('.tab-wholesaler-option').find('select[multiple]').each(function(i, el) {
|
||||
$(el).on('click', function() {
|
||||
if ($(this).find(':selected').val() === 'all') {
|
||||
$(this).find('option').prop('selected', false);
|
||||
$(this).find('option[value="all"]').prop('selected', true);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('.multiple-clear').on('click', function(e) {
|
||||
e.preventDefault();
|
||||
|
||||
$(this).parent().find('select[multiple]').each(function() {
|
||||
$(this).find('option').prop('selected', false);
|
||||
});
|
||||
|
||||
$(this).parent().find('select[multiple] option.multiple-empty').prop('selected', true);
|
||||
});
|
||||
|
||||
$('.individual-enabled').on('change', function() {
|
||||
var elements = 'input:not(.individual-enabled):not(.version-disabled):not(.skip-dynamic), ' +
|
||||
'select:not(.individual-enabled):not(.version-disabled):not(.skip-dynamic), ' +
|
||||
'button:not(.individual-enabled):not(.version-disabled):not(.skip-dynamic)';
|
||||
|
||||
if (parseInt($(this).val()) === 1) {
|
||||
$(this).closest('.tab-pane').find(elements).removeAttr('disabled');
|
||||
} else {
|
||||
$(this).closest('.tab-pane').find(elements).prop('disabled', true);
|
||||
}
|
||||
});
|
||||
|
||||
$('.cleaner-default').on('click', function(e) {
|
||||
e.preventDefault();
|
||||
|
||||
$(this).hide();
|
||||
$(this).closest('.tab-pane').find('.cleaner-default-fields').show();
|
||||
});
|
||||
|
||||
$('#wholesaler_file-selectbutton').click(function() {
|
||||
$('#wholesaler_file').trigger('click');
|
||||
});
|
||||
|
||||
$('#wholesaler_file-name').click(function() {
|
||||
$('#wholesaler_file').trigger('click');
|
||||
});
|
||||
|
||||
$('#wholesaler_file').change(function() {
|
||||
var name = '';
|
||||
|
||||
if ($(this)[0].files !== undefined) {
|
||||
var files = $(this)[0].files;
|
||||
$.each(files, function(index, value) {
|
||||
name += value.name+', ';
|
||||
});
|
||||
|
||||
$('#wholesaler_file-name').val(name.slice(0, -2));
|
||||
}
|
||||
else { // Internet Explorer 9 Compatibility
|
||||
name = $(this).val().split(/[\\/]/);
|
||||
$('#wholesaler_file-name').val(name[name.length-1]);
|
||||
}
|
||||
});
|
||||
|
||||
$('button[name="submitAddNewWholesaler"]').on('click', function(e) {
|
||||
if (!$('#wholesaler_file')[0].files.length) {
|
||||
e.preventDefault();
|
||||
alert('Nie wybrano pliku do przesłania');
|
||||
}
|
||||
});
|
||||
|
||||
$('.nav-tab-wholesaler a').on('click', function() {
|
||||
setUrlParams(
|
||||
$(this).attr('aria-controls'),
|
||||
$('.tab-wholesaler #' + $(this).attr('aria-controls') + ' .nav-tab-wholesaler-option li.active a').attr('aria-controls')
|
||||
);
|
||||
});
|
||||
|
||||
$('.nav-tab-wholesaler-option a').on('click', function() {
|
||||
setUrlParams(
|
||||
$('.nav-tab-wholesaler li.active a').attr('aria-controls'),
|
||||
$(this).attr('aria-controls')
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
function getUrlParam(parameter) {
|
||||
var value = false;
|
||||
if (window.location.href.indexOf(parameter) > -1) {
|
||||
value = getUrlVars()[parameter];
|
||||
}
|
||||
|
||||
return (value !== '' ? value : false);
|
||||
}
|
||||
|
||||
function getUrlVars() {
|
||||
var vars = [];
|
||||
window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function(m, key, value) {
|
||||
vars[key] = value;
|
||||
});
|
||||
|
||||
return vars;
|
||||
}
|
||||
|
||||
function setUrlParams(tabWholesaler, tabWholesalerOption) {
|
||||
tabWholesalerOption = (typeof tabWholesalerOption === 'undefined' ? '' : tabWholesalerOption);
|
||||
|
||||
$('input[name="tabWholesaler"]').val(tabWholesaler);
|
||||
$('input[name="tabWholesalerOption"]').val(tabWholesalerOption);
|
||||
|
||||
history.replaceState(null, '', wholesalersAdminLink + '&tabWholesaler=' + tabWholesaler + '&tabWholesalerOption=' + tabWholesalerOption);
|
||||
}
|
||||
|
||||
function getFieldDependencies() {
|
||||
var fieldDependencies = [];
|
||||
$('.depends-on').each(function (index, node) {
|
||||
var $element = $(node);
|
||||
var $classes = $element.prop('class').split(/\s+/);
|
||||
for (var i = 0; i < $classes.length; i++) {
|
||||
var current = $classes[i];
|
||||
if (current.includes('depends-field')) {
|
||||
var parts = current.replace('depends-field-', '').split(':');
|
||||
fieldDependencies.push(parts[0]);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
return fieldDependencies;
|
||||
}
|
||||
|
||||
function handleFieldDependencies(specificFieldName) {
|
||||
var specificField = specificFieldName || false;
|
||||
$('.depends-on').each(function (index, node) {
|
||||
var $element = $(node);
|
||||
var $classes = $element.prop('class').split(/\s+/);
|
||||
var $method = 'match';
|
||||
var $fieldName = false,
|
||||
$fieldValue = false,
|
||||
$fieldType = false,
|
||||
$currentValue,
|
||||
$typeOfTheField;
|
||||
if ($element.hasClass('depends-on-multiple')) {
|
||||
$fieldValue = [];
|
||||
$fieldName = [];
|
||||
$fieldType = [];
|
||||
}
|
||||
|
||||
for (var i = 0; i < $classes.length; i++) {
|
||||
var current = $classes[i];
|
||||
if (current.includes('depends-where')) {
|
||||
if (current === 'depends-where-is-not') {
|
||||
$method = 'not_match';
|
||||
}
|
||||
}
|
||||
if (current.includes('depends-field')) {
|
||||
var parts = current.replace('depends-field-', '').split(':');
|
||||
var $nameOfTheField = parts[0];
|
||||
var $valueOfTheField = parts[1].split('--');
|
||||
|
||||
if ($element.hasClass('depends-on-multiple')) {
|
||||
$fieldName.push($nameOfTheField);
|
||||
$fieldValue.push($valueOfTheField);
|
||||
} else {
|
||||
$fieldName = $nameOfTheField;
|
||||
$fieldValue = $valueOfTheField;
|
||||
}
|
||||
|
||||
if($('input[name="'+ $nameOfTheField +'"]').length > 0){
|
||||
$typeOfTheField = $('input[name="'+ $nameOfTheField +'"]').attr('type');
|
||||
}else if($('textarea[name="'+ $nameOfTheField +'"]').length === 1){
|
||||
$typeOfTheField = 'textarea';
|
||||
}else if($('select[name="'+ $nameOfTheField +'"]').length === 1){
|
||||
$typeOfTheField = 'select';
|
||||
}
|
||||
|
||||
if ($element.hasClass('depends-on-multiple')) {
|
||||
$fieldType.push($typeOfTheField);
|
||||
} else {
|
||||
$fieldType = $typeOfTheField;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($element.hasClass('depends-on-multiple')) {
|
||||
var showBasedOnMultiple = true;
|
||||
for (var i = 0; i < $fieldName.length; i++) {
|
||||
if ($fieldType[i] === 'checkbox' || $fieldType[i] === 'radio'){
|
||||
$currentValue = $('[name="'+ $fieldName[i] +'"]:checked').val();
|
||||
} else if ($fieldType[i] === 'select') {
|
||||
$currentValue = $('[name="'+ $fieldName[i] +'"] option:selected').val();
|
||||
} else {
|
||||
$currentValue = $('[name="'+ $fieldName[i] +'"]').val();
|
||||
}
|
||||
|
||||
if ($method === 'match') {
|
||||
if (!inArray($currentValue, $fieldValue[i])) {
|
||||
showBasedOnMultiple = false;
|
||||
}
|
||||
}
|
||||
if ($method === 'not_match') {
|
||||
if (inArray($currentValue, $fieldValue[i])) {
|
||||
showBasedOnMultiple = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (showBasedOnMultiple) {
|
||||
$element.show();
|
||||
} else {
|
||||
$element.hide();
|
||||
}
|
||||
} else {
|
||||
if (specificField && specificField !== $fieldName) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ($fieldType === 'checkbox' || $fieldType === 'radio'){
|
||||
$currentValue = $('[name="'+ $fieldName +'"]:checked').val();
|
||||
} else if ($fieldType === 'select') {
|
||||
$currentValue = $('[name="'+ $fieldName +'"] option:selected').val();
|
||||
} else {
|
||||
$currentValue = $('[name="'+ $fieldName +'"]').val();
|
||||
}
|
||||
|
||||
if ($method === 'not_match' && $fieldName && $fieldValue) {
|
||||
if ($fieldValue.includes($currentValue)) {
|
||||
$element.hide();
|
||||
} else {
|
||||
$element.show();
|
||||
}
|
||||
}
|
||||
if ($method === 'match' && $fieldName && $fieldValue) {
|
||||
if ($fieldValue.includes($currentValue)) {
|
||||
$element.show();
|
||||
} else {
|
||||
$element.hide();
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function inArray(needle, haystack) {
|
||||
var length = haystack.length;
|
||||
for(var i = 0; i < length; i++) {
|
||||
if(haystack[i] === needle) return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
</script>
|
||||
|
||||
{if version_compare($smarty.const._PS_VERSION_, '1.7.0.0', '<') && (isset($tinymce) && $tinymce)}
|
||||
<script type="text/javascript">
|
||||
var iso = '{$iso|addslashes}';
|
||||
var pathCSS = '{$smarty.const._THEME_CSS_DIR_|addslashes}';
|
||||
var ad = '{$ad|addslashes}';
|
||||
|
||||
$(document).ready(function(){
|
||||
tinySetup({
|
||||
editor_selector :"autoload_rte"
|
||||
});
|
||||
});
|
||||
</script>
|
||||
{/if}
|
||||
|
||||
{if version_compare($smarty.const._PS_VERSION_, '1.6.0.0', '<')}
|
||||
<script>
|
||||
$(function() {
|
||||
$('#tabs_ps_15').tabs();
|
||||
|
||||
{foreach from=$wholesalers item=wholesale}
|
||||
$('#tabs_ps_15_{$wholesale.name}').tabs();
|
||||
{/foreach}
|
||||
});
|
||||
</script>
|
||||
{/if}
|
||||
|
||||
{$smarty.block.parent}
|
||||
{/block}
|
||||
@@ -0,0 +1,111 @@
|
||||
<div class="form-wrapper">
|
||||
{foreach $optionsFields AS $key => $field}
|
||||
{if $field['type'] == 'hidden'}
|
||||
<input type="hidden" name="{$key}" value="{$field['value']}" />
|
||||
{else}
|
||||
<div class="form-group{if isset($field.form_group_class)} {$field.form_group_class}{/if} clearfix"{if isset($tabs) && isset($field.tab)} data-tab-id="{$field.tab}"{/if}>
|
||||
<div id="conf_id_{$key}">
|
||||
{if isset($field['title']) && isset($field['hint'])}
|
||||
<label class="control-label col-lg-3{if isset($field['required']) && $field['required']} required{/if}">
|
||||
<span title="" data-toggle="tooltip" class="label-tooltip" data-original-title="
|
||||
{if is_array($field['hint'])}
|
||||
{foreach $field['hint'] as $hint}
|
||||
{if is_array($hint)}
|
||||
{$hint.text}
|
||||
{else}
|
||||
{$hint}
|
||||
{/if}
|
||||
{/foreach}
|
||||
{else}
|
||||
{$field['hint']}
|
||||
{/if}
|
||||
" data-html="true">
|
||||
{$field['title']}
|
||||
</span>
|
||||
</label>
|
||||
{elseif isset($field['title'])}
|
||||
<label class="control-label col-lg-3{if isset($field['required']) && $field['required']} required{/if}">{$field['title']}</label>
|
||||
{/if}
|
||||
|
||||
{if $field['type'] == 'select'}
|
||||
<div class="col-lg-9">
|
||||
{if $field['list']}
|
||||
<select class="form-control fixed-width-xxl {if isset($field['class'])}{$field['class']}{/if}" name="{$key}{if isset($field['multiple']) && $field['multiple']}[]{/if}"{if isset($field['multiple']) && $field['multiple']} multiple style="float: left; margin-right: 5px;"{/if}{if isset($field['js'])} onchange="{$field['js']}"{/if} id="{$key}" {if isset($field['size'])} size="{$field['size']}"{/if} {if isset($field['disabled']) && $field['disabled']} disabled="disabled"{/if}>
|
||||
{if isset($field['multiple']) && $field['multiple']}<option value="" class="multiple-empty" style="display: none;"></option>{/if}
|
||||
{foreach $field['list'] AS $k => $option}
|
||||
<option value="{$option[$field['identifier']]}"{if (isset($field['multiple']) && $field['multiple'] && is_array($field['value']) && in_array($option[$field['identifier']], $field['value'])) || (!is_array($field['value']) && $field['value'] == $option[$field['identifier']])} selected="selected"{/if}>{$option['name']}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
{if isset($field['multiple']) && $field['multiple']}
|
||||
<button class="btn btn-default multiple-clear" {if isset($field['disabled']) && $field['disabled']} disabled="disabled"{/if}>Odznacz wszystko</button>
|
||||
{/if}
|
||||
{elseif isset($input.empty_message)}
|
||||
{$input.empty_message}
|
||||
{/if}
|
||||
</div>
|
||||
{elseif $field['type'] == 'bool'}
|
||||
<div class="col-lg-9">
|
||||
<span class="switch prestashop-switch fixed-width-lg">
|
||||
{strip}
|
||||
<input type="radio" data-wholesaler="{$wholesale.name}" class="{if isset($field['class'])}{$field['class']}{/if}" name="{$key}" id="{$key}_on" value="1" {if $field['value']} checked="checked"{/if}{if isset($field['js']['on'])} {$field['js']['on']}{/if}{if isset($field['disabled']) && $field['disabled']} disabled="disabled"{/if}/>
|
||||
<label for="{$key}_on" class="radioCheck">
|
||||
{l s='Yes'}
|
||||
</label>
|
||||
<input type="radio" data-wholesaler="{$wholesale.name}" class="{if isset($field['class'])}{$field['class']}{/if}" name="{$key}" id="{$key}_off" value="0" {if !$field['value']} checked="checked"{/if}{if isset($field['js']['off'])} {$field['js']['off']}{/if}{if isset($field['disabled']) && $field['disabled']} disabled="disabled"{/if}/>
|
||||
<label for="{$key}_off" class="radioCheck">
|
||||
{l s='No'}
|
||||
</label>
|
||||
{/strip}
|
||||
<a class="slide-button btn"></a>
|
||||
</span>
|
||||
</div>
|
||||
{elseif $field['type'] == 'text'}
|
||||
<div class="col-lg-9">{if isset($field['suffix'])}<div class="input-group{if isset($field.class)} {$field.class}{/if}">{/if}
|
||||
<input class="form-control {if isset($field['class'])}{$field['class']}{/if}" type="{$field['type']}"{if isset($field['id'])} id="{$field['id']}"{/if} size="{if isset($field['size'])}{$field['size']|intval}{else}75{/if}" name="{$key}" value="{if isset($field['no_escape']) && $field['no_escape']}{$field['value']|escape:'UTF-8'}{else}{$field['value']|escape:'html':'UTF-8'}{/if}" {if isset($field['autocomplete']) && !$field['autocomplete']}autocomplete="off"{/if} {if isset($field['disabled']) && $field['disabled']} disabled="disabled"{/if} />
|
||||
{if isset($field['suffix'])}
|
||||
<span class="input-group-addon">
|
||||
{$field['suffix']|strval}
|
||||
</span>
|
||||
{/if}
|
||||
{if isset($field['suffix'])}</div>{/if}
|
||||
</div>
|
||||
{elseif $field['type'] == 'textarea'}
|
||||
<div class="col-lg-9">
|
||||
<textarea class="{if isset($field['class'])}{$field['class']}{/if}{if isset($field['autoload_rte']) && $field['autoload_rte']} rte autoload_rte{else} textarea-autosize{/if}"{if isset($field['id'])} id="{$field['id']}"{/if} name={$key}{if isset($field['cols'])} cols="{$field['cols']}"{/if}{if isset($field['rows'])} rows="{$field['rows']}"{/if} {if isset($field['disabled']) && $field['disabled']} disabled="disabled"{/if}>{$field['value']|escape:'html':'UTF-8'}</textarea>
|
||||
</div>
|
||||
{elseif $field['type'] == 'password'}
|
||||
<div class="col-lg-9">{if isset($field['suffix'])}<div class="input-group{if isset($field.class)} {$field.class}{/if}">{/if}
|
||||
<input class="form-control {if isset($field['class'])}{$field['class']}{/if}" type="{$field['type']}"{if isset($field['id'])} id="{$field['id']}"{/if} size="{if isset($field['size'])}{$field['size']|intval}{else}75{/if}" name="{$key}" value="{if isset($field['no_escape']) && $field['no_escape']}{$field['value']|escape:'UTF-8'}{else}{$field['value']|escape:'html':'UTF-8'}{/if}"{if isset($field['autocomplete']) && !$field['autocomplete']} autocomplete="off"{/if} {if isset($field['disabled']) && $field['disabled']} disabled="disabled"{/if} />
|
||||
{if isset($field['suffix'])}
|
||||
<span class="input-group-addon">
|
||||
{$field['suffix']|strval}
|
||||
</span>
|
||||
{/if}
|
||||
{if isset($field['suffix'])}</div>{/if}
|
||||
</div>
|
||||
{elseif $field['type'] == 'hr'}
|
||||
<hr />
|
||||
{/if}
|
||||
|
||||
{if isset($field['desc']) && !empty($field['desc'])}
|
||||
<div class="col-lg-9 col-lg-offset-3">
|
||||
<div class="help-block">
|
||||
{if is_array($field['desc'])}
|
||||
{foreach $field['desc'] as $p}
|
||||
{if is_array($p)}
|
||||
<span id="{$p.id}">{$p.text}</span><br />
|
||||
{else}
|
||||
{$p}<br />
|
||||
{/if}
|
||||
{/foreach}
|
||||
{else}
|
||||
{$field['desc']}
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
{/foreach}
|
||||
</div>
|
||||
@@ -0,0 +1,8 @@
|
||||
<style>
|
||||
.icon-AdminXImport:before {
|
||||
content: "\f019";
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
var x13importToken = "{$token}";
|
||||
</script>
|
||||
11
modules/x13import/views/templates/index.php
Normal file
11
modules/x13import/views/templates/index.php
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
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;
|
||||
Reference in New Issue
Block a user