Merge branch 'develop' into 24_MATCHING

This commit is contained in:
Alexandre SPANGARO 2026-06-11 03:06:32 +02:00 committed by GitHub
commit cc986487e8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 24 additions and 16 deletions

View file

@ -512,7 +512,7 @@ class ExternalModules
if (array_key_exists('price_ht', $product) && price2num($product["price_ht"]) > 0) {
$price = '<h3>'.price(price2num($product["price_ht"], 'MT'), 0, $langs, 1, -1, -1, 'EUR').' '.$langs->trans("HT").'</h3>';
$download_link = '<a class="paddingleft paddingright" target="_blank" title="'.$langs->trans("View").'" href="'.$this->shop_url.'/product.php?id='.((int) $product['id']).'">';
$download_link = '<a class="paddingleft paddingright valignmiddle" target="_blank" title="'.$langs->trans("View").'" href="'.$this->shop_url.'/product.php?id='.((int) $product['id']).'">';
$download_link .= img_picto('', 'url', 'class="size2x paddingright"');
$download_link .= '</a>';
} else {
@ -539,13 +539,13 @@ class ExternalModules
}
if ($product['source'] === 'githubcommunity') {
$download_link = '<a class="paddingleft paddingright" target="_blank" title="'.$langs->trans("Sources").'" href="'.$product["link"].'">';
$download_link = '<a class="paddingleft paddingright valignmiddle" target="_blank" title="'.$langs->trans("Sources").'" href="'.$product["link"].'">';
$download_link .= img_picto('', 'file-code', 'class="size2x paddingright colorgrey"');
$download_link .= '</a>';
$urlview = $product["dolistore-download"]; // View on Dolistore
if ($urlview) {
$download_link .= '<a class="paddingleft paddingright" target="_blank" title="'.$langs->trans("View").'" href="'.$urlview.'" rel="noopener noreferrer">';
$download_link .= '<a class="paddingleft paddingright valignmiddle" target="_blank" title="'.$langs->trans("View").'" href="'.$urlview.'" rel="noopener noreferrer">';
$download_link .= img_picto('', 'url', 'class="size2x"');
$download_link .= '</a>';
}
@ -554,7 +554,7 @@ class ExternalModules
$reg = array();
if (preg_match('/https:.*\?id=(\d+)$/', $urlview, $reg)) {
$urldownload = 'https://www.dolistore.com/_service_download.php?t=free&p='.$reg[1];
$download_link .= '<a class="paddingleft paddingright" target="_blank" title="'.$langs->trans("Download").'" href="'.$urldownload.'" rel="noopener noreferrer">';
$download_link .= '<a class="paddingleft paddingright valignmiddle" target="_blank" title="'.$langs->trans("Download").'" href="'.$urldownload.'" rel="noopener noreferrer">';
$download_link .= img_picto('', 'download', 'class="size2x paddingright"');
//$download_link .= '<img width="32" src="'.DOL_URL_ROOT.'/admin/remotestore/img/download.png" />';
$download_link .= '</a>';
@ -563,7 +563,7 @@ class ExternalModules
} elseif ($product['source'] === 'dolistore') {
$urlview = $this->shop_url.'/product.php?id='.((int) $product["id"]);
$urldownload = 'https://www.dolistore.com/_service_download.php?t=free&p=' . $product['id'];
$download_link = '<a class="paddingleft paddingright" target="_blank" title="'.$langs->trans("View").'" href="'.$urlview.'">';
$download_link = '<a class="paddingleft paddingright valignmiddle" target="_blank" title="'.$langs->trans("View").'" href="'.$urlview.'">';
$download_link .= img_picto('', 'url', 'class="size2x"');
$download_link .= '</a>';
$download_link .= '<a class="paddingleft paddingright" target="_blank" title="'.$langs->trans("Download").'" href="'.$urldownload.'" rel="noopener noreferrer">';
@ -581,8 +581,8 @@ class ExternalModules
foreach ($product as $key => $value) {
$fields['producttoinstall['.$key.']'] = $value;
}
$download_link .= '<hr class="margintopbottomonly"/>';
$download_link .= '<button class="' . ($disableInstall ? 'butActionRefused' : 'butAction') . ' paddingleft paddingright"'
$install_link = '<button class="valignmiddle ' . ($disableInstall ? 'butActionRefused' : 'butAction') . ' paddingleft paddingright"'
. ($disableInfo ? ' title="' . dol_escape_htmltag($disableInfo) . '"' : '')
. (!$disableInstall ? ' data-confirm' : '')
. (!$disableInstall ? ' data-fields="' . dol_escape_htmltag(json_encode($fields)) . '"' : '')
@ -667,6 +667,12 @@ class ExternalModules
// Price - do not load if display none
$html .= '<td class="margeCote center amount'.(getDolOptimizeSmallScreen() ? ' left" colspan="2"' : '"').'>';
$html .= $price;
if (($product['direct-download'] && $product['direct-download'] == 'yes')
|| ($product['source'] === 'dolistore' && empty((float) $product['price_ht']))) {
if ($install_link) {
$html .= $install_link;
}
}
if (!getDolOptimizeSmallScreen()) {
$html .= '</td>';

View file

@ -243,7 +243,7 @@ if (empty($groupedNormalTools) && empty($groupedSystemTools)) {
if (preg_match('/^(create|update|delete|add|remove|change|write|edit|validate|pay|send)/i', $name)) {
$type = 'write';
$typeBadge = '<span class="badge badge-status8" style="display: inline-block;">' . $langs->trans('Modify') . '</span>';
$typeBadge = '<span class="badge badge-status2" style="display: inline-block;">' . $langs->trans('Modify') . '</span>';
} else {
$type = 'read';
$typeBadge = '<span class="badge badge-status4" style="display: inline-block;">' . $langs->trans('ViewOnly') . '</span>';
@ -273,15 +273,15 @@ if (empty($groupedNormalTools) && empty($groupedSystemTools)) {
print img_picto($langs->trans('Active'), 'switch_on', '', 0, 0, 0, '', 'opacitymedium');
} else {
$actAst = $isAstOn ? 'delrights' : 'addrights';
$pictoAst = $isAstOn ? 'switch_on' : 'switch_off';
$pictoAst = $isAstOn ? 'switch_on'.($type == 'write' ? '_warning' : '') : 'switch_off';
$urlAst = dolBuildUrl($_SERVER["PHP_SELF"], [
'action' => $actAst,
'toolcontext' => 'ast',
'toolname' => $name
], true);
print '<a class="ctx-ast-link' . $lockCssClass . '" href="' . $urlAst . '">';
print img_picto($langs->trans($isAstOn ? 'Remove' : 'Add'), $pictoAst);
print '<a class="ctx-ast-link reposition' . $lockCssClass . '" href="' . $urlAst . '">';
print img_picto($langs->trans($isAstOn ? 'Remove' : 'Add'), $pictoAst, '', 0, 0, 0, '', !$isAstOn ? 'font-status6' : ($type == 'write' ? 'font-status2' : 'font-status4'));
print '</a>';
}
print '</td>';
@ -292,15 +292,15 @@ if (empty($groupedNormalTools) && empty($groupedSystemTools)) {
print img_picto($langs->trans('Active'), 'switch_on', '', 0, 0, 0, '', 'opacitymedium');
} else {
$actMcp = $isMcpOn ? 'delrights' : 'addrights';
$pictoMcp = $isMcpOn ? 'switch_on' : 'switch_off';
$pictoMcp = $isMcpOn ? 'switch_on'.($type == 'write' ? '_warning' : '') : 'switch_off';
$urlMcp = dolBuildUrl($_SERVER["PHP_SELF"], [
'action' => $actMcp,
'toolcontext' => 'mcp',
'toolname' => $name
], true);
print '<a class="ctx-mcp-link' . $lockCssClass . '" href="' . $urlMcp . '">';
print img_picto($langs->trans($isMcpOn ? 'Remove' : 'Add'), $pictoMcp);
print '<a class="ctx-mcp-link reposition' . $lockCssClass . '" href="' . $urlMcp . '">';
print img_picto($langs->trans($isMcpOn ? 'Remove' : 'Add'), $pictoMcp, '', 0, 0, 0, '', !$isMcpOn ? 'font-status6' : ($type == 'write' ? 'font-status2' : 'font-status4'));
print '</a>';
}
print '</td>';

View file

@ -29,6 +29,8 @@ require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php';
/**
* Tool class for CRUD operations on Dolibarr objects
* TODO Remove all tools in this file. Must be into the objectname.class.php
* to follow the same structure than APIs.
*/
class ToolCrudObjects extends McpTool
{

View file

@ -3661,8 +3661,8 @@ if (getDolGlobalString('MAIN_LOGIN_BACKGROUND')) {
}
.login_table #tdpasswordlogin #togglepassword {
position: absolute;
top: 0.8em;
right: 11px;
top: 1.1em;
right: 20px;
background: none;
border: none;
opacity: 0.3;