Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

eztrade/admin/datasupplier.php
Go to the documentation of this file.
1 <?php
3 //
4 // $Id: datasupplier.php 9275 2002-02-26 14:28:02Z ce $
5 //
6 // Created on: <21-Sep-2000 10:32:36 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/ezhttptool.php" );
28 // include_once( "ezuser/classes/ezpermission.php" );
29 // include_once( "eztrade/classes/ezproducttool.php" );
30
31 // include_once( "ezuser/classes/ezobjectpermission.php" );
32
33
34 $user =& eZUser::currentUser();
35 if( eZPermission::checkPermission( $user, "eZTrade", "ModuleEdit" ) == false )
36 {
37 eZHTTPTool::header( "Location: /error/403" );
38 exit();
39 }
40
41 $url_array = explode( "/", $REQUEST_URI );
42
43 switch ( $url_array[2] )
44 {
45 case "funkyhomo" :
46 {
47
48 if ( isset( $AddType ) )
49 $Action = "AddType";
50
51 if ( isset( $AddGroup ) )
52 $Action = "AddGroup";
53
54 if ( isset( $Store ) )
55 $Action = "Store";
56
57 if ( isset( $Delete ) )
58 $Action = "DeleteSelected";
59
60
61 include( "kernel/eztrade/admin/shippingtypes.php" );
62 }
63 break;
64 /*
65 case "export" :
66 {
67 // automated ftp or manual ?
68 if ( $url_array[3] == 'froogle' )
69 {
70 if ( $url_array[4] == 'download' )
71 {
72 $Action = "export";
73 }
74 else {
75 // $Action = "export-cron";
76 $Action = "display";
77 }
78
79 include( "kernel/eztrade/admin/export_froogle.php" );
80 }
81 elseif ( $url_array[3] == 'yahoo' )
82 {
83 if ( $url_array[4] == 'download' )
84 {
85 $Action = "export";
86 }
87 else {
88 // $Action = "export-cron";
89 $Action = "display";
90 }
91
92 include( "kernel/eztrade/admin/export_yahoo.php" );
93 }
94 elseif ( $url_array[3] == 'download' )
95 {
96 $Action = "export";
97 include( "kernel/eztrade/admin/export_froogle.php" );
98 }
99 else {
100 // $Action = "export-cron";
101 $Action = "display";
102 include( "kernel/eztrade/admin/export_froogle.php" );
103 }
104
105 // include( "kernel/eztrade/admin/froogle.php" );
106 }
107 break;
108 */
109
110 case "export" :
111 {
112 if ( $url_array[3] == 'froogle' )
113 {
114 if ( $url_array[4] == 'download' )
115 {
116 $Action = "export";
117 }
118 else
119 {
120 $Action = "export-cron";
121 }
122 include( "kernel/eztrade/admin/export_froogle.php" );
123 }
124 elseif ( $url_array[3] == 'yahoo' )
125 {
126 if ( $url_array[4] == 'download' )
127 {
128 $Action = "export";
129 }
130 else
131 {
132 $Action = "export-cron";
133 }
134 include( "kernel/eztrade/admin/export_yahoo.php" );
135 }
136 else {
137 $Action = "export-cron";
138 include( "kernel/eztrade/admin/export_froogle.php" );
139 }
140 }
141 break;
142
143 case "orderlist" :
144 {
145 if ( $url_array[3] != "" )
146 $Offset = $url_array[3];
147 else
148 $Offset = 0;
149
150 if( isset( $_REQUEST['SortBy'] ) )
151 $OrderBy = $_REQUEST['SortBy'];
152 else
153 $OrderBy = "Date";
154
155 include( "kernel/eztrade/admin/orderlist.php" );
156 }
157 break;
158
159 case "orderedit" :
160 $OrderID = $url_array[3];
161 isset( $url_array[4] ) ? $Action = $url_array[4] : $Action = "Edit";
162 include( "kernel/eztrade/admin/orderedit.php" );
163 break;
164
165 case "orderview" :
166 {
167 $OrderID = $url_array[3];
168 include( "kernel/eztrade/admin/orderview.php" );
169 }
170 break;
171
172 case "customerlist" :
173 {
174 if ( $url_array[3] != "" )
175 $Offset = $url_array[3];
176 else
177 $Offset = 0;
178
179 include( "kernel/eztrade/admin/customerlist.php" );
180 }
181 break;
182
183 case "customerview" :
184 {
185 $CustomerID = $url_array[3];
186
187 include( "kernel/eztrade/admin/customerview.php" );
188 }
189 break;
190
191
192 case "categorylist" :
193 {
194 if( isset( $DetailView ) && $DetailView ){
195 if ( ( $url_array[3] == "parent") && ( $url_array[4] != "" ) )
196 {
197 $ParentID = $url_array[4];
198
199 if( isset( $url_array[5] ) )
200 $Offset = $url_array[5];
201
202 include( "kernel/eztrade/admin/categorylist.php" );
203 }
204 else
205 {
206 include( "kernel/eztrade/admin/detailcategorylist.php" );
207 }
208 }else{
209 // else assume ( $NormalView )
210
211 if ( ( $url_array[3] == "parent") && ( $url_array[4] != "" ) )
212 {
213 $ParentID = $url_array[4];
214 if( isset( $url_array[5] ) )
215 $Offset = $url_array[5];
216 else
217 $Offset = 0;
218 include( "kernel/eztrade/admin/simplecategorylist.php" );
219 }
220 else
221 {
222 include( "kernel/eztrade/admin/simplecategorylist.php" );
223 }
224 // include( "kernel/eztrade/admin/categorylist.php" );
225
226 }
227 }
228 break;
229
230 case "typelist" :
231 {
232 include( "kernel/eztrade/admin/typelist.php" );
233 }
234 break;
235
236 case "voucherlist" :
237 {
238 include( "kernel/eztrade/admin/voucherlist.php" );
239 }
240 break;
241
242 case "typeedit" :
243 {
244 if ( $url_array[3] == "edit" )
245 {
246 $TypeID = $url_array[4];
247 $Action = "Edit";
248 }
249 if ( $url_array[3] == "delete" )
250 {
251 $TypeID = $url_array[4];
252 $Action = "Delete";
253 }
254 if ( $url_array[3] == "up" )
255 {
256 $TypeID = $url_array[4];
257 $AttributeID = $url_array[5];
258 $Action = "up";
259 }
260 if ( $url_array[3] == "down" )
261 {
262 $TypeID = $url_array[4];
263 $AttributeID = $url_array[5];
264 $Action = "down";
265 }
266
267 if ( !isset( $Action ) )
268 {
269 $Action = "New";
270 }
271 include( "kernel/eztrade/admin/typeedit.php" );
272 }
273 break;
274
275 case "voucheredit" :
276 {
277 if ( $url_array[3] == "edit" )
278 {
279 $VoucherID = $url_array[4];
280 $Action = "Edit";
281 }
282 if ( $url_array[3] == "delete" )
283 {
284 $VoucherID = $url_array[4];
285 $Action = "Delete";
286 }
287 include( "kernel/eztrade/admin/voucheredit.php" );
288 }
289 break;
290
291 case "categoryedit" :
292 if ( ( $url_array[3] == "insert") )
293 {
294 $Action = "Insert";
295 include( "kernel/eztrade/admin/categoryedit.php" );
296 }
297 else if ( ( $url_array[3] == "edit") )
298 {
299 $Action = "Edit";
300 $CategoryID = $url_array[4];
301 include( "kernel/eztrade/admin/categoryedit.php" );
302 }
303 else if ( ( $url_array[3] == "update") )
304 {
305 $Action = "Update";
306 include( "kernel/eztrade/admin/categoryedit.php" );
307 }
308 else if ( ( $url_array[3] == "delete") )
309 {
310 $Action = "Delete";
311 $CategoryID = $url_array[4];
312 include( "kernel/eztrade/admin/categoryedit.php" );
313 }
314 else
315 {
316 $Action = "New";
317 include( "kernel/eztrade/admin/categoryedit.php" );
318 }
319 break;
320
321 case "voucher" :
322 $UseVoucher = true;
323 case "productedit" :
324 {
325 switch ( $url_array[3] )
326 {
327
328 // filelist
329 case "filelist" :
330 {
331 $ProductID = $url_array[4];
332 include( "kernel/eztrade/admin/filelist.php" );
333 break;
334 }
335
336 // preview
337 case "productpreview" :
338 $ProductID = $url_array[4];
339 include( "kernel/eztrade/admin/productpreview.php" );
340 break;
341
342 //files
343 case "fileedit" :
344 {
345 if ( isSet( $Browse ) )
346 {
347 include( "kernel/ezfilemanager/admin/browse.php" );
348 break;
349 }
350 switch ( $url_array[4] )
351 {
352 case "new" :
353 {
354 $Action = "New";
355 $ProductID = $url_array[5];
356 include( "kernel/eztrade/admin/fileedit.php" );
357 }
358 break;
359
360 case "edit" :
361 {
362 $Action = "Edit";
363 $ProductID = $url_array[6];
364 $FileID = $url_array[5];
365 include( "kernel/eztrade/admin/fileedit.php" );
366 }
367 break;
368
369 case "delete" :
370 {
371 $Action = "Delete";
372 $ProductID = $url_array[6];
373 $FileID = $url_array[5];
374 include( "kernel/eztrade/admin/fileedit.php" );
375 }
376 break;
377
378 default :
379 {
380 include( "kernel/eztrade/admin/fileedit.php" );
381 }
382 }
383 }
384 break;
385
386
387 // Images
388 case "imagelist" :
389 $ProductID = $url_array[4];
390 include( "kernel/eztrade/admin/imagelist.php" );
391 break;
392
393 case "imageedit" :
394 if ( isset ( $Browse ) )
395 {
396 include ( "kernel/ezimagecatalogue/admin/browse.php" );
397 break;
398 }
399 if ( $url_array[4] == "edit" )
400 {
401 $Action = "Edit";
402 $ImageID = $url_array[5];
403 $ProductID = $url_array[6];
404 include( "kernel/eztrade/admin/imageedit.php" );
405 }
406 else if ( $url_array[4] == "delete" )
407 {
408 $Action = "Delete";
409 $ImageID = $url_array[5];
410 $ProductID = $url_array[6];
411 include( "kernel/eztrade/admin/imageedit.php" );
412 }
413 else if ( $url_array[4] == "new" )
414 {
415 $ProductID = $url_array[5];
416 include( "kernel/eztrade/admin/imageedit.php" );
417 }
418 else if ( $url_array[4] == "storedef" )
419 {
420 $Action = "StoreDef";
421 if ( isset( $DeleteSelected ) )
422 $Action = "Delete";
423 if ( isset( $UpdateImages ) )
424 $Action = "UpdateImages";
425 $ProductID = $url_array[5];
426 include( "kernel/eztrade/admin/imageedit.php" );
427 }
428 else
429 {
430 include( "kernel/eztrade/admin/imageedit.php" );
431 }
432
433 break;
434
435 // Options
436 case "optionlist" :
437 $ProductID = $url_array[4];
438 include( "kernel/eztrade/admin/optionlist.php" );
439 break;
440
441 case "attributeedit" :
442 {
443 $ProductID = $url_array[4];
444 include( "kernel/eztrade/admin/attributeedit.php" );
445 }
446 break;
447
448 case "formlist":
449 {
450 $ProductID = $url_array[4];
451 include( "kernel/eztrade/admin/formlist.php" );
452 }
453 break;
454
455
456 case "link" :
457 {
458 $ItemID = $url_array[5];
459 // include_once( "kernel/eztrade/classes/ezproduct.php" );
460 // include_once( "kernel/eztrade/classes/ezproducttool.php" );
461
462 $INIGroup = "eZTradeMain";
463 $DefaultSectionsName = "ProductLinkSections";
464 $PreferencesSetting = "ProductLinkType";
465 $ClientModuleName = "eZTrade";
466 $ClientModuleType = "Product";
467 $root = "/trade/productedit";
468 $URLS = array( "back" => "$root/edit/%s",
469 "linklist" => "$root/link/list/%s",
470 "linkmoveup" => "$root/link/moveup/link/%d/%d/%d",
471 "linkmovedown" => "$root/link/movedown/link/%d/%d/%d",
472 "sectionmoveup" => "$root/link/moveup/section/%d/%d",
473 "sectionmovedown" => "$root/link/movedown/section/%d/%d",
474 "linkselect" => "$root/link/select/%s/%s/%s/%s/%s/0/%s",
475 "linkselect_basic" => "$root/link/select/",
476 "linkselect_std" => "$root/link/select/%s/%s/%s/%s/%s",
477 "urledit" => "$root/link/select/%s/%s/%s/%s",
478 "linkedit" => "$root/link/select/%s/%s/%s/0/0/%s" );
479 $Funcs = array( "delete" => "deleteCacheHelper" );
480
481 function deleteCacheHelper( $ProductID )
482 {
483 eZProductTool::deleteCache( $ProductID );
484 }
485
486 switch( $url_array[4] )
487 {
488 case "list":
489 {
490 include( "classes/admin/linklist.php" );
491 break;
492 }
493 case "select":
494 {
495 if ( isset( $url_array[6] ) )
496 $ModuleName = $url_array[6];
497 if ( isset( $url_array[7] ) )
498 $Type = $url_array[7];
499 if ( isset( $url_array[8] ) )
500 $SectionID = $url_array[8];
501 if ( isset( $url_array[9] ) )
502 $Category = $url_array[9];
503 if ( isset( $url_array[10] ) )
504 $Offset = $url_array[10];
505 if ( isset( $url_array[11] ) )
506 $LinkID = $url_array[11];
507
508 include( "classes/admin/linkselect.php" );
509 break;
510 }
511 case "moveup":
512 $MoveUp = true;
513 case "movedown":
514 {
515 if ( isset( $url_array[5] ) )
516 $ObjectType = $url_array[5];
517 if ( isset( $url_array[6] ) )
518 $ItemID = $url_array[6];
519 if ( isset( $url_array[7] ) )
520 $ObjectID = $url_array[7];
521 if ( isset( $url_array[8] ) )
522 $LinkID = $url_array[8];
523 include( "classes/admin/linkmove.php" );
524 break;
525 }
526 default:
527 {
528 eZHTTPTool::header( "Location: /error/404" );
529 break;
530 }
531 }
532 break;
533 }
534
535 case "optionedit" :
536 if ( $url_array[4] == "edit" )
537 {
538 $Action = "Edit";
539 $OptionID = $url_array[5];
540 $ProductID = $url_array[6];
541 include( "kernel/eztrade/admin/optionedit.php" );
542 }
543 else if ( $url_array[4] == "delete" )
544 {
545 $Action = "Delete";
546 $OptionID = $url_array[5];
547 $ProductID = $url_array[6];
548 include( "kernel/eztrade/admin/optionedit.php" );
549 }
550 else if ( $url_array[4] == "new" )
551 {
552 $Action = "New";
553 $ProductID = $url_array[5];
554 include( "kernel/eztrade/admin/optionedit.php" );
555 }
556 else
557 {
558 include( "kernel/eztrade/admin/optionedit.php" );
559 }
560
561 break;
562
563 case "insert" :
564 $Action = "Insert";
565 include( "kernel/eztrade/admin/productedit.php" );
566 break;
567 case "edit" :
568 {
569 $Action = "Edit";
570 $ProductID = $url_array[4];
571 if( eZObjectPermission::hasPermission( $ProductID, "trade_product", 'w' ) )
572 {
573 include( "kernel/eztrade/admin/productedit.php" );
574 }
575 else
576 {
577 eZHTTPTool::header( "Location: /error/403" );
578 exit();
579 }
580 }
581 break;
582 case "update" :
583 $Action = "Update";
584 include( "kernel/eztrade/admin/productedit.php" );
585 break;
586
587 case "cancel" :
588 {
589 $Action = "Cancel";
590 include( "kernel/eztrade/admin/productedit.php" );
591 }
592 break;
593
594 case "delete" :
595 $Action = "Delete";
596 $ProductID = $url_array[4];
597 if( eZObjectPermission::hasPermission( $ProductID, "trade_product", 'w' ) )
598 {
599 include( "kernel/eztrade/admin/productedit.php" );
600 }
601 else
602 {
603 eZHTTPTool::header( "Location: /error/403" );
604 exit();
605 }
606 break;
607
608 case "voucheredit":
609 include( "kernel/eztrade/admin/voucheredit.php" );
610 break;
611 default:
612 include( "kernel/eztrade/admin/productedit.php" );
613 break;
614 }
615 }
616 break;
617
618 case "vattypes" :
619 {
620 if ( isset( $Add ) )
621 $Action = "Add";
622
623 if ( isset( $Store ) )
624 $Action = "Store";
625
626 if ( isset( $Delete ) )
627 $Action = "Delete";
628
629 include( "kernel/eztrade/admin/vattypes.php" );
630 }
631 break;
632
633 case "boxtypes" :
634 {
635 if ( isset( $Add ) )
636 $Action = "Add";
637
638 if ( isset( $Store ) )
639 $Action = "Store";
640
641 if ( isset( $Delete ) )
642 $Action = "Delete";
643
644 include( "kernel/eztrade/admin/boxtypes.php" );
645 }
646 break;
647
648 case "shippingtypes" :
649 {
650 if ( isset( $AddType ) )
651 $Action = "AddType";
652
653 if ( isset( $AddGroup ) )
654 $Action = "AddGroup";
655
656 if ( isset( $Store ) )
657 $Action = "Store";
658
659 if ( isset( $Delete ) )
660 $Action = "DeleteSelected";
661
662
663 include( "kernel/eztrade/admin/shippingtypes.php" );
664 break;
665 }
666
667 case "pricegroups":
668 {
669 $Action = $url_array[3];
670 switch( $Action )
671 {
672 case "list":
673 {
674 include( "kernel/eztrade/admin/pricegroups.php" );
675 break;
676 }
677 case "new":
678 case "edit":
679 {
680 if ( !isset( $PriceID ) )
681 $PriceID = $url_array[4];
682 include( "kernel/eztrade/admin/pricegroupedit.php" );
683 break;
684 }
685 }
686 break;
687 }
688
689 case "search":
690 {
691 $Offset = $url_array[3];
692 if ( isset( $Query ) )
693 $Search = $Query;
694 else
695 $Search = $url_array[4];
696 include( "kernel/eztrade/admin/productsearch.php" );
697 break;
698 }
699
700 case "currency" :
701 {
702 if ( isset( $AddCurrency ) )
703 $Action = "AddCurrency";
704
705 if ( isset( $Store ) )
706 $Action = "Store";
707
708 if ( isset( $Delete ) )
709 $Action = "DeleteSelected";
710
711
712 include( "kernel/eztrade/admin/currency.php" );
713 break;
714 }
715
716 default :
717 {
718 eZHTTPTool::header( "Location: /error/404" );
719 exit();
720 }
721 break;
722 }
723
724 ?>
$CategoryID
$CategoryID
Definition: admin/articleedit.php:53
eZHTTPTool\header
static header( $string)
Definition: ezhttptool.php:96
eZObjectPermission\hasPermission
static hasPermission( $objectID, $moduleTable, $permission, $user=false)
Definition: ezobjectpermission.php:76
eZPermission\checkPermission
static checkPermission( $user, $moduleName, $permissionName)
Definition: ezpermission.php:430
eZProductTool\deleteCache
deleteCache( $product)
Definition: ezproducttool.php:44
eZUser\currentUser
static & currentUser()
Definition: ezuser.php:896
$Action
$Action
Definition: companysearch.php:80
$ImageID
$ImageID
Definition: companytypelist.php:201
$Offset
$Offset
Definition: ezarticle/user/search.php:110
$ModuleName
$ModuleName
Definition: ezarticle/user/searchsupplier.php:30
$SectionID
$SectionID
Definition: ezfilemanager/user/filelist.php:46
$ParentID
$ParentID
Definition: eztrade/admin/categorylist.php:171
$user
$user
Definition: eztrade/admin/datasupplier.php:34
$url_array
if(eZPermission::checkPermission( $user, "eZTrade", "ModuleEdit")==false) $url_array
Definition: eztrade/admin/datasupplier.php:41
exit
exit
Definition: folder.php:81
$OrderBy
$OrderBy
Definition: reciverpopup.php:21
$REQUEST_URI
$REQUEST_URI
Definition: storestats.php:32
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.