dolibarr 25.0.0-alpha
index.php
Go to the documentation of this file.
1<?php
2/* Copyright (C) 2019-2023 Open-DSI <support@open-dsi.fr>
3 * Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
4 * Copyright (C) 2025-2026 Alexandre Spangaro <alexandre@inovea-conseil.com>
5 * Copyright (C) 2025-2026 MDW <mdeweerd@users.noreply.github.com>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <https://www.gnu.org/licenses/>.
19 */
20
27// Load Dolibarr environment
28require '../../main.inc.php';
36require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
37require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
38require_once DOL_DOCUMENT_ROOT.'/core/class/fiscalyear.class.php';
39require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php';
40require_once DOL_DOCUMENT_ROOT.'/accountancy/class/bookkeeping.class.php';
41
42// Load translation files required by the page
43$langs->loadLangs(array("accountancy", "bills", "compta", "exports", "other"));
44
45$action = GETPOST('action', 'aZ09');
46$confirm = GETPOST('confirm', 'aZ09');
47$fiscal_period_id = GETPOSTINT('fiscal_period_id');
48$validatemonth = GETPOSTINT('validatemonth');
49$validateyear = GETPOSTINT('validateyear');
50
51// Security check
52if (!isModEnabled('accounting')) {
54}
55if ($user->socid > 0) {
57}
58if (!$user->hasRight('accounting', 'fiscalyear', 'write')) {
60}
61
62// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context
63$hookmanager->initHooks(array('accountancyclosure'));
64
65$object = new BookKeeping($db);
66
67$now = dol_now();
68$fiscal_periods = $object->getFiscalPeriods();
69if (!is_array($fiscal_periods)) {
70 setEventMessages($object->error, $object->errors, 'errors');
71}
72
73// Define the arrays of fiscal periods
74$active_fiscal_periods = array();
75$first_active_fiscal_period = null;
76$last_fiscal_period = null;
77$current_fiscal_period = null;
78$next_fiscal_period = null;
79$next_active_fiscal_period = null;
80if (is_array($fiscal_periods)) {
81 foreach ($fiscal_periods as $fiscal_period) { // List of fiscal periods sorted by date start
82 if (empty($first_active_fiscal_period) && empty($fiscal_period['status'])) {
83 $first_active_fiscal_period = $fiscal_period;
84 }
85 if (empty($fiscal_period['status'])) { // if not closed
86 $active_fiscal_periods[] = $fiscal_period;
87 }
88 if (isset($current_fiscal_period)) { // If we already reach then current fiscal period, then this one is the next one just after
89 if (!isset($next_fiscal_period)) {
90 $next_fiscal_period = $fiscal_period;
91 }
92 if (!isset($next_active_fiscal_period) && empty($fiscal_period['status'])) {
93 $next_active_fiscal_period = $fiscal_period;
94 }
95 } else { // If we did not found the current fiscal period
96 // Only select by ID, not by date range for closure page
97 if (!empty($fiscal_period_id) && $fiscal_period_id == $fiscal_period['id']) {
98 $current_fiscal_period = $fiscal_period;
99 } else {
100 $last_fiscal_period = $fiscal_period; // $last_fiscal_period is in fact $previous_fiscal_period
101 }
102 }
103 }
104}
105
106// If a current fiscal period open with an end and start date was not found, we autoselect the first one that is open and has a start and end date defined
107if (empty($current_fiscal_period) && !empty($first_active_fiscal_period)) {
108 $current_fiscal_period = $first_active_fiscal_period;
109 $last_fiscal_period = null;
110 $foundcurrent = false;
111 foreach ($fiscal_periods as $fiscal_period) { // List of fiscal periods sorted by date start
112 if ($foundcurrent) {
113 $next_fiscal_period = $fiscal_period;
114 break;
115 }
116 if ($fiscal_period['id'] == $current_fiscal_period['id']) {
117 $foundcurrent = true;
118 }
119 if (!$foundcurrent) {
120 $last_fiscal_period = $fiscal_period;
121 }
122 }
123}
124
125$accounting_groups_used_for_balance_sheet_account = array_filter(array_map('trim', explode(',', getDolGlobalString('ACCOUNTING_CLOSURE_ACCOUNTING_GROUPS_USED_FOR_BALANCE_SHEET_ACCOUNT'))), 'strlen'); // @phpstan-ignore argument.type
126$accounting_groups_used_for_income_statement = array_filter(array_map('trim', explode(',', getDolGlobalString('ACCOUNTING_CLOSURE_ACCOUNTING_GROUPS_USED_FOR_INCOME_STATEMENT'))), 'strlen'); // @phpstan-ignore argument.type
127
128
129/*
130 * Actions
131 */
132
133$parameters = array('fiscal_periods' => $fiscal_periods, 'last_fiscal_period' => $last_fiscal_period, 'current_fiscal_period' => $current_fiscal_period, 'next_fiscal_period' => $next_fiscal_period);
134$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
135if ($reshook < 0) {
136 setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
137}
138
139if (empty($reshook)) {
140 if (isset($current_fiscal_period)) {
141 if ($action == 'confirm_step_1' && $confirm == "yes" && $user->hasRight('accounting', 'fiscalyear', 'write')) {
142 $date_start = dol_mktime(0, 0, 0, GETPOSTINT('date_startmonth'), GETPOSTINT('date_startday'), GETPOSTINT('date_startyear'));
143 $date_end = dol_mktime(23, 59, 59, GETPOSTINT('date_endmonth'), GETPOSTINT('date_endday'), GETPOSTINT('date_endyear'));
144
145 $result = $object->validateMovementForFiscalPeriod($date_start, $date_end);
146 if ($result > 0) {
147 setEventMessages($langs->trans("AllMovementsWereRecordedAsValidated"), null, 'mesgs');
148
149 header("Location: " . $_SERVER['PHP_SELF'] . '?fiscal_period_id=' . $current_fiscal_period['id']);
150 exit;
151 } else {
152 setEventMessages($langs->trans("NotAllMovementsCouldBeRecordedAsValidated"), null, 'errors');
153 setEventMessages($object->error, $object->errors, 'errors');
154 $action = '';
155 }
156 } elseif ($action == 'confirm_step_2' && $confirm == "yes" && $user->hasRight('accounting', 'fiscalyear', 'write')) {
157 $new_fiscal_period_id = GETPOSTINT('new_fiscal_period_id');
158 $separate_auxiliary_account = (!empty(GETPOST('separate_auxiliary_account')) ? 1 : 0);
159 $generate_bookkeeping_records = (!empty(GETPOST('generate_bookkeeping_records')) ? 1 : 0);
160
161 $error = 0;
162 if ($generate_bookkeeping_records) {
163 if (!getDolGlobalString('ACCOUNTING_CLOSURE_ACCOUNTING_GROUPS_USED_FOR_BALANCE_SHEET_ACCOUNT')) {
164 $error++;
165 setEventMessages($langs->trans("ErrorAccountingClosureSetupNotComplete"), null, 'errors');
166 } elseif (!getDolGlobalString('ACCOUNTING_CLOSURE_ACCOUNTING_GROUPS_USED_FOR_INCOME_STATEMENT')) {
167 $error++;
168 setEventMessages($langs->trans("ErrorAccountingClosureSetupNotComplete"), null, 'errors');
169 }
170 }
171
172 if (!$error) {
173 $result = $object->closeFiscalPeriod($current_fiscal_period['id'], $new_fiscal_period_id, (bool) $separate_auxiliary_account, (bool) $generate_bookkeeping_records);
174 if ($result < 0) {
175 setEventMessages($object->error, $object->errors, 'errors');
176 } else {
177 setEventMessages($langs->trans("AccountancyClosureCloseSuccessfully"), null, 'mesgs');
178
179 header("Location: " . $_SERVER['PHP_SELF'] . '?fiscal_period_id=' . $current_fiscal_period['id']);
180 exit;
181 }
182 }
183 } elseif ($action == 'confirm_step_3' && $confirm == "yes" && $user->hasRight('accounting', 'fiscalyear', 'write')) {
184 $inventory_journal_id = GETPOSTINT('inventory_journal_id');
185 $new_fiscal_period_id = GETPOSTINT('new_fiscal_period_id');
186 $date_start = dol_mktime(0, 0, 0, GETPOSTINT('date_startmonth'), GETPOSTINT('date_startday'), GETPOSTINT('date_startyear'));
187 $date_end = dol_mktime(23, 59, 59, GETPOSTINT('date_endmonth'), GETPOSTINT('date_endday'), GETPOSTINT('date_endyear'));
188
189 $result = $object->insertAccountingReversal($current_fiscal_period['id'], $inventory_journal_id, $new_fiscal_period_id, $date_start, $date_end);
190 if ($result < 0) {
191 setEventMessages($object->error, $object->errors, 'errors');
192 } else {
193 setEventMessages($langs->trans("AccountancyClosureInsertAccountingReversalSuccessfully"), null, 'mesgs');
194
195 header("Location: " . $_SERVER['PHP_SELF'] . '?fiscal_period_id=' . $current_fiscal_period['id']);
196 exit;
197 }
198 }
199 }
200}
201
202
203/*
204 * View
205 */
206
207$form = new Form($db);
208$formaccounting = new FormAccounting($db);
209
210$title = $langs->trans('Closure');
211
212$help_url = 'EN:Module_Double_Entry_Accounting|FR:Module_Comptabilit&eacute;_en_Partie_Double#Cl.C3.B4ture_annuelle';
213
214llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-accountancy page-closure-index');
215
216$formconfirm = '';
217
218if (isset($current_fiscal_period)) {
219 if ($action == 'step_1') {
220 $form_question = array();
221
222 $form_question['date_start'] = array(
223 'name' => 'date_start',
224 'type' => 'date',
225 'label' => $langs->trans('DateStart'),
226 'value' => $current_fiscal_period['date_start']
227 );
228 $form_question['date_end'] = array(
229 'name' => 'date_end',
230 'type' => 'date',
231 'label' => $langs->trans('DateEnd'),
232 'value' => $current_fiscal_period['date_end']
233 );
234
235 $formconfirm = $form->formconfirm(
236 $_SERVER["PHP_SELF"] . '?fiscal_period_id=' . $current_fiscal_period['id'],
237 $langs->trans('ValidateMovements'),
238 $langs->trans('DescValidateMovements', $langs->transnoentitiesnoconv("RegistrationInAccounting")),
239 'confirm_step_1',
240 $form_question,
241 '',
242 1,
243 340,
244 600
245 );
246 } elseif ($action == 'step_2') {
247 $form_question = array();
248
249 $fiscal_period_arr = array();
250 if (!empty($current_fiscal_period['date_end'])) {
251 foreach ($active_fiscal_periods as $info) {
252 if ($info['date_start'] > $current_fiscal_period['date_end']) {
253 $fiscal_period_arr[$info['id']] = $info['label'];
254 }
255 }
256 }
257 if (empty($fiscal_period_arr)) {
258 $langs->load('errors');
259 setEventMessages($langs->trans(empty($current_fiscal_period['date_end']) ? 'ErrorAccountancyClosureNoEndDate' : 'ErrorAccountancyClosureNoNextFiscalPeriod'), null, 'errors');
260 }
261 $form_question['new_fiscal_period_id'] = array(
262 'name' => 'new_fiscal_period_id',
263 'type' => 'select',
264 'label' => $langs->trans('AccountancyClosureStep3NewFiscalPeriod'),
265 'values' => $fiscal_period_arr,
266 'default' => isset($next_active_fiscal_period) ? $next_active_fiscal_period['id'] : '',
267 );
268 $form_question['generate_bookkeeping_records'] = array(
269 'name' => 'generate_bookkeeping_records',
270 'type' => 'checkbox',
271 'label' => $langs->trans('AccountancyClosureGenerateClosureBookkeepingRecords'),
272 'value' => 1
273 );
274 $form_question['separate_auxiliary_account'] = array(
275 'name' => 'separate_auxiliary_account',
276 'type' => 'checkbox',
277 'label' => $langs->trans('AccountancyClosureSeparateAuxiliaryAccounts'),
278 'value' => 0
279 );
280
281 $formconfirm = empty($fiscal_period_arr) ? '' : $form->formconfirm(
282 $_SERVER["PHP_SELF"] . '?fiscal_period_id=' . $current_fiscal_period['id'],
283 $langs->trans('AccountancyClosureClose'),
284 $langs->trans('AccountancyClosureConfirmClose'),
285 'confirm_step_2',
286 $form_question,
287 '',
288 1,
289 340,
290 600
291 );
292 } elseif ($action == 'step_3') {
293 $form_question = array();
294
295 $form_question['inventory_journal_id'] = array(
296 'name' => 'inventory_journal_id',
297 'type' => 'other',
298 'label' => $langs->trans('InventoryJournal'),
299 'value' => $formaccounting->select_journal('0', "inventory_journal_id", 8, 1, 0, 0)
300 );
301 $fiscal_period_arr = array();
302 foreach ($active_fiscal_periods as $info) {
303 $fiscal_period_arr[$info['id']] = $info['label'];
304 }
305 $form_question['new_fiscal_period_id'] = array(
306 'name' => 'new_fiscal_period_id',
307 'type' => 'select',
308 'label' => $langs->trans('AccountancyClosureStep3NewFiscalPeriod'),
309 'values' => $fiscal_period_arr,
310 'default' => isset($next_active_fiscal_period) ? $next_active_fiscal_period['id'] : '',
311 );
312 $form_question['date_start'] = array(
313 'name' => 'date_start',
314 'type' => 'date',
315 'label' => $langs->trans('DateStart'),
316 'value' => dol_time_plus_duree((int) $current_fiscal_period['date_end'], -1, 'm')
317 );
318 $form_question['date_end'] = array(
319 'name' => 'date_end',
320 'type' => 'date',
321 'label' => $langs->trans('DateEnd'),
322 'value' => $current_fiscal_period['date_end']
323 );
324
325 $formconfirm = $form->formconfirm(
326 $_SERVER["PHP_SELF"] . '?fiscal_period_id=' . $current_fiscal_period['id'],
327 $langs->trans('AccountancyClosureAccountingReversal'),
328 $langs->trans('AccountancyClosureConfirmAccountingReversal'),
329 'confirm_step_3',
330 $form_question,
331 '',
332 1,
333 340,
334 600
335 );
336 }
337}
338
339// Call Hook formConfirm
340$parameters = array('formConfirm' => $formconfirm, 'fiscal_periods' => $fiscal_periods, 'last_fiscal_period' => $last_fiscal_period, 'current_fiscal_period' => $current_fiscal_period, 'next_fiscal_period' => $next_fiscal_period);
341$reshook = $hookmanager->executeHooks('formConfirm', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
342if (empty($reshook)) {
343 $formconfirm .= $hookmanager->resPrint;
344} elseif ($reshook > 0) {
345 $formconfirm = $hookmanager->resPrint;
346}
347
348// Print form confirm
349print $formconfirm;
350
351$fiscal_period_nav_text = $langs->trans("FiscalPeriod");
352
353if (!empty($current_fiscal_period)) {
354 $fiscal_period_nav_text .= ' '.$current_fiscal_period['label'].' &nbsp;(' . dol_print_date($current_fiscal_period['date_start'], 'day') . '&nbsp;-&nbsp;' . ($current_fiscal_period['date_end'] ? dol_print_date($current_fiscal_period['date_end'], 'day') : '?'). ')';
355}
356$fiscal_period_nav_text .= '&nbsp; &nbsp; ';
357$fiscal_period_nav_text .= '<a href="' . (isset($last_fiscal_period) ? $_SERVER["PHP_SELF"] . '?fiscal_period_id=' . $last_fiscal_period['id'] : '#" class="disabled') . '">' . img_previous() . '</a>';
358$fiscal_period_nav_text .= '&nbsp;';
359$fiscal_period_nav_text .= '<a href="' . (isset($next_fiscal_period) ? $_SERVER["PHP_SELF"] . '?fiscal_period_id=' . $next_fiscal_period['id'] : '#" class="disabled') . '">' . img_next() . '</a>';
360
361print load_fiche_titre($langs->trans("Closure") . " - " . $fiscal_period_nav_text, '', 'title_accountancy');
362
363if (empty($current_fiscal_period)) {
364 print $langs->trans('ErrorNoFiscalPeriodActiveFound', $langs->transnoentitiesnoconv("Accounting"), $langs->transnoentitiesnoconv("Setup"), $langs->transnoentitiesnoconv("FiscalPeriod"));
365} else {
366 if (!getDolGlobalString("ACCOUNTANCY_DISABLE_CLOSURE_LINE_BY_LINE")) {
367 // Step 1
368 $head = array();
369 $head[0][0] = DOL_URL_ROOT . '/accountancy/closure/index.php?fiscal_period_id=' . $current_fiscal_period['id'];
370 $head[0][1] = $langs->trans("Step").' 1 - '.$langs->trans("AccountancyClosureStep1");
371 $head[0][2] = 'step1';
372 print dol_get_fiche_head($head, 'step1', '', -1, '');
373
374 //print '<span class="opacitymedium">' . $langs->trans("AccountancyClosureStep1Desc") . '</span><br>';
375
376 $count_by_month = $object->getCountByMonthForFiscalPeriod((int) $current_fiscal_period['date_start'], (int) $current_fiscal_period['date_end']);
377
378 if (!is_array($count_by_month)) {
379 setEventMessages($object->error, $object->errors, 'errors');
380 }
381
382 if (empty($count_by_month['total'])) {
383 $buttonvalidate = '<a class="butActionRefused classfortooltip" href="#">' . $langs->trans("ValidateMovements") . '</a>';
384 } else {
385 $buttonvalidate = '<a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?action=step_1&token='.newToken().'&fiscal_period_id=' . $current_fiscal_period['id'] . '">' . $langs->trans("ValidateMovements") . '</a>';
386 }
387 print_barre_liste($langs->trans("OverviewOfMovementsNotValidated"), 0, '', '', '', '', '', -1, '', '', 0, $buttonvalidate, '', 0, 1, 0);
388
389 print '<div class="div-table-responsive-no-min">';
390 print '<table class="noborder centpercent">';
391
392 print '<tr class="liste_titre">';
393 $nb_years = is_array($count_by_month['list']) ? count($count_by_month['list']) : 0;
394 if ($nb_years > 1) {
395 print '<td class="right">' . $langs->trans("Year") . '</td>';
396 }
397 for ($i = 1; $i <= 12; $i++) {
398 print '<td class="right">' . $langs->trans('MonthShort' . str_pad((string) $i, 2, '0', STR_PAD_LEFT)) . '</td>';
399 }
400 print '<td class="right"><b>' . $langs->trans("Total") . '</b></td>';
401 print '</tr>';
402
403 if (is_array($count_by_month['list']) && count($count_by_month['list']) > 0) {
404 foreach ($count_by_month['list'] as $info) {
405 print '<tr class="oddeven">';
406 if ($nb_years > 1) {
407 print '<td class="right">' . $info['year'] . '</td>';
408 }
409 for ($i = 1; $i <= 12; $i++) {
410 print '<td class="right">' . ((int) $info['count'][$i]) . '</td>';
411 }
412 print '<td class="right"><b>' . $info['total'] . '</b></td>';
413 print '</tr>';
414 }
415 } else {
416 print '<tr class="oddeven"><td colspan="' . (12 + ($nb_years > 1 ? 1 : 0) + 1) . '">';
417 print '<span class="opacitymedium">';
418 print $langs->trans("None");
419 print '</span>';
420 print '</td></tr>';
421 }
422
423 print "</table>\n";
424 print '</div>';
425
426 print '<br>';
427 }
428
429 // Step 2
430 $head = array();
431 $head[0][0] = DOL_URL_ROOT . '/accountancy/closure/index.php?fiscal_period_id=' . $current_fiscal_period['id'];
432 $head[0][1] = $langs->trans("Step"). ' ' . (getDolGlobalString("ACCOUNTANCY_DISABLE_CLOSURE_LINE_BY_LINE") ? '1' : '2').' - '.$langs->trans("AccountancyClosureStep2");
433 $head[0][2] = 'step2';
434 print dol_get_fiche_head($head, 'step2', '', -1, '');
435
436 $button = '';
437 // print '<span class="opacitymedium">' . $langs->trans("AccountancyClosureStep2Desc") . '</span><br>';
438 if ((empty($count_by_month['total']) || getDolGlobalString("ACCOUNTANCY_DISABLE_CLOSURE_LINE_BY_LINE")) && empty($current_fiscal_period['status'])) {
439 // If no unlocked record and period still open
440 $button = '<a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?action=step_2&token='.newToken().'&fiscal_period_id=' . $current_fiscal_period['id'] . '">' . $langs->trans("AccountancyClosureClose") . '</a>';
441 } else {
442 if (!empty($current_fiscal_period['status'])) {
443 $button = '<a class="butActionRefused classfortooltip" href="#" title="The period is already closed. Feature disabled.">' . $langs->trans("AccountancyClosureClose") . '</a>';
444 } elseif (!empty($count_by_month['total'])) {
445 $button = '<a class="butActionRefused classfortooltip" href="#" title="There is some lines not yet locked. Feature disabled.">' . $langs->trans("AccountancyClosureClose") . '</a>';
446 }
447 }
448 print_barre_liste('', 0, '', '', '', '', '', -1, '', '', 0, $button, '', 0, 1, 0);
449
450 print '<br>';
451
452 // Step 3
453 $head = array();
454 $head[0][0] = DOL_URL_ROOT . '/accountancy/closure/index.php?fiscal_period_id=' . $current_fiscal_period['id'];
455 $head[0][1] = $langs->trans("Step"). ' ' . (getDolGlobalString("ACCOUNTANCY_DISABLE_CLOSURE_LINE_BY_LINE") ? '2' : '3').' - '.$langs->trans("AccountancyClosureStep3");
456 $head[0][2] = 'step3';
457 print dol_get_fiche_head($head, 'step3', '', -1, '');
458
459 // print '<span class="opacitymedium">' . $langs->trans("AccountancyClosureStep3Desc") . '</span><br>';
460
461 if (empty($current_fiscal_period['status'])) {
462 $button = '<a class="butActionRefused classfortooltip" href="#">' . $langs->trans("AccountancyClosureAccountingReversal") . '</a>';
463 } else {
464 $button = '<a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?action=step_3&token='.newToken().'&fiscal_period_id=' . $current_fiscal_period['id'] . '">' . $langs->trans("AccountancyClosureAccountingReversal") . '</a>';
465 }
466 print_barre_liste('', 0, '', '', '', '', '', -1, '', '', 0, $button, '', 0, 1, 0);
467}
468
469// End of page
470llxFooter();
471$db->close();
if(! $sortfield) if(! $sortorder) $object
Definition account.php:100
llxFooter($comment='', $zone='private', $disabledoutputofmessages=0)
Empty footer.
Definition wrapper.php:91
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
Empty header.
Definition wrapper.php:73
Class to manage Ledger (General Ledger and Subledger)
Class to manage generation of HTML components for accounting management.
Class to manage generation of HTML components Only common components must be here.
dol_time_plus_duree($time, $duration_value, $duration_unit, $ruleforendofmonth=0, $tz='')
Add a delay to a date.
Definition date.lib.php:127
$date_start
Variables from include:
dol_now($mode='gmt')
Return date for now.
dol_mktime($hour, $minute, $second, $month, $day, $year, $gm='auto', $check=1)
Return a timestamp date built from detailed information (by default a local PHP server timestamp) Rep...
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0, $nodefault=0)
Return value of a param into GET or POST supervariable.
GETPOSTINT($paramname, $method=0, $nodefault=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs=null, $encodetooutput=false, $decorate=0)
Output date in a string format according to outputlangs (or langs if not defined).
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
isModEnabled($module)
Is Dolibarr module enabled.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='', $dragdropfile=0, $morecssdiv='')
Show tabs of a record.
Definition html.lib.php:542
img_previous($titlealt='default', $moreatt='')
Show previous logo.
img_next($titlealt='default', $moreatt='')
Show next logo.
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='', $morecssonpicto='widthpictotitle')
Load a title with picto.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.