Removed 2 options from setup than are now set automatically
This commit is contained in:
parent
0662f2cc91
commit
67ca02e1b3
@ -66,12 +66,7 @@ $error = 0;
|
||||
* Actions
|
||||
*/
|
||||
|
||||
if (in_array($action, array(
|
||||
'setBANK_DISABLE_DIRECT_INPUT',
|
||||
'setACCOUNTANCY_COMBO_FOR_AUX',
|
||||
'setACCOUNTING_MANAGE_ZERO',
|
||||
'setACCOUNTING_LIST_SORT_VENTILATION_TODO',
|
||||
'setACCOUNTING_LIST_SORT_VENTILATION_DONE'))) {
|
||||
if (in_array($action, array('setBANK_DISABLE_DIRECT_INPUT', 'setACCOUNTANCY_COMBO_FOR_AUX', 'setACCOUNTING_MANAGE_ZERO'))) {
|
||||
$constname = preg_replace('/^set/', '', $action);
|
||||
$constvalue = GETPOST('value', 'int');
|
||||
$res = dolibarr_set_const($db, $constname, $constvalue, 'yesno', 0, '', $conf->entity);
|
||||
@ -121,34 +116,6 @@ if ($action == 'update') {
|
||||
}
|
||||
}
|
||||
|
||||
if ($action == 'setlistsorttodo') {
|
||||
$setlistsorttodo = GETPOST('value', 'int');
|
||||
$res = dolibarr_set_const($db, "ACCOUNTING_LIST_SORT_VENTILATION_TODO", $setlistsorttodo, '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 == 'setlistsortdone') {
|
||||
$setlistsortdone = GETPOST('value', 'int');
|
||||
$res = dolibarr_set_const($db, "ACCOUNTING_LIST_SORT_VENTILATION_DONE", $setlistsortdone, '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 == 'setmanagezero') {
|
||||
$setmanagezero = GETPOST('value', 'int');
|
||||
$res = dolibarr_set_const($db, "ACCOUNTING_MANAGE_ZERO", $setmanagezero, 'yesno', 0, '', $conf->entity);
|
||||
@ -417,33 +384,6 @@ print '<tr class="liste_titre">';
|
||||
print '<td colspan="2">'.$langs->trans('BindingOptions').'</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
// TO DO Mutualize code for yes/no constants
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.$langs->trans("ACCOUNTING_LIST_SORT_VENTILATION_TODO").'</td>';
|
||||
if (!empty($conf->global->ACCOUNTING_LIST_SORT_VENTILATION_TODO)) {
|
||||
print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&action=setACCOUNTING_LIST_SORT_VENTILATION_TODO&value=0">';
|
||||
print img_picto($langs->trans("Activated"), 'switch_on');
|
||||
print '</a></td>';
|
||||
} else {
|
||||
print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&action=setACCOUNTING_LIST_SORT_VENTILATION_TODO&value=1">';
|
||||
print img_picto($langs->trans("Disabled"), 'switch_off');
|
||||
print '</a></td>';
|
||||
}
|
||||
print '</tr>';
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.$langs->trans("ACCOUNTING_LIST_SORT_VENTILATION_DONE").'</td>';
|
||||
if (!empty($conf->global->ACCOUNTING_LIST_SORT_VENTILATION_DONE)) {
|
||||
print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&action=setACCOUNTING_LIST_SORT_VENTILATION_DONE&value=0">';
|
||||
print img_picto($langs->trans("Activated"), 'switch_on');
|
||||
print '</a></td>';
|
||||
} else {
|
||||
print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&action=setACCOUNTING_LIST_SORT_VENTILATION_DONE&value=1">';
|
||||
print img_picto($langs->trans("Disabled"), 'switch_off');
|
||||
print '</a></td>';
|
||||
}
|
||||
print '</tr>';
|
||||
|
||||
// Param a user $user->rights->accounting->chartofaccount can access
|
||||
foreach ($list_binding as $key) {
|
||||
print '<tr class="oddeven value">';
|
||||
|
||||
@ -65,10 +65,10 @@ $search_country = GETPOST('search_country', 'alpha');
|
||||
$search_tvaintra = GETPOST('search_tvaintra', 'alpha');
|
||||
|
||||
// Load variable for pagination
|
||||
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : (empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION) ? $conf->liste_limit : $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION);
|
||||
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : (empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION) ? $conf->liste_limit : $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION);
|
||||
$sortfield = GETPOST('sortfield', 'aZ09comma');
|
||||
$sortorder = GETPOST('sortorder', 'aZ09comma');
|
||||
$page = GETPOSTISSET('pageplusonPour le détail de la facture ref…e') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||
if (empty($page) || $page < 0) {
|
||||
$page = 0;
|
||||
}
|
||||
@ -81,6 +81,8 @@ if (!$sortfield) {
|
||||
if (!$sortorder) {
|
||||
if ($conf->global->ACCOUNTING_LIST_SORT_VENTILATION_DONE > 0) {
|
||||
$sortorder = "DESC";
|
||||
} else {
|
||||
$sortorder = "ASC";
|
||||
}
|
||||
}
|
||||
|
||||
@ -159,6 +161,12 @@ if (is_array($changeaccount) && count($changeaccount) > 0 && $user->hasRight('ac
|
||||
}
|
||||
}
|
||||
|
||||
if (GETPOST('sortfield') == 'f.datef, f.ref, fd.rowid') {
|
||||
$value = (GETPOST('sortorder') == 'asc,asc,asc' ? 0 : 1);
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
||||
$res = dolibarr_set_const($db, "ACCOUNTING_LIST_SORT_VENTILATION_DONE", $value, 'yesno', 0, '', $conf->entity);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
|
||||
@ -91,6 +91,8 @@ if (!$sortfield) {
|
||||
if (!$sortorder) {
|
||||
if ($conf->global->ACCOUNTING_LIST_SORT_VENTILATION_TODO > 0) {
|
||||
$sortorder = "DESC";
|
||||
} else {
|
||||
$sortorder = "ASC";
|
||||
}
|
||||
}
|
||||
|
||||
@ -208,6 +210,11 @@ if ($massaction == 'ventil' && $user->rights->accounting->bind->write) {
|
||||
}
|
||||
}
|
||||
|
||||
if (GETPOST('sortfield') == 'f.datef, f.ref, l.rowid') {
|
||||
$value = (GETPOST('sortorder') == 'asc,asc,asc' ? 0 : 1);
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
||||
$res = dolibarr_set_const($db, "ACCOUNTING_LIST_SORT_VENTILATION_TODO", $value, 'yesno', 0, '', $conf->entity);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
|
||||
@ -75,6 +75,8 @@ if (!$sortfield) {
|
||||
if (!$sortorder) {
|
||||
if ($conf->global->ACCOUNTING_LIST_SORT_VENTILATION_DONE > 0) {
|
||||
$sortorder = "DESC";
|
||||
} else {
|
||||
$sortorder = "ASC";
|
||||
}
|
||||
}
|
||||
|
||||
@ -149,6 +151,12 @@ if (is_array($changeaccount) && count($changeaccount) > 0 && $user->rights->acco
|
||||
}
|
||||
}
|
||||
|
||||
if (GETPOST('sortfield') == 'erd.date, erd.rowid') {
|
||||
$value = (GETPOST('sortorder') == 'asc,asc' ? 0 : 1);
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
||||
$res = dolibarr_set_const($db, "ACCOUNTING_LIST_SORT_VENTILATION_DONE", $value, 'yesno', 0, '', $conf->entity);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
|
||||
@ -84,6 +84,8 @@ if (!$sortfield) {
|
||||
if (!$sortorder) {
|
||||
if ($conf->global->ACCOUNTING_LIST_SORT_VENTILATION_TODO > 0) {
|
||||
$sortorder = "DESC";
|
||||
} else {
|
||||
$sortorder = "ASC";
|
||||
}
|
||||
}
|
||||
|
||||
@ -199,6 +201,11 @@ if ($massaction == 'ventil' && $user->rights->accounting->bind->write) {
|
||||
}
|
||||
}
|
||||
|
||||
if (GETPOST('sortfield') == 'erd.date, erd.rowid') {
|
||||
$value = (GETPOST('sortorder') == 'asc,asc' ? 0 : 1);
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
||||
$res = dolibarr_set_const($db, "ACCOUNTING_LIST_SORT_VENTILATION_TODO", $value, 'yesno', 0, '', $conf->entity);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
|
||||
@ -83,6 +83,8 @@ if (!$sortfield) {
|
||||
if (!$sortorder) {
|
||||
if ($conf->global->ACCOUNTING_LIST_SORT_VENTILATION_DONE > 0) {
|
||||
$sortorder = "DESC";
|
||||
} else {
|
||||
$sortorder = "ASC";
|
||||
}
|
||||
}
|
||||
|
||||
@ -164,6 +166,12 @@ if (is_array($changeaccount) && count($changeaccount) > 0 && $user->rights->acco
|
||||
}
|
||||
}
|
||||
|
||||
if (GETPOST('sortfield') == 'f.datef, f.ref, l.rowid') {
|
||||
$value = (GETPOST('sortorder') == 'asc,asc,asc' ? 0 : 1);
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
||||
$res = dolibarr_set_const($db, "ACCOUNTING_LIST_SORT_VENTILATION_DONE", $value, 'yesno', 0, '', $conf->entity);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
|
||||
@ -93,6 +93,8 @@ if (!$sortfield) {
|
||||
if (!$sortorder) {
|
||||
if ($conf->global->ACCOUNTING_LIST_SORT_VENTILATION_TODO > 0) {
|
||||
$sortorder = "DESC";
|
||||
} else {
|
||||
$sortorder = "ASC";
|
||||
}
|
||||
}
|
||||
|
||||
@ -210,6 +212,11 @@ if ($massaction == 'ventil' && $user->rights->accounting->bind->write) {
|
||||
}
|
||||
}
|
||||
|
||||
if (GETPOST('sortfield') == 'f.datef, f.ref, l.rowid') {
|
||||
$value = (GETPOST('sortorder') == 'asc,asc,asc' ? 0 : 1);
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
||||
$res = dolibarr_set_const($db, "ACCOUNTING_LIST_SORT_VENTILATION_TODO", $value, 'yesno', 0, '', $conf->entity);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
|
||||
@ -5329,7 +5329,7 @@ function getTitleFieldOfList($name, $thead = 0, $file = "", $field = "", $begin
|
||||
$options = '&'.$options;
|
||||
}
|
||||
|
||||
if (!$sortorder || $field1 != $sortfield1) {
|
||||
if (!$sortorder || ($field1 != $sortfield1)) {
|
||||
//$out.= '<a href="'.$file.'?sortfield='.$field.'&sortorder=asc&begin='.$begin.$options.'">'.img_down("A-Z",0).'</a>';
|
||||
//$out.= '<a href="'.$file.'?sortfield='.$field.'&sortorder=desc&begin='.$begin.$options.'">'.img_up("Z-A",0).'</a>';
|
||||
} else {
|
||||
|
||||
@ -124,18 +124,6 @@ class modAccounting extends DolibarrModules
|
||||
"",
|
||||
"", 0, 'current', 0
|
||||
);
|
||||
$this->const[9] = array(
|
||||
"ACCOUNTING_LIST_SORT_VENTILATION_TODO",
|
||||
"yesno",
|
||||
"1",
|
||||
"", 0, 'current', 0
|
||||
);
|
||||
$this->const[10] = array(
|
||||
"ACCOUNTING_LIST_SORT_VENTILATION_DONE",
|
||||
"yesno",
|
||||
"1",
|
||||
"", 0, 'current', 0
|
||||
);
|
||||
$this->const[11] = array(
|
||||
"ACCOUNTING_EXPORT_DATE",
|
||||
"chaine",
|
||||
|
||||
Loading…
Reference in New Issue
Block a user