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