Debug v20

This commit is contained in:
Laurent Destailleur 2024-05-31 13:55:45 +02:00
parent 236230585d
commit 7e8565bee7
6 changed files with 48 additions and 22 deletions

View file

@ -141,20 +141,6 @@ if ($action == 'setmanagezero') {
}
}
if ($action == 'setdisabledirectinput') {
$setdisabledirectinput = GETPOSTINT('value');
$res = dolibarr_set_const($db, "BANK_DISABLE_DIRECT_INPUT", $setdisabledirectinput, 'yesno', 0, '', $conf->entity);
if (!($res > 0)) {
$error++;
}
if (!$error) {
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
} else {
setEventMessages($langs->trans("Error"), null, 'mesgs');
}
}
if ($action == 'setenabledraftexport') {
$setenabledraftexport = GETPOSTINT('value');
$res = dolibarr_set_const($db, "ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL", $setenabledraftexport, 'yesno', 0, '', $conf->entity);

View file

@ -37,10 +37,6 @@ require_once DOL_DOCUMENT_ROOT.'/societe/class/companybankaccount.class.php';
// Load translation files required by the page
$langs->loadLangs(array("admin", "companies", "bills", "other", "banks"));
if (!$user->admin) {
accessforbidden();
}
$action = GETPOST('action', 'aZ09');
$actionsave = GETPOST('save', 'alpha');
$value = GETPOST('value', 'alpha');
@ -48,11 +44,32 @@ $label = GETPOST('label', 'alpha');
$scandir = GETPOST('scan_dir', 'alpha');
$type = 'bankaccount';
if (!$user->admin) {
accessforbidden();
}
$error = 0;
/*
* Actions
*/
if (in_array($action, array('setBANK_DISABLE_DIRECT_INPUT'))) {
$constname = preg_replace('/^set/', '', $action);
$constvalue = GETPOSTINT('value');
$res = dolibarr_set_const($db, $constname, $constvalue, 'yesno', 0, '', $conf->entity);
if (!($res > 0)) {
$error++;
}
if (!$error) {
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
} else {
setEventMessages($langs->trans("Error"), null, 'mesgs');
}
}
// Order display of bank account
if ($action == 'setbankorder') {
if (dolibarr_set_const($db, "BANK_SHOW_ORDER_OPTION", GETPOST('value', 'alpha'), 'chaine', 0, '', $conf->entity) > 0) {
@ -477,6 +494,19 @@ print '<td>'.$langs->trans("Description").'</td>';
print '<td class="center width75">'.$langs->trans("Status")."</td>\n";
print "</tr>\n";
print '<tr class="oddeven">';
print '<td>'.$langs->trans("BANK_DISABLE_DIRECT_INPUT").'</td><td></td>';
if (getDolGlobalString('BANK_DISABLE_DIRECT_INPUT')) {
print '<td class="center"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&action=setBANK_DISABLE_DIRECT_INPUT&value=0">';
print img_picto($langs->trans("Activated"), 'switch_on');
print '</a></td>';
} else {
print '<td class="center"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&action=setBANK_DISABLE_DIRECT_INPUT&value=1">';
print img_picto($langs->trans("Disabled"), 'switch_off');
print '</a></td>';
}
print '</tr>';
print '<tr class="oddeven"><td>';
print $langs->trans('AccountStatement');
print "</td><td>\n";

View file

@ -35,13 +35,17 @@ function showOnlineSignatureUrl($type, $ref, $obj = null, $mode = '')
$servicename = 'Online';
$out = img_picto('', 'globe').' <span class="opacitymedium">'.$langs->trans("ToOfferALinkForOnlineSignature", $servicename).'</span><br>';
$out = '';
if ($mode != 'short') {
$out .= img_picto('', 'globe', 'class="pictofixedwidth"');
}
$out .= '<span class="opacitymedium">'.$langs->trans("ToOfferALinkForOnlineSignature", $servicename).'</span><br>';
$url = getOnlineSignatureUrl(0, $type, $ref, 1, $obj);
$out .= '<div class="urllink">';
if ($url == $langs->trans("FeatureOnlineSignDisabled")) {
$out .= $url;
} else {
$out .= '<input type="text" id="onlinesignatureurl" class="quatrevingtpercentminusx" value="'.$url.'">';
$out .= '<input type="text" id="onlinesignatureurl" class="'.($mode == 'short' ? 'centpercentminusx' : 'quatrevingtpercentminusx').'" value="'.$url.'">';
}
$out .= '<a class="" href="'.$url.'" target="_blank" rel="noopener noreferrer">'.img_picto('', 'globe', 'class="paddingleft"').'</a>';
$out .= '</div>';

View file

@ -1731,11 +1731,11 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard'
if (!getDolGlobalInt('SOCIETE_DISABLE_BANKACCOUNT') && getDolGlobalInt("SOCIETE_RIB_ALLOW_ONLINESIGN")) {
// Show online signature link
print '<td class="nowraponall">';
print '<td class="width200">';
$useonlinesignature = 1;
if ($useonlinesignature) {
require_once DOL_DOCUMENT_ROOT . '/core/lib/signature.lib.php';
print showOnlineSignatureUrl($companybankaccount->element, $rib->id, $rib, 1);
print showOnlineSignatureUrl($companybankaccount->element, $rib->id, $rib, 'short');
}
print '</td>';
}

View file

@ -856,6 +856,9 @@ th .button {
.quatrevingtpercentminusx {
width: calc(80% - 52px);
}
.centpercentminusx {
width: calc(100% - 52px);
}
textarea.centpercent {
width: 96%;
}

View file

@ -1044,6 +1044,9 @@ th .button {
.quatrevingtpercentminusx {
width: calc(80% - 52px);
}
.centpercentminusx {
width: calc(100% - 52px);
}
textarea.centpercent {
width: 96%;
}