Last change
on this file since 48815 was
48815,
checked in by n.pavot@…, 10 years ago
|
On peut désormais lier une ou plusieurs organisations à une rubrique, directement à partir de la vue de la rubrique dans l'espace privé.
|
File size:
1.1 KB
|
Line | |
---|
1 | <?php |
---|
2 | /** |
---|
3 | * Plugin Contacts & Organisations |
---|
4 | * Licence GPL (c) 2010-2011 Matthieu Marcillaud, Cyril Marion, Nadine Pavot |
---|
5 | **/ |
---|
6 | |
---|
7 | if (!defined("_ECRIRE_INC_VERSION")) return; |
---|
8 | |
---|
9 | function action_lier_rubrique_dist($arg=null) { |
---|
10 | if (is_null($arg)){ |
---|
11 | $securiser_action = charger_fonction('securiser_action', 'inc'); |
---|
12 | $arg = $securiser_action(); |
---|
13 | } |
---|
14 | $arg = explode('/', $arg); |
---|
15 | |
---|
16 | // cas liaison id_rubrique / id_organisation |
---|
17 | if (intval($arg[0]) and is_numeric($arg[1])) { |
---|
18 | //spip_log("appel à l'action_lier_rubrique_dist avec $arg[0] $arg[1] comme argument"); |
---|
19 | action_lier_rubrique_post($arg[0], $arg[1]); |
---|
20 | } |
---|
21 | |
---|
22 | else { |
---|
23 | spip_log("action_lier_rubrique_dist $arg pas compris"); |
---|
24 | } |
---|
25 | } |
---|
26 | |
---|
27 | function action_lier_rubrique_post($id_rubrique, $id_organisation) { |
---|
28 | |
---|
29 | $id_rubrique = intval($id_rubrique); |
---|
30 | $id_organisation = intval($id_organisation); |
---|
31 | if ($id_rubrique && $id_organisation) { |
---|
32 | sql_replace("spip_organisations_liens", array( |
---|
33 | "id_organisation" => $id_organisation, |
---|
34 | "id_objet" => $id_rubrique, |
---|
35 | "objet" => 'rubrique' |
---|
36 | )); |
---|
37 | |
---|
38 | include_spip('inc/invalideur'); |
---|
39 | suivre_invalideur("id='id_rubrique/$id_rubrique'"); |
---|
40 | } |
---|
41 | } |
---|
42 | |
---|
43 | ?> |
---|
Note: See
TracBrowser
for help on using the repository browser.