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