diff --git a/debian/changelog b/debian/changelog index 0df486d2..cd83d6e5 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -hedera-web (1.405.92) stable; urgency=low +hedera-web (1.405.93) stable; urgency=low * Initial Release. diff --git a/forms/ecomerce/checkout/checkout.js b/forms/ecomerce/checkout/checkout.js index e543dd5a..a5abce00 100644 --- a/forms/ecomerce/checkout/checkout.js +++ b/forms/ecomerce/checkout/checkout.js @@ -1,18 +1,16 @@ -Hedera.Checkout = new Class -({ - Extends: Hedera.Form +Hedera.Checkout = new Class ({ + Extends: Hedera.Form, - ,activate: function () - { + activate: function() { this.autoStepLocked = true; + this.$('assistant').stepsIndex = this.agencySteps; - this.today = new Date (); - this.today.setHours (0,0,0,0); - } + this.today = new Date(); + this.today.setHours(0, 0, 0, 0); + }, - ,onValuesReady: function () - { + onValuesReady: function() { var orderForm = this.$('order-form'); var defaultsForm = this.$('defaults'); @@ -21,168 +19,173 @@ Hedera.Checkout = new Class var date; - if (orderForm.numRows > 0) - { + if (orderForm.numRows > 0) { var i = orderForm; - date = i.get ('sent'); - } - else + date = i.get('sent'); + } else var i = defaultsForm; - if (!date || date.getTime () < (new Date ()).getTime ()) - { - date = new Date (); + if (!date || date.getTime() <(new Date()).getTime()) { + date = new Date(); if (i.get('deliveryMethod') != 'PICKUP') - date.setTime (date.getTime () + 86400000); + date.setTime(date.getTime() + 86400000); } this.$('date').value = date; - this.$('method').value = i.get ('deliveryMethod'); - this.$('agency').value = i.get ('agencyModeFk'); - this.$('address').value = i.get ('addressFk'); + this.$('method').value = i.get('deliveryMethod'); + this.$('agency').value = i.get('agencyModeFk'); + this.$('address').value = i.get('addressFk'); this.autoStepLocked = false; - } + }, - ,disableButtons: function (disable) - { - this.$('confirm-agency').disabled = disable; + disableButtons: function(disable) { this.$('confirm-delivery').disabled = disable; this.$('confirm-pickup').disabled = disable; - } + }, - ,onConfirmClick: function () - { - this.disableButtons (true); + onConfirmClick: function() { + this.disableButtons(true); - var query = 'CALL basketConfigure (#date, #method, #agency, #address)'; + var query = 'CALL basketConfigure(#date, #method, #agency, #address)'; - var batch = new Sql.Batch (); - batch.addParam ('method', this.$('method')); - batch.addParam ('date', this.$('date')); - batch.addParam ('agency', this.$('agency')); - batch.addParam ('address', this.$('address')); + var batch = new Sql.Batch(); + batch.addParam('method', this.$('method')); + batch.addParam('date', this.$('date')); + batch.addParam('agency', this.$('agency')); + batch.addParam('address', this.$('address')); - this.conn.execQuery (query, - this.onBasketConfigured.bind (this), batch); - } + this.conn.execQuery(query, + this.onBasketConfigured.bind(this), batch); + }, - ,onBasketConfigured: function (resultSet) - { - this.disableButtons (false); + onBasketConfigured: function(resultSet) { + this.disableButtons(false); - if (!resultSet.fetchResult ()) + if (!resultSet.fetchResult()) return; if (this.$('order-form').numRows > 0) - Htk.Toast.showMessage (_('OrderUpdated')); + Htk.Toast.showMessage(_('OrderUpdated')); else - Htk.Toast.showMessage (_('OrderStarted')); + Htk.Toast.showMessage(_('OrderStarted')); - this.hash.set ({form: 'ecomerce/catalog'}); - } + this.hash.set({form: 'ecomerce/catalog'}); + }, - ,onCancelClick: function () - { + onCancelClick: function() { if (this.$('order-form').numRows > 0) window.history.back(); else - this.hash.set ({'form': 'ecomerce/orders'}); - } + this.hash.set({form: 'ecomerce/orders'}); + }, - ,agencySteps: ['method', 'date', 'address', 'agency', 'confirm-agency'] - ,pickupSteps: ['method', 'date', 'address', 'pickup', 'confirm-pickup'] - - ,stepFunc: function (stepIndex) - { - var isDelivery = this.$('rg-method').value == 'AGENCY'; - var steps = isDelivery ? this.agencySteps : this.pickupSteps; - var stepId = steps[stepIndex]; - - if (!stepId) - return null; + agencySteps: ['method', 'date', 'address', 'agency', 'confirm-delivery'], + pickupSteps: ['method', 'date', 'address', 'pickup', 'confirm-pickup'], - switch (stepId) - { - case 'date': - Vn.Node.setText (this.$('date-question'), isDelivery ? - _('OrderDateDeliveryQuestion'): - _('OrderDatePickupQuestion')); - this.$('calendar').goToSelectedMonth (); - break; - case 'address': - Vn.Node.setText (this.$('address-question'), isDelivery ? - _('AddressQuestion'): - _('AddressQuestionPickup')); - break; - case 'agency': - this.$('agencies').refresh (); - break; - case 'pickup': - this.$('warehouses').refresh (); - break; - } - - return this.$(stepId +'-step'); - } + isDelivery: function() { + return this.$('rg-method').value != 'PICKUP'; + }, + + onMethodChange: function() { + this.$('assistant').stepsIndex = this.isDelivery() ? + this.agencySteps : this.pickupSteps; + this.onFieldChange(); + }, + + methodValidate: function() { + if (!this.$('rg-method').isSelected()) + throw new Error(_('Please select an option')); + }, + + dateShow: function() { + Vn.Node.setText(this.$('date-question'), this.isDelivery() ? + _('OrderDateDeliveryQuestion'): + _('OrderDatePickupQuestion')); + this.$('calendar').goToSelectedMonth(); + }, + + dateValidate: function() { + if (!this.$('calendar').value) + throw new Error(_('Please select a date')); + }, + + addressShow: function() { + Vn.Node.setText(this.$('address-question'), this.isDelivery() ? + _('AddressQuestion'): + _('AddressQuestionPickup')); + }, + + addressValidate: function() { + if (this.$('address-form').row == -1) + throw new Error(_('Please select an address')); + }, + + agencyShow: function() { + this.$('agencies').refresh(); + }, + + agencyValidate: function() { + if (this.$('agency-combo').row == -1 && this.isDelivery()) + throw new Error(_('Please select an agency')); + }, + + pickupShow: function() { + this.$('warehouses').refresh(); + }, + + pickupValidate: function() { + if (this.$('warehouse-combo').row == -1) + throw new Error(_('Please select a store')); + }, - ,onFieldChange: function () - { + onFieldChange: function() { if (!this.autoStepLocked) - this.$('assistant').moveNext (); - } + this.$('assistant').moveNext(); + }, - ,goNextStep: function () - { - this.$('assistant').moveNext (); - } + goNextStep: function() { + this.$('assistant').moveNext(); + }, - ,addressRenderer: function (builder, form) - { - builder.$('address').addEventListener ('click', - this.onAddressClick.bind (this, form.get ('id'))); - } + addressRenderer: function(builder, form) { + builder.$('address').addEventListener('click', + this.onAddressClick.bind(this, form.get('id'))); + }, - ,onAddressClick: function (addressId) - { + onAddressClick: function(addressId) { this.$('address').value = addressId; - this.goNextStep (); - } + this.goNextStep(); + }, - ,onAddressChange: function () - { + onAddressChange: function() { if (this.selectedNode) - Vn.Node.removeClass (this.selectedNode, 'selected'); + Vn.Node.removeClass(this.selectedNode, 'selected'); - var row = this.$('addresses').search ('id', this.$('address').value); + var row = this.$('addresses').search('id', this.$('address').value); - if (row != -1) - { - var builder = this.$('repeater').getBuilder (row); + if (row != -1) { + var builder = this.$('repeater').getBuilder(row); this.selectedNode = builder.$('address'); - Vn.Node.addClass (this.selectedNode, 'selected'); + Vn.Node.addClass(this.selectedNode, 'selected'); } this.$('address-form').row = row; - } + }, - ,onAgenciesReady: function (model) - { + onAgenciesReady: function(model) { if (model.ready && model.numRows == 0) - Htk.Toast.showError (_('NoAgeciesAvailableForDate')); - } + Htk.Toast.showError(_('NoAgeciesAvailableForDate')); + }, - ,onWarehousesReady: function (model) - { + onWarehousesReady: function(model) { if (model.ready && model.numRows == 0) - Htk.Toast.showError (_('NoWarehousesAvailableForDate')); - } + Htk.Toast.showError(_('NoWarehousesAvailableForDate')); + }, - ,calendarRestrict: function (date) - { - return date.getTime () >= this.today.getTime (); + calendarRestrict: function(date) { + return date.getTime() >= this.today.getTime(); } }); - diff --git a/forms/ecomerce/checkout/locale/ca.yml b/forms/ecomerce/checkout/locale/ca.yml index 4df1aef4..7b1ed86c 100644 --- a/forms/ecomerce/checkout/locale/ca.yml +++ b/forms/ecomerce/checkout/locale/ca.yml @@ -19,6 +19,11 @@ Warehouse: Magatzem Confirm: Confirmar OrderStarted: Comanda començada OrderUpdated: Comanda actualitzada +Please select an option: Si us plau tria una opció +Please select a date: Si us plau tria una data +Please select an address: Si us plau tria una direcció +Please select an agency: Si us plau tria una agència +Please select a store: Si us plau tria un magatzem NoAgeciesAvailableForDate: >- No hi ha agències disponibles per a la data i el consignatari seleccionats, modifica la data d'enviament de la comanda diff --git a/forms/ecomerce/checkout/locale/en.yml b/forms/ecomerce/checkout/locale/en.yml index cb36b235..cdaafd85 100644 --- a/forms/ecomerce/checkout/locale/en.yml +++ b/forms/ecomerce/checkout/locale/en.yml @@ -19,6 +19,11 @@ Warehouse: Store Confirm: Confirm OrderStarted: Order started OrderUpdated: Order updated +Please select an option: Please select an option +Please select a date: Please select a date +Please select an address: Please select an address +Please select an agency: Please select an agency +Please select a store: Please select a store NoAgeciesAvailableForDate: >- No agencies available for the selected date and consignee, change the shipping date of your order diff --git a/forms/ecomerce/checkout/locale/es.yml b/forms/ecomerce/checkout/locale/es.yml index b1fb03cb..74069ff4 100644 --- a/forms/ecomerce/checkout/locale/es.yml +++ b/forms/ecomerce/checkout/locale/es.yml @@ -19,6 +19,11 @@ Warehouse: Almacén Confirm: Confirmar OrderStarted: Pedido empezado OrderUpdated: Pedido actualizado +Please select an option: Por favor elige una opción +Please select a date: Por favor elige una fecha +Please select an address: Por favor elige una dirección +Please select an agency: Por favor elige una agencia +Please select a store: Por favor elige un almacén NoAgeciesAvailableForDate: >- No hay agencias disponibles para la fecha y el consignatario seleccionados, modifica la fecha de envío del pedido diff --git a/forms/ecomerce/checkout/locale/fr.yml b/forms/ecomerce/checkout/locale/fr.yml index 822ef084..20f0c290 100644 --- a/forms/ecomerce/checkout/locale/fr.yml +++ b/forms/ecomerce/checkout/locale/fr.yml @@ -19,6 +19,11 @@ Warehouse: MAgasin Confirm: Confirmer OrderStarted: Commande a commencé OrderUpdated: Mise à jour commande +Please select an option: Veuillez choisir une option +Please select a date: Veuillez choisir une date +Please select an address: Veuillez choisir une adresse +Please select an agency: Veuillez choisir une agence +Please select a store: Veuillez choisir un entrepôt NoAgeciesAvailableForDate: >- Aucune agence disponibles pour la date et le destinataire sélectionné, changer la date d'envoi de la commande diff --git a/forms/ecomerce/checkout/locale/pt.yml b/forms/ecomerce/checkout/locale/pt.yml index b40d3423..800486d7 100644 --- a/forms/ecomerce/checkout/locale/pt.yml +++ b/forms/ecomerce/checkout/locale/pt.yml @@ -19,6 +19,11 @@ Warehouse: Armazém Confirm: Confirmar OrderStarted: Encomenda iniciada OrderUpdated: Encomenda actualizada +Please select an option: Por favor escolha uma opção +Please select a date: Por favor, escolha uma data +Please select an address: Por favor, escolha um endereço +Please select an agency: Por favor, escolha uma agência +Please select a store: Por favor, escolha um armazém NoAgeciesAvailableForDate: >- Não há agências disponíveis para a data e o consignatario escolhido, modifique a data de envío do pedido diff --git a/forms/ecomerce/checkout/style.css b/forms/ecomerce/checkout/style.css index 9fa8fdb3..7a19763e 100644 --- a/forms/ecomerce/checkout/style.css +++ b/forms/ecomerce/checkout/style.css @@ -4,10 +4,15 @@ max-width: 40em; margin: 0 auto; } +.checkout .bar +{ + padding: .2em; + margin-bottom: 1em; +} .checkout .form { max-width: 40em; - padding: 3em; + padding: 4em; } /* Step */ @@ -20,7 +25,7 @@ } .answers .htk-select { - max-width: 8em; + max-width: 10em; display: block; margin: 0 auto; font-size: 1.6em; diff --git a/forms/ecomerce/checkout/ui.xml b/forms/ecomerce/checkout/ui.xml index 8f6baa0c..8baec5fb 100644 --- a/forms/ecomerce/checkout/ui.xml +++ b/forms/ecomerce/checkout/ui.xml @@ -70,149 +70,143 @@ on-click="onCancelClick"/>
-
-
+
+
-
-
-
+
+
+
-
-
-
+
+
-
-