diff --git a/htdocs/admin/dolistore/ajax/image.php b/htdocs/admin/dolistore/ajax/image.php
index 10ce4656c40..6d63dd3e08b 100644
--- a/htdocs/admin/dolistore/ajax/image.php
+++ b/htdocs/admin/dolistore/ajax/image.php
@@ -42,7 +42,7 @@ if (!$res) die("Include of main fails");
global $lang, $user, $conf;
-dol_include_once('/dolistore/class/dolistore.class.php');
+require_once DOL_DOCUMENT_ROOT.'/admin/dolistore/class/dolistore.class.php';
$dolistore = new Dolistore();
$id_product = GETPOST('id_product', 'int');
diff --git a/htdocs/admin/dolistore/class/dolistore.class.php b/htdocs/admin/dolistore/class/dolistore.class.php
index 5e0aa546cc0..0c5a7f08568 100644
--- a/htdocs/admin/dolistore/class/dolistore.class.php
+++ b/htdocs/admin/dolistore/class/dolistore.class.php
@@ -19,9 +19,145 @@
include_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
include_once DOL_DOCUMENT_ROOT.'/admin/dolistore/class/PSWebServiceLibrary.class.php';
+
+
/**
* Class DolistoreModel
*/
+class DolistoreModel
+{
+
+ function get_categories($parent = 0)
+ {
+ if (!isset($this->categories)) die('not possible');
+ if ($parent != 0) {
+ $html = '
';
+ } else {
+ $html = '';
+ }
+
+ $nbofcateg = count($this->categories);
+ for ($i = 0; $i < $nbofcateg; $i++)
+ {
+ $cat = $this->categories[$i];
+ if ($cat->is_root_category == 1 && $parent == 0) {
+ $html .= '- ';
+ $html .= self::get_categories($cat->id);
+ $html .= "
\n";
+ } elseif (trim($cat->id_parent) == $parent && $cat->active == 1 && trim($cat->id_parent) != 0) { // si cat est de ce niveau
+ $select = ($cat->id == $this->categorie) ? ' selected' : '';
+ $html .= '- '.$cat->name->language[$this->lang].' '.$cat->nb_products_recursive.'';
+ $html .= self::get_categories($cat->id);
+ $html .= "
\n";
+ } else {
+
+ }
+ }
+
+ if ($html == '') {
+ return '';
+ }
+ if ($parent != 0) {
+ return $html.'
';
+ } else {
+ return $html;
+ }
+ }
+
+ function get_products()
+ {
+ global $langs, $conf;
+ $html = "";
+ $parity = "pair";
+ $last_month = time() - (30 * 24 * 60 * 60);
+ foreach ($this->products as $product) {
+ $parity = ($parity == "impair") ? 'pair' : 'impair';
+
+ // check new product ?
+ $newapp = '';
+ if ($last_month < strtotime($product->date_add)) {
+ $newapp .= ''.$langs->trans('New').' ';
+ }
+
+ // check updated ?
+ if ($last_month < strtotime($product->date_upd) && $newapp == '') {
+ $newapp .= ''.$langs->trans('Updated').' ';
+ }
+
+ // add image or default ?
+ if ($product->id_default_image != '') {
+ $image_url = dol_buildPath('/dolistore/ajax/image.php?id_product=', 2).$product->id.'&id_image='.$product->id_default_image;
+ $images = ''.
+ '
';
+ } else {
+ $images = '
';
+ }
+
+ // free or pay ?
+ if ($product->price > 0) {
+ $price = ''.price(round((float) $product->price * $this->vat_rate, 2)).' €
';
+ $download_link = '
';
+ } else {
+ $price = $langs->trans('Free');
+ $download_link = '
';
+ }
+
+ //checking versions
+ if ($this->version_compare($product->dolibarr_min, DOL_VERSION) <= 0) {
+ if ($this->version_compare($product->dolibarr_max, DOL_VERSION) >= 0) {
+ //compatible
+ $version = ''.$langs->trans('CompatibleUpTo', $product->dolibarr_max,
+ $product->dolibarr_min, $product->dolibarr_max).'';
+ $compatible = '';
+ } else {
+ //never compatible, module expired
+ $version = ''.$langs->trans('NotCompatible', DOL_VERSION,
+ $product->dolibarr_min, $product->dolibarr_max).'';
+ $compatible = 'NotCompatible';
+ }
+ } else {
+ //need update
+ $version = ''.$langs->trans('CompatibleAfterUpdate', DOL_VERSION,
+ $product->dolibarr_min, $product->dolibarr_max).'';
+ $compatible = 'NotCompatible';
+ }
+
+ //output template
+ $html .= '
+ '.$newapp.$images.' |
+
+ '.dol_print_date(strtotime($product->date_upd)).' - '.$langs->trans('Référence').': '.$product->reference.' - '.$langs->trans('Id').': '.$product->id.'
'.$product->description_short->language[$this->lang].' |
+ '.$product->description->language[$this->lang].' |
+ '.$price.' |
+ '.$download_link.' |
+
';
+ }
+ return $html;
+ }
+
+ function get_previous_link($text = '<<')
+ {
+ return ''.$text.'';
+ }
+
+ function get_next_link($text = '>>')
+ {
+ return ''.$text.'';
+ }
+}
+
+
+
+/**
+ * Class Dolistore
+ */
class Dolistore extends DolistoreModel
{
// params
@@ -182,135 +318,3 @@ class Dolistore extends DolistoreModel
}
}
-
-/**
- * Class DolistoreModel
- */
-class DolistoreModel
-{
-
- function get_categories($parent = 0)
- {
- if (!isset($this->categories)) die('not possible');
- if ($parent != 0) {
- $html = '';
- } else {
- $html = '';
- }
-
- $nbofcateg = count($this->categories);
- for ($i = 0; $i < $nbofcateg; $i++)
- {
- $cat = $this->categories[$i];
- if ($cat->is_root_category == 1 && $parent == 0) {
- $html .= '- ';
- $html .= self::get_categories($cat->id);
- $html .= "
\n";
- } elseif (trim($cat->id_parent) == $parent && $cat->active == 1 && trim($cat->id_parent) != 0) { // si cat est de ce niveau
- $select = ($cat->id == $this->categorie) ? ' selected' : '';
- $html .= '- '.$cat->name->language[$this->lang].' '.$cat->nb_products_recursive.'';
- $html .= self::get_categories($cat->id);
- $html .= "
\n";
- } else {
-
- }
- }
-
- if ($html == '') {
- return '';
- }
- if ($parent != 0) {
- return $html.'
';
- } else {
- return $html;
- }
- }
-
- function get_products()
- {
- global $langs, $conf;
- $html = "";
- $parity = "pair";
- $last_month = time() - (30 * 24 * 60 * 60);
- foreach ($this->products as $product) {
- $parity = ($parity == "impair") ? 'pair' : 'impair';
-
- // check new product ?
- $newapp = '';
- if ($last_month < strtotime($product->date_add)) {
- $newapp .= ''.$langs->trans('New').' ';
- }
-
- // check updated ?
- if ($last_month < strtotime($product->date_upd) && $newapp == '') {
- $newapp .= ''.$langs->trans('Updated').' ';
- }
-
- // add image or default ?
- if ($product->id_default_image != '') {
- $image_url = dol_buildPath('/dolistore/ajax/image.php?id_product=', 2).$product->id.'&id_image='.$product->id_default_image;
- $images = ''.
- '
';
- } else {
- $images = '
';
- }
-
- // free or pay ?
- if ($product->price > 0) {
- $price = ''.price(round((float) $product->price * $this->vat_rate, 2)).' €
';
- $download_link = '
';
- } else {
- $price = $langs->trans('Free');
- $download_link = '
';
- }
-
- //checking versions
- if ($this->version_compare($product->dolibarr_min, DOL_VERSION) <= 0) {
- if ($this->version_compare($product->dolibarr_max, DOL_VERSION) >= 0) {
- //compatible
- $version = ''.$langs->trans('CompatibleUpTo', $product->dolibarr_max,
- $product->dolibarr_min, $product->dolibarr_max).'';
- $compatible = '';
- } else {
- //never compatible, module expired
- $version = ''.$langs->trans('NotCompatible', DOL_VERSION,
- $product->dolibarr_min, $product->dolibarr_max).'';
- $compatible = 'NotCompatible';
- }
- } else {
- //need update
- $version = ''.$langs->trans('CompatibleAfterUpdate', DOL_VERSION,
- $product->dolibarr_min, $product->dolibarr_max).'';
- $compatible = 'NotCompatible';
- }
-
- //output template
- $html .= '
- '.$newapp.$images.' |
-
- '.dol_print_date(strtotime($product->date_upd)).' - '.$langs->trans('Référence').': '.$product->reference.' - '.$langs->trans('Id').': '.$product->id.'
'.$product->description_short->language[$this->lang].' |
- '.$product->description->language[$this->lang].' |
- '.$price.' |
- '.$download_link.' |
-
';
- }
- return $html;
- }
-
- function get_previous_link($text = '<<')
- {
- return ''.$text.'';
- }
-
- function get_next_link($text = '>>')
- {
- return ''.$text.'';
- }
-}
diff --git a/htdocs/admin/dolistore/class/init.php b/htdocs/admin/dolistore/class/init.php
index df5773d9e7d..4a94e08002c 100644
--- a/htdocs/admin/dolistore/class/init.php
+++ b/htdocs/admin/dolistore/class/init.php
@@ -29,7 +29,7 @@
// Here we define constants /!\ You need to replace this parameters
//https://dolistorecatalogpublickey1234567@vmdevwww.dolistore.com/api/
define('DEBUG', true); // Debug mode
-define('PS_SHOP_PATH', 'http://vmdevwww.dolistore.com/'); // Root path of your PrestaShop store
+define('PS_SHOP_PATH', 'https://www.dolistore.com/'); // Root path of your PrestaShop store
define('PS_WS_AUTH_KEY', 'dolistorecatalogpublickey1234567'); // Auth key (Get it in your Back Office)
require_once('./PSWebServiceLibrary.php');
// Here we make the WebService Call
diff --git a/htdocs/cashdesk/css/style.css b/htdocs/cashdesk/css/style.css
index c34e8596f01..d4149619aae 100644
--- a/htdocs/cashdesk/css/style.css
+++ b/htdocs/cashdesk/css/style.css
@@ -260,10 +260,6 @@ p.titre {
padding: 0;
}
-.resultats_dhtml {
- width: 400px;
- position: absolute;
-}
/* --------------------- Combo lists ------------------- */
.select_design {
diff --git a/htdocs/cashdesk/javascript/dhtml.js b/htdocs/cashdesk/javascript/dhtml.js
index 7f5df55a767..db05855a3b2 100644
--- a/htdocs/cashdesk/javascript/dhtml.js
+++ b/htdocs/cashdesk/javascript/dhtml.js
@@ -51,26 +51,14 @@ function file(fichier) {
}
-// Affichage des donnees aTexte dans le bloc identifie par aId
-function afficheDonnees(aId, aTexte) {
-
- document.getElementById(aId).innerHTML = aTexte;
-
-}
-
-
// aCible : id du bloc de destination; aCode : argument a passer a la page php chargee du traitement et de l'affichage
function verifResultat(aCible, aCode, iLimit) {
if (aCode != '' && aCode.length >= iLimit) {
if (texte = file('facturation_dhtml.php?code='+escape(aCode))) {
-
- afficheDonnees (aCible, texte);
-
+ document.getElementById(aCible).innerHTML = texte;
} else
-
- afficheDonnees (aCible, '');
-
+ document.getElementById(aCible).innerHTML = '';
}
}
diff --git a/htdocs/cashdesk/tpl/facturation1.tpl.php b/htdocs/cashdesk/tpl/facturation1.tpl.php
index 8cfe70638e3..3f0a0f4c371 100644
--- a/htdocs/cashdesk/tpl/facturation1.tpl.php
+++ b/htdocs/cashdesk/tpl/facturation1.tpl.php
@@ -45,8 +45,7 @@ $langs->load("cashdesk");
+ onfocus="javascript: this.select();" />
|
|