dolibarr 21.0.0-beta
search.php
Go to the documentation of this file.
1<?php
2/* Copyright (C) 2015 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
27if (!defined('NOREQUIREUSER')) {
28 define('NOREQUIREUSER', '1');
29}
30if (!defined('NOREQUIREDB')) {
31 define('NOREQUIREDB', '1');
32}
33if (!defined('NOREQUIRESOC')) {
34 define('NOREQUIRESOC', '1');
35}
36if (!defined('NOREQUIRETRAN')) {
37 define('NOREQUIRETRAN', '1');
38}
39if (!defined('NOCSRFCHECK')) {
40 define('NOCSRFCHECK', 1);
41}
42if (!defined('NOTOKENRENEWAL')) {
43 define('NOTOKENRENEWAL', 1);
44}
45if (!defined('NOLOGIN')) {
46 define('NOLOGIN', 1);
47}
48if (!defined('NOREQUIREMENU')) {
49 define('NOREQUIREMENU', 1);
50}
51
52require_once '../main.inc.php';
62/*
63 * Actions
64 */
65
66if (GETPOST('search_proposal') != '') {
67 header("Location: ".DOL_URL_ROOT.'/comm/propal/list.php?sall='.urlencode(GETPOST('search_proposal')));
68 exit;
69}
70if (GETPOST('search_customer_order') != '') {
71 header("Location: ".DOL_URL_ROOT.'/commande/list.php?sall='.urlencode(GETPOST('search_customer_order')));
72 exit;
73}
74if (GETPOST('search_supplier_order') != '') {
75 header("Location: ".DOL_URL_ROOT.'/fourn/commande/list.php?search_all='.urlencode(GETPOST('search_supplier_order')));
76 exit;
77}
78if (GETPOST('search_intervention') != '') {
79 header("Location: ".DOL_URL_ROOT.'/fichinter/list.php?sall='.urlencode(GETPOST('search_intervention')));
80 exit;
81}
82if (GETPOST('search_contract') != '') {
83 header("Location: ".DOL_URL_ROOT.'/contrat/list.php?sall='.urlencode(GETPOST('search_contract')));
84 exit;
85}
86if (GETPOST('search_invoice') != '') {
87 header("Location: ".DOL_URL_ROOT.'/compta/facture/list.php?sall='.urlencode(GETPOST('search_invoice')));
88 exit;
89}
90if (GETPOST('search_supplier_invoice') != '') {
91 header("Location: ".DOL_URL_ROOT.'/fourn/facture/list.php?sall='.urlencode(GETPOST('search_supplier_invoice')));
92 exit;
93}
94if (GETPOST('search_supplier_proposal') != '') {
95 header("Location: ".DOL_URL_ROOT.'/supplier_proposal/list.php?sall='.urlencode(GETPOST('search_supplier_proposal')));
96 exit;
97}
98if (GETPOST('search_donation') != '') {
99 header("Location: ".DOL_URL_ROOT.'/don/list.php?sall='.urlencode(GETPOST('search_donation')));
100 exit;
101}
102if (GETPOST('search_product') != '') {
103 header("Location: ".DOL_URL_ROOT.'/product/list.php?sall='.urlencode(GETPOST('search_product')));
104 exit;
105}
106if (GETPOST('search_thirdparty') != '') {
107 header("Location: ".DOL_URL_ROOT.'/societe/list.php?mode=search&sall='.urlencode(GETPOST('search_thirdparty')));
108 exit;
109}
110if (GETPOST('search_contact') != '') {
111 header("Location: ".DOL_URL_ROOT.'/contact/list.php?mode=search&sall='.urlencode(GETPOST('search_contact')));
112 exit;
113}
114if (GETPOST('search_deplacement') != '') {
115 header("Location: ".DOL_URL_ROOT.'/compta/deplacement/list.php?mode=search&sall='.urlencode(GETPOST('search_deplacement')));
116 exit;
117}
118if (GETPOST('search_expensereport') != '') {
119 header("Location: ".DOL_URL_ROOT.'/expensereport/list.php?mode=search&sall='.urlencode(GETPOST('search_expensereport')));
120 exit;
121}
122if (GETPOST('search_holiday') != '') {
123 header("Location: ".DOL_URL_ROOT.'/holiday/list.php?mode=search&sall='.urlencode(GETPOST('search_holiday')));
124 exit;
125}
126if (GETPOST('search_member') != '') {
127 header("Location: ".DOL_URL_ROOT.'/adherents/list.php?mode=search&sall='.urlencode(GETPOST('search_member')));
128 exit;
129}
130if (GETPOST('search_project') != '') {
131 header("Location: ".DOL_URL_ROOT.'/projet/list.php?mode=search&search_all='.urlencode(GETPOST('search_project')));
132 exit;
133}
134if (GETPOST('search_task') != '') {
135 header("Location: ".DOL_URL_ROOT.'/projet/tasks/list.php?mode=search&search_all='.urlencode(GETPOST('search_task')));
136 exit;
137}
138
139if (GETPOST('search_user') != '') {
140 header("Location: ".DOL_URL_ROOT.'/user/list.php?search_all='.urlencode(GETPOST('search_user')));
141 exit;
142}
143if (GETPOST('search_group') != '') {
144 header("Location: ".DOL_URL_ROOT.'/user/group/list.php?search_all='.urlencode(GETPOST('search_group')));
145 exit;
146}
147
148
149
150// If we are here, search was called with no supported criteria
151if (!empty($_SERVER['HTTP_REFERER'])) {
152 header("Location: ".$_SERVER['HTTP_REFERER']);
153 exit;
154} else {
155 print 'The wrapper search.php was called without any search criteria';
156}
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.