Skip to content

Commit

Permalink
Merge branch 'develop' of [email protected]:Dolibarr/dolibarr.git into
Browse files Browse the repository at this point in the history
develop

Conflicts:
	htdocs/adherents/subscription/card.php
  • Loading branch information
eldy committed Jun 8, 2023
2 parents d28fcda + 134b9c7 commit 31d6df0
Show file tree
Hide file tree
Showing 276 changed files with 1,529 additions and 1,323 deletions.
4 changes: 2 additions & 2 deletions dev/setup/fail2ban/jail.local
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ filter = web-dolibarr-rulesbruteforce
logpath = /mypath/documents/documents/dolibarr.log
action = %(action_mw)s
bantime = 86400 ; 1 day
findtime = 3600 ; 1 hour
maxretry = 10
findtime = 14400 ; 4 hours
maxretry = 20


[web-dol-limitpublic]
Expand Down
86 changes: 66 additions & 20 deletions htdocs/accountancy/bookkeeping/balance.php
Original file line number Diff line number Diff line change
Expand Up @@ -161,11 +161,11 @@

if (!empty($search_date_start)) {
$filter['t.doc_date>='] = $search_date_start;
$param .= '&date_startmonth=' . GETPOST('date_startmonth', 'int') . '&date_startday=' . GETPOST('date_startday', 'int') . '&date_startyear=' . GETPOST('date_startyear', 'int');
$param .= '&date_startmonth=' . GETPOST('date_startmonth', 'int') . '&date_startday=' . GETPOST('date_startday', 'int') . '&date_startyear=' . GETPOST('date_startyear', 'int');
}
if (!empty($search_date_end)) {
$filter['t.doc_date<='] = $search_date_end;
$param .= '&amp;date_endmonth=' . GETPOST('date_endmonth', 'int') . '&amp;date_endday=' . GETPOST('date_endday', 'int') . '&amp;date_endyear=' . GETPOST('date_endyear', 'int');
$param .= '&date_endmonth=' . GETPOST('date_endmonth', 'int') . '&date_endday=' . GETPOST('date_endday', 'int') . '&date_endyear=' . GETPOST('date_endyear', 'int');
}
if (!empty($search_doc_date)) {
$filter['t.doc_date'] = $search_doc_date;
Expand All @@ -177,15 +177,15 @@
} else {
$filter['t.numero_compte>='] = $search_accountancy_code_start;
}
$param .= '&amp;search_accountancy_code_start=' . urlencode($search_accountancy_code_start);
$param .= '&search_accountancy_code_start=' . urlencode($search_accountancy_code_start);
}
if (!empty($search_accountancy_code_end)) {
if ($type == 'sub') {
$filter['t.subledger_account<='] = $search_accountancy_code_end;
} else {
$filter['t.numero_compte<='] = $search_accountancy_code_end;
}
$param .= '&amp;search_accountancy_code_end=' . urlencode($search_accountancy_code_end);
$param .= '&search_accountancy_code_end=' . urlencode($search_accountancy_code_end);
}
if (!empty($search_ledger_code)) {
$filter['t.code_journal'] = $search_ledger_code;
Expand Down Expand Up @@ -375,10 +375,12 @@
}
$moreforfilter .= '</div>';

$moreforfilter .= '<div class="divsearchfield">';
$moreforfilter .= '<label for="notreconciled">'.$langs->trans('NotReconciled').'</label>: ';
$moreforfilter .= '<input type="checkbox" name="search_not_reconciled" id="notreconciled" value="notreconciled"'.($search_not_reconciled == 'notreconciled' ? ' checked' : '').'>';
$moreforfilter .= '</div>';
if (!empty($conf->global->ACCOUNTING_ENABLE_LETTERING)) {
$moreforfilter .= '<div class="divsearchfield">';
$moreforfilter .= '<label for="notreconciled">'.$langs->trans('NotReconciled').'</label>: ';
$moreforfilter .= '<input type="checkbox" name="search_not_reconciled" id="notreconciled" value="notreconciled"'.($search_not_reconciled == 'notreconciled' ? ' checked' : '').'>';
$moreforfilter .= '</div>';
}

if (!empty($moreforfilter)) {
print '<div class="liste_titre liste_titre_bydiv centpercent">';
Expand All @@ -395,6 +397,14 @@
print '<table class="liste '.($moreforfilter ? "listwithfilterbefore" : "").'">';

print '<tr class="liste_titre_filter">';

if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
print '<td class="liste_titre maxwidthsearch">';
$searchpicto = $form->showFilterButtons();
print $searchpicto;
print '</td>';
}

print '<td class="liste_titre" colspan="'.$colspan.'">';
print '</td>';

Expand All @@ -404,13 +414,18 @@
print $hookmanager->resPrint;

// Action column
print '<td class="liste_titre maxwidthsearch">';
$searchpicto = $form->showFilterButtons();
print $searchpicto;
print '</td>';
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
print '<td class="liste_titre maxwidthsearch">';
$searchpicto = $form->showFilterButtons();
print $searchpicto;
print '</td>';
}
print '</tr>'."\n";

print '<tr class="liste_titre">';
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
}
print_liste_field_titre("AccountAccounting", $_SERVER['PHP_SELF'], "t.numero_compte", "", $param, "", $sortfield, $sortorder);
// TODO : Retrieve the type of third party: Customer / Supplier / Employee
//if ($type == 'sub') {
Expand All @@ -428,7 +443,9 @@
$reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $object); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
// Action column
print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
}
print '</tr>'."\n";

$total_debit = 0;
Expand Down Expand Up @@ -532,6 +549,14 @@
}

print '<tr class="oddeven">';

// Action column
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
print '<td class="center">';
print $link;
print '</td>';
}

// Accounting account
if ($type == 'sub') {
print '<td>'.$line->subledger_account.' <span class="opacitymedium">('.$line->subledger_label.')</span></td>';
Expand Down Expand Up @@ -581,9 +606,14 @@
} else {
print '<td class="right nowraponall amount">'.price(price2num($line->debit - $line->credit, 'MT')).'</td>';
}
print '<td class="center">';
print $link;
print '</td>';

// Action column
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
print '<td class="center">';
print $link;
print '</td>';
}

print "</tr>\n";

// Records the sub-total
Expand All @@ -593,7 +623,12 @@
}

if (!empty($show_subgroup)) {
print '<tr class="liste_total"><td class="right">'.$langs->trans("SubTotal").':</td>';
print '<tr class="liste_total">';
// Action column
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
print "<td></td>\n";
}
print '<td class="right">'.$langs->trans("SubTotal").':</td>';
if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) {
print '<td class="right nowraponall amount">'.price(price2num($sous_total_opening_balance, 'MT')).'</td>';
}
Expand All @@ -604,11 +639,19 @@
} else {
print '<td class="right nowraponall amount">' . price(price2num($sous_total_debit - $sous_total_credit, 'MT')) . '</td>';
}
print "<td></td>\n";
// Action column
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
print "<td></td>\n";
}
print '</tr>';
}

print '<tr class="liste_total"><td class="right">'.$langs->trans("AccountBalance").':</td>';
print '<tr class="liste_total">';
// Action column
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
print "<td></td>\n";
}
print '<td class="right">'.$langs->trans("AccountBalance").':</td>';
if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) {
print '<td class="nowrap right">'.price(price2num($total_opening_balance, 'MT')).'</td>';
}
Expand All @@ -619,7 +662,10 @@
} else {
print '<td class="right nowraponall amount">' . price(price2num($total_debit - $total_credit, 'MT')) . '</td>';
}
print "<td></td>\n";
// Action column
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
print "<td></td>\n";
}
print '</tr>';

$parameters = array('arrayfields'=>$arrayfields, 'sql'=>$sql);
Expand Down
2 changes: 1 addition & 1 deletion htdocs/accountancy/bookkeeping/list.php
Original file line number Diff line number Diff line change
Expand Up @@ -720,7 +720,7 @@

// List of mass actions available
$arrayofmassactions = array();
if (getDolGlobalInt('ACCOUNTING_ENABLE_LETTERING') && $user->rights->accounting->mouvements->creer) {
if (getDolGlobalInt('ACCOUNTING_ENABLE_LETTERING') && $user->hasRight('accounting', 'mouvements', 'creer')) {
$arrayofmassactions['letteringauto'] = img_picto('', 'check', 'class="pictofixedwidth"') . $langs->trans('LetteringAuto');
$arrayofmassactions['preunletteringauto'] = img_picto('', 'uncheck', 'class="pictofixedwidth"') . $langs->trans('UnletteringAuto');
$arrayofmassactions['letteringmanual'] = img_picto('', 'check', 'class="pictofixedwidth"') . $langs->trans('LetteringManual');
Expand Down
2 changes: 1 addition & 1 deletion htdocs/accountancy/bookkeeping/listbyaccount.php
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@
$param = '&type='.$type.$param;
}

//if ($action == 'delbookkeepingyearconfirm' && $user->rights->accounting->mouvements->supprimer_tous) {
//if ($action == 'delbookkeepingyearconfirm' && $user->hasRight('accounting', 'mouvements', 'supprimer')_tous) {
// $delmonth = GETPOST('delmonth', 'int');
// $delyear = GETPOST('delyear', 'int');
// if ($delyear == -1) {
Expand Down
4 changes: 2 additions & 2 deletions htdocs/accountancy/customer/list.php
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@
}


if ($massaction == 'ventil' && $user->rights->accounting->bind->write) {
if ($massaction == 'ventil' && $user->hasRight('accounting', 'bind', 'write')) {
$msg = '';

//print '<div><span style="color:red">' . $langs->trans("Processing") . '...</span></div>';
Expand Down Expand Up @@ -446,7 +446,7 @@
//'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"),
//'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"),
);
//if ($user->rights->mymodule->supprimer) $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete");
//if ($user->hasRight('mymodule', 'supprimer')) $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete");
//if (in_array($massaction, array('presend','predelete'))) $arrayofmassactions=array();
if ($massaction !== 'set_default_account') {
$massactionbutton = $form->selectMassAction('ventil', $arrayofmassactions, 1);
Expand Down
2 changes: 1 addition & 1 deletion htdocs/accountancy/expensereport/card.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
* Actions
*/

if ($action == 'ventil' && $user->rights->accounting->bind->write) {
if ($action == 'ventil' && $user->hasRight('accounting', 'bind', 'write')) {
if (!$cancel) {
if ($codeventil < 0) {
$codeventil = 0;
Expand Down
2 changes: 1 addition & 1 deletion htdocs/accountancy/expensereport/lines.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@
$search_date_end = '';
}

if (is_array($changeaccount) && count($changeaccount) > 0 && $user->rights->accounting->bind->write) {
if (is_array($changeaccount) && count($changeaccount) > 0 && $user->hasRight('accounting', 'bind', 'write')) {
$error = 0;

if (!(GETPOST('account_parent', 'int') >= 0)) {
Expand Down
2 changes: 1 addition & 1 deletion htdocs/accountancy/expensereport/list.php
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@
}


if ($massaction == 'ventil' && $user->rights->accounting->bind->write) {
if ($massaction == 'ventil' && $user->hasRight('accounting', 'bind', 'write')) {
$msg = '';

if (!empty($mesCasesCochees)) {
Expand Down
Loading

0 comments on commit 31d6df0

Please sign in to comment.