Skip to content

Commit

Permalink
Debug v21
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Dec 30, 2024
1 parent 938e038 commit 152050d
Show file tree
Hide file tree
Showing 9 changed files with 35 additions and 16 deletions.
1 change: 1 addition & 0 deletions README-FR.md
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
11 changes: 6 additions & 5 deletions htdocs/core/lib/invoice.lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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 .= '<td class="right">'.$objectstatic->getLibStatut(5, $payment).'</td>';
$result .= '<td class="right">'.$objectstatic->getLibStatut(3, $payment).'</td>';

$result .= '</tr>';

Expand Down Expand Up @@ -1048,11 +1049,11 @@ function getPurchaseInvoiceLatestEditTable($maxCount = 5, $socid = 0)

$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="right">'.$objectstatic->getLibStatut(5).'</td>';
$result .= '<td class="right">'.$objectstatic->getLibStatut(3).'</td>';

$result .= '</tr>';

Expand Down Expand Up @@ -1305,8 +1306,6 @@ function getPurchaseInvoiceUnpaidOpenTable($maxCount = 500, $socid = 0)
$num = $db->num_rows($resql);
$othernb = 0;

$formfile = new FormFile($db);

print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">';

Expand All @@ -1326,7 +1325,9 @@ function getPurchaseInvoiceUnpaidOpenTable($maxCount = 500, $socid = 0)
print '<th class="right">'.$langs->trans("Paid").'</th>';
print '<th width="16">&nbsp;</th>';
print "</tr>\n";

$societestatic = new Societe($db);

if ($num) {
$i = 0;
$total = $total_ttc = $totalam = 0;
Expand Down
2 changes: 1 addition & 1 deletion htdocs/don/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@
print '</td>';

// 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>';

Expand Down
2 changes: 1 addition & 1 deletion htdocs/margin/agentMargins.php
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@

$i = 0;
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">';
if ($agentid > 0) {
Expand Down
4 changes: 2 additions & 2 deletions htdocs/margin/checkMargins.php
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@
$selectedfields = '';

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 '<td><input type="text" name="search_ref" value="'.dol_escape_htmltag($search_ref).'"></td>';
Expand All @@ -288,7 +288,7 @@
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();
print $searchpitco;
print '</td>';
Expand Down
2 changes: 1 addition & 1 deletion htdocs/margin/customerMargins.php
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@

$i = 0;
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">';
if (!empty($client)) {
Expand Down
2 changes: 1 addition & 1 deletion htdocs/margin/productMargins.php
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@

$i = 0;
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">';
if ($id > 0) {
Expand Down
26 changes: 21 additions & 5 deletions htdocs/website/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'));
Expand Down Expand Up @@ -3544,15 +3549,18 @@ 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
$(\'[contenteditable="true"]\').each(function() {
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();
Expand All @@ -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,
Expand Down Expand Up @@ -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\');
}
Expand Down Expand Up @@ -4896,8 +4914,6 @@ function switchEditorOnline(forceenable)
if ($action == 'editfile' || $action == 'file_manager' || $action == 'convertimgwebp' || $action == 'confirmconvertimgwebp') {
print '<!-- Edit Media -->'."\n";
print '<div class="fiche"><br>';
//print '<div class="center">'.$langs->trans("FeatureNotYetAvailable").'</center>';


$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
Expand Down

0 comments on commit 152050d

Please sign in to comment.