[Fusionforge-commits] r11843 - in trunk/src/plugins/projects_hierarchy: . common include www
Franck VILLAUME
nerville at libremir.placard.fr.eu.org
Mon Dec 20 11:03:49 CET 2010
Author: nerville
Date: 2010-12-20 11:03:49 +0100 (Mon, 20 Dec 2010)
New Revision: 11843
Added:
trunk/src/plugins/projects_hierarchy/include/
trunk/src/plugins/projects_hierarchy/include/hierarchy_utils.php
Removed:
trunk/src/plugins/projects_hierarchy/www/hierarchy_utils.php
Modified:
trunk/src/plugins/projects_hierarchy/common/projects_hierarchyPlugin.class.php
Log:
move utils php to include
Modified: trunk/src/plugins/projects_hierarchy/common/projects_hierarchyPlugin.class.php
===================================================================
--- trunk/src/plugins/projects_hierarchy/common/projects_hierarchyPlugin.class.php 2010-12-19 16:30:55 UTC (rev 11842)
+++ trunk/src/plugins/projects_hierarchy/common/projects_hierarchyPlugin.class.php 2010-12-20 10:03:49 UTC (rev 11843)
@@ -57,7 +57,7 @@
}
case "admin_project_link": {
global $gfplugins;
- require_once $gfplugins.'projects_hierarchy/www/hierarchy_utils.php';
+ require_once $gfplugins.'projects_hierarchy/include/hierarchy_utils.php';
$group_id = $params;
$project = group_get_object($group_id);
if ($project->usesPlugin($this->name)) {
Copied: trunk/src/plugins/projects_hierarchy/include/hierarchy_utils.php (from rev 11842, trunk/src/plugins/projects_hierarchy/www/hierarchy_utils.php)
===================================================================
--- trunk/src/plugins/projects_hierarchy/include/hierarchy_utils.php (rev 0)
+++ trunk/src/plugins/projects_hierarchy/include/hierarchy_utils.php 2010-12-20 10:03:49 UTC (rev 11843)
@@ -0,0 +1,99 @@
+<?php
+/*
+ * Copyright 2004 (c) GForge LLC
+ * Copyright 2006 (c) Fabien Regnier - Sogeti
+ *
+ * This file is part of FusionForge.
+ *
+ * FusionForge is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * FusionForge is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with FusionForge; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+function son_box($group_id,$name,$selected='xzxzxz') {
+ global $son;
+ if (!$son) {
+ $family = get_family($group_id);
+ $cond = '';
+ $skipped = array();
+ if($family != NULL) {
+
+ reset($family);
+ while (list($key, $val) = each($family)) {
+ $skipped[] = $val;
+ }
+ }
+ $son = db_query_params('SELECT group_id,group_name,register_time FROM groups
+WHERE status=$1 AND type_id=1 AND group_id != $2 AND group_id <> ALL ($3) AND group_id NOT IN (SELECT sub_project_id FROM plugin_projects_hierarchy WHERE link_type = $4)',
+ array('A',
+ $group_id,
+ db_int_array_to_any_clause ($skipped),
+ 'shar'));
+ }
+ return html_build_select_box($son,$name,$selected,false);
+}
+
+function link_box($group_id,$name,$selected='xzxzxz') {
+ global $link;
+ if (!$link) {
+ $link = db_query_params('SELECT group_id,group_name,register_time FROM groups
+WHERE status=$1 AND type_id=1 AND group_id != $2
+AND group_id NOT IN (SELECT sub_project_id FROM plugin_projects_hierarchy WHERE project_id = $3 )
+ AND group_id NOT IN (SELECT project_id FROM plugin_projects_hierarchy WHERE sub_project_id = $4 )',
+ array('A',
+ $group_id,
+ $group_id,
+ $group_id));
+
+
+ }
+ return html_build_select_box($link, $name, $selected, false);
+}
+
+
+function type_son_box() {
+ return "<select name='link_type' onchange=\"javascript:
+if(this.value!= 0){
+document.formson.son.disabled=false
+}
+else {
+document.formson.son.disabled=true
+}\">
+\n<option value='0' selected=\"selected\" >"._('Link Type')."</option>\n
+<option value='shar'>"._('Share')."</option>\n
+<option value='navi' >"._('Navigation')."</option>\n
+</select>";
+}
+
+//search all the family,all ancestor
+function get_family($group_id, $family='', $cpt=0){
+ $res = db_query_params('SELECT project_id FROM plugin_projects_hierarchy WHERE sub_project_id = $1',
+ array($group_id))
+ or die (db_error ());
+ if (!$res || db_numrows($res) < 1) {
+ //return $family;
+ }
+ else {
+ $row = db_fetch_array($res);
+ $family[$cpt] = $row['project_id'];
+ $cpt++;
+ return get_family($row['project_id'],$family,$cpt);
+ }
+ return $family;
+}
+// Local Variables:
+// mode: php
+// c-file-style: "bsd"
+// End:
+
+?>
Deleted: trunk/src/plugins/projects_hierarchy/www/hierarchy_utils.php
===================================================================
--- trunk/src/plugins/projects_hierarchy/www/hierarchy_utils.php 2010-12-19 16:30:55 UTC (rev 11842)
+++ trunk/src/plugins/projects_hierarchy/www/hierarchy_utils.php 2010-12-20 10:03:49 UTC (rev 11843)
@@ -1,102 +0,0 @@
-<?php
-/*
- * Copyright 2004 (c) GForge LLC
- * Copyright 2006 (c) Fabien Regnier - Sogeti
- *
- * This file is part of FusionForge.
- *
- * FusionForge is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * FusionForge is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with FusionForge; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-function son_box ($group_id,$name,$selected='xzxzxz') {
- global $son;
- if (!$son) {
-
- $family = get_family($group_id);
- $cond = '';
- $skipped = array() ;
- if($family != NULL){
-
- reset($family);
- while (list($key, $val) = each($family)) {
- $skipped[] = $val ;
- }
-
- }
- $son = db_query_params ('SELECT group_id,group_name,register_time FROM groups
-WHERE status=$1 AND type_id=1 AND group_id != $2 AND group_id <> ALL ($3) AND group_id NOT IN (SELECT sub_project_id FROM plugin_projects_hierarchy WHERE link_type = $4)',
- array ('A',
- $group_id,
- db_int_array_to_any_clause ($skipped),
- 'shar'));
- }
- return html_build_select_box($son,$name,$selected,false);
-}
-
-function link_box ($group_id,$name,$selected='xzxzxz') {
- global $link;
- if (!$link) {
- $link = db_query_params ('SELECT group_id,group_name,register_time FROM groups
-WHERE status=$1 AND type_id=1 AND group_id != $2
-AND group_id NOT IN (SELECT sub_project_id FROM plugin_projects_hierarchy WHERE project_id = $3 )
- AND group_id NOT IN (SELECT project_id FROM plugin_projects_hierarchy WHERE sub_project_id = $4 )',
- array ('A',
- $group_id,
- $group_id,
- $group_id));
-
-
- }
- return html_build_select_box($link,$name,$selected,false);
-}
-
-
-function type_son_box () {
- return "<select name='link_type' onchange=\"javascript:
-if(this.value!= 0){
-document.formson.son.disabled=false
-}
-else {
-document.formson.son.disabled=true
-}\">
-\n<option value='0' selected=\"selected\" >"._('Link Type')."</option>\n
-<option value='shar'>"._('Share')."</option>\n
-<option value='navi' >"._('Navigation')."</option>\n
-</select>";
- }
-
-//search all the family,all ancestor
-function get_family($group_id,$family='',$cpt=0){
- $res = db_query_params ('SELECT project_id FROM plugin_projects_hierarchy WHERE sub_project_id = $1',
- array ($group_id))
- or die (db_error ());
- if (!$res || db_numrows($res) < 1) {
- //return $family;
- }
- else {
- $row = db_fetch_array($res);
- $family[$cpt] = $row['project_id'];
- $cpt++;
- return get_family($row['project_id'],$family,$cpt);
- }
-
- return $family;
-}
-// Local Variables:
-// mode: php
-// c-file-style: "bsd"
-// End:
-
-?>
More information about the Fusionforge-commits
mailing list