1 | <?php |
---|
2 | // +-------------------------------------------------+ |
---|
3 | // © 2002-2004 PMB Services / www.sigb.net pmb@sigb.net et contributeurs (voir www.sigb.net) |
---|
4 | // +-------------------------------------------------+ |
---|
5 | // $Id: collections.inc.php,v 1.9 2010-12-06 15:51:18 ngantier Exp $ |
---|
6 | |
---|
7 | if (stristr($_SERVER['REQUEST_URI'], ".inc.php")) die("no access"); |
---|
8 | |
---|
9 | // fonctions communes aux pages de gestion des autorités |
---|
10 | require('./autorites/auth_common.inc.php'); |
---|
11 | |
---|
12 | // templates pour les fonctions de gestion des collections |
---|
13 | include("$include_path/templates/collections.tpl.php"); |
---|
14 | |
---|
15 | // classe gestion des collections et des éditeurs |
---|
16 | include("$class_path/collection.class.php"); |
---|
17 | include("$class_path/editor.class.php"); |
---|
18 | |
---|
19 | // gestion des collections |
---|
20 | print "<h1>".$msg[140]." : ". $msg[136]."</h1>"; |
---|
21 | $tri_param = " order by index_coll "; |
---|
22 | switch($sub) { |
---|
23 | case 'reach': |
---|
24 | // afficher résultat recherche collection |
---|
25 | include('./autorites/collections/collections_list.inc.php'); |
---|
26 | break; |
---|
27 | case 'replace': |
---|
28 | if(!$by) { |
---|
29 | $collection = new collection($id); |
---|
30 | $collection->replace_form(); |
---|
31 | } else { |
---|
32 | // routine de remplacement |
---|
33 | $collection = new collection($id); |
---|
34 | $rep_result = $collection->replace($by,$aut_link_save); |
---|
35 | if(!$rep_result) |
---|
36 | include('./autorites/collections/collections_list.inc.php'); |
---|
37 | else { |
---|
38 | error_message($msg[132], $rep_result, 1, "./autorites.php?categ=collections&sub=collection_form&id=$id"); |
---|
39 | } |
---|
40 | } |
---|
41 | break; |
---|
42 | case 'delete': |
---|
43 | $coll = new collection($id); |
---|
44 | $sup_result = $coll->delete(); |
---|
45 | if(!$sup_result) |
---|
46 | include('./autorites/collections/collections_list.inc.php'); |
---|
47 | else { |
---|
48 | error_message($msg[132], $sup_result, 1, "./autorites.php?categ=collections&sub=collection_form&id=$id"); |
---|
49 | } |
---|
50 | break; |
---|
51 | case 'update': |
---|
52 | // mettre à jour collection id |
---|
53 | // mise à jour d'une collection |
---|
54 | $collection_nom = clean_string($collection_nom); |
---|
55 | if ((!$collection_nom) || (!$ed_id)) |
---|
56 | error_message($msg[132], $mg['erreur_creation_collection'], 1, ""); |
---|
57 | else { |
---|
58 | $coll = array( |
---|
59 | 'name' => $collection_nom, |
---|
60 | 'parent' => $ed_id, |
---|
61 | 'collection_web' => $collection_web, |
---|
62 | 'issn' => $issn, |
---|
63 | 'comment' => $comment); |
---|
64 | |
---|
65 | $collection = new collection($id); |
---|
66 | $collection->update($coll); |
---|
67 | include('./autorites/collections/collections_list.inc.php'); |
---|
68 | } |
---|
69 | break; |
---|
70 | case 'collection_form': |
---|
71 | // création d'une collection |
---|
72 | if(!$id) { |
---|
73 | // affichage du form pour création |
---|
74 | $collection = new collection(); |
---|
75 | $collection->show_form(); |
---|
76 | } else { |
---|
77 | // affichage du form pour modification |
---|
78 | $collection = new collection($id); |
---|
79 | $collection->show_form(); |
---|
80 | } |
---|
81 | break; |
---|
82 | case 'collection_last': |
---|
83 | $last_param=1; |
---|
84 | $tri_param = "order by collection_id desc "; |
---|
85 | $limit_param = "limit 0, $pmb_nb_lastautorities "; |
---|
86 | $clef = ""; |
---|
87 | $nbr_lignes = 0 ; |
---|
88 | include('./autorites/collections/collections_list.inc.php'); |
---|
89 | break; |
---|
90 | default: |
---|
91 | // affichage du form de recherche (par défaut) |
---|
92 | include('./autorites/collections/collections_list.inc.php'); |
---|
93 | break; |
---|
94 | } |
---|
95 | ?> |
---|