From 152050d1a8b3c73b440d19a7b0e6e8f81a7abd00 Mon Sep 17 00:00:00 2001 From: "Laurent Destailleur (aka Eldy)" Date: Mon, 30 Dec 2024 03:14:20 +0100 Subject: [PATCH] Debug v21 --- README-FR.md | 1 + README.md | 1 + htdocs/core/lib/invoice.lib.php | 11 ++++++----- htdocs/don/index.php | 2 +- htdocs/margin/agentMargins.php | 2 +- htdocs/margin/checkMargins.php | 4 ++-- htdocs/margin/customerMargins.php | 2 +- htdocs/margin/productMargins.php | 2 +- htdocs/website/index.php | 26 +++++++++++++++++++++----- 9 files changed, 35 insertions(+), 16 deletions(-) diff --git a/README-FR.md b/README-FR.md index c1c474f25973f..34ca2f596f138 100644 --- a/README-FR.md +++ b/README-FR.md @@ -1,6 +1,7 @@ # DOLIBARR ERP & CRM ![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/) [![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) diff --git a/README.md b/README.md index c5870358438fd..136f946a257e1 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ # DOLIBARR ERP & CRM ![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/) [![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) diff --git a/htdocs/core/lib/invoice.lib.php b/htdocs/core/lib/invoice.lib.php index fd21d5462b2a4..84f3b42937f16 100644 --- a/htdocs/core/lib/invoice.lib.php +++ b/htdocs/core/lib/invoice.lib.php @@ -905,6 +905,7 @@ function getCustomerInvoiceLatestEditTable($maxCount = 5, $socid = 0) $objectstatic->ref = $obj->ref; $objectstatic->paye = $obj->paye; $objectstatic->statut = $obj->status; + $objectstatic->status = $obj->status; $objectstatic->total_ht = $obj->total_ht; $objectstatic->total_tva = $obj->total_tva; $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) $payment = $objectstatic->getSommePaiement(); - $result .= ''.$objectstatic->getLibStatut(5, $payment).''; + $result .= ''.$objectstatic->getLibStatut(3, $payment).''; $result .= ''; @@ -1048,11 +1049,11 @@ function getPurchaseInvoiceLatestEditTable($maxCount = 5, $socid = 0) $result .= ''.$companystatic->getNomUrl(1, 'supplier').''; - $result .= ''.dol_print_date($db->jdate($obj->datec), 'day').''; + $result .= 'jdate($obj->datec), 'dayhour').'">'.dol_print_date($db->jdate($obj->datec), 'day').''; $result .= ''.price($obj->total_ttc).''; - $result .= ''.$objectstatic->getLibStatut(5).''; + $result .= ''.$objectstatic->getLibStatut(3).''; $result .= ''; @@ -1305,8 +1306,6 @@ function getPurchaseInvoiceUnpaidOpenTable($maxCount = 500, $socid = 0) $num = $db->num_rows($resql); $othernb = 0; - $formfile = new FormFile($db); - print '
'; print ''; @@ -1326,7 +1325,9 @@ function getPurchaseInvoiceUnpaidOpenTable($maxCount = 500, $socid = 0) print ''; print ''; print "\n"; + $societestatic = new Societe($db); + if ($num) { $i = 0; $total = $total_ttc = $totalam = 0; diff --git a/htdocs/don/index.php b/htdocs/don/index.php index 6775c5263e196..2df4cdbdcfe03 100644 --- a/htdocs/don/index.php +++ b/htdocs/don/index.php @@ -257,7 +257,7 @@ print ''; // Date - print ''; + print ''; print ''; diff --git a/htdocs/margin/agentMargins.php b/htdocs/margin/agentMargins.php index a31ac92d1ed6e..95c4ba1ad063f 100644 --- a/htdocs/margin/agentMargins.php +++ b/htdocs/margin/agentMargins.php @@ -259,7 +259,7 @@ $i = 0; print '
'; - print '
'.$langs->trans("Paid").' 
'.dol_print_date($db->jdate($obj->datem), 'day').'jdate($obj->datem), 'day').'">'.dol_print_date($db->jdate($obj->datem), 'day').''.$donation_static->LibStatut($obj->fk_statut, 5).'
'."\n"; + print '
'."\n"; print ''; if ($agentid > 0) { diff --git a/htdocs/margin/checkMargins.php b/htdocs/margin/checkMargins.php index d497b845c3dd1..391d12958bc5c 100644 --- a/htdocs/margin/checkMargins.php +++ b/htdocs/margin/checkMargins.php @@ -279,7 +279,7 @@ $selectedfields = ''; print '
'; - print '
'."\n"; + print '
'."\n"; print ''; print ''; @@ -288,7 +288,7 @@ print ''; print ''; print ''; - print ''; diff --git a/htdocs/margin/customerMargins.php b/htdocs/margin/customerMargins.php index e9b3c3b2cf84e..1ec4b367601fa 100644 --- a/htdocs/margin/customerMargins.php +++ b/htdocs/margin/customerMargins.php @@ -329,7 +329,7 @@ $i = 0; print '
'; - print '
'."\n"; + print '
'."\n"; print ''; if (!empty($client)) { diff --git a/htdocs/margin/productMargins.php b/htdocs/margin/productMargins.php index 9dd60cfa76907..97d1a5a3f9263 100644 --- a/htdocs/margin/productMargins.php +++ b/htdocs/margin/productMargins.php @@ -279,7 +279,7 @@ $i = 0; print '
'; - print '
'."\n"; + print '
'."\n"; print ''; if ($id > 0) { diff --git a/htdocs/website/index.php b/htdocs/website/index.php index 300ac8f0b833e..46d428bac93ec 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -454,6 +454,11 @@ exit; } 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_SUBCONTAINERSINLINE', 0); // Force disable of 'Include dynamic content' header("Location: ".$_SERVER["PHP_SELF"].'?website='.urlencode(GETPOST('website')).'&pageid='.GETPOSTINT('pageid')); @@ -3544,8 +3549,10 @@ function switchEditorOnline(forceenable) isEditingEnabled = true; // Trigger the function when clicking outside the elements with contenteditable=true attribute + // so we can save the change. $(document).on(\'click\', function(e) { var target = $(e.target); + // Check if the click is outside the elements with contenteditable=true attribute if (!target.closest(\'[contenteditable="true"]\').length) { // Repeat through the elements with contenteditable="true" attribute @@ -3553,6 +3560,7 @@ function switchEditorOnline(forceenable) var idToUse = $(this).attr(\'id\'); var elementType = $(this).prop("tagName").toLowerCase(); // Get the tag name (div, section, footer...) var instance = CKEDITOR.instances[idToUse]; + // Check if the element has been modified if ($(this).hasClass(\'modified\')) { var content = instance.getData(); @@ -3561,13 +3569,18 @@ function switchEditorOnline(forceenable) // Retrieving the content and ID of the element 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({ type: \'POST\', url: \'' . DOL_URL_ROOT . '/core/ajax/editinline.php\', data: { - website_ref: \''.$website->ref.'\', - page_id: \'' . $websitepage->id . '\', + website_ref: \''.dol_escape_js($website->ref).'\', + page_id: \'' . ((int) $websitepage->id) . '\', content: content, element_id: elementId, element_type: elementType, @@ -3598,6 +3611,11 @@ function switchEditorOnline(forceenable) }, 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\'); } @@ -4896,8 +4914,6 @@ function switchEditorOnline(forceenable) if ($action == 'editfile' || $action == 'file_manager' || $action == 'convertimgwebp' || $action == 'confirmconvertimgwebp') { print ''."\n"; print '

'; - //print '
'.$langs->trans("FeatureNotYetAvailable").''; - $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