#! /usr/bin/make -f
#
-# Build 3rd party rpms like php-htmlpurifier, php-jpgraph.
-#
# Once built, packages are in $BUILDPLACE
BUILDERDIR:=$(shell ../tests/scripts/builder_get_config.sh BUILDERDIR)
HTMLPURIFIER_TBZ=htmlpurifier-$(HTMLPURIFIER_VERSION).tar.gz
HTMLPURIFIER_RPM=noarch/php-htmlpurifier-$(HTMLPURIFIER_VERSION)-1.noarch.rpm
-JPGRAPH_DIR:=$(CURDIR)/php-jpgraph
-JPGRAPH_VERSION=1.5.2
-JPGRAPH_SPEC=$(JPGRAPH_DIR)/php-jpgraph.spec
-JPGRAPH_TBZ=libphp-jpgraph_$(JPGRAPH_VERSION).orig.tar.gz
-JPGRAPH_RPM=noarch/php-jpgraph-$(JPGRAPH_VERSION)-1.noarch.rpm
-JPGRAPH_DIFF=libphp-jpgraph_$(JPGRAPH_VERSION)-12.diff
-JPGRAPH_PATCH1=jpgraph-1.5.2-php5_and_liberation_fonts.patch
-JPGRAPH_PATCH2=jpgraph-rhel-fonts.patch
-
WEBDAV_SERVER_DIR:=$(CURDIR)/php-pear-HTTP_WebDAV_Server
WEBDAV_SERVER_VERSION=1.0.0RC5
WEBDAV_SERVER_SPEC=$(WEBDAV_SERVER_DIR)/php-pear-HTTP_WebDAV_Server.spec
RPMBUILD=rpmbuild --quiet --define='_topdir $(BUILDPLACE)' --define='_tmppath %{_topdir}' --define='_sysconfdir /etc' --define='_rpmdir $(BUILDRESULT)' --define='_specdir %{_topdir}/SPECS'
#--define='_sourcedir %{_topdir}/SOURCES'
-default: $(HTMLPURIFYER_DIR) $(JPGRAPH_DIR) $(WEBDAV_SERVER_DIR) $(SELENIUM_DIR) dist
+default: $(HTMLPURIFYER_DIR) $(WEBDAV_SERVER_DIR) $(SELENIUM_DIR) dist
all: clean default
$(BUILDPLACE)/SOURCES/$(HTMLPURIFIER_TBZ): $(BUILDPLACE)/SOURCES
@cd $(BUILDPLACE)/SOURCES; [ -f $@ ] || wget -q -N http://htmlpurifier.org/releases/$(HTMLPURIFIER_TBZ)
-# PHP JPGRAPH
-$(JPGRAPH_DIR): $(BUILDRESULT)/$(JPGRAPH_RPM)
-
-$(BUILDRESULT)/$(JPGRAPH_RPM): $(JPGRAPH_SPEC) $(BUILDPLACE)/SOURCES/$(JPGRAPH_DIFF) $(BUILDPLACE)/SOURCES/$(JPGRAPH_TBZ) $(BUILDPLACE)/SOURCES/$(JPGRAPH_PATCH1) $(BUILDPLACE)/SOURCES/$(JPGRAPH_PATCH2)
- $(RPMBUILD) --quiet --clean -ba $(JPGRAPH_SPEC)
-
-$(BUILDPLACE)/SOURCES/$(JPGRAPH_DIFF): $(BUILDPLACE)/SOURCES
- zcat $(JPGRAPH_DIR)/$(JPGRAPH_DIFF).gz > $@
-
-$(BUILDPLACE)/SOURCES/$(JPGRAPH_TBZ): $(BUILDPLACE)/SOURCES
- cp $(JPGRAPH_DIR)/$(JPGRAPH_TBZ) $@
-
-$(BUILDPLACE)/SOURCES/$(JPGRAPH_PATCH1):
- cp $(JPGRAPH_DIR)/$(JPGRAPH_PATCH1) $@
-
-$(BUILDPLACE)/SOURCES/$(JPGRAPH_PATCH2):
- cp $(JPGRAPH_DIR)/$(JPGRAPH_PATCH2) $@
-
# WEBDAV SERVER
$(WEBDAV_SERVER_DIR): $(BUILDRESULT)/$(WEBDAV_SERVER_RPM)
+++ /dev/null
-diff -Naur jpgraph-1.5.2.org/src/jpgraph_dir.php jpgraph-1.5.2/src/jpgraph_dir.php
---- jpgraph-1.5.2.org/src/jpgraph_dir.php 2002-03-01 01:46:17.000000000 +0100
-+++ jpgraph-1.5.2/src/jpgraph_dir.php 2008-12-09 21:55:28.000000000 +0100
-@@ -26,5 +26,6 @@
-
- // Directory for TTF fonts. Must end with '/'
- DEFINE("TTF_DIR","/usr/local/fonts/ttf/");
-+DEFINE("LIBERATION_DIR","/usr/share/fonts/liberation/");
-
- ?>
-diff -Naur jpgraph-1.5.2.org/src/jpgraph_gantt.php jpgraph-1.5.2/src/jpgraph_gantt.php
---- jpgraph-1.5.2.org/src/jpgraph_gantt.php 2002-03-01 01:46:17.000000000 +0100
-+++ jpgraph-1.5.2/src/jpgraph_gantt.php 2008-12-09 21:55:28.000000000 +0100
-@@ -1157,10 +1157,6 @@
- $this->iCaptionMargin=$aMarg;
- }
-
-- function GetLineNbr() {
-- return 0;
-- }
--
- function GetAbsHeight($aImg) {
- return 0;
- }
-@@ -1189,7 +1185,7 @@
- $this->iProgress = $aProg;
- }
-
-- function SetPattern($aPattern,$aColor="blue",$aDensity=98) {
-+ function SetPattern($aPattern,$aColor="blue",$aDensity=100) {
- $this->iPattern = $aPattern;
- $this->iColor = $aColor;
- $this->iDensity = $aDensity;
-diff -Naur jpgraph-1.5.2.org/src/jpgraph.php jpgraph-1.5.2/src/jpgraph.php
---- jpgraph-1.5.2.org/src/jpgraph.php 2002-03-01 01:46:17.000000000 +0100
-+++ jpgraph-1.5.2/src/jpgraph.php 2008-12-09 21:55:28.000000000 +0100
-@@ -30,7 +30,8 @@
- // regenerate the image. Note that even if reading the cache is
- // disabled the cached will still be updated with the newly generated
- // image. Set also "USE_CACHE" below.
--DEFINE("READ_CACHE",true);
-+//DEFINE("READ_CACHE",true);
-+DEFINE("READ_CACHE",false);
-
- // Should the cache be used at all? By setting this to false no
- // files will be generated in the cache directory.
-@@ -38,7 +39,8 @@
- // false will still create the image in the cache directory
- // just not use it. By setting USE_CACHE=false no files will even
- // be generated in the cache directory.
--DEFINE("USE_CACHE",true);
-+//DEFINE("USE_CACHE",true);
-+DEFINE("USE_CACHE",false);
-
- // If the color palette is full should JpGraph try to allocate
- // the closest match? If you plan on using background image or
-@@ -104,6 +106,7 @@
- DEFINE("FF_COMIC",14);
- DEFINE("FF_ARIAL",15);
- DEFINE("FF_BOOK",16);
-+DEFINE("FF_LIBERATION_SANS",17);
-
- // TTF Font styles
- DEFINE("FS_NORMAL",1);
-@@ -251,11 +254,11 @@
- // Check what version of the GD library is being used
- //
- if(function_exists('imagecopyresampled') ) {
-- $gd2 = true;
-+ $GLOBALS['gd2'] = true;
- $copyfunc = "imagecopyresampled";
- } elseif(function_exists('imagecopyresized')) {
- $copyfunc = "imagecopyresized";
-- $gd2 = false;
-+ $GLOBALS['gd2'] = false;
- }
- else {
- JpGraphError::Raise("<b>JpGraph Error:</b> Your PHP installation does not
-@@ -272,7 +275,6 @@
- // (top level), i.e it is safe to call this function
- // from a script that uses JpGraph
- function GenImgName() {
-- global $HTTP_SERVER_VARS;
- $supported = imagetypes();
- if( $supported & IMG_PNG )
- $img_format="png";
-@@ -280,10 +282,10 @@
- $img_format="gif";
- elseif( $supported & IMG_JPG )
- $img_format="jpeg";
-- if( !isset($HTTP_SERVER_VARS['PHP_SELF']) )
-+ if( !isset($_SERVER['PHP_SELF']) )
- JpGraphError::Raise("<b>JpGraph Error:</b> Can't access PHP_SELF, PHP global variable. You can't run PHP from command line
- if you want to use the 'auto' naming of cache or image files.");
-- $fname=basename($HTTP_SERVER_VARS['PHP_SELF']);
-+ $fname=basename($_SERVER['PHP_SELF']);
- // Replace the ".php" extension with the image format extension
- return substr($fname,0,strlen($fname)-4).".".$img_format;
- }
-@@ -489,6 +491,7 @@
-
- // Specify a background image
- function SetBackgroundImage($aFileName,$aBgType=BKIMG_FILLPLOT,$aImgFormat="png") {
-+/* CB Not any more bugging
-
- if( $GLOBALS["gd2"] && !USE_TRUECOLOR ) {
- JpGraphError::Raise("<b>JpGraph Error:</b>You are using GD 2.x and are
-@@ -500,6 +503,7 @@
- using any truetype fonts with truecolor images will result in very
- poor quality fonts.");
- }
-+*/
-
- $this->background_image = $aFileName;
- $this->background_image_type=$aBgType;
-@@ -1064,6 +1068,10 @@
- $this->img->Rectangle(0,0,$this->img->width-1,$this->img->height-1);
- }
- }
-+ // Set Margin by Christian Bayle
-+ function SetMargin($lm,$rm,$tm,$bm) {
-+ $this->img->SetMargin($lm,$rm,$tm,$bm);
-+ }
- } // Class
-
-
-@@ -1084,7 +1092,8 @@
- FF_HANDWRT => TTF_DIR."handwriting",
- FF_COMIC => TTF_DIR."comic",
- FF_ARIAL => TTF_DIR."arial",
-- FF_BOOK => TTF_DIR."bookant");
-+ FF_BOOK => TTF_DIR."bookant",
-+ FF_LIBERATION_SANS => LIBERATION_DIR."LiberationSans-Regular");
- }
-
- //---------------
-@@ -3183,7 +3192,7 @@
- }
- }
- }
-- elseif($this->font_family >= FF_COURIER && $this->font_family <= FF_BOOK) { // TTF font
-+ elseif($this->font_family >= FF_COURIER && $this->font_family <= FF_LIBERATION_SANS) { // TTF font
- $file = $this->ttf->File($this->font_family,$this->font_style);
- $angle=$dir;
- $bbox=ImageTTFBBox($this->font_size,$angle,$file,$txt);
-@@ -3208,7 +3217,7 @@
- }
- }
- else
-- JpGraphError::Raise("<b>JpGraph Error:</b> Unknown font font family specification. ");
-+ JpGraphError::Raise("<b>JpGraph Error:</b> Unknown font family specification: ". $this->font_family);
- }
-
- function SetMargin($lm,$rm,$tm,$bm) {
-@@ -3490,7 +3499,16 @@
- }
-
- function FilledCircle($xc,$yc,$r) {
-- imagefilledellipse($this->img,$xc,$yc,2*$r,2*$r,$this->current_color);
-+ if( $GLOBALS['gd2'] ) {
-+ imagefilledellipse($this->img,$xc,$yc,2*$r,2*$r,$this->current_color);
-+ }
-+ else {
-+ for( $i=1; $i < 2*$r; $i += 2 ) {
-+ $this->Arc($xc,$yc,$i,$i,0,360);
-+ $this->Arc($xc,$yc,$i+1,$i,0,360);
-+ $this->Arc($xc,$yc,$i+1,$i+1,0,360);
-+ }
-+ }
- }
-
- // Linear Color InterPolation
+++ /dev/null
-diff -Naur jpgraph-1.5.2.org/src/jpgraph_dir.php jpgraph-1.5.2/src/jpgraph_dir.php
---- jpgraph-1.5.2.org/src/jpgraph_dir.php 2010-03-30 23:47:09.000000000 +0200
-+++ jpgraph-1.5.2/src/jpgraph_dir.php 2010-03-30 23:51:52.000000000 +0200
-@@ -25,9 +25,9 @@
- DEFINE("APACHE_CACHE_DIR","/jpgraph_cache/");
-
- // Directory for TTF fonts. Must end with '/'
--DEFINE("TTF_DIR","/usr/share/fonts/truetype/msttcorefonts/");
-+DEFINE("TTF_DIR","/usr/local/fonts/ttf/");
-
--// Add Free liberation font as suggested by Alain Peyrat
--DEFINE("LIBERATION_DIR","/usr/share/fonts/truetype/ttf-liberation/");
-+// Add Free liberation font
-+DEFINE("LIBERATION_DIR","/usr/share/fonts/liberation/");
-
- ?>
-diff -Naur jpgraph-1.5.2.org/src/jpgraph.php jpgraph-1.5.2/src/jpgraph.php
---- jpgraph-1.5.2.org/src/jpgraph.php 2010-03-30 23:47:09.000000000 +0200
-+++ jpgraph-1.5.2/src/jpgraph.php 2010-03-30 23:55:57.000000000 +0200
-@@ -1095,13 +1095,13 @@
- function TTF() {
- // Base file names for available fonts
- $this->font_fam=array(
-- FF_COURIER => TTF_DIR."Courier_New",
-- FF_VERDANA => TTF_DIR."Verdana",
-- FF_TIMES => TTF_DIR."Times",
-- FF_HANDWRT => TTF_DIR."Handwriting",
-- FF_COMIC => TTF_DIR."Comic",
-- FF_ARIAL => TTF_DIR."Arial",
-- FF_BOOK => TTF_DIR."Bookant",
-+ FF_COURIER => TTF_DIR."courier",
-+ FF_VERDANA => TTF_DIR."verdana",
-+ FF_TIMES => TTF_DIR."times",
-+ FF_HANDWRT => TTF_DIR."handwriting",
-+ FF_COMIC => TTF_DIR."comic",
-+ FF_ARIAL => TTF_DIR."arial",
-+ FF_BOOK => TTF_DIR."bookant",
- FF_LIBERATION_SANS => LIBERATION_DIR."LiberationSans-Regular");
- }
-
-@@ -1114,11 +1114,11 @@
- switch( $style ) {
- case FS_NORMAL:
- break;
-- case FS_BOLD: $f .= "_Bold";
-+ case FS_BOLD: $f .= "bd";
- break;
-- case FS_ITALIC: $f .= "_Italic";
-+ case FS_ITALIC: $f .= "i";
- break;
-- case FS_BOLDIT: $f .= "_Bold_Italic";
-+ case FS_BOLDIT: $f .= "bi";
- break;
- default:
- JpGraphError::Raise("<b>JpGraph Error:</b> Unknown TTF Style.");
+++ /dev/null
-# $Id: php-jpgraph.spec 4308 2006-04-21 22:20:20Z dries $
-# Authority: dag
-
-%define real_name jpgraph
-
-Summary: OO Graph Library for PHP
-Name: php-jpgraph
-Version: 1.5.2
-Release: 1
-License: GPL
-Group: Development/Languages
-URL: http://www.aditus.nu/jpgraph/
-
-#Source: http://members.chello.se/jpgraph/jpgdownloads/jpgraph-%{version}.tar.gz
-Source: libphp-jpgraph_%{version}.orig.tar.gz
-BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
-
-BuildArch: noarch
-Requires: php
-Obsoletes: jpgraph
-Provides: jpgraph
-
-Patch0: libphp-jpgraph_1.5.2-12.diff
-Patch1: jpgraph-rhel-fonts.patch
-
-
-%description
-JpGraph is an OO class library for PHP 4.1 (or higher). JpGraph makes it
-easy to draw both "quick and dirty" graphs with a minimum of code and
-complex professional graphs which requires a very fine grain control.
-
-JpGraph is equally well suited for both scientific and business type of graphs.
-
-An important feature of the library is that it assigns context sensitive
-default values for most of the parameters which radically minimizes the
-learning curve. The features are there when you need it - they don't get
-in your way when you don't need them!
-
-%package docs
-Summary: Documentation for package %{name}
-Group: Documentation
-
-%description docs
-JpGraph is an OO class library for PHP 4.1 (or higher). JpGraph makes it
-easy to draw both "quick and dirty" graphs with a minimum of code and
-complex professional graphs which requires a very fine grain control.
-
-This package includes the documentation for %{name}.
-
-%prep
-%setup -n %{real_name}-%{version}
-%patch0 -p1
-%patch1 -p1
-
-### Change the default TTF_DIR to Red Hat's TTF_DIR.
-%{__perl} -pi.orig -e 's|/usr/X11R6/lib/X11/fonts/truetype/|/usr/X11R6/lib/X11/fonts/TTF/|' src/jpgraph.php
-
-%build
-
-%install
-%{__rm} -rf %{buildroot}
-%{__install} -d -m0755 %{buildroot}%{_datadir}/%{real_name}
-%{__install} -p -m0644 src/jpgraph*.php %{buildroot}%{_datadir}/%{real_name}/
-
-%clean
-%{__rm} -rf %{buildroot}
-
-%files
-%defattr(-, root, root, 0755)
-%doc README
-%{_datadir}/%{real_name}/
-
-%files docs
-%defattr(-, root, root, 0755)
-%doc src/Examples/
-
-%changelog
-* Mon Mar 29 2010 Alain Peyrat <aljeux@free.fr> - 1.5.2-1
-- Initial package, spec taken from DAG.
#
./gforge-install.sh gforge.company.com apacheuser apachegroup
-#
-# jpgraph install - use the 1.9.1 version from gforge.org
-# as mentioned above
-#
-tar -xzf jpgraph-1.9.1.tar.gz
-mv jpgraph-1.9.1/src/* /opt/jpgraph/
-
-#you will have to edit jpgraph.php to set USE_CACHE=false
-vim /opt/jpgraph/jpgraph.php
-
Apache will need to have a line added to its httpd.conf:
Include /etc/gforge/httpd.conf
A: Go to the reporting tab and scroll down so you can choose
"Initialize/Rebuild Reporting Tables"
-You may also be missing GD support or be missing JPGraph or have it installed
-improperly. The jpgraph/src/ directory should be specified accurately in your
-local.inc file, and you should include a / at the end of the path specified.
-In addition, you should modify jpgraph.php to set USE_CACHE=false
-
-
Q: How do I upgrade my database?
A: As stated above, you must apply the changes that are listed in date order
forge_define_config_item ('template_group', 'core', $GLOBALS['sys_template_group']) ;
forge_define_config_item ('sendmail_path', 'core', $GLOBALS['sys_sendmail_path']) ;
forge_define_config_item ('mailman_path', 'core', $GLOBALS['sys_path_to_mailman']) ;
- forge_define_config_item ('jpgraph_path', 'core', $GLOBALS['sys_path_to_jpgraph']) ;
forge_define_config_item ('account_manager_type', 'core', $GLOBALS['sys_account_manager_type']) ;
forge_define_config_item ('unix_cipher', 'core', $GLOBALS['unix_cipher']) ;
forge_define_config_item ('homedir_prefix', 'core', $GLOBALS['homedir_prefix']) ;
default_timezone = GMT
default_trove_cat = 18
force_login = no
-jpgraph_path = "/usr/share/jpgraph/"
mailman_path = "/usr/lib/mailman"
mailman_data_path = "/var/lib/mailman"
news_group = 2
Requires: /bin/sh, /bin/bash
Requires: perl, perl-DBI, perl-HTML-Parser, perl-Text-Autoformat, perl-Mail-Sendmail, perl-Sort-Versions
Requires: cronolog
-Requires: php-jpgraph
-Requires: /var/www/jpgraph-1.19/jpgraph.php
#Requires: libnss-pgsql >= 1.4
Requires: gettext
Requires: php-htmlpurifier >= 4.0.0
#%{__sed} -i -e 's|.*php_value[[:space:]]*include_path.*$|\tphp_value\tinclude_path ".:/usr/share/gforge/www/include:/usr/share/gforge:/etc/gforge:/usr/share/gforge/common:/usr/share/gforge/www:/usr/share/gforge/plugins"|' $RPM_BUILD_ROOT%{_sysconfdir}/httpd/conf.d/z-gforge.conf
%{__sed} -i -e 's!www-data!apache!g' $RPM_BUILD_ROOT%{FORGE_CONF_DIR}/config.ini.d/defaults.ini
-%{__sed} -i -e 's!/usr/share/jpgraph!/var/www/jpgraph-1.19!g' $RPM_BUILD_ROOT%{FORGE_CONF_DIR}/config.ini.d/defaults.ini
%{__sed} -i -e 's!lists.$core/web_host!$core/web_host!g' $RPM_BUILD_ROOT%{FORGE_CONF_DIR}/config.ini.d/defaults.ini
%{__sed} -i -e 's!scm.$core/web_host!$core/web_host!g' $RPM_BUILD_ROOT%{FORGE_CONF_DIR}/config.ini.d/defaults.ini
%{__sed} -i -e 's!users.$core/web_host!$core/web_host!g' $RPM_BUILD_ROOT%{FORGE_CONF_DIR}/config.ini.d/defaults.ini
# Copyright 2006 GForge, LLC
# Copyright (C) 2010 Alain Peyrat - Alcatel-Lucent
# Copyright (C) 2011 Christian Bayle
+# Copyright 2013, Franck Villaume - TrivialDev
# http://fusionforge.org/
#
# @version
*)
pg=postgresql
esac
- yum --enablerepo=fusionforge --enablerepo=dag-rpmforge -y --skip-broken install httpd php mailman cvs $pg $pg-libs $pg-server $pg-contrib perl-URI php-pgsql subversion mod_dav_svn postfix rcs php-gd mod_ssl wget openssh which liberation-fonts php-htmlpurifier php-mbstring php-jpgraph-1.5.2 poppler-utils php-pecl-zip php-pear-HTTP_WebDAV_Server antiword php-pecl-Fileinfo shared-mime-info rsync git gitweb
+ yum --enablerepo=fusionforge --enablerepo=dag-rpmforge -y --skip-broken install httpd php mailman cvs $pg $pg-libs $pg-server $pg-contrib perl-URI php-pgsql subversion mod_dav_svn postfix rcs php-gd mod_ssl wget openssh which liberation-fonts php-htmlpurifier php-mbstring poppler-utils php-pecl-zip php-pear-HTTP_WebDAV_Server antiword php-pecl-Fileinfo shared-mime-info rsync git gitweb
touch /tmp/done_yum
fi
}
Package: @OLDPACKAGE@-web-apache2
Architecture: all
-Depends: @OLDPACKAGE@-common, @OLDPACKAGE@-db-postgresql | @OLDPACKAGE@-db, libapache2-mod-php5, php5-cgi, php5-pgsql, php5-gd, perl, libdbi-perl, libdbd-pg-perl, debianutils (>= 1.7), debconf (>= 1.0.32) | debconf-2.0, ucf, cronolog, python, ssl-cert, libnusoap-php, libphp-simplepie, php-http, libjs-yui, libjs-scriptaculous, libjs-jquery, libjs-jquery-tipsy, libjs-jquery-ui, libjs-jquery-ui-theme-overcast, libphp-jpgraph, ${misc:Depends}
+Depends: @OLDPACKAGE@-common, @OLDPACKAGE@-db-postgresql | @OLDPACKAGE@-db, libapache2-mod-php5, php5-cgi, php5-pgsql, php5-gd, perl, libdbi-perl, libdbd-pg-perl, debianutils (>= 1.7), debconf (>= 1.0.32) | debconf-2.0, ucf, cronolog, python, ssl-cert, libnusoap-php, libphp-simplepie, php-http, libjs-yui, libjs-scriptaculous, libjs-jquery, libjs-jquery-tipsy, libjs-jquery-ui, libjs-jquery-ui-theme-overcast, ${misc:Depends}
Recommends: locales | locales-all
Provides: @OLDPACKAGE@-web
Conflicts: @OLDPACKAGE@-web
add_config core groupdir_prefix >> $tmp
add_config core homedir_prefix >> $tmp
add_config core images_url >> $tmp
-add_config core jpgraph_path >> $tmp
add_config core lists_host >> $tmp
add_config core mailman_path >> $tmp
add_config core master_path >> $tmp
/**
* FusionForge Config File edit page
*
- * @version
- * @author
- * @copyright
+ * Daniel A. Pérez danielperez.arg@gmail.com
* Copyright 2005 GForge, LLC
+ * Copyright 2013, Franck Villaume - TrivialDev
* http://fusionforge.org/
*
- * Daniel A. Pérez danielperez.arg@gmail.com
- *
* This file is part of FusionForge. FusionForge is free software;
* you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software
static function groupdir_prefix($v) { return is_dir($v); }
static function homedir_prefix($v) { return is_dir($v); }
static function installation_environment($v) { return in_array($v, array('production', 'integration', 'development')); }
- static function jpgraph_path($v) { return is_dir($v); }
static function log_path($v) { return is_dir($v); }
static function mailman_path($v) { return is_dir($v); }
static function plugins_path($v) { return is_dir($v); }
+++ /dev/null
-<?php
-
-$sys_path_to_jpgraph='/usr/share/jpgraph';
-
-require_once($sys_path_to_jpgraph.'/jpgraph.php');
-require_once($sys_path_to_jpgraph.'/jpgraph_pie.php');
-require_once($sys_path_to_jpgraph.'/jpgraph_pie3d.php');
-
-function util_unconvert_htmlspecialchars($string) {
- if (strlen($string) < 1) {
- return '';
- } else {
- //$trans = get_html_translation_table(HTMLENTITIES, ENT_QUOTES);
- $trans = get_html_translation_table(HTML_ENTITIES);
- $trans = array_flip ($trans);
- $str = strtr ($string, $trans);
- return $str;
- }
-}
-
-function report_pie_arr($labels, $vals, $format=1) {
- global $pie_labels,$pie_vals;
- //first get sum of all values
- for ($i=0; $i<count($vals); $i++) {
- $total += $vals[$i];
- }
-
- //now prune out vals where < 2%
- $rem=0;
- $pie_labels='';
- $pie_vals='';
- for ($i=0; $i<count($vals); $i++) {
- if (($vals[$i]/$total) < .02) {
- $rem += $vals[$i];
- } else {
- $pie_labels[]=utf8_decode(util_unconvert_htmlspecialchars($labels[$i]))." (". number_format($vals[$i],$format) .") ".number_format($vals[$i]/$total*100,1)."%%";
- //$pie_vals[]=number_format($vals[$i],1);
- $pie_vals[]=$vals[$i];
- }
- }
- if ($rem > 0) {
- $pie_labels[]=_('Other')." (". number_format($rem,$format) .") ";
- //$pie_vals[]=number_format($rem,1);
- $pie_vals[]=$rem;
- }
-
-}
-
-
-
-$vals = array(2236,1029,687,623,577,466,302,221,205,188,1009);
-$labels=array("Jean","Paul","Pierre","Philippe","Aimé","Amédé","Noémi","Noël","Philibert","Alphonse","Autres");
-
-// Create the graph. These two calls are always required
-$graph = new PieGraph(640, 480,"auto");
-//$graph->SetMargin(50,10,35,50);
-setlocale(LC_TIME, "fr_FR.UTF-8");
-//setlocale(LC_TIME, "C");
-setlocale(LC_ALL, "fr_FR.UTF-8");
-$start=strtotime("12/28/2002");
-$end=strtotime("6/30/2004");
-
-//$graph->title->Set(_("Commits By User")." (".date('m/d/Y',$start) ."-". date('m/d/Y',$end) .")");
-$graph->title->Set(utf8_decode(_("Commits By User")." (".strftime('%x',$start) ." - ". strftime('%x',$end) .")"));
-$graph->subtitle->Set(forge_get_config ('forge_name'));
-
-// Create the tracker open plot
-////report_pie_arr(util_result_column_to_array($res,0), util_result_column_to_array($res,1));
-//$pie_vals=$vals;
-//$pie_labels=$labels;
-report_pie_arr($labels, $vals,0);
-
-//print_r($pie_vals);
-//print_r($pie_labels);
-
-$p1 = new PiePlot3D($pie_vals);
-$p1->ExplodeSlice (0);
-$p1->SetLegends($pie_labels);
-$graph->Add( $p1);
-
-// Display the graph
-$graph->Stroke();
-
-?>