Qual: Mutualize code
This commit is contained in:
parent
df227422ed
commit
1e76d296ae
@ -25,10 +25,12 @@
|
|||||||
require("../../main.inc.php");
|
require("../../main.inc.php");
|
||||||
require_once(DOL_DOCUMENT_ROOT."/core/modules/rapport/pdf_paiement.class.php");
|
require_once(DOL_DOCUMENT_ROOT."/core/modules/rapport/pdf_paiement.class.php");
|
||||||
require_once(DOL_DOCUMENT_ROOT."/core/lib/files.lib.php");
|
require_once(DOL_DOCUMENT_ROOT."/core/lib/files.lib.php");
|
||||||
|
require_once(DOL_DOCUMENT_ROOT."/core/class/html.formother.class.php");
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
if (! $user->rights->facture->lire)
|
if (! $user->rights->facture->lire) accessforbidden();
|
||||||
accessforbidden();
|
|
||||||
|
$action=GETPOST('action');
|
||||||
|
|
||||||
$dir = $conf->facture->dir_output.'/payments';
|
$dir = $conf->facture->dir_output.'/payments';
|
||||||
|
|
||||||
@ -48,7 +50,7 @@ if (! $year) { $year=date("Y"); }
|
|||||||
* Actions
|
* Actions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if ($_POST["action"] == 'builddoc')
|
if ($action == 'builddoc')
|
||||||
{
|
{
|
||||||
$rap = new pdf_paiement($db);
|
$rap = new pdf_paiement($db);
|
||||||
|
|
||||||
@ -80,6 +82,8 @@ if ($_POST["action"] == 'builddoc')
|
|||||||
* View
|
* View
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
$formother=new FormOther($db);
|
||||||
|
|
||||||
llxHeader();
|
llxHeader();
|
||||||
|
|
||||||
$titre=($year?$langs->trans("PaymentsReportsForYear",$year):$langs->trans("PaymentsReports"));
|
$titre=($year?$langs->trans("PaymentsReportsForYear",$year):$langs->trans("PaymentsReports"));
|
||||||
@ -92,33 +96,10 @@ print '<input type="hidden" name="action" value="builddoc">';
|
|||||||
$cmonth = GETPOST("remonth")?GETPOST("remonth"):date("n", time());
|
$cmonth = GETPOST("remonth")?GETPOST("remonth"):date("n", time());
|
||||||
$syear = GETPOST("reyear")?GETPOST("reyear"):date("Y", time());
|
$syear = GETPOST("reyear")?GETPOST("reyear"):date("Y", time());
|
||||||
|
|
||||||
print '<select class="flat" name="remonth">';
|
print $formother->select_month($cmonth,'remonth');
|
||||||
for ($month = 1 ; $month < 13 ; $month++)
|
|
||||||
{
|
print $formother->select_year($syear,'reyear');
|
||||||
if ($month == $cmonth)
|
|
||||||
{
|
|
||||||
print "<option value=\"$month\" selected=\"true\">" . dol_print_date(mktime(0,0,0,$month),"%B");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
print "<option value=\"$month\">" . dol_print_date(mktime(0,0,0,$month),"%B");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
print "</select>";
|
|
||||||
print '<select class="flat" name="reyear">';
|
|
||||||
|
|
||||||
for ($formyear = $syear - 2; $formyear < $syear +1 ; $formyear++)
|
|
||||||
{
|
|
||||||
if ($formyear == $syear)
|
|
||||||
{
|
|
||||||
print "<option value=\"$formyear\" selected=\"true\">".$formyear."</option>";
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
print "<option value=\"$formyear\">".$formyear."</option>";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
print "</select>\n";
|
|
||||||
print '<input type="submit" class="button" value="'.$langs->trans("Create").'">';
|
print '<input type="submit" class="button" value="'.$langs->trans("Create").'">';
|
||||||
print '</form>';
|
print '</form>';
|
||||||
print '<br>';
|
print '<br>';
|
||||||
@ -183,7 +164,8 @@ if ($year)
|
|||||||
print '</table>';
|
print '</table>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$db->close();
|
|
||||||
|
|
||||||
llxFooter();
|
llxFooter();
|
||||||
|
|
||||||
|
$db->close();
|
||||||
?>
|
?>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user