Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX avoid php warnings #32333

Open
wants to merge 1 commit into
base: 20.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions htdocs/compta/facture/list.php
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,13 @@
$pageprev = $page - 1;
$pagenext = $page + 1;

// Security check
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to template in modulebuilder, the test on restrictArea is done at end of header.
The reason is that some tests on permission need the variable to be initialized before being checked.
On which field is the warning ?

$fieldid = (!empty($ref) ? 'ref' : 'rowid');
if (!empty($user->socid)) {
$socid = $user->socid;
}
$result = restrictedArea($user, 'facture', $id, '', '', 'fk_soc', $fieldid);

$diroutputmassaction = $conf->facture->dir_output.'/temp/massgeneration/'.$user->id;

$now = dol_now();
Expand Down Expand Up @@ -308,13 +315,6 @@
$search_sale = $user->id;
}

// Security check
$fieldid = (!empty($ref) ? 'ref' : 'rowid');
if (!empty($user->socid)) {
$socid = $user->socid;
}
$result = restrictedArea($user, 'facture', $id, '', '', 'fk_soc', $fieldid);


/*
* Actions
Expand Down
6 changes: 3 additions & 3 deletions htdocs/core/actions_massactions.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -891,13 +891,13 @@
$filename .= '_'.strtolower(dol_sanitizeFileName($langs->transnoentities("Unpaid")));
}
}
if ($year) {
if (!empty($year)) {
$filename .= '_'.$year;
}
if ($month) {
if (!empty($month)) {
$filename .= '_'.$month;
}
if ($pagecount) {
if (!empty($pagecount)) {
$now = dol_now();
$file = $diroutputmassaction.'/'.$filename.'_'.dol_print_date($now, 'dayhourlog').'.pdf';
$pdf->Output($file, 'F');
Expand Down
Loading