dolibarr 21.0.0-beta
quickadd_page.php
Go to the documentation of this file.
1<?php
2/* Copyright (C) 2005-2017 Laurent Destailleur <eldy@users.sourceforge.net>
3 * Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
4 *
5 * This file is a modified version of datepicker.php from phpBSM to fix some
6 * bugs, to add new features and to dramatically increase speed.
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 3 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program. If not, see <https://www.gnu.org/licenses/>.
20 */
21
27//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER','1'); // Not disabled cause need to load personalized language
28//if (! defined('NOREQUIREDB')) define('NOREQUIREDB','1'); // Not disabled cause need to load personalized language
29//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1');
30//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); // Not disabled cause need to do translations
31if (!defined('NOCSRFCHECK')) {
32 define('NOCSRFCHECK', 1);
33}
34if (!defined('NOTOKENRENEWAL')) {
35 define('NOTOKENRENEWAL', 1);
36}
37//if (! defined('NOLOGIN')) define('NOLOGIN',1); // Not disabled cause need to load personalized language
38if (!defined('NOREQUIREMENU')) {
39 define('NOREQUIREMENU', 1);
40}
41//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML',1);
42
43require_once '../main.inc.php';
52if (GETPOST('lang', 'aZ09')) {
53 $langs->setDefaultLang(GETPOST('lang', 'aZ09')); // If language was forced on URL by the main.inc.php
54}
55
56$langs->loadLangs(array("main", "other"));
57
58$action = GETPOST('action', 'aZ09');
59
60/*$right = ($langs->trans("DIRECTION") == 'rtl' ? 'left' : 'right');
61$left = ($langs->trans("DIRECTION") == 'rtl' ? 'right' : 'left');*/
62
63
64/*
65 * Actions
66 */
67
68// None
69
70
71/*
72 * View
73 */
74
75// Important: Following code is to avoid page request by browser and PHP CPU at each Dolibarr page access.
76if (empty($dolibarr_nocache) && GETPOSTINT('cache')) {
77 header('Cache-Control: max-age='.GETPOSTINT('cache').', public');
78 // For a .php, we must set an Expires to avoid to have it forced to an expired value by the web server
79 header('Expires: '.gmdate('D, d M Y H:i:s', dol_now('gmt') + GETPOSTINT('cache')).' GMT');
80 // HTTP/1.0
81 header('Pragma: token=public');
82} else {
83 // HTTP/1.0
84 header('Cache-Control: no-cache');
85}
86
87$title = $langs->trans("QuickAdd");
88
89// URL http://mydolibarr/core/search_page?dol_use_jmobile=1 can be used for tests
90$head = '<!-- Quick add -->'."\n"; // This is used by DoliDroid to know page is a search page
91$arrayofjs = array();
92$arrayofcss = array();
93top_htmlhead($head, $title, 0, 0, $arrayofjs, $arrayofcss);
94
95
96
97print '<body>'."\n";
98print '<div>';
99//print '<br>';
100
101// Instantiate hooks of thirdparty module
102$hookmanager->initHooks(array('quickaddform'));
103
104// Show all forms
105print "\n";
106print "<!-- Begin SearchForm -->\n";
107print '<div class="center"><div class="center" style="padding: 30px;">';
108print '<style>.menu_titre { padding-top: 7px; }</style>';
109print '<div id="blockvmenusearch" class="tagtable center searchpage">'."\n";
110
111print printDropdownQuickadd(1);
112
113print '</div>'."\n";
114print '</div></div>';
115print "\n<!-- End SearchForm -->\n";
116
117
118print '</div>';
119print '</body></html>'."\n";
120
121$db->close();
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
dol_now($mode='auto')
Return date for now.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs=array(), $arrayofcss=array(), $disableforlogin=0, $disablenofollow=0, $disablenoindex=0)
Output html header of a page.
printDropdownQuickadd($mode=0)
Generate list of quickadd items.