From 4cac3d3544612a11e9381244db3893c2034a9b73 Mon Sep 17 00:00:00 2001 From: ldestailleur Date: Sun, 12 Oct 2025 15:54:27 +0200 Subject: [PATCH 1/2] Fix embedded tool to search module --- .../class/externalModules.class.php | 74 +++++++++++++++---- htdocs/theme/dolistore_squarred.svg | 22 ++++++ 2 files changed, 81 insertions(+), 15 deletions(-) create mode 100644 htdocs/theme/dolistore_squarred.svg diff --git a/htdocs/admin/remotestore/class/externalModules.class.php b/htdocs/admin/remotestore/class/externalModules.class.php index 5b7fd9bf66e..ba80ebd141f 100644 --- a/htdocs/admin/remotestore/class/externalModules.class.php +++ b/htdocs/admin/remotestore/class/externalModules.class.php @@ -428,7 +428,7 @@ class ExternalModules if ($product['source'] === 'githubcommunity') { $download_link = ''; - $download_link .= img_picto('', 'file-code', 'class="size2x paddingright"'); + $download_link .= img_picto('', 'file-code', 'class="size2x paddingright colorgrey"'); $download_link .= ''; $urlview = $product["dolistore-download"]; // In a future, we will have the download to the zip file @@ -474,7 +474,7 @@ class ExternalModules $compatible = ''; } else { // never compatible, module expired - $version = ''.$langs->trans( + $version = ''.$langs->trans( 'NotCompatible', $dolibarrversiontouse, $product["dolibarr_min"], @@ -506,31 +506,71 @@ class ExternalModules // Output the line $html .= ''; + + // Logo $html .= '
'; $html .= $newapp.$images; // No dol_escape_htmltag, it is already escape html $html .= '
'; - $html .= '

'; + + // Description + $html .= '

'; $html .= dolPrintHTML(dol_string_nohtmltag($product["label"])); - $html .= '
'; - $html .= $version; // No dol_escape_htmltag, it is already escape html - $html .= '

'; - $html .= ' '; - if (empty($product['tms'])) { - $html .= ''.$langs->trans("DateCreation").': '.$langs->trans("Unknown").''; - } else { - $html .= ''.dol_print_date(dol_stringtotime($product['tms']), 'day').''; + if (!empty($product['author']) && $product['author'] != 'unkownauthor') { + $html .= '   -   '.img_picto('', 'company', 'class="pictofixedwidth"'); + if (!empty($product['author_url'])) { + $html .= ''.$product['author'].''; + } else { + $html .= $product['author']; + } + $html .= ''; } - $html .= ' - '.$langs->trans('Ref').' '.dolPrintHTML($product["ref"]); + $html .= '
'; + $html .= $version; // Version Dolibarr. No dol_escape_htmltag, it is already escape html + $html .= ''; + $html .= ''; + + $html .= ' '; + if (empty($product['tms'])) { + $html .= img_picto($langs->trans('DateCreation'), 'calendar', 'class="pictofixedwidth"').''.$langs->trans("DateCreation").': '; + $html .= (!empty($product['datec']) ? dol_print_date(dol_stringtotime($product['datec']), 'day') : $langs->trans("Unknown")).''; + } else { + $html .= img_picto($langs->trans('DateModification'), 'calendar', 'class="pictofixedwidth"').''.dol_print_date(dol_stringtotime($product['tms']), 'day').''; + } + $html .= '   '.$langs->trans('Ref').' '.dolPrintHTML(preg_replace('/@.*$/', '', $product["ref"])); //$html .= ' - '.dol_escape_htmltag($langs->trans('Id')).': '.((int) $product["id"]); $html .= '
'; - $html .= ''.$langs->trans('Source').': '.$product["source"].'
'; - $html .= '
'.dolPrintHTML(dol_string_nohtmltag($product["description"])); + //$html .= '
'.$langs->trans('Source').'  
'; + $html .= '
'; + if ($product["source"] == 'dolistore') { + //$html .= img_picto('DoliStore', 'shop', 'class="pictofixedwidth"'); + $html .= ''; + } elseif ($product["source"] == 'githubcommunity') { + $html .= img_picto($langs->trans('Source').': GitHub community repo', 'group', 'class="pictofixedwidth valignmiddle"'); + } else { + $html .= img_picto($langs->trans('Source').': '.$langs->trans('Other'), 'generic', 'class="pictofixedwidth"'); + } + //$html .= $product["source"]; + $html .= '
 '; + if (!empty($product['phpmin']) && $product['phpmin'] != 'unknown') { + $html .= ' PHP min '.$product['phpmin'].''; + } + if (!empty($product['phpmax']) && $product['phpmax'] != 'unknown') { + $html .= ' PHP max '.$product['phpmax'].''; + } + $html .= '
'; + + $html .= '
'; + $html .= '
'.dolPrintHTML(dol_string_nohtmltag($product["description"])).'
'; $html .= ''; - // do not load if display none + + // Price - do not load if display none $html .= ''; $html .= $price; $html .= ''; + + // Links $html .= ''.$download_link.''; + $html .= ''; } @@ -930,6 +970,8 @@ class ExternalModules 'tms' => (!empty($package['last_updated_at']) && is_string($package['last_updated_at'])) ? date('Y-m-d H:i:s', strtotime($package['last_updated_at'])) : '', + 'author' => array_key_exists('author', $package) ? $package['author'] : '', + 'author_url' => array_key_exists('author_url', $package) ? $package['author_url'] : '', 'price_ttc' => 0, 'dolibarr_min' => !empty($package['dolibarrmin']) ? $package['dolibarrmin'] @@ -983,6 +1025,8 @@ class ExternalModules 'description' => $package['description'], 'datec' => $package['datec'], 'tms' => $package['tms'], + 'author' => array_key_exists('author', $package) ? $package['author'] : '', + 'author_url' => array_key_exists('author_url', $package) ? $package['author_url'] : '', 'price_ttc' => $package['price_ttc'], 'dolibarr_min' => $package['dolibarr_min'], 'dolibarr_max' => $package['dolibarr_max'], diff --git a/htdocs/theme/dolistore_squarred.svg b/htdocs/theme/dolistore_squarred.svg new file mode 100644 index 00000000000..053423665ac --- /dev/null +++ b/htdocs/theme/dolistore_squarred.svg @@ -0,0 +1,22 @@ + + + + + + + + + + From 538fc37242304c60715ba8d85de4a0ed22389538 Mon Sep 17 00:00:00 2001 From: ldestailleur Date: Sun, 12 Oct 2025 17:12:00 +0200 Subject: [PATCH 2/2] FIX prices must be HT in dolistore browser --- htdocs/admin/remotestore/class/externalModules.class.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/admin/remotestore/class/externalModules.class.php b/htdocs/admin/remotestore/class/externalModules.class.php index ba80ebd141f..bcb2b8b910a 100644 --- a/htdocs/admin/remotestore/class/externalModules.class.php +++ b/htdocs/admin/remotestore/class/externalModules.class.php @@ -416,8 +416,8 @@ class ExternalModules } // free or pay ? - if ($product["price_ttc"] > 0) { - $price = '

'.price(price2num($product["price_ttc"], 'MT'), 0, $langs, 1, -1, -1, 'EUR').' '.$langs->trans("TTC").'

'; + if ($product["price_ht"] > 0) { + $price = '

'.price(price2num($product["price_ht"], 'MT'), 0, $langs, 1, -1, -1, 'EUR').' '.$langs->trans("HT").'

'; $download_link = ''; $download_link .= img_picto('', 'url', 'class="size2x paddingright"'); @@ -973,6 +973,7 @@ class ExternalModules 'author' => array_key_exists('author', $package) ? $package['author'] : '', 'author_url' => array_key_exists('author_url', $package) ? $package['author_url'] : '', 'price_ttc' => 0, + 'price_ht' => 0, 'dolibarr_min' => !empty($package['dolibarrmin']) ? $package['dolibarrmin'] : 'unknown', @@ -1028,6 +1029,7 @@ class ExternalModules 'author' => array_key_exists('author', $package) ? $package['author'] : '', 'author_url' => array_key_exists('author_url', $package) ? $package['author_url'] : '', 'price_ttc' => $package['price_ttc'], + 'price_ht' => $package['price_ht'], 'dolibarr_min' => $package['dolibarr_min'], 'dolibarr_max' => $package['dolibarr_max'], 'phpmin' => empty($package['phpmin']) ? '' : $package['phpmin'],