* text=auto !eol
gforge/backend/shell/apache.sh svneol=native#unset
+gforge/common/docman/Parsedata.class -text
+gforge/common/docman/engine/majwords.php -text
+gforge/common/docman/engine/majwords.sh -text
+gforge/common/docman/engine/parser_list.txt -text
+gforge/common/docman/engine/parser_oo.php -text
+gforge/common/docman/engine/parser_pdf.php.php -text
+gforge/common/docman/engine/parser_text.inc.php -text
+gforge/common/docman/engine/parser_text.php -text
gforge/common/include/TextSanitizer.class -text
gforge/contrib/cmd-line-prototype.tar.gz -text
+gforge/cronjobs/ftp_create_group_access.php -text
+gforge/cronjobs/gforge-db-backup.sh -text
gforge/cronjobs/mail/publicize_list.py -text
gforge/db/20030701-gforge-3.0 -text svneol=unset#application/octet-stream
gforge/db/20031026-gforge-3.1 -text svneol=unset#application/octet-stream
gforge/db/20040326-gforge-3.3 -text svneol=unset#application/octet-stream
gforge/db/20041025-gforge-4.0 -text svneol=unset#application/octet-stream
gforge/db/20050822-drops.sql -text
+gforge/db/20051103_transiciel_motscle_document.sql -text
gforge/db/20060216-drops.sql -text
gforge/db/20060216-nocommit.sql -text
gforge/db/FTI-20061025.sql -text
gforge/plugins/mediawiki/usr/share/mediawiki1.7/skins/gforge/wiki-indexed.png -text
gforge/plugins/mediawiki/usr/share/mediawiki1.7/skins/gforge/wiki.png -text
gforge/plugins/mediawiki/www/index.php -text
+gforge/plugins/projects_hierarchy/AUTHORS -text
+gforge/plugins/projects_hierarchy/COPYING -text
+gforge/plugins/projects_hierarchy/ChangeLog -text
+gforge/plugins/projects_hierarchy/common/languages/Base.tab -text
+gforge/plugins/projects_hierarchy/common/languages/French.tab -text
+gforge/plugins/projects_hierarchy/common/projects_hierarchy-init.php -text
+gforge/plugins/projects_hierarchy/common/projects_hierarchyPlugin.class -text
+gforge/plugins/projects_hierarchy/db/projects_hierarchy-init.sql -text
+gforge/plugins/projects_hierarchy/www/add_link.php -text
+gforge/plugins/projects_hierarchy/www/add_son.php -text
+gforge/plugins/projects_hierarchy/www/del_father.php -text
+gforge/plugins/projects_hierarchy/www/del_son.php -text
+gforge/plugins/projects_hierarchy/www/dtree.css -text
+gforge/plugins/projects_hierarchy/www/dtree.js -text
+gforge/plugins/projects_hierarchy/www/hierarchy_utils.php -text
+gforge/plugins/projects_hierarchy/www/img/base.gif -text
+gforge/plugins/projects_hierarchy/www/img/cd.gif -text
+gforge/plugins/projects_hierarchy/www/img/empty.gif -text
+gforge/plugins/projects_hierarchy/www/img/folder.gif -text
+gforge/plugins/projects_hierarchy/www/img/folderopen.gif -text
+gforge/plugins/projects_hierarchy/www/img/globe.gif -text
+gforge/plugins/projects_hierarchy/www/img/imgfolder.gif -text
+gforge/plugins/projects_hierarchy/www/img/join.gif -text
+gforge/plugins/projects_hierarchy/www/img/joinbottom.gif -text
+gforge/plugins/projects_hierarchy/www/img/line.gif -text
+gforge/plugins/projects_hierarchy/www/img/minus.gif -text
+gforge/plugins/projects_hierarchy/www/img/minusbottom.gif -text
+gforge/plugins/projects_hierarchy/www/img/musicfolder.gif -text
+gforge/plugins/projects_hierarchy/www/img/nolines_minus.gif -text
+gforge/plugins/projects_hierarchy/www/img/nolines_plus.gif -text
+gforge/plugins/projects_hierarchy/www/img/page.gif -text
+gforge/plugins/projects_hierarchy/www/img/plus.gif -text
+gforge/plugins/projects_hierarchy/www/img/plusbottom.gif -text
+gforge/plugins/projects_hierarchy/www/img/question.gif -text
+gforge/plugins/projects_hierarchy/www/img/trash.gif -text
+gforge/plugins/projects_hierarchy/www/index.php -text
+gforge/plugins/projects_hierarchy/www/softwaremap.php -text
+gforge/plugins/projects_hierarchy/www/wait_son.php -text
+gforge/plugins/quota_management/INSTALL -text
+gforge/plugins/quota_management/common/languages/Base.tab -text
+gforge/plugins/quota_management/common/quota_management-init.php -text
+gforge/plugins/quota_management/common/quota_managementPlugin.class -text
+gforge/plugins/quota_management/cronjobs/quota_update.pl -text
+gforge/plugins/quota_management/db/quota_management-init.sql -text
+gforge/plugins/quota_management/www/index.php -text
+gforge/plugins/quota_management/www/quota.php -text
+gforge/plugins/quota_management/www/quota_admin.php -text
+gforge/plugins/quota_management/www/quota_project.php -text
gforge/plugins/svntracker/AUTHORS -text
gforge/plugins/svntracker/COPYING -text
gforge/plugins/svntracker/README -text
gforge/plugins/svntracker/postcommit.example -text
gforge/plugins/svntracker/rpm-specific/cron.d/gforge-plugin-svntracker -text
gforge/plugins/svntracker/www/newcommit.php -text
+gforge/plugins/webcalendar/AUTHORS -text
+gforge/plugins/webcalendar/COPYING -text
+gforge/plugins/webcalendar/ChangeLog -text
+gforge/plugins/webcalendar/README -text
+gforge/plugins/webcalendar/common/languages/Base.tab -text
+gforge/plugins/webcalendar/common/languages/French.tab -text
+gforge/plugins/webcalendar/common/webcalendar-init.php -text
+gforge/plugins/webcalendar/common/webcalendarPlugin.class -text
+gforge/plugins/webcalendar/db/webcalendar-init.sql -text
+gforge/plugins/webcalendar/script/webcalendar-init.php -text
+gforge/plugins/webcalendar/www/.project -text
+gforge/plugins/webcalendar/www/AUTHORS -text
+gforge/plugins/webcalendar/www/GPL.html -text
+gforge/plugins/webcalendar/www/NEWS -text
+gforge/plugins/webcalendar/www/README.html -text
+gforge/plugins/webcalendar/www/UPGRADING.html -text
+gforge/plugins/webcalendar/www/activity_log.php -text
+gforge/plugins/webcalendar/www/add_entry.php -text
+gforge/plugins/webcalendar/www/admin.php -text
+gforge/plugins/webcalendar/www/admin_handler.php -text
+gforge/plugins/webcalendar/www/adminhome.php -text
+gforge/plugins/webcalendar/www/approve_entry.php -text
+gforge/plugins/webcalendar/www/assistant_edit.php -text
+gforge/plugins/webcalendar/www/assistant_edit_handler.php -text
+gforge/plugins/webcalendar/www/availability.php -text
+gforge/plugins/webcalendar/www/category.php -text
+gforge/plugins/webcalendar/www/category_handler.php -text
+gforge/plugins/webcalendar/www/circle.gif -text
+gforge/plugins/webcalendar/www/colors.php -text
+gforge/plugins/webcalendar/www/datesel.php -text
+gforge/plugins/webcalendar/www/day.php -text
+gforge/plugins/webcalendar/www/del_entry.php -text
+gforge/plugins/webcalendar/www/del_layer.php -text
+gforge/plugins/webcalendar/www/docs/README -text
+gforge/plugins/webcalendar/www/docs/WebCalendar-Database.html -text
+gforge/plugins/webcalendar/www/docs/WebCalendar-DeveloperGuide.html -text
+gforge/plugins/webcalendar/www/docs/WebCalendar-Styling.html -text
+gforge/plugins/webcalendar/www/docs/WebCalendar-SysAdmin.html -text
+gforge/plugins/webcalendar/www/docs/newwin.gif -text
+gforge/plugins/webcalendar/www/edit_entry.php -text
+gforge/plugins/webcalendar/www/edit_entry_handler.php -text
+gforge/plugins/webcalendar/www/edit_layer.php -text
+gforge/plugins/webcalendar/www/edit_layer_handler.php -text
+gforge/plugins/webcalendar/www/edit_nonusers.php -text
+gforge/plugins/webcalendar/www/edit_nonusers_handler.php -text
+gforge/plugins/webcalendar/www/edit_report.php -text
+gforge/plugins/webcalendar/www/edit_report_handler.php -text
+gforge/plugins/webcalendar/www/edit_template.php -text
+gforge/plugins/webcalendar/www/edit_user.php -text
+gforge/plugins/webcalendar/www/edit_user_handler.php -text
+gforge/plugins/webcalendar/www/export.php -text
+gforge/plugins/webcalendar/www/export_handler.php -text
+gforge/plugins/webcalendar/www/favicon.ico -text
+gforge/plugins/webcalendar/www/gradient.php -text
+gforge/plugins/webcalendar/www/group_edit.php -text
+gforge/plugins/webcalendar/www/group_edit_handler.php -text
+gforge/plugins/webcalendar/www/groups.php -text
+gforge/plugins/webcalendar/www/help.gif -text
+gforge/plugins/webcalendar/www/help_admin.php -text
+gforge/plugins/webcalendar/www/help_bug.php -text
+gforge/plugins/webcalendar/www/help_edit_entry.php -text
+gforge/plugins/webcalendar/www/help_import.php -text
+gforge/plugins/webcalendar/www/help_index.php -text
+gforge/plugins/webcalendar/www/help_layers.php -text
+gforge/plugins/webcalendar/www/help_pref.php -text
+gforge/plugins/webcalendar/www/htmlarea-3.0rc1.zip -text
+gforge/plugins/webcalendar/www/import.php -text
+gforge/plugins/webcalendar/www/import_handler.php -text
+gforge/plugins/webcalendar/www/import_ical.php -text
+gforge/plugins/webcalendar/www/import_palmdesktop.php -text
+gforge/plugins/webcalendar/www/import_vcal.php -text
+gforge/plugins/webcalendar/www/includes/config.php -text
+gforge/plugins/webcalendar/www/includes/connect.php -text
+gforge/plugins/webcalendar/www/includes/dbtable.php -text
+gforge/plugins/webcalendar/www/includes/functions.php -text
+gforge/plugins/webcalendar/www/includes/help_trailer.php -text
+gforge/plugins/webcalendar/www/includes/index.html -text
+gforge/plugins/webcalendar/www/includes/index.php -text
+gforge/plugins/webcalendar/www/includes/init.php -text
+gforge/plugins/webcalendar/www/includes/js.php -text
+gforge/plugins/webcalendar/www/includes/js/admin.php -text
+gforge/plugins/webcalendar/www/includes/js/assistant_edit.php -text
+gforge/plugins/webcalendar/www/includes/js/availability.php -text
+gforge/plugins/webcalendar/www/includes/js/colors.php -text
+gforge/plugins/webcalendar/www/includes/js/datesel.php -text
+gforge/plugins/webcalendar/www/includes/js/edit_entry.php -text
+gforge/plugins/webcalendar/www/includes/js/edit_layer.php -text
+gforge/plugins/webcalendar/www/includes/js/export.php -text
+gforge/plugins/webcalendar/www/includes/js/popups.php -text
+gforge/plugins/webcalendar/www/includes/js/pref.php -text
+gforge/plugins/webcalendar/www/includes/js/purge.php -text
+gforge/plugins/webcalendar/www/includes/js/search.php -text
+gforge/plugins/webcalendar/www/includes/js/users.php -text
+gforge/plugins/webcalendar/www/includes/js/usersel.php -text
+gforge/plugins/webcalendar/www/includes/js/view_d.php -text
+gforge/plugins/webcalendar/www/includes/js/views_edit.php -text
+gforge/plugins/webcalendar/www/includes/js/visible.php -text
+gforge/plugins/webcalendar/www/includes/php-dbi.php -text
+gforge/plugins/webcalendar/www/includes/print_styles.css -text
+gforge/plugins/webcalendar/www/includes/settings.php -text
+gforge/plugins/webcalendar/www/includes/settings.php.orig -text
+gforge/plugins/webcalendar/www/includes/site_extras.php -text
+gforge/plugins/webcalendar/www/includes/styles.php -text
+gforge/plugins/webcalendar/www/includes/trailer.php -text
+gforge/plugins/webcalendar/www/includes/translate.php -text
+gforge/plugins/webcalendar/www/includes/user-app-postnuke.php -text
+gforge/plugins/webcalendar/www/includes/user-ldap.php -text
+gforge/plugins/webcalendar/www/includes/user-nis.php -text
+gforge/plugins/webcalendar/www/includes/user.php -text
+gforge/plugins/webcalendar/www/includes/validate.php -text
+gforge/plugins/webcalendar/www/index.php -text
+gforge/plugins/webcalendar/www/index2.php -text
+gforge/plugins/webcalendar/www/install-datebook.patch -text
+gforge/plugins/webcalendar/www/install/index.php -text
+gforge/plugins/webcalendar/www/layers.php -text
+gforge/plugins/webcalendar/www/layers_toggle.php -text
+gforge/plugins/webcalendar/www/leftarrow.gif -text
+gforge/plugins/webcalendar/www/leftarrowsmall.gif -text
+gforge/plugins/webcalendar/www/list_unapproved.php -text
+gforge/plugins/webcalendar/www/login.gif -text
+gforge/plugins/webcalendar/www/login.php -text
+gforge/plugins/webcalendar/www/month.php -text
+gforge/plugins/webcalendar/www/new.gif -text
+gforge/plugins/webcalendar/www/nonusers.php -text
+gforge/plugins/webcalendar/www/nonusers_handler.php -text
+gforge/plugins/webcalendar/www/pix.gif -text
+gforge/plugins/webcalendar/www/pixb.gif -text
+gforge/plugins/webcalendar/www/pref.php -text
+gforge/plugins/webcalendar/www/pref_handler.php -text
+gforge/plugins/webcalendar/www/publish.php -text
+gforge/plugins/webcalendar/www/purge.php -text
+gforge/plugins/webcalendar/www/reject_entry.php -text
+gforge/plugins/webcalendar/www/report.php -text
+gforge/plugins/webcalendar/www/rightarrow.gif -text
+gforge/plugins/webcalendar/www/rightarrowsmall.gif -text
+gforge/plugins/webcalendar/www/search.php -text
+gforge/plugins/webcalendar/www/search_handler.php -text
+gforge/plugins/webcalendar/www/select_user.php -text
+gforge/plugins/webcalendar/www/set_entry_cat.php -text
+gforge/plugins/webcalendar/www/spacer.gif -text
+gforge/plugins/webcalendar/www/tables-db2.sql -text
+gforge/plugins/webcalendar/www/tables-ibase.sql -text
+gforge/plugins/webcalendar/www/tables-mysql.sql -text
+gforge/plugins/webcalendar/www/tables-oracle.sql -text
+gforge/plugins/webcalendar/www/tables-postgres.sql -text
+gforge/plugins/webcalendar/www/tools/check_translation.pl -text
+gforge/plugins/webcalendar/www/tools/convert_passwords.php -text
+gforge/plugins/webcalendar/www/tools/palm_datebook.pl -text
+gforge/plugins/webcalendar/www/tools/send_reminders.php -text
+gforge/plugins/webcalendar/www/tools/summary.txt -text
+gforge/plugins/webcalendar/www/tools/translation_summary.pl -text
+gforge/plugins/webcalendar/www/tools/update_all.pl -text
+gforge/plugins/webcalendar/www/tools/update_translation.pl -text
+gforge/plugins/webcalendar/www/tools/upgrade_to_0.9.7.pl -text
+gforge/plugins/webcalendar/www/translations/Basque.txt -text
+gforge/plugins/webcalendar/www/translations/Bulgarian.txt -text
+gforge/plugins/webcalendar/www/translations/Catalan.txt -text
+gforge/plugins/webcalendar/www/translations/Chinese-Big5.txt -text
+gforge/plugins/webcalendar/www/translations/Chinese-GB2312.txt -text
+gforge/plugins/webcalendar/www/translations/Czech.txt -text
+gforge/plugins/webcalendar/www/translations/Danish.txt -text
+gforge/plugins/webcalendar/www/translations/Dutch.txt -text
+gforge/plugins/webcalendar/www/translations/English-US.txt -text
+gforge/plugins/webcalendar/www/translations/Estonian.txt -text
+gforge/plugins/webcalendar/www/translations/Finnish.txt -text
+gforge/plugins/webcalendar/www/translations/French.txt -text
+gforge/plugins/webcalendar/www/translations/Galician.txt -text
+gforge/plugins/webcalendar/www/translations/German.txt -text
+gforge/plugins/webcalendar/www/translations/Holo-Big5.txt -text
+gforge/plugins/webcalendar/www/translations/Hungarian.txt -text
+gforge/plugins/webcalendar/www/translations/Icelandic.txt -text
+gforge/plugins/webcalendar/www/translations/Italian.txt -text
+gforge/plugins/webcalendar/www/translations/Japanese-eucjp.txt -text
+gforge/plugins/webcalendar/www/translations/Japanese-utf8.txt -text
+gforge/plugins/webcalendar/www/translations/Japanese.txt -text
+gforge/plugins/webcalendar/www/translations/Korean.txt -text
+gforge/plugins/webcalendar/www/translations/Norwegian.txt -text
+gforge/plugins/webcalendar/www/translations/Polish.txt -text
+gforge/plugins/webcalendar/www/translations/Portuguese.txt -text
+gforge/plugins/webcalendar/www/translations/Portuguese_BR.txt -text
+gforge/plugins/webcalendar/www/translations/Romanian.txt -text
+gforge/plugins/webcalendar/www/translations/Russian.txt -text
+gforge/plugins/webcalendar/www/translations/Spanish.txt -text
+gforge/plugins/webcalendar/www/translations/Swedish.txt -text
+gforge/plugins/webcalendar/www/translations/Turkish.txt -text
+gforge/plugins/webcalendar/www/translations/Welsh.txt -text
+gforge/plugins/webcalendar/www/upcoming.php -text
+gforge/plugins/webcalendar/www/users.php -text
+gforge/plugins/webcalendar/www/usersel.php -text
+gforge/plugins/webcalendar/www/view_d.php -text
+gforge/plugins/webcalendar/www/view_entry.php -text
+gforge/plugins/webcalendar/www/view_l.php -text
+gforge/plugins/webcalendar/www/view_m.php -text
+gforge/plugins/webcalendar/www/view_t.php -text
+gforge/plugins/webcalendar/www/view_v.php -text
+gforge/plugins/webcalendar/www/view_w.php -text
+gforge/plugins/webcalendar/www/views.php -text
+gforge/plugins/webcalendar/www/views_edit.php -text
+gforge/plugins/webcalendar/www/views_edit_handler.php -text
+gforge/plugins/webcalendar/www/week.php -text
+gforge/plugins/webcalendar/www/week_details.php -text
+gforge/plugins/webcalendar/www/week_ssi.php -text
+gforge/plugins/webcalendar/www/ws/get_events.php -text
+gforge/plugins/webcalendar/www/ws/get_reminders.php -text
+gforge/plugins/webcalendar/www/ws/login.php -text
+gforge/plugins/webcalendar/www/year.php -text
gforge/rpm-specific/custom/.keepme -text svneol=unset#application/octet-stream
gforge/rpm-specific/languages/.keepme -text svneol=unset#application/octet-stream
gforge/rpm-specific/scripts/gforge-config -text svneol=unset#application/octet-stream
+gforge/www/docman/include/vtemplate.class.php -text
+gforge/www/docman/search.php -text
+gforge/www/docman/search.tpl.html -text
+gforge/www/env.inc.php -text
gforge/www/favicon.ico svneol=native#unset
gforge/www/forum/admin/ForumAdmin.class -text
gforge/www/forum/include/AttachManager.class -text
gforge/www/include/SmilieSupport.class -text svneol=unset#application/octet-stream
gforge/www/include/SmilieSupportHtml.class -text svneol=unset#application/octet-stream
gforge/www/include/TextSupport.class -text svneol=unset#application/octet-stream
+gforge/www/include/unicode.php -text
gforge/www/jscook/ThemePanel/arrow.gif svneol=native#unset
gforge/www/jscook/ThemePanel/arrowdown.gif svneol=native#unset
gforge/www/jscook/ThemePanel/blank.gif svneol=native#unset
-
2006-10-04 Christian Bayle <bayle@debian.org>
* remove use of deprecated user_ismember function in layout.class
* Allow opening of /etc/gforge/local.inc readonly in configman.php,
*/
require_once('common/include/Error.class');
+require_once('common/docman/Parsedata.class');
class Document extends Error {
*
* @var object $Group.
*/
- var $Group; //group object
+ /**
+ * The Search engine path.
+ *
+ * @var string $engine_path
+ */
+ var $engine_path;
/**
* Constructor.
* @param array The associative array of data.
* @return boolean success.
*/
- function Document(&$Group, $docid=false, $arr=false) {
+ function Document(&$Group, $docid=false, $arr=false, $engine = "") {
$this->Error();
if (!$Group || !is_object($Group)) {
$this->setNotValidGroupObjectError();
}
}
}
+ $this->engine_path = $engine;
return true;
}
function_exists('mb_detect_encoding')) {
$data = mb_convert_encoding($data,'UTF-8',mb_detect_encoding($data));
}
-
+ $data1 = $data;
+
+ // key words for in-document search
+ $kw = new Parsedata ($this->engine_path);
+ $kwords = $kw->get_parse_data (stripslashes($data1), htmlspecialchars($title1), htmlspecialchars($description), $filetype);
+ // $kwords = "";
+
$filesize = strlen($data);
$sql="INSERT INTO doc_data (group_id,title,description,createdate,doc_group,
- stateid,language_id,filename,filetype,filesize,data,created_by)
+ stateid,language_id,filename,filetype,filesize,data,data_words,created_by)
VALUES ('".$this->Group->getId()."',
'". htmlspecialchars($title) ."',
'". htmlspecialchars($description) ."',
'$filetype',
'$filesize',
'". base64_encode(stripslashes($data)) ."',
+ '$kwords',
'$user_id')";
db_begin();
--- /dev/null
+<?php\r
+/**\r
+ * GForge Doc Mgr Facility\r
+ *\r
+ * \r
+ * Fabio Bertagnin november 2005\r
+ *\r
+ * @version $Id: 04_IMPROVDOC_75_document_specific_search_engine.dpatch,v 1.1 2006/01/11 17:02:45 fabio Exp $\r
+ *\r
+ * This file is part of GForge.\r
+ *\r
+ * GForge is free software; you can redistribute it and/or modify\r
+ * it under the terms of the GNU General Public License as published by\r
+ * the Free Software Foundation; either version 2 of the License, or\r
+ * (at your option) any later version.\r
+ * \r
+ * GForge is distributed in the hope that it will be useful,\r
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
+ * GNU General Public License for more details.\r
+ *\r
+ * You should have received a copy of the GNU General Public License\r
+ * along with GForge; if not, write to the Free Software\r
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
+ */\r
+\r
+\r
+/*\r
+ Document Manager\r
+\r
+ by Fabio Bertagnin\r
+\r
+*/\r
+\r
+\r
+class Parsedata {\r
+ /**\r
+ * Constructor.\r
+ *\r
+ * @param\r
+ * @return\r
+ */\r
+ var $parsers;\r
+ var $p_path = "";\r
+ \r
+ function Parsedata($ppath="") \r
+ {\r
+ $this->p_path = $ppath;\r
+ $p = get_parser_list ($ppath);\r
+ $this->parsers = $p;\r
+ return true;\r
+ }\r
+ function get_parse_data ($data, $title, $description, $filetype)\r
+ {\r
+ $parser = "";\r
+ $rep = "";\r
+ $data1 = $data;\r
+ if (array_key_exists($filetype, $this->parsers))\r
+ { \r
+ // parse data if good parser exists\r
+ $parser = $this->p_path.$this->parsers[$filetype];\r
+ $filename = rand(10000,99999);\r
+ $filename = "/tmp/gfd$filename.tmp";\r
+ $fp = fopen ($filename, "w");\r
+ fwrite ($fp, $data1);\r
+ fclose ($fp);\r
+ \r
+ $cmd = "$parser $filename";\r
+ echo "cmd $cmd<br />";\r
+ $rep = shell_exec ($cmd);\r
+ echo "rep : <br />$rep<br />";\r
+ unlink ("$filename");\r
+ \r
+ // pour tests et debug\r
+ // echo "parser $parser<br />";\r
+ // echo "$rep<br /><br />";\r
+ // exit();\r
+ }\r
+ // alwais parse titre and description\r
+ $data2 = utf8_decode(" $title");\r
+ $data2 .= utf8_decode(" $description");\r
+ // $data2 = ereg_replace ("\n", " ", $data2);\r
+ // temporary file for traitement\r
+ $filename = rand(10000,99999);\r
+ $filename = "/tmp/gfi$filename.tmp";\r
+ $fp = fopen ($filename, "w");\r
+ fwrite ($fp, $data2);\r
+ fclose ($fp);\r
+ $cmd = $this->p_path.$this->parsers["text/plain"];\r
+ $cmd = "$cmd $filename";\r
+ $rep1 = shell_exec ($cmd);\r
+ return ereg_replace ("\n", " ", "$rep $rep1");\r
+ }\r
+ \r
+ \r
+ function print_debug ($text)\r
+ {\r
+ echo "$text \n";\r
+ ob_flush();\r
+ }\r
+}\r
+\r
+function get_parser_list ($parser_path)\r
+{\r
+ $file = $parser_path."parser_list.txt";\r
+ $rep = array();\r
+ $fp = fopen ($file, "r");\r
+ if ($fp)\r
+ {\r
+ $buff = fread($fp, 2048);\r
+ $a1 = explode ("\n", $buff);\r
+ foreach ($a1 as $a)\r
+ {\r
+ if (trim($a) != "" && substr($a, 0,1) != "#")\r
+ {\r
+ $a2 = explode ("\t", $a);\r
+ $rep[$a2[0]] = $a2[1];\r
+ }\r
+ }\r
+ }\r
+ return $rep;\r
+}\r
+\r
+?>
\ No newline at end of file
--- /dev/null
+#! /usr/bin/php4 -f\r
+<?php\r
+/**\r
+ * GForge Doc Search engine\r
+ *\r
+ * \r
+ * Fabio Bertagnin November 2005\r
+ *\r
+ * @version $Id: 04_IMPROVDOC_75_document_specific_search_engine.dpatch,v 1.1 2006/01/11 17:02:45 fabio Exp $\r
+ */\r
+\r
+require_once('pre.php');\r
+require_once('www/docman/include/doc_utils.php');\r
+require_once('common/docman/Parsedata.class');\r
+require_once('common/docman/Document.class');\r
+require_once('common/docman/DocumentFactory.class');\r
+require_once('common/docman/DocumentGroupFactory.class');\r
+\r
+$p = new Parsedata ("$sys_engine_path");\r
+// print_debug(print_r($p->get_parser_list (),true));\r
+\r
+$timestarttrait = microtime_float();\r
+// documents list\r
+$sql = "SELECT docid, group_id, filename, title, createdate, filename, description, filetype, data FROM doc_data \n";\r
+$resarr = array();\r
+$result=db_query($sql);\r
+if ($result)\r
+{\r
+ while ($arr = db_fetch_array($result))\r
+ {\r
+ $resarr[] = $arr;\r
+ }\r
+}\r
+\r
+$compt = 0;\r
+$rapp = "";\r
+foreach ($resarr as $item)\r
+{\r
+ $compt++;\r
+ $timestart = microtime_float();\r
+ $data1 = base64_decode($item["data"]);\r
+ $lenin = strlen($data1);\r
+ $res = $p->get_parse_data ($data1, $item["title"], $item["description"], $item["filetype"]);\r
+ $len = strlen($res);\r
+ $sql = "UPDATE doc_data SET data_words = '$res' WHERE docid = $item[docid] ";\r
+ db_query($sql);\r
+ $timeend = microtime_float();\r
+ $timetrait = $timeend - $timestart;\r
+ print_debug ("analyze $item[filename] type=$item[filetype] octets in=$lenin octets out=$len time=$timetrait sec");\r
+}\r
+$timeendtrait = microtime_float();\r
+$timetot = $timeendtrait - $timestarttrait;\r
+print_debug ("End analyze : $compt files, $timetot secs.");\r
+\r
+\r
+function print_debug ($text)\r
+{\r
+ echo "$text\n";\r
+}\r
+\r
+function microtime_float()\r
+{\r
+ list($usec, $sec) = explode(" ", microtime());\r
+ return ((float)$usec + (float)$sec);\r
+}\r
+?>\r
--- /dev/null
+#!/bin/sh\r
+./majwords.php -d include_path=/etc/gforge:/usr/share/gforge:/usr/share/gforge/www/include\r
--- /dev/null
+# parser_list.txt\r
+# Liste des documents connus avec le parseur associé\r
+# Cette liste est utilisée pour fabriquer les mots clé pour la recherche dans le contenu des documents\r
+# Le format texte est traité directement par un parseur approprié (engine/parser_text.py).\r
+# Les autres formats doivent être convertis au format texte avant d'être envoyées au parseur de base.\r
+text/plain parser_text.php\r
+application/pdf parser_pdf.php\r
+application/vnd.sun.xml.writer parser_oo.php\r
--- /dev/null
+#! /usr/bin/php4 -f\r
+<?php\r
+/**\r
+ * GForge Doc Search Utilities\r
+ *\r
+ * \r
+ * Fabio Bertagnin November 2005\r
+ *\r
+ */\r
+ \r
+require_once("parser_text.inc.php");\r
+\r
+\r
+if ($argc != 2)\r
+{\r
+ echo "Usage : parser_oo.php <filename>\n";\r
+ exit (1);\r
+}\r
+\r
+$fichin = $argv[1];\r
+if (!is_file($fichin)) exit (1);\r
+$fichout = "/tmp/gfo".rand(10000, 99999).".tmp";\r
+$cmd = "/usr/bin/perl /usr/bin/ooo2txt.pl $fichin > $fichout";\r
+$res = shell_exec($cmd);\r
+\r
+\r
+$rep = parser_text($fichout);\r
+// envoi du résultat sur stdout\r
+echo "$rep";\r
+// efface les fichiers témporaires\r
+unlink ($fichout);\r
+\r
+?>
\ No newline at end of file
--- /dev/null
+#! /usr/bin/php4 -f\r
+<?php\r
+/**\r
+ * GForge Doc Search Utilities\r
+ *\r
+ * \r
+ * Fabio Bertagnin November 2005\r
+ *\r
+ */\r
+ \r
+require_once("parser_text.inc.php");\r
+\r
+\r
+if ($argc != 2)\r
+{\r
+ echo "Usage : parser_pdf.php <filename>\n";\r
+ exit (1);\r
+}\r
+\r
+$fichin = $argv[1];\r
+if (!is_file($fichin)) exit (1);\r
+$fichout = "/tmp/gfo".rand(10000, 99999).".tmp";\r
+$cmd = "/usr/bin/pdftotext $fichin - > $fichout";\r
+$res = shell_exec($cmd);\r
+\r
+\r
+$rep = parser_text($fichout);\r
+// envoi du résultat sur stdout\r
+echo "$rep";\r
+// efface les fichiers témporaires\r
+unlink ($fichout);\r
+\r
+?>
\ No newline at end of file
--- /dev/null
+<?php\r
+/**\r
+ * GForge Doc Search Utilities\r
+ *\r
+ * \r
+ * Fabio Bertagnin November 2005\r
+ *\r
+ */\r
+\r
+function parser_text($fichin)\r
+{\r
+ $tstart = microtime_float();\r
+ if (!is_file($fichin)) return "";\r
+ $fp = fopen ($fichin, "r");\r
+ $buff = fread ($fp, filesize($fichin));\r
+ // tout en minuscules\r
+ $buff = mb_strtolower($buff);\r
+ // élimination d'éventuels caractères unicode encore présents\r
+ $buff = mb_convert_encoding ($buff, "ascii");\r
+ // élimination caractères avec accents \r
+ // et caractères spéciaux\r
+ $buff = suppression_diacritics($buff);\r
+ // tous les mots dans un tableau\r
+ $a = explode(" ", $buff);\r
+ //sort($a);\r
+ // élimination des doublons\r
+ $a = array_unique($a);\r
+ // envoi du résultat sur stdout\r
+ $rep = print_list($a);\r
+ return $rep;\r
+}\r
+\r
+function print_list ($list)\r
+{\r
+ $rep = "";\r
+ foreach ($list as $el)\r
+ {\r
+ if (strlen($el) > 1) $rep .= "$el ";\r
+ }\r
+ return $rep;\r
+}\r
+\r
+function suppression_diacritics($text)\r
+{\r
+ $b = $text;\r
+ $b = strtr($b, "éêèëàâäîïùûüôöç", "eeeeaaaiiuuuooc");\r
+ $b = strtr($b, "\t\r\n?.*'\":;,#![]()", " ");\r
+ return $b;\r
+}\r
+\r
+function microtime_float()\r
+{\r
+ list($usec, $sec) = explode(" ", microtime());\r
+ return ((float)$usec + (float)$sec);\r
+}\r
+\r
+\r
+function print_debug ($text)\r
+{\r
+ echo "$text <br />\n";\r
+ ob_flush();\r
+}\r
+\r
+?>
\ No newline at end of file
--- /dev/null
+#! /usr/bin/php4 -f\r
+<?php\r
+/**\r
+ * GForge Doc Search Utilities\r
+ *\r
+ * \r
+ * Fabio Bertagnin November 2005\r
+ *\r
+ */\r
+ \r
+require_once("parser_text.inc.php");\r
+\r
+if ($argc != 2)\r
+{\r
+ echo "Usage : parser_oo.php <filename>\n";\r
+ exit (1);\r
+}\r
+$fichin = $argv[1];\r
+if (!is_file($fichin)) exit (1);\r
+\r
+$rep = parser_text($fichin);\r
+// envoi du résultat sur stdout\r
+echo "$rep";\r
+// efface le fichier source\r
+unlink ($fichin);\r
+\r
+?>
\ No newline at end of file
* @return int The unix time.
*/
function getSavedDate() {
- if ($this->save_date) {
+ if (@$this->save_date) {
return $this->save_date;
} else {
if (session_loggedin()) {
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
+require_once('common/include/Error.class');
class GForge extends Error {
/**
$this->sendApprovalEmail();
$this->addHistory('approved', 'x');
+
+ //plugin webcal
+ //change assistant for webcal
+
+ $params[0] = $idadmin_group ;
+ $params[1] = $this->getID();
+ plugin_hook('change_cal_permission_default',$params);
return true;
}
'trackeradmin'=>array('0','2'),
'tracker'=>array('-1','0','1','2','3'),
'pmadmin'=>array('0','2'),
- 'pm'=>array('-1','0','1','2','3'));
+ 'pm'=>array('-1','0','1','2','3'),
+ 'webcal'=>array('0','1','2'));
var $defaults=array(
- 'Admin'=>array( 'projectadmin'=>'A', 'frs'=>'1', 'scm'=>'1', 'docman'=>'1', 'forumadmin'=>'2', 'forum'=>'2', 'trackeradmin'=>'2', 'tracker'=>'2', 'pmadmin'=>'2', 'pm'=>'2' ),
- 'Senior Developer'=>array( 'projectadmin'=>'0', 'frs'=>'1', 'scm'=>'1', 'docman'=>'1', 'forumadmin'=>'2', 'forum'=>'2', 'trackeradmin'=>'2', 'tracker'=>'2', 'pmadmin'=>'2', 'pm'=>'2' ),
- 'Junior Developer'=>array( 'projectadmin'=>'0', 'frs'=>'0', 'scm'=>'1', 'docman'=>'0', 'forumadmin'=>'0', 'forum'=>'1', 'trackeradmin'=>'0', 'tracker'=>'1', 'pmadmin'=>'0', 'pm'=>'1' ),
- 'Doc Writer'=>array( 'projectadmin'=>'0', 'frs'=>'0', 'scm'=>'0', 'docman'=>'1', 'forumadmin'=>'0', 'forum'=>'1', 'trackeradmin'=>'0', 'tracker'=>'0', 'pmadmin'=>'0', 'pm'=>'0' ),
- 'Support Tech'=>array( 'projectadmin'=>'0', 'frs'=>'0', 'scm'=>'0', 'docman'=>'1', 'forumadmin'=>'0', 'forum'=>'1', 'trackeradmin'=>'0', 'tracker'=>'2', 'pmadmin'=>'0', 'pm'=>'0' )
+ 'Admin'=>array( 'projectadmin'=>'A', 'frs'=>'1', 'scm'=>'1', 'docman'=>'1', 'forumadmin'=>'2', 'forum'=>'2', 'trackeradmin'=>'2', 'tracker'=>'2', 'pmadmin'=>'2', 'pm'=>'2', 'webcal'=>'1' ),
+ 'Senior Developer'=>array( 'projectadmin'=>'0', 'frs'=>'1', 'scm'=>'1', 'docman'=>'1', 'forumadmin'=>'2', 'forum'=>'2', 'trackeradmin'=>'2', 'tracker'=>'2', 'pmadmin'=>'2', 'pm'=>'2', 'webcal'=>'2' ),
+ 'Junior Developer'=>array( 'projectadmin'=>'0', 'frs'=>'0', 'scm'=>'1', 'docman'=>'0', 'forumadmin'=>'0', 'forum'=>'1', 'trackeradmin'=>'0', 'tracker'=>'1', 'pmadmin'=>'0', 'pm'=>'1', 'webcal'=>'2' ),
+ 'Doc Writer'=>array( 'projectadmin'=>'0', 'frs'=>'0', 'scm'=>'0', 'docman'=>'1', 'forumadmin'=>'0', 'forum'=>'1', 'trackeradmin'=>'0', 'tracker'=>'0', 'pmadmin'=>'0', 'pm'=>'0' , 'webcal'=>'2'),
+ 'Support Tech'=>array( 'projectadmin'=>'0', 'frs'=>'0', 'scm'=>'0', 'docman'=>'1', 'forumadmin'=>'0', 'forum'=>'1', 'trackeradmin'=>'0', 'tracker'=>'2', 'pmadmin'=>'0', 'pm'=>'0' , 'webcal'=>'2')
);
/**
}
}
db_commit();
+
+ //plugin webcalendar, create cal_user
+ plugin_hook('add_cal_user',$this->getID());
+
return true;
}
}
$this->setError('backfill_users_added_daily:: Could Not Get Start Date');
return false;
}
+ $i = 0;
while (true) {
$day=($today-($i*REPORT_DAY_SPAN));
if (!$this->users_added_daily($day)) {
$this->setError('backfill_groups_added_daily:: Could Not Get Start Date');
return false;
}
+ $i = 0;
while (true) {
$day=($today-($i*REPORT_DAY_SPAN));
if (!$this->groups_added_daily($day)) {
$this->setError('backfill_users_cum_daily:: Could Not Get Start Date');
return false;
}
+ $i = 0;
while (true) {
$day=$today-($i*REPORT_DAY_SPAN);
if (!$this->users_cum_daily($day)) {
$this->setError('backfill_groups_cum_daily:: Could Not Get Start Date');
return false;
}
+ $i = 0;
while (true) {
$day=$today-($i*REPORT_DAY_SPAN);
if (!$this->groups_cum_daily($day)) {
$this->setError('backfill_user_act_daily:: Could Not Get Start Date');
return false;
}
+ $i = 0;
while (true) {
$day=$today-($i*REPORT_DAY_SPAN);
if (!$this->user_act_daily($day)) {
$this->setError('backfill_group_act_daily:: Could Not Get Start Date');
return false;
}
+ $i = 0;
while (true) {
$day=$today-($i*REPORT_DAY_SPAN);
if (!$this->group_act_daily($day)) {
--- /dev/null
+#! /usr/bin/php4 -f
+<?php
+/**
+ *
+ * Fabio Bertagnin nov 2005
+ * fbertatnin@mail.transiciel.com
+ *
+ * @version $Id: 06_IMPROVSFTP_80_ftp_improvement.dpatch,v 1.1 2006/01/11 17:02:45 fabio Exp $
+ *
+ * This file is part of GForge.
+ *
+ * GForge 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.
+ *
+ * GForge 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 GForge; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+require ('squal_pre.php');
+require ('common/include/cron_utils.php');
+
+
+$users = array();
+
+$chroot_dir = $sys_chroot;
+$ftp_dir = $sys_ftp_upload_dir."/pub/";
+$home_dir = $chroot_dir.$homedir_prefix."/";
+
+
+$SQL = "SELECT groups.group_id, group_name, unix_group_name, ";
+$SQL .= "user_group.user_id, ";
+$SQL .= "users.user_name ";
+$SQL .= "FROM groups ";
+$SQL .= "JOIN user_group ON user_group.group_id = groups.group_id ";
+$SQL .= "JOIN users ON users.user_id = user_group.user_id ";
+$SQL .= "ORDER BY group_id ";
+$res_db = db_query($SQL);
+if ($res_db)
+{
+ while($e = db_fetch_array($res_db))
+ {
+ $users["$e[user_id]"]["user_name"] = "$e[user_name]";
+ $users["$e[user_id]"]["user_groups"][] = "$e[unix_group_name]";
+ }
+}
+foreach ($users as $u)
+{
+ $dir = "$home_dir"."$u[user_name]"."/pub";
+ //$cmd = "cd $dir";
+ //$res = execute($cmd);
+ if (is_dir("$home_dir"."$u[user_name]"))
+ {
+ foreach ($u["user_groups"] as $g)
+ {
+ if (is_dir("$ftp_dir"."$g"))
+ {
+ if (is_dir("$dir/$g"))
+ {
+ $cmd = "/bin/umount $dir/$g";
+ $res = execute($cmd);
+ $cmd = "/bin/rmdir $dir/$g";
+ $res = execute($cmd);
+ }
+ if (!is_dir($dir))
+ {
+ $cmd = "/bin/mkdir $dir";
+ $res = execute($cmd);
+ }
+ $cmd = "/bin/mkdir $dir/$g";
+ $res = execute($cmd);
+ $cmd = "/bin/mount --bind $ftp_dir"."$g $dir/$g";
+ $res = execute($cmd);
+ echo "allow $u[user_name] to access at $dir/$g\n";
+ }
+ }
+ }
+}
+
+function print_debug($text)
+{
+ echo "$text\n";
+}
+
+function execute($cmd)
+{
+ // print_debug ("cmd= ".$cmd);
+ $res = shell_exec($cmd);
+ // print_debug ("res= ".$res);
+ return $res;
+}
+?>
--- /dev/null
+#!/bin/sh
+
+# This script does personal backups to a rsync backup server. You will end up
+# with a 7 day rotating incremental backup. The incrementals will go
+# into subdirectories named after the day of the week, and the current
+# full backup goes into a directory called "current"
+
+if [ $(id -u) != 0 ] ; then
+ echo "You must be root to run this, please enter passwd"
+ exec su -c "$0 $1"
+fi
+
+# directory to backup
+BDIR="/var/lib/gforge/chroot /var/lib/mailman /etc"
+PATTERNS="mailman postgresql exim4 gforge"
+
+DEST="/var/lib/gforge/backup"
+
+# BACKUPDIR=`date --date yesterday +%A`
+BACKUPDIR=`date +%A`
+# BACKUPDIR=`date --date tomorrow +%A`
+# BACKUPDIR=`date --date "2 days" +%A`
+OPTS="--force --ignore-errors --delete --backup --backup-dir=$DEST/$BACKUPDIR -a"
+
+[ ! -d ${DEST} ] && mkdir ${DEST}
+[ ! -d ${DEST}/postgres ] && mkdir ${DEST}/postgres
+[ ! -d ${DEST}/debconf ] && mkdir ${DEST}/debconf
+
+echo "Backuping data from $BDIR"
+# the following line clears the last weeks incremental directory
+[ -d $DEST/emptydir ] || mkdir $DEST/emptydir
+rsync --delete -a $DEST/emptydir/ $DEST/$BACKUPDIR/
+rmdir $DEST/emptydir
+
+# now the actual transfer
+rsync $OPTS $BDIR $DEST/current
+
+echo "Dumping database"
+su -s /bin/bash postgres -c "pg_dump -F c -d gforge" | gzip -c > ${DEST}/postgres/gforge.dump.gz
+
+echo "Dumping debconf keys"
+for PAT in $PATTERNS
+do
+ debconf-copydb configdb stdout -c Name:stdout -c Driver:Pipe -c InFd:none \
+ --pattern='^'${PAT}'/' > ${DEST}/debconf/${PAT}.txt
+ chmod 0700 ${DEST}/debconf/${PAT}.txt
+done
--- /dev/null
+--- Modification de la base gforge pour permettre la recherche dans le contenu des documents stockés\r
+--- Fabio Bertagnin - Transiciel Technologies\r
+--- fbertagnin@mail.transiciel.com\r
+--- 03/11/2005\r
+\r
+ALTER TABLE doc_data ADD COLUMN data_words TEXT;\r
+ALTER TABLE doc_data ALTER data_words SET DEFAULT '';\r
+UPDATE doc_data SET data_words = '';\r
+ALTER TABLE doc_data ALTER data_words SET NOT NULL;
\ No newline at end of file
$dbh->commit () ;
}
-
+
+ &update_with_sql("20051103_transiciel_motscle_document","4.6-1");
+
+
########################### INSERT HERE #################################
&debug ("It seems your database $action went well and smoothly. That's cool.") ;
-gforge (4.5.14-25+955) unstable; urgency=low
+gforge (4.5.14-25+963) unstable; urgency=low
* Merged Branch_4_5 into trunk after svn conversion
essentially debian and deb-specific dir, setup and install-apache.sh too
Package: gforge-ftp-proftpd
Architecture: all
-Depends: gforge-common, gforge-shell, proftpd, perl, debianutils (>= 1.7), debconf (>= 1.0.32) | debconf-2.0
+Depends: gforge-common, gforge-shell, proftpd, perl, debianutils (>= 1.7), debconf (>= 1.0.32) | debconf-2.0, php4-cli
Provides: gforge-ftp
Conflicts: gforge-ftp
Description: collaborative development tool - FTP management (using ProFTPd)
# Regular cron jobs for the gforge-db-postgresql package
#
+# Daily reporting process
+25 7 * * * gforge [ -x /usr/lib/gforge/bin/reporting_cron.php ] && /usr/lib/gforge/bin/reporting_cron.php -d include_path=/etc/gforge:/usr/share/gforge/:/usr/share/gforge/www/include > /dev/null 2>&1
+
# Recalculate user popularity metric
25 1 * * * gforge [ -x /usr/lib/gforge/bin/calculate_user_metric.php ] && /usr/lib/gforge/bin/calculate_user_metric.php -d include_path=/etc/gforge:/usr/share/gforge/:/usr/share/gforge/www/include > /dev/null 2>&1
45 0 * * * gforge [ -x /usr/lib/gforge/bin/db_stats_agg.php ] && /usr/lib/gforge/bin/db_stats_agg.php -d include_path=/etc/gforge:/usr/share/gforge/:/usr/share/gforge/www/include > /dev/null 2>&1
# Hourly sending of mass e-mailings
-48 * * * * gforge [ -x /usr/lib/gforge/bin/massmail.php ] && /usr/lib/gforge/bin/massmail.php -d include_path=/etc/gforge:/usr/share/gforge/:/usr/share/gforge/www/include > /dev/null 2>&1
+48 * * * * root [ -x /usr/lib/gforge/bin/massmail.php ] && /usr/lib/gforge/bin/massmail.php -d include_path=/etc/gforge:/usr/share/gforge/:/usr/share/gforge/www/include > /dev/null 2>&1
# Weekly db vacuum
50 2 * * Mon gforge [ -x /usr/lib/gforge/bin/vacuum.php ] && /usr/lib/gforge/bin/vacuum.php -d include_path=/etc/gforge:/usr/share/gforge/:/usr/share/gforge/www/include > /dev/null 2>&1
# Daily mail for not approved news
30 17 * * * root [ -x /usr/lib/gforge/bin/get_news_notapproved.pl ] && /usr/lib/gforge/bin/get_news_notapproved.pl -d include_path=/etc/gforge:/usr/share/gforge/:/usr/share/gforge/www/include > /dev/null 2>&1
+
+# Daily incremental backup to /backup
+# we have to discuss this
+#15 23 * * * root [ -x /usr/lib/gforge/bin/gforge-db-backup.sh ] && /usr/lib/gforge/bin/gforge-db-backup.sh > /dev/null 2>&1
# FTP update
0 * * * * root [ -x /usr/lib/gforge/bin/install-ftp.sh ] && /usr/lib/gforge/bin/install-ftp.sh update > /dev/null 2>&1
+
+# create and mount project directory in user's home directory
+# added by fabio bertagnin nov 2005
+0 * * * * root [ -x /usr/lib/gforge/bin/ftp_create_group_access.php ] && /usr/bin/php4 -d include_path=/etc/gforge:/usr/share/gforge/:/usr/share/gforge/www/include /usr/lib/gforge/bin/ftp_create_group_access.php > /dev/null 2>&1
\ No newline at end of file
usr/share/gforge/www/include
usr/sbin
var/lib/gforge/www/plugins
+var/lib/gforge/www/plugins/webcalendar/www/includes
var/lib/gforge/etc
var/lib/gforge/etc/templates
bin
chown www-data:www-data $(CURDIR)/debian/gforge-plugins/var/lib/gforge/www/plugins
chmod 755 $(CURDIR)/debian/gforge-plugins/usr/share/gforge/plugins/*/sbin/*
chmod 755 $(CURDIR)/debian/gforge-plugins/usr/share/gforge/plugins/*/bin/*
+ rm -f $(CURDIR)/debian/gforge-plugins/usr/share/gforge/plugins/*/COPYING
# mediawiki plugin
cp -r $(CURDIR)/debian/gforge-plugins/usr/share/gforge/plugins/mediawiki/usr $(CURDIR)/debian/gforge-plugins/
rm -rf $(CURDIR)/debian/gforge-plugins/usr/share/gforge/plugins/mediawiki/usr
# scmsvn plugin
install -m 755 deb-specific/install-svn.sh $(CURDIR)/debian/gforge-plugins/usr/lib/gforge/bin/
cp -r deb-specific/scmsvn/cronjobs/* $(CURDIR)/debian/gforge-plugins/usr/share/gforge/plugins/scmsvn/cronjobs
+ # cvstracker plugin
+ chmod +x $(CURDIR)/debian/gforge-plugins/usr/share/gforge/plugins/svntracker/postcommit.example
+ # fckeditor plugin
+ chmod +x $(CURDIR)/debian/gforge-plugins/usr/share/gforge/plugins/fckeditor/www/editor/dialog/fck_spellerpages/spellerpages/server-scripts/spellchecker.pl
+ chmod +x $(CURDIR)/debian/gforge-plugins/usr/share/gforge/plugins/fckeditor/www/editor/filemanager/browser/mcpuk/connectors/php/Commands/helpers/*.cgi
+ # webcalendar plugin
+ mv $(CURDIR)/debian/gforge-plugins/usr/share/gforge/plugins/webcalendar/www/includes/settings.php \
+ $(CURDIR)/debian/gforge-plugins/var/lib/gforge/www/plugins/webcalendar/www/includes
+ chown www-data $(CURDIR)/debian/gforge-plugins/var/lib/gforge/www/plugins/webcalendar/www/includes/settings.php
+ chmod 600 $(CURDIR)/debian/gforge-plugins/var/lib/gforge/www/plugins/webcalendar/www/includes/settings.php
+ ln -s /var/lib/gforge/www/plugins/webcalendar/www/includes/settings.php \
+ $(CURDIR)/debian/gforge-plugins/usr/share/gforge/plugins/webcalendar/www/includes/settings.php
+ chmod +x $(CURDIR)/debian/gforge-plugins/usr/share/gforge/plugins/webcalendar/www/tools/*.pl
# gforge-common
install -m 644 etc/httpd.d/[0-9][0-9]* $(CURDIR)/debian/gforge-common/usr/share/gforge/etc/httpd.d/
find $(CURDIR)/debian/gforge-web-apache/usr/share/gforge/ -name CVS -type d | xargs rm -rf
find $(CURDIR)/debian/gforge-web-apache/usr/share/gforge/ -name .cvsignore | xargs rm -f
find $(CURDIR)/debian/gforge-web-apache -name \*.uu -type f | xargs rm -f
+ rm -f $(CURDIR)/debian/gforge-web-apache/usr/share/gforge/www/themes/gforge/COPYING
find $(CURDIR)/debian/gforge-web-apache/usr/share/gforge/www -type d -exec chmod 0755 {} \;
find $(CURDIR)/debian/gforge-web-apache/usr/share/gforge/www -type f -exec chmod 0644 {} \;
find $(CURDIR)/debian/gforge-web-apache/usr/share/gforge/www -name '*.py' -exec chmod 0755 {} \;
install -m 644 cronjobs/stats_site.inc $(CURDIR)/debian/gforge-db-postgresql/usr/share/gforge/cronjobs/
install -m 644 cronjobs/stats_projects.inc $(CURDIR)/debian/gforge-db-postgresql/usr/share/gforge/cronjobs/
#
+ install -m 755 cronjobs/reporting_cron.php $(CURDIR)/debian/gforge-db-postgresql/usr/lib/gforge/bin/
+ #
install -m 755 cronjobs/db_stats_agg.php $(CURDIR)/debian/gforge-db-postgresql/usr/lib/gforge/bin/
install -m 755 cronjobs/massmail.php $(CURDIR)/debian/gforge-db-postgresql/usr/lib/gforge/bin/
install -m 755 cronjobs/vacuum.php $(CURDIR)/debian/gforge-db-postgresql/usr/lib/gforge/bin/
+ install -m 755 cronjobs/gforge-db-backup.sh $(CURDIR)/debian/gforge-db-postgresql/usr/lib/gforge/bin/
+ #
+ install -m 755 cronjobs/ftp_create_group_access.php $(CURDIR)/debian/gforge-ftp-proftpd/usr/lib/gforge/bin/
+ #
install -m 755 deb-specific/stats_projects_logparse.pl $(CURDIR)/debian/gforge-db-postgresql/usr/lib/gforge/bin/
install -m 755 deb-specific/get_news_notapproved.pl $(CURDIR)/debian/gforge-db-postgresql/usr/lib/gforge/bin/
install -m 755 deb-specific/install-db.sh $(CURDIR)/debian/gforge-db-postgresql/usr/lib/gforge/bin/
// you will break the html_image function in include/html.php
//
$sys_urlroot='{sys_urlroot}';
+$sys_urlprefix='';
// Name of the system as a whole (needed by various utils and titles)
$sys_name='{system_name}';
*
*/
-require_once("www/plugins/fckeditor/fckeditor.php");
+require_once($GLOBALS['sys_plugins_path']."fckeditor/www/fckeditor.php");
class fckeditorPlugin extends Plugin {
function fckeditorPlugin () {
function isLoggedIn() {
return $this->is_logged_in;
}
+
+ function setUpTheme() {
+//
+// An optimization in session_getdata lets us pre-fetch this in most cases.....
+//
+ if (!$this->data_array['dirname']) {
+ $res=db_query("SELECT dirname FROM themes WHERE theme_id='".$this->getThemeID()."'");
+ $this->theme=db_result($res,0,'dirname');
+ } else {
+ $this->theme=$this->data_array['dirname'];
+ }
+ if (is_file($GLOBALS['sys_themeroot'].$this->theme.'/Theme.class')) {
+ $GLOBALS['sys_theme']=$this->theme;
+ } else {
+ $this->theme=$GLOBALS['sys_theme'];
+ }
+ return $this->theme;
+ }
}
// Local Variables:
*/
//library to determine browser settings
-//require_once('www/include/browser.php');
+require_once('www/include/browser.php');
//base error library for new objects
require_once('common/include/Error.class');
if (session_loggedin()) {
//set up the user's timezone if they are logged in
$LUSER =& session_get_user();
- //$LUSER->setUpTheme();
+ $LUSER->setUpTheme();
//header('Cache-Control: private');
$GLOBALS['G_USERNAME']=$GLOBALS['G_SESSION']->getUnixName();
}
<?php $this->html('headscripts') ?>
<!-- GFORGE Stylesheet BEGIN -->
- <?php
- /* check if a personalized css stylesheet exist, if yes include only
- this stylesheet
- new stylesheets should use the <themename>.css file
- */
- $theme_cssfile=$GLOBALS['sys_themeroot'].$GLOBALS['sys_theme'].'/css/'.$GLOBALS['sys_theme'].'.css';
- if (file_exists($theme_cssfile)){
- echo '
- <link rel="stylesheet" type="text/css" href="/themes/'.$GLOBALS['sys_theme'].'/css/'.$GLOBALS['sys_theme'].'.css"/>
- ';
- } else {
- /* if this is not our case, then include the compatibility stylesheet
- that contains all removed styles from the code and check if a
- custom stylesheet exists.
- Used for compatibility with existing stylesheets
- */
- ?>
- <link rel="stylesheet" type="text/css" href="/themes/css/gforge-compat.css" />
- <?php
- $theme_cssfile=$GLOBALS['sys_themeroot'].$GLOBALS['sys_theme'].'/css/theme.css';
- if (file_exists($theme_cssfile)){
- echo '
- <link rel="stylesheet" type="text/css" href="/themes/'.$GLOBALS['sys_theme'].'/css/theme.css" />
- ';
- }
- }
-?>
+ <?php $GLOBALS['HTML']->headerCSS(); ?>
<!-- GFORGE Stylesheet END -->
</head>
class="<?php $this->text('nsclass') ?> <?php $this->text('dir') ?>">
<!-- GFORGE BodyHeader BEGIN -->
-<table border="0" width="100%" cellspacing="0" cellpadding="0" id="headertable" >
- <tr>
- <td><a href="/"><?php echo html_image('logo.png',198,52,array('border'=>'0')); ?></a></td>
- <td><?php echo $GLOBALS['HTML']->searchBox(); ?></td>
- <td align="right"><?php
- global $Language;
- if (session_loggedin()) {
- ?>
- <a class="lnkutility" href="/account/logout.php?return_to=<?php echo $_SERVER['REQUEST_URI']; ?>"><?php echo $Language->getText('common','logout'); ?></a><br />
- <a class="lnkutility" href="/account/"><?php echo $Language->getText('common','myaccount'); ?></a>
- <?php
- } else {
- ?>
- <b><a class="lnkutility" href="/account/login.php?return_to=<?php echo $_SERVER['REQUEST_URI']; ?>"><?php echo $Language->getText('common','login'); ?></a></b><br />
- <b><a class="lnkutility" href="/account/register.php"><?php echo $Language->getText('common','newaccount'); ?></a></b>
- <?php
- }
- echo $GLOBALS['HTML']->quickNav();
-
- ?></td>
- <td> </td>
- </tr>
-
-</table>
-<table border="0" width="100%" cellspacing="0" cellpadding="0" >
- <tr>
- <td> </td>
- <td colspan="3">
- <?php echo $GLOBALS['HTML']->outerTabs($params); ?>
- </td>
- <td> </td>
- </tr>
- <tr>
- <td align="left" class="toptab" width="9"><img src="<?php echo $GLOBALS['HTML']->imgroot; ?>tabs/topleft.png" height="9" width="9" alt="" /></td>
- <td class="toptab" width="30"><img src="<?php echo $GLOBALS['HTML']->imgroot; ?>clear.png" width="30" height="1" alt="" /></td>
- <td class="toptab"><img src="<?php echo $GLOBALS['HTML']->imgroot; ?>clear.png" width="1" height="1" alt="" /></td>
- <td class="toptab" width="30"><img src="<?php echo $GLOBALS['HTML']->imgroot; ?>clear.png" width="30" height="1" alt="" /></td>
- <td align="right" class="toptab" width="9"><img src="<?php echo $GLOBALS['HTML']->imgroot; ?>tabs/topright.png" height="9" width="9" alt="" /></td>
- </tr>
- <tr>
- <!-- Outer body row -->
- <td class="toptab"><img src="<?php echo $GLOBALS['HTML']->imgroot; ?>clear.png" width="10" height="1" alt="" /></td>
- <td valign="top" width="99%" class="toptab" colspan="3">
- <!-- Inner Tabs / Shell -->
- <table border="0" width="100%" cellspacing="0" cellpadding="0">
- <?php if (isset($params['group']) && $params['group']) { ?>
- <tr>
- <td> </td>
- <td>
- <?php echo $GLOBALS['HTML']->projectTabs($params['toptab'],$params['group']); ?>
- </td>
- <td> </td>
- </tr>
- <?php } ?>
- <tr>
- <td align="left" class="projecttab" width="9"><img src="<?php echo $GLOBALS['HTML']->imgroot; ?>tabs/topleft-inner.png" height="9" width="9" alt="" /></td>
- <td class="projecttab" ><img src="<?php echo $GLOBALS['HTML']->imgroot; ?>clear.png" width="1" height="1" alt="" /></td>
- <td align="right" class="projecttab" width="9"><img src="<?php echo $GLOBALS['HTML']->imgroot; ?>tabs/topright-inner.png" height="9" width="9" alt="" /></td>
- </tr>
-
- <tr>
- <td class="projecttab" ><img src="<?php echo $GLOBALS['HTML']->imgroot; ?>clear.png" width="10" height="1" alt="" /></td>
- <td valign="top" width="99%" class="projecttab" >
+ <?php $GLOBALS['HTML']->bodyHeader($params); ?>
<!-- GFORGE BodyHeader END -->
<div id="globalWrapper">
--- /dev/null
+Fabien Regnier <fabien.regnier@sogeti.com>
+Julien Jeany <julien.jeany@sogeti.com>
--- /dev/null
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+ 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+\f
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+\f
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+\f
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+\f
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+\f
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) 19yy <name of author>
+
+ This program 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.
+
+ This program 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 this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+ Gnomovision version 69, Copyright (C) 19yy name of author
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+ <signature of Ty Coon>, 1 April 1989
+ Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs. If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library. If this is what you want to do, use the GNU Library General
+Public License instead of this License.
+
--- /dev/null
+#/**
+# *
+# * projects_hierarchy message catalog (English)
+# *
+# * GForge: Breaking Down the Barriers to Open Source Development
+# * Copyright 1999-2001 (c) VA Linux Systems
+# * 2005 (c) Daniel Pérez <danielperez.arg@gmail.com>
+# * http://sourceforge.net
+# * Here you can add your own language customizations
+# *
+# *
+# */
+user_home view_projects_hierarchy View Personal projects_hierarchy
+project_admin projects_hierarchy View the projects_hierarchy Administration
+project_admin link Link Type
+project_admin del Delete
+project_admin allow Authorize
+project_admin wait Waiting
+project_admin share Share
+project_admin navi Navigation
+project_admin add_link Add a link
+project_admin validation_wait Father waiting for validation
+project_admin hierarchy Modify the hierarchy
+project_admin save_son Add son project
+project_admin alert_del Do you really want to delete this link ?
+project_admin father Project's parent
+project_admin alert_allow Do you really want to authorize this project ?
+project_admin display_link Link list
+project_admin share_link Share link
+project_admin navi_link Navigation link
+project_admin com_father Commentary of father :
+project_admin com Commentary :
+project_admin choice_project Select a project :
+project_tree cat By Category
+project_tree tree By hierarchy
+project_tree tree_project Project Tree
+project_home project_father Parent project
+project_home project_son Child project
+project_home hierarchy_title Linked projects
+project_home hierarchy_no No linked project avalaible
+project_home link Links
--- /dev/null
+#/**
+# *
+# * projects_hierarchy message catalog (English)
+# *
+# * GForge: Breaking Down the Barriers to Open Source Development
+# * Copyright 1999-2001 (c) VA Linux Systems
+# * 2005 (c) Daniel Pérez <danielperez.arg@gmail.com>
+# * http://sourceforge.net
+# * Here you can add your own language customizations
+# *
+# *
+# */
+user_home view_projects_hierarchy View Personal projects_hierarchy
+project_admin projects_hierarchy View the projects_hierarchy Administration
+project_admin link Type de lien
+project_admin del Supprimer
+project_admin allow Autoriser
+project_admin wait En attente
+project_admin share Partagé
+project_admin navi Navigation
+project_admin add_link Ajouter un lien
+project_admin validation_wait Père en attente de validation
+project_admin hierarchy Modifier la Hiérarchie
+project_admin save_son Ajouter un fils
+project_admin alert_del Etes vous sûr de vouloir supprimer le lien?
+project_admin father Parent du projet
+project_admin alert_allow Etes vous sûr de vouloir autoriser ce projet?
+project_admin display_link Liste des liens
+project_admin share_link Partage de ressources
+project_admin navi_link Lien de navigation
+project_admin com_father Commentaire du père :
+project_admin com Commentaire :
+project_admin choice_project Choix du projet :
+project_tree cat Par catégorie
+project_tree tree Par hiérarchie
+project_tree tree_project Arbre des projets
+project_home project_father Projet père
+project_home project_son Projet fils
+project_home hierarchy_title Les projets liés
+project_home hierarchy_no Pas de projets liés
+project_home link Liens
--- /dev/null
+<?php
+
+/**
+ *
+ * This file is part of GForge.
+ *
+ * GForge 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.
+ *
+ * GForge 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 GForge; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+require_once ('projects_hierarchyPlugin.class') ;
+
+$projects_hierarchyPluginObject = new projects_hierarchyPlugin ;
+
+register_plugin ($projects_hierarchyPluginObject) ;
+
+// Local Variables:
+// mode: php
+// c-file-style: "bsd"
+// End:
+
+?>
--- /dev/null
+<?php
+
+/**
+ * projects_hierarchyPlugin Class
+ *
+ *
+ * This file is part of GForge.
+ *
+ * GForge 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.
+ *
+ * GForge 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 GForge; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+class projects_hierarchyPlugin extends Plugin {
+ function projects_hierarchyPlugin () {
+ $this->Plugin() ;
+ $this->name = "projects_hierarchy" ;
+ $this->text = "projects_hierarchy!" ; // To show in the tabs, use...
+ $this->hooks[] = "user_personal_links";//to make a link to the user´s personal part of the plugin
+ $this->hooks[] = "usermenu" ;
+ $this->hooks[] = "groupmenu" ; // To put into the project tabs
+ $this->hooks[] = "groupisactivecheckbox" ; // The "use ..." checkbox in editgroupinfo
+ $this->hooks[] = "groupisactivecheckboxpost" ; //
+ $this->hooks[] = "userisactivecheckbox" ; // The "use ..." checkbox in user account
+ $this->hooks[] = "userisactivecheckboxpost" ; //
+ $this->hooks[] = "project_admin_plugins"; // to show up in the admin page fro group
+ $this->hooks[] = "admin_project_link"; // to add son to a project
+ $this->hooks[] = "project_home_link"; // to see father and sons in project home
+ $this->hooks[] = "tree"; // to see the tree of projects
+ $this->hooks[] = "delete_link"; // to delete link
+ }
+
+ function CallHook ($hookname, $params) {
+ global $use_projects_hierarchyplugin,$G_SESSION,$HTML,$Language;
+ $group_id=$params['group'];
+ if ($hookname == "usermenu") {
+ $text = $this->text; // this is what shows in the tab
+ if ($G_SESSION->usesPlugin("projects_hierarchy")) {
+ $param = '?type=user&id=' . $G_SESSION->getId() . "&pluginname=" . $this->name; // we indicate the part we´re calling is the user one
+ echo ' | ' . $HTML->PrintSubMenu (array ($text),
+ array ('/plugins/projects_hierarchy/index.php' . $param ));
+ }
+ } elseif ($hookname == "groupmenu") {
+ $project = &group_get_object($group_id);
+ if (!$project || !is_object($project)) {
+ return;
+ }
+ if ($project->isError()) {
+ return;
+ }
+ if (!$project->isProject()) {
+ return;
+ }
+ if ( $project->usesPlugin ( $this->name ) ) {
+ $params['TITLES'][]=$this->text;
+ $params['DIRS'][]='/plugins/projects_hierarchy/index.php?type=group&id=' . $group_id . "&pluginname=" . $this->name; // we indicate the part we´re calling is the project one
+ } else {
+ //$params['TITLES'][]=$this->text." is [Off]";
+ }
+ (($params['toptab'] == $this->name) ? $params['selected']=(count($params['TITLES'])-1) : '' );
+ } elseif ($hookname == "groupisactivecheckbox") {
+ //Check if the group is active
+ } elseif ($hookname == "groupisactivecheckboxpost") {
+ // this code actually activates/deactivates the plugin after the form was submitted in the project edit public info page
+ $group = &group_get_object($group_id);
+ $use_projects_hierarchyplugin = getStringFromRequest('use_projects_hierarchyplugin');
+ if ( $use_projects_hierarchyplugin == 1 ) {
+ $group->setPluginUse ( $this->name );
+ } else {
+ $group->setPluginUse ( $this->name, false );
+ }
+ } elseif ($hookname == "userisactivecheckbox") {
+ //check if user is active
+ // this code creates the checkbox in the user account manteinance page to activate/deactivate the plugin
+ } elseif ($hookname == "userisactivecheckboxpost") {
+ // this code actually activates/deactivates the plugin after the form was submitted in the user account manteinance page
+ $user = $params['user'];
+ $use_projects_hierarchyplugin = getStringFromRequest('use_projects_hierarchyplugin');
+ if ( $use_projects_hierarchyplugin == 1 ) {
+ $user->setPluginUse ( $this->name );
+ } else {
+ $user->setPluginUse ( $this->name, false );
+ }
+ echo "<tr>";
+ echo "<td>";
+ echo ' <input type="CHECKBOX" name="use_projects_hierarchyplugin" value="1" ';
+ // CHECKED OR UNCHECKED?
+ if ( $user->usesPlugin ( $this->name ) ) {
+ echo "CHECKED";
+ }
+ echo "> Use ".$this->text." Plugin";
+ echo "</td>";
+ echo "</tr>";
+ } elseif ($hookname == "user_personal_links") {
+ global $Language;
+ // this displays the link in the user´s profile page to it´s personal projects_hierarchy (if you want other sto access it, youll have to change the permissions in the index.php
+ $userid = $params['user_id'];
+ $user = user_get_object($userid);
+ $text = $params['text'];
+ //check if the user has the plugin activated
+ if ($user->usesPlugin($this->name)) {
+ echo ' <p>
+ <a href="/plugins/projects_hierarchy/index.php?id=' . $userid . '&type=user&pluginname=' . $this->name . '">' . $Language->getText('user_home','view_projects_hierarchy') .'</a></p>';
+ }
+ } elseif ($hookname == "project_admin_plugins") {
+ global $Language;
+ // this displays the link in the project admin options page to it´s projects_hierarchy administration
+ $group_id = $params['group_id'];
+ $group = &group_get_object($group_id);
+ if ( $group->usesPlugin ( $this->name ) ) {
+ echo '<a href="/plugins/projects_hierarchy/index.php?id=' . $group->getID() . '&type=admin&pluginname=' . $this->name . '">' . $Language->getText('project_admin','projects_hierarchy') . '</a><br />';
+ }
+ }
+ elseif ($hookname == "tree") {
+
+ header('Location: ../plugins/projects_hierarchy/softwaremap.php');
+
+ }
+ elseif ($hookname == "project_home_link") {
+ // ############################## Display link
+ $group_id = $params;
+ echo $HTML->boxTop($Language->getText('project_home','hierarchy_title'));
+ $cpt_project = 0 ;
+ // father request
+ $query = "SELECT DISTINCT group_id,unix_group_name,group_name FROM groups,plugin_projects_hierarchy WHERE plugin_projects_hierarchy.link_type ='shar' AND plugin_projects_hierarchy.activated='t' AND groups.group_id=plugin_projects_hierarchy.project_id AND plugin_projects_hierarchy.sub_project_id=".$group_id;
+ $res = db_query($query);
+ echo db_error();
+ while ($row = db_fetch_array($res)) {
+ echo "<img src=\"themes/gforge/images/ic/forum20g.png\" border=\"0\"> ".$Language->getText('project_home','project_father').": <a href=\"/projects/".$row['unix_group_name']."\">" . $row['group_name'] . "</a><br/>";
+ $cpt_project ++;
+ }
+
+ if($cpt_project != 0){
+ print '<hr size="1" />';
+ }
+ $cpt_temp = $cpt_project ;
+ // sons request
+ $query = "SELECT DISTINCT group_id,unix_group_name,group_name,com FROM groups,plugin_projects_hierarchy WHERE plugin_projects_hierarchy.link_type ='shar' AND plugin_projects_hierarchy.activated='t' AND groups.group_id=plugin_projects_hierarchy.sub_project_id AND plugin_projects_hierarchy.project_id=".$group_id;
+ $res = db_query($query);
+ echo db_error();
+ while ($row = db_fetch_array($res)) {
+ echo "<img src=\"themes/gforge/images/ic/forum20g.png\" border=\"0\"> ".$Language->getText('project_home','project_son')." : <a href=\"/projects/".$row['unix_group_name']."\">" . $row['group_name'] . "</a> : ".$row['com']."<br/>";
+ $cpt_project ++;
+ }
+
+
+ if($cpt_project != $cpt_temp){
+ print '<hr size="1" />';
+ }
+ $cpt_temp = $cpt_project ;
+
+ // links if project is father
+ $query = "SELECT DISTINCT group_id,unix_group_name,group_name,com FROM groups,plugin_projects_hierarchy WHERE plugin_projects_hierarchy.link_type ='navi' AND plugin_projects_hierarchy.activated='t' AND groups.group_id=plugin_projects_hierarchy.sub_project_id AND plugin_projects_hierarchy.project_id=".$group_id;
+ $res = db_query($query);
+ echo db_error();
+ while ($row = db_fetch_array($res)) {
+ echo "<img src=\"themes/gforge/images/ic/forum20g.png\" border=\"0\"> ".$Language->getText('project_home','link')." : <a href=\"/projects/".$row['unix_group_name']."\">" . $row['group_name'] . "</a> : ".$row['com']."<br/>";
+ $cpt_project ++;
+ }
+ // links if project is son
+ $query = "SELECT DISTINCT group_id,unix_group_name,group_name,com FROM groups,plugin_projects_hierarchy WHERE plugin_projects_hierarchy.link_type ='navi' AND plugin_projects_hierarchy.activated='t' AND groups.group_id=plugin_projects_hierarchy.project_id AND plugin_projects_hierarchy.sub_project_id=".$group_id;
+ $res = db_query($query);
+ echo db_error();
+ while ($row = db_fetch_array($res)) {
+ echo "<img src=\"themes/gforge/images/ic/forum20g.png\" border=\"0\"> ".$Language->getText('project_home','link')." : <a href=\"/projects/".$row['unix_group_name']."\">" . $row['group_name'] . "</a><br/>";
+ $cpt_project ++;
+ }
+
+
+
+ if($cpt_project != $cpt_temp){
+ print '<hr size="1" />';
+ }
+
+ if($cpt_project == 0){
+ echo $Language->getText('project_home','hierarchy_no');
+ print '<hr size="1" />';
+ }
+
+ echo $HTML->boxBottom();
+
+ }
+ elseif ($hookname == "admin_project_link") {
+ //modif pour hierarchie par Fabien le 10/10/06
+ //add files add_son.php, del_father.php,del_son.php,wait_son.php and hierarchy_utils.php
+
+ include('../../plugins/projects_hierarchy/hierarchy_utils.php');
+ $group_id = $params ;
+ echo $HTML->boxMiddle($Language->getText('project_admin','hierarchy'));
+ echo '<form action="../../plugins/projects_hierarchy/add_son.php?group_id='.$group_id.'" method="POST" name="formson">';
+ //include('hierarchy_utils.php');
+ //select box of sons
+ echo '<table><tr>';
+ echo '<td>'.$Language->getText('project_admin','choice_project').'</td><td>'.son_box($group_id,'sub_project_id','0').'</td><td> </td>' ;
+ echo '</tr><tr>' ;
+ echo '<td>'.$Language->getText('project_admin','com').'</td><td> <input type="text" size="50" value="" name="com"></td>' ;
+ //echo type_son_box();
+ echo '<td><input type="submit" name="son" value="'.$Language->getText('project_admin','save_son').'"></td></tr></table></form>';
+ echo '<br/>';
+ echo '<form action="../../plugins/projects_hierarchy/add_link.php?group_id='.$group_id.'" method="POST" name="formlink">';
+ //include('hierarchy_utils.php');
+ //select box of sons
+ echo '<table><tr>';
+ echo '<td>'.$Language->getText('project_admin','choice_project').'</td><td>'.link_box($group_id,'sub_project_id','0').'</td><td> </td>';
+ echo '</tr><tr>' ;
+ echo '<td>'.$Language->getText('project_admin','com').'</td><td><input type="text" size="50" value="" name="com"></td>' ;
+ echo '<td><input type="submit" name="son" value="'.$Language->getText('project_admin','add_link').'"></td></tr></table></form>';
+ echo '<br/>';
+ //select all the sons of the current project
+ $sql_son = "SELECT group_id,group_name,unix_group_name,sub_project_id, activated,link_type,com FROM groups,plugin_projects_hierarchy WHERE " .
+ " ( groups.group_id = plugin_projects_hierarchy.sub_project_id " .
+ "AND plugin_projects_hierarchy.project_id = ".$group_id.")" ;
+
+
+ $res_son=db_query($sql_son)or die(db_error());
+ if (!$res_son || db_numrows($res_son) < 1) {
+
+ }
+ else {
+ //display of sons
+ $cpt_son = 1 ;
+ echo $Language->getText('project_admin','display_link');
+ echo '<table>';
+ $i = 0;
+ while($row_son = db_fetch_array($res_son)){
+ $i++;
+ echo '<tr>';
+ echo '<td>';
+ //link to the project
+ echo "<a href=\"../../projects/".$row_son['unix_group_name']."\">".$row_son['group_name']."</a>";
+ echo '</td>';
+
+ echo '<td>';
+ if($row_son[link_type] == 'navi'){
+ echo $Language->getText('project_admin','navi_link');
+ }
+ else {
+ echo $Language->getText('project_admin','share_link');
+ }
+ echo '</td>';
+
+ echo '<td>';
+ if($row_son[activated] == 'f'){
+ echo $Language->getText('project_admin','wait');
+ }
+ else {
+ print "<b>".$Language->getText('project_admin','allow')."</b>";
+ }
+ echo '</td>';
+ echo "<td><a href='#' onclick='if(confirm(\"".$Language->getText('project_admin','alert_del')."\")){window.location.href=\"../../plugins/projects_hierarchy/del_son.php?group_id=".$group_id."&sub_group_id=".$row_son['sub_project_id']."\"}'}>".$Language->getText('project_admin','del')."</a></td>";
+ echo "<tr><td colspan='4'>".$Language->getText('project_admin','com')." <i>".$row_son[com]."</i>";
+ echo '</td></tr>';
+ }
+
+ }
+ //select navigation link by father
+ $sql_son = "SELECT group_id,group_name,unix_group_name,project_id, activated,link_type,com FROM groups,plugin_projects_hierarchy WHERE " .
+ " ( groups.group_id = plugin_projects_hierarchy.project_id " .
+ "AND plugin_projects_hierarchy.sub_project_id = ".$group_id." AND plugin_projects_hierarchy.link_type = 'navi') ";
+
+ $res_son=db_query($sql_son)or die(db_error());
+ if (!$res_son || db_numrows($res_son) < 1) {
+ if($cpt_son == 1 ){
+ echo '</table>';
+ }
+ }
+ else {
+ //display of sons
+ if($cpt_son != 1 ){
+ echo $Language->getText('project_admin','display_link');
+ echo '<table>';
+ }
+
+ $i = 0;
+ while($row_son = db_fetch_array($res_son)){
+ $i++;
+ echo '<tr>';
+ echo '<td>';
+ //link to the project
+ echo "<a href=\"../../projects/".$row_son['unix_group_name']."\">".$row_son['group_name']."</a>";
+ echo '</td>';
+
+ echo '<td>';
+ if($row_son[link_type] == 'navi'){
+ echo $Language->getText('project_admin','navi_link');
+ }
+ else {
+ echo $Language->getText('project_admin','share_link');
+ }
+ echo '</td>';
+
+ echo '<td>';
+ if($row_son[activated] == 'f'){
+ //echo $Language->getText('project_admin','wait');
+ echo "<td><a href='#' onclick='if(confirm(\"".$Language->getText('project_admin','alert_allow')."\")){window.location.href=\"../../plugins/projects_hierarchy/wait_son.php?sub_group_id=".$group_id."&group_id=".$row_son['project_id']."\"}'}>".$Language->getText('project_admin','allow')."</a></td>";
+ }
+ else {
+ print "<b>".$Language->getText('project_admin','allow')."</b>";
+ }
+ echo '</td>';
+ echo "<td><a href='#' onclick='if(confirm(\"".$Language->getText('project_admin','alert_del')."\")){window.location.href=\"../../plugins/projects_hierarchy/del_father.php?group_id=".$row_son['project_id']."&sub_group_id=".$group_id."\"}'}>".$Language->getText('project_admin','del')."</a></td>";
+ echo "<tr><td colspan='4'>".$Language->getText('project_admin','com_father')." <i>".$row_son['com']."</i></td>";
+ echo '</tr>';
+ }
+ echo '</table>';
+ }
+
+ //research allowing father
+ $sql_father = "SELECT group_id,group_name,unix_group_name,project_id,com FROM groups,plugin_projects_hierarchy WHERE " .
+ " groups.group_id = plugin_projects_hierarchy.project_id " .
+ "AND plugin_projects_hierarchy.sub_project_id = ".$group_id."".
+ " AND plugin_projects_hierarchy.activated = true AND plugin_projects_hierarchy.link_type = 'shar'";
+ //print $sql_wait;
+ $res_father=db_query($sql_father)or die(db_error());
+ if (!$res_father || db_numrows($res_father) < 1) {
+
+ }
+ else {
+ //display of the father of the current project
+ echo '<table><tr><td colspan=\"2\">';
+ echo $Language->getText('project_admin','father');
+ echo '</td></tr>';
+ while ($row_father = db_fetch_array($res_father)) {
+ echo '<tr>';
+ echo '<td>';
+ echo "<a href=\"../../projects/".$row_father['unix_group_name']."\">".$row_father['group_name']."</a>";
+ echo '</td><td>';
+ echo "<td><a href='#' onclick='if(confirm(\"".$Language->getText('project_admin','alert_del')."\")){window.location.href=\"../../plugins/projects_hierarchy/del_father.php?sub_group_id=".$group_id."&group_id=".$row_father['group_id']."\"}'}>".$Language->getText('project_admin','del')."</a></td>";
+ echo '</td></tr>';
+ }
+ echo '</table>';
+ }
+
+
+ //research waiting fathers
+ $sql_wait = "SELECT group_id,group_name,unix_group_name,project_id,link_type,com FROM groups,plugin_projects_hierarchy WHERE " .
+ " groups.group_id = plugin_projects_hierarchy.project_id " .
+ "AND plugin_projects_hierarchy.sub_project_id = ".$group_id."".
+ " AND plugin_projects_hierarchy.activated = false AND plugin_projects_hierarchy.link_type = 'shar'";
+ //print $sql_wait;
+ $res_wait=db_query($sql_wait)or die(db_error());
+ if (!$res_wait || db_numrows($res_wait) < 1) {
+
+ }
+ else {
+ //display of waiting fathers
+ echo '<table><tr><td colspan=\"2\">';
+ echo $Language->getText('project_admin','validation_wait');
+ echo '</td></tr>';
+ while ($row_wait = db_fetch_array($res_wait)) {
+ echo '<tr>';
+ echo '<td>';
+ echo "<a href=\"../../projects/".$row_wait[unix_group_name]."\">".$row_wait[group_name]."</a>";
+ echo '</td>';
+ echo'<td>';
+ echo "<td><a href='#' onclick='if(confirm(\"".$Language->getText('project_admin','alert_allow')."\")){window.location.href=\"../../plugins/projects_hierarchy/wait_son.php?sub_group_id=".$group_id."&group_id=".$row_wait[group_id]."\"}'}>".$Language->getText('project_admin','allow')."</a></td>";
+ echo '</td><td>';
+ echo "<td><a href='#' onclick='if(confirm(\"".$Language->getText('project_admin','alert_del')."\")){window.location.href=\"../../plugins/projects_hierarchy/del_father.php?sub_group_id=".$group_id."&group_id=".$row_wait[group_id]."\"}'}>".$Language->getText('project_admin','del')."</a></td>";
+ echo "</td><tr><td colspan='3'>".$Language->getText('project_admin','com_father')." <i>".$row_wait[com]."</i>";
+ echo '</td></tr>';
+ }
+ echo '</table>';
+ }
+
+
+ }
+ elseif ($hookname == "delete_link") {
+
+ $sql = "DELETE FROM plugin_projects_hierarchy WHERE project_id = ".$params." OR sub_project_id = ".$params." ";
+ $res_son=db_query($sql);
+ }
+
+ }
+}
+
+// Local Variables:
+// mode: php
+// c-file-style: "bsd"
+// End:
+
+?>
--- /dev/null
+CREATE TABLE plugin_projects_hierarchy (
+ project_id integer DEFAULT 0 NOT NULL,
+ sub_project_id integer DEFAULT 0 NOT NULL,
+ link_type char(4) DEFAULT 'navi' NOT NULL,
+ activated boolean DEFAULT false NOT NULL,
+ com char(255) NOT NULL
+ );
+
+INSERT INTO plugins (plugin_name,plugin_desc) VALUES ('hierarchy','Hierarchy GForge Plugin');
\ No newline at end of file
--- /dev/null
+<?php\r
+/**\r
+ * Role Editing Page\r
+ *\r
+ * Copyright 2004 (c) GForge LLC\r
+ *\r
+ * @version $Id: add_son.php,v 1.0 2006/10/10 15:00:00 fregnier Exp $\r
+ * @author Fabien Regnier fabien.regnier@sogeti.com\r
+ * @date 2006-10-10\r
+ *\r
+ * This file is part of GForge.\r
+ *\r
+ * GForge is free software; you can redistribute it and/or modify\r
+ * it under the terms of the GNU General Public License as published by\r
+ * the Free Software Foundation; either version 2 of the License, or\r
+ * (at your option) any later version.\r
+ *\r
+ * GForge is distributed in the hope that it will be useful,\r
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
+ * GNU General Public License for more details.\r
+ *\r
+ * You should have received a copy of the GNU General Public License\r
+ * along with GForge; if not, write to the Free Software\r
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
+ */\r
+\r
+require_once('pre.php');\r
+session_require(array('group'=>$group_id,'admin_flags'=>'A'));\r
+//add link between two projects\r
+$sql = "INSERT INTO plugin_projects_hierarchy (project_id ,sub_project_id,link_type,com) VALUES ('".$_GET['group_id']."' , '".$_POST['sub_project_id']."', 'navi','".$_POST['com']."')";\r
+//print "<br>".$sql;\r
+db_begin();\r
+$test = db_query($sql) or die(db_error());\r
+db_commit();\r
+\r
+\r
+?>\r
+<script>\r
+//back to the administration \r
+window.location.href = "/project/admin/index.php?group_id=<?php print $_GET['group_id'] ?>";\r
+</script>\r
--- /dev/null
+<?php\r
+/**\r
+ * Role Editing Page\r
+ *\r
+ * Copyright 2004 (c) GForge LLC\r
+ *\r
+ * @version $Id: add_son.php,v 1.0 2006/10/10 15:00:00 fregnier Exp $\r
+ * @author Fabien Regnier fabien.regnier@sogeti.com\r
+ * @date 2006-10-10\r
+ *\r
+ * This file is part of GForge.\r
+ *\r
+ * GForge is free software; you can redistribute it and/or modify\r
+ * it under the terms of the GNU General Public License as published by\r
+ * the Free Software Foundation; either version 2 of the License, or\r
+ * (at your option) any later version.\r
+ *\r
+ * GForge is distributed in the hope that it will be useful,\r
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
+ * GNU General Public License for more details.\r
+ *\r
+ * You should have received a copy of the GNU General Public License\r
+ * along with GForge; if not, write to the Free Software\r
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
+ */\r
+\r
+require_once('pre.php');\r
+session_require(array('group'=>$group_id,'admin_flags'=>'A'));\r
+//add link between two projects\r
+$sql = "INSERT INTO plugin_projects_hierarchy (project_id ,sub_project_id,link_type,com) VALUES ('".$_GET['group_id']."' , '".$_POST['sub_project_id']."', 'shar','".$_POST['com']."')";\r
+//print "<br>".$sql;\r
+db_begin();\r
+$test = db_query($sql) or die(db_error());\r
+db_commit();\r
+\r
+\r
+?>\r
+<script>\r
+//back to the administration \r
+window.location.href = "/project/admin/index.php?group_id=<?php print $_GET['group_id'] ?>";\r
+</script>\r
--- /dev/null
+<?php\r
+/**\r
+ * Role Editing Page\r
+ *\r
+ * Copyright 2004 (c) GForge LLC\r
+ *\r
+ * @version $Id: del_father.php,v 1.0 2006/10/10 15:00:00 fregnier Exp $\r
+ * @author Fabien Regnier fabien.regnier@sogeti.com\r
+ * @date 2006-10-10\r
+ *\r
+ * This file is part of GForge.\r
+ *\r
+ * GForge is free software; you can redistribute it and/or modify\r
+ * it under the terms of the GNU General Public License as published by\r
+ * the Free Software Foundation; either version 2 of the License, or\r
+ * (at your option) any later version.\r
+ *\r
+ * GForge is distributed in the hope that it will be useful,\r
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
+ * GNU General Public License for more details.\r
+ *\r
+ * You should have received a copy of the GNU General Public License\r
+ * along with GForge; if not, write to the Free Software\r
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
+ */\r
+\r
+require_once('pre.php');\r
+session_require(array('group'=>$group_id,'admin_flags'=>'A'));\r
+//plugin webcal\r
+$params[0] = $_GET['sub_group_id'] ;\r
+$params[1] = $_GET['group_id'] ;\r
+plugin_hook('del_cal_link_father',$params);\r
+//del link between two projects\r
+$sql = "DELETE FROM plugin_projects_hierarchy WHERE project_id = '".$_GET['group_id']."' AND sub_project_id = '".$_GET['sub_group_id']."'";\r
+//print "<br>".$sql;\r
+db_begin();\r
+$test = db_query($sql) or die(db_error());\r
+db_commit();\r
+\r
+?>\r
+<script>\r
+//back to the admin's page (son)\r
+window.location.href = "/project/admin/index.php?group_id=<?php print $_GET['sub_group_id'] ?>";\r
+</script>\r
--- /dev/null
+<?php\r
+/**\r
+ * Role Editing Page\r
+ *\r
+ * Copyright 2004 (c) GForge LLC\r
+ *\r
+ * @version $Id: del_son.php,v 1.0 2006/10/10 15:00:00 fregnier Exp $\r
+ * @author Fabien Regnier fabien.regnier@sogeti.com\r
+ * @date 2006-10-10\r
+ *\r
+ * This file is part of GForge.\r
+ *\r
+ * GForge is free software; you can redistribute it and/or modify\r
+ * it under the terms of the GNU General Public License as published by\r
+ * the Free Software Foundation; either version 2 of the License, or\r
+ * (at your option) any later version.\r
+ *\r
+ * GForge is distributed in the hope that it will be useful,\r
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
+ * GNU General Public License for more details.\r
+ *\r
+ * You should have received a copy of the GNU General Public License\r
+ * along with GForge; if not, write to the Free Software\r
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
+ */\r
+\r
+require_once('pre.php');\r
+session_require(array('group'=>$group_id,'admin_flags'=>'A'));\r
+//plugin webcal\r
+$params[0] = $_GET['sub_group_id'] ;\r
+$params[1] = $_GET['group_id'] ;\r
+plugin_hook('del_cal_link_father',$params);\r
+//del link between two projects\r
+$sql = "DELETE FROM plugin_projects_hierarchy WHERE project_id = '".$_GET['group_id']."' AND sub_project_id = '".$_GET['sub_group_id']."'";\r
+//print "<br>".$sql;\r
+db_begin();\r
+$test = db_query($sql) or die(db_error());\r
+db_commit();\r
+\r
+?>\r
+<script>\r
+//back to the administration (father)\r
+window.location.href = "/project/admin/index.php?group_id=<?php print $_GET['group_id'] ?>";\r
+</script>\r
--- /dev/null
+/*--------------------------------------------------|\r
+| dTree 2.05 | www.destroydrop.com/javascript/tree/ |\r
+|---------------------------------------------------|\r
+| Copyright (c) 2002-2003 Geir Landrö |\r
+|--------------------------------------------------*/\r
+\r
+.dtree {\r
+ font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;\r
+ font-size: 11px;\r
+ color: #666;\r
+ white-space: nowrap;\r
+}\r
+.dtree img {\r
+ border: 0px;\r
+ vertical-align: middle;\r
+}\r
+.dtree a {\r
+ color: #333;\r
+ text-decoration: none;\r
+}\r
+.dtree a.node, .dtree a.nodeSel {\r
+ white-space: nowrap;\r
+ padding: 1px 2px 1px 2px;\r
+}\r
+.dtree a.node:hover, .dtree a.nodeSel:hover {\r
+ color: #333;\r
+ text-decoration: underline;\r
+}\r
+.dtree a.nodeSel {\r
+ background-color: #c0d2ec;\r
+}\r
+.dtree .clip {\r
+ overflow: hidden;\r
+}
\ No newline at end of file
--- /dev/null
+/*--------------------------------------------------|\r
+\r
+| dTree 2.05 | www.destroydrop.com/javascript/tree/ |\r
+\r
+|---------------------------------------------------|\r
+\r
+| Copyright (c) 2002-2003 Geir Landrö |\r
+\r
+| |\r
+\r
+| This script can be used freely as long as all |\r
+\r
+| copyright messages are intact. |\r
+\r
+| |\r
+\r
+| Updated: 17.04.2003 |\r
+\r
+|--------------------------------------------------*/\r
+\r
+\r
+\r
+// Node object\r
+\r
+function Node(id, pid, name, url, title, target, icon, iconOpen, open) {\r
+\r
+ this.id = id;\r
+\r
+ this.pid = pid;\r
+\r
+ this.name = name;\r
+\r
+ this.url = url;\r
+\r
+ this.title = title;\r
+\r
+ this.target = target;\r
+\r
+ this.icon = icon;\r
+\r
+ this.iconOpen = iconOpen;\r
+\r
+ this._io = open || false;\r
+\r
+ this._is = false;\r
+\r
+ this._ls = false;\r
+\r
+ this._hc = false;\r
+\r
+ this._ai = 0;\r
+\r
+ this._p;\r
+\r
+};\r
+\r
+\r
+\r
+// Tree object\r
+\r
+function dTree(objName) {\r
+\r
+ this.config = {\r
+\r
+ target : null,\r
+\r
+ folderLinks : true,\r
+\r
+ useSelection : true,\r
+\r
+ useCookies : true,\r
+\r
+ useLines : true,\r
+\r
+ useIcons : true,\r
+\r
+ useStatusText : false,\r
+\r
+ closeSameLevel : false,\r
+\r
+ inOrder : false\r
+\r
+ }\r
+\r
+ this.icon = {\r
+\r
+ root : 'img/base.gif',\r
+\r
+ folder : 'img/folder.gif',\r
+\r
+ folderOpen : 'img/folderopen.gif',\r
+\r
+ node : 'img/page.gif',\r
+\r
+ empty : 'img/empty.gif',\r
+\r
+ line : 'img/line.gif',\r
+\r
+ join : 'img/join.gif',\r
+\r
+ joinBottom : 'img/joinbottom.gif',\r
+\r
+ plus : 'img/plus.gif',\r
+\r
+ plusBottom : 'img/plusbottom.gif',\r
+\r
+ minus : 'img/minus.gif',\r
+\r
+ minusBottom : 'img/minusbottom.gif',\r
+\r
+ nlPlus : 'img/nolines_plus.gif',\r
+\r
+ nlMinus : 'img/nolines_minus.gif'\r
+\r
+ };\r
+\r
+ this.obj = objName;\r
+\r
+ this.aNodes = [];\r
+\r
+ this.aIndent = [];\r
+\r
+ this.root = new Node(-1);\r
+\r
+ this.selectedNode = null;\r
+\r
+ this.selectedFound = false;\r
+\r
+ this.completed = false;\r
+\r
+};\r
+\r
+\r
+\r
+// Adds a new node to the node array\r
+\r
+dTree.prototype.add = function(id, pid, name, url, title, target, icon, iconOpen, open) {\r
+\r
+ this.aNodes[this.aNodes.length] = new Node(id, pid, name, url, title, target, icon, iconOpen, open);\r
+\r
+};\r
+\r
+\r
+\r
+// Open/close all nodes\r
+\r
+dTree.prototype.openAll = function() {\r
+\r
+ this.oAll(true);\r
+\r
+};\r
+\r
+dTree.prototype.closeAll = function() {\r
+\r
+ this.oAll(false);\r
+\r
+};\r
+\r
+\r
+\r
+// Outputs the tree to the page\r
+\r
+dTree.prototype.toString = function() {\r
+\r
+ var str = '<div class="dtree">\n';\r
+\r
+ if (document.getElementById) {\r
+\r
+ if (this.config.useCookies) this.selectedNode = this.getSelected();\r
+\r
+ str += this.addNode(this.root);\r
+\r
+ } else str += 'Browser not supported.';\r
+\r
+ str += '</div>';\r
+\r
+ if (!this.selectedFound) this.selectedNode = null;\r
+\r
+ this.completed = true;\r
+\r
+ return str;\r
+\r
+};\r
+\r
+\r
+\r
+// Creates the tree structure\r
+\r
+dTree.prototype.addNode = function(pNode) {\r
+\r
+ var str = '';\r
+\r
+ var n=0;\r
+\r
+ if (this.config.inOrder) n = pNode._ai;\r
+\r
+ for (n; n<this.aNodes.length; n++) {\r
+\r
+ if (this.aNodes[n].pid == pNode.id) {\r
+\r
+ var cn = this.aNodes[n];\r
+\r
+ cn._p = pNode;\r
+\r
+ cn._ai = n;\r
+\r
+ this.setCS(cn);\r
+\r
+ if (!cn.target && this.config.target) cn.target = this.config.target;\r
+\r
+ if (cn._hc && !cn._io && this.config.useCookies) cn._io = this.isOpen(cn.id);\r
+\r
+ if (!this.config.folderLinks && cn._hc) cn.url = null;\r
+\r
+ if (this.config.useSelection && cn.id == this.selectedNode && !this.selectedFound) {\r
+\r
+ cn._is = true;\r
+\r
+ this.selectedNode = n;\r
+\r
+ this.selectedFound = true;\r
+\r
+ }\r
+\r
+ str += this.node(cn, n);\r
+\r
+ if (cn._ls) break;\r
+\r
+ }\r
+\r
+ }\r
+\r
+ return str;\r
+\r
+};\r
+\r
+\r
+\r
+// Creates the node icon, url and text\r
+\r
+dTree.prototype.node = function(node, nodeId) {\r
+\r
+ var str = '<div class="dTreeNode">' + this.indent(node, nodeId);\r
+\r
+ if (this.config.useIcons) {\r
+\r
+ if (!node.icon) node.icon = (this.root.id == node.pid) ? this.icon.root : ((node._hc) ? this.icon.folder : this.icon.node);\r
+\r
+ if (!node.iconOpen) node.iconOpen = (node._hc) ? this.icon.folderOpen : this.icon.node;\r
+\r
+ if (this.root.id == node.pid) {\r
+\r
+ node.icon = this.icon.root;\r
+\r
+ node.iconOpen = this.icon.root;\r
+\r
+ }\r
+\r
+ str += '<img id="i' + this.obj + nodeId + '" src="' + ((node._io) ? node.iconOpen : node.icon) + '" alt="" />';\r
+\r
+ }\r
+\r
+ if (node.url) {\r
+\r
+ str += '<a id="s' + this.obj + nodeId + '" class="' + ((this.config.useSelection) ? ((node._is ? 'nodeSel' : 'node')) : 'node') + '" href="' + node.url + '"';\r
+\r
+ if (node.title) str += ' title="' + node.title + '"';\r
+\r
+ if (node.target) str += ' target="' + node.target + '"';\r
+\r
+ if (this.config.useStatusText) str += ' onmouseover="window.status=\'' + node.name + '\';return true;" onmouseout="window.status=\'\';return true;" ';\r
+\r
+ if (this.config.useSelection && ((node._hc && this.config.folderLinks) || !node._hc))\r
+\r
+ str += ' onclick="javascript: ' + this.obj + '.s(' + nodeId + ');"';\r
+\r
+ str += '>';\r
+\r
+ }\r
+\r
+ else if ((!this.config.folderLinks || !node.url) && node._hc && node.pid != this.root.id)\r
+\r
+ str += '<a href="javascript: ' + this.obj + '.o(' + nodeId + ');" class="node">';\r
+\r
+ str += node.name;\r
+\r
+ if (node.url || ((!this.config.folderLinks || !node.url) && node._hc)) str += '</a>';\r
+\r
+ str += '</div>';\r
+\r
+ if (node._hc) {\r
+\r
+ str += '<div id="d' + this.obj + nodeId + '" class="clip" style="display:' + ((this.root.id == node.pid || node._io) ? 'block' : 'none') + ';">';\r
+\r
+ str += this.addNode(node);\r
+\r
+ str += '</div>';\r
+\r
+ }\r
+\r
+ this.aIndent.pop();\r
+\r
+ return str;\r
+\r
+};\r
+\r
+\r
+\r
+// Adds the empty and line icons\r
+\r
+dTree.prototype.indent = function(node, nodeId) {\r
+\r
+ var str = '';\r
+\r
+ if (this.root.id != node.pid) {\r
+\r
+ for (var n=0; n<this.aIndent.length; n++)\r
+\r
+ str += '<img src="' + ( (this.aIndent[n] == 1 && this.config.useLines) ? this.icon.line : this.icon.empty ) + '" alt="" />';\r
+\r
+ (node._ls) ? this.aIndent.push(0) : this.aIndent.push(1);\r
+\r
+ if (node._hc) {\r
+\r
+ str += '<a href="javascript: ' + this.obj + '.o(' + nodeId + ');"><img id="j' + this.obj + nodeId + '" src="';\r
+\r
+ if (!this.config.useLines) str += (node._io) ? this.icon.nlMinus : this.icon.nlPlus;\r
+\r
+ else str += ( (node._io) ? ((node._ls && this.config.useLines) ? this.icon.minusBottom : this.icon.minus) : ((node._ls && this.config.useLines) ? this.icon.plusBottom : this.icon.plus ) );\r
+\r
+ str += '" alt="" /></a>';\r
+\r
+ } else str += '<img src="' + ( (this.config.useLines) ? ((node._ls) ? this.icon.joinBottom : this.icon.join ) : this.icon.empty) + '" alt="" />';\r
+\r
+ }\r
+\r
+ return str;\r
+\r
+};\r
+\r
+\r
+\r
+// Checks if a node has any children and if it is the last sibling\r
+\r
+dTree.prototype.setCS = function(node) {\r
+\r
+ var lastId;\r
+\r
+ for (var n=0; n<this.aNodes.length; n++) {\r
+\r
+ if (this.aNodes[n].pid == node.id) node._hc = true;\r
+\r
+ if (this.aNodes[n].pid == node.pid) lastId = this.aNodes[n].id;\r
+\r
+ }\r
+\r
+ if (lastId==node.id) node._ls = true;\r
+\r
+};\r
+\r
+\r
+\r
+// Returns the selected node\r
+\r
+dTree.prototype.getSelected = function() {\r
+\r
+ var sn = this.getCookie('cs' + this.obj);\r
+\r
+ return (sn) ? sn : null;\r
+\r
+};\r
+\r
+\r
+\r
+// Highlights the selected node\r
+\r
+dTree.prototype.s = function(id) {\r
+\r
+ if (!this.config.useSelection) return;\r
+\r
+ var cn = this.aNodes[id];\r
+\r
+ if (cn._hc && !this.config.folderLinks) return;\r
+\r
+ if (this.selectedNode != id) {\r
+\r
+ if (this.selectedNode || this.selectedNode==0) {\r
+\r
+ eOld = document.getElementById("s" + this.obj + this.selectedNode);\r
+\r
+ eOld.className = "node";\r
+\r
+ }\r
+\r
+ eNew = document.getElementById("s" + this.obj + id);\r
+\r
+ eNew.className = "nodeSel";\r
+\r
+ this.selectedNode = id;\r
+\r
+ if (this.config.useCookies) this.setCookie('cs' + this.obj, cn.id);\r
+\r
+ }\r
+\r
+};\r
+\r
+\r
+\r
+// Toggle Open or close\r
+\r
+dTree.prototype.o = function(id) {\r
+\r
+ var cn = this.aNodes[id];\r
+\r
+ this.nodeStatus(!cn._io, id, cn._ls);\r
+\r
+ cn._io = !cn._io;\r
+\r
+ if (this.config.closeSameLevel) this.closeLevel(cn);\r
+\r
+ if (this.config.useCookies) this.updateCookie();\r
+\r
+};\r
+\r
+\r
+\r
+// Open or close all nodes\r
+\r
+dTree.prototype.oAll = function(status) {\r
+\r
+ for (var n=0; n<this.aNodes.length; n++) {\r
+\r
+ if (this.aNodes[n]._hc && this.aNodes[n].pid != this.root.id) {\r
+\r
+ this.nodeStatus(status, n, this.aNodes[n]._ls)\r
+\r
+ this.aNodes[n]._io = status;\r
+\r
+ }\r
+\r
+ }\r
+\r
+ if (this.config.useCookies) this.updateCookie();\r
+\r
+};\r
+\r
+\r
+\r
+// Opens the tree to a specific node\r
+\r
+dTree.prototype.openTo = function(nId, bSelect, bFirst) {\r
+\r
+ if (!bFirst) {\r
+\r
+ for (var n=0; n<this.aNodes.length; n++) {\r
+\r
+ if (this.aNodes[n].id == nId) {\r
+\r
+ nId=n;\r
+\r
+ break;\r
+\r
+ }\r
+\r
+ }\r
+\r
+ }\r
+\r
+ var cn=this.aNodes[nId];\r
+\r
+ if (cn.pid==this.root.id || !cn._p) return;\r
+\r
+ cn._io = true;\r
+\r
+ cn._is = bSelect;\r
+\r
+ if (this.completed && cn._hc) this.nodeStatus(true, cn._ai, cn._ls);\r
+\r
+ if (this.completed && bSelect) this.s(cn._ai);\r
+\r
+ else if (bSelect) this._sn=cn._ai;\r
+\r
+ this.openTo(cn._p._ai, false, true);\r
+\r
+};\r
+\r
+\r
+\r
+// Closes all nodes on the same level as certain node\r
+\r
+dTree.prototype.closeLevel = function(node) {\r
+\r
+ for (var n=0; n<this.aNodes.length; n++) {\r
+\r
+ if (this.aNodes[n].pid == node.pid && this.aNodes[n].id != node.id && this.aNodes[n]._hc) {\r
+\r
+ this.nodeStatus(false, n, this.aNodes[n]._ls);\r
+\r
+ this.aNodes[n]._io = false;\r
+\r
+ this.closeAllChildren(this.aNodes[n]);\r
+\r
+ }\r
+\r
+ }\r
+\r
+}\r
+\r
+\r
+\r
+// Closes all children of a node\r
+\r
+dTree.prototype.closeAllChildren = function(node) {\r
+\r
+ for (var n=0; n<this.aNodes.length; n++) {\r
+\r
+ if (this.aNodes[n].pid == node.id && this.aNodes[n]._hc) {\r
+\r
+ if (this.aNodes[n]._io) this.nodeStatus(false, n, this.aNodes[n]._ls);\r
+\r
+ this.aNodes[n]._io = false;\r
+\r
+ this.closeAllChildren(this.aNodes[n]); \r
+\r
+ }\r
+\r
+ }\r
+\r
+}\r
+\r
+\r
+\r
+// Change the status of a node(open or closed)\r
+\r
+dTree.prototype.nodeStatus = function(status, id, bottom) {\r
+\r
+ eDiv = document.getElementById('d' + this.obj + id);\r
+\r
+ eJoin = document.getElementById('j' + this.obj + id);\r
+\r
+ if (this.config.useIcons) {\r
+\r
+ eIcon = document.getElementById('i' + this.obj + id);\r
+\r
+ eIcon.src = (status) ? this.aNodes[id].iconOpen : this.aNodes[id].icon;\r
+\r
+ }\r
+\r
+ eJoin.src = (this.config.useLines)?\r
+\r
+ ((status)?((bottom)?this.icon.minusBottom:this.icon.minus):((bottom)?this.icon.plusBottom:this.icon.plus)):\r
+\r
+ ((status)?this.icon.nlMinus:this.icon.nlPlus);\r
+\r
+ eDiv.style.display = (status) ? 'block': 'none';\r
+\r
+};\r
+\r
+\r
+\r
+\r
+\r
+// [Cookie] Clears a cookie\r
+\r
+dTree.prototype.clearCookie = function() {\r
+\r
+ var now = new Date();\r
+\r
+ var yesterday = new Date(now.getTime() - 1000 * 60 * 60 * 24);\r
+\r
+ this.setCookie('co'+this.obj, 'cookieValue', yesterday);\r
+\r
+ this.setCookie('cs'+this.obj, 'cookieValue', yesterday);\r
+\r
+};\r
+\r
+\r
+\r
+// [Cookie] Sets value in a cookie\r
+\r
+dTree.prototype.setCookie = function(cookieName, cookieValue, expires, path, domain, secure) {\r
+\r
+ document.cookie =\r
+\r
+ escape(cookieName) + '=' + escape(cookieValue)\r
+\r
+ + (expires ? '; expires=' + expires.toGMTString() : '')\r
+\r
+ + (path ? '; path=' + path : '')\r
+\r
+ + (domain ? '; domain=' + domain : '')\r
+\r
+ + (secure ? '; secure' : '');\r
+\r
+};\r
+\r
+\r
+\r
+// [Cookie] Gets a value from a cookie\r
+\r
+dTree.prototype.getCookie = function(cookieName) {\r
+\r
+ var cookieValue = '';\r
+\r
+ var posName = document.cookie.indexOf(escape(cookieName) + '=');\r
+\r
+ if (posName != -1) {\r
+\r
+ var posValue = posName + (escape(cookieName) + '=').length;\r
+\r
+ var endPos = document.cookie.indexOf(';', posValue);\r
+\r
+ if (endPos != -1) cookieValue = unescape(document.cookie.substring(posValue, endPos));\r
+\r
+ else cookieValue = unescape(document.cookie.substring(posValue));\r
+\r
+ }\r
+\r
+ return (cookieValue);\r
+\r
+};\r
+\r
+\r
+\r
+// [Cookie] Returns ids of open nodes as a string\r
+\r
+dTree.prototype.updateCookie = function() {\r
+\r
+ var str = '';\r
+\r
+ for (var n=0; n<this.aNodes.length; n++) {\r
+\r
+ if (this.aNodes[n]._io && this.aNodes[n].pid != this.root.id) {\r
+\r
+ if (str) str += '.';\r
+\r
+ str += this.aNodes[n].id;\r
+\r
+ }\r
+\r
+ }\r
+\r
+ this.setCookie('co' + this.obj, str);\r
+\r
+};\r
+\r
+\r
+\r
+// [Cookie] Checks if a node id is in a cookie\r
+\r
+dTree.prototype.isOpen = function(id) {\r
+\r
+ var aOpen = this.getCookie('co' + this.obj).split('.');\r
+\r
+ for (var n=0; n<aOpen.length; n++)\r
+\r
+ if (aOpen[n] == id) return true;\r
+\r
+ return false;\r
+\r
+};\r
+\r
+\r
+\r
+// If Push and pop is not implemented by the browser\r
+\r
+if (!Array.prototype.push) {\r
+\r
+ Array.prototype.push = function array_push() {\r
+\r
+ for(var i=0;i<arguments.length;i++)\r
+\r
+ this[this.length]=arguments[i];\r
+\r
+ return this.length;\r
+\r
+ }\r
+\r
+};\r
+\r
+if (!Array.prototype.pop) {\r
+\r
+ Array.prototype.pop = function array_pop() {\r
+\r
+ lastElement = this[this.length-1];\r
+\r
+ this.length = Math.max(this.length-1,0);\r
+\r
+ return lastElement;\r
+\r
+ }\r
+\r
+};
\ No newline at end of file
--- /dev/null
+<?php\r
+/*\r
+ * Copyright 2004 GForge, LLC\r
+ *\r
+ * @version $Id: hierarchy_utils.php,v 1.0 2006/10/10 15:00:00 fregnier Exp $\r
+ * @author Fabien Regnier fabien.regnier@sogeti.com\r
+ * @date 2006-10-10\r
+ *\r
+ * This file is part of GForge.\r
+ *\r
+ * GForge is free software; you can redistribute it and/or modify\r
+ * it under the terms of the GNU General Public License as published by\r
+ * the Free Software Foundation; either version 2 of the License, or\r
+ * (at your option) any later version.\r
+ *\r
+ * GForge is distributed in the hope that it will be useful,\r
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
+ * GNU General Public License for more details.\r
+ *\r
+ * You should have received a copy of the GNU General Public License\r
+ * along with GForge; if not, write to the Free Software\r
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
+ */\r
+ \r
+ function son_box ($group_id,$name,$selected='xzxzxz') {\r
+ global $son;\r
+ if (!$son) {\r
+ \r
+ $family = get_family($group_id);\r
+ if($family != NULL){\r
+ \r
+ reset($family);\r
+ while (list($key, $val) = each($family)) { \r
+ $cond .= " AND group_id != ".$val." ";\r
+ }\r
+ \r
+ }\r
+ $son=db_query("SELECT group_id,group_name,register_time FROM groups " .\r
+ "WHERE status='A' AND type_id=1 AND group_id != ".$group_id." " .$cond.\r
+ "AND group_id NOT IN (SELECT sub_project_id FROM plugin_projects_hierarchy WHERE link_type = 'shar')" );\r
+ \r
+ \r
+ }\r
+ return html_build_select_box($son,$name,$selected,false);\r
+}\r
+\r
+ function link_box ($group_id,$name,$selected='xzxzxz') {\r
+ global $link;\r
+ if (!$link) {\r
+ $link=db_query("SELECT group_id,group_name,register_time FROM groups " .\r
+ "WHERE status='A' AND type_id=1 AND group_id != ".$group_id." " .\r
+ "AND group_id NOT IN (SELECT sub_project_id FROM plugin_projects_hierarchy WHERE project_id = ".$group_id." )".\r
+ " AND group_id NOT IN (SELECT project_id FROM plugin_projects_hierarchy WHERE sub_project_id = ".$group_id." )");\r
+ \r
+ \r
+ }\r
+ return html_build_select_box($link,$name,$selected,false);\r
+}\r
+\r
+\r
+ function type_son_box () {\r
+ global $Language;\r
+ return "<select name='link_type' onchange=\"javascript:" .\r
+ "if(this.value!= 0){" .\r
+ "document.formson.son.disabled=false" .\r
+ "}" .\r
+ "else {" .\r
+ "document.formson.son.disabled=true" .\r
+ "}\">" .\r
+ "\n<option value='0' selected=\"selected\" >".$Language->getText('project_admin','link')."</option>\n" .\r
+ "<option value='shar'>".$Language->getText('project_admin','share')."</option>\n" .\r
+ "<option value='navi' >".$Language->getText('project_admin','navi')."</option>\n" .\r
+ "</select>";\r
+ }\r
+\r
+//search all the family,all ancestor \r
+function get_family($group_id,$family='',$cpt=0){\r
+ $req = "SELECT project_id FROM plugin_projects_hierarchy WHERE sub_project_id = ".$group_id." ";\r
+ $res=db_query($req)or die(db_error());\r
+ if (!$res || db_numrows($res) < 1) {\r
+ //return $family;\r
+ }\r
+ else {\r
+ $row = db_fetch_array($res); \r
+ $family[$cpt] = $row['project_id'];\r
+ $cpt++;\r
+ return get_family($row['project_id'],$family,$cpt);\r
+ }\r
+ \r
+ return $family;\r
+}\r
+?>\r
--- /dev/null
+<?php
+
+/*
+ * projects_hierarchy plugin
+ *
+ * Daniel Perez <danielperez.arg@gmail.com>
+ *
+ * This is an example to watch things in action. You can obviously modify things and logic as you see fit
+ */
+
+require_once('pre.php');
+require_once ('plugins/projects_hierarchy/config.php');
+
+// the header that displays for the user portion of the plugin
+function projects_hierarchy_Project_Header($params) {
+ global $DOCUMENT_ROOT,$HTML,$id,$Language;
+ $params['toptab']='projects_hierarchy';
+ $params['group']=$id;
+
+ /*
+ Show horizontal links
+ */
+ site_project_header($params);
+}
+
+// the header that displays for the project portion of the plugin
+function projects_hierarchy_User_Header($params) {
+ global $DOCUMENT_ROOT,$HTML,$user_id,$Language;
+ $params['toptab']='projects_hierarchy';
+ $params['user']=$user_id;
+
+ /*
+ Show horizontal links
+ */
+ site_user_header($params);
+}
+
+
+ $user = session_get_user(); // get the session user
+
+ if (!$user || !is_object($user) || $user->isError() || !$user->isActive()) {
+ exit_error("Invalid User", "Cannot Process your request for this user.");
+ }
+
+ $type = getStringFromRequest('type');
+ $id = getStringFromRequest('id');
+ $pluginname = getStringFromRequest('pluginname');
+
+ if (!$type) {
+ exit_error("Cannot Process your request","No TYPE specified"); // you can create items in Base.tab and customize this messages
+ } elseif (!$id) {
+ exit_error("Cannot Process your request","No ID specified");
+ } else {
+ if ($type == 'group') {
+ $group = group_get_object($id);
+ if ( !$group) {
+ exit_error("Invalid Project", "Inexistent Project");
+ }
+ if ( ! ($group->usesPlugin ( $pluginname )) ) {//check if the group has the projects_hierarchy plugin active
+ exit_error("Error", "First activate the $pluginname plugin through the Project's Admin Interface");
+ }
+ $userperm = $group->getPermission($user);//we´ll check if the user belongs to the group (optional)
+ if ( !$userperm->IsMember()) {
+ exit_error("Access Denied", "You are not a member of this project");
+ }
+ // other perms checks here...
+ projects_hierarchy_Project_Header(array('title'=>$pluginname . ' Project Plugin!','pagename'=>"$pluginname",'sectionvals'=>array(group_getname($id))));
+ // DO THE STUFF FOR THE PROJECT PART HERE
+ echo "We are in the Project projects_hierarchy plugin <br>";
+ echo "Greetings from planet " . $world; // $world comes from the config file in /etc
+ } elseif ($type == 'user') {
+ $realuser = user_get_object($id);//
+ if (!($realuser) || !($realuser->usesPlugin($pluginname))) {
+ exit_error("Error", "First activate the User's $pluginname plugin through Account Manteinance Page");
+ }
+ if ( (!$user) || ($user->getID() != $id)) { // if someone else tried to access the private projects_hierarchy part of this user
+ exit_error("Access Denied", "You cannot access other user's personal $pluginname");
+ }
+ projects_hierarchy_User_Header(array('title'=>'My '.$pluginname,'pagename'=>"$pluginname",'sectionvals'=>array($realuser->getUnixName())));
+ // DO THE STUFF FOR THE USER PART HERE
+ echo "We are in the User projects_hierarchy plugin <br>";
+ echo "Greetings from planet " . $world; // $world comes from the config file in /etc
+ } elseif ($type == 'admin') {
+ $group = group_get_object($id);
+ if ( !$group) {
+ exit_error("Invalid Project", "Inexistent Project");
+ }
+ if ( ! ($group->usesPlugin ( $pluginname )) ) {//check if the group has the projects_hierarchy plugin active
+ exit_error("Error", "First activate the $pluginname plugin through the Project's Admin Interface");
+ }
+ $userperm = $group->getPermission($user);//we´ll check if the user belongs to the group
+ if ( !$userperm->IsMember()) {
+ exit_error("Access Denied", "You are not a member of this project");
+ }
+ //only project admin can access here
+ if ( $userperm->isAdmin() ) {
+ projects_hierarchy_Project_Header(array('title'=>$pluginname . ' Project Plugin!','pagename'=>"$pluginname",'sectionvals'=>array(group_getname($id))));
+ // DO THE STUFF FOR THE PROJECT ADMINISTRATION PART HERE
+ echo "We are in the Project projects_hierarchy plugin <font color=\"#ff0000\">ADMINISTRATION</font> <br>";
+ echo "Greetings from planet " . $world; // $world comes from the config file in /etc
+ } else {
+ exit_error("Access Denied", "You are not a project Admin");
+ }
+ }
+ }
+
+ site_project_footer(array());
+
+?>
--- /dev/null
+<?php\r
+/**\r
+ *\r
+ * SourceForge Trove Software Map\r
+ *\r
+ * SourceForge: Breaking Down the Barriers to Open Source Development\r
+ * Copyright 1999-2001 (c) VA Linux Systems\r
+ * http://sourceforge.net\r
+ *\r
+ * @version $Id: trove_list.php,v 1.2 2005/11/28 13:29:52 uid20157 Exp $\r
+ *\r
+ */\r
+\r
+session_start();\r
+require_once('pre.php'); \r
+require_once('www/include/trove.php');\r
+require_once('../../../www/docman/include/doc_utils.php');\r
+\r
+if (!$sys_use_trove) {\r
+ exit_disabled();\r
+}\r
+\r
+//we check if the user has already chosen the tree\r
+if(isset($_GET['cat'])){\r
+ $_SESSION['cat'] = $_GET['cat'];\r
+}\r
+\r
+// assign default. 18 is 'topic'\r
+if (!isset($form_cat) || !$form_cat) {\r
+ $form_cat = $default_trove_cat;\r
+}\r
+\r
+$form_cat = intval($form_cat);\r
+\r
+// get info about current folder\r
+$res_trove_cat = db_query("\r
+ SELECT *\r
+ FROM trove_cat\r
+ WHERE trove_cat_id='$form_cat' ORDER BY fullname");\r
+\r
+if (db_numrows($res_trove_cat) < 1) {\r
+ exit_error(\r
+ $Language->getText('trove_list','invalid_category_title'),\r
+ $Language->getText('trove_list','invalid_category_text').': '.db_error()\r
+ );\r
+}\r
+\r
+$HTML->header(array('title'=>$Language->getText('trove_list','title'),'pagename'=>'softwaremap'));\r
+\r
+//rajout fab a mettre dans head\r
+?>\r
+<link rel="StyleSheet" href="dtree.css" type="text/css" />\r
+ <script type="text/javascript" src="dtree.js"></script>\r
+<?php\r
+//fin rajout\r
+\r
+print "<b><a href=\"./softwaremap.php?cat=c\">".$Language->getText('project_tree','cat')."</a> | <a href=\"./softwaremap.php?cat=t\">".$Language->getText('project_tree','tree')."</a></b>";\r
+\r
+echo'\r
+ <hr />';\r
+\r
+if($_SESSION['cat'] != 't'){\r
+ $row_trove_cat = db_fetch_array($res_trove_cat);\r
+ \r
+ // #####################################\r
+ // this section limits search and requeries if there are discrim elements\r
+ \r
+ $discrim_url = '';\r
+ $discrim_desc = '';\r
+ \r
+ if (isset($discrim) && $discrim) {\r
+ unset ($discrim_queryalias);\r
+ unset ($discrim_queryand);\r
+ unset ($discrim_url_b);\r
+ \r
+ // commas are ANDs\r
+ $expl_discrim = explode(',',$discrim);\r
+ \r
+ // need one link for each "get out of this limit" links\r
+ $discrim_url = '&discrim=';\r
+ \r
+ $lims=sizeof($expl_discrim);\r
+ if ($lims > 6) {\r
+ $lims=6;\r
+ }\r
+ \r
+ // one per argument \r
+ for ($i=0;$i<$lims;$i++) {\r
+ // make sure these are all ints, no url trickery\r
+ $expl_discrim[$i] = intval($expl_discrim[$i]);\r
+ \r
+ // need one aliased table for everything\r
+ //[CB] $discrim_queryalias .= ', trove_group_link trove_group_link_'.$i.' ';\r
+ $discrim_queryalias .= ', trove_agg trove_agg_'.$i.' ';\r
+ \r
+ // need additional AND entries for aliased tables\r
+ //[CB] $discrim_queryand .= 'AND trove_group_link_'.$i.'.trove_cat_id='\r
+ //[CB] .$expl_discrim[$i].' AND trove_group_link_'.$i.'.group_id='\r
+ //[CB] .'trove_group_link.group_id ';\r
+ $discrim_queryand .= 'AND trove_agg_'.$i.'.trove_cat_id='\r
+ .$expl_discrim[$i].' AND trove_agg_'.$i.'.group_id='\r
+ .'trove_agg.group_id ';\r
+ \r
+ // must build query string for all urls\r
+ if ($i==0) {\r
+ $discrim_url .= $expl_discrim[$i];\r
+ } else {\r
+ $discrim_url .= ','.$expl_discrim[$i];\r
+ }\r
+ // must also do this for EACH "get out of this limit" links\r
+ // convoluted logic to build urls for these, but works quickly\r
+ for ($j=0;$j<sizeof($expl_discrim);$j++) {\r
+ if ($i!=$j) {\r
+ if (!$discrim_url_b[$j]) {\r
+ $discrim_url_b[$j] = '&discrim='.$expl_discrim[$i];\r
+ } else {\r
+ $discrim_url_b[$j] .= ','.$expl_discrim[$i];\r
+ }\r
+ }\r
+ }\r
+ \r
+ }\r
+ \r
+ // build text for top of page on what viewier is seeing\r
+ $discrim_desc = '<span style="color:red;font-size:smaller">'.$Language->getText('trove_list','limiting_view').':\r
+ </span>';\r
+ \r
+ for ($i=0;$i<sizeof($expl_discrim);$i++) {\r
+