diff --git a/debian/control b/debian/control index 2254c6a1..8fc4d6c1 100644 --- a/debian/control +++ b/debian/control @@ -9,7 +9,7 @@ Vcs-Git: git://www.verdnatura.es/var/git/hedera-web Package: hedera-web Architecture: all -Depends: apache2, php5-mysql, php5-mcrypt, php5-ssh2, php5-apcu, php-vn-lib, nodejs +Depends: apache2, php5-mysql, php5-mcrypt, php5-ldap, php5-ssh2, php5-apcu, php-vn-lib, nodejs Suggests: php-text-captcha, php5-imap Section: misc Priority: optional diff --git a/forms/account/conf/ui.xml b/forms/account/conf/ui.xml index 8afd0ee1..8d7045b1 100755 --- a/forms/account/conf/ui.xml +++ b/forms/account/conf/ui.xml @@ -8,8 +8,7 @@ - SELECT u.id, u.name, u.recoverPass, - c.email, c.mail, c.user_id + SELECT u.id, u.name, u.email, u.recoverPass, c.mail, c.user_id FROM account.userView u LEFT JOIN customer_view c ON u.id = c.user_id diff --git a/forms/admin/photos/locale/ca.json b/forms/admin/photos/locale/ca.json index 704fe00c..60d2a788 100755 --- a/forms/admin/photos/locale/ca.json +++ b/forms/admin/photos/locale/ca.json @@ -7,6 +7,10 @@ ,"Clear all": "Netejar tot" ,"Upload files": "Pujar arxius" + ,"Waiting for upload": "Esperant per pujar" + ,"Uploading file": "Pujant fitxer" + ,"Image uploaded": "Imatge pujada" + ,"Upload finished successfully": "Imatges pujades correctament" ,"Some errors happened on upload": "Van ocórrer errors en pujar alguna de les imatges" ,"There are no files to upload": "No s'ha seleccionat arxius per pujar" diff --git a/forms/admin/photos/locale/en.json b/forms/admin/photos/locale/en.json index c160093c..dd46d4af 100755 --- a/forms/admin/photos/locale/en.json +++ b/forms/admin/photos/locale/en.json @@ -7,6 +7,10 @@ ,"Clear all": "Clear all" ,"Upload files": "Upload files" + ,"Waiting for upload": "Waiting for upload" + ,"Uploading file": "Uploading file" + ,"Image uploaded": "Image uploaded" + ,"Upload finished successfully": "Upload finished successfully" ,"Some errors happened on upload": "Some errors happened on upload" ,"There are no files to upload": "There are no files to upload" diff --git a/forms/admin/photos/locale/es.json b/forms/admin/photos/locale/es.json index 841acff0..57a426a5 100755 --- a/forms/admin/photos/locale/es.json +++ b/forms/admin/photos/locale/es.json @@ -7,6 +7,10 @@ ,"Clear all": "Limpiar todo" ,"Upload files": "Subir archivos" + ,"Waiting for upload": "Esperando para subir" + ,"Uploading file": "Subiendo fichero" + ,"Image uploaded": "Imagen subida" + ,"Upload finished successfully": "Imágenes subidas correctamente" ,"Some errors happened on upload": "Ocurrieron errores al subir alguna de las imágenes" ,"There are no files to upload": "No se han seleccionado archivos para subir" diff --git a/forms/admin/photos/locale/fr.json b/forms/admin/photos/locale/fr.json index c2b17151..4242b592 100755 --- a/forms/admin/photos/locale/fr.json +++ b/forms/admin/photos/locale/fr.json @@ -7,6 +7,10 @@ ,"Clear all": "Tout effacer" ,"Upload files": "Upload Files" + ,"Waiting for upload": "En attente de télécharger" + ,"Uploading file": "Uploader des fichiers" + ,"Image uploaded": "Fichier uploadé" + ,"Upload finished successfully": "Les images téléchargées correctement" ,"Some errors happened on upload": "Des erreurs sont survenues lors du téléchargement des images" ,"There are no files to upload": "Aucun fichier sélectionné pour télécharger" diff --git a/forms/admin/photos/locale/mn.json b/forms/admin/photos/locale/mn.json index c160093c..dd46d4af 100755 --- a/forms/admin/photos/locale/mn.json +++ b/forms/admin/photos/locale/mn.json @@ -7,6 +7,10 @@ ,"Clear all": "Clear all" ,"Upload files": "Upload files" + ,"Waiting for upload": "Waiting for upload" + ,"Uploading file": "Uploading file" + ,"Image uploaded": "Image uploaded" + ,"Upload finished successfully": "Upload finished successfully" ,"Some errors happened on upload": "Some errors happened on upload" ,"There are no files to upload": "There are no files to upload" diff --git a/forms/admin/photos/locale/pt.json b/forms/admin/photos/locale/pt.json index 728f208e..0b96d036 100644 --- a/forms/admin/photos/locale/pt.json +++ b/forms/admin/photos/locale/pt.json @@ -7,6 +7,10 @@ ,"Clear all": "Clear All" ,"Upload files": "Fazer upload de arquivos" + ,"Waiting for upload": "Esperando para enviar" + ,"Uploading file": "Enviando arquivo" + ,"Image uploaded": "Arquivo enviado" + ,"Upload finished successfully": "Upload concluído com sucesso" ,"Some errors happened on upload": "Ocurrieron erros ao subir alguma das imagens" ,"There are no files to upload": "Não há arquivos selecionados para upload" diff --git a/forms/admin/photos/photos.js b/forms/admin/photos/photos.js index 7fab2c61..6cde6ddd 100644 --- a/forms/admin/photos/photos.js +++ b/forms/admin/photos/photos.js @@ -1,3 +1,11 @@ +(function() { + +var Status = { + NONE : 0 + ,WAITING : 1 + ,UPLOADING : 2 + ,UPLOADED : 3 +}; Hedera.Photos = new Class ({ @@ -5,6 +13,8 @@ Hedera.Photos = new Class ,filesData: [] ,uploadCount: 0 ,errors: false + ,uploadQueue: [] + ,isUploading: false ,activate: function () { @@ -46,17 +56,16 @@ Hedera.Photos = new Class name.value = getFileName (file.name); div.appendChild (name); - var status = doc.createElement ('span'); - status.className = 'status'; - div.appendChild (status); + var statusNode = doc.createElement ('span'); + statusNode.className = 'status'; + div.appendChild (statusNode); var fileData = { div: div, file: file, name: name, - status: status, - sent: false, - loading : false + statusNode: statusNode, + status: Status.NONE }; this.filesData.push (fileData); button.value = fileData; @@ -67,68 +76,88 @@ Hedera.Photos = new Class ,onUploadClick: function () { var filesData = this.filesData; - var formData = new FormData(); var count = 0; for (var i = 0; i < filesData.length; i++) { var fileData = filesData[i]; - - if (!(fileData.sent || fileData.loading)) - { - formData.append ('image', fileData.file); - formData.append ('name', fileData.name.value); - formData.append ('schema', this.$('schema').value); - formData.append ('srv', 'json:image/upload'); - this.conn.sendFormData (formData, - this.onFileUpload.bind (this, fileData)); - fileData.loading = true; - this.uploadCount++; + if (fileData.status === Status.NONE) + { + this.setImageStatus ( + fileData, Status.WAITING, 'cloud-upload', _('Waiting for upload')); + fileData.name.disabled = true; + this.uploadQueue.push (fileData); count++; } } if (count === 0) Htk.Toast.showWarning (_('There are no files to upload')); + else + this.uploadNextFile (); + } + + ,uploadNextFile: function () + { + if (this.isUploading) + return; + + this.isUploading = true; + + var fileData = this.uploadQueue.shift (); + this.setImageStatus ( + fileData, Status.UPLOADING, 'upload', _('Uploading file')); + + var formData = new FormData(); + formData.append ('image', fileData.file); + formData.append ('name', fileData.name.value); + formData.append ('schema', this.$('schema').value); + formData.append ('srv', 'json:image/upload'); + this.conn.sendFormData (formData, + this.onFileUpload.bind (this, fileData)); } ,onFileUpload: function (fileData, data, error) { - fileData.loading = false; + this.isUploading = false; if (data) { - var iconName = 'ok'; - var title = _('ImageAdded'); - fileData.sent = true; - fileData.name.disabled = true; + this.setImageStatus ( + fileData, Status.UPLOADED, 'ok', _('Image uploaded')); } else { - var iconName = 'error'; - var title = error.message; + this.setImageStatus ( + fileData, Status.NONE, 'error', error.message); + fileData.name.disabled = false; this.errors = true; } - var status = fileData.status; - Vn.Node.removeChilds (status); - - var icon = new Htk.Icon ({icon: iconName}); - status.appendChild (icon.node); - status.title = title; - - this.uploadCount--; - - if (this.uploadCount === 0) + if (this.uploadQueue.length === 0) { - if (!this.errors) - Htk.Toast.showMessage (_('Upload finished successfully')); - else + if (this.errors) Htk.Toast.showError (_('Some errors happened on upload')); + else + Htk.Toast.showMessage (_('Upload finished successfully')); this.errors = false; } + else + this.uploadNextFile (); + } + + ,setImageStatus: function (fileData, status, icon, title) + { + fileData.status = status; + + var statusNode = fileData.statusNode; + Vn.Node.removeChilds (statusNode); + + var iconNode = new Htk.Icon ({icon: icon}); + statusNode.appendChild (iconNode.node); + statusNode.title = title ? title : ''; } ,onFileRemove: function (button) @@ -202,3 +231,5 @@ function getFileName (path) return path.substr (barIndex, dotIndex); } + +})(); diff --git a/forms/ecomerce/catalog/locale/ca.json b/forms/ecomerce/catalog/locale/ca.json index 0589742e..583e5a50 100755 --- a/forms/ecomerce/catalog/locale/ca.json +++ b/forms/ecomerce/catalog/locale/ca.json @@ -31,6 +31,7 @@ ,"Origin": "Origen" ,"Category": "Categoria" ,"Remove filters": "Esborrar filtres" + ,"Relevancy": "Rellevància" ,"Price": "Precio" ,"Amount": "Quantitat" diff --git a/forms/ecomerce/catalog/locale/en.json b/forms/ecomerce/catalog/locale/en.json index 981bc119..d93ab1f9 100755 --- a/forms/ecomerce/catalog/locale/en.json +++ b/forms/ecomerce/catalog/locale/en.json @@ -31,6 +31,7 @@ ,"Origin": "Origin" ,"Category": "Category" ,"Remove filters": "Remove filters" + ,"Relevancy": "Relevance" ,"Price": "Price" ,"Amount": "Amount" diff --git a/forms/ecomerce/catalog/locale/es.json b/forms/ecomerce/catalog/locale/es.json index 4a588d82..012354e2 100755 --- a/forms/ecomerce/catalog/locale/es.json +++ b/forms/ecomerce/catalog/locale/es.json @@ -40,8 +40,9 @@ ,"Higher price": "Precio más alto" ,"Lower size": "Medida más pequeña" ,"Higher size": "Medida más grande" + ,"Relevancy": "Relevancia" + ,", %.0d Units": ", %.0d Unidades" - ,"from": "desde" ,"from %.2d€": "desde %.2d€" ,"AddToBasket": "Añadir artículo" diff --git a/forms/ecomerce/catalog/locale/fr.json b/forms/ecomerce/catalog/locale/fr.json index 9c9b99eb..4bbdc865 100755 --- a/forms/ecomerce/catalog/locale/fr.json +++ b/forms/ecomerce/catalog/locale/fr.json @@ -31,6 +31,7 @@ ,"Origin": "Origine" ,"Category": "Catégorie" ,"Remove filters": "Retirer les filtres" + ,"Relevancy": "Pertinence" ,"Price": "Prix" ,"Amount": "Quantité" diff --git a/forms/ecomerce/catalog/locale/mn.json b/forms/ecomerce/catalog/locale/mn.json index 981bc119..1c6d8df8 100755 --- a/forms/ecomerce/catalog/locale/mn.json +++ b/forms/ecomerce/catalog/locale/mn.json @@ -31,6 +31,7 @@ ,"Origin": "Origin" ,"Category": "Category" ,"Remove filters": "Remove filters" + ,"Relevancy": "хамаарал" ,"Price": "Price" ,"Amount": "Amount" diff --git a/forms/ecomerce/catalog/locale/pt.json b/forms/ecomerce/catalog/locale/pt.json index bfe501f8..9003febb 100644 --- a/forms/ecomerce/catalog/locale/pt.json +++ b/forms/ecomerce/catalog/locale/pt.json @@ -31,6 +31,7 @@ ,"Origin": "Orígem" ,"Category": "Categoria" ,"Remove filters": "Eliminar filtros" + ,"Relevancy": "Relevância" ,"Price": "Preço" ,"Amount": "Quantidade" diff --git a/forms/ecomerce/catalog/ui.xml b/forms/ecomerce/catalog/ui.xml index 313a59af..4898620c 100755 --- a/forms/ecomerce/catalog/ui.xml +++ b/forms/ecomerce/catalog/ui.xml @@ -54,7 +54,7 @@ LEFT JOIN vn_locale.color_view c ON c.color_id = a.Color LEFT JOIN vn_locale.origin_view o ON o.origin_id = a.id_origen WHERE b.available > 0 - ORDER BY a.Article, a.Medida + ORDER BY a.relevancy DESC, a.Article, a.Medida LIMIT 40; @@ -298,7 +298,10 @@

Order by