3 * Copyright 2004 (c) GForge LLC
4 * Copyright 2006 (c) Fabien Regnier - Sogeti
5 * Copyright 2011, Franck Villaume - Capgemini
7 * This file is part of FusionForge. FusionForge is free software;
8 * you can redistribute it and/or modify it under the terms of the
9 * GNU General Public License as published by the Free Software
10 * Foundation; either version 2 of the Licence, or (at your option)
13 * FusionForge is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License along
19 * with FusionForge; if not, write to the Free Software Foundation, Inc.,
20 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
23 function link_box($group_id, $name, $selected = 'xzxzxz') {
26 $link = db_query_params('SELECT group_id,group_name,register_time FROM groups
30 AND group_id NOT IN (SELECT sub_project_id FROM plugin_projects_hierarchy WHERE project_id = $2 )
31 AND group_id NOT IN (SELECT project_id FROM plugin_projects_hierarchy WHERE sub_project_id = $2 )
32 AND group_id IN (select group_id from group_plugin,plugins where group_plugin.plugin_id = plugins.plugin_id and plugins.plugin_name = $3);',
33 array('A', $group_id, 'projects_hierarchy'));
35 return html_build_select_box($link, $name, $selected, false);
38 function type_son_box() {
39 return "<select name='link_type' onchange=\"javascript:
41 document.formson.son.disabled=false
44 document.formson.son.disabled=true
46 \n<option value='0' selected=\"selected\" >"._('Link Type')."</option>\n
47 <option value='shar'>"._('Share')."</option>\n
48 <option value='navi' >"._('Navigation')."</option>\n
52 //search all the family,all ancestor
53 function get_family($group_id, $family = '', $cpt = 0){
54 $res = db_query_params('SELECT project_id FROM plugin_projects_hierarchy WHERE sub_project_id = $1',
57 if (!$res || db_numrows($res) < 1) {
60 $row = db_fetch_array($res);
61 $family[$cpt] = $row['project_id'];
63 return get_family($row['project_id'], $family, $cpt);
69 // c-file-style: "bsd"