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