Skip to content

Commit

Permalink
Debug v21
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Dec 15, 2024
1 parent 65f9e7f commit 81f0bb8
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 14 deletions.
14 changes: 9 additions & 5 deletions htdocs/compta/bank/bankentries_list.php
Original file line number Diff line number Diff line change
Expand Up @@ -900,7 +900,7 @@
}

// Code to adjust value date with plus and less picto using an Ajax call instead of a full reload of page
$urlajax = DOL_URL_ROOT.'/core/ajax/bankconciliate.php?token='.currentToken();
$urlajax = DOL_URL_ROOT.'/core/ajax/bankconciliate.php?format=dayreduceformat&token='.currentToken();
print '
<script type="text/javascript">
$(function() {
Expand All @@ -909,10 +909,10 @@
current.click(function()
{
var url = "'.$urlajax.'&"+current.attr("href").split("?")[1];
console.log("We click on ajaxforbankoperationchange url="+url);
$.get(url, function(data)
{
console.log(url)
console.log(data)
console.log(data);
current.parent().parent().find(".spanforajaxedit").replaceWith(data);
});
return false;
Expand Down Expand Up @@ -1663,7 +1663,9 @@
// Date ope
if (!empty($arrayfields['b.dateo']['checked'])) {
print '<td class="nowraponall center">';
print '<span class="spanforajaxedit" id="dateoperation_'.$objp->rowid.'" title="'.dol_print_date($db->jdate($objp->do), "day").'">'.dol_print_date($db->jdate($objp->do), "dayreduceformat")."</span>";
print '<span class="spanforajaxedit" id="dateoperation_'.$objp->rowid.'" title="'.dol_print_date($db->jdate($objp->do), "day").'">';
print dol_print_date($db->jdate($objp->do), "dayreduceformat");
print "</span>";
print '&nbsp;';
print '<span class="inline-block">';
print '<a class="ajaxforbankoperationchange" href="'.$_SERVER['PHP_SELF'].'?action=doprev&amp;account='.$objp->bankid.'&amp;rowid='.$objp->rowid.'">';
Expand All @@ -1680,7 +1682,9 @@
// Date value
if (!empty($arrayfields['b.datev']['checked'])) {
print '<td class="nowraponall center">';
print '<span class="spanforajaxedit" id="datevalue_'.$objp->rowid.'" title="'.dol_print_date($db->jdate($objp->dv), "day").'">'.dol_print_date($db->jdate($objp->dv), "dayreduceformat")."</span>";
print '<span class="spanforajaxedit" id="datevalue_'.$objp->rowid.'" title="'.dol_print_date($db->jdate($objp->dv), "day").'">';
print dol_print_date($db->jdate($objp->dv), "dayreduceformat");
print "</span>";
print '&nbsp;';
print '<span class="inline-block">';
print '<a class="ajaxforbankoperationchange" href="'.$_SERVER['PHP_SELF'].'?action=dvprev&amp;account='.$objp->bankid.'&amp;rowid='.$objp->rowid.'">';
Expand Down
4 changes: 2 additions & 2 deletions htdocs/compta/bank/line.php
Original file line number Diff line number Diff line change
Expand Up @@ -672,10 +672,10 @@
current.click(function()
{
var url = "'.$urlajax.'&"+current.attr("href").split("?")[1];
console.log("We click on ajaxforbankoperationchange url="+url);
$.get(url, function(data)
{
console.log(url)
console.log(data)
console.log(data);
current.parent().prev().replaceWith(data);
});
return false;
Expand Down
5 changes: 2 additions & 3 deletions htdocs/compta/bank/releve.php
Original file line number Diff line number Diff line change
Expand Up @@ -744,12 +744,11 @@
var current = $(this);
current.click(function()
{
console.log("We click on ajaxforbankoperationchange");
var url = "'.$urlajax.'&"+current.attr("href").split("?")[1];
console.log("We click on ajaxforbankoperationchange url="+url);
$.get(url, function(data)
{
console.log(url)
console.log(data)
console.log(data);
current.parent().parent().find(".spanforajaxedit").replaceWith(data);
});
return false;
Expand Down
10 changes: 6 additions & 4 deletions htdocs/core/ajax/bankconciliate.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@

$action = GETPOST('action', 'aZ09');

$format = GETPOST('format');

// Security check
// Checks are done later

Expand All @@ -72,7 +74,7 @@
$al->datev_next(GETPOSTINT('rowid'));
$al->fetch(GETPOSTINT('rowid'));

print '<span class="spanforajaxedit" id="datevalue_'.$al->id.'">'.dol_print_date($al->datev, "day").'</span>';
print '<span class="spanforajaxedit" id="datevalue_'.$al->id.'">'.dol_print_date($al->datev, ($format ? $format : "day")).'</span>';

exit;
}
Expand All @@ -83,7 +85,7 @@
$al->datev_previous(GETPOSTINT('rowid'));
$al->fetch(GETPOSTINT('rowid'));

print '<span class="spanforajaxedit" id="datevalue_'.$al->id.'">'.dol_print_date($al->datev, "day").'</span>';
print '<span class="spanforajaxedit" id="datevalue_'.$al->id.'">'.dol_print_date($al->datev, ($format ? $format : "day")).'</span>';

exit;
}
Expand All @@ -94,7 +96,7 @@
$al->dateo_next(GETPOSTINT('rowid'));
$al->fetch(GETPOSTINT('rowid'));

print '<span class="spanforajaxedit" id="dateoperation_'.$al->id.'">'.dol_print_date($al->dateo, "day").'</span>';
print '<span class="spanforajaxedit" id="dateoperation_'.$al->id.'">'.dol_print_date($al->dateo, ($format ? $format : "day")).'</span>';

exit;
}
Expand All @@ -105,7 +107,7 @@
$al->dateo_previous(GETPOSTINT('rowid'));
$al->fetch(GETPOSTINT('rowid'));

print '<span class="spanforajaxedit" id="dateoperation_'.$al->id.'">'.dol_print_date($al->dateo, "day").'</span>';
print '<span class="spanforajaxedit" id="dateoperation_'.$al->id.'">'.dol_print_date($al->dateo, ($format ? $format : "day")).'</span>';

exit;
}

0 comments on commit 81f0bb8

Please sign in to comment.