From 09278c582d720ff088dbd0fc58463bfd86cd05eb Mon Sep 17 00:00:00 2001 From: jObregon Date: Thu, 26 Apr 2012 16:58:28 +0000 Subject: [PATCH] [+] MO : Shipwire module --- modules/shipwire/config.xml | 12 + modules/shipwire/cronjob_update.php | 54 + modules/shipwire/es.php | 68 ++ modules/shipwire/fr.php | 68 ++ modules/shipwire/index.php | 36 + modules/shipwire/lib/SWCurl.php | 111 ++ modules/shipwire/lib/ShipwireApi.php | 133 +++ .../shipwire/lib/ShipwireInventoryUpdate.php | 61 ++ modules/shipwire/lib/ShipwireOrder.php | 91 ++ modules/shipwire/lib/ShipwireTracking.php | 188 ++++ modules/shipwire/lib/index.php | 36 + modules/shipwire/logo.gif | Bin 0 -> 162 bytes modules/shipwire/shipwire.php | 956 ++++++++++++++++++ modules/shipwire/shipwire_logo.png | Bin 0 -> 10901 bytes modules/shipwire/sql/index.php | 36 + modules/shipwire/sql/sql-install.php | 83 ++ modules/shipwire/sql/sql-uninstall.php | 32 + modules/shipwire/style.css | 102 ++ 18 files changed, 2067 insertions(+) create mode 100644 modules/shipwire/config.xml create mode 100644 modules/shipwire/cronjob_update.php create mode 100644 modules/shipwire/es.php create mode 100644 modules/shipwire/fr.php create mode 100644 modules/shipwire/index.php create mode 100644 modules/shipwire/lib/SWCurl.php create mode 100644 modules/shipwire/lib/ShipwireApi.php create mode 100644 modules/shipwire/lib/ShipwireInventoryUpdate.php create mode 100644 modules/shipwire/lib/ShipwireOrder.php create mode 100644 modules/shipwire/lib/ShipwireTracking.php create mode 100644 modules/shipwire/lib/index.php create mode 100644 modules/shipwire/logo.gif create mode 100644 modules/shipwire/shipwire.php create mode 100644 modules/shipwire/shipwire_logo.png create mode 100644 modules/shipwire/sql/index.php create mode 100644 modules/shipwire/sql/sql-install.php create mode 100644 modules/shipwire/sql/sql-uninstall.php create mode 100644 modules/shipwire/style.css diff --git a/modules/shipwire/config.xml b/modules/shipwire/config.xml new file mode 100644 index 000000000..13156940e --- /dev/null +++ b/modules/shipwire/config.xml @@ -0,0 +1,12 @@ + + + shipwire + + + + + + 1 + 1 + + \ No newline at end of file diff --git a/modules/shipwire/cronjob_update.php b/modules/shipwire/cronjob_update.php new file mode 100644 index 000000000..aff7f4d19 --- /dev/null +++ b/modules/shipwire/cronjob_update.php @@ -0,0 +1,54 @@ + +* @copyright 2007-2012 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +include(dirname(__FILE__).'/../../config/config.inc.php'); + +if (isset($_GET['secure_key']) || isset($_ARGV[1])) +{ + $secureKey = md5(_COOKIE_KEY_.Configuration::get('PS_SHOP_NAME')); + if (!empty($secureKey) && ($secureKey == $_GET['secure_key'] || (isset($_ARGV[1]) && $secureKey == $_ARGV[1]))) + { + // Clean logs + $logDeleteDate = date('Y-m-d', mktime(0, 0, 0, date('n'), date('j') - Configuration::get('SHIPWIRE_LOG_LIFE'), date('Y'))).' 00:00:00'; + Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'shipwire_log` WHERE `date_added` < \''.pSQL($logDeleteDate).'\''); + + if (!class_exists('Shipwire')) + require(dirname(__FILE__).'/shipwire.php'); + + require(dirname(__FILE__).'/lib/ShipwireApi.php'); + require(dirname(__FILE__).'/lib/ShipwireTracking.php'); + + $m = new Shipwire(); + $d = Db::getInstance()->ExecuteS('SELECT `id_order` FROM `'._DB_PREFIX_.'shipwire_order` WHERE `transaction_ref` IS NULL OR `transaction_ref` = \'\''); + foreach ($d as $line) + $m->updateOrderStatus($line['id_order']); + + ShipwireTracking::updateTracking(); // This will be called directly thru the browser or cronjob + } + + die('Invalid key.'); +} \ No newline at end of file diff --git a/modules/shipwire/es.php b/modules/shipwire/es.php new file mode 100644 index 000000000..cb17d00b0 --- /dev/null +++ b/modules/shipwire/es.php @@ -0,0 +1,68 @@ +shipwire_e912562384b72ccc478a47019c553dc7'] = 'Shipwire'; +$_MODULE['<{shipwire}prestashop>shipwire_387ef38ac0cb1704e465d537ab8d690d'] = 'Logística empresarial para todos.'; +$_MODULE['<{shipwire}prestashop>shipwire_621db7652ee0cb6a53c8ca4ec683bae5'] = 'No se envió a Shipwire.'; +$_MODULE['<{shipwire}prestashop>shipwire_485ed82930e1e53e6da27a11ccf2089b'] = 'Shipwire Estatus'; +$_MODULE['<{shipwire}prestashop>shipwire_7ae1032125a8a684fba52b9b6c09ded0'] = 'Ha ocurrido un error en el servidor remoto:'; +$_MODULE['<{shipwire}prestashop>shipwire_45d696d51dc4a18515658aeebddf4179'] = 'Un error desconocido ocurrió con el ID de la orden.'; +$_MODULE['<{shipwire}prestashop>shipwire_b5bccda6d3a04e1d8f79846355290435'] = 'Por favor, introduzca una dirección de correo electrónico válida.'; +$_MODULE['<{shipwire}prestashop>shipwire_76a8cba9f6f6ca77abe5dfb9e56ba994'] = 'Inventario actualizado.'; +$_MODULE['<{shipwire}prestashop>shipwire_e1b21d2b3dae6a61b0937d9e5d483b3a'] = 'Error en la actualización del inventario'; +$_MODULE['<{shipwire}prestashop>shipwire_8d72a4c1a23232d68f7fc3c36bc1ed53'] = 'Transacciones actualizadas.'; +$_MODULE['<{shipwire}prestashop>shipwire_3fa1e76061af98ff1d61c688e2b5283a'] = 'Fallo al actualizar las transacciones.'; +$_MODULE['<{shipwire}prestashop>shipwire_f4725a7b56d133e57f0ff8ccef7861f1'] = 'Orden reenviada satisfactoriamente.'; +$_MODULE['<{shipwire}prestashop>shipwire_7ae3fd45db978dd817e1e023548009b1'] = 'Error al enviar. Inténtelo más tarde.'; +$_MODULE['<{shipwire}prestashop>shipwire_38af966ecd35842058e527c36f17e42f'] = 'Transacciones reenviadas satisfactoriamente.'; +$_MODULE['<{shipwire}prestashop>shipwire_db7972f220d257cc289fef03cbad3779'] = 'Error reenviando transacciones.'; +$_MODULE['<{shipwire}prestashop>shipwire_77ab0beb2c0eb88c3e6375d6355b42d7'] = 'Registros vacíos.'; +$_MODULE['<{shipwire}prestashop>shipwire_b8529249c5c02d3d62cedac39afcfd67'] = 'Error al eliminar registros.'; +$_MODULE['<{shipwire}prestashop>shipwire_63a77eaf9f310dc5def6709c2887dcc4'] = 'Error en la conexión de prueba.'; +$_MODULE['<{shipwire}prestashop>shipwire_527fe8cddad7740fc09d02dbd718a8b8'] = '¡Felicitaciones! Su tienda está ahora conectado a Shipwire.'; +$_MODULE['<{shipwire}prestashop>shipwire_c888438d14855d7d96a2724ee9c306bd'] = 'Configuración actualizada'; +$_MODULE['<{shipwire}prestashop>shipwire_6a26f548831e6a8c26bfbbd9f6ec61e0'] = 'Ayuda'; +$_MODULE['<{shipwire}prestashop>shipwire_de54437623a7b25ea277a303772e0912'] = 'Cómo configurar el módulo de Shipwire:'; +$_MODULE['<{shipwire}prestashop>shipwire_082efcf162e9fc2ce9cd32e13706790b'] = 'Llene el correo electrónico Shipwire y Contraseña con los proporcionados por Shipwire.'; +$_MODULE['<{shipwire}prestashop>shipwire_2a5075cb5b1148436ee37a1ef46e51a6'] = 'Haga clic en \"Guardar configuración\" y luego probar su conexión.'; +$_MODULE['<{shipwire}prestashop>shipwire_727283f37d3e70d3faceb71761d0fb51'] = 'Propósito del módulo :'; +$_MODULE['<{shipwire}prestashop>shipwire_5a2b02068a8824776581bf12ea9b84c0'] = 'La plataforma de la empresa de logística Shipwire le ayudará a reducir costos, incrementar las ventas y ofrecer una gran experiencia para sus clientes. Shipwire asegura que sus órdenes se envíen con rapidez y a un costo menor.'; +$_MODULE['<{shipwire}prestashop>shipwire_fd78097435e14fb77cea008f89beb08a'] = 'Conecte con facilidad sus canales de ventas y expándase en otros, como el comercio social. Utilice los almacenes globales de Shipwire para llegar a más clientes con mayor rapidez y a un costo más bajo.'; +$_MODULE['<{shipwire}prestashop>shipwire_cf628555f89cf93adc51e5a98f74406d'] = 'Quel que soit le volume de vos ventes, les entrepôts automatisés de Shipwire traitent vos commandes rapidement et avec précision, pour des clients Sea cual sea el volumen, los almacenes automatizados de Shipwire procesan sus órdenes de forma rápida y precisa.'; +$_MODULE['<{shipwire}prestashop>shipwire_e8d3449d135b1840e2d5ca638f0d608f'] = 'Credenciales Shipwire'; +$_MODULE['<{shipwire}prestashop>shipwire_ce8ae9da5b7cd6c3df2929543a9af92d'] = 'E-mail'; +$_MODULE['<{shipwire}prestashop>shipwire_dc647eb65e6711e155375218212b3964'] = 'Contraseña'; +$_MODULE['<{shipwire}prestashop>shipwire_9daf1fb753b42c3cdc8f1d01669cd6d8'] = 'Guardar configuración'; +$_MODULE['<{shipwire}prestashop>shipwire_79ddd6cfbf01f63986f7b114ecc2ca95'] = 'Haga clic aquí para Conexión de prueba'; +$_MODULE['<{shipwire}prestashop>shipwire_8d47e6b887cacc0d7d48ce49f403cf7f'] = 'Shipwire y PrestaShop'; +$_MODULE['<{shipwire}prestashop>shipwire_989004cc8be1a096644202bcb9ed5111'] = 'Más información sobre Shipwire en PrestaShop.com'; +$_MODULE['<{shipwire}prestashop>shipwire_dae8ace18bdcbcc6ae5aece263e14fe8'] = 'Opciones'; +$_MODULE['<{shipwire}prestashop>shipwire_858b7d4b9e6c0a1066c76b67492ebfc2'] = 'Estados de pedido que interactuarán con Shipwire'; +$_MODULE['<{shipwire}prestashop>shipwire_fda9efefff2479c9f299cf01757b0354'] = 'Cuando un estado de la orden se actualiza en Shipwire, los estados siguientes se aplicarán a la orden en su tienda.'; +$_MODULE['<{shipwire}prestashop>shipwire_004bf6c9a40003140292e97330236c53'] = 'Acción'; +$_MODULE['<{shipwire}prestashop>shipwire_4bb3e6ea4b1aa93c3429e410129b4be4'] = 'Estado de la orden en su tienda'; +$_MODULE['<{shipwire}prestashop>shipwire_20e85fb909bc0a3f5465e4847a421727'] = 'Enviar orden a Shipwire'; +$_MODULE['<{shipwire}prestashop>shipwire_f6aa2a9d2f9c62fcebed30a12718174e'] = 'Marcar orden como ENVIADO en su tienda.'; +$_MODULE['<{shipwire}prestashop>shipwire_b69c10301eb67f486f8c7b53ef297f3f'] = 'Marcar orden como ENTREGADO en su tienda.'; +$_MODULE['<{shipwire}prestashop>shipwire_5292f1fdc23e0772998728bfe960fafe'] = 'Duración de los registros'; +$_MODULE['<{shipwire}prestashop>shipwire_e166edcc50bf23bd04a651f99af1e6a8'] = 'Borrar registros de transacciones cada'; +$_MODULE['<{shipwire}prestashop>shipwire_2c30957d90dbbb192712f11e183853cd'] = 'dias (recomendado: 30 días)'; +$_MODULE['<{shipwire}prestashop>shipwire_8be66d7d19c88192adcbbe43ca7b5781'] = '--Seleccione uno--'; +$_MODULE['<{shipwire}prestashop>shipwire_af22fc80f66213750302086471651553'] = 'Métodos de Envío'; +$_MODULE['<{shipwire}prestashop>shipwire_241e84e8de91e9c6295063a40e46d175'] = 'Seleccione los métodos de envío que usted aceptará (Tienen que ser único para cada uno.)'; +$_MODULE['<{shipwire}prestashop>shipwire_89d1b3d4a7ffb1bda5a2f5104e5c9536'] = 'Envío terrestre'; +$_MODULE['<{shipwire}prestashop>shipwire_1ab6826e411df2c1c802305135824edf'] = 'Entrega al día siguiente'; +$_MODULE['<{shipwire}prestashop>shipwire_96e85eae3ebdf4f8bb77a5fa381745c5'] = 'Segundo día de entrega'; +$_MODULE['<{shipwire}prestashop>shipwire_569b506f9bc511a1b93035883f3d8f0a'] = 'Entrega internacional'; +$_MODULE['<{shipwire}prestashop>shipwire_23183cd144a4dcc5a599a4b6506f7154'] = 'Guardar opciones'; +$_MODULE['<{shipwire}prestashop>shipwire_ef87224bb79834a8b6e9180a6e9a850b'] = 'Limpiar registro'; +$_MODULE['<{shipwire}prestashop>shipwire_7c100dd5d4dc4f335c54fb59dbd2fb67'] = 'Actualizar Inventario'; +$_MODULE['<{shipwire}prestashop>shipwire_1936d6b9a73b24d6f49a7970d0310e8c'] = 'Inventario Shipwire'; +$_MODULE['<{shipwire}prestashop>shipwire_b4b449bf2a9925610b5ba0dfefeb78a9'] = 'Actualizar Transacciones'; +$_MODULE['<{shipwire}prestashop>shipwire_0af92eb536ec6c250e93a928acff6c42'] = 'Reenviar Transacciones Fallidas'; +$_MODULE['<{shipwire}prestashop>shipwire_d5a65aabf6965a9c075d869273d66b8c'] = 'Transacciones Shipwire'; +$_MODULE['<{shipwire}prestashop>shipwire_cd6ed4022793c016945dc5b9394467d6'] = 'Haga click aqui para reenviar la orden a Shipwire'; +$_MODULE['<{shipwire}prestashop>shipwire_e9d1630ae443a956bfff65409d479fe8'] = 'No hay transacciones disponibles.'; +$_MODULE['<{shipwire}prestashop>shipwire_f246ef453f4bf9f68366c9879964965c'] = 'Cronjob de Shipwire'; +$_MODULE['<{shipwire}prestashop>shipwire_54a0794ef5c2900f26b99596ba230c4f'] = 'Utilice el servicio web de PrestaShop para actualizar su inventario y estados de pedido. Ponga esta URL en el crontab (frecuencia sugerida: Cada 5 horas) o acceda de forma manual todos los días:'; diff --git a/modules/shipwire/fr.php b/modules/shipwire/fr.php new file mode 100644 index 000000000..84b73d845 --- /dev/null +++ b/modules/shipwire/fr.php @@ -0,0 +1,68 @@ +shipwire_e912562384b72ccc478a47019c553dc7'] = 'Shipwire'; +$_MODULE['<{shipwire}prestashop>shipwire_387ef38ac0cb1704e465d537ab8d690d'] = 'La logistique d\'entreprise pour tous'; +$_MODULE['<{shipwire}prestashop>shipwire_621db7652ee0cb6a53c8ca4ec683bae5'] = 'Non envoyé à Shipwire'; +$_MODULE['<{shipwire}prestashop>shipwire_485ed82930e1e53e6da27a11ccf2089b'] = 'Statut Shipwire'; +$_MODULE['<{shipwire}prestashop>shipwire_7ae1032125a8a684fba52b9b6c09ded0'] = 'Une erreur est survenue sur le serveur distant :'; +$_MODULE['<{shipwire}prestashop>shipwire_45d696d51dc4a18515658aeebddf4179'] = 'Une erreur inconnue est survenue avec la référence de la commande.'; +$_MODULE['<{shipwire}prestashop>shipwire_b5bccda6d3a04e1d8f79846355290435'] = 'Veuillez entrer une adresse email valide'; +$_MODULE['<{shipwire}prestashop>shipwire_76a8cba9f6f6ca77abe5dfb9e56ba994'] = 'Stock mis à jour'; +$_MODULE['<{shipwire}prestashop>shipwire_e1b21d2b3dae6a61b0937d9e5d483b3a'] = 'La mise à jour du stock a échoué'; +$_MODULE['<{shipwire}prestashop>shipwire_8d72a4c1a23232d68f7fc3c36bc1ed53'] = 'Les transactions ont été mises à jour'; +$_MODULE['<{shipwire}prestashop>shipwire_3fa1e76061af98ff1d61c688e2b5283a'] = 'La mise à jour des transactions a échoué'; +$_MODULE['<{shipwire}prestashop>shipwire_f4725a7b56d133e57f0ff8ccef7861f1'] = 'Commande correctement renvoyée'; +$_MODULE['<{shipwire}prestashop>shipwire_7ae3fd45db978dd817e1e023548009b1'] = 'Erreur pendant l\'envoi. Réessayez plus tard.'; +$_MODULE['<{shipwire}prestashop>shipwire_38af966ecd35842058e527c36f17e42f'] = 'Les transactions ont été correctement renvoyées.'; +$_MODULE['<{shipwire}prestashop>shipwire_db7972f220d257cc289fef03cbad3779'] = 'Erreur pendant le renvoi des transactions.'; +$_MODULE['<{shipwire}prestashop>shipwire_77ab0beb2c0eb88c3e6375d6355b42d7'] = 'Logs vides.'; +$_MODULE['<{shipwire}prestashop>shipwire_b8529249c5c02d3d62cedac39afcfd67'] = 'Erreur pendant la suppression des logs.'; +$_MODULE['<{shipwire}prestashop>shipwire_63a77eaf9f310dc5def6709c2887dcc4'] = 'Le test de connexion a échoué.'; +$_MODULE['<{shipwire}prestashop>shipwire_527fe8cddad7740fc09d02dbd718a8b8'] = 'Félicitations ! Votre boutique est maintenant liée à Shipwire.'; +$_MODULE['<{shipwire}prestashop>shipwire_c888438d14855d7d96a2724ee9c306bd'] = 'Les paramètres ont correctement été mis à jour.'; +$_MODULE['<{shipwire}prestashop>shipwire_6a26f548831e6a8c26bfbbd9f6ec61e0'] = 'Aide'; +$_MODULE['<{shipwire}prestashop>shipwire_de54437623a7b25ea277a303772e0912'] = 'Comment configurer le module Shipwire :'; +$_MODULE['<{shipwire}prestashop>shipwire_082efcf162e9fc2ce9cd32e13706790b'] = 'Remplir les champs \"Email\" et \"Mot de passe\" avec ceux fournis par Shipwire.'; +$_MODULE['<{shipwire}prestashop>shipwire_2a5075cb5b1148436ee37a1ef46e51a6'] = 'Cliquer sur \"Sauvegarder les paramètres\" puis sur \"Tester la connexion\"'; +$_MODULE['<{shipwire}prestashop>shipwire_727283f37d3e70d3faceb71761d0fb51'] = 'Avantages du module Shipwire :'; +$_MODULE['<{shipwire}prestashop>shipwire_5a2b02068a8824776581bf12ea9b84c0'] = 'La plate-forme logistique de Shipwire vous permet de réduire vos coûts de gestion logistique, augmenter vos ventes, et d\'offrir une excellente expérience d\'achat à vos clients.'; +$_MODULE['<{shipwire}prestashop>shipwire_fd78097435e14fb77cea008f89beb08a'] = 'Les entrepôts de Shipwire, répartis à travers le monde, vous permettent d\'atteindre davantage de clients plus rapidement - à un moindre coût.'; +$_MODULE['<{shipwire}prestashop>shipwire_cf628555f89cf93adc51e5a98f74406d'] = 'Quel que soit le volume de vos ventes, les entrepôts automatisés de Shipwire traitent vos commandes rapidement et avec précision, pour des clients satisfaits !'; +$_MODULE['<{shipwire}prestashop>shipwire_e8d3449d135b1840e2d5ca638f0d608f'] = 'Identifiants Shipwire'; +$_MODULE['<{shipwire}prestashop>shipwire_ce8ae9da5b7cd6c3df2929543a9af92d'] = 'Email'; +$_MODULE['<{shipwire}prestashop>shipwire_dc647eb65e6711e155375218212b3964'] = 'Mot de passe'; +$_MODULE['<{shipwire}prestashop>shipwire_9daf1fb753b42c3cdc8f1d01669cd6d8'] = 'Sauvegarder les paramètres'; +$_MODULE['<{shipwire}prestashop>shipwire_79ddd6cfbf01f63986f7b114ecc2ca95'] = 'Cliquer ici pour tester la connexion'; +$_MODULE['<{shipwire}prestashop>shipwire_8d47e6b887cacc0d7d48ce49f403cf7f'] = 'Shipwire et PrestaShop'; +$_MODULE['<{shipwire}prestashop>shipwire_989004cc8be1a096644202bcb9ed5111'] = 'En savoir plus sur Shipwire sur PrestaShop.com'; +$_MODULE['<{shipwire}prestashop>shipwire_dae8ace18bdcbcc6ae5aece263e14fe8'] = 'Options'; +$_MODULE['<{shipwire}prestashop>shipwire_858b7d4b9e6c0a1066c76b67492ebfc2'] = 'Statuts de commande qui intéragissent avec Shipwire'; +$_MODULE['<{shipwire}prestashop>shipwire_fda9efefff2479c9f299cf01757b0354'] = 'Quand un statut est mis à jour dans Shipwire, les statuts suivant seront appliqués sur la commande dans votre boutique PrestaShop.'; +$_MODULE['<{shipwire}prestashop>shipwire_004bf6c9a40003140292e97330236c53'] = 'Action'; +$_MODULE['<{shipwire}prestashop>shipwire_4bb3e6ea4b1aa93c3429e410129b4be4'] = 'Statut de commande dans votre boutique'; +$_MODULE['<{shipwire}prestashop>shipwire_20e85fb909bc0a3f5465e4847a421727'] = 'Envoyer la commande à Shipwire'; +$_MODULE['<{shipwire}prestashop>shipwire_f6aa2a9d2f9c62fcebed30a12718174e'] = 'Marquer la commande comme \"Envoyée\" dans votre boutique'; +$_MODULE['<{shipwire}prestashop>shipwire_b69c10301eb67f486f8c7b53ef297f3f'] = 'Marquer la commande comme \"Livrée\" dans votre boutique'; +$_MODULE['<{shipwire}prestashop>shipwire_5292f1fdc23e0772998728bfe960fafe'] = 'Sauvegarde des logs'; +$_MODULE['<{shipwire}prestashop>shipwire_e166edcc50bf23bd04a651f99af1e6a8'] = 'Supprimer l\'historique des transactions tous les'; +$_MODULE['<{shipwire}prestashop>shipwire_2c30957d90dbbb192712f11e183853cd'] = 'jours (recommandé : 30 jours)'; +$_MODULE['<{shipwire}prestashop>shipwire_8be66d7d19c88192adcbbe43ca7b5781'] = '-- Choisir --'; +$_MODULE['<{shipwire}prestashop>shipwire_af22fc80f66213750302086471651553'] = 'Méthodes d\'expédition'; +$_MODULE['<{shipwire}prestashop>shipwire_241e84e8de91e9c6295063a40e46d175'] = 'Choisir les méthodes d\'expédition que vous utilisez (une méthode ne peut être associée qu\'une fois)'; +$_MODULE['<{shipwire}prestashop>shipwire_89d1b3d4a7ffb1bda5a2f5104e5c9536'] = 'Transport terrestre'; +$_MODULE['<{shipwire}prestashop>shipwire_1ab6826e411df2c1c802305135824edf'] = 'Livraison le lendemain'; +$_MODULE['<{shipwire}prestashop>shipwire_96e85eae3ebdf4f8bb77a5fa381745c5'] = 'Livraison en 2 jours'; +$_MODULE['<{shipwire}prestashop>shipwire_569b506f9bc511a1b93035883f3d8f0a'] = 'Livraison internationnale'; +$_MODULE['<{shipwire}prestashop>shipwire_23183cd144a4dcc5a599a4b6506f7154'] = 'Sauvegarder les options'; +$_MODULE['<{shipwire}prestashop>shipwire_ef87224bb79834a8b6e9180a6e9a850b'] = 'Vider les logs'; +$_MODULE['<{shipwire}prestashop>shipwire_7c100dd5d4dc4f335c54fb59dbd2fb67'] = 'Mettre à jour le stock'; +$_MODULE['<{shipwire}prestashop>shipwire_1936d6b9a73b24d6f49a7970d0310e8c'] = 'Stock Shipwire'; +$_MODULE['<{shipwire}prestashop>shipwire_b4b449bf2a9925610b5ba0dfefeb78a9'] = 'Rafraîchir les transactions'; +$_MODULE['<{shipwire}prestashop>shipwire_0af92eb536ec6c250e93a928acff6c42'] = 'Renvoyer les transactions en erreur'; +$_MODULE['<{shipwire}prestashop>shipwire_d5a65aabf6965a9c075d869273d66b8c'] = 'Transactions Shipwire'; +$_MODULE['<{shipwire}prestashop>shipwire_cd6ed4022793c016945dc5b9394467d6'] = 'Cliquer ici pour renvoyer la commande à Shipwire'; +$_MODULE['<{shipwire}prestashop>shipwire_e9d1630ae443a956bfff65409d479fe8'] = 'Pas de transaction pour le moment'; +$_MODULE['<{shipwire}prestashop>shipwire_f246ef453f4bf9f68366c9879964965c'] = 'Tâche planifiée Shipwire'; +$_MODULE['<{shipwire}prestashop>shipwire_54a0794ef5c2900f26b99596ba230c4f'] = 'Utilisez le web-service de PrestaShop pour mettre à jour votre stock et le statut des commandes. Mettez cette URL dans la table des tâches planifiées (fréquence suggérée : toutes les 5 heures) ou accédez-y manuellement une fois par jour :'; diff --git a/modules/shipwire/index.php b/modules/shipwire/index.php new file mode 100644 index 000000000..d69acffb4 --- /dev/null +++ b/modules/shipwire/index.php @@ -0,0 +1,36 @@ + +* @copyright 2007-2012 PrestaShop SA +* @version Release: $Revision: 14009 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); +header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT"); + +header("Cache-Control: no-store, no-cache, must-revalidate"); +header("Cache-Control: post-check=0, pre-check=0", false); +header("Pragma: no-cache"); + +header("Location: ../"); +exit; diff --git a/modules/shipwire/lib/SWCurl.php b/modules/shipwire/lib/SWCurl.php new file mode 100644 index 000000000..7d9f8d78a --- /dev/null +++ b/modules/shipwire/lib/SWCurl.php @@ -0,0 +1,111 @@ + +* @copyright 2007-2012 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +/// @todo document and handle errors +class SWCurl +{ + /** @var _ch Curl Handler Resource */ + private $_ch; + /** @var _url Url to call */ + private $_url; + /** @var _lastResponse Last HTTP response fetched */ + private $_lastResponse; + /** @var _params Array containing data for Methods */ + private $_params; + + public function __construct($url = null, $sslCheck = true) + { + $this->_ch = curl_init(); + $this->_url = $url; + /* $this->_setOpt(CURLOPT_HEADER, true); */ + /* $this->_setOpt(CURLINFO_HEADER_OUT, true); */ + $this->_setOpt(CURLOPT_RETURNTRANSFER, true); + if (!$sslCheck) + $this->_setOpt(CURLOPT_SSL_VERIFYPEER, false); + } + + public function __destruct() + { + curl_close($this->_ch); + } + + private function _setOpt($flag, $value) + { + curl_setopt($this->_ch, $flag, $value); + } + + public function setPostMethod(Array $params) + { + $this->_params['POST'] = http_build_query($params); + curl_setopt($this->_ch, CURLOPT_POST, true); + curl_setopt($this->_ch, CURLOPT_POSTFIELDS, $this->_params['POST']); + } + + public function setCustomPost($paramString) + { + curl_setopt($this->_ch, CURLOPT_POST, true); + curl_setopt($this->_ch, CURLOPT_POSTFIELDS, $paramString); + $this->_params['POST'] = $paramString; + } + + public function setHttpHeader(Array $headers) + { + curl_setopt($this->_ch, CURLOPT_HTTPHEADER, $headers); + } + + public function setGetParams(Array $params) + { + $this->_params['GET'] = http_build_query($params); + } + + public function send($url = null) + { + if (!$url) + $url = $this->_url; + if (!$url) + return false; + + if (isset($this->_params['GET'])) + $url .= '?'.$this->_params['GET']; + + curl_setopt($this->_ch, CURLOPT_URL, $url); + $this->_lastResponse = curl_exec($this->_ch); + + if ($this->_lastResponse === false) + { + trigger_error('Curl error: '.curl_error($this->_ch), E_USER_WARNING); + return false; + } + + return $this->_lastResponse; + } + + public function getLastResponse() + { + return $this->_lastResponse; + } +} diff --git a/modules/shipwire/lib/ShipwireApi.php b/modules/shipwire/lib/ShipwireApi.php new file mode 100644 index 000000000..53aec2c37 --- /dev/null +++ b/modules/shipwire/lib/ShipwireApi.php @@ -0,0 +1,133 @@ + +* @copyright 2007-2012 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +/* Security */ +if (!defined('_PS_VERSION_')) + exit; + +class ShipwireApi +{ + protected $_configVars = array( + 'SHIPWIRE_API_SERVER' => '', + 'SHIPWIRE_API_USER' => '', + 'SHIPWIRE_API_PASSWD' => '', + 'SHIPWIRE_API_CONNECTED' => '', + 'SHIPWIRE_API_MODE' => '', + 'SHIPWIRE_WAREHOUSE' => '', + 'SHIPWIRE_ACCOUNT_NAME' => '', + 'SHIPWIRE_TRACKING_LAST_DATE' => '', + 'SHIPWIRE_COMMIT_ID' => '', + 'SHIPWIRE_SENT_ID' => '', + 'SHIPWIRE_DELIVERED_ID' => '', + ); + + /** @var _xml Array with header body and footer of the final xml */ + public $_xml = array(); + + /** @var _mode Sets the connection mode: Test | Production */ + protected $_mode = 'Production'; + + /** @var _urlConn URL to connect to at Shipwire's end */ + + protected $_url = array( + 'inventoryUpdate' => array( + 'Test' => 'https://api.beta.shipwire.com/exec/InventoryServices.php', + 'Production' => 'https://api.shipwire.com/exec/InventoryServices.php', + 'prefix' => 'InventoryUpdateXML', + ), + 'fulfillmentServices' => array( + 'Test' => 'https://api.beta.shipwire.com/exec/FulfillmentServices.php', + 'Production' => 'https://api.shipwire.com/exec/FulfillmentServices.php', + 'prefix' => 'OrderListXML', + ), + 'trackingUpdate' => array( + 'Test' => 'https://api.beta.shipwire.com/exec/TrackingServices.php', + 'Production' => 'https://api.shipwire.com/exec/TrackingServices.php', + 'prefix' => 'TrackingUpdateXML', + ), + ); + + // protected $_url = array( + // 'inventoryUpdate' => array( + // 'Test' => 'https://api.beta.shipwire.com/exec/InventoryServices.php', + // 'Production' => 'https://api.beta.shipwire.com/exec/InventoryServices.php', + // 'prefix' => 'InventoryUpdateXML', + // ), + // 'fulfillmentServices' => array( + // 'Test' => 'https://api.beta.shipwire.com/exec/FulfillmentServices.php', + // 'Production' => 'https://api.beta.shipwire.com/exec/FulfillmentServices.php', + // 'prefix' => 'OrderListXML', + // ), + // 'trackingUpdate' => array( + // 'Test' => 'https://api.beta.shipwire.com/exec/TrackingServices.php', + // 'Production' => 'https://api.beta.shipwire.com/exec/TrackingServices.php', + // 'prefix' => 'TrackingUpdateXML', + // ), + // ); + + public function __construct() + { + foreach ($this->_configVars as $key => $v) + $this->_configVars[$key] = Configuration::get($key); + + if (Configuration::get('PS_CIPHER_ALGORITHM')) + $this->_cipherTool = new Rijndael(_RIJNDAEL_KEY_, _RIJNDAEL_IV_); + else + $this->_cipherTool = new Blowfish(_COOKIE_KEY_, _COOKIE_IV_); + + $this->_configVars['SHIPWIRE_API_PASSWD'] = Tools::safeOutput($this->_cipherTool->decrypt($this->_configVars['SHIPWIRE_API_PASSWD'])); + $this->_configVars['SHIPWIRE_API_MODE'] = $this->_mode; + } + + public function sendData($xmlTagFields = array()) + { + $xmlDocument = $this->_buildXMLDoc(); + + $urlConn = new SWCurl($this->_url[$this->_apiType][$this->_mode], false); + $urlConn->setCustomPost($this->_url[$this->_apiType]['prefix'].'='.urlencode($xmlDocument)); + + $action = $urlConn->send(); + + $xml = simplexml_load_string($urlConn->getLastResponse()); + $json = json_encode($xml); + + return json_decode($json,TRUE); + } + + private function _buildXMLDoc() + { + $xmlDocument = ''; + foreach ($this->_xml['header'] as $header) + $xmlDocument .= $header; + foreach ($this->_xml['body'] as $body) + $xmlDocument .= $body; + foreach ($this->_xml['footer'] as $footer) + $xmlDocument .= $footer; + + return $xmlDocument; + } +} diff --git a/modules/shipwire/lib/ShipwireInventoryUpdate.php b/modules/shipwire/lib/ShipwireInventoryUpdate.php new file mode 100644 index 000000000..2765f72d6 --- /dev/null +++ b/modules/shipwire/lib/ShipwireInventoryUpdate.php @@ -0,0 +1,61 @@ + +* @copyright 2007-2012 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +/* Security */ +if (!defined('_PS_VERSION_')) + exit; + +class ShipwireInventoryUpdate extends ShipwireApi +{ + protected $_apiType = 'inventoryUpdate'; + + public function __construct($apiUser, $apiPasswd) + { + $this->_xml['header'][] = + ''. + ''.$apiUser.''. + ''.$apiPasswd.''. + ''.$this->_configVars['SHIPWIRE_API_MODE'].''. + '7403'. + ' + + '; + + $this->_xml['body'][] = ''; + $this->_xml['footer'][] = ''; + } + + public function getInventory($field = NULL) + { + $result = $this->sendData(); + + if (!empty($field) && isset($result[$field])) + $result = $result[$field]; + + return $result; + } +} diff --git a/modules/shipwire/lib/ShipwireOrder.php b/modules/shipwire/lib/ShipwireOrder.php new file mode 100644 index 000000000..12282ccc4 --- /dev/null +++ b/modules/shipwire/lib/ShipwireOrder.php @@ -0,0 +1,91 @@ + +* @copyright 2007-2012 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +/* Security */ +if (!defined('_PS_VERSION_')) + exit; + +class ShipwireOrder extends ShipwireApi +{ + protected $_apiType = 'fulfillmentServices'; + + public function __construct() + { + parent::__construct(); + + $this->_configVars['SHIPWIRE_ACCOUNT_NAME'] = ''; + + $this->_xml['header'] = array( + '',// StorAccountName="'.$this->_configVars['SHIPWIRE_ACCOUNT_NAME'].'">', + ''.$this->_configVars['SHIPWIRE_API_USER'].'', + ''.$this->_configVars['SHIPWIRE_API_PASSWD'].'', + ''.$this->_configVars['SHIPWIRE_API_MODE'].'', + '7403', + ); + $this->_xml['body'][] = ''; + $this->_xml['footer'][] = ''; + } + + public function addOrder($values, $refresh = false) + { + foreach ($values as &$v) + if (!empty($v) && !is_array($v)) + $v = pSQL($v); + + if (!$refresh) + $this->_xml['body'] = array( + '', + ''.$this->_configVars['SHIPWIRE_WAREHOUSE'].'', +// ''.$values['sameDay'].'', + '', + ''.$values['name'].'', + ''.$values['address1'].'', + ''.$values['address2'].'', + ''.$values['city'].'', + ''.$values['country'].'', + ''.$values['zip'].'', + ''.$values['phone'].'', + ''.$values['mail'].'', + '', + ''.$values['shippingType'].'', + ); + else + $this->_xml['body'] = array(''); + + $i = 0; + foreach ($values['packageList'] as $item) + { + $this->_xml['body'][] = ''; + $this->_xml['body'][] = ''.$item['code'].''; + $this->_xml['body'][] = ''.$item['quantity'].''; + $this->_xml['body'][] = ''; + } + + $this->_xml['body'][] = ''; + } + +} diff --git a/modules/shipwire/lib/ShipwireTracking.php b/modules/shipwire/lib/ShipwireTracking.php new file mode 100644 index 000000000..b4c88f095 --- /dev/null +++ b/modules/shipwire/lib/ShipwireTracking.php @@ -0,0 +1,188 @@ + +* @copyright 2007-2012 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +if (!defined('_PS_VERSION_')) + require(dirname(__FILE__).'/../../../config/config.inc.php'); + +if (!class_exists('Shipwire')) + require(dirname(__FILE__).'/../shipwire.php'); + +class ShipwireTracking extends ShipwireApi +{ + protected $_apiType = 'trackingUpdate'; + + public function __construct() + { + parent::__construct(); + + $this->_configVars['SHIPWIRE_ACCOUNT_NAME'] = ''; + + $this->_xml['header'] = array( + '', + ''.$this->_configVars['SHIPWIRE_API_USER'].'', + ''.$this->_configVars['SHIPWIRE_API_PASSWD'].'', + ''.$this->_configVars['SHIPWIRE_API_MODE'].'', + '7403', + ); + $this->_xml['body'] = array(); + $this->_xml['footer'][] = ''; + } + + public function retrieveFromTransacId($transactionId) + { + $this->_xml['body'][] = ''.pSQL($transactionId).''; + } + + public function retrieveFromOrderId($orderId) + { + $this->_xml['body'][] = ''.pSQL($orderId).''; + } + + public function retrieveFull() + { + $this->_xml['body'][] = '1'; + } + + public function retrieveNew() + { + $this->_xml['body'][] = '3'; + } + + /* + * @brief Updates tracking info in local database. + * Declared as a static method so shipwire.php can access it thru autoload + */ + public static function updateTracking($static = false) + { + return updateTracking($static); + } +} + +function updateTracking($static = false) +{ + $api = new ShipwireTracking(); + $api->retrieveFull(); + $d = $api->sendData(); + + if ($d['Status']) + if ($static) + return false; + else + die('KO'); + + if ($d['TotalOrders'] > 0) + { + foreach ($d['Order'] as $order) + { + $o = array(); + if (isset($order['@attributes'])) + $o = $order['@attributes']; + + if (!isset($o['id'])) + { + Logger::addLog('Shipwire: Order ID not defined. >>>>'.print_r($d, true).'<<<<', 4); + continue; + } + + $orderExists = Db::getInstance()->ExecuteS('SELECT `id_order` + FROM `'._DB_PREFIX_.'shipwire_order` + WHERE `id_order` = '.(int)$o['id'].' LIMIT 1'); + + if (isset($orderExists[0]['id_order']) && !empty($orderExists[0]['id_order'])) + { + Db::getInstance()->Execute('UPDATE `'._DB_PREFIX_.'shipwire_order` SET ' + .(isset($order['TrackingNumber']) ? '`tracking_number` = \''.pSQL($order['TrackingNumber']).'\',' : '') + .(isset($o['shipped']) ? '`shipped` = \''.pSQL($o['shipped']).'\'' : '') + .(isset($o['shipper']) ? ',`shipper` = \''.pSQL($o['shipper']).'\'' : '') + .(isset($o['shipDate']) ? ',`shipDate` = \''.pSQL($o['shipDate']).'\'' : '') + .(isset($o['expectedDeliveryDate']) ? ',`expectedDeliveryDate` = \''.pSQL($o['expectedDeliveryDate']).'\'' : '') + .(isset($o['href']) ? ',`href` = \''.pSQL($o['href']).'\'' : '') + .(isset($o['shipperFullName']) ? ',`shipperFullName` = \''.pSQL($o['shipperFullName']).'\'' : '') + .' WHERE `id_order` = '.(int)$o['id']); + } + else + { + Db::getInstance()->Execute('INSERT INTO `'._DB_PREFIX_.'shipwire_order` + (`id_order`, `tracking_number`, `shipped`, `shipper`, `shipDate`, `expectedDeliveryDate`, `href`, `shipperFullName`) + VALUES ( + \''.pSQL($o['id']).'\'' + .(isset($order['TrackingNumber']) ? ',\''.pSQL($order['TrackingNumber']).'\'' : ',\'\'') + .(isset($o['shipped']) ? ',\''.pSQL($o['shipped']).'\'' : ',\'\'') + .(isset($o['shipper']) ? ',\''.pSQL($o['shipper']).'\'' : ',\'\'') + .(isset($o['shipDate']) ? ',\''.pSQL($o['shipDate']).'\'' : ',\'\'') + .(isset($o['expectedDeliveryDate']) ? ',\''.pSQL($o['expectedDeliveryDate']).'\'' : ',\'\'') + .(isset($o['href']) ? ',\''.pSQL($o['href']).'\'' : ',\'\'') + .(isset($o['shipperFullName']) ? ',\''.pSQL($o['shipperFullName']).'\'' : ',\'\'') + .')'); + } + + $result = Db::getInstance()->getValue('SELECT `transaction_ref` + FROM `'._DB_PREFIX_.'shipwire_order` + WHERE `id_order` = '.(int)$o['id']); + if (empty($result)) + { + $module = new Shipwire(); + $module->updateOrderStatus((int)$o['id'], true); + } + + if (isset($order['TrackingNumber'])) + { + Db::getInstance()->Execute('UPDATE `'._DB_PREFIX_.'orders` + SET `shipping_number` = \''.pSQL($order['TrackingNumber']).'\' + WHERE `id_order` = '.(int)$o['id']); + if ($o['id']) + { + $psOrder = new Order($o['id']); + if ($psOrder->id) + { + $history = new OrderHistory(); + $history->id_order = $o['id']; + if (isset($o['shipped']) && $o['shipped'] == 'YES') + $history->changeIdOrderState(Configuration::get('SHIPWIRE_SENT_ID'), $o['id']); + + $history->addWithemail(); + } + } + } + } + } + + if (Configuration::get('PS_CIPHER_ALGORITHM')) + $cipherTool = new Rijndael(_RIJNDAEL_KEY_, _RIJNDAEL_IV_); + else + $cipherTool = new Blowfish(_COOKIE_KEY_, _COOKIE_IV_); + + $shipWireInventoryUpdate = new ShipwireInventoryUpdate(Configuration::get('SHIPWIRE_API_USER'), + $cipherTool->decrypt(Configuration::get('SHIPWIRE_API_PASSWD'))); + $shipWireInventoryUpdate->getInventory(); + + if ($static) + return true; + else + die('OK'); + +} diff --git a/modules/shipwire/lib/index.php b/modules/shipwire/lib/index.php new file mode 100644 index 000000000..d69acffb4 --- /dev/null +++ b/modules/shipwire/lib/index.php @@ -0,0 +1,36 @@ + +* @copyright 2007-2012 PrestaShop SA +* @version Release: $Revision: 14009 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); +header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT"); + +header("Cache-Control: no-store, no-cache, must-revalidate"); +header("Cache-Control: post-check=0, pre-check=0", false); +header("Pragma: no-cache"); + +header("Location: ../"); +exit; diff --git a/modules/shipwire/logo.gif b/modules/shipwire/logo.gif new file mode 100644 index 0000000000000000000000000000000000000000..a82ff439f88011824d4c930f95329a8cae380bd0 GIT binary patch literal 162 zcmZ?wbhEHb6krfwc+AQ0y~5*1mHUrc*PlJszvdbI+a>$|KEwZ~4F8`o{Kp0q{|P!5 zr6!i7rYMwWmSiZnd-?`2DE?$& +* @copyright 2007-2012 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +/* Security */ +if (!defined('_PS_VERSION_')) + exit; + +spl_autoload_register('shipwireAutoload'); + +class Shipwire extends Module +{ + /** @var _cipherTool Helper Object to encrypt API KEY */ + private $_cipherTool; + + /** @var dParams Array replacing smarty (display parameters) */ + private $dParams = array(); + + /** @const _SHIPWIRE_SERVER Shipwire server url */ + private $_configVars = array( + 'SHIPWIRE_API_SERVER' => '', + 'SHIPWIRE_API_USER' => '', + 'SHIPWIRE_API_PASSWD' => '', + 'SHIPWIRE_API_CONNECTED' => '', + 'SHIPWIRE_API_MODE' => '', + 'SHIPWIRE_WAREHOUSE' => '', + 'SHIPWIRE_ACCOUNT_NAME' => '', + 'SHIPWIRE_TRACKING_LAST_DATE' => '', + 'SHIPWIRE_COMMIT_ID' => '', + 'SHIPWIRE_SENT_ID' => '', + 'SHIPWIRE_DELIVERED_ID' => '', + ); + + /** @var _shipWireInventoryUpdate Shipwire Api Object */ + private $_shipWireInventoryUpdate; + + /******************************************************************/ + /** Construct Method **********************************************/ + /******************************************************************/ + public function __construct() + { + $this->_initContext(); + + $this->name = 'shipwire'; + $this->tab = 'administration'; + $this->version = '1.1.3'; + $this->author = 'PrestaShop'; + + parent::__construct(); + + $this->displayName = $this->l('Shipwire'); + $this->description = $this->l('Enterprise logistics for everyone.'); + + if (Configuration::get('PS_CIPHER_ALGORITHM')) + $this->_cipherTool = new Rijndael(_RIJNDAEL_KEY_, _RIJNDAEL_IV_); + else + $this->_cipherTool = new Blowfish(_COOKIE_KEY_, _COOKIE_IV_); + + $this->_shipWireInventoryUpdate = new ShipwireInventoryUpdate(Configuration::get('SHIPWIRE_API_USER'), $this->_cipherTool->decrypt(Configuration::get('SHIPWIRE_API_PASSWD'))); + $this->_shipWireOrder = new ShipwireOrder(); + } + + /** + * @brief Make the module compatible 1.4/1.5 + */ + private function _initContext() + { + $this->dParams['base_dir'] = __PS_BASE_URI__; + + if (class_exists('Context') && function_exists('getContent')) + $this->context = Context::getContent(); + else + { + global $smarty, $cookie; + + $this->context = new StdClass(); + $this->context->smarty = $smarty; + $this->context->cookie = $cookie; + $this->context->shop = new StdClass(); + $this->context->shop->id = 1; + $this->context->shop->id_group_shop = 1; + } + + $this->_loadConfiguration(); + } + + private function _loadConfiguration() + { + foreach ($this->_configVars as $key => $v) + $this->_configVars[$key] = Configuration::get($key); + } + + /** + * @brief Install/Uninstall Configuration variables + * + * @param install True for installation, false for uninstall + * + * @return Success or failure + */ + private function _setupConfigVariables($install = true) + { + $configVars = array( + 'SHIPWIRE_API_SERVER' => '', + 'SHIPWIRE_API_USER' => '', + 'SHIPWIRE_API_PASSWD' => '', + 'SHIPWIRE_API_CONNECTED' => 0, + 'SHIPWIRE_ACCOUNT_NAME' => '', + 'SHIPWIRE_API_MODE' => 'Test', + 'SHIPWIRE_WAREHOUSE' => '00', + 'SHIPWIRE_TRACKING_LAST_DATE' => 0, + 'SHIPWIRE_COMMIT_ID' => 2, + 'SHIPWIRE_SENT_ID' => 4, + 'SHIPWIRE_DELIVERED_ID' => 5, + 'SHIPWIRE_LOG_LIFE' => 10, + ); + + $error = 0; + foreach ($configVars as $varName => $value) + if ($install) + $error += Configuration::updateValue($varName, $value) ? 0 : 1; + else + $error += Configuration::deleteByName($varName) ? 0 : 1; + + return !$error; + } + + /******************************************************************/ + /** Install / Uninstall Methods ***********************************/ + /******************************************************************/ + public function install() + { + // Setup config variable with 'install' flag on + if (!$this->_setupConfigVariables(true)) + return false; + + if (!parent::install() || !$this->registerHook('backOfficeTop') || !$this->registerHook('updateOrderStatus')) + return false; + + // Perform the sql install + include(dirname(__FILE__).'/sql/sql-install.php'); + foreach ($sql as $s) + if (!Db::getInstance()->Execute($s)) + return false; + + return true; + } + + /** + * @brief Uninstall function + * + * @return Success or failure + */ + public function uninstall() + { + // Uninstall parent and unregister Configuration + if (!parent::uninstall()) + return false; + + // Unregister hook + if (!$this->unregisterHook('backOfficeTop') || !$this->unregisterHook('updateOrderStatus')) + return false; + + // Remove configuration variable with 'install' flag off + if (!$this->_setupConfigVariables(false)) + return false; + + // Uninstall SQL + include(dirname(__FILE__).'/sql/sql-uninstall.php'); + foreach ($sql as $s) + if (!Db::getInstance()->Execute($s)) + return false; + + return true; + } + + /** + * @brief hookBackOfficeTop Implementation. + * + * Hook that allow to add script anywhere in the backoffice. + * + * @return Render to display + */ + public function hookBackOfficeTop() + { + $r = array(); + if (isset($_GET['id_order'])) + $r = Db::getInstance()->ExecuteS('SELECT `id_order`, `transaction_ref`, `order_ref`, `status` + FROM `'._DB_PREFIX_.'shipwire_order` + WHERE `id_order` = '.(int)$_GET['id_order']); + + $status = isset($r[0]['status']) && !empty($r[0]['status']) ? ucfirst($r[0]['status']) : $this->l('Not sent to Shipwire.'); + + echo ' + '; + } + + /** + * @brief hookUpdateOrderStatus Implementation. + * + * @return ? + */ + public function hookUpdateOrderStatus($params) + { + $orderStatusId = $params['newOrderStatus']->id; + + // We check the orderstatus + if ($orderStatusId != $this->_configVars['SHIPWIRE_COMMIT_ID']) + return false; + + // Check that the order was not already commited to Shipwire + $r = Db::getInstance()->ExecuteS('SELECT `id_order`, `transaction_ref`, `order_ref`, `status` + FROM `'._DB_PREFIX_.'shipwire_order` + WHERE `id_order` = '.(int)$params['id_order']); + if (!(isset($r[0]['transaction_ref']) && !empty($r[0]['transaction_ref']))) + { + $this->updateOrderStatus($params['id_order']); + ShipwireTracking::updateTracking(true); + } + + return true; + } + + public function updateOrderStatus($idOrder, $refresh = false) + { + $order = new Order($idOrder); + if (!$order->id) + return false; + + $address = new Address($order->id_address_delivery); + $customer = new Customer($order->id_customer); + $carrier = new Carrier($order->id_carrier); + $cart = new Cart($order->id_cart); + + $products = $cart->getProducts(); + + $packageList = array(); + foreach ($products as $product) + { + $packageList[] = array( + 'code' => (!empty($product['reference']) ? pSQL($product['reference']) : (int)$product['id_product_attribute']), // SKU + 'quantity' => (int)$product['cart_quantity'], + ); + } + + switch ($order->id_carrier) + { + default: + case Configuration::get('SHIPWIRE_GD') : + $shippingType = 'GD'; + break; + case Configuration::get('SHIPWIRE_1D') : + $shippingType = '1D'; + break; + case Configuration::get('SHIPWIRE_2D') : + $shippingType = '2D'; + break; + case Configuration::get('SHIPWIRE_INTL') : + $shippingType = 'INTL'; + break; + } + + $this->_shipWireOrder->addOrder(array( + 'orderId' => $order->id, + 'name' => $customer->firstname.'.'.$customer->lastname, + 'address1' => $address->address1, + 'address2' => $address->address2, + 'city' => $address->city, + 'country' => $address->country, + 'zip' => $address->postcode, + 'phone' => $address->phone, + 'mail' => $customer->email, + 'shippingType' => $shippingType, + 'packageList' => $packageList, + ), $refresh); + + $r = $this->_shipWireOrder->sendData(); + + if ($r['Status']) + $this->_displayConfirmation($this->l('An error occured on the remote server: ').$r['ErrorMessage'], 'error'); + + foreach ($r['OrderInformation'] as $o) + { + if ($o['@attributes']['number'] != $order->id) + $this->_displayConfirmation($this->l('An unkown error occured with order Id.'), 'error'); + //$val = Db::getInstance()->getValue('SELECT `transaction_ref` FROM `'._DB_PREFIX_.'shipwire_order` WHERE `id_order` = '.(int)$order->id); + + $orderExists = Db::getInstance()->ExecuteS('SELECT `id_order` FROM `'._DB_PREFIX_.'shipwire_order` WHERE `id_order` = '.(int)$order->id.' LIMIT 1'); + if (isset($orderExists[0]['id_order']) && !empty($orderExists[0]['id_order'])) + { + Db::getInstance()->Execute('UPDATE `'._DB_PREFIX_.'shipwire_order` + SET `transaction_ref` = \''.pSQL($o['@attributes']['id']).'\', + `order_ref` = \''.pSQL($o['@attributes']['number']).'\', + `status` = \''.pSQL($o['@attributes']['status']).'\' + WHERE `id_order` = '.(int)$order->id); + } + else + { + Db::getInstance()->Execute('INSERT INTO `'._DB_PREFIX_.'shipwire_order` + (`id_order`, `transaction_ref`, `status`) + VALUES ( + \''.pSQL($order->id).'\'' + .(isset($o['id']) ? ',\''.pSQL($o['id']).'\'' : ',\'\'') + .(isset($o['status']) ? ',\''.pSQL($o['status']).'\'' : ',\'\'') + .')'); + } + $this->log((int)$order->id, $o['@attributes']['id']); + } + + return true; + } + + /** + * @brief Empty all tables of the module. + */ + private function _clearTables() + { + /// @todo : check if this method is used + if (!Db::getInstance()->Execute('TRUNCATE `'._DB_PREFIX_.'shipwire_order`') || + Db::getInstance()->Execute('TRUNCATE `'._DB_PREFIX_.'shipwire_stock`')) + return false; + return true; + } + + /** + * @brief Main Form Method + * + * @return Rendered form + */ + public function getContent() + { + if (Tools::isSubmit('SubmitShipwireSettings')) + { + if (Validate::isEmail(Tools::getValue('shipwire_api_user'))) + { + Configuration::updateValue('SHIPWIRE_API_CONNECTED', 0); + Configuration::updateValue('SHIPWIRE_API_USER', + Tools::getValue('shipwire_api_user')); + Configuration::updateValue('SHIPWIRE_API_PASSWD', + $this->_cipherTool->encrypt(Tools::getValue('shipwire_api_passwd'))); + + $this->dParams['confirmMessage'] = $this->_displayConfirmation(); + Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'shipwire_order`'); + Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'shipwire_stock`'); + } + else + $this->dParams['confirmMessage'] = $this->_displayConfirmation($this->l('Please enter a valid email address.'), 'error'); + } + elseif (Tools::isSubmit('SubmitShipwireTestConnection')) + { + $connectionTestResult = $this->_testConnection(); + } + elseif (Tools::isSubmit('SubmitShipwireOptions')) + { + $duplicates = 0; + + Configuration::updateValue('SHIPWIRE_COMMIT_ID', (int)Tools::getValue('shipwire_commit_id')); + Configuration::updateValue('SHIPWIRE_SENT_ID', (int)Tools::getValue('shipwire_sent_id')); + Configuration::updateValue('SHIPWIRE_DELIVERED_ID', (int)Tools::getValue('shipwire_delivered_id')); + Configuration::updateValue('SHIPWIRE_LOG_LIFE', ((int)Tools::getValue('shipwire_log_life') < 1 ? 1 : (int)Tools::getValue('shipwire_log_life'))); + // Carrier selection + //GD + if ((Tools::getValue('shipwire_gd') != Tools::getValue('shipwire_1d') + && Tools::getValue('shipwire_gd') != Tools::getValue('shipwire_2d') + && Tools::getValue('shipwire_gd') != Tools::getValue('shipwire_intl')) + || Tools::getValue('shipwire_gd') == 0) + Configuration::updateValue('SHIPWIRE_GD', (int)Tools::getValue('shipwire_gd')); + else + $duplicates = 1; + + //1d + if ((Tools::getValue('shipwire_1d') != Tools::getValue('shipwire_gd') + && Tools::getValue('shipwire_1d') != Tools::getValue('shipwire_2d') + && Tools::getValue('shipwire_1d') != Tools::getValue('shipwire_intl')) + || Tools::getValue('shipwire_1d') == 0) + Configuration::updateValue('SHIPWIRE_1D', (int)Tools::getValue('shipwire_1d')); + else + $duplicates = 1; + + //2d + if ((Tools::getValue('shipwire_2d') != Tools::getValue('shipwire_gd') + && Tools::getValue('shipwire_2d') != Tools::getValue('shipwire_1d') + && Tools::getValue('shipwire_2d') != Tools::getValue('shipwire_intl')) + || Tools::getValue('shipwire_2d') == 0) + Configuration::updateValue('SHIPWIRE_2D', (int)Tools::getValue('shipwire_2d')); + else + $duplicates = 1; + + //INTL + if ((Tools::getValue('shipwire_intl') != Tools::getValue('shipwire_gd') + && Tools::getValue('shipwire_intl') != Tools::getValue('shipwire_1d') + && Tools::getValue('shipwire_intl') != Tools::getValue('shipwire_2d')) + || Tools::getValue('shipwire_intl') == 0) + Configuration::updateValue('SHIPWIRE_INTL', (int)Tools::getValue('shipwire_intl')); + else + $duplicates = 1; + + //Check for errors + if ($duplicates) + $this->dParams['confirmMessage'] = $this->_displayConfirmation($this->l('The shipping methods were not saved + because duplicate values are not allowed.'), 'warn'); + else + $this->dParams['confirmMessage'] = $this->_displayConfirmation(); + } + elseif (Tools::isSubmit('SubmitUpdateStock')) + { + if ($this->_shipWireInventoryUpdate->getInventory()) + $this->dParams['confirmMessage'] = $this->_displayConfirmation($this->l('Stock updated.')); + else + $this->dParams['confirmMessage'] = $this->_displayConfirmation($this->l('Stock update failed'), 'error'); + } + elseif (Tools::isSubmit('SubmitUpdateTracking')) + { + if (ShipwireTracking::updateTracking(true)) + $this->dParams['confirmMessage'] = $this->_displayConfirmation($this->l('Transactions updated.')); + else + $this->dParams['confirmMessage'] = $this->_displayConfirmation($this->l('Transactions update failed.'), 'error'); + } + elseif (Tools::isSubmit('resend_id_order')) + { + if ($this->updateOrderStatus($_POST['resend_id_order'])) + $this->dParams['confirmMessage'] = $this->_displayConfirmation($this->l('Order successfully resent.')); + else + $this->dParams['confirmMessage'] = $this->_displayConfirmation($this->l('Error while sending. Try again later.'), 'error'); + } + elseif (Tools::isSubmit('SubmitResendFailedTransactions')) + { + $d = Db::getInstance()->ExecuteS('SELECT `id_order` + FROM `'._DB_PREFIX_.'shipwire_order` + WHERE `transaction_ref` IS NULL OR `transaction_ref` = \'\''); + foreach ($d as $line) + $this->updateOrderStatus($line['id_order']); + + if (ShipwireTracking::updateTracking(true)) + $this->dParams['confirmMessage'] = $this->_displayConfirmation($this->l('Transactions successfully resent.')); + else + $this->dParams['confirmMessage'] = $this->_displayConfirmation($this->l('Error resending transactions.'), 'error'); + } + elseif (Tools::isSubmit('SubmitCleanLogs')) + { + if (Db::getInstance()->Execute('TRUNCATE `'._DB_PREFIX_.'shipwire_log`')) + $this->dParams['confirmMessage'] = $this->_displayConfirmation($this->l('Logs empty.')); + else + $this->dParams['confirmMessage'] = $this->_displayConfirmation($this->l('Error deleting logs.'), 'error'); + } + + $confValues = Configuration::getMultiple(array( + 'SHIPWIRE_API_USER', + 'SHIPWIRE_API_PASSWD')); + + /// @todo : check if these assigns are necessary + $this->dParams['defaultOriginServerURL'] = 'http://'.Configuration::get('PS_SHOP_DOMAIN').__PS_BASE_URI__; + + $this->dParams['serverRequestUri'] = Tools::safeOutput($_SERVER['REQUEST_URI']); + $this->dParams['displayName'] = Tools::safeOutput($this->displayName); + + if (isset($connectionTestResult)) + $this->dParams['connectionTestResult'] = $connectionTestResult; + + if (isset($confValues['SHIPWIRE_API_USER'])) + $this->dParams['apiEmail'] = Tools::safeOutput($confValues['SHIPWIRE_API_USER']); + if (isset($confValues['SHIPWIRE_API_PASSWD'])) + $this->dParams['apiPasswd'] = Tools::safeOutput($this->_cipherTool->decrypt($confValues['SHIPWIRE_API_PASSWD'])); + return $this->_displayContent(); + } + + /** + * @brief Test the conenction to Shipwire and the credentials. + * + * In order to test that, we just try to get the pullzones amd we check if + * the server reply the errorCode 0. If can't connect or other errorCode, then + * there is something wrong. + * + * @return True if the connection is OK, false otherwise + */ + private function _testConnection() + { + + if ($this->_shipWireInventoryUpdate->getInventory('Status') == 'Error') + return array(' + '.$this->l('Connection Test Failed.').'', + '#FFD8D8', false); + + Configuration::updateValue('SHIPWIRE_API_CONNECTED', 1); + return array(' + '.$this->l('Congratulations! Your store is now linked to Shipwire.').' + + ', + '#D6F5D6', true); + + } + + /* + ** Display a custom message for settings update + ** $text string Text to be displayed in the message + ** $type string (confirm|warn|error) Decides what color will the + ** message have (green|yellow) + */ + private function _displayConfirmation($text = '', $type = 'confirm') + { + switch ($type) + { + case 'confirm': + $img = 'ok.gif'; + break ; + case 'warn': + $img = 'warn2.png'; + break ; + case 'error': + $img = 'disabled.gif'; + break ; + default: + die('Invalid type.'); + } + + return array( + 'class' => Tools::safeOutput($type), + 'img' => Tools::safeOutput($img), + 'text' => (empty($text) ? $this->l('Settings updated') : $text) + ); + } + + /******************************************************************/ + /** Web-service methods *******************************************/ + /******************************************************************/ + + /******************************************************************/ + /** Tools methods *************************************************/ + /******************************************************************/ + public function getCurrentURL($htmlEntities = false) + { + $url = $_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI']; + return (!empty($_SERVER['HTTPS']) ? 'https' : 'http'). + '://'.($htmlEntities ? preg_replace('/&/', '&', $url): $url); + } + + public function log($orderId, $transactionId) + { + return Db::getInstance()->Execute('REPLACE INTO `'._DB_PREFIX_.'shipwire_log` + (`transaction_ref`, `id_order`, `date_added`) + VALUES (\''.pSQL($transactionId).'\', + '.(int)$orderId.', + \''.date('Y-m-d H:i:s').'\')'); + } + + /******************************************************************/ + /** Display methods *************************************************/ + /******************************************************************/ + private function _displayContent() + { + $cookie = $this->context->cookie; + + $buffer = ' + '; + + if (isset($this->dParams['confirmMessage'])) + $buffer .= ' +
+ + '.$this->dParams['confirmMessage']['text'].' +
'; + $buffer .= ' + +

'.$this->dParams['displayName'].'

+
+ '.$this->l('Help').' + +

'.$this->l('How to configure Shipwire Module:').'

+ - '.$this->l('Fill the Shipwire Email and Password fields with those provided by Shipwire.').'
+ - '.$this->l('Click on the "Save Settings" button and then Test your connection.').'

+

'.$this->l('Module purpose:').'

+ '.$this->l('Shipwire\'s enterprise logistics platform will help lower your cost, grow your sales, and deliver a great experience for your customers. Shipwire ensures your orders ship faster — at a lower cost.').'
'. + $this->l('Easily connect your sales channels and expand into emerging ones like Social Commerce. Use Shipwire\'s global warehouses to reach more customers faster — at a lower cost.').'
'. + $this->l('Whatever the volume, Shipwire\'s automated warehouses process your orders quickly and accurately.').'

+
+
+
+
+
+ '.$this->l('Shipwire Credentials').''; + + if (isset($this->dParams['connectionTestResult'])) + $buffer .= ' +
+ '.Tools::safeOutput($this->dParams['connectionTestResult'][0]).' +
'; + + $buffer .= ' + + + + + + + + + +
'.$this->l('Email').'
'.$this->l('Password').' + +
+
+
+
+
+
+
+ '.$this->l('Shipwire and PrestaShop').' +

'.$this->l('Learn more about Shipwire at PrestaShop.com').'

+
+
'; + + $buffer .= ' +
+
+
+ '.$this->l('Options').' + +

'.$this->l('Order statuses that will interact with Shipwire').'

+ '.$this->l('When an order status is updated in Shipwire, the following statuses will be applied to the order in your store.').'

'; + + /* Check if the order status exist */ + $orderStatus = Db::getInstance()->ExecuteS('SELECT `id_order_state`, `name` FROM '._DB_PREFIX_.'order_state_lang WHERE `id_lang` = '.(int)$cookie->id_lang); + $orderStatusList = array(); + foreach ($orderStatus as $v) + $orderStatusList[$v['id_order_state']] = Tools::safeOutput($v['name']); + $buffer .= ' + + + + + + + + + + + '; + /// There's no DELIVERED status at the moment thru SHIPWIRE API + /* + + + + + */ + $buffer .= ' +
'.$this->l('Action').''.$this->l('Order status in your store').'
'.$this->l('Commit order to Shipwire').': + +
'.$this->l('Set order as SHIPPED in your store').': + +
'.$this->l('Set order as DELIVERED in your store').': + +
+
+
+

'.$this->l('Logs life').'

+ + + + + +
'.$this->l('Delete transaction logs every').': + + '.$this->l('days (recommended: 30 days)').' +
'; + + // Get Carriers + $carriers = Db::getInstance()->ExecuteS('SELECT `id_carrier`, `name` FROM `'._DB_PREFIX_.'carrier` WHERE `deleted` = 0'); + array_unshift($carriers, array('id_carrier' => 0, 'name' => $this->l('--Select one--'))); + + foreach ($carriers as $k => $c) + if (empty($c['name'])) + unset($carriers[$k]); + + $buffer .= ' +
+
+

'.$this->l('Shipping Methods').'

+
'. + $this->l('Select the shipping methods that you will accept (They have to be unique for each.)').' +
+ + + + + + + + + + + + + + + + + + +
'.$this->l('Ground shipping').': + +
'.$this->l('Next day delivery').': + +
'.$this->l('Second day delivery').': + +
'.$this->l('International delivery').': + +
+ +
+
+
+
+ '; + + // Product list from Shipwire + if (Configuration::get('SHIPWIRE_API_CONNECTED')) + { + $products = $this->_shipWireInventoryUpdate->getInventory('Product'); + + $buffer .= ' +

+ +
+ '.$this->l('Shipwire Stock').' +
'; + + + $buffer .= ' + + + + + + + + + + + + + + + + + + + + + + '; + + if (is_array($products)) + foreach ($products as $product) + { + $buffer .= ' + '; + + if (isset($product['@attributes']) && count($product['@attributes']) && is_array($product['@attributes'])) + foreach ($product['@attributes'] as $k => $p) + $buffer .= ' + '; + $buffer .= ' + '; + } + + $buffer .= '
Code (SKU)QuantityPendingGoodBackorderedReservedShippingShippedConsumingCreatingConsumedCreatedAvailable DateShipped Last DayShipped Last WeekShipped Last 4 WeeksOrdered Last DayOrdered Last WeekOrdered Last 4 Weeks
'.Tools::safeOutput($p).'
'; + + $buffer .= ''; + + $buffer .=' +
+
+
'; + + $buffer .= ' +

+
+ + +
+
+ '.$this->l('Shipwire Transactions').' +
'; + + $r = Db::getInstance()->ExecuteS('SELECT `id_order`, `transaction_ref`, `tracking_number`, + `status`, `shipped`, `shipper`, `shipDate`, `expectedDeliveryDate`, + `href`, `shipperFullName` + FROM `'._DB_PREFIX_.'shipwire_order`'); + if (count($r)) + { + $buffer .= ' + + + + + + + + + + + + + + + '; + + foreach ($r as $k => $d) + { + $buffer .= ''; + foreach ($d as $key => $value) + $buffer .= '
'.($key == 'id_order' ? ''.Tools::safeOutput($value).'' : (empty($value) ? 'N/A' : Tools::safeOutput($value))).'
'; + $buffer .= '
'; + } + + $buffer .= '
Order IdTransaction RefTracking NumberStatusShippedShipperShip DateExpected Delivery DateTracking URLShipper Full Name
'.(empty($r[$k]['transaction_ref']) ? '' : '').'
+
'; + } + else + $buffer .= '
'.$this->l('No transactions available.').'
'; + + $buffer .= ' +
+


+
+ '.$this->l('Shipwire Cronjob').' + '.$this->l('Use PrestaShop\'s web-service to update your stock and order statuses. Place this URL in crontab (suggested frequency: every 5 hrs.) or access it manually daily:').'
+ + '.(Configuration::get('PS_SSL_ENABLED') ? 'https://' : 'http://').Configuration::get('PS_SHOP_DOMAIN').'/modules/shipwire/cronjob_update.php?secure_key='.md5(_COOKIE_KEY_.Configuration::get('PS_SHOP_NAME')).' +
+ '; + } + + return $buffer; + } + +} + +function shipwireAutoload($className) +{ + $className = str_replace(chr(0), '', $className); + if (!preg_match('/^\w+$/', $className)) + die('In2valid classname.'.$className); + + $moduleDir = dirname(__FILE__).'/'; + + if (file_exists($moduleDir.'lib/'.$className.'.php')) + require_once($moduleDir.'lib/'.$className.'.php'); + else + __autoload($className); +} diff --git a/modules/shipwire/shipwire_logo.png b/modules/shipwire/shipwire_logo.png new file mode 100644 index 0000000000000000000000000000000000000000..13143320362b6131bf88d4bb469d44d696d3a04a GIT binary patch literal 10901 zcmaiZV{|4>)NKb7+tvgVI}>N3iEYoswl%RPwr$(ClZkEH#(m!JyX*eFz1Hcf>K|RZ z&e^q3_32P~SusR7JU9RV5GBM#6hZAG$V6bEKzFpLY;{lrYb&nd008jl{}~vNnvMei z*a2q3!t(N_HjXw9rZ%=D62ihHw)Qs0W|l?(;JQ+wVIq(5nb@&D%L>sK?J&u8nC>vC zFvGNWhC+^`pa3R{f&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Rykzxhi4RtRwhELaZfmagdXJmkJTykaH8$xMGXnmr1goH+3>@|7LDZVNzE zYP8VbCVYADC{YeuD={EVkj!arRwtlEEoEn6(eEdhq_n7!0_Bj0f3A@ZW%K4gsDF!z z4Vjj^%ScPVZSM^H{Yii+lWMsr8mHLG2`S#LUKB?rbHkTV6KJEd6T3YxB2nf?W&SyY_CZfN;e|t}sdYop6`E{%m z!+bqno$fo%A{9#8QSJxia6zhS($EWf;$?JV!q_e}oFeI3H)PthOUDDW+^BUEM#h~z zU2DASKmN=C7ycNxbWS_6i$FqLK`qymloZ%!Q=GKm&b&MW4AFRBUoZvA>*Lv?F9O!S zE=i2E?oyLaLbUBZsVM+#u?O~xPIc`TXA|L78_!N5_q2Trr;Wz4)8kmt@V zLuzv;Qw+BqtpM7&0n;PHHrwI2uX|KAOKmPTLdY##o=;b9MEdkwcQsC@sytfsWE@LM1JNCm+=#dE|ldo_=wJP|If z)?l(s^$F{=S86i<} z8%A%ePj#x^d-O6E*%+d(w1z;kQtdU?#i&3_Dz4KJxd`2(ad(DD24b2Z#aNyJM;%PK zieTMitikClRtZwC7 z^)Adp*eUS7F7`)u#U2^PG4l2$Q1%TJV$Y>C9~#pJHicd9onKmD-wwCS#$pEMf~_BC>HC&%GMj$BpX1e<&E6b zgen*6B0yD`0I(sk-7*qVl0CAmhhwzL|LptuRgV8KYS!IC7B1K`lWg&4pY_Io8b zhm@z#QS4E-zG1@}qoCMVgqTxk3kv-h7VQS>r25VLLnRu8SBpf#5F9*L8xk@AWdC#f huk$~HsOwJ%pxlPabf(nQ3{=7bBt&IJDusUe{T~3z8kPV6 literal 0 HcmV?d00001 diff --git a/modules/shipwire/sql/index.php b/modules/shipwire/sql/index.php new file mode 100644 index 000000000..d69acffb4 --- /dev/null +++ b/modules/shipwire/sql/index.php @@ -0,0 +1,36 @@ + +* @copyright 2007-2012 PrestaShop SA +* @version Release: $Revision: 14009 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); +header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT"); + +header("Cache-Control: no-store, no-cache, must-revalidate"); +header("Cache-Control: post-check=0, pre-check=0", false); +header("Pragma: no-cache"); + +header("Location: ../"); +exit; diff --git a/modules/shipwire/sql/sql-install.php b/modules/shipwire/sql/sql-install.php new file mode 100644 index 000000000..3026ff331 --- /dev/null +++ b/modules/shipwire/sql/sql-install.php @@ -0,0 +1,83 @@ + +* @copyright 2007-2012 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +$sql = array(); + +$sql[] = 'CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'shipwire_stock` ( + `id_stock` int(10) unsigned NOT NULL, + `id_shop` int(10) unsigned NOT NULL, + `id_group_shop` int(10) unsigned NOT NULL, + `code` varchar(255) NULL, + `quantity` int(10) unsigned default 0, + `good` int(10) unsigned default 0, + `pending` int(10) unsigned default 0, + `backordered` int(10) unsigned default 0, + `reserved` int(10) unsigned default 0, + `shipping` int(10) unsigned default 0, + `shipped` int(10) unsigned default 0, + `consuming` int(10) unsigned default 0, + `consumed` int(10) unsigned default 0, + `creating` int(10) unsigned default 0, + `created` int(10) unsigned default 0, + `available_date` date, + `shipped_last_day` int(10) unsigned default 0, + `shipped_last_week` int(10) unsigned default 0, + `shipped_last_4_weeks` int(10) unsigned default 0, + `ordered_last_day` int(10) unsigned default 0, + `ordered_last_week` int(10) unsigned default 0, + `ordered_last_4_weeks` int(10) unsigned default 0, + PRIMARY KEY (`id_stock`, `id_shop`), + UNIQUE (`id_stock`)) + ENGINE='._MYSQL_ENGINE_.' DEFAULT CHARSET=utf8;'; + +$sql[] = 'CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'shipwire_order` ( + `id_order` int(10) unsigned NOT NULL, + `id_shop` int(10) unsigned NOT NULL, + `id_group_shop` int(10) unsigned NOT NULL, + `transaction_ref` varchar(255) NULL, + `order_ref` varchar(255) NULL, + `tracking_number` varchar(35) NULL, + `status` varchar(32) NULL, + `shipped` varchar(32) NULL, + `shipper` varchar(255) NULL, + `shipDate` varchar(32) NULL, + `expectedDeliveryDate` varchar(32) NULL, + `href` varchar(255) NULL, + `shipperFullName` varchar(255) NULL, + PRIMARY KEY (`id_order`, `id_shop`), + UNIQUE (`id_order`)) + ENGINE='._MYSQL_ENGINE_.' DEFAULT CHARSET=utf8;'; + +$sql[] = 'CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'shipwire_log` ( + `id_order` int(10) unsigned NOT NULL, + `id_shop` int(10) unsigned NOT NULL, + `id_group_shop` int(10) unsigned NOT NULL, + `transaction_ref` varchar(255) NULL, + `date_added` datetime, + PRIMARY KEY (`id_order`, `id_shop`), + UNIQUE (`id_order`, `transaction_ref`)) + ENGINE='._MYSQL_ENGINE_.' DEFAULT CHARSET=utf8;'; \ No newline at end of file diff --git a/modules/shipwire/sql/sql-uninstall.php b/modules/shipwire/sql/sql-uninstall.php new file mode 100644 index 000000000..c89f188ac --- /dev/null +++ b/modules/shipwire/sql/sql-uninstall.php @@ -0,0 +1,32 @@ + +* @copyright 2007-2012 PrestaShop SA +* @version Release: $Revision: 1.4 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +$sql = array(); + +$sql[] = 'DROP TABLE IF EXISTS `'._DB_PREFIX_.'shipwire_stock`;'; +$sql[] = 'DROP TABLE IF EXISTS `'._DB_PREFIX_.'shipwire_order`;'; +$sql[] = 'DROP TABLE IF EXISTS `'._DB_PREFIX_.'shipwire_log`;'; diff --git a/modules/shipwire/style.css b/modules/shipwire/style.css new file mode 100644 index 000000000..796d638fb --- /dev/null +++ b/modules/shipwire/style.css @@ -0,0 +1,102 @@ +fieldset.shipwire_fieldset td.shipwire_column { padding: 0 18px; text-align: right; vertical-align: top;} +fieldset.shipwire_fieldset input[type=text] { width: 250px; } +fieldset.shipwire_fieldset input.shipwire_button { margin-top: 10px; } +fieldset.shipwire_fieldset div#test_connection { margin-left: 18px; border: 1px solid #DFD5C3; padding: 5px; font-size: 11px; margin-bottom: 10px; width: 90%; } +fieldset.shipwire_fieldset a { color: #0000CC; font-weight: bold; text-decoration: underline; } +.clear {clear: both; margin: 0 auto;} +.current-page {border: 1px solid #000; padding: 3px;} +.description {font-size: 11px; color: #777; font-style: italic; margin-top: 3px;} + +.small { font-size: 10px; display: inline-block; } + +.tabbed-form { margin: 0px; padding: 0px; } +.tabbed-form.menu li { list-style: none; float: left; border: 1px solid #CCC; padding: 3px 6px; border-bottom: none;} +.tabbed-form.menu li.active { background: #FFF; height: 22px; margin-top: -7px; border: 1px solid #AAA; border-bottom: none; position: relative; top: 2px;} +.tabbed-form.menu li:hover { background: #FFF; cursor: pointer; } +.tabbed-form.content { border: 1px solid #AAA; padding-left: 10px; background: #FFF;} +.tabbed-form.content li { list-style: none; width: 100%; padding: 10px; } + +span.tree-button { border: 1px solid #000000; font-size: 10px; height: 0; margin: 4px; padding: 0 2px; } +span.tree-button:hover { background: #DDD; cursor: pointer; } +.tree .details { display: none; margin: 5px 20px;} +.tree table { vertical-align: middle; } +.tree table td { padding: 0px 5px; min-width: 50px;} + +.spaced-table { border-collapse: collapse } +.spaced-table td {padding: 0px 5px; min-width: 50px; font-weight: bold; border-bottom: 1px dashed #E8E8E8;} + +.spaced-table2 th{ min-width: 100px; max-width: 100px} +.spaced-table2 td{ max-width: 100px; } +.spaced-table3 th { min-width: 200px; max-width: 200px} +.spaced-table3 th.small{ min-width: 30px; max-width: 30px} +.spaced-table3 th.medium{ min-width: 100px; max-width: 100px} +.spaced-table3 td{ max-width: 200px; vertical-align: top;} +.spaced-table3 td .small{ max-width: 30px; } +.spaced-table3 td .medium{ max-width: 100px; } + + +.shipwire-dialogbox { border: 1px solid #D8D8D8; padding: 10px; width: 90%; margin: 10px 0px;} +.shipwire-dialogbox input { margin: 5px 0px;} +.shipwire-dialogbox label{ padding: 0.2em 1.5em 0 0; width: 150px; } + +.prepaid-bandwidth { + background: none repeat scroll 0 0 #DDE9F7; + border: 1px solid #50B0EC; + font-size: 11px; + left: 566px; + padding: 10px; + position: relative; + text-shadow: 0 1px 0 #FFFFFF; + top: 26px; + width: 155px; +} + +.prepaid-bandwidth.coupon { + left: 565px; + width: 340px; +} + +.bandwidth-value { font-size: 30px; text-align: center; margin-top: 10px;} + +.bold-td { font-weight: bold; } +.hint { padding: 8px 6px 8px 42px; } + +/* Aliases */ +.MB0 {margin-bottom: 0;} +.MB10 {margin-bottom: 10px;} +.MB20 {margin-bottom: 20px;} +.MB30 {margin-bottom: 30px;} +.MT0 {margin-top: 0;} +.MT10 {margin-top: 10px;} +.MT20 {margin-top: 20px;} +.MT30 {margin-top: 30px;} +.ML0 {margin-left: 0px;} +.ML10 {margin-left: 10px;} +.ML20 {margin-left: 20px;} +.ML30 {margin-left: 30px;} +.MR0 {margin-right: 0px;} +.MR10 {margin-right: 10px;} +.MR20 {margin-right: 20px;} +.MR30 {margin-right: 30px;} +.resetM {margin: 0;} +.C { clear: both; margin: 0 auto; } +.I {font-style: italic;} +.L {float: left;} +.R {float: right;} + +/* jExcerpt */ +.jexcerpt-long { + float: left; + display: none; + position: absolute; + background: #FFF; + border: 1px solid #444; + padding: 3px; + margin: -3px; + cursor: default; +} +.jexcerpt-short { + float: left; +} + +#requiredFieldsTranslation { display: none; } \ No newline at end of file