dolibarr  20.0.0-alpha
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 /*
55  * Actions
56  */
57 
58 if (GETPOST('search_proposal') != '') {
59  header("Location: ".DOL_URL_ROOT.'/comm/propal/list.php?sall='.urlencode(GETPOST('search_proposal')));
60  exit;
61 }
62 if (GETPOST('search_customer_order') != '') {
63  header("Location: ".DOL_URL_ROOT.'/commande/list.php?sall='.urlencode(GETPOST('search_customer_order')));
64  exit;
65 }
66 if (GETPOST('search_supplier_order') != '') {
67  header("Location: ".DOL_URL_ROOT.'/fourn/commande/list.php?search_all='.urlencode(GETPOST('search_supplier_order')));
68  exit;
69 }
70 if (GETPOST('search_intervention') != '') {
71  header("Location: ".DOL_URL_ROOT.'/fichinter/list.php?sall='.urlencode(GETPOST('search_intervention')));
72  exit;
73 }
74 if (GETPOST('search_contract') != '') {
75  header("Location: ".DOL_URL_ROOT.'/contrat/list.php?sall='.urlencode(GETPOST('search_contract')));
76  exit;
77 }
78 if (GETPOST('search_invoice') != '') {
79  header("Location: ".DOL_URL_ROOT.'/compta/facture/list.php?sall='.urlencode(GETPOST('search_invoice')));
80  exit;
81 }
82 if (GETPOST('search_supplier_invoice') != '') {
83  header("Location: ".DOL_URL_ROOT.'/fourn/facture/list.php?sall='.urlencode(GETPOST('search_supplier_invoice')));
84  exit;
85 }
86 if (GETPOST('search_supplier_proposal') != '') {
87  header("Location: ".DOL_URL_ROOT.'/supplier_proposal/list.php?sall='.urlencode(GETPOST('search_supplier_proposal')));
88  exit;
89 }
90 if (GETPOST('search_donation') != '') {
91  header("Location: ".DOL_URL_ROOT.'/don/list.php?sall='.urlencode(GETPOST('search_donation')));
92  exit;
93 }
94 if (GETPOST('search_product') != '') {
95  header("Location: ".DOL_URL_ROOT.'/product/list.php?sall='.urlencode(GETPOST('search_product')));
96  exit;
97 }
98 if (GETPOST('search_thirdparty') != '') {
99  header("Location: ".DOL_URL_ROOT.'/societe/list.php?mode=search&sall='.urlencode(GETPOST('search_thirdparty')));
100  exit;
101 }
102 if (GETPOST('search_contact') != '') {
103  header("Location: ".DOL_URL_ROOT.'/contact/list.php?mode=search&sall='.urlencode(GETPOST('search_contact')));
104  exit;
105 }
106 if (GETPOST('search_deplacement') != '') {
107  header("Location: ".DOL_URL_ROOT.'/compta/deplacement/list.php?mode=search&sall='.urlencode(GETPOST('search_deplacement')));
108  exit;
109 }
110 if (GETPOST('search_expensereport') != '') {
111  header("Location: ".DOL_URL_ROOT.'/expensereport/list.php?mode=search&sall='.urlencode(GETPOST('search_expensereport')));
112  exit;
113 }
114 if (GETPOST('search_holiday') != '') {
115  header("Location: ".DOL_URL_ROOT.'/holiday/list.php?mode=search&sall='.urlencode(GETPOST('search_holiday')));
116  exit;
117 }
118 if (GETPOST('search_member') != '') {
119  header("Location: ".DOL_URL_ROOT.'/adherents/list.php?mode=search&sall='.urlencode(GETPOST('search_member')));
120  exit;
121 }
122 if (GETPOST('search_project') != '') {
123  header("Location: ".DOL_URL_ROOT.'/projet/list.php?mode=search&search_all='.urlencode(GETPOST('search_project')));
124  exit;
125 }
126 if (GETPOST('search_task') != '') {
127  header("Location: ".DOL_URL_ROOT.'/projet/tasks/list.php?mode=search&search_all='.urlencode(GETPOST('search_task')));
128  exit;
129 }
130 
131 if (GETPOST('search_user') != '') {
132  header("Location: ".DOL_URL_ROOT.'/user/list.php?search_all='.urlencode(GETPOST('search_user')));
133  exit;
134 }
135 if (GETPOST('search_group') != '') {
136  header("Location: ".DOL_URL_ROOT.'/user/group/list.php?search_all='.urlencode(GETPOST('search_group')));
137  exit;
138 }
139 
140 
141 
142 // If we are here, search was called with no supported criteria
143 if (!empty($_SERVER['HTTP_REFERER'])) {
144  header("Location: ".$_SERVER['HTTP_REFERER']);
145  exit;
146 } else {
147  print 'The wrapper search.php was called without any search criteria';
148 }
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.