Skip to content
Code-Schnipsel Gruppen Projekte

Revisionen vergleichen

Änderungen werden so angezeigt, als ob die Quellrevision mit der Zielrevision zusammengeführt würde. Erfahre mehr über den Vergleich von Revisionen.

Quelle

Zielprojekt auswählen
No results found

Ziel

Zielprojekt auswählen
  • quiqqer/shipping
1 Ergebnis
Änderungen anzeigen
Commits auf Quelle (3)
werden angezeigt mit 798 Ergänzungen und 789 Löschungen
...@@ -3,8 +3,8 @@ ...@@ -3,8 +3,8 @@
*/ */
define('package/quiqqer/shipping/bin/backend/Shipping', [ define('package/quiqqer/shipping/bin/backend/Shipping', [
'package/quiqqer/shipping/bin/backend/classes/Handler' 'package/quiqqer/shipping/bin/backend/classes/Handler'
], function (Shipping) { ], function(Shipping) {
"use strict"; 'use strict';
return new Shipping(); return new Shipping();
}); });
\ No newline at end of file
...@@ -3,8 +3,8 @@ ...@@ -3,8 +3,8 @@
*/ */
define('package/quiqqer/shipping/bin/backend/ShippingRules', [ define('package/quiqqer/shipping/bin/backend/ShippingRules', [
'package/quiqqer/shipping/bin/backend/classes/ShippingRules' 'package/quiqqer/shipping/bin/backend/classes/ShippingRules'
], function (ShippingRules) { ], function(ShippingRules) {
"use strict"; 'use strict';
return new ShippingRules(); return new ShippingRules();
}); });
\ No newline at end of file
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
*/ */
define('package/quiqqer/shipping/bin/backend/ShippingStatus', [ define('package/quiqqer/shipping/bin/backend/ShippingStatus', [
'package/quiqqer/shipping/bin/backend/classes/ShippingStatus' 'package/quiqqer/shipping/bin/backend/classes/ShippingStatus'
], function (ShippingStatus) { ], function(ShippingStatus) {
"use strict"; 'use strict';
return new ShippingStatus(); return new ShippingStatus();
}); });
...@@ -14,15 +14,15 @@ define('package/quiqqer/shipping/bin/backend/classes/Handler', [ ...@@ -14,15 +14,15 @@ define('package/quiqqer/shipping/bin/backend/classes/Handler', [
'qui/classes/DOM', 'qui/classes/DOM',
'Ajax' 'Ajax'
], function (QUI, QUIDOM, QUIAjax) { ], function(QUI, QUIDOM, QUIAjax) {
"use strict"; 'use strict';
return new Class({ return new Class({
Extends: QUIDOM, Extends: QUIDOM,
Type : 'package/quiqqer/shipping/bin/Manager', Type: 'package/quiqqer/shipping/bin/Manager',
initialize: function (options) { initialize: function(options) {
this.parent(options); this.parent(options);
this.$shippings = null; this.$shippings = null;
...@@ -33,20 +33,20 @@ define('package/quiqqer/shipping/bin/backend/classes/Handler', [ ...@@ -33,20 +33,20 @@ define('package/quiqqer/shipping/bin/backend/classes/Handler', [
* *
* @return {Promise} * @return {Promise}
*/ */
getShippingList: function () { getShippingList: function() {
if (this.$shippings) { if (this.$shippings) {
return window.Promise.resolve(this.$shippings); return window.Promise.resolve(this.$shippings);
} }
var self = this; var self = this;
return new Promise(function (resolve, reject) { return new Promise(function(resolve, reject) {
QUIAjax.get('package_quiqqer_shipping_ajax_backend_getShippingList', function (result) { QUIAjax.get('package_quiqqer_shipping_ajax_backend_getShippingList', function(result) {
self.$shippings = result; self.$shippings = result;
resolve(self.$shippings); resolve(self.$shippings);
}, { }, {
'package': 'quiqqer/shipping', 'package': 'quiqqer/shipping',
onError : reject onError: reject
}); });
}); });
}, },
...@@ -57,11 +57,11 @@ define('package/quiqqer/shipping/bin/backend/classes/Handler', [ ...@@ -57,11 +57,11 @@ define('package/quiqqer/shipping/bin/backend/classes/Handler', [
* @param {String|Number} shippingId * @param {String|Number} shippingId
* @return {Promise} * @return {Promise}
*/ */
getShippingEntry: function (shippingId) { getShippingEntry: function(shippingId) {
return new Promise(function (resolve, reject) { return new Promise(function(resolve, reject) {
QUIAjax.get('package_quiqqer_shipping_ajax_backend_getShippingEntry', resolve, { QUIAjax.get('package_quiqqer_shipping_ajax_backend_getShippingEntry', resolve, {
'package' : 'quiqqer/shipping', 'package': 'quiqqer/shipping',
onError : reject, onError: reject,
shippingId: shippingId shippingId: shippingId
}); });
}); });
...@@ -72,11 +72,11 @@ define('package/quiqqer/shipping/bin/backend/classes/Handler', [ ...@@ -72,11 +72,11 @@ define('package/quiqqer/shipping/bin/backend/classes/Handler', [
* *
* @return {Promise} * @return {Promise}
*/ */
getShippingTypes: function () { getShippingTypes: function() {
return new Promise(function (resolve, reject) { return new Promise(function(resolve, reject) {
QUIAjax.get('package_quiqqer_shipping_ajax_backend_getShippingTypes', resolve, { QUIAjax.get('package_quiqqer_shipping_ajax_backend_getShippingTypes', resolve, {
'package': 'quiqqer/shipping', 'package': 'quiqqer/shipping',
onError : reject onError: reject
}); });
}); });
}, },
...@@ -87,24 +87,24 @@ define('package/quiqqer/shipping/bin/backend/classes/Handler', [ ...@@ -87,24 +87,24 @@ define('package/quiqqer/shipping/bin/backend/classes/Handler', [
* @param {String} shippingType - Hash of the shipping type * @param {String} shippingType - Hash of the shipping type
* @return {Promise} * @return {Promise}
*/ */
createShipping: function (shippingType) { createShipping: function(shippingType) {
var self = this; var self = this;
return new Promise(function (resolve, reject) { return new Promise(function(resolve, reject) {
QUIAjax.post('package_quiqqer_shipping_ajax_backend_create', function (shippingId) { QUIAjax.post('package_quiqqer_shipping_ajax_backend_create', function(shippingId) {
self.$shippings = null; self.$shippings = null;
require([ require([
'package/quiqqer/translator/bin/Translator' 'package/quiqqer/translator/bin/Translator'
], function (Translator) { ], function(Translator) {
Translator.refreshLocale().then(function () { Translator.refreshLocale().then(function() {
self.fireEvent('shippingCreate', [self, shippingId]); self.fireEvent('shippingCreate', [self, shippingId]);
resolve(shippingId); resolve(shippingId);
}); });
}); });
}, { }, {
'package' : 'quiqqer/shipping', 'package': 'quiqqer/shipping',
onError : reject, onError: reject,
shippingType: shippingType shippingType: shippingType
}); });
}); });
...@@ -117,26 +117,26 @@ define('package/quiqqer/shipping/bin/backend/classes/Handler', [ ...@@ -117,26 +117,26 @@ define('package/quiqqer/shipping/bin/backend/classes/Handler', [
* @param {Object} data - Data of the shipping * @param {Object} data - Data of the shipping
* @return {Promise} * @return {Promise}
*/ */
updateShipping: function (shippingId, data) { updateShipping: function(shippingId, data) {
var self = this; var self = this;
return new Promise(function (resolve, reject) { return new Promise(function(resolve, reject) {
QUIAjax.post('package_quiqqer_shipping_ajax_backend_update', function (result) { QUIAjax.post('package_quiqqer_shipping_ajax_backend_update', function(result) {
self.$shippings = null; self.$shippings = null;
require([ require([
'package/quiqqer/translator/bin/Translator' 'package/quiqqer/translator/bin/Translator'
], function (Translator) { ], function(Translator) {
Translator.refreshLocale().then(function () { Translator.refreshLocale().then(function() {
self.fireEvent('shippingUpdate', [self, shippingId, result]); self.fireEvent('shippingUpdate', [self, shippingId, result]);
resolve(result); resolve(result);
}); });
}); });
}, { }, {
'package' : 'quiqqer/shipping', 'package': 'quiqqer/shipping',
onError : reject, onError: reject,
shippingId: shippingId, shippingId: shippingId,
data : window.JSON.encode(data) data: window.JSON.encode(data)
}); });
}); });
}, },
...@@ -146,18 +146,18 @@ define('package/quiqqer/shipping/bin/backend/classes/Handler', [ ...@@ -146,18 +146,18 @@ define('package/quiqqer/shipping/bin/backend/classes/Handler', [
* @param {String|Number} shippingId * @param {String|Number} shippingId
* @return {Promise} * @return {Promise}
*/ */
deleteShipping: function (shippingId) { deleteShipping: function(shippingId) {
var self = this; var self = this;
return new Promise(function (resolve, reject) { return new Promise(function(resolve, reject) {
self.$shippings = null; self.$shippings = null;
QUIAjax.post('package_quiqqer_shipping_ajax_backend_delete', function () { QUIAjax.post('package_quiqqer_shipping_ajax_backend_delete', function() {
self.fireEvent('shippingDelete', [self, shippingId]); self.fireEvent('shippingDelete', [self, shippingId]);
resolve(); resolve();
}, { }, {
'package' : 'quiqqer/shipping', 'package': 'quiqqer/shipping',
onError : reject, onError: reject,
shippingId: shippingId shippingId: shippingId
}); });
}); });
...@@ -169,18 +169,18 @@ define('package/quiqqer/shipping/bin/backend/classes/Handler', [ ...@@ -169,18 +169,18 @@ define('package/quiqqer/shipping/bin/backend/classes/Handler', [
* @param {String|Number} shippingId * @param {String|Number} shippingId
* @return {Promise} * @return {Promise}
*/ */
activateShipping: function (shippingId) { activateShipping: function(shippingId) {
var self = this; var self = this;
return new Promise(function (resolve, reject) { return new Promise(function(resolve, reject) {
self.$shippings = null; self.$shippings = null;
QUIAjax.post('package_quiqqer_shipping_ajax_backend_activate', function (result) { QUIAjax.post('package_quiqqer_shipping_ajax_backend_activate', function(result) {
self.fireEvent('shippingActivate', [self, shippingId, result]); self.fireEvent('shippingActivate', [self, shippingId, result]);
resolve(result); resolve(result);
}, { }, {
'package' : 'quiqqer/shipping', 'package': 'quiqqer/shipping',
onError : reject, onError: reject,
shippingId: shippingId shippingId: shippingId
}); });
}); });
...@@ -192,18 +192,18 @@ define('package/quiqqer/shipping/bin/backend/classes/Handler', [ ...@@ -192,18 +192,18 @@ define('package/quiqqer/shipping/bin/backend/classes/Handler', [
* @param {String|Number} shippingId * @param {String|Number} shippingId
* @return {Promise} * @return {Promise}
*/ */
deactivateShipping: function (shippingId) { deactivateShipping: function(shippingId) {
var self = this; var self = this;
return new Promise(function (resolve, reject) { return new Promise(function(resolve, reject) {
self.$shippings = null; self.$shippings = null;
QUIAjax.post('package_quiqqer_shipping_ajax_backend_deactivate', function (result) { QUIAjax.post('package_quiqqer_shipping_ajax_backend_deactivate', function(result) {
self.fireEvent('shippingDeactivate', [self, shippingId, result]); self.fireEvent('shippingDeactivate', [self, shippingId, result]);
resolve(result); resolve(result);
}, { }, {
'package' : 'quiqqer/shipping', 'package': 'quiqqer/shipping',
onError : reject, onError: reject,
shippingId: shippingId shippingId: shippingId
}); });
}); });
......
...@@ -12,30 +12,24 @@ define('package/quiqqer/shipping/bin/backend/classes/ShippingRules', [ ...@@ -12,30 +12,24 @@ define('package/quiqqer/shipping/bin/backend/classes/ShippingRules', [
'qui/classes/DOM', 'qui/classes/DOM',
'Ajax' 'Ajax'
], function (QUI, QUIDOM, QUIAjax) { ], function(QUI, QUIDOM, QUIAjax) {
"use strict"; 'use strict';
return new Class({ return new Class({
Extends: QUIDOM, Extends: QUIDOM,
Type : 'package/quiqqer/shipping/bin/backend/classes/ShippingRules', Type: 'package/quiqqer/shipping/bin/backend/classes/ShippingRules',
/** /**
* Return * Return
* @return {Promise|*} * @return {Promise|*}
*/ */
getList: function (options) { getList: function(options) {
// workaround for https://dev.quiqqer.com/quiqqer/shipping/-/issues/52 return new Promise(function(resolve, reject) {
const optionsWithoutButtons = Object.assign({}, options);
if (typeof optionsWithoutButtons['buttons'] !== 'undefined') {
delete optionsWithoutButtons['buttons'];
}
return new Promise(function (resolve, reject) {
QUIAjax.get('package_quiqqer_shipping_ajax_backend_rules_getList', resolve, { QUIAjax.get('package_quiqqer_shipping_ajax_backend_rules_getList', resolve, {
'package': 'quiqqer/shipping', 'package': 'quiqqer/shipping',
options : JSON.encode(optionsWithoutButtons), options: JSON.encode(options),
onError : reject onError: reject
}); });
}); });
}, },
...@@ -46,17 +40,17 @@ define('package/quiqqer/shipping/bin/backend/classes/ShippingRules', [ ...@@ -46,17 +40,17 @@ define('package/quiqqer/shipping/bin/backend/classes/ShippingRules', [
* @param rules * @param rules
* @return {Promise} * @return {Promise}
*/ */
create: function (rules) { create: function(rules) {
var self = this; var self = this;
return new Promise(function (resolve, reject) { return new Promise(function(resolve, reject) {
QUIAjax.post('package_quiqqer_shipping_ajax_backend_rules_create', function (ruleId) { QUIAjax.post('package_quiqqer_shipping_ajax_backend_rules_create', function(ruleId) {
resolve(ruleId); resolve(ruleId);
self.fireEvent('create', [self, ruleId]); self.fireEvent('create', [self, ruleId]);
}, { }, {
'package': 'quiqqer/shipping', 'package': 'quiqqer/shipping',
rules : JSON.encode(rules), rules: JSON.encode(rules),
onError : reject onError: reject
}); });
}); });
}, },
...@@ -68,18 +62,18 @@ define('package/quiqqer/shipping/bin/backend/classes/ShippingRules', [ ...@@ -68,18 +62,18 @@ define('package/quiqqer/shipping/bin/backend/classes/ShippingRules', [
* @param {Object} data * @param {Object} data
* @return {Promise} * @return {Promise}
*/ */
update: function (ruleId, data) { update: function(ruleId, data) {
var self = this; var self = this;
return new Promise(function (resolve, reject) { return new Promise(function(resolve, reject) {
QUIAjax.post('package_quiqqer_shipping_ajax_backend_rules_update', function () { QUIAjax.post('package_quiqqer_shipping_ajax_backend_rules_update', function() {
resolve(); resolve();
self.fireEvent('update', [self, ruleId]); self.fireEvent('update', [self, ruleId]);
}, { }, {
'package': 'quiqqer/shipping', 'package': 'quiqqer/shipping',
ruleId : ruleId, ruleId: ruleId,
data : JSON.encode(data), data: JSON.encode(data),
onError : reject onError: reject
}); });
}); });
}, },
...@@ -90,17 +84,17 @@ define('package/quiqqer/shipping/bin/backend/classes/ShippingRules', [ ...@@ -90,17 +84,17 @@ define('package/quiqqer/shipping/bin/backend/classes/ShippingRules', [
* @param {Number|Array} ruleIds * @param {Number|Array} ruleIds
* @return {Promise} * @return {Promise}
*/ */
delete: function (ruleIds) { delete: function(ruleIds) {
var self = this; var self = this;
return new Promise(function (resolve, reject) { return new Promise(function(resolve, reject) {
QUIAjax.post('package_quiqqer_shipping_ajax_backend_rules_delete', function () { QUIAjax.post('package_quiqqer_shipping_ajax_backend_rules_delete', function() {
resolve(); resolve();
self.fireEvent('delete', [self, ruleIds]); self.fireEvent('delete', [self, ruleIds]);
}, { }, {
'package': 'quiqqer/shipping', 'package': 'quiqqer/shipping',
ruleIds : JSON.encode(ruleIds), ruleIds: JSON.encode(ruleIds),
onError : reject onError: reject
}); });
}); });
}, },
...@@ -111,12 +105,12 @@ define('package/quiqqer/shipping/bin/backend/classes/ShippingRules', [ ...@@ -111,12 +105,12 @@ define('package/quiqqer/shipping/bin/backend/classes/ShippingRules', [
* @param ruleIds * @param ruleIds
* @return {Promise} * @return {Promise}
*/ */
getRules: function (ruleIds) { getRules: function(ruleIds) {
return new Promise(function (resolve, reject) { return new Promise(function(resolve, reject) {
QUIAjax.get('package_quiqqer_shipping_ajax_backend_rules_getRules', resolve, { QUIAjax.get('package_quiqqer_shipping_ajax_backend_rules_getRules', resolve, {
'package': 'quiqqer/shipping', 'package': 'quiqqer/shipping',
ruleIds : JSON.encode(ruleIds), ruleIds: JSON.encode(ruleIds),
onError : reject onError: reject
}); });
}); });
}, },
...@@ -127,8 +121,8 @@ define('package/quiqqer/shipping/bin/backend/classes/ShippingRules', [ ...@@ -127,8 +121,8 @@ define('package/quiqqer/shipping/bin/backend/classes/ShippingRules', [
* @param {Integer} ruleId * @param {Integer} ruleId
* @return {Promise} * @return {Promise}
*/ */
getRule: function (ruleId) { getRule: function(ruleId) {
return this.getRules([ruleId]).then(function (result) { return this.getRules([ruleId]).then(function(result) {
return result[0]; return result[0];
}); });
}, },
...@@ -137,8 +131,8 @@ define('package/quiqqer/shipping/bin/backend/classes/ShippingRules', [ ...@@ -137,8 +131,8 @@ define('package/quiqqer/shipping/bin/backend/classes/ShippingRules', [
* *
* @return {Promise} * @return {Promise}
*/ */
getShippingRuleUnitFields: function () { getShippingRuleUnitFields: function() {
return new Promise(function (resolve) { return new Promise(function(resolve) {
QUIAjax.get('package_quiqqer_shipping_ajax_backend_rules_settings_getUnitFieldSetting', resolve, { QUIAjax.get('package_quiqqer_shipping_ajax_backend_rules_settings_getUnitFieldSetting', resolve, {
'package': 'quiqqer/shipping' 'package': 'quiqqer/shipping'
}); });
......
...@@ -8,15 +8,15 @@ define('package/quiqqer/shipping/bin/backend/classes/ShippingStatus', [ ...@@ -8,15 +8,15 @@ define('package/quiqqer/shipping/bin/backend/classes/ShippingStatus', [
'qui/classes/DOM', 'qui/classes/DOM',
'Ajax' 'Ajax'
], function (QUI, QUIDOM, QUIAjax) { ], function(QUI, QUIDOM, QUIAjax) {
"use strict"; 'use strict';
return new Class({ return new Class({
Extends: QUIDOM, Extends: QUIDOM,
Type : 'package/quiqqer/shipping/bin/backend/classes/ShippingStatus', Type: 'package/quiqqer/shipping/bin/backend/classes/ShippingStatus',
initialize: function (options) { initialize: function(options) {
this.parent(options); this.parent(options);
}, },
...@@ -25,11 +25,11 @@ define('package/quiqqer/shipping/bin/backend/classes/ShippingStatus', [ ...@@ -25,11 +25,11 @@ define('package/quiqqer/shipping/bin/backend/classes/ShippingStatus', [
* *
* @return {Promise} * @return {Promise}
*/ */
getList: function () { getList: function() {
return new Promise(function (resolve, reject) { return new Promise(function(resolve, reject) {
QUIAjax.get('package_quiqqer_shipping_ajax_backend_shippingStatus_list', resolve, { QUIAjax.get('package_quiqqer_shipping_ajax_backend_shippingStatus_list', resolve, {
'package': 'quiqqer/shipping', 'package': 'quiqqer/shipping',
onError : reject onError: reject
}); });
}); });
}, },
...@@ -39,11 +39,11 @@ define('package/quiqqer/shipping/bin/backend/classes/ShippingStatus', [ ...@@ -39,11 +39,11 @@ define('package/quiqqer/shipping/bin/backend/classes/ShippingStatus', [
* *
* @return {Promise} * @return {Promise}
*/ */
getNextId: function () { getNextId: function() {
return new Promise(function (resolve, reject) { return new Promise(function(resolve, reject) {
QUIAjax.get('package_quiqqer_shipping_ajax_backend_shippingStatus_getNextId', resolve, { QUIAjax.get('package_quiqqer_shipping_ajax_backend_shippingStatus_getNextId', resolve, {
'package': 'quiqqer/shipping', 'package': 'quiqqer/shipping',
onError : reject onError: reject
}); });
}); });
}, },
...@@ -57,23 +57,23 @@ define('package/quiqqer/shipping/bin/backend/classes/ShippingStatus', [ ...@@ -57,23 +57,23 @@ define('package/quiqqer/shipping/bin/backend/classes/ShippingStatus', [
* @param {Boolean} notification * @param {Boolean} notification
* @return {Promise} * @return {Promise}
*/ */
createShippingStatus: function (id, color, title, notification) { createShippingStatus: function(id, color, title, notification) {
return new Promise(function (resolve, reject) { return new Promise(function(resolve, reject) {
QUIAjax.post('package_quiqqer_shipping_ajax_backend_shippingStatus_create', function (result) { QUIAjax.post('package_quiqqer_shipping_ajax_backend_shippingStatus_create', function(result) {
require([ require([
'package/quiqqer/translator/bin/Translator' 'package/quiqqer/translator/bin/Translator'
], function (Translator) { ], function(Translator) {
Translator.refreshLocale().then(function () { Translator.refreshLocale().then(function() {
resolve(result); resolve(result);
}); });
}); });
}, { }, {
'package' : 'quiqqer/shipping', 'package': 'quiqqer/shipping',
id : id, id: id,
color : color, color: color,
title : JSON.encode(title), title: JSON.encode(title),
notification: notification ? 1 : 0, notification: notification ? 1 : 0,
onError : reject onError: reject
}); });
}); });
}, },
...@@ -84,20 +84,20 @@ define('package/quiqqer/shipping/bin/backend/classes/ShippingStatus', [ ...@@ -84,20 +84,20 @@ define('package/quiqqer/shipping/bin/backend/classes/ShippingStatus', [
* @param {String|Number} id - Processing Status ID * @param {String|Number} id - Processing Status ID
* @return {Promise} * @return {Promise}
*/ */
deleteShippingStatus: function (id) { deleteShippingStatus: function(id) {
return new Promise(function (resolve, reject) { return new Promise(function(resolve, reject) {
QUIAjax.post('package_quiqqer_shipping_ajax_backend_shippingStatus_delete', function () { QUIAjax.post('package_quiqqer_shipping_ajax_backend_shippingStatus_delete', function() {
require([ require([
'package/quiqqer/translator/bin/Translator' 'package/quiqqer/translator/bin/Translator'
], function (Translator) { ], function(Translator) {
Translator.refreshLocale().then(function () { Translator.refreshLocale().then(function() {
resolve(); resolve();
}); });
}); });
}, { }, {
'package': 'quiqqer/shipping', 'package': 'quiqqer/shipping',
id : id, id: id,
onError : reject onError: reject
}); });
}); });
}, },
...@@ -108,12 +108,12 @@ define('package/quiqqer/shipping/bin/backend/classes/ShippingStatus', [ ...@@ -108,12 +108,12 @@ define('package/quiqqer/shipping/bin/backend/classes/ShippingStatus', [
* @param {String|Number} id - Processing Status ID * @param {String|Number} id - Processing Status ID
* @return {Promise} * @return {Promise}
*/ */
getShippingStatus: function (id) { getShippingStatus: function(id) {
return new Promise(function (resolve, reject) { return new Promise(function(resolve, reject) {
QUIAjax.post('package_quiqqer_shipping_ajax_backend_shippingStatus_get', resolve, { QUIAjax.post('package_quiqqer_shipping_ajax_backend_shippingStatus_get', resolve, {
'package': 'quiqqer/shipping', 'package': 'quiqqer/shipping',
id : id, id: id,
onError : reject onError: reject
}); });
}); });
}, },
...@@ -127,14 +127,14 @@ define('package/quiqqer/shipping/bin/backend/classes/ShippingStatus', [ ...@@ -127,14 +127,14 @@ define('package/quiqqer/shipping/bin/backend/classes/ShippingStatus', [
* @param {Boolean} notification * @param {Boolean} notification
* @return {Promise} * @return {Promise}
*/ */
updateShippingStatus: function (id, color, title, notification) { updateShippingStatus: function(id, color, title, notification) {
return new Promise(function (resolve, reject) { return new Promise(function(resolve, reject) {
QUIAjax.post('package_quiqqer_shipping_ajax_backend_shippingStatus_update', resolve, { QUIAjax.post('package_quiqqer_shipping_ajax_backend_shippingStatus_update', resolve, {
'package' : 'quiqqer/shipping', 'package': 'quiqqer/shipping',
id : id, id: id,
color : color, color: color,
title : JSON.encode(title), title: JSON.encode(title),
onError : reject, onError: reject,
notification: notification ? 1 : 0 notification: notification ? 1 : 0
}); });
}); });
...@@ -147,13 +147,13 @@ define('package/quiqqer/shipping/bin/backend/classes/ShippingStatus', [ ...@@ -147,13 +147,13 @@ define('package/quiqqer/shipping/bin/backend/classes/ShippingStatus', [
* @param {Number} orderId - shipping ID * @param {Number} orderId - shipping ID
* @return {Promise} * @return {Promise}
*/ */
getNotificationText: function (shippingId, orderId) { getNotificationText: function(shippingId, orderId) {
return new Promise(function (resolve, reject) { return new Promise(function(resolve, reject) {
QUIAjax.get('package_quiqqer_shipping_ajax_backend_shippingStatus_getNotificationText', resolve, { QUIAjax.get('package_quiqqer_shipping_ajax_backend_shippingStatus_getNotificationText', resolve, {
'package' : 'quiqqer/shipping', 'package': 'quiqqer/shipping',
shippingId: shippingId, shippingId: shippingId,
orderId : orderId, orderId: orderId,
onError : reject onError: reject
}); });
}); });
} }
......
Dieser Diff ist reduziert.
...@@ -13,15 +13,15 @@ define('package/quiqqer/shipping/bin/backend/controls/ShippingEntry.List', [ ...@@ -13,15 +13,15 @@ define('package/quiqqer/shipping/bin/backend/controls/ShippingEntry.List', [
'controls/grid/Grid', 'controls/grid/Grid',
'Locale' 'Locale'
], function (QUI, QUIControl, Grid, QUILocale) { ], function(QUI, QUIControl, Grid, QUILocale) {
"use strict"; 'use strict';
const lg = 'quiqqer/shipping'; const lg = 'quiqqer/shipping';
return new Class({ return new Class({
Extends: QUIControl, Extends: QUIControl,
Type : 'package/quiqqer/shipping/bin/backend/controls/ShippingEntry.List', Type: 'package/quiqqer/shipping/bin/backend/controls/ShippingEntry.List',
Binds: [ Binds: [
'$onInject', '$onInject',
...@@ -31,13 +31,13 @@ define('package/quiqqer/shipping/bin/backend/controls/ShippingEntry.List', [ ...@@ -31,13 +31,13 @@ define('package/quiqqer/shipping/bin/backend/controls/ShippingEntry.List', [
options: { options: {
shippingId: false, shippingId: false,
name : 'shipping-rules' name: 'shipping-rules'
}, },
initialize: function (options) { initialize: function(options) {
this.parent(options); this.parent(options);
this.$Grid = null; this.$Grid = null;
this.$Input = null; this.$Input = null;
this.addEvents({ this.addEvents({
...@@ -49,7 +49,7 @@ define('package/quiqqer/shipping/bin/backend/controls/ShippingEntry.List', [ ...@@ -49,7 +49,7 @@ define('package/quiqqer/shipping/bin/backend/controls/ShippingEntry.List', [
* *
* @return {HTMLDivElement} * @return {HTMLDivElement}
*/ */
create: function () { create: function() {
this.$Elm = this.parent(); this.$Elm = this.parent();
this.$Elm.addClass('quiqqer-shipping-rules'); this.$Elm.addClass('quiqqer-shipping-rules');
...@@ -65,12 +65,12 @@ define('package/quiqqer/shipping/bin/backend/controls/ShippingEntry.List', [ ...@@ -65,12 +65,12 @@ define('package/quiqqer/shipping/bin/backend/controls/ShippingEntry.List', [
/** /**
* refresh the input value * refresh the input value
*/ */
refreshInput: function () { refreshInput: function() {
if (!this.$Grid) { if (!this.$Grid) {
return; return;
} }
let value = this.$Grid.getData().map(function (entry) { let value = this.$Grid.getData().map(function(entry) {
return parseInt(entry.id); return parseInt(entry.id);
}); });
...@@ -84,7 +84,7 @@ define('package/quiqqer/shipping/bin/backend/controls/ShippingEntry.List', [ ...@@ -84,7 +84,7 @@ define('package/quiqqer/shipping/bin/backend/controls/ShippingEntry.List', [
* *
* @return {Promise} * @return {Promise}
*/ */
refresh: function () { refresh: function() {
this.fireEvent('refreshBegin', [this]); this.fireEvent('refreshBegin', [this]);
return new Promise((resolve) => { return new Promise((resolve) => {
...@@ -93,7 +93,7 @@ define('package/quiqqer/shipping/bin/backend/controls/ShippingEntry.List', [ ...@@ -93,7 +93,7 @@ define('package/quiqqer/shipping/bin/backend/controls/ShippingEntry.List', [
'package/quiqqer/shipping/bin/backend/ShippingRules', 'package/quiqqer/shipping/bin/backend/ShippingRules',
'package/quiqqer/shipping/bin/backend/utils/ShippingUtils' 'package/quiqqer/shipping/bin/backend/utils/ShippingUtils'
], (Shipping, ShippingRules, Utils) => { ], (Shipping, ShippingRules, Utils) => {
let shippingRules = this.$Grid.getData().map(function (entry) { let shippingRules = this.$Grid.getData().map(function(entry) {
return entry.id; return entry.id;
}); });
...@@ -115,74 +115,81 @@ define('package/quiqqer/shipping/bin/backend/controls/ShippingEntry.List', [ ...@@ -115,74 +115,81 @@ define('package/quiqqer/shipping/bin/backend/controls/ShippingEntry.List', [
/** /**
* event: on inject * event: on inject
*/ */
$onInject: function () { $onInject: function() {
const Container = new Element('div').inject(this.getElm()); const Container = new Element('div').inject(this.getElm());
const width = Container.getSize().x - 5; const width = Container.getSize().x - 5;
this.$Grid = new Grid(Container, { this.$Grid = new Grid(Container, {
height : 300, height: 300,
width : width, width: width,
pagination : false, pagination: false,
buttons : [{ buttons: [
name : 'add', {
text : QUILocale.get('quiqqer/core', 'add'), name: 'add',
textimage: 'fa fa-plus', text: QUILocale.get('quiqqer/core', 'add'),
events : { textimage: 'fa fa-plus',
onClick: this.$openAddDialog events: {
onClick: this.$openAddDialog
}
}, {
name: 'remove',
text: QUILocale.get('quiqqer/system', 'remove'),
textimage: 'fa fa-trash',
disabled: true,
events: {
onClick: this.$openRemoveDialog
}
} }
}, { ],
name : 'remove', columnModel: [
text : QUILocale.get('quiqqer/system', 'remove'), {
textimage: 'fa fa-trash', header: QUILocale.get('quiqqer/system', 'id'),
disabled : true, dataIndex: 'id',
events : { dataType: 'number',
onClick: this.$openRemoveDialog width: 50
}, {
header: QUILocale.get('quiqqer/system', 'priority'),
dataIndex: 'priority',
dataType: 'number',
width: 50
}, {
header: QUILocale.get('quiqqer/system', 'status'),
dataIndex: 'statusNode',
dataType: 'node',
width: 60,
className: 'grid-align-center'
}, {
header: QUILocale.get('quiqqer/system', 'title'),
dataIndex: 'title',
dataType: 'string',
width: 200
} }
}], ]
columnModel: [{
header : QUILocale.get('quiqqer/system', 'id'),
dataIndex: 'id',
dataType : 'number',
width : 50
}, {
header : QUILocale.get('quiqqer/system', 'priority'),
dataIndex: 'priority',
dataType : 'number',
width : 50
}, {
header : QUILocale.get('quiqqer/system', 'status'),
dataIndex: 'statusNode',
dataType : 'node',
width : 60,
className: 'grid-align-center'
}, {
header : QUILocale.get('quiqqer/system', 'title'),
dataIndex: 'title',
dataType : 'string',
width : 200
}]
}); });
this.$Grid.setWidth(width); this.$Grid.setWidth(width);
this.$Grid.addEvents({ this.$Grid.addEvents({
onClick: () => { onClick: () => {
this.$Grid.getButtons().filter(function (Btn) { this.$Grid.getButtons().filter(function(Btn) {
return Btn.getAttribute('name') === 'remove'; return Btn.getAttribute('name') === 'remove';
})[0].enable(); })[0].enable();
}, },
onDblClick: () => { onDblClick: () => {
require(['package/quiqqer/shipping/bin/backend/controls/shippingRules/RuleWindow'], (RuleWindow) => { require(
new RuleWindow({ ['package/quiqqer/shipping/bin/backend/controls/shippingRules/RuleWindow'],
ruleId: this.$Grid.getSelectedData()[0].id, (RuleWindow) => {
events: { new RuleWindow({
onUpdateEnd: () => { ruleId: this.$Grid.getSelectedData()[0].id,
this.refreshInput(); events: {
this.refresh(); onUpdateEnd: () => {
this.refreshInput();
this.refresh();
}
} }
} }).open();
}).open(); }
}); );
} }
}); });
...@@ -200,7 +207,7 @@ define('package/quiqqer/shipping/bin/backend/controls/ShippingEntry.List', [ ...@@ -200,7 +207,7 @@ define('package/quiqqer/shipping/bin/backend/controls/ShippingEntry.List', [
shippingRules = []; shippingRules = [];
} }
let data = shippingRules.map(function (entry) { let data = shippingRules.map(function(entry) {
return { return {
id: entry id: entry
}; };
...@@ -222,14 +229,14 @@ define('package/quiqqer/shipping/bin/backend/controls/ShippingEntry.List', [ ...@@ -222,14 +229,14 @@ define('package/quiqqer/shipping/bin/backend/controls/ShippingEntry.List', [
* *
* @param {Array} shippingRules - list of ids * @param {Array} shippingRules - list of ids
*/ */
addShippingRules: function (shippingRules) { addShippingRules: function(shippingRules) {
return new Promise((resolve) => { return new Promise((resolve) => {
require(['package/quiqqer/shipping/bin/backend/ShippingRules'], (ShippingRules) => { require(['package/quiqqer/shipping/bin/backend/ShippingRules'], (ShippingRules) => {
ShippingRules.getRules(shippingRules).then((rules) => { ShippingRules.getRules(shippingRules).then((rules) => {
const current = QUILocale.getCurrent(), const current = QUILocale.getCurrent(),
currentData = this.$Grid.getData(); currentData = this.$Grid.getData();
const isInCurrentData = function (id) { const isInCurrentData = function(id) {
id = parseInt(id); id = parseInt(id);
for (let i = 0, len = currentData.length; i < len; i++) { for (let i = 0, len = currentData.length; i < len; i++) {
...@@ -241,7 +248,7 @@ define('package/quiqqer/shipping/bin/backend/controls/ShippingEntry.List', [ ...@@ -241,7 +248,7 @@ define('package/quiqqer/shipping/bin/backend/controls/ShippingEntry.List', [
return false; return false;
}; };
rules.forEach(function (v, k) { rules.forEach(function(v, k) {
let title = ''; let title = '';
if (typeof v.title[current] !== 'undefined') { if (typeof v.title[current] !== 'undefined') {
...@@ -276,10 +283,10 @@ define('package/quiqqer/shipping/bin/backend/controls/ShippingEntry.List', [ ...@@ -276,10 +283,10 @@ define('package/quiqqer/shipping/bin/backend/controls/ShippingEntry.List', [
* *
* @param {Array} shippingRuleIds - ids of the shipping rules * @param {Array} shippingRuleIds - ids of the shipping rules
*/ */
removeShippingRules: function (shippingRuleIds) { removeShippingRules: function(shippingRuleIds) {
let data = this.$Grid.getData(); let data = this.$Grid.getData();
data = data.filter(function (entry) { data = data.filter(function(entry) {
return shippingRuleIds.indexOf(entry.id) === -1; return shippingRuleIds.indexOf(entry.id) === -1;
}); });
...@@ -293,7 +300,7 @@ define('package/quiqqer/shipping/bin/backend/controls/ShippingEntry.List', [ ...@@ -293,7 +300,7 @@ define('package/quiqqer/shipping/bin/backend/controls/ShippingEntry.List', [
/** /**
* open rule window to add a rule to the shipping rules * open rule window to add a rule to the shipping rules
*/ */
$openAddDialog: function () { $openAddDialog: function() {
require([ require([
'package/quiqqer/shipping/bin/backend/controls/shippingRules/ShippingRuleListWindow' 'package/quiqqer/shipping/bin/backend/controls/shippingRules/ShippingRuleListWindow'
], (ShippingRuleListWindow) => { ], (ShippingRuleListWindow) => {
...@@ -311,18 +318,18 @@ define('package/quiqqer/shipping/bin/backend/controls/ShippingEntry.List', [ ...@@ -311,18 +318,18 @@ define('package/quiqqer/shipping/bin/backend/controls/ShippingEntry.List', [
* Open the remove dialog * Open the remove dialog
* - The user has the possibility to remove a shipping rule from the shipping entry * - The user has the possibility to remove a shipping rule from the shipping entry
*/ */
$openRemoveDialog: function () { $openRemoveDialog: function() {
const selected = this.$Grid.getSelectedData(); const selected = this.$Grid.getSelectedData();
if (!selected.length) { if (!selected.length) {
return; return;
} }
const shippingIds = selected.map(function (entry) { const shippingIds = selected.map(function(entry) {
return entry.id; return entry.id;
}); });
let idHtml = selected.map(function (entry) { let idHtml = selected.map(function(entry) {
return '<li>#' + entry.id + ' ' + entry.title + '</li>'; return '<li>#' + entry.id + ' ' + entry.title + '</li>';
}); });
...@@ -330,16 +337,16 @@ define('package/quiqqer/shipping/bin/backend/controls/ShippingEntry.List', [ ...@@ -330,16 +337,16 @@ define('package/quiqqer/shipping/bin/backend/controls/ShippingEntry.List', [
require(['qui/controls/windows/Confirm'], (QUIConfirm) => { require(['qui/controls/windows/Confirm'], (QUIConfirm) => {
new QUIConfirm({ new QUIConfirm({
icon : 'fa fa-trash', icon: 'fa fa-trash',
texticon : 'fa fa-trash', texticon: 'fa fa-trash',
title : QUILocale.get(lg, 'window.shipping.entry.remove.rule.title'), title: QUILocale.get(lg, 'window.shipping.entry.remove.rule.title'),
text : QUILocale.get(lg, 'window.shipping.entry.remove.rule.text'), text: QUILocale.get(lg, 'window.shipping.entry.remove.rule.text'),
information: QUILocale.get(lg, 'window.shipping.entry.remove.rule.information', { information: QUILocale.get(lg, 'window.shipping.entry.remove.rule.information', {
ids: idHtml ids: idHtml
}), }),
maxHeight : 300, maxHeight: 300,
maxWidth : 600, maxWidth: 600,
events : { events: {
onSubmit: () => { onSubmit: () => {
this.removeShippingRules(shippingIds); this.removeShippingRules(shippingIds);
} }
......
Dieser Diff ist reduziert.
...@@ -11,26 +11,26 @@ define('package/quiqqer/shipping/bin/backend/controls/ShippingRules', [ ...@@ -11,26 +11,26 @@ define('package/quiqqer/shipping/bin/backend/controls/ShippingRules', [
'package/quiqqer/shipping/bin/backend/controls/shippingRules/ShippingRuleList', 'package/quiqqer/shipping/bin/backend/controls/shippingRules/ShippingRuleList',
'Locale' 'Locale'
], function (QUI, QUIPanel, ShippingRuleList, QUILocale) { ], function(QUI, QUIPanel, ShippingRuleList, QUILocale) {
"use strict"; 'use strict';
var lg = 'quiqqer/shipping'; var lg = 'quiqqer/shipping';
return new Class({ return new Class({
Extends: QUIPanel, Extends: QUIPanel,
Type : 'package/quiqqer/shipping/bin/backend/controls/ShippingRules', Type: 'package/quiqqer/shipping/bin/backend/controls/ShippingRules',
Binds: [ Binds: [
'$onCreate', '$onCreate',
'$onInject' '$onInject'
], ],
initialize: function (options) { initialize: function(options) {
this.parent(options); this.parent(options);
this.setAttributes({ this.setAttributes({
icon : 'fa fa-truck', icon: 'fa fa-truck',
title: QUILocale.get(lg, 'menu.erp.shipping.rules.title') title: QUILocale.get(lg, 'menu.erp.shipping.rules.title')
}); });
...@@ -39,23 +39,23 @@ define('package/quiqqer/shipping/bin/backend/controls/ShippingRules', [ ...@@ -39,23 +39,23 @@ define('package/quiqqer/shipping/bin/backend/controls/ShippingRules', [
this.addEvents({ this.addEvents({
onCreate: this.$onCreate, onCreate: this.$onCreate,
onInject: this.$onInject, onInject: this.$onInject,
onShow : this.$onInject onShow: this.$onInject
}); });
}, },
/** /**
* event: on create * event: on create
*/ */
$onCreate: function () { $onCreate: function() {
var self = this; var self = this;
this.$List = new ShippingRuleList({ this.$List = new ShippingRuleList({
events: { events: {
onRefreshBegin: function () { onRefreshBegin: function() {
self.Loader.show(); self.Loader.show();
}, },
onRefreshEnd: function () { onRefreshEnd: function() {
self.Loader.hide(); self.Loader.hide();
} }
} }
...@@ -65,8 +65,8 @@ define('package/quiqqer/shipping/bin/backend/controls/ShippingRules', [ ...@@ -65,8 +65,8 @@ define('package/quiqqer/shipping/bin/backend/controls/ShippingRules', [
/** /**
* event: on resize * event: on resize
*/ */
$onInject: function () { $onInject: function() {
(function () { (function() {
this.$List.resize(); this.$List.resize();
}).delay(200, this); }).delay(200, this);
} }
......
...@@ -11,20 +11,20 @@ define('package/quiqqer/shipping/bin/backend/controls/ShippingSelect', [ ...@@ -11,20 +11,20 @@ define('package/quiqqer/shipping/bin/backend/controls/ShippingSelect', [
'css!package/quiqqer/shipping/bin/backend/controls/ShippingSelect.css' 'css!package/quiqqer/shipping/bin/backend/controls/ShippingSelect.css'
], function (QUI, QUIElementSelect, Handler, QUILocale) { ], function(QUI, QUIElementSelect, Handler, QUILocale) {
"use strict"; 'use strict';
return new Class({ return new Class({
Extends: QUIElementSelect, Extends: QUIElementSelect,
Type : 'package/quiqqer/shipping/bin/backend/controls/ShippingSelect', Type: 'package/quiqqer/shipping/bin/backend/controls/ShippingSelect',
Binds: [ Binds: [
'$onCreate', '$onCreate',
'$onSearchButtonClick' '$onSearchButtonClick'
], ],
initialize: function (options) { initialize: function(options) {
this.parent(options); this.parent(options);
this.setAttribute('icon', 'fa fa-truck'); this.setAttribute('icon', 'fa fa-truck');
...@@ -38,14 +38,14 @@ define('package/quiqqer/shipping/bin/backend/controls/ShippingSelect', [ ...@@ -38,14 +38,14 @@ define('package/quiqqer/shipping/bin/backend/controls/ShippingSelect', [
this.addEvents({ this.addEvents({
onSearchButtonClick: this.$onSearchButtonClick, onSearchButtonClick: this.$onSearchButtonClick,
onCreate : this.$onCreate onCreate: this.$onCreate
}); });
}, },
/** /**
* Event: onCreate * Event: onCreate
*/ */
$onCreate: function () { $onCreate: function() {
this.getElm().getParent().addClass('quiqqer-shipping-select'); this.getElm().getParent().addClass('quiqqer-shipping-select');
}, },
...@@ -55,16 +55,16 @@ define('package/quiqqer/shipping/bin/backend/controls/ShippingSelect', [ ...@@ -55,16 +55,16 @@ define('package/quiqqer/shipping/bin/backend/controls/ShippingSelect', [
* @param {Object} self - select object * @param {Object} self - select object
* @param {Object} Btn - button object * @param {Object} Btn - button object
*/ */
$onSearchButtonClick: function (self, Btn) { $onSearchButtonClick: function(self, Btn) {
Btn.setAttribute('icon', 'fa fa-spinner fa-spin'); Btn.setAttribute('icon', 'fa fa-spinner fa-spin');
require(['package/quiqqer/shipping/bin/backend/controls/search/Shipping/Window'], (Window) => { require(['package/quiqqer/shipping/bin/backend/controls/search/Shipping/Window'], (Window) => {
new Window({ new Window({
autoclose: true, autoclose: true,
multiple : this.getAttribute('multiple'), multiple: this.getAttribute('multiple'),
events : { events: {
onSubmit: (Win, data) => { onSubmit: (Win, data) => {
data = data.map(function (Entry) { data = data.map(function(Entry) {
return parseInt(Entry.id); return parseInt(Entry.id);
}); });
......
...@@ -8,19 +8,19 @@ define('package/quiqqer/shipping/bin/backend/controls/ShippingSelectItem', [ ...@@ -8,19 +8,19 @@ define('package/quiqqer/shipping/bin/backend/controls/ShippingSelectItem', [
'qui/controls/elements/SelectItem', 'qui/controls/elements/SelectItem',
'package/quiqqer/shipping/bin/backend/Shipping' 'package/quiqqer/shipping/bin/backend/Shipping'
], function (QUI, QUIElementSelectItem, Handler) { ], function(QUI, QUIElementSelectItem, Handler) {
"use strict"; 'use strict';
return new Class({ return new Class({
Extends: QUIElementSelectItem, Extends: QUIElementSelectItem,
Type : 'package/quiqqer/shipping/bin/backend/controls/ShippingSelectItem', Type: 'package/quiqqer/shipping/bin/backend/controls/ShippingSelectItem',
Binds: [ Binds: [
'refresh' 'refresh'
], ],
initialize: function (options) { initialize: function(options) {
this.parent(options); this.parent(options);
this.setAttribute('icon', 'fa fa-truck'); this.setAttribute('icon', 'fa fa-truck');
...@@ -31,10 +31,10 @@ define('package/quiqqer/shipping/bin/backend/controls/ShippingSelectItem', [ ...@@ -31,10 +31,10 @@ define('package/quiqqer/shipping/bin/backend/controls/ShippingSelectItem', [
* *
* @returns {Promise} * @returns {Promise}
*/ */
refresh: function () { refresh: function() {
var self = this; var self = this;
return Handler.getShippingEntry(this.getAttribute('id')).then(function (Shipping) { return Handler.getShippingEntry(this.getAttribute('id')).then(function(Shipping) {
self.$Text.set({ self.$Text.set({
html: Shipping.currentTitle html: Shipping.currentTitle
}); });
......
...@@ -10,8 +10,8 @@ define('package/quiqqer/shipping/bin/backend/controls/ShippingWindow', [ ...@@ -10,8 +10,8 @@ define('package/quiqqer/shipping/bin/backend/controls/ShippingWindow', [
'controls/grid/Grid', 'controls/grid/Grid',
'Locale' 'Locale'
], function (QUI, QUIConfirm, Shipping, Grid, QUILocale) { ], function(QUI, QUIConfirm, Shipping, Grid, QUILocale) {
"use strict"; 'use strict';
const lg = 'quiqqer/shipping'; const lg = 'quiqqer/shipping';
const current = QUILocale.getCurrent(); const current = QUILocale.getCurrent();
...@@ -19,7 +19,7 @@ define('package/quiqqer/shipping/bin/backend/controls/ShippingWindow', [ ...@@ -19,7 +19,7 @@ define('package/quiqqer/shipping/bin/backend/controls/ShippingWindow', [
return new Class({ return new Class({
Extends: QUIConfirm, Extends: QUIConfirm,
Type : 'package/quiqqer/shipping/bin/backend/controls/ShippingWindow', Type: 'package/quiqqer/shipping/bin/backend/controls/ShippingWindow',
Binds: [ Binds: [
'$onOpen', '$onOpen',
...@@ -31,14 +31,14 @@ define('package/quiqqer/shipping/bin/backend/controls/ShippingWindow', [ ...@@ -31,14 +31,14 @@ define('package/quiqqer/shipping/bin/backend/controls/ShippingWindow', [
Order: null Order: null
}, },
initialize: function (options) { initialize: function(options) {
this.parent(options); this.parent(options);
this.setAttributes({ this.setAttributes({
title : QUILocale.get(lg, 'shipping.window.title'), title: QUILocale.get(lg, 'shipping.window.title'),
icon : 'fa fa-truck', icon: 'fa fa-truck',
maxHeight: 560, maxHeight: 560,
maxWidth : 500, maxWidth: 500
}); });
this.$Grid = null; this.$Grid = null;
...@@ -48,7 +48,7 @@ define('package/quiqqer/shipping/bin/backend/controls/ShippingWindow', [ ...@@ -48,7 +48,7 @@ define('package/quiqqer/shipping/bin/backend/controls/ShippingWindow', [
}); });
}, },
refresh: function () { refresh: function() {
if (!this.$Elm) { if (!this.$Elm) {
return; return;
} }
...@@ -56,10 +56,10 @@ define('package/quiqqer/shipping/bin/backend/controls/ShippingWindow', [ ...@@ -56,10 +56,10 @@ define('package/quiqqer/shipping/bin/backend/controls/ShippingWindow', [
this.Loader.show(); this.Loader.show();
Shipping.getShippingList().then((result) => { Shipping.getShippingList().then((result) => {
const toggle = function (Btn) { const toggle = function(Btn) {
let data = Btn.getAttribute('data'), let data = Btn.getAttribute('data'),
shippingId = data.id, shippingId = data.id,
status = parseInt(data.active); status = parseInt(data.active);
Btn.setAttribute('icon', 'fa fa-spinner fa-spin'); Btn.setAttribute('icon', 'fa fa-spinner fa-spin');
...@@ -74,11 +74,11 @@ define('package/quiqqer/shipping/bin/backend/controls/ShippingWindow', [ ...@@ -74,11 +74,11 @@ define('package/quiqqer/shipping/bin/backend/controls/ShippingWindow', [
for (let i = 0, len = result.length; i < len; i++) { for (let i = 0, len = result.length; i < len; i++) {
if (parseInt(result[i].active)) { if (parseInt(result[i].active)) {
result[i].status = { result[i].status = {
icon : 'fa fa-check', icon: 'fa fa-check',
styles: { styles: {
lineHeight: 20, lineHeight: 20,
padding : 0, padding: 0,
width : 20 width: 20
}, },
events: { events: {
onClick: toggle onClick: toggle
...@@ -86,18 +86,18 @@ define('package/quiqqer/shipping/bin/backend/controls/ShippingWindow', [ ...@@ -86,18 +86,18 @@ define('package/quiqqer/shipping/bin/backend/controls/ShippingWindow', [
}; };
} else { } else {
result[i].status = { result[i].status = {
icon : 'fa fa-remove', icon: 'fa fa-remove',
styles: { styles: {
lineHeight: 20, lineHeight: 20,
padding : 0, padding: 0,
width : 20 width: 20
}, },
events: { events: {
onClick: toggle onClick: toggle
} }
}; };
} }
result[i].shippingType_display = ''; result[i].shippingType_display = '';
if (typeOf(result[i].title) !== 'string') { if (typeOf(result[i].title) !== 'string') {
...@@ -108,7 +108,7 @@ define('package/quiqqer/shipping/bin/backend/controls/ShippingWindow', [ ...@@ -108,7 +108,7 @@ define('package/quiqqer/shipping/bin/backend/controls/ShippingWindow', [
result[i].workingTitle = result[i].workingTitle[current]; result[i].workingTitle = result[i].workingTitle[current];
} }
if ("shippingType" in result[i] && result[i].shippingType) { if ('shippingType' in result[i] && result[i].shippingType) {
result[i].shippingType_display = result[i].shippingType.title; result[i].shippingType_display = result[i].shippingType.title;
} }
} }
...@@ -125,71 +125,71 @@ define('package/quiqqer/shipping/bin/backend/controls/ShippingWindow', [ ...@@ -125,71 +125,71 @@ define('package/quiqqer/shipping/bin/backend/controls/ShippingWindow', [
}); });
}, },
$onOpen: function () { $onOpen: function() {
this.Loader.show(); this.Loader.show();
this.getContent().set('html', ''); this.getContent().set('html', '');
const Container = new Element('div', { const Container = new Element('div', {
styles: { styles: {
height: '100%', height: '100%',
width : '100%' width: '100%'
} }
}).inject(this.getContent()); }).inject(this.getContent());
this.$Grid = new Grid(Container, { this.$Grid = new Grid(Container, {
columnModel: [ columnModel: [
{ {
header : QUILocale.get('quiqqer/system', 'priority'), header: QUILocale.get('quiqqer/system', 'priority'),
dataIndex: 'priority', dataIndex: 'priority',
dataType : 'number', dataType: 'number',
width : 50 width: 50
}, },
{ {
header : QUILocale.get('quiqqer/system', 'status'), header: QUILocale.get('quiqqer/system', 'status'),
dataIndex: 'status', dataIndex: 'status',
dataType : 'button', dataType: 'button',
width : 60 width: 60
}, },
{ {
header : QUILocale.get('quiqqer/system', 'title'), header: QUILocale.get('quiqqer/system', 'title'),
dataIndex: 'title', dataIndex: 'title',
dataType : 'string', dataType: 'string',
width : 200 width: 200
}, },
{ {
header : QUILocale.get('quiqqer/system', 'workingtitle'), header: QUILocale.get('quiqqer/system', 'workingtitle'),
dataIndex: 'workingTitle', dataIndex: 'workingTitle',
dataType : 'string', dataType: 'string',
width : 200 width: 200
}, },
{ {
header : QUILocale.get('quiqqer/system', 'id'), header: QUILocale.get('quiqqer/system', 'id'),
dataIndex: 'id', dataIndex: 'id',
dataType : 'number', dataType: 'number',
width : 30 width: 30
}, },
{ {
header : QUILocale.get(lg, 'shipping.type'), header: QUILocale.get(lg, 'shipping.type'),
dataIndex: 'shippingType_display', dataIndex: 'shippingType_display',
dataType : 'string', dataType: 'string',
width : 200 width: 200
} }
] ]
}); });
this.$Grid.addEvents({ this.$Grid.addEvents({
onRefresh : this.refresh, onRefresh: this.refresh,
onDblClick: this.$onDblClick onDblClick: this.$onDblClick
}); });
this.refresh(); this.refresh();
}, },
$onDblClick: function () { $onDblClick: function() {
this.submit(); this.submit();
}, },
submit: function () { submit: function() {
const data = this.$Grid.getSelectedData(); const data = this.$Grid.getSelectedData();
if (!data.length) { if (!data.length) {
......
...@@ -11,20 +11,20 @@ define('package/quiqqer/shipping/bin/backend/controls/TrackingInput', [ ...@@ -11,20 +11,20 @@ define('package/quiqqer/shipping/bin/backend/controls/TrackingInput', [
'css!package/quiqqer/shipping/bin/backend/controls/TrackingInput.css' 'css!package/quiqqer/shipping/bin/backend/controls/TrackingInput.css'
], function (QUI, QUIControl, QUISelect, QUIAjax) { ], function(QUI, QUIControl, QUISelect, QUIAjax) {
"use strict"; 'use strict';
return new Class({ return new Class({
Extends: QUIControl, Extends: QUIControl,
Type : 'package/quiqqer/shipping/bin/backend/controls/TrackingInput', Type: 'package/quiqqer/shipping/bin/backend/controls/TrackingInput',
Binds: [ Binds: [
'$onImport', '$onImport',
'$onChange' '$onChange'
], ],
initialize: function (options) { initialize: function(options) {
this.parent(options); this.parent(options);
this.$value = null; this.$value = null;
...@@ -34,7 +34,7 @@ define('package/quiqqer/shipping/bin/backend/controls/TrackingInput', [ ...@@ -34,7 +34,7 @@ define('package/quiqqer/shipping/bin/backend/controls/TrackingInput', [
}); });
}, },
$onImport: function () { $onImport: function() {
this.$Value = this.$Elm; this.$Value = this.$Elm;
this.$Value.setStyle('display', 'none'); this.$Value.setStyle('display', 'none');
...@@ -79,7 +79,7 @@ define('package/quiqqer/shipping/bin/backend/controls/TrackingInput', [ ...@@ -79,7 +79,7 @@ define('package/quiqqer/shipping/bin/backend/controls/TrackingInput', [
* *
* @returns {Promise} * @returns {Promise}
*/ */
getTrackingList: function () { getTrackingList: function() {
return new Promise((resolve) => { return new Promise((resolve) => {
QUIAjax.get('package_quiqqer_shipping_ajax_backend_tracking_getList', resolve, { QUIAjax.get('package_quiqqer_shipping_ajax_backend_tracking_getList', resolve, {
'package': 'quiqqer/shipping' 'package': 'quiqqer/shipping'
...@@ -87,17 +87,17 @@ define('package/quiqqer/shipping/bin/backend/controls/TrackingInput', [ ...@@ -87,17 +87,17 @@ define('package/quiqqer/shipping/bin/backend/controls/TrackingInput', [
}); });
}, },
$onChange: function () { $onChange: function() {
const tracking = this.$TrackingType.getValue(); const tracking = this.$TrackingType.getValue();
const trackingNumber = this.$Input.value; const trackingNumber = this.$Input.value;
this.$Value.set('value', JSON.encode({ this.$Value.set('value', JSON.encode({
type : tracking, type: tracking,
number: trackingNumber number: trackingNumber
})); }));
}, },
setValue: function (value) { setValue: function(value) {
if (typeof value === 'string') { if (typeof value === 'string') {
value = JSON.decode(value); value = JSON.decode(value);
} }
......
...@@ -10,14 +10,14 @@ define('package/quiqqer/shipping/bin/backend/controls/products/fields/ShippingTi ...@@ -10,14 +10,14 @@ define('package/quiqqer/shipping/bin/backend/controls/products/fields/ShippingTi
'css!package/quiqqer/shipping/bin/backend/controls/products/fields/ShippingTimePeriod.css' 'css!package/quiqqer/shipping/bin/backend/controls/products/fields/ShippingTimePeriod.css'
], function (QUI, TimePeriod, QUILocale) { ], function(QUI, TimePeriod, QUILocale) {
"use strict"; 'use strict';
var lg = 'quiqqer/shipping'; var lg = 'quiqqer/shipping';
return new Class({ return new Class({
Extends: TimePeriod, Extends: TimePeriod,
Type : 'package/quiqqer/shipping/bin/backend/controls/products/fields/ShippingTimePeriod', Type: 'package/quiqqer/shipping/bin/backend/controls/products/fields/ShippingTimePeriod',
Binds: [ Binds: [
'$onImport', '$onImport',
...@@ -36,13 +36,13 @@ define('package/quiqqer/shipping/bin/backend/controls/products/fields/ShippingTi ...@@ -36,13 +36,13 @@ define('package/quiqqer/shipping/bin/backend/controls/products/fields/ShippingTi
show_default_option: true show_default_option: true
}, },
initialize: function (options) { initialize: function(options) {
this.parent(options); this.parent(options);
this.$OptionsSelect = null; this.$OptionsSelect = null;
this.$CustomTextContainer = null; this.$CustomTextContainer = null;
this.$CustomTextInput = null; this.$CustomTextInput = null;
this.$CustomText = null; this.$CustomText = null;
this.addEvents({ this.addEvents({
onImport: this.$onImport onImport: this.$onImport
...@@ -52,9 +52,9 @@ define('package/quiqqer/shipping/bin/backend/controls/products/fields/ShippingTi ...@@ -52,9 +52,9 @@ define('package/quiqqer/shipping/bin/backend/controls/products/fields/ShippingTi
/** /**
* Event: onImport * Event: onImport
*/ */
$onImport: function () { $onImport: function() {
var self = this, var self = this,
Elm = this.getElm(), Elm = this.getElm(),
Value = false; Value = false;
this.parent(); this.parent();
...@@ -65,13 +65,13 @@ define('package/quiqqer/shipping/bin/backend/controls/products/fields/ShippingTi ...@@ -65,13 +65,13 @@ define('package/quiqqer/shipping/bin/backend/controls/products/fields/ShippingTi
}).inject(this.$Content, 'top'); }).inject(this.$Content, 'top');
this.$OptionsSelect = new Element('select', { this.$OptionsSelect = new Element('select', {
name : 'option', name: 'option',
events: { events: {
change: this.$onOptionSelectChange change: this.$onOptionSelectChange
} }
}).inject(OptionsContainer); }).inject(OptionsContainer);
var options = this.getAttribute('selectOptions'), var options = this.getAttribute('selectOptions'),
lgPrefix = 'controls.products.fields.ShippingTimePeriod.'; lgPrefix = 'controls.products.fields.ShippingTimePeriod.';
if (this.getAttribute('show_default_option')) { if (this.getAttribute('show_default_option')) {
...@@ -83,30 +83,30 @@ define('package/quiqqer/shipping/bin/backend/controls/products/fields/ShippingTi ...@@ -83,30 +83,30 @@ define('package/quiqqer/shipping/bin/backend/controls/products/fields/ShippingTi
new Element('option', { new Element('option', {
value: option, value: option,
html : QUILocale.get(lg, lgPrefix + 'option.' + option) html: QUILocale.get(lg, lgPrefix + 'option.' + option)
}).inject(this.$OptionsSelect); }).inject(this.$OptionsSelect);
} }
// Custom text input // Custom text input
this.$CustomTextContainer = new Element('div', { this.$CustomTextContainer = new Element('div', {
'class': 'quiqqer-shipping-fields-shippingtimeperiod-customtext quiqqer-shipping-fields-shippingtimeperiod__hidden', 'class': 'quiqqer-shipping-fields-shippingtimeperiod-customtext quiqqer-shipping-fields-shippingtimeperiod__hidden'
}).inject( }).inject(
Elm.getParent().getElement('.quiqqer-products-fields-types-timeperiod') Elm.getParent().getElement('.quiqqer-products-fields-types-timeperiod')
); );
var CustomTextInput = new Element('input', { var CustomTextInput = new Element('input', {
type : 'text', type: 'text',
'data-qui': 'package/quiqqer/products/bin/controls/fields/types/InputMultiLang' 'data-qui': 'package/quiqqer/products/bin/controls/fields/types/InputMultiLang'
}).inject(this.$CustomTextContainer); }).inject(this.$CustomTextContainer);
QUI.parse(this.$CustomTextContainer).then(function () { QUI.parse(this.$CustomTextContainer).then(function() {
self.$CustomText = QUI.Controls.getById( self.$CustomText = QUI.Controls.getById(
CustomTextInput.get('data-quiid') CustomTextInput.get('data-quiid')
); );
self.$CustomText.getElm().getElements('input').addEvent('change', self.$onOptionSelectChange); self.$CustomText.getElm().getElements('input').addEvent('change', self.$onOptionSelectChange);
(function () { (function() {
if (!Elm.value) { if (!Elm.value) {
self.$OptionsSelect.value = 'timeperiod'; self.$OptionsSelect.value = 'timeperiod';
return; return;
...@@ -127,7 +127,7 @@ define('package/quiqqer/shipping/bin/backend/controls/products/fields/ShippingTi ...@@ -127,7 +127,7 @@ define('package/quiqqer/shipping/bin/backend/controls/products/fields/ShippingTi
/** /**
* Executed if an option is selected * Executed if an option is selected
*/ */
$onOptionSelectChange: function () { $onOptionSelectChange: function() {
var option = this.$OptionsSelect.value; var option = this.$OptionsSelect.value;
if (option === 'timeperiod') { if (option === 'timeperiod') {
...@@ -152,7 +152,7 @@ define('package/quiqqer/shipping/bin/backend/controls/products/fields/ShippingTi ...@@ -152,7 +152,7 @@ define('package/quiqqer/shipping/bin/backend/controls/products/fields/ShippingTi
/** /**
* Set field value to input * Set field value to input
*/ */
$setValue: function () { $setValue: function() {
var customText = this.$CustomText.getValue().trim(); var customText = this.$CustomText.getValue().trim();
if (customText !== '') { if (customText !== '') {
...@@ -160,11 +160,11 @@ define('package/quiqqer/shipping/bin/backend/controls/products/fields/ShippingTi ...@@ -160,11 +160,11 @@ define('package/quiqqer/shipping/bin/backend/controls/products/fields/ShippingTi
} }
this.getElm().value = JSON.encode({ this.getElm().value = JSON.encode({
from : this.$FromInput.value.trim(), from: this.$FromInput.value.trim(),
to : this.$ToInput.value.trim(), to: this.$ToInput.value.trim(),
unit : this.$UnitSelect.value, unit: this.$UnitSelect.value,
option: this.$OptionsSelect.value, option: this.$OptionsSelect.value,
text : customText text: customText
}); });
}, },
...@@ -173,7 +173,7 @@ define('package/quiqqer/shipping/bin/backend/controls/products/fields/ShippingTi ...@@ -173,7 +173,7 @@ define('package/quiqqer/shipping/bin/backend/controls/products/fields/ShippingTi
* *
* @returns {Object} * @returns {Object}
*/ */
getValue: function () { getValue: function() {
var customText = this.$CustomText.getValue().trim(); var customText = this.$CustomText.getValue().trim();
if (customText !== '') { if (customText !== '') {
...@@ -181,11 +181,11 @@ define('package/quiqqer/shipping/bin/backend/controls/products/fields/ShippingTi ...@@ -181,11 +181,11 @@ define('package/quiqqer/shipping/bin/backend/controls/products/fields/ShippingTi
} }
return { return {
from : this.$FromInput.value.trim(), from: this.$FromInput.value.trim(),
to : this.$ToInput.value.trim(), to: this.$ToInput.value.trim(),
unit : this.$UnitSelect.value, unit: this.$UnitSelect.value,
option: this.$OptionsSelect.value, option: this.$OptionsSelect.value,
text : customText text: customText
}; };
} }
}); });
......
...@@ -15,14 +15,14 @@ define('package/quiqqer/shipping/bin/backend/controls/search/Shipping/Result', [ ...@@ -15,14 +15,14 @@ define('package/quiqqer/shipping/bin/backend/controls/search/Shipping/Result', [
'controls/grid/Grid', 'controls/grid/Grid',
'Locale' 'Locale'
], function (QUI, QUIControl, QUIButton, Grid, QUILocale) { ], function(QUI, QUIControl, QUIButton, Grid, QUILocale) {
"use strict"; 'use strict';
var lg = 'quiqqer/shipping'; var lg = 'quiqqer/shipping';
return new Class({ return new Class({
Extends: QUIControl, Extends: QUIControl,
Type : 'package/quiqqer/shipping/bin/backend/controls/search/Shipping/Result', Type: 'package/quiqqer/shipping/bin/backend/controls/search/Shipping/Result',
Binds: [ Binds: [
'$onInject' '$onInject'
...@@ -32,7 +32,7 @@ define('package/quiqqer/shipping/bin/backend/controls/search/Shipping/Result', [ ...@@ -32,7 +32,7 @@ define('package/quiqqer/shipping/bin/backend/controls/search/Shipping/Result', [
multipleSelection: true multipleSelection: true
}, },
initialize: function (options) { initialize: function(options) {
this.parent(options); this.parent(options);
this.$Grid = null; this.$Grid = null;
...@@ -46,51 +46,53 @@ define('package/quiqqer/shipping/bin/backend/controls/search/Shipping/Result', [ ...@@ -46,51 +46,53 @@ define('package/quiqqer/shipping/bin/backend/controls/search/Shipping/Result', [
* Return the DOMNode Element * Return the DOMNode Element
* @returns {HTMLDivElement} * @returns {HTMLDivElement}
*/ */
create: function () { create: function() {
var Elm = this.parent(); var Elm = this.parent();
Elm.set('html', ''); Elm.set('html', '');
Elm.setStyles({ Elm.setStyles({
'float' : 'left', 'float': 'left',
'height': '100%', 'height': '100%',
'width' : '100%' 'width': '100%'
}); });
var Container = new Element('div').inject(Elm); var Container = new Element('div').inject(Elm);
this.$Grid = new Grid(Container, { this.$Grid = new Grid(Container, {
filterInput : true, filterInput: true,
multipleSelection: this.getAttribute('multipleSelection'), multipleSelection: this.getAttribute('multipleSelection'),
columnModel : [{ columnModel: [
header : QUILocale.get('quiqqer/system', 'id'), {
dataIndex: 'id', header: QUILocale.get('quiqqer/system', 'id'),
dataType : 'number', dataIndex: 'id',
width : 30 dataType: 'number',
}, { width: 30
header : QUILocale.get('quiqqer/system', 'priority'), }, {
dataIndex: 'priority', header: QUILocale.get('quiqqer/system', 'priority'),
dataType : 'number', dataIndex: 'priority',
width : 50 dataType: 'number',
}, { width: 50
header : QUILocale.get('quiqqer/system', 'title'), }, {
dataIndex: 'currentTitle', header: QUILocale.get('quiqqer/system', 'title'),
dataType : 'string', dataIndex: 'currentTitle',
width : 200 dataType: 'string',
}, { width: 200
header : QUILocale.get('quiqqer/system', 'workingtitle'), }, {
dataIndex: 'currentWorkingTitle', header: QUILocale.get('quiqqer/system', 'workingtitle'),
dataType : 'string', dataIndex: 'currentWorkingTitle',
width : 200 dataType: 'string',
}, { width: 200
header : QUILocale.get(lg, 'shipping.type'), }, {
dataIndex: 'shippingType_display', header: QUILocale.get(lg, 'shipping.type'),
dataType : 'string', dataIndex: 'shippingType_display',
width : 200 dataType: 'string',
}] width: 200
}
]
}); });
this.$Grid.addEvent('onDblClick', function () { this.$Grid.addEvent('onDblClick', function() {
this.fireEvent('dblClick', [this]); this.fireEvent('dblClick', [this]);
}.bind(this)); }.bind(this));
...@@ -100,7 +102,7 @@ define('package/quiqqer/shipping/bin/backend/controls/search/Shipping/Result', [ ...@@ -100,7 +102,7 @@ define('package/quiqqer/shipping/bin/backend/controls/search/Shipping/Result', [
/** /**
* event : on inject * event : on inject
*/ */
$onInject: function () { $onInject: function() {
this.fireEvent('loaded'); this.fireEvent('loaded');
}, },
...@@ -109,13 +111,13 @@ define('package/quiqqer/shipping/bin/backend/controls/search/Shipping/Result', [ ...@@ -109,13 +111,13 @@ define('package/quiqqer/shipping/bin/backend/controls/search/Shipping/Result', [
* *
* @param {Object} data - grid data * @param {Object} data - grid data
*/ */
setData: function (data) { setData: function(data) {
if (!this.$Grid) { if (!this.$Grid) {
return; return;
} }
for (var i = 0, len = data.length; i < len; i++) { for (var i = 0, len = data.length; i < len; i++) {
if ("shippingType" in data[i] && data[i].shippingType) { if ('shippingType' in data[i] && data[i].shippingType) {
data[i].shippingType_display = data[i].shippingType.title; data[i].shippingType_display = data[i].shippingType.title;
} }
} }
...@@ -130,7 +132,7 @@ define('package/quiqqer/shipping/bin/backend/controls/search/Shipping/Result', [ ...@@ -130,7 +132,7 @@ define('package/quiqqer/shipping/bin/backend/controls/search/Shipping/Result', [
* *
* @returns {Array} * @returns {Array}
*/ */
getSelected: function () { getSelected: function() {
if (!this.$Grid) { if (!this.$Grid) {
return []; return [];
} }
...@@ -143,7 +145,7 @@ define('package/quiqqer/shipping/bin/backend/controls/search/Shipping/Result', [ ...@@ -143,7 +145,7 @@ define('package/quiqqer/shipping/bin/backend/controls/search/Shipping/Result', [
* *
* @return {Promise} * @return {Promise}
*/ */
resize: function () { resize: function() {
var size = this.getElm().getSize(); var size = this.getElm().getSize();
this.$Grid.setWidth(size.x); this.$Grid.setWidth(size.x);
......
...@@ -14,15 +14,15 @@ define('package/quiqqer/shipping/bin/backend/controls/search/Shipping/Window', [ ...@@ -14,15 +14,15 @@ define('package/quiqqer/shipping/bin/backend/controls/search/Shipping/Window', [
'css!package/quiqqer/shipping/bin/backend/controls/search/Shipping/Window.css' 'css!package/quiqqer/shipping/bin/backend/controls/search/Shipping/Window.css'
], function (QUI, QUIControl, QUIConfirm, Handler, QUILocale) { ], function(QUI, QUIControl, QUIConfirm, Handler, QUILocale) {
"use strict"; 'use strict';
var lg = 'quiqqer/shipping'; var lg = 'quiqqer/shipping';
return new Class({ return new Class({
Extends: QUIConfirm, Extends: QUIConfirm,
Type : 'package/quiqqer/shipping/bin/backend/controls/search/Shipping/Window', Type: 'package/quiqqer/shipping/bin/backend/controls/search/Shipping/Window',
Binds: [ Binds: [
'$onOpen' '$onOpen'
...@@ -30,22 +30,22 @@ define('package/quiqqer/shipping/bin/backend/controls/search/Shipping/Window', [ ...@@ -30,22 +30,22 @@ define('package/quiqqer/shipping/bin/backend/controls/search/Shipping/Window', [
options: { options: {
maxHeight: 600, maxHeight: 600,
maxWidth : 800, maxWidth: 800,
icon : 'fa fa-globe', icon: 'fa fa-globe',
title : QUILocale.get(lg, 'control.search.ShippingWindow.title'), title: QUILocale.get(lg, 'control.search.ShippingWindow.title'),
autoclose: false, autoclose: false,
cancel_button: { cancel_button: {
text : QUILocale.get('quiqqer/system', 'cancel'), text: QUILocale.get('quiqqer/system', 'cancel'),
textimage: 'fa fa-remove' textimage: 'fa fa-remove'
}, },
ok_button : { ok_button: {
text : QUILocale.get('quiqqer/system', 'accept'), text: QUILocale.get('quiqqer/system', 'accept'),
textimage: 'fa fa-truck' textimage: 'fa fa-truck'
} }
}, },
initialize: function (options) { initialize: function(options) {
this.parent(options); this.parent(options);
this.$Result = null; this.$Result = null;
...@@ -60,8 +60,8 @@ define('package/quiqqer/shipping/bin/backend/controls/search/Shipping/Window', [ ...@@ -60,8 +60,8 @@ define('package/quiqqer/shipping/bin/backend/controls/search/Shipping/Window', [
* *
* @returns {HTMLDivElement} * @returns {HTMLDivElement}
*/ */
$onOpen: function (Win) { $onOpen: function(Win) {
var self = this, var self = this,
Content = Win.getContent(); Content = Win.getContent();
Win.Loader.show(); Win.Loader.show();
...@@ -75,10 +75,10 @@ define('package/quiqqer/shipping/bin/backend/controls/search/Shipping/Window', [ ...@@ -75,10 +75,10 @@ define('package/quiqqer/shipping/bin/backend/controls/search/Shipping/Window', [
require([ require([
'package/quiqqer/shipping/bin/backend/controls/search/Shipping/Result' 'package/quiqqer/shipping/bin/backend/controls/search/Shipping/Result'
], function (Result) { ], function(Result) {
self.$Result = new Result({ self.$Result = new Result({
events: { events: {
onDblClick: function () { onDblClick: function() {
self.submit(); self.submit();
} }
} }
...@@ -86,7 +86,7 @@ define('package/quiqqer/shipping/bin/backend/controls/search/Shipping/Window', [ ...@@ -86,7 +86,7 @@ define('package/quiqqer/shipping/bin/backend/controls/search/Shipping/Window', [
self.$Result.resize(); self.$Result.resize();
Handler.getShippingList().then(function (result) { Handler.getShippingList().then(function(result) {
self.$Result.setData(result); self.$Result.setData(result);
Win.Loader.hide(); Win.Loader.hide();
}); });
...@@ -96,7 +96,7 @@ define('package/quiqqer/shipping/bin/backend/controls/search/Shipping/Window', [ ...@@ -96,7 +96,7 @@ define('package/quiqqer/shipping/bin/backend/controls/search/Shipping/Window', [
/** /**
* Submit * Submit
*/ */
submit: function () { submit: function() {
if (!this.$Result) { if (!this.$Result) {
return; return;
} }
......
...@@ -11,20 +11,20 @@ define('package/quiqqer/shipping/bin/backend/controls/settings/RuleFields', [ ...@@ -11,20 +11,20 @@ define('package/quiqqer/shipping/bin/backend/controls/settings/RuleFields', [
'css!package/quiqqer/shipping/bin/backend/controls/settings/RuleFields.css' 'css!package/quiqqer/shipping/bin/backend/controls/settings/RuleFields.css'
], function (QUI, QUIControl, QUILocale, QUIAjax) { ], function(QUI, QUIControl, QUILocale, QUIAjax) {
"use strict"; 'use strict';
return new Class({ return new Class({
Extends: QUIControl, Extends: QUIControl,
Type : 'package/quiqqer/shipping/bin/backend/controls/settings/RuleFields', Type: 'package/quiqqer/shipping/bin/backend/controls/settings/RuleFields',
Binds: [ Binds: [
'$onImport', '$onImport',
'$updateInput' '$updateInput'
], ],
initialize: function (options) { initialize: function(options) {
this.parent(options); this.parent(options);
this.addEvents({ this.addEvents({
...@@ -35,9 +35,9 @@ define('package/quiqqer/shipping/bin/backend/controls/settings/RuleFields', [ ...@@ -35,9 +35,9 @@ define('package/quiqqer/shipping/bin/backend/controls/settings/RuleFields', [
/** /**
* event: on import * event: on import
*/ */
$onImport: function () { $onImport: function() {
this.$Input = this.getElm(); this.$Input = this.getElm();
this.$Elm = new Element('div', { this.$Elm = new Element('div', {
'class': 'quiqqer-shipping-settings-ruleFields field-container-field' 'class': 'quiqqer-shipping-settings-ruleFields field-container-field'
}).wraps(this.$Input); }).wraps(this.$Input);
...@@ -45,18 +45,18 @@ define('package/quiqqer/shipping/bin/backend/controls/settings/RuleFields', [ ...@@ -45,18 +45,18 @@ define('package/quiqqer/shipping/bin/backend/controls/settings/RuleFields', [
html: '<span class="fa fa-spinner fa-spin"></span>' html: '<span class="fa fa-spinner fa-spin"></span>'
}).inject(this.$Elm); }).inject(this.$Elm);
var self = this, var self = this,
Container = this.$Elm; Container = this.$Elm;
this.$Elm this.$Elm.getParent('.field-container').getElement('.field-container-item').addEvent(
.getParent('.field-container') 'click',
.getElement('.field-container-item') function(event) {
.addEvent('click', function (event) {
event.stop(); event.stop();
}); }
);
QUIAjax.get('package_quiqqer_shipping_ajax_backend_rules_settings_getUnitFields', function (unitFields) { QUIAjax.get('package_quiqqer_shipping_ajax_backend_rules_settings_getUnitFields', function(unitFields) {
Container.getChildren().forEach(function (Node) { Container.getChildren().forEach(function(Node) {
if (Node.nodeName !== 'INPUT') { if (Node.nodeName !== 'INPUT') {
Node.destroy(); Node.destroy();
} }
...@@ -65,8 +65,8 @@ define('package/quiqqer/shipping/bin/backend/controls/settings/RuleFields', [ ...@@ -65,8 +65,8 @@ define('package/quiqqer/shipping/bin/backend/controls/settings/RuleFields', [
for (var i = 0, len = unitFields.length; i < len; i++) { for (var i = 0, len = unitFields.length; i < len; i++) {
new Element('label', { new Element('label', {
'class': 'quiqqer-shipping-settings-ruleFields-entry', 'class': 'quiqqer-shipping-settings-ruleFields-entry',
html : '<input type="checkbox" value="' + unitFields[i].id + '" />' + unitFields[i].title, html: '<input type="checkbox" value="' + unitFields[i].id + '" />' + unitFields[i].title,
events : { events: {
change: self.$updateInput change: self.$updateInput
} }
}).inject(Container); }).inject(Container);
...@@ -92,14 +92,14 @@ define('package/quiqqer/shipping/bin/backend/controls/settings/RuleFields', [ ...@@ -92,14 +92,14 @@ define('package/quiqqer/shipping/bin/backend/controls/settings/RuleFields', [
/** /**
* Refresh the input value * Refresh the input value
*/ */
$updateInput: function () { $updateInput: function() {
var checkboxes = this.getElm().getElements('[type="checkbox"]'); var checkboxes = this.getElm().getElements('[type="checkbox"]');
checkboxes = checkboxes.filter(function (Node) { checkboxes = checkboxes.filter(function(Node) {
return Node.checked; return Node.checked;
}); });
checkboxes = checkboxes.map(function (Node) { checkboxes = checkboxes.map(function(Node) {
return Node.value; return Node.value;
}); });
......
Dieser Diff ist reduziert.
...@@ -9,13 +9,13 @@ define('package/quiqqer/shipping/bin/backend/controls/shippingRules/CreateRuleWi ...@@ -9,13 +9,13 @@ define('package/quiqqer/shipping/bin/backend/controls/shippingRules/CreateRuleWi
'package/quiqqer/shipping/bin/backend/controls/shippingRules/CreateRule', 'package/quiqqer/shipping/bin/backend/controls/shippingRules/CreateRule',
'Locale' 'Locale'
], function (QUI, QUIConfirm, CreateRule, QUILocale) { ], function(QUI, QUIConfirm, CreateRule, QUILocale) {
"use strict"; 'use strict';
return new Class({ return new Class({
Extends: QUIConfirm, Extends: QUIConfirm,
Type : 'package/quiqqer/shipping/bin/backend/controls/shippingRules/CreateRuleWindow', Type: 'package/quiqqer/shipping/bin/backend/controls/shippingRules/CreateRuleWindow',
Binds: [ Binds: [
'$onOpen', '$onOpen',
...@@ -24,18 +24,18 @@ define('package/quiqqer/shipping/bin/backend/controls/shippingRules/CreateRuleWi ...@@ -24,18 +24,18 @@ define('package/quiqqer/shipping/bin/backend/controls/shippingRules/CreateRuleWi
options: { options: {
maxHeight: 800, maxHeight: 800,
maxWidth : 600, maxWidth: 600,
autoclose: false autoclose: false
}, },
initialize: function (options) { initialize: function(options) {
this.parent(options); this.parent(options);
this.setAttributes({ this.setAttributes({
title : QUILocale.get('quiqqer/shipping', 'window.shipping.rules.title'), title: QUILocale.get('quiqqer/shipping', 'window.shipping.rules.title'),
icon : 'fa fa-truck', icon: 'fa fa-truck',
ok_button: { ok_button: {
text : QUILocale.get('quiqqer/shipping', 'window.shipping.entry.delete.rule.create'), text: QUILocale.get('quiqqer/shipping', 'window.shipping.entry.delete.rule.create'),
textimage: 'fa fa-trash' textimage: 'fa fa-trash'
} }
}); });
...@@ -43,7 +43,7 @@ define('package/quiqqer/shipping/bin/backend/controls/shippingRules/CreateRuleWi ...@@ -43,7 +43,7 @@ define('package/quiqqer/shipping/bin/backend/controls/shippingRules/CreateRuleWi
this.$Create = null; this.$Create = null;
this.addEvents({ this.addEvents({
onOpen : this.$onOpen, onOpen: this.$onOpen,
onSubmit: this.$onSubmit onSubmit: this.$onSubmit
}); });
}, },
...@@ -51,7 +51,7 @@ define('package/quiqqer/shipping/bin/backend/controls/shippingRules/CreateRuleWi ...@@ -51,7 +51,7 @@ define('package/quiqqer/shipping/bin/backend/controls/shippingRules/CreateRuleWi
/** /**
* event: on inject * event: on inject
*/ */
$onOpen: function () { $onOpen: function() {
var self = this; var self = this;
this.Loader.show(); this.Loader.show();
...@@ -59,7 +59,7 @@ define('package/quiqqer/shipping/bin/backend/controls/shippingRules/CreateRuleWi ...@@ -59,7 +59,7 @@ define('package/quiqqer/shipping/bin/backend/controls/shippingRules/CreateRuleWi
this.$Create = new CreateRule({ this.$Create = new CreateRule({
events: { events: {
onLoad: function () { onLoad: function() {
self.Loader.hide(); self.Loader.hide();
} }
} }
...@@ -69,11 +69,11 @@ define('package/quiqqer/shipping/bin/backend/controls/shippingRules/CreateRuleWi ...@@ -69,11 +69,11 @@ define('package/quiqqer/shipping/bin/backend/controls/shippingRules/CreateRuleWi
/** /**
* event: on submit * event: on submit
*/ */
$onSubmit: function () { $onSubmit: function() {
var self = this; var self = this;
this.Loader.hide(); this.Loader.hide();
this.$Create.submit().then(function () { this.$Create.submit().then(function() {
self.Loader.hide(); self.Loader.hide();
self.close(); self.close();
}); });
......