Debug v21

This commit is contained in:
Laurent Destailleur (aka Eldy) 2024-12-30 03:14:20 +01:00
parent 938e0380f4
commit 152050d1a8
9 changed files with 35 additions and 16 deletions

View File

@ -1,6 +1,7 @@
# DOLIBARR ERP & CRM # DOLIBARR ERP & CRM
![Downloads per day](https://img.shields.io/sourceforge/dw/dolibarr.svg) ![Downloads per day](https://img.shields.io/sourceforge/dw/dolibarr.svg)
![Docker hub pulls](https://img.shields.io/docker/pulls/dolibarr/dolibarr.svg)
[![Minimum PHP Version](https://img.shields.io/badge/php-%3E%3D%207.1-8892BF.svg?style=flat-square)](https://php.net/) [![Minimum PHP Version](https://img.shields.io/badge/php-%3E%3D%207.1-8892BF.svg?style=flat-square)](https://php.net/)
[![GitHub release](https://img.shields.io/github/v/release/Dolibarr/dolibarr)](https://github.com/Dolibarr/dolibarr) [![GitHub release](https://img.shields.io/github/v/release/Dolibarr/dolibarr)](https://github.com/Dolibarr/dolibarr)
[![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/5521/badge)](https://bestpractices.coreinfrastructure.org/projects/5521) [![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/5521/badge)](https://bestpractices.coreinfrastructure.org/projects/5521)

View File

@ -1,6 +1,7 @@
# DOLIBARR ERP & CRM # DOLIBARR ERP & CRM
![Downloads per day](https://img.shields.io/sourceforge/dw/dolibarr.svg) ![Downloads per day](https://img.shields.io/sourceforge/dw/dolibarr.svg)
![Docker hub pulls](https://img.shields.io/docker/pulls/dolibarr/dolibarr.svg)
[![Minimum PHP Version](https://img.shields.io/badge/php-%3E%3D%207.1-8892BF.svg?style=flat-square)](https://php.net/) [![Minimum PHP Version](https://img.shields.io/badge/php-%3E%3D%207.1-8892BF.svg?style=flat-square)](https://php.net/)
[![GitHub release](https://img.shields.io/github/v/release/Dolibarr/dolibarr)](https://github.com/Dolibarr/dolibarr) [![GitHub release](https://img.shields.io/github/v/release/Dolibarr/dolibarr)](https://github.com/Dolibarr/dolibarr)
[![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/5521/badge)](https://bestpractices.coreinfrastructure.org/projects/5521) [![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/5521/badge)](https://bestpractices.coreinfrastructure.org/projects/5521)

View File

@ -905,6 +905,7 @@ function getCustomerInvoiceLatestEditTable($maxCount = 5, $socid = 0)
$objectstatic->ref = $obj->ref; $objectstatic->ref = $obj->ref;
$objectstatic->paye = $obj->paye; $objectstatic->paye = $obj->paye;
$objectstatic->statut = $obj->status; $objectstatic->statut = $obj->status;
$objectstatic->status = $obj->status;
$objectstatic->total_ht = $obj->total_ht; $objectstatic->total_ht = $obj->total_ht;
$objectstatic->total_tva = $obj->total_tva; $objectstatic->total_tva = $obj->total_tva;
$objectstatic->total_ttc = $obj->total_ttc; $objectstatic->total_ttc = $obj->total_ttc;
@ -938,7 +939,7 @@ function getCustomerInvoiceLatestEditTable($maxCount = 5, $socid = 0)
// Load amount of existing payment of invoice (needed for complete status) // Load amount of existing payment of invoice (needed for complete status)
$payment = $objectstatic->getSommePaiement(); $payment = $objectstatic->getSommePaiement();
$result .= '<td class="right">'.$objectstatic->getLibStatut(5, $payment).'</td>'; $result .= '<td class="right">'.$objectstatic->getLibStatut(3, $payment).'</td>';
$result .= '</tr>'; $result .= '</tr>';
@ -1048,11 +1049,11 @@ function getPurchaseInvoiceLatestEditTable($maxCount = 5, $socid = 0)
$result .= '<td class="tdoverflowmax150">'.$companystatic->getNomUrl(1, 'supplier').'</td>'; $result .= '<td class="tdoverflowmax150">'.$companystatic->getNomUrl(1, 'supplier').'</td>';
$result .= '<td>'.dol_print_date($db->jdate($obj->datec), 'day').'</td>'; $result .= '<td title="'.$langs->trans("DateModification").': '.dol_print_date($db->jdate($obj->datec), 'dayhour').'">'.dol_print_date($db->jdate($obj->datec), 'day').'</td>';
$result .= '<td class="amount right">'.price($obj->total_ttc).'</td>'; $result .= '<td class="amount right">'.price($obj->total_ttc).'</td>';
$result .= '<td class="right">'.$objectstatic->getLibStatut(5).'</td>'; $result .= '<td class="right">'.$objectstatic->getLibStatut(3).'</td>';
$result .= '</tr>'; $result .= '</tr>';
@ -1305,8 +1306,6 @@ function getPurchaseInvoiceUnpaidOpenTable($maxCount = 500, $socid = 0)
$num = $db->num_rows($resql); $num = $db->num_rows($resql);
$othernb = 0; $othernb = 0;
$formfile = new FormFile($db);
print '<div class="div-table-responsive-no-min">'; print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">'; print '<table class="noborder centpercent">';
@ -1326,7 +1325,9 @@ function getPurchaseInvoiceUnpaidOpenTable($maxCount = 500, $socid = 0)
print '<th class="right">'.$langs->trans("Paid").'</th>'; print '<th class="right">'.$langs->trans("Paid").'</th>';
print '<th width="16">&nbsp;</th>'; print '<th width="16">&nbsp;</th>';
print "</tr>\n"; print "</tr>\n";
$societestatic = new Societe($db); $societestatic = new Societe($db);
if ($num) { if ($num) {
$i = 0; $i = 0;
$total = $total_ttc = $totalam = 0; $total = $total_ttc = $totalam = 0;

View File

@ -257,7 +257,7 @@ if ($resql) {
print '</td>'; print '</td>';
// Date // Date
print '<td class="center">'.dol_print_date($db->jdate($obj->datem), 'day').'</td>'; print '<td class="center" title="'.$langs->trans("DonationDate").': '.dol_print_date($db->jdate($obj->datem), 'day').'">'.dol_print_date($db->jdate($obj->datem), 'day').'</td>';
print '<td class="right">'.$donation_static->LibStatut($obj->fk_statut, 5).'</td>'; print '<td class="right">'.$donation_static->LibStatut($obj->fk_statut, 5).'</td>';

View File

@ -259,7 +259,7 @@ if ($result) {
$i = 0; $i = 0;
print '<div class="div-table-responsive">'; print '<div class="div-table-responsive">';
print '<table class="tagtable liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n"; print '<table class="tagtable noborder nobottomiftotal liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
if ($agentid > 0) { if ($agentid > 0) {

View File

@ -279,7 +279,7 @@ if ($result) {
$selectedfields = ''; $selectedfields = '';
print '<div class="div-table-responsive">'; print '<div class="div-table-responsive">';
print '<table class="tagtable liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n"; print '<table class="tagtable noborder nobottomiftotal liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
print '<tr class="liste_titre liste_titre_search">'; print '<tr class="liste_titre liste_titre_search">';
print '<td><input type="text" name="search_ref" value="'.dol_escape_htmltag($search_ref).'"></td>'; print '<td><input type="text" name="search_ref" value="'.dol_escape_htmltag($search_ref).'"></td>';
@ -288,7 +288,7 @@ if ($result) {
print '<td></td>'; print '<td></td>';
print '<td></td>'; print '<td></td>';
print '<td></td>'; print '<td></td>';
print '<td class="liste_titre" align="middle">'; print '<td class="liste_titre center">';
$searchpitco = $form->showFilterButtons(); $searchpitco = $form->showFilterButtons();
print $searchpitco; print $searchpitco;
print '</td>'; print '</td>';

View File

@ -329,7 +329,7 @@ if ($result) {
$i = 0; $i = 0;
print '<div class="div-table-responsive">'; print '<div class="div-table-responsive">';
print '<table class="tagtable liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n"; print '<table class="tagtable noborder nobottomiftotal liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
if (!empty($client)) { if (!empty($client)) {

View File

@ -279,7 +279,7 @@ if ($result) {
$i = 0; $i = 0;
print '<div class="div-table-responsive">'; print '<div class="div-table-responsive">';
print '<table class="tagtable liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n"; print '<table class="tagtable noborder nobottomiftotal liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
if ($id > 0) { if ($id > 0) {

View File

@ -454,6 +454,11 @@ if ($action == 'setwebsiteoffline' && $usercanedit) {
exit; exit;
} }
if ($action == 'seteditinline') { // Test on permission not required here if ($action == 'seteditinline') { // Test on permission not required here
if (!getDolGlobalString('WEBSITE_EDITINLINE_SAVE_CKEDITOR_EDIT')) {
// Show warning for feature not yet ready
setEventMessages($langs->trans("FeatureNotYetAvailable"), null, 'warnings');
}
dolibarr_set_const($db, 'WEBSITE_EDITINLINE', 1); dolibarr_set_const($db, 'WEBSITE_EDITINLINE', 1);
//dolibarr_set_const($db, 'WEBSITE_SUBCONTAINERSINLINE', 0); // Force disable of 'Include dynamic content' //dolibarr_set_const($db, 'WEBSITE_SUBCONTAINERSINLINE', 0); // Force disable of 'Include dynamic content'
header("Location: ".$_SERVER["PHP_SELF"].'?website='.urlencode(GETPOST('website')).'&pageid='.GETPOSTINT('pageid')); header("Location: ".$_SERVER["PHP_SELF"].'?website='.urlencode(GETPOST('website')).'&pageid='.GETPOSTINT('pageid'));
@ -3544,8 +3549,10 @@ if (!GETPOST('hide_websitemenu')) {
isEditingEnabled = true; isEditingEnabled = true;
// Trigger the function when clicking outside the elements with contenteditable=true attribute // Trigger the function when clicking outside the elements with contenteditable=true attribute
// so we can save the change.
$(document).on(\'click\', function(e) { $(document).on(\'click\', function(e) {
var target = $(e.target); var target = $(e.target);
// Check if the click is outside the elements with contenteditable=true attribute // Check if the click is outside the elements with contenteditable=true attribute
if (!target.closest(\'[contenteditable="true"]\').length) { if (!target.closest(\'[contenteditable="true"]\').length) {
// Repeat through the elements with contenteditable="true" attribute // Repeat through the elements with contenteditable="true" attribute
@ -3553,6 +3560,7 @@ if (!GETPOST('hide_websitemenu')) {
var idToUse = $(this).attr(\'id\'); var idToUse = $(this).attr(\'id\');
var elementType = $(this).prop("tagName").toLowerCase(); // Get the tag name (div, section, footer...) var elementType = $(this).prop("tagName").toLowerCase(); // Get the tag name (div, section, footer...)
var instance = CKEDITOR.instances[idToUse]; var instance = CKEDITOR.instances[idToUse];
// Check if the element has been modified // Check if the element has been modified
if ($(this).hasClass(\'modified\')) { if ($(this).hasClass(\'modified\')) {
var content = instance.getData(); var content = instance.getData();
@ -3561,13 +3569,18 @@ if (!GETPOST('hide_websitemenu')) {
// Retrieving the content and ID of the element // Retrieving the content and ID of the element
var elementId = $(this).attr(\'id\'); var elementId = $(this).attr(\'id\');
// Sending data via AJAX ';
if (getDolGlobalString('WEBSITE_EDITINLINE_SAVE_CKEDITOR_EDIT')) {
print '
console.log("A change has been detected, we send new content for update with ajax");
// Sending data via AJAX to update section
$.ajax({ $.ajax({
type: \'POST\', type: \'POST\',
url: \'' . DOL_URL_ROOT . '/core/ajax/editinline.php\', url: \'' . DOL_URL_ROOT . '/core/ajax/editinline.php\',
data: { data: {
website_ref: \''.$website->ref.'\', website_ref: \''.dol_escape_js($website->ref).'\',
page_id: \'' . $websitepage->id . '\', page_id: \'' . ((int) $websitepage->id) . '\',
content: content, content: content,
element_id: elementId, element_id: elementId,
element_type: elementType, element_type: elementType,
@ -3598,6 +3611,11 @@ if (!GETPOST('hide_websitemenu')) {
}, 2000); }, 2000);
} }
}); });
';
} else {
print 'console.log("A change has been detected, but saving is not enabled by option WEBSITE_EDITINLINE_SAVE_CKEDITOR_EDIT, so no ajax update is done");';
}
print '
$(this).removeClass(\'modified\'); $(this).removeClass(\'modified\');
} }
@ -4896,8 +4914,6 @@ if ($action == 'preview') {
if ($action == 'editfile' || $action == 'file_manager' || $action == 'convertimgwebp' || $action == 'confirmconvertimgwebp') { if ($action == 'editfile' || $action == 'file_manager' || $action == 'convertimgwebp' || $action == 'confirmconvertimgwebp') {
print '<!-- Edit Media -->'."\n"; print '<!-- Edit Media -->'."\n";
print '<div class="fiche"><br>'; print '<div class="fiche"><br>';
//print '<div class="center">'.$langs->trans("FeatureNotYetAvailable").'</center>';
$module = 'medias'; $module = 'medias';
$formalreadyopen = 2; // So the form to submit a new file will not be open another time inside the core/tpl/filemanager.tpl.php $formalreadyopen = 2; // So the form to submit a new file will not be open another time inside the core/tpl/filemanager.tpl.php