From 98125196770cefcb70b8a3e62613a8ba6abb694b Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Fri, 26 Aug 2016 14:43:45 +0200 Subject: [PATCH] One unique entry point from HTTP server --- hedera.php => cli.php | 2 +- debian/cron.d | 8 +- debian/install | 23 +-- forms/cms/contact/contact.js | 9 +- forms/cms/contact/ui.xml | 5 +- forms/ecomerce/invoices/invoices.js | 2 +- index.php | 6 +- js/htk/image-editor.xml | 3 +- js/vn/json-request.js | 47 ++--- json.php | 8 - rest.php | 8 - rest/edi/clean.php | 49 +++++ rest/edi/lib/message.php | 165 ++++++++++++++++ rest/edi/lib/method.php | 43 +++++ rest/edi/lib/section.php | 28 +++ rest/edi/lib/segment.php | 38 ++++ rest/edi/load.php | 221 ++++++++++++++++++++++ rest/edi/plsql/batch_new.sql | 169 +++++++++++++++++ rest/edi/plsql/edi_load.sql | 164 ++++++++++++++++ rest/edi/plsql/message_new.sql | 27 +++ rest/edi/schemas/CLOCKT.json | 15 ++ rest/edi/sql/batch-add.sql | 6 + rest/edi/sql/bucket.sql | 14 ++ rest/edi/sql/bucket_type.sql | 10 + rest/edi/sql/feature.sql | 11 ++ rest/edi/sql/genus.sql | 10 + rest/edi/sql/item.sql | 13 ++ rest/edi/sql/item_feature.sql | 12 ++ rest/edi/sql/item_group.sql | 10 + rest/edi/sql/plant.sql | 11 ++ rest/edi/sql/specie.sql | 11 ++ rest/edi/sql/supplier.sql | 10 + rest/edi/sql/type.sql | 11 ++ rest/edi/sql/value.sql | 11 ++ rest/edi/update.php | 119 ++++++++++++ rest/image/resize.php | 2 +- rest/image/sync.php | 2 +- rest/misc/exchange-rate.php | 54 ++++++ rest/misc/exrate-add.sql | 6 + rest/misc/mail.php | 91 +++++++++ rest/tpv/confirm-mail.php | 10 +- vn/web/app.php | 143 +++----------- vn/web/{html-app.php => html-service.php} | 15 +- vn/web/{json-app.php => json-service.php} | 8 +- vn/web/{rest-app.php => rest-service.php} | 12 +- vn/web/service.php | 139 ++++++++++++++ 46 files changed, 1579 insertions(+), 202 deletions(-) rename hedera.php => cli.php (55%) delete mode 100755 json.php delete mode 100755 rest.php create mode 100644 rest/edi/clean.php create mode 100644 rest/edi/lib/message.php create mode 100644 rest/edi/lib/method.php create mode 100644 rest/edi/lib/section.php create mode 100644 rest/edi/lib/segment.php create mode 100644 rest/edi/load.php create mode 100644 rest/edi/plsql/batch_new.sql create mode 100644 rest/edi/plsql/edi_load.sql create mode 100644 rest/edi/plsql/message_new.sql create mode 100644 rest/edi/schemas/CLOCKT.json create mode 100644 rest/edi/sql/batch-add.sql create mode 100644 rest/edi/sql/bucket.sql create mode 100644 rest/edi/sql/bucket_type.sql create mode 100644 rest/edi/sql/feature.sql create mode 100644 rest/edi/sql/genus.sql create mode 100644 rest/edi/sql/item.sql create mode 100644 rest/edi/sql/item_feature.sql create mode 100644 rest/edi/sql/item_group.sql create mode 100644 rest/edi/sql/plant.sql create mode 100644 rest/edi/sql/specie.sql create mode 100644 rest/edi/sql/supplier.sql create mode 100644 rest/edi/sql/type.sql create mode 100644 rest/edi/sql/value.sql create mode 100644 rest/edi/update.php create mode 100755 rest/misc/exchange-rate.php create mode 100644 rest/misc/exrate-add.sql create mode 100755 rest/misc/mail.php mode change 100755 => 100644 vn/web/app.php rename vn/web/{html-app.php => html-service.php} (90%) rename vn/web/{json-app.php => json-service.php} (92%) rename vn/web/{rest-app.php => rest-service.php} (93%) create mode 100755 vn/web/service.php diff --git a/hedera.php b/cli.php similarity index 55% rename from hedera.php rename to cli.php index 6fa654af..e0538a82 100755 --- a/hedera.php +++ b/cli.php @@ -2,7 +2,7 @@ require_once ('vn/lib/cli-app.php'); -$cliApp = new Vn\Lib\CliApp ('hedera-web', 'rest'); +$cliApp = new Vn\Lib\CliApp ('hedera-web'); $cliApp->run (); ?> diff --git a/debian/cron.d b/debian/cron.d index 2a9461b4..d26b7a7c 100644 --- a/debian/cron.d +++ b/debian/cron.d @@ -1,2 +1,8 @@ MAILTO=webmaster -*/4 * * * * www-data php5 /usr/share/hedera-web/tpv/imap.php +*/4 * * * * root php /usr/share/hedera-web/cli.php -m tpv/confirm-mail +*/2 * * * * root php /usr/share/hedera-web/cli.php -m edi/load +0 23 * * * root php /usr/share/hedera-web/cli.php -m edi/clean +0 5 * * * root php /usr/share/hedera-web/cli.php -m edi/update +*/1 * * * * root php /usr/share/hedera-web/cli.php -m misc/mail +0 5 * * * root php /usr/share/hedera-web/cli.php -m misc/exchange-rate +45 14 20 11 * root php /usr/share/hedera-web/cli.php -m misc/exchange-rate diff --git a/debian/install b/debian/install index 35d0221f..f8f50518 100644 --- a/debian/install +++ b/debian/install @@ -1,17 +1,12 @@ conf/* etc/hedera-web vn usr/share/php doc/* usr/share/doc/hedera-web -forms usr/share/hedera-web/web -image usr/share/hedera-web/web -js usr/share/hedera-web/web -locale usr/share/hedera-web/web -pages usr/share/hedera-web/web -reports usr/share/hedera-web/web -rest usr/share/hedera-web/web -rest-json usr/share/hedera-web/web -index.php usr/share/hedera-web/web -rest.php usr/share/hedera-web/web -rest-json.php usr/share/hedera-web/web -hedera.php usr/share/hedera-web/bin -tasks usr/share/hedera-web/bin - +forms usr/share/hedera-web +image usr/share/hedera-web +js usr/share/hedera-web +locale usr/share/hedera-web +pages usr/share/hedera-web +reports usr/share/hedera-web +rest usr/share/hedera-web +index.php usr/share/hedera-web +cli.php usr/share/hedera-web diff --git a/forms/cms/contact/contact.js b/forms/cms/contact/contact.js index a52f06df..8dee47e2 100644 --- a/forms/cms/contact/contact.js +++ b/forms/cms/contact/contact.js @@ -14,8 +14,13 @@ Vn.Contact = new Class ,refreshCaptcha: function () { - var url = 'rest.php?method=core/captcha'; - this.$('captcha-img').src = url +'&stamp='+ new Date ().getTime (); + params = { + 'srv': 'rest:core/captcha', + 'stamp': new Date ().getTime () + }; + this.$('captcha-img').src = '?'+ Vn.Url.makeUri (params); + + Vn.Url.makeUri (params) } ,onSubmit: function () diff --git a/forms/cms/contact/ui.xml b/forms/cms/contact/ui.xml index 3121df5a..bcb3afe2 100755 --- a/forms/cms/contact/ui.xml +++ b/forms/cms/contact/ui.xml @@ -12,9 +12,8 @@ OrCallUs