Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

ezcontact/admin/datasupplier.php
Go to the documentation of this file.
1 <?php
3 //
4 // $Id: datasupplier.php 9529 2002-05-14 11:17:05Z jhe $
5 //
6 // Created on: <23-Oct-2000 17:53:46 bf>
7 //
8 // This source file is part of Exponential Basic, publishing software.
9 //
10 // Copyright (C) 1999-2001 eZ Systems. All rights reserved.
11 //
12 // This program is free software; you can redistribute it and/or
13 // modify it under the terms of the GNU General Public License
14 // as published by the Free Software Foundation; either version 2
15 // of the License, or (at your option) any later version.
16 //
17 // This program is distributed in the hope that it will be useful,
18 // but WITHOUT ANY WARRANTY; without even the implied warranty of
19 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 // GNU General Public License for more details.
21 //
22 // You should have received a copy of the GNU General Public License
23 // along with this program; if not, write to the Free Software
24 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, US
25 //
26
27 // include_once( "classes/ezuritool.php" );
28 // include_once( "classes/ezhttptool.php" );
29 // include_once( "ezuser/classes/ezpermission.php" );
30
31 $user =& eZUser::currentUser();
32 if ( !eZPermission::checkPermission( $user, "eZContact", "ModuleEdit" ) )
33 {
34 eZHTTPTool::header( "Location: /error/403" );
35 exit();
36 }
37
38 $url_array = eZURITool::split( $REQUEST_URI );
39 $url_array_count = count( $url_array );
40
41 for( $i = $url_array_count; $i <= 25; $i++ )
42 {
43 $url_array[$i] = false;
44 }
45
46 $ListType = $url_array[2];
47 switch ( $ListType )
48 {
49 case "nopermission":
50 {
51 $Type = $url_array[3];
52 switch ( $Type )
53 {
54 case "company":
55 {
56 $Action = $url_array[4];
57 include( "kernel/ezcontact/admin/nopermission.php" );
58 }
59 break;
60
61 case "category":
62 {
63 $Action = $url_array[4];
64 include( "kernel/ezcontact/admin/nopermission.php" );
65 }
66 break;
67
68 case "person":
69 {
70 $Action = $url_array[4];
71 include( "kernel/ezcontact/admin/nopermission.php" );
72 }
73 break;
74
75 case "login":
76 case "consultation":
77 {
78 include( "kernel/ezcontact/admin/nopermission.php" );
79 }
80 break;
81
82 case "type":
83 {
84 $Action = $url_array[4];
85 include( "kernel/ezcontact/admin/nopermission.php" );
86 }
87 break;
88
89 default:
90 {
91 // include_once( "classes/ezhttptool.php" );
92 eZHTTPTool::header( "Location: /contact/error?Type=404&Uri=$REQUEST_URI&Query=$QUERY_STRING&BackUrl=$HTTP_REFERER" );
93 }
94 break;
95 }
96 }
97 break;
98
99 case "setup":
100 {
101 include( "kernel/ezcontact/admin/setup.php" );
102 }
103 break;
104
105 case "search":
106 {
107 $SearchType = $url_array[3];
108 switch ( $SearchType )
109 {
110 case "company":
111 {
112 include( "kernel/ezcontact/user/companysearch.php" );
113 break;
114 }
115 case "person":
116 {
117 include( "kernel/ezcontact/user/personsearch.php" );
118 break;
119 }
120 }
121 break;
122 }
123
124 case "company":
125 {
126 $CompanyID = $url_array[4];
127 $Action = $url_array[3];
128 switch ( $Action )
129 {
130 case "new":
131 case "edit":
132 case "update":
133 case "delete":
134 case "insert":
135 {
136 $CompanyEdit = true;
137 if ( isset( $SendMail ) )
138 {
139 include( "kernel/ezcontact/admin/sendmail.php" );
140 }
141 else if ( isset( $MailButton ) )
142 {
143 $ContactArrayID = array( $PersonID );
144 include( "kernel/ezcontact/admin/sendmail.php" );
145 }
146 else
147 {
148 if ( isset( $NewCompany ) )
149 $Action = "new";
150 if ( $Action == "new" )
151 if ( isset( $url_array[4] ) and is_numeric( $url_array[4] ) )
152 $NewCompanyCategory = $url_array[4];
153 else
154 if ( !isset( $CompanyID ) and isset( $url_array[4] ) and is_numeric( $url_array[4] ) )
155 $CompanyID = $url_array[4];
156 include( "kernel/ezcontact/admin/companyedit.php" );
157 }
158 }
159 break;
160
161 case "view":
162 {
163 if ( !isset( $CompanyID ) and isset( $url_array[4] ) and is_numeric( $url_array[4] ) )
164 $CompanyID = $url_array[4];
165 $PersonOffset = $url_array[5];
166 include( "kernel/ezcontact/admin/companyview.php" );
167 }
168 break;
169
170 case "stats":
171 {
172 $Year = $url_array[6];
173 $Month = $url_array[7];
174 $Day = $url_array[8];
175 $DateType = $url_array[4];
176 if ( !isset( $CompanyID ) and isset( $url_array[5] ) and is_numeric( $url_array[5] ) )
177 $CompanyID = $url_array[5];
178 include( "kernel/ezcontact/admin/companystats.php" );
179 }
180 break;
181
182 case "list":
183 {
184 $TypeID = $url_array[4];
185 $Offset = $url_array[5];
186 $ShowStats = true;
187 include( "kernel/ezcontact/admin/companytypelist.php" );
188 }
189 break;
190
191 case "folder":
192 {
193 $item_id = $url_array[4];
194 $CompanyEdit = true;
195 include( "kernel/ezcontact/admin/folder.php" );
196 }
197 break;
198
199 case "buy":
200 {
201 include( "kernel/ezcontact/admin/buy.php" );
202 }
203 break;
204
205 default:
206 {
207 // include_once( "classes/ezhttptool.php" );
208 eZHTTPTool::header( "Location: /contact/error?Type=404&Uri=$REQUEST_URI&Query=$QUERY_STRING&BackUrl=$HTTP_REFERER" );
209 }
210 break;
211 }
212 }
213 break;
214
215 case "companycategory" :
216 {
217 $TypeID = $url_array[4];
218 $Action = $url_array[3];
219 switch ( $Action )
220 {
221 // intentional fall through
222 case "new":
223 {
224 $NewParentID = $url_array[4];
225 unset( $TypeID );
226 include( "kernel/ezcontact/admin/companytypeedit.php" );
227 }
228 break;
229
230 case "edit":
231 case "update":
232 case "delete":
233 case "insert":
234 {
235 include( "kernel/ezcontact/admin/companytypeedit.php" );
236 }
237 break;
238
239 default:
240 {
241 // include_once( "classes/ezhttptool.php" );
242 eZHTTPTool::header( "Location: /contact/error?Type=404&Uri=$REQUEST_URI&Query=$QUERY_STRING&BackUrl=$HTTP_REFERER" );
243 }
244 break;
245 }
246 }
247 break;
248
249 case "person":
250 {
251 $PersonID = $url_array[4];
252 $Action = $url_array[3];
253 switch ( $Action )
254 {
255 // intentional fall through
256 case "new":
257 case "edit":
258 case "update":
259 case "delete":
260 case "insert":
261 {
262 $CompanyEdit = false;
263 if ( isset( $SendMail ) )
264 {
265 include( "kernel/ezcontact/admin/sendmail.php" );
266 }
267 else if ( isset( $MailButton ) )
268 {
269 $ContactArrayID = array( $PersonID );
270 include( "kernel/ezcontact/admin/sendmail.php" );
271 }
272 else
273 {
274 include( "kernel/ezcontact/admin/personedit.php" );
275 }
276
277 }
278 break;
279
280 case "list":
281 {
282 if ( is_numeric( $url_array[4] ) )
283 $Offset = $url_array[4];
284 include( "kernel/ezcontact/admin/personlist.php" );
285 }
286 break;
287
288 case "search":
289 {
290 if ( is_numeric( $url_array[4] ) )
291 $Offset = $url_array[4];
292 if ( count( $url_array ) >= 5 && !isset( $SearchText ) )
293 {
294 $SearchText = $url_array[5];
295 $SearchText = eZURITool::decode( $SearchText );
296 }
297 include( "kernel/ezcontact/admin/personlist.php" );
298 }
299 break;
300
301 case "view":
302 {
303 include( "kernel/ezcontact/admin/personview.php" );
304 }
305 break;
306
307 case "folder":
308 {
309 $item_id = $url_array[4];
310 include( "kernel/ezcontact/admin/folder.php" );
311 }
312 break;
313
314 case "buy":
315 {
316 include( "kernel/ezcontact/admin/buy.php" );
317 }
318 break;
319
320 default:
321 {
322 // include_once( "classes/ezhttptool.php" );
323 eZHTTPTool::header( "Location: /contact/error?Type=404&Uri=$REQUEST_URI&Query=$QUERY_STRING&BackUrl=$HTTP_REFERER" );
324 }
325 break;
326 }
327 }
328 break;
329
330 case "consultation":
331 {
332 if ( !isset( $ConsultationID ) or !is_numeric( $ConsultationID ) )
333 $ConsultationID = $url_array[4];
334
335 $Action = $url_array[3];
336 switch ( $Action )
337 {
338 // intentional fall through
339 case "new":
340 case "edit":
341 case "update":
342 case "delete":
343 case "insert":
344 {
345 include( "kernel/ezcontact/admin/consultationedit.php" );
346 }
347 break;
348
349 case "view":
350 {
351 include( "kernel/ezcontact/admin/consultationview.php" );
352 }
353 break;
354
355 case "list":
356 {
357 include( "kernel/ezcontact/admin/consultationlist.php" );
358 }
359 break;
360
361 case "company":
362 {
363 $SubAction = $url_array[3];
364 $Action = $url_array[4];
365 if ( !isset( $CompanyID ) or !is_numeric( $CompanyID ) )
366 $CompanyID = $url_array[5];
367 switch ( $Action )
368 {
369 // intentional fall through
370 case "delete":
371 {
372 $ConsultationID = $url_array[5];
373 }
374 case "new":
375 case "edit":
376 case "update":
377 case "insert":
378 {
379 include( "kernel/ezcontact/admin/consultationedit.php" );
380 }
381 break;
382
383 case "list":
384 {
385 $ConsultationList = true;
386 include( "kernel/ezcontact/admin/consultationlist.php" );
387 }
388 break;
389
390 case "view":
391 {
392 include( "kernel/ezcontact/admin/consultationview.php" );
393 }
394 break;
395 }
396 }
397 break;
398
399 case "person":
400 {
401 $SubAction = $url_array[3];
402 $Action = $url_array[4];
403 if ( !isset( $PersonID ) )
404 $PersonID = $url_array[5];
405 switch ( $Action )
406 {
407 // intentional fall through
408 case "delete":
409 {
410 $ConsultationID = $url_array[5];
411 }
412 case "new":
413 case "edit":
414 case "update":
415 case "insert":
416 {
417 include( "kernel/ezcontact/admin/consultationedit.php" );
418 }
419 break;
420
421 case "list":
422 {
423 $ConsultationList = true;
424 include( "kernel/ezcontact/admin/consultationlist.php" );
425 }
426 break;
427
428 case "view":
429 {
430 include( "kernel/ezcontact/admin/consultationview.php" );
431 }
432 break;
433 }
434 break;
435 }
436
437 default:
438 {
439 // include_once( "classes/ezhttptool.php" );
440 eZHTTPTool::header( "Location: /contact/error?Type=404&Uri=$REQUEST_URI&Query=$QUERY_STRING&BackUrl=$HTTP_REFERER" );
441 }
442 break;
443 }
444 }
445 break;
446
447 case "consultationtype":
448 {
449 $ConsultationTypeID = $url_array[4];
450 $Action = $url_array[3];
451 switch ( $Action )
452 {
453 // intentional fall through
454 case "new":
455 case "edit":
456 case "update":
457 case "delete":
458 case "confirm":
459 case "insert":
460 case "up":
461 case "down":
462 {
463 include( "kernel/ezcontact/admin/consultationtypeedit.php" );
464 }
465 break;
466
467 case "list":
468 {
469 if ( is_numeric( $url_array[4] ) )
470 $Offset = $url_array[4];
471 else
472 $Offset = false;
473 include( "kernel/ezcontact/admin/consultationtypelist.php" );
474 }
475 break;
476
477 case "search":
478 {
479 if ( is_numeric( $url_array[4] ) )
480 $Offset = $url_array[4];
481 if ( count( $url_array ) >= 5 && !isset( $SearchText ) )
482 {
483 $SearchText = $url_array[5];
484 $SearchText = eZURITool::decode( $SearchText );
485 }
486 include( "kernel/ezcontact/admin/consultationtypelist.php" );
487 }
488 break;
489
490 default:
491 {
492 // include_once( "classes/ezhttptool.php" );
493 eZHTTPTool::header( "Location: /contact/error?Type=404&Uri=$REQUEST_URI&Query=$QUERY_STRING&BackUrl=$HTTP_REFERER" );
494 }
495 break;
496 }
497 }
498 break;
499
500 case "projecttype":
501 {
502 $ProjectTypeID = $url_array[4];
503 $Action = $url_array[3];
504 switch ( $Action )
505 {
506 // intentional fall through
507 case "new":
508 case "edit":
509 case "update":
510 case "delete":
511 case "confirm":
512 case "insert":
513 case "up":
514 case "down":
515 {
516 include( "kernel/ezcontact/admin/projecttypeedit.php" );
517 }
518 break;
519
520 case "list":
521 {
522 if ( is_numeric( $url_array[4] ) )
523 $Offset = $url_array[4];
524 else
525 $Offset = false;
526
527 include( "kernel/ezcontact/admin/projecttypelist.php" );
528 }
529 break;
530
531 case "search":
532 {
533 if ( is_numeric( $url_array[4] ) )
534 $Offset = $url_array[4];
535 if ( count( $url_array ) >= 5 && !isset( $SearchText ) )
536 {
537 $SearchText = $url_array[5];
538 $SearchText = eZURITool::decode( $SearchText );
539 }
540 include( "kernel/ezcontact/admin/projecttypelist.php" );
541 }
542 break;
543
544 default:
545 {
546 // include_once( "classes/ezhttptool.php" );
547 eZHTTPTool::header( "Location: /contact/error?Type=404&Uri=$REQUEST_URI&Query=$QUERY_STRING&BackUrl=$HTTP_REFERER" );
548 }
549 break;
550 }
551 }
552 break;
553
554 case "error":
555 {
556 include( "kernel/ezcontact/admin/error.php" );
557 }
558 break;
559
560 default :
561 {
562 // include_once( "classes/ezhttptool.php" );
563 eZHTTPTool::header( "Location: /contact/error?Type=404&Uri=$REQUEST_URI&Query=$QUERY_STRING&BackUrl=$HTTP_REFERER" );
564 }
565 break;
566 }
567
568 ?>
$i
$i
Definition: admin/adlist.php:91
eZHTTPTool\header
static header( $string)
Definition: ezhttptool.php:96
eZPermission\checkPermission
static checkPermission( $user, $moduleName, $permissionName)
Definition: ezpermission.php:430
eZURITool\decode
static & decode(&$text)
Definition: ezuritool.php:81
eZURITool\split
static & split(&$uri)
Definition: ezuritool.php:58
eZUser\currentUser
static & currentUser()
Definition: ezuser.php:896
$CompanyEdit
$CompanyEdit
Definition: companyedit.php:32
$Action
$Action
Definition: companysearch.php:80
$SearchText
$SearchText
Definition: ezaddress/admin/typelist.php:143
$Offset
$Offset
Definition: ezarticle/user/search.php:110
$Month
$Month
Definition: ezcalendar/user/dayview.php:78
$Day
$Day
Definition: ezcalendar/user/dayview.php:79
$user
$user
Definition: ezcontact/admin/datasupplier.php:31
$url_array
if(!eZPermission::checkPermission( $user, "eZContact", "ModuleEdit")) $url_array
Definition: ezcontact/admin/datasupplier.php:38
$url_array_count
$url_array_count
Definition: ezcontact/admin/datasupplier.php:39
$ListType
for( $i=$url_array_count; $i<=25; $i++) $ListType
Definition: ezcontact/admin/datasupplier.php:46
exit
exit
Definition: folder.php:81
$item_id
$item_id
Definition: personedit.php:76
$REQUEST_URI
$REQUEST_URI
Definition: storestats.php:32
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.