qsos-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qsos-commits] qsos/apps/o3s commons.js config.php export_oo.p...


From: Raphaël Semeteys
Subject: [Qsos-commits] qsos/apps/o3s commons.js config.php export_oo.p...
Date: Fri, 02 Feb 2007 07:14:33 +0000

CVSROOT:        /sources/qsos
Module name:    qsos
Changes by:     Raphaël Semeteys <rsemeteys>   07/02/02 07:14:33

Added files:
        apps/o3s       : commons.js config.php export_oo.php index.php 
                         loadremote.php radar.php save_weighting.php 
                         search.js search.php set_weighting.php show.php 
                         software.php template.zip writeremote.php 

Log message:
        Codenamed Phpviewer is now o3S
        1.0 version

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/qsos/apps/o3s/commons.js?cvsroot=qsos&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/qsos/apps/o3s/config.php?cvsroot=qsos&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/qsos/apps/o3s/export_oo.php?cvsroot=qsos&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/qsos/apps/o3s/index.php?cvsroot=qsos&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/qsos/apps/o3s/loadremote.php?cvsroot=qsos&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/qsos/apps/o3s/radar.php?cvsroot=qsos&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/qsos/apps/o3s/save_weighting.php?cvsroot=qsos&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/qsos/apps/o3s/search.js?cvsroot=qsos&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/qsos/apps/o3s/search.php?cvsroot=qsos&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/qsos/apps/o3s/set_weighting.php?cvsroot=qsos&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/qsos/apps/o3s/show.php?cvsroot=qsos&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/qsos/apps/o3s/software.php?cvsroot=qsos&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/qsos/apps/o3s/template.zip?cvsroot=qsos&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/qsos/apps/o3s/writeremote.php?cvsroot=qsos&rev=1.1

Patches:
Index: commons.js
===================================================================
RCS file: commons.js
diff -N commons.js
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ commons.js  2 Feb 2007 07:14:33 -0000       1.1
@@ -0,0 +1,89 @@
+/*
+**  Copyright (C) 2007 Atos Origin 
+**
+**  Author: Raphael Semeteys <address@hidden>
+**
+**  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., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  
USA
+**
+**
+** O3S
+** commons.js: common JavaScript functions
+**
+*/
+
+function matchStart(target, pattern) {
+       var pos = target.indexOf(pattern);
+       if (pos == 0) {
+               return true;
+       } else {
+               return false;
+       }
+}
+
+function expand(div) {
+       var rows = document.getElementsByTagName("tr");
+       var id = div.parentNode.parentNode.id + "-";
+       for (var i = 0; i < rows.length; i++) {
+               var r = rows[i];
+               if (matchStart(r.id, id)) {
+                       if (document.all) r.style.display = "block"; //IE4+ 
specific code
+                       else r.style.display = "table-row"; //Netscape and 
Mozilla
+               }
+       }
+       div.className = "expanded";
+       div.onclick = function () {
+               collapse(this);
+       }
+}
+
+function collapse(div) {
+       var rows = document.getElementsByTagName("tr");
+       var id = div.parentNode.parentNode.id + "-";
+       for (var i = 0; i < rows.length; i++) {
+               var r = rows[i];
+               if (matchStart(r.id, id)) {
+                       r.style.display = "none";
+               }
+       }
+       div.className = "collapsed";
+       div.onclick = function () {
+               expand(this);
+       }
+}
+
+function collapseAll() {
+       var rows = document.getElementsByTagName("TR");
+               for (var j = 0; j < rows.length; j++) {
+               var r = rows[j];
+               if (r.id.indexOf("-") >= 0) {
+                       r.style.display = "none";
+               }
+       }
+       document.getElementById("all_selector").href = 
"javascript:expandAll();";
+       document.getElementById("all_selector").firstChild.nodeValue = "Expand 
All";
+}
+
+function expandAll() {
+       var rows = document.getElementsByTagName("TR");
+               for (var j = 0; j < rows.length; j++) {
+               var r = rows[j];
+               if (r.id.indexOf("-") >= 0) {
+                       if (document.all) r.style.display = "block"; //IE4+ 
specific code
+                       else r.style.display = "table-row"; //Netscape and 
Mozilla
+               }
+       }
+       document.getElementById("all_selector").href = 
"javascript:collapseAll();";
+       document.getElementById("all_selector").firstChild.nodeValue = 
"Collapse All";
+}
\ No newline at end of file

Index: config.php
===================================================================
RCS file: config.php
diff -N config.php
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ config.php  2 Feb 2007 07:14:33 -0000       1.1
@@ -0,0 +1,48 @@
+<?php
+/*
+**  Copyright (C) 2007 Atos Origin 
+**
+**  Author: Raphael Semeteys <address@hidden>
+**
+**  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., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  
USA
+**
+**
+** O3S
+** config.php: configuration file
+**
+*/
+
+//Local and web paths to QSOS sheets and templates
+$sheet = "sheets";
+$sheet_web = "http://localhost:88/o3s/sheets";;
+$template = "template";
+$template_web = "http://localhost:88/o3s/template";;
+$delim = "/";
+
+//Path to jpgraph library (for PNG graphs)
+$jpgraph_path = "libs/jpgraph-2.1.3/src/";
+
+//Temp directory, with trailing slash
+$temp = "/tmp/";
+
+//Activate/Deactivate OpenDocument exports caching
+$cache = "off";
+
+//Skin to use (CSS are stored in skins/ subdirectory)
+$skin = "default";
+
+//Locale to use (locale files are stored i, locales/ subdirectory)
+$lang = "fr-FR";
+?>
\ No newline at end of file

Index: export_oo.php
===================================================================
RCS file: export_oo.php
diff -N export_oo.php
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ export_oo.php       2 Feb 2007 07:14:33 -0000       1.1
@@ -0,0 +1,1042 @@
+<?php
+/*
+**  Copyright (C) 2007 Atos Origin 
+**
+**  Author: Raphael Semeteys <address@hidden>
+**
+**  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., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  
USA
+**
+**
+** O3S
+** export_oo.php: OpenDocument export
+**
+*/
+
+session_start();
+
+include("config.php");
+include("libs/QSOSDocument.php");
+include('libs/pclzip.lib.php');
+
+//XML file to be exported
+$file = $_GET['f'];
+//Name of the ODS file
+$odsfile = basename($file, ".qsos").".ods";
+
+//Global variables
+$numrow;
+$graph_formula_module;
+
+function showtree($output, $input, $tree, $table0, $table1, $depth) {
+       global $numrow;;
+       global $graph_formula_module;
+       $children = array();
+
+       $new_depth = $depth + 1;
+       $offset = $new_depth*10;
+       $idF = 0;
+
+       switch ($depth) {
+               case '0':
+                       //Section
+                       $style_row = 'ro1';
+                       $style_title = 'ce2';
+                       $style_comment = 'ce2';
+                       $style_score = 'ce5';
+                       $style_weight = 'ce5';
+                       break;
+               case '1':
+                       //Level 1 criterion
+                       $style_row = 'ro1';
+                       $style_title = 'ce3';
+                       $style_comment = 'ce3';
+                       $style_score = 'ce6';
+                       $style_weight = 'ce6';
+                       break;
+               case '2':
+                       //Level 2 criterion
+                       $style_row = 'ro1';
+                       $style_title = '';
+                       $style_comment = '';
+                       $style_score = '';
+                       $style_weight = '';
+                       break;
+               default:
+                       //Level N criterion,  N > 2
+                       $style_row = 'ro1';
+                       $style_title = 'ce8';
+                       $style_comment = 'ce8';
+                       $style_score = 'ce9';
+                       $style_weight = 'ce9';
+                       break;
+       }
+
+       $graph_formula_module1 = '';
+       $graph_formula_module2 = '';
+
+       foreach($tree as $element) {
+               $name = $element->name;
+               $title = $element->title;
+               $subtree = $element->children;
+               $comment = $input->getgeneric($name, "comment");
+
+               $numrow++;
+               array_push($children, $numrow);
+
+               if ($depth == '0') {
+                       $graph_formula_module1 .= "\$Evaluation.\$A\$$numrow;";
+                       $graph_formula_module2 .= "\$Evaluation.\$C\$$numrow;";
+               }
+
+               //New row for first sheet
+               $row = $output->createElement('table:table-row');
+               $row->setAttribute("table:style-name",$style_row);
+               //Criterion
+               $cell = $output->createElement('table:table-cell');
+               if ($style_title != "") 
$cell->setAttribute("table:style-name",$style_title);
+               $cell->setAttribute("office:value-type","string");
+               $text = $output->createElement('text:p',$title);
+               $cell->appendChild($text);
+               $row->appendChild($cell);
+               //Desc0
+               $cell = $output->createElement('table:table-cell');
+               if ($style_title != "") 
$cell->setAttribute("table:style-name",$style_title);
+               $cell->setAttribute("office:value-type","string");
+               $text = 
$output->createElement('text:p',$input->getgeneric($name, "desc0"));
+               $cell->appendChild($text);
+               $row->appendChild($cell);
+               //Desc1
+               $score = $output->createElement('table:table-cell');
+               if ($style_title != "") 
$score->setAttribute("table:style-name",$style_title);
+               $score->setAttribute("office:value-type","string");
+               $text = 
$output->createElement('text:p',$input->getgeneric($name, "desc1"));
+               $score->appendChild($text);
+               $row->appendChild($score);
+               //Desc2
+               $cell = $output->createElement('table:table-cell');
+               if ($style_title != "") 
$cell->setAttribute("table:style-name",$style_title);
+               $cell->setAttribute("office:value-type","string");
+               $text = 
$output->createElement('text:p',$input->getgeneric($name, "desc2"));
+               $cell->appendChild($text);
+               $row->appendChild($cell);
+
+               $table0->appendChild($row);
+
+               //New row for second sheet
+               $row = $output->createElement('table:table-row');
+               $row->setAttribute("table:style-name",$style_row);
+               //Criterion
+               $cell = $output->createElement('table:table-cell');
+               if ($style_title != "") 
$cell->setAttribute("table:style-name",$style_title);
+               $cell->setAttribute("office:value-type","string");
+               $text = $output->createElement('text:p',$title);
+               $cell->appendChild($text);
+               $row->appendChild($cell);
+               //Comment
+               $cell = $output->createElement('table:table-cell');
+               if ($style_comment != "") 
$cell->setAttribute("table:style-name",$style_comment);
+               $cell->setAttribute("office:value-type","string");
+               $text = $output->createElement('text:p',$comment);
+               $cell->appendChild($text);
+               $row->appendChild($cell);
+               //Score
+               $score = $output->createElement('table:table-cell');
+               if ($style_score != "") 
$score->setAttribute("table:style-name",$style_score);
+               $score->setAttribute("office:value-type","float");
+               $score->setAttribute("office:value",$element->score);
+               $text = $output->createElement('text:p',$element->score);
+               $score->appendChild($text);
+               $row->appendChild($score);
+               //Weight
+               $cell = $output->createElement('table:table-cell');
+               if ($style_weight != "") 
$cell->setAttribute("table:style-name",$style_weight);
+               $cell->setAttribute("office:value-type","float");
+               $cell->setAttribute("office:value",$_SESSION[$name]);
+               $text = $output->createElement('text:p',$_SESSION[$name]);
+               $cell->appendChild($text);
+               $row->appendChild($cell);
+
+               $table1->appendChild($row);
+
+               if ($subtree) {
+                       //Subcriteria regrouping
+                       $group0 = 
$output->createElement('table:table-row-group');
+                       $group = 
$output->createElement('table:table-row-group');
+                       $return = showtree($output, $input, $subtree, $group0, 
$group, $new_depth);
+                       //Set score formula
+                       
$score->setAttribute("table:formula",getFormula($return));
+                       $table0->appendChild($group0);
+                       $table1->appendChild($group);
+               }
+       }
+
+       if ($depth == 0) {
+               $graph_formula_module = 
$graph_formula_module1.$graph_formula_module2;
+               return $children;
+       } else {
+               return $children;
+       }
+}
+
+function getFormula($cells) {
+       $quotient = "";
+       $dividend = "";
+       for ($i=0; $i < count($cells); $i++) {
+               if ($i != 0) {
+                       $quotient .= "+";
+                       $dividend .= "+";
+               }
+               $quotient .= "[.C".$cells[$i]."]*[.D".$cells[$i]."]";
+               $dividend .= "[.D".$cells[$i]."]";
+       }
+       return "oooc:=($quotient)/($dividend)";
+}
+
+function createODS($file) {
+       global $numrow;
+       global $odsfile;
+       global $graph_formula_module;
+       global $temp;
+       $input = new QSOSDocument("$file");
+       $output = new DOMDocument();
+       
+       //Document element
+       $document = $output->createElement('office:document-content');
+       
$document->setAttribute("xmlns:office","urn:oasis:names:tc:opendocument:xmlns:office:1.0");
+       
$document->setAttribute("xmlns:style","urn:oasis:names:tc:opendocument:xmlns:style:1.0");
+       
$document->setAttribute("xmlns:text","urn:oasis:names:tc:opendocument:xmlns:text:1.0");
+       
$document->setAttribute("xmlns:table","urn:oasis:names:tc:opendocument:xmlns:table:1.0");
+       
$document->setAttribute("xmlns:draw","urn:oasis:names:tc:opendocument:xmlns:drawing:1.0");
+       
$document->setAttribute("xmlns:fo","urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0");
+       $document->setAttribute("xmlns:xlink","http://www.w3.org/1999/xlink";);
+       $document->setAttribute("xmlns:dc","http://purl.org/dc/elements/1.1/";);
+       
$document->setAttribute("xmlns:meta","urn:oasis:names:tc:opendocument:xmlns:meta:1.0");
+       
$document->setAttribute("xmlns:number","urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0");
+       
$document->setAttribute("xmlns:svg","urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0");
+       
$document->setAttribute("xmlns:chart","urn:oasis:names:tc:opendocument:xmlns:chart:1.0");
+       
$document->setAttribute("xmlns:dr3d","urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0");
+       
$document->setAttribute("xmlns:math","http://www.w3.org/1998/Math/MathML";);
+       
$document->setAttribute("xmlns:form","urn:oasis:names:tc:opendocument:xmlns:form:1.0");
+       
$document->setAttribute("xmlns:script","urn:oasis:names:tc:opendocument:xmlns:script:1.0");
+       
$document->setAttribute("xmlns:ooo","http://openoffice.org/2004/office";);
+       
$document->setAttribute("xmlns:ooow","http://openoffice.org/2004/writer";);
+       $document->setAttribute("xmlns:oooc","http://openoffice.org/2004/calc";);
+       
$document->setAttribute("xmlns:dom","http://www.w3.org/2001/xml-events";);
+       $document->setAttribute("xmlns:xforms","http://www.w3.org/2002/xforms";);
+       $document->setAttribute("xmlns:xsd","http://www.w3.org/2001/XMLSchema";);
+       
$document->setAttribute("xmlns:xsi","http://www.w3.org/2001/XMLSchema-instance";);
+       $document->setAttribute("office:version","1.0");
+       
+       $scripts = $output->createElement('office:scripts');
+       $listeners = $output->createElement('office:event-listeners');
+       $listener = $output->createElement('script:event-listener');
+       $listener->setAttribute("script:language","ooo:script");
+       $listener->setAttribute("script:event-name","dom:load");
+       
$listener->setAttribute("xlink:href","vnd.sun.star.script:Standard.Module1.Graph?language=Basic&location=document");
+       $listeners->appendChild($listener);
+       $scripts->appendChild($listeners);
+       $document->appendChild($scripts);
+       
+       //Font declaration
+       $fontfaces = $output->createElement('office:font-face-decls');
+       
+       $font = $output->createElement('style:font-face');
+       $font->setAttribute("style:name","Lucida Sans Unicode");
+       $font->setAttribute("svg:font-family","'Lucida Sans Unicode'");
+       $font->setAttribute("style:font-pitch","variable");
+       $fontfaces->appendChild($font);
+       
+       $font = $output->createElement('style:font-face');
+       $font->setAttribute("style:name","Tahoma");
+       $font->setAttribute("svg:font-family","Tahoma");
+       $font->setAttribute("style:font-pitch","variable");
+       $fontfaces->appendChild($font);
+       
+       $font = $output->createElement('style:font-face');
+       $font->setAttribute("style:name","Arial");
+       $font->setAttribute("svg:font-family","Arial");
+       $font->setAttribute("style:font-pitch","variable");
+       $fontfaces->appendChild($font);
+       
+       $font = $output->createElement('style:font-face');
+       $font->setAttribute("style:name","Arial");
+       $font->setAttribute("svg:font-family","Arial");
+       $font->setAttribute("style:font-family-generic","swiss");
+       $font->setAttribute("style:font-pitch","variable");
+       $fontfaces->appendChild($font);
+       
+       $document->appendChild($fontfaces);
+       
+       //Styles
+       $styles = $output->createElement('office:automatic-styles');
+
+       //co0
+       $style = $output->createElement('style:style');
+       $style->setAttribute("style:name","co0");
+       $style->setAttribute("style:family","table-column");
+       $substyle = $output->createElement('style:table-column-properties');
+       $substyle->setAttribute("fo:break-before","auto");
+       $substyle->setAttribute("style:column-width","4.717cm");
+       $style->appendChild($substyle);
+       $styles->appendChild($style);
+
+       //co1
+       $style = $output->createElement('style:style');
+       $style->setAttribute("style:name","co1");
+       $style->setAttribute("style:family","table-column");
+       $substyle = $output->createElement('style:table-column-properties');
+       $substyle->setAttribute("fo:break-before","auto");
+       $substyle->setAttribute("style:column-width","5.117cm");
+       $style->appendChild($substyle);
+       $styles->appendChild($style);
+       
+       //co2
+       $style = $output->createElement('style:style');
+       $style->setAttribute("style:name","co2");
+       $style->setAttribute("style:family","table-column");
+       $substyle = $output->createElement('style:table-column-properties');
+       $substyle->setAttribute("fo:break-before","auto");
+       $substyle->setAttribute("style:column-width","10.931cm");
+       $style->appendChild($substyle);
+       $styles->appendChild($style);
+       
+       //co3
+       $style = $output->createElement('style:style');
+       $style->setAttribute("style:name","co3");
+       $style->setAttribute("style:family","table-column");
+       $substyle = $output->createElement('style:table-column-properties');
+       $substyle->setAttribute("fo:break-before","auto");
+       $substyle->setAttribute("style:column-width","1.452cm");
+       $style->appendChild($substyle);
+       $styles->appendChild($style);
+       
+       //co4
+       $style = $output->createElement('style:style');
+       $style->setAttribute("style:name","co4");
+       $style->setAttribute("style:family","table-column");
+       $substyle = $output->createElement('style:table-column-properties');
+       $substyle->setAttribute("fo:break-before","auto");
+       $substyle->setAttribute("style:column-width","1.452cm");
+       $style->appendChild($substyle);
+       $styles->appendChild($style);
+       
+       //ro1
+       $style = $output->createElement('style:style');
+       $style->setAttribute("style:name","ro1");
+       $style->setAttribute("style:family","table-row");
+       $substyle = $output->createElement('style:table-row-properties');
+       $substyle->setAttribute("style:row-height","0.453cm");
+       $substyle->setAttribute("fo:break-before","auto");
+       $substyle->setAttribute("style:use-optimal-row-height","true");
+       $style->appendChild($substyle);
+       $styles->appendChild($style);
+       
+       //ro2
+       $style = $output->createElement('style:style');
+       $style->setAttribute("style:name","ro2");
+       $style->setAttribute("style:family","table-row");
+       $substyle = $output->createElement('style:table-row-properties');
+       $substyle->setAttribute("style:row-height","0.453cm");
+       $substyle->setAttribute("fo:break-before","auto");
+       $substyle->setAttribute("style:use-optimal-row-height","true");
+       $style->appendChild($substyle);
+       $styles->appendChild($style);
+       
+       //ta1: basic table
+       $style = $output->createElement('style:style');
+       $style->setAttribute("style:name","ta1");
+       $style->setAttribute("style:family","table");
+       $style->setAttribute("style:master-page-name","Default");
+       $substyle = $output->createElement('style:table-properties');
+       $substyle->setAttribute("table:display","true");
+       $substyle->setAttribute("style:writing-mode","lr-tb");
+       $style->appendChild($substyle);
+       $styles->appendChild($style);
+       
+       //ce1
+       $style = $output->createElement('style:style');
+       $style->setAttribute("style:name","ce1");
+       $style->setAttribute("style:family","table-cell");
+       $style->setAttribute("style:parent-style-name","Default");
+       $substyle = $output->createElement('style:table-cell-properties');
+       $substyle->setAttribute("fo:wrap-option","wrap");
+       $substyle->setAttribute("style:vertical-align","middle");
+       $style->appendChild($substyle);
+       $substyle = $output->createElement('style:text-properties');
+       $substyle->setAttribute("fo:color","#ffffff");
+       $style->appendChild($substyle);
+       $styles->appendChild($style);
+       
+       //ce2
+       $style = $output->createElement('style:style');
+       $style->setAttribute("style:name","ce2");
+       $style->setAttribute("style:family","table-cell");
+       $style->setAttribute("style:parent-style-name","Default");
+       $substyle = $output->createElement('style:table-cell-properties');
+       $substyle->setAttribute("fo:background-color","#2323dc");
+       $substyle->setAttribute("fo:wrap-option","wrap");
+       $substyle->setAttribute("style:vertical-align","middle");
+       $style->appendChild($substyle);
+       $substyle = $output->createElement('style:text-properties');
+       $substyle->setAttribute("fo:color","#ffffff");
+       $substyle->setAttribute("fo:font-weight","bold");
+       $style->appendChild($substyle);
+       $styles->appendChild($style);
+       
+       //ce3
+       $style = $output->createElement('style:style');
+       $style->setAttribute("style:name","ce3");
+       $style->setAttribute("style:family","table-cell");
+       $style->setAttribute("style:parent-style-name","Default");
+       $substyle = $output->createElement('style:table-cell-properties');
+       $substyle->setAttribute("fo:wrap-option","wrap");
+       $substyle->setAttribute("style:vertical-align","middle");
+       $substyle->setAttribute("fo:background-color","#99ccff");
+       $style->appendChild($substyle);
+       $styles->appendChild($style);
+       
+       //ce4
+       $style = $output->createElement('style:style');
+       $style->setAttribute("style:name","ce4");
+       $style->setAttribute("style:family","table-cell");
+       $style->setAttribute("style:parent-style-name","Default");
+       $substyle = $output->createElement('style:table-cell-properties');
+       $substyle->setAttribute("fo:wrap-option","wrap");
+       $substyle->setAttribute("style:vertical-align","middle");
+       $substyle->setAttribute("fo:background-color","#ccffff");
+       $style->appendChild($substyle);
+       $styles->appendChild($style);
+       
+       //ce5
+       $style = $output->createElement('style:style');
+       $style->setAttribute("style:name","ce5");
+       $style->setAttribute("style:family","table-cell");
+       $style->setAttribute("style:parent-style-name","Default");
+       $substyle = $output->createElement('style:table-cell-properties');
+       $substyle->setAttribute("fo:background-color","#2323dc");
+       $substyle->setAttribute("style:text-align-source","fix");
+       $substyle->setAttribute("style:repeat-content","false");
+       $substyle->setAttribute("style:vertical-align","middle");
+       $style->appendChild($substyle);
+       $substyle = $output->createElement('style:paragraph-properties');
+       $substyle->setAttribute("fo:text-align","center");
+       $substyle->setAttribute("fo:margin-left","0cm");
+       $style->appendChild($substyle);
+       $substyle = $output->createElement('style:text-properties');
+       $substyle->setAttribute("fo:color","#ffffff");
+       $substyle->setAttribute("fo:font-weight","bold");
+       $style->appendChild($substyle);
+       $styles->appendChild($style);
+       
+       //ce6
+       $style = $output->createElement('style:style');
+       $style->setAttribute("style:name","ce6");
+       $style->setAttribute("style:family","table-cell");
+       $style->setAttribute("style:parent-style-name","Default");
+       $substyle = $output->createElement('style:table-cell-properties');
+       $substyle->setAttribute("fo:background-color","#99ccff");
+       $substyle->setAttribute("style:text-align-source","fix");
+       $substyle->setAttribute("style:repeat-content","false");
+       $substyle->setAttribute("style:vertical-align","middle");
+       $style->appendChild($substyle);
+       $substyle = $output->createElement('style:paragraph-properties');
+       $substyle->setAttribute("fo:text-align","center");
+       $substyle->setAttribute("fo:margin-left","0cm");
+       $style->appendChild($substyle);
+       $styles->appendChild($style);
+       
+       //ce7
+       $style = $output->createElement('style:style');
+       $style->setAttribute("style:name","ce7");
+       $style->setAttribute("style:family","table-cell");
+       $style->setAttribute("style:parent-style-name","Default");
+       $substyle = $output->createElement('style:table-cell-properties');
+       $substyle->setAttribute("fo:background-color","#ccffff");
+       $substyle->setAttribute("style:text-align-source","fix");
+       $substyle->setAttribute("style:repeat-content","false");
+       $substyle->setAttribute("style:vertical-align","middle");
+       $style->appendChild($substyle);
+       $substyle = $output->createElement('style:paragraph-properties');
+       $substyle->setAttribute("fo:text-align","center");
+       $substyle->setAttribute("fo:margin-left","0cm");
+       $style->appendChild($substyle);
+       $styles->appendChild($style);
+       
+       //ce8
+       $style = $output->createElement('style:style');
+       $style->setAttribute("style:name","ce8");
+       $style->setAttribute("style:family","table-cell");
+       $style->setAttribute("style:parent-style-name","Default");
+       $substyle = $output->createElement('style:table-cell-properties');
+       $substyle->setAttribute("style:text-align-source","fix");
+       $substyle->setAttribute("style:repeat-content","false");
+       $substyle->setAttribute("fo:wrap-option","wrap");
+       $substyle->setAttribute("style:vertical-align","middle");
+       $style->appendChild($substyle);
+       $styles->appendChild($style);
+       
+       //ce9
+       $style = $output->createElement('style:style');
+       $style->setAttribute("style:name","ce9");
+       $style->setAttribute("style:family","table-cell");
+       $style->setAttribute("style:parent-style-name","Default");
+       $substyle = $output->createElement('style:table-cell-properties');
+       $substyle->setAttribute("style:text-align-source","fix");
+       $substyle->setAttribute("style:repeat-content","false");
+       $substyle->setAttribute("style:vertical-align","middle");
+       $style->appendChild($substyle);
+       $substyle = $output->createElement('style:paragraph-properties');
+       $substyle->setAttribute("fo:text-align","center");
+       $substyle->setAttribute("fo:margin-left","0cm");
+       $style->appendChild($substyle);
+       $styles->appendChild($style);
+       
+       $document->appendChild($styles);
+       
+       //Document body
+       $body = $output->createElement('office:body');
+       $spreadsheet = $output->createElement('office:spreadsheet');
+
+       //First sheet (Criteria)
+       $table0 = $output->createElement('table:table');
+       $table0->setAttribute("table:name","Criteria");
+       $table0->setAttribute("table:style-name","ta1");
+       $table0->setAttribute("table:print","false");
+
+       $column = $output->createElement('table:table-column');
+       $column->setAttribute("table:style-name","co0");
+       $column->setAttribute("table:default-cell-style-name","ce4");
+       $table0->appendChild($column);
+       
+       $column = $output->createElement('table:table-column');
+       $column->setAttribute("table:style-name","co0");
+       $column->setAttribute("table:default-cell-style-name","ce4");
+       $table0->appendChild($column);
+
+       $column = $output->createElement('table:table-column');
+       $column->setAttribute("table:style-name","co0");
+       $column->setAttribute("table:default-cell-style-name","ce4");
+       $table0->appendChild($column);
+
+       $column = $output->createElement('table:table-column');
+       $column->setAttribute("table:style-name","co0");
+       $column->setAttribute("table:default-cell-style-name","ce4");
+       $table0->appendChild($column);
+
+       $row = $output->createElement('table:table-row');
+       $row->setAttribute("table:style-name","ro1");
+       $row->setAttribute("table:number-rows-repeated","2");
+       $cell = $output->createElement('table:table-cell');
+       $cell->setAttribute("table:style-name","Default");
+       $cell->setAttribute("table:number-columns-repeated","4");
+       $row->appendChild($cell);
+       $table0->appendChild($row);
+
+       //Software family
+       $row = $output->createElement('table:table-row');
+       $row->setAttribute("table:style-name","ro1");
+       $cell = $output->createElement('table:table-cell');
+       $cell->setAttribute("table:style-name","ce2");
+       $cell->setAttribute("office:value-type","string");
+       $text = $output->createElement('text:p',"Software family");
+       $cell->appendChild($text);
+       $row->appendChild($cell);
+       $cell = $output->createElement('table:table-cell');
+       $cell->setAttribute("table:style-name","ce8");
+       $cell->setAttribute("office:value-type","string");
+       $text = 
$output->createElement('text:p',$input->getkey("qsosappfamily"));
+       $cell->appendChild($text);
+       $row->appendChild($cell);
+       $cell = $output->createElement('table:table-cell');
+       $cell->setAttribute("table:style-name","ce8");
+       $cell->setAttribute("table:number-columns-repeated","2");
+       $row->appendChild($cell);
+       $table0->appendChild($row);
+
+       //QSOS version
+       $row = $output->createElement('table:table-row');
+       $row->setAttribute("table:style-name","ro1");
+       $cell = $output->createElement('table:table-cell');
+       $cell->setAttribute("table:style-name","ce2");
+       $cell->setAttribute("office:value-type","string");
+       $text = $output->createElement('text:p',"QSOS version");
+       $cell->appendChild($text);
+       $row->appendChild($cell);
+       $cell = $output->createElement('table:table-cell');
+       $cell->setAttribute("table:style-name","ce8");
+       $cell->setAttribute("office:value-type","string");
+       $text = $output->createElement('text:p',$input->getkey("qsosformat"));
+       $cell->appendChild($text);
+       $row->appendChild($cell);
+       $cell = $output->createElement('table:table-cell');
+       $cell->setAttribute("table:style-name","ce8");
+       $cell->setAttribute("table:number-columns-repeated","2");
+       $row->appendChild($cell);
+       $table0->appendChild($row);
+
+       //Template version
+       $row = $output->createElement('table:table-row');
+       $row->setAttribute("table:style-name","ro1");
+       $cell = $output->createElement('table:table-cell');
+       $cell->setAttribute("table:style-name","ce2");
+       $cell->setAttribute("office:value-type","string");
+       $text = $output->createElement('text:p',"Template version");
+       $cell->appendChild($text);
+       $row->appendChild($cell);
+       $cell = $output->createElement('table:table-cell');
+       $cell->setAttribute("table:style-name","ce8");
+       $cell->setAttribute("office:value-type","string");
+       $text = 
$output->createElement('text:p',$input->getkey("qsosspecificformat"));
+       $cell->appendChild($text);
+       $row->appendChild($cell);
+       $cell = $output->createElement('table:table-cell');
+       $cell->setAttribute("table:style-name","ce8");
+       $cell->setAttribute("table:number-columns-repeated","2");
+       $row->appendChild($cell);
+       $table0->appendChild($row);
+
+       $row = $output->createElement('table:table-row');
+       $row->setAttribute("table:style-name","ro1");
+       $row->setAttribute("table:number-rows-repeated","2");
+       $cell = $output->createElement('table:table-cell');
+       $cell->setAttribute("table:style-name","Default");
+       $cell->setAttribute("table:number-columns-repeated","4");
+       $row->appendChild($cell);
+       $table0->appendChild($row);
+
+       //Criteria
+       $row = $output->createElement('table:table-row');
+       $row->setAttribute("table:style-name","ro1");
+       $cell = $output->createElement('table:table-cell');
+       $cell->setAttribute("table:style-name","ce2");
+       $cell->setAttribute("office:value-type","string");
+       $text = $output->createElement('text:p','Criterion');
+       $cell->appendChild($text);
+       $row->appendChild($cell);
+       $cell = $output->createElement('table:table-cell');
+       $cell->setAttribute("table:style-name","ce2");
+       $cell->setAttribute("office:value-type","string");
+       $text = $output->createElement('text:p','Score 0');
+       $cell->appendChild($text);
+       $row->appendChild($cell);
+       $cell = $output->createElement('table:table-cell');
+       $cell->setAttribute("table:style-name","ce2");
+       $cell->setAttribute("office:value-type","string");
+       $text = $output->createElement('text:p','Score 1');
+       $cell->appendChild($text);
+       $row->appendChild($cell);
+       $cell = $output->createElement('table:table-cell');
+       $cell->setAttribute("table:style-name","ce2");
+       $cell->setAttribute("office:value-type","string");
+       $text = $output->createElement('text:p','Score 2');
+       $cell->appendChild($text);
+       $row->appendChild($cell);
+       $table0->appendChild($row);
+
+       //Second sheet (Evaluation)
+       $table1 = $output->createElement('table:table');
+       $table1->setAttribute("table:name","Evaluation");
+       $table1->setAttribute("table:style-name","ta1");
+       $table1->setAttribute("table:print","false");
+       
+       $column = $output->createElement('table:table-column');
+       $column->setAttribute("table:style-name","co1");
+       $column->setAttribute("table:default-cell-style-name","ce4");
+       $table1->appendChild($column);
+       
+       $column = $output->createElement('table:table-column');
+       $column->setAttribute("table:style-name","co2");
+       $column->setAttribute("table:default-cell-style-name","ce4");
+       $table1->appendChild($column);
+       
+       $column = $output->createElement('table:table-column');
+       $column->setAttribute("table:style-name","co3");
+       $column->setAttribute("table:default-cell-style-name","ce7");
+       $table1->appendChild($column);
+       
+       $column = $output->createElement('table:table-column');
+       $column->setAttribute("table:style-name","co4");
+       $column->setAttribute("table:default-cell-style-name","ce7");
+       $table1->appendChild($column);
+       
+       $row = $output->createElement('table:table-row');
+       $row->setAttribute("table:style-name","ro1");
+       $row->setAttribute("table:number-rows-repeated","2");
+       $cell = $output->createElement('table:table-cell');
+       $cell->setAttribute("table:style-name","Default");
+       $cell->setAttribute("table:number-columns-repeated","4");
+       $row->appendChild($cell);
+       $table1->appendChild($row);
+
+       //Header
+       //Application
+       $row = $output->createElement('table:table-row');
+       $row->setAttribute("table:style-name","ro1");
+       $cell = $output->createElement('table:table-cell');
+       $cell->setAttribute("table:style-name","ce2");
+       $cell->setAttribute("office:value-type","string");
+       $text = $output->createElement('text:p',"Application");
+       $cell->appendChild($text);
+       $row->appendChild($cell);
+       $cell = $output->createElement('table:table-cell');
+       $cell->setAttribute("table:style-name","ce8");
+       $cell->setAttribute("office:value-type","string");
+       $text = $output->createElement('text:p',$input->getkey("appname"));
+       $cell->appendChild($text);
+       $row->appendChild($cell);
+       $cell = $output->createElement('table:table-cell');
+       $cell->setAttribute("table:style-name","ce8");
+       $cell->setAttribute("table:number-columns-repeated","2");
+       $row->appendChild($cell);
+       $table1->appendChild($row);
+
+       //Release
+       $row = $output->createElement('table:table-row');
+       $row->setAttribute("table:style-name","ro1");
+       $cell = $output->createElement('table:table-cell');
+       $cell->setAttribute("table:style-name","ce2");
+       $cell->setAttribute("office:value-type","string");
+       $text = $output->createElement('text:p',"Release");
+       $cell->appendChild($text);
+       $row->appendChild($cell);
+       $cell = $output->createElement('table:table-cell');
+       $cell->setAttribute("table:style-name","ce8");
+       $cell->setAttribute("office:value-type","string");
+       $text = $output->createElement('text:p',$input->getkey("release"));
+       $cell->appendChild($text);
+       $row->appendChild($cell);
+       $cell = $output->createElement('table:table-cell');
+       $cell->setAttribute("table:style-name","ce8");
+       $cell->setAttribute("table:number-columns-repeated","2");
+       $row->appendChild($cell);
+       $table1->appendChild($row);
+
+       //Software family
+       $row = $output->createElement('table:table-row');
+       $row->setAttribute("table:style-name","ro1");
+       $cell = $output->createElement('table:table-cell');
+       $cell->setAttribute("table:style-name","ce2");
+       $cell->setAttribute("office:value-type","string");
+       $text = $output->createElement('text:p',"Software family");
+       $cell->appendChild($text);
+       $row->appendChild($cell);
+       $cell = $output->createElement('table:table-cell');
+       $cell->setAttribute("table:style-name","ce8");
+       $cell->setAttribute("office:value-type","string");
+       $text = 
$output->createElement('text:p',$input->getkey("qsosappfamily"));
+       $cell->appendChild($text);
+       $row->appendChild($cell);
+       $cell = $output->createElement('table:table-cell');
+       $cell->setAttribute("table:style-name","ce8");
+       $cell->setAttribute("table:number-columns-repeated","2");
+       $row->appendChild($cell);
+       $table1->appendChild($row);
+
+       //License
+       $row = $output->createElement('table:table-row');
+       $row->setAttribute("table:style-name","ro1");
+       $cell = $output->createElement('table:table-cell');
+       $cell->setAttribute("table:style-name","ce2");
+       $cell->setAttribute("office:value-type","string");
+       $text = $output->createElement('text:p',"License");
+       $cell->appendChild($text);
+       $row->appendChild($cell);
+       $cell = $output->createElement('table:table-cell');
+       $cell->setAttribute("table:style-name","ce8");
+       $cell->setAttribute("office:value-type","string");
+       $text = $output->createElement('text:p',$input->getkey("licensedesc"));
+       $cell->appendChild($text);
+       $row->appendChild($cell);
+       $cell = $output->createElement('table:table-cell');
+       $cell->setAttribute("table:style-name","ce8");
+       $cell->setAttribute("table:number-columns-repeated","2");
+       $row->appendChild($cell);
+       $table1->appendChild($row);
+
+       //Url
+       $row = $output->createElement('table:table-row');
+       $row->setAttribute("table:style-name","ro1");
+       $cell = $output->createElement('table:table-cell');
+       $cell->setAttribute("table:style-name","ce2");
+       $cell->setAttribute("office:value-type","string");
+       $text = $output->createElement('text:p',"Website");
+       $cell->appendChild($text);
+       $row->appendChild($cell);
+       $cell = $output->createElement('table:table-cell');
+       $cell->setAttribute("table:style-name","ce8");
+       $cell->setAttribute("office:value-type","string");
+       $text = $output->createElement('text:p',$input->getkey("url"));
+       $cell->appendChild($text);
+       $row->appendChild($cell);
+       $cell = $output->createElement('table:table-cell');
+       $cell->setAttribute("table:style-name","ce8");
+       $cell->setAttribute("table:number-columns-repeated","2");
+       $row->appendChild($cell);
+       $table1->appendChild($row);
+
+       //Description
+       $row = $output->createElement('table:table-row');
+       $row->setAttribute("table:style-name","ro1");
+       $cell = $output->createElement('table:table-cell');
+       $cell->setAttribute("table:style-name","ce2");
+       $cell->setAttribute("office:value-type","string");
+       $text = $output->createElement('text:p',"Description");
+       $cell->appendChild($text);
+       $row->appendChild($cell);
+       $cell = $output->createElement('table:table-cell');
+       $cell->setAttribute("table:style-name","ce8");
+       $cell->setAttribute("office:value-type","string");
+       $text = $output->createElement('text:p',$input->getkey("desc"));
+       $cell->appendChild($text);
+       $row->appendChild($cell);
+       $cell = $output->createElement('table:table-cell');
+       $cell->setAttribute("table:style-name","ce8");
+       $cell->setAttribute("table:number-columns-repeated","2");
+       $row->appendChild($cell);
+       $table1->appendChild($row);
+
+       //Authors
+       $authors = $input->getauthors();
+       $list = "";
+       for ($i=0; $i < count($authors); $i++) {
+               if ($i != 0) {
+                       $list .= ", ";
+               }
+               $list .= $authors[$i]->name." (".$authors[$i]->email.")";
+       }
+       $row = $output->createElement('table:table-row');
+       $row->setAttribute("table:style-name","ro1");
+       $cell = $output->createElement('table:table-cell');
+       $cell->setAttribute("table:style-name","ce2");
+       $cell->setAttribute("office:value-type","string");
+       $text = $output->createElement('text:p',"Authors");
+       $cell->appendChild($text);
+       $row->appendChild($cell);
+       $cell = $output->createElement('table:table-cell');
+       $cell->setAttribute("table:style-name","ce8");
+       $cell->setAttribute("office:value-type","string");
+       $text = $output->createElement('text:p',$list);
+       $cell->appendChild($text);
+       $row->appendChild($cell);
+       $cell = $output->createElement('table:table-cell');
+       $cell->setAttribute("table:style-name","ce8");
+       $cell->setAttribute("table:number-columns-repeated","2");
+       $row->appendChild($cell);
+       $table1->appendChild($row);
+
+       //Creation date
+       $row = $output->createElement('table:table-row');
+       $row->setAttribute("table:style-name","ro1");
+       $cell = $output->createElement('table:table-cell');
+       $cell->setAttribute("table:style-name","ce2");
+       $cell->setAttribute("office:value-type","string");
+       $text = $output->createElement('text:p',"Creation date");
+       $cell->appendChild($text);
+       $row->appendChild($cell);
+       $cell = $output->createElement('table:table-cell');
+       $cell->setAttribute("table:style-name","ce8");
+       $cell->setAttribute("office:value-type","string");
+       $text = $output->createElement('text:p',$input->getkey("creation"));
+       $cell->appendChild($text);
+       $row->appendChild($cell);
+       $cell = $output->createElement('table:table-cell');
+       $cell->setAttribute("table:style-name","ce8");
+       $cell->setAttribute("table:number-columns-repeated","2");
+       $row->appendChild($cell);
+       $table1->appendChild($row);
+
+       //Validation date
+       $row = $output->createElement('table:table-row');
+       $row->setAttribute("table:style-name","ro1");
+       $cell = $output->createElement('table:table-cell');
+       $cell->setAttribute("table:style-name","ce2");
+       $cell->setAttribute("office:value-type","string");
+       $text = $output->createElement('text:p',"Validation date");
+       $cell->appendChild($text);
+       $row->appendChild($cell);
+       $cell = $output->createElement('table:table-cell');
+       $cell->setAttribute("table:style-name","ce8");
+       $cell->setAttribute("office:value-type","string");
+       $text = $output->createElement('text:p',$input->getkey("validation"));
+       $cell->appendChild($text);
+       $row->appendChild($cell);
+       $cell = $output->createElement('table:table-cell');
+       $cell->setAttribute("table:style-name","ce8");
+       $cell->setAttribute("table:number-columns-repeated","2");
+       $row->appendChild($cell);
+       $table1->appendChild($row);
+
+       $row = $output->createElement('table:table-row');
+       $row->setAttribute("table:style-name","ro1");
+       $row->setAttribute("table:number-rows-repeated","2");
+       $cell = $output->createElement('table:table-cell');
+       $cell->setAttribute("table:style-name","Default");
+       $cell->setAttribute("table:number-columns-repeated","4");
+       $row->appendChild($cell);
+       $table1->appendChild($row);
+
+       //Criteria
+       $row = $output->createElement('table:table-row');
+       $row->setAttribute("table:style-name","ro1");
+       $cell = $output->createElement('table:table-cell');
+       $cell->setAttribute("table:style-name","ce2");
+       $cell->setAttribute("office:value-type","string");
+       $text = $output->createElement('text:p','Criterion');
+       $cell->appendChild($text);
+       $row->appendChild($cell);
+       $cell = $output->createElement('table:table-cell');
+       $cell->setAttribute("table:style-name","ce2");
+       $cell->setAttribute("office:value-type","string");
+       $text = $output->createElement('text:p','Comment');
+       $cell->appendChild($text);
+       $row->appendChild($cell);
+       $cell = $output->createElement('table:table-cell');
+       $cell->setAttribute("table:style-name","ce5");
+       $cell->setAttribute("office:value-type","string");
+       $text = $output->createElement('text:p','Score');
+       $cell->appendChild($text);
+       $row->appendChild($cell);
+       $cell = $output->createElement('table:table-cell');
+       $cell->setAttribute("table:style-name","ce5");
+       $cell->setAttribute("office:value-type","string");
+       $text = $output->createElement('text:p','Weight');
+       $cell->appendChild($text);
+       $row->appendChild($cell);
+       $table1->appendChild($row);
+       
+       //Init row counter
+       $numrow = 14;
+       
+       //Init loop
+       showtree($output, $input, $input->getTree(), $table0, $table1, 0);
+       
+       //Third sheet (Graph)
+       $table2 = $output->createElement('table:table');
+       $table2->setAttribute("table:name","Graph");
+       $table2->setAttribute("table:style-name","ta1");
+       $table2->setAttribute("table:print","false");
+
+       $forms = $output->createElement('office:forms');
+       $forms->setAttribute("form:automatic-focus","false");
+       $forms->setAttribute("form:apply-design-mode","false");
+       $table2->appendChild($forms);
+
+       $column = $output->createElement('table:table-column');
+       $column->setAttribute("table:style-name","co2");
+       $column->setAttribute("table:default-cell-style-name","Default");
+       $table2->appendChild($column);
+
+       $row = $output->createElement('table:table-row');
+       $row->setAttribute("table:style-name","ro1");
+       $row->setAttribute("table:number-rows-repeated","2");
+       $cell = $output->createElement('table:table-cell');
+       $row->appendChild($cell);
+       $table2->appendChild($row);
+
+       $row = $output->createElement('table:table-row');
+       $row->setAttribute("table:style-name","ro1");
+       $cell = $output->createElement('table:table-cell');
+       $frame = $output->createElement('draw:frame');
+       $frame->setAttribute("table:end-cell-address","Graph.I32");
+       $frame->setAttribute("table:end-x","0.449cm");
+       $frame->setAttribute("table:end-y","0.104cm");
+       $frame->setAttribute("draw:z-index","0");
+       $frame->setAttribute("svg:width","17.669cm");
+       $frame->setAttribute("svg:height","12.024cm");
+       $frame->setAttribute("svg:x","0.844cm");
+       $frame->setAttribute("svg:y","0.412cm");
+       $object = $output->createElement('draw:object');
+       
$object->setAttribute("draw:notify-on-update-of-ranges","Criteria.A1:Criteria.A1");
+       $object->setAttribute("xlink:href","./Object 1");
+       $object->setAttribute("xlink:type","simple");
+       $object->setAttribute("xlink:show","embed");
+       $object->setAttribute("xlink:actuate","onLoad");
+       $frame->appendChild($object);
+       $image = $output->createElement('draw:image');
+       $image->setAttribute("xlink:href","./ObjectReplacements/Object 1");
+       $image->setAttribute("xlink:type","simple");
+       $image->setAttribute("xlink:show","embed");
+       $image->setAttribute("xlink:actuate","onLoad");
+       $frame->appendChild($image);
+       $cell->appendChild($frame);
+       $row->appendChild($cell);
+       $table2->appendChild($row);
+
+       $spreadsheet->appendChild($table0);
+       $spreadsheet->appendChild($table1);
+       $spreadsheet->appendChild($table2);
+       $body->appendChild($spreadsheet);
+       $document->appendChild($body);
+       $output->appendChild($document);
+       
+       $tempdir = $temp.uniqid();
+       mkdir($tempdir, 0755);
+       $output->save("$tempdir/content.xml");
+
+       //Macro definition
+       $output = new DOMDocument();
+       $document = $output->createElement('script:module');
+       
$document->setAttribute("xmlns:script","http://openoffice.org/2000/script";);
+       $document->setAttribute("script:name","Module1");
+       $document->setAttribute("script:language","StarBasic");
+
+       $macro = "\n \nSub Main\n \n \nEnd Sub\n \n";
+       $macro .= "sub Graph\n \n";
+       $macro .= "dim document   as object\n";
+       $macro .= "dim dispatcher as object\n \n";      
+       $macro .= "document   = ThisComponent.CurrentController.Frame\n";
+       $macro .= "dispatcher = 
createUnoService(\"com.sun.star.frame.DispatchHelper\")\n \n";
+       $macro .= "dim args2(3) as new com.sun.star.beans.PropertyValue\n";
+       $macro .= "args2(0).Name = \"Name\"\n";
+       $macro .= "args2(0).Value = \"Object 1\"\n";
+       $macro .= "args2(1).Name = \"Range\"\n";
+       //$macro .= "args2(1).Value = 
\"\$Evaluation.\$A\$15;\$Evaluation.\$A\$74;\$Evaluation.\$A\$102;\$Evaluation.\$A\$108;\$Evaluation.\$C\$15;\$Evaluation.\$C\$74;\$Evaluation.\$C\$102;\$Evaluation.\$C\$108\"\n";
+       $macro .= "args2(1).Value = \"$graph_formula_module\"\n";
+       $macro .= "args2(2).Name = \"ColHeaders\"\n";
+       $macro .= "args2(2).Value = false\n";
+       $macro .= "args2(3).Name = \"RowHeaders\"\n";
+       $macro .= "args2(3).Value = true\n \n";
+       $macro .= 
"dispatcher.executeDispatch(document,\".uno:ChangeChartData\", \"\", 0, 
args2())\n \n";
+       $macro .= "end sub";
+
+       $document->appendChild($output->createTextNode($macro));
+       $output->appendChild($document);
+
+       $output->save("$tempdir/Module1.xml");
+       
+       copy("template.zip", "ods/$odsfile");
+       
+       $oofile = new PclZip("ods/$odsfile");
+       $v_list = $oofile->add("$tempdir/content.xml", PCLZIP_OPT_REMOVE_PATH, 
$tempdir);
+       if ($v_list == 0) {
+               die("Error 01: ODS generation");
+       }
+       $v_list = $oofile->add("$tempdir/Module1.xml", PCLZIP_OPT_REMOVE_PATH, 
$tempdir,
+                          PCLZIP_OPT_ADD_PATH, 'Basic/Standard');
+       if ($v_list == 0) {
+               die("Error 02: ODS generation");
+       }
+}
+
+//Uncomment to manage a cache
+//if (!(file_exists("ods/$odsfile"))) {
+       createODS($file);
+//}
+
+//Return ODS file to the browser
+header("Location: ods/$odsfile");
+exit;
+
+?>
\ No newline at end of file

Index: index.php
===================================================================
RCS file: index.php
diff -N index.php
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ index.php   2 Feb 2007 07:14:33 -0000       1.1
@@ -0,0 +1,92 @@
+<?php
+/*
+**  Copyright (C) 2007 Atos Origin 
+**
+**  Author: Raphael Semeteys <address@hidden>
+**
+**  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., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  
USA
+**
+**
+** O3S
+** index.php: lists software families and shows search box
+**
+*/
+
+include("config.php");
+include("locales/$lang.php");
+
+echo "<html>\n";
+echo "<head>\n";
+echo "<LINK REL=StyleSheet HREF='skins/$skin/o3s.css' TYPE='text/css'/>\n";
+echo "</head>\n";
+
+echo "<body>\n";
+echo "<center>\n";
+echo "<img src='skins/$skin/o3s.png'/>\n";
+echo "<br/><br/>\n";
+
+//Returns array of software families
+function getFamilies($dir) {
+       global $delim;
+       $families = array();
+       if (is_dir($dir)) {
+               if ($dh = opendir($dir)) {
+                       while (($file = readdir($dh)) !== false) {
+                               if (is_dir($dir.$delim.$file) 
+                               && ($file != 'CVS') 
+                               && ($file != '.') 
+                               && ($file != '..') 
+                               && ($file != 'include') 
+                               && ($file != 'template') 
+                               && ($file != 'templates') 
+                               && ($file != '.svn')) {
+                                       array_push($families, $file);
+                               }
+                       }
+                       closedir($dh);
+               }
+       }
+       return (isset($families) ? $families : false);
+}
+
+$families = getFamilies($sheet);
+
+echo "<div style='font-weight: bold'>".$msg['s1_title']."<br/><br/>\n";
+
+echo "<table style='border-collapse: collapse'>\n";
+echo "<tr class='title'>\n";
+echo "<td>".$msg['s1_table_title']."</td>\n";
+echo "</tr>\n";
+
+for ($i=0; $i<count($families); $i++) {
+       echo "<tr class='level1' 
+               onmouseover=\"this.setAttribute('class','highlight')\" 
+               onmouseout=\"this.setAttribute('class','level1')\">\n";
+       echo "<td><a 
href='set_weighting.php?family=$families[$i]'>$families[$i]</a></td>\n";
+       echo "</tr>\n";
+}
+
+echo "</table>\n";
+
+echo "<p>".$msg['s1_search']."<br/><form action='search.php' method='post'>
+       <input type='text' name='s' size='20' maxlength='30'/>
+       <input type='submit' value='".$msg['s1_button']."'/>
+</form></p>";
+echo "</div>\n";
+
+echo "</center>\n";
+echo "</body>\n";
+echo "</html>\n";
+?>
\ No newline at end of file

Index: loadremote.php
===================================================================
RCS file: loadremote.php
diff -N loadremote.php
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ loadremote.php      2 Feb 2007 07:14:33 -0000       1.1
@@ -0,0 +1,91 @@
+<?php
+/*
+**  Copyright (C) 2007 Atos Origin 
+**
+**  Author: Raphael Semeteys <address@hidden>
+**
+**  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., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  
USA
+**
+**
+** O3S - Backend for remote clients
+** loadremote.php: lists software families and shows search box
+**
+*/
+
+include("config.php");
+
+$output = new DOMDocument();
+
+//Should we return the templates list or the sheets list?
+$selector = $_REQUEST["tpl"];
+if (isset($selector) && $selector == "yes") $list_templates = true;
+
+function getListTemplates($path, $webpath) {
+       global $output;
+       global $delim;
+
+       $templates = $output->createElement("templates");
+       if (is_dir($path) && $dh = opendir($path)) {
+               while (($file = readdir($dh)) !== false) {
+                       if (substr($file, -5) == ".qsos") {
+                               $newtreeitem = $output->createElement("item");
+                               $newtreeitem->setAttribute("id", 
$webpath.$delim.$file);
+                               $newtreeitem->setAttribute("label", $file);
+                               $templates->appendChild($newtreeitem);
+                       }
+               }
+               closedir($dh);
+       }
+       return $templates;
+}
+
+function buildTreeSheets($path, $webpath) {
+       global $output;
+       global $delim;
+
+       $children = $output->createElement("children");
+       if (is_dir($path) && $dh = opendir($path)) {
+               while (($file = readdir($dh)) !== false) {
+                       $subpath = $path.$delim.$file;
+                       $newwebpath = $webpath.$delim.$file;
+                       if (is_dir($subpath) && ($file != 'CVS') && ($file != 
'.') && ($file != '..') && ($file != 'include') && ($file != 'template') && 
($file != 'templates') && ($file != '.svn')) {
+                               $newtreeitem = $output->createElement("item");
+                               $newtreeitem->setAttribute("id", $newwebpath);
+                               $newtreeitem->setAttribute("label", $file);
+                               
$newtreeitem->appendChild(buildTreeSheets($subpath, $newwebpath));
+                               $children->appendChild($newtreeitem);
+                       } elseif (substr($file, -5) == ".qsos") {
+                               $newtreeitem = $output->createElement("item");
+                               $newtreeitem->setAttribute("id", $newwebpath);
+                               $newtreeitem->setAttribute("label", $file);
+                               $children->appendChild($newtreeitem);
+                       }
+               }
+               closedir($dh);
+       }
+       return $children;
+}
+
+$doc = $output->createElement("Document");
+if ($list_templates) {
+       $output->appendChild(getListTemplates($template, $template_web));
+} else {
+       $output->appendChild(buildTreeSheets($sheet, $sheet_web));
+}
+
+header('Content-type: text/xml');
+echo $output->saveXML();
+
+?>
\ No newline at end of file

Index: radar.php
===================================================================
RCS file: radar.php
diff -N radar.php
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ radar.php   2 Feb 2007 07:14:33 -0000       1.1
@@ -0,0 +1,472 @@
+<?php
+/*
+**  Copyright (C) 2007 Atos Origin 
+**
+**  Author: Raphael Semeteys <address@hidden>
+**
+**  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., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  
USA
+**
+**
+** O3S
+** radar.php: graph generation (in SVG or PNG format)
+**
+*/
+
+session_start();
+
+//Is the graph to be generated in SVG?
+$svg = $_REQUEST['svg'];
+//SOftware family
+$family = $_REQUEST['family'];
+//Weigntings are stored in session
+$weights = $_SESSION;
+
+if(isset($svg) && ($svg == "yes")) {
+//Graph generated in SVG format
+       header("Content-type: image/svg+xml");
+       include('libs/QSOSDocument.php');
+       
+       $files = $_REQUEST['f']; //QSOS files to display
+       $name = $_REQUEST['c']; //Criterion to detail
+       
+       if (!(isset($files))) {
+               die("No QSOS file provided!");
+       }
+       
+       $SCALE = 70; //1 QSOS unit in pixels
+       $FONT_SIZE = 12; //$SCALE/10;
+       $dx = 500; // X offset
+       $dy = 300; // Y offset
+       $doc = new DOMDocument('1.0');
+       
+       $myDoc = array();
+       $num = count($files);
+       
+       //Initialization of data arrays
+       for($i=0; $i<$num; $i++) {
+               $myDoc[$i] = new QSOSDocument($files[$i]);
+       }
+       
+       //draw $n equidistant axis
+       function drawAxis($n) {
+               global $SCALE;
+               drawCircle(0.5*$SCALE);
+               drawMark(0.5*$SCALE-25, 15, "0.5");
+               drawCircle($SCALE);
+               drawMark($SCALE-15, 15, "1");
+               drawCircle(1.5*$SCALE);
+               drawMark(1.5*$SCALE-25, 15, "1.5");
+               drawCircle(2*$SCALE);
+               drawMark(2*$SCALE-15, 15, "2");
+               
+               //N: should be commented
+               for ($i=1; $i < $n+1; $i++) {
+                       drawSingleAxis(2*$i*pi()/$n);
+               }
+       }
+       
+       //draw a single axis at $angle (in radians) from angle 0        
+       function drawSingleAxis($angle) {
+               global $SCALE, $dx, $dy;
+               $x2 = 2*$SCALE*cos($angle) + $dx;
+               $y2 = 2*$SCALE*sin($angle) + $dy;
+               drawLine($dx, $dy, $x2, $y2);
+       }
+       
+       //draw a circle of $r radius
+       function drawCircle($r) {
+               global $doc;
+               global $g, $dx, $dy;
+               $circle = $doc->createElement("circle");
+               $circle->setAttribute("cx", $dx);
+               $circle->setAttribute("cy", $dy);
+               $circle->setAttribute("r", $r);
+               $circle->setAttribute("fill", "none");
+               $circle->setAttribute("stroke", "lightgrey");
+               $circle->setAttribute("stroke-width", "1");
+               $g->appendChild($circle);
+       }
+       
+       //draw a line between two points
+       function drawLine($x1, $y1, $x2, $y2) {
+               global $doc;
+               global $g, $dx, $dy;
+               $line = $doc->createElement("line");
+               $line->setAttribute("x1", $x1);
+               $line->setAttribute("y1", $y1);
+               $line->setAttribute("x2", $x2);
+               $line->setAttribute("y2", $y2);
+               $line->setAttribute("stroke", "lightgrey");
+               $line->setAttribute("stroke-width", "1");
+               $g->appendChild($line);
+       }
+       
+       //draw scale mark on the radar
+       //$x, $y: coordinates
+       //$mark : text to be displayed
+       function drawMark($x, $y, $mark) {
+               global $doc;
+               global $g, $dx, $dy;
+               global $FONT_SIZE;
+               $text = $doc->createElement("text");
+               $text->setAttribute("x", $x + $dx);
+               $text->setAttribute("y", $y + $dy);
+               $text->setAttribute("font-family", "Verdana");
+               $text->setAttribute("font-size", $FONT_SIZE);
+       
+               $text->setAttribute("fill", "lightgrey");
+               $text->appendChild($doc->createTextNode($mark));
+               $g->appendChild($text);
+       }
+       
+       //draw an axis legend
+       //$x, $y: coordinates
+       //$element : element which title is to be displayed
+       function drawText($x, $y, $element) {
+               global $files;
+               global $doc;
+               global $family;
+               global $g, $dx, $dy;
+               global $FONT_SIZE;
+               $text = $doc->createElement("text");
+               $text->setAttribute("x", $x + $dx);
+               $text->setAttribute("y", $y + $dy);
+               $text->setAttribute("font-family", "Verdana");
+               $text->setAttribute("font-size", $FONT_SIZE);
+               $text->appendChild($doc->createTextNode($element->title));
+               
+               if ($element->children) {
+                       $text->setAttribute("fill", "green");
+                       $a = $doc->createElement("a");
+                       $f = "";
+                       foreach($files as $file) {
+                               $f .= "f[]=$file&";
+                       }
+                       $a->setAttribute("xlink:href", 
$_SERVER['PHP_SELF']."?family=$family&".$f."c=".$element->name."&svg=yes");
+                       $a->appendChild($text);
+                       $g->appendChild($a);
+               } else {
+                       $text->setAttribute("fill", "black");
+                       $g->appendChild($text);
+               }
+               
+               //text position is ajusted to be outside the circle shape
+               //8 here is empiric data :)
+               $textLength = strlen($element->title)*8;
+               $myX = (abs($x)==$x)?$x:$x-$textLength;
+               $myY = (abs($y)==$y)?$y+$FONT_SIZE:$y;
+               $text->setAttribute("x", $myX + $dx);
+               $text->setAttribute("y", $myY + $dy);
+       }
+
+       //draw "Up" and "Back" links under the navigation tree
+       //$name : name of the current criterion
+       function drawNavBar($name) {
+               global $doc;
+               global $myDoc;
+               global $files;
+               global $family;
+               global $g;
+
+               $f = "";
+               foreach($files as $file) {
+                       $f .= "f[]=$file&";
+               }
+
+               $a = $doc->createElement("a");
+               
$a->setAttribute("xlink:href","show.php?family=$family&".$f."svg=yes");
+               $text = $doc->createElement("text");
+               $text->setAttribute("x", 0);
+               $text->setAttribute("y", 25);
+               $text->setAttribute("fill", "green");
+               $text->appendChild($doc->createTextNode("Back"));
+               $a->appendChild($text);
+               $g->appendChild($a);
+
+               if ($myDoc[0]->getParent($name)) {
+                       $a = $doc->createElement("a");
+                       $a->setAttribute("xlink:href", 
$_SERVER['PHP_SELF']."?family=$family&".$f."c=".$myDoc[0]->getParent($name)->getAttribute("name")."&svg=yes");
+                       $text = $doc->createElement("text");
+                       $text->setAttribute("x", 50);
+                       $text->setAttribute("y", 25);
+                       $text->setAttribute("fill", "green");
+                       $text->appendChild($doc->createTextNode("Up"));
+                       $a->appendChild($text);
+                       $g->appendChild($a);
+               }
+       }
+
+       //draw the graph's title including software name and release and 
navigation tree
+       //$name : name of the current criterion
+       function drawTitle($name) {
+               global $doc;
+               global $myDoc;
+               global $files;
+               global $FONT_SIZE;
+       
+               $text = $doc->createElement("text");
+               $text->setAttribute("font-family", "Verdana");
+               $text->setAttribute("font-weight", "bold");
+               $text->setAttribute("font-size", $FONT_SIZE);
+               
+               $tspan = $doc->createElement("tspan");
+               $tspan->appendChild($doc->createTextNode($title = 
$myDoc[0]->getkeytitle($name)));
+               $text->appendChild($tspan);
+
+               $lasttspan = $tspan;
+
+               $f = "";
+               foreach($files as $file) {
+                       $f .= "f[]=$file&";
+               }
+
+               $node = $name;
+               while ($myDoc[0]->getParent($node)) {
+                       $tspan = $doc->createElement("tspan");
+                       
$tspan->appendChild($doc->createTextNode($myDoc[0]->getParent($node)->getAttribute("title")
 . " > "));
+                       $text->insertBefore($tspan, $lasttspan);
+                       $node = 
$myDoc[0]->getParent($node)->getAttribute("name");
+                       $lasttspan = $tspan;
+               }
+
+               for ($i=0; $i < count($myDoc); $i++) {
+                       $tspan = $doc->createElement("tspan");
+                       $tspan->setAttribute("fill", getcolor($i));
+                       
$tspan->appendChild($doc->createTextNode($myDoc[$i]->getkey("appname")." 
".$myDoc[$i]->getkey("release")." "));
+                       $text->insertBefore($tspan, $lasttspan);
+               }
+       
+               return $text;
+       }
+       
+       //draw path between points on each axis
+       //$myDoc : QSOSDocument concerned
+       //$name : name of the criteria regrouping subcriteria to be displayed
+       //      if $name is not set, gobal sectiosn are displayed
+       //$n : position of the software to display in the list (used for 
coloring)
+       //$weights: array of weights for teh scores
+       function drawPath($myDoc, $name, $n, $weights) {
+               global $doc;
+               global $SCALE, $dx, $dy;
+               global $num;
+               $path = $doc->createElement("path");
+               $myD = "";
+               
+               if (isset($name) && $name != "") {
+                       $tree = $myDoc->getWeightedSubTree($name, $weights);
+               } else {
+                       $tree = $myDoc->getWeightedTree($weights);
+               }
+               
+               /*N
+               $totalWeight = 0;
+               for ($i=0; $i < count($tree); $i++) {
+                       $totalWeight = $totalWeight + $weights[$tree[$i]->name];
+               }*/
+
+               drawAxis(count($tree));
+               $angle = 0;
+               for ($i=0; $i < count($tree); $i++) {
+                       /*N $delta = 
$weights[$tree[$i]->name]*2*pi()/$totalWeight;
+                       $angle_text = $angle + $delta/2;
+                       $angle = $angle + $delta;
+                       drawSingleAxis($angle);*/
+
+                       $myD .= ($i==0)?"M":"L";
+                       //N: should be commented
+                       $angle = ($i+1)*2*pi()/(count($tree));
+                       $x = ($tree[$i]->score)*$SCALE*cos($angle);
+                       $x = $x + $dx;
+                       $y = ($tree[$i]->score)*$SCALE*sin($angle);
+                       $y = $y + $dy;
+                       $myD .= " $x $y ";
+                       //2.1 = 2 + 0.1 of padding before actual text display
+                       //N: drawText(2.1*$SCALE*cos($angle_text), 
2.1*$SCALE*sin($angle_text), $tree[$i]);
+                       drawText(2.1*$SCALE*cos($angle), 
2.1*$SCALE*sin($angle), $tree[$i]);
+               }
+               $myD .= "z";
+               $path->setAttribute("d", $myD);
+               $path->setAttribute("fill", getColor($n));
+               $path->setAttribute("fill-opacity", "0.2");
+               $path->setAttribute("stroke-width", "3");
+               $path->setAttribute("stroke", getColor($n));
+       
+               return $path;
+       }
+       
+       $colors = array('red', 'blue', 'green', 'purple');
+       //Return drawing color depending on software position in the list
+       function getColor($i) {
+               global $colors;
+               if($i < count($colors)) {
+                       return $colors[$i];
+               } else {
+                       return "black";
+               }
+       }
+       
+       //svg element
+       $svg = $doc->createElement('svg');
+       $svg->setAttribute('xmlns', 'http://www.w3.org/2000/svg');
+       $svg->setAttribute('xmlns:xlink', 'http://www.w3.org/1999/xlink');
+       $svg->setAttribute('width', '100%');
+       $svg->setAttribute('height', '100%');
+       
+       //Graph element
+       $g = $doc->createElement('g');
+       //$g->setAttribute('transform', 'translate(500,300)');
+       $g->setAttribute('transform', 'translate(50,50)');
+       $g->appendChild(drawTitle($name));
+       drawNavBar($name);
+       //display each software on teh graph
+       for($i=0; $i<$num; $i++) {
+               $g->appendChild(drawPath($myDoc[$i], $name, $i, $weights));
+       }
+       $svg->appendChild($g);
+       $doc->appendChild($svg);
+       
+       echo $doc->saveXML();
+} else {
+//Graph generated with jpgraph
+       include("config.php");
+       include ($jpgraph_path."jpgraph.php");
+       include ($jpgraph_path."jpgraph_radar.php");
+       include("libs/QSOSDocument.php");
+       
+       $files = $_REQUEST['f'];
+       $name = $_REQUEST['c'];
+       
+       $myDoc = array();
+       $app = array();
+       $trees = array();
+       $scores = array();
+       $titles = array();
+       
+       $i = 0;
+       $num = count($files);
+       
+       //Initialization of data arrays
+       for($i=0; $i<$num; $i++) {
+               $myDoc[$i] = new QSOSDocument($files[$i]);
+               $trees[$i] = array();
+               if (isset($name) && $name != "") {
+                       $trees[$i] = $myDoc[$i]->getSubTree($name);
+               } else {
+                       $trees[$i] = $myDoc[$i]->getTree();
+               }
+       
+               $scores[$i] = array();
+               foreach($trees[$i] as $element) {
+                       array_push($scores[$i], $element->score);
+               }
+       }
+       
+       //Graph's title
+       if (isset($name) && $name != "") {
+               $title = $myDoc[0]->getkeytitle($name);
+       } else {
+               $title = $myDoc[0]->getkey("qsosappfamily");
+       }
+       
+       //Axis titles
+       foreach($trees[0] as $element) {
+               array_push($titles, $element->title);
+       }
+       
+       // Create the basic radar graph
+       $graph = new RadarGraph(700,500,"auto");
+       
+       // Set background color and shadow
+       $graph->SetColor("white");
+       $graph->SetFrame(false,'',0);
+       
+       // Position the graph
+       $graph->SetCenter(0.4,0.55);
+       $graph->SetPos(0.5,0.6);
+       
+       // Setup the axis formatting  
+       $graph->SetScale('lin',0,2);
+       $graph->axis->SetFont(FF_ARIAL,FS_BOLD);
+       $graph->axis->title->SetFont(FF_ARIAL,FS_BOLD);
+       $graph->axis->title->SetMargin(5);
+       $graph->axis->SetWeight(1);
+       $graph->axis->SetColor('darkgray'); 
+       
+       // Setup the grid lines
+       $graph->grid->SetLineStyle("longdashed");
+       $graph->grid->SetColor("darkgray");
+       $graph->grid->Show();
+       $graph->HideTickMarks();
+               
+       // Setup graph titles
+       $graph->title->Set($title);
+       $graph->title->SetFont(FF_ARIAL,FS_BOLD,12);
+       $graph->SetTitles($titles);
+       
+       // Setup graph legend
+       $graph->legend->SetFont(FF_ARIAL,FS_BOLD);
+       
+       function getColor($b_safe = TRUE) {
+               //if a browser safe color is requested then set the array up
+               //so that only a browser safe color can be returned
+               if($b_safe) {
+                       $ary_codes = array('00','33','66','99','CC','FF');
+                       $max = 5; //the highest array offest
+                       //if a browser safe color is not requested then set the 
array
+                       //up so that any color can be returned.
+               } else {
+                       $ary_codes = array();
+                       for($i=0;$i<16;$i++) {
+                               $t_1 = dechex($i);
+                               for($j=0;$j<16;$j++) {
+                                       $t_2 = dechex($j);
+                                       $ary_codes[] = "$t_1$t_2";
+                               }
+                       }
+                       $max = 256; //the highest array offset
+               }
+               $retVal = '';
+               
+               //generate a random color code
+               for($i=0;$i<3;$i++) {
+                       $offset = rand(0,$max);
+                       $retVal .= $ary_codes[$offset];
+               } //end for i
+               
+               return "#".$retVal;
+       }
+       
+       //Generate graph for each software
+       function getPlot($scores, $myDoc) {
+               global $num;
+               $plot = new RadarPlot($scores);
+               $plot->SetLegend($myDoc->getkey("appname")." 
".$myDoc->getkey("release"));
+               $color = getColor();
+               $plot->SetColor("address@hidden");
+               if ($num == 1) $plot->SetFillColor("address@hidden");
+               $plot->SetLineWeight(3);
+               return $plot;
+       }
+       
+       //Add them to the global graph
+       for($i=0; $i<$num; $i++) {
+               $graph->Add(getPlot($scores[$i], $myDoc[$i]));
+       }
+       
+       //Output the graph
+       $graph->Stroke();
+}
+
+?> 

Index: save_weighting.php
===================================================================
RCS file: save_weighting.php
diff -N save_weighting.php
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ save_weighting.php  2 Feb 2007 07:14:33 -0000       1.1
@@ -0,0 +1,55 @@
+<?php
+/*
+**  Copyright (C) 2007 Atos Origin 
+**
+**  Author: Raphael Semeteys <address@hidden>
+**
+**  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., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  
USA
+**
+**
+** O3S
+** save_weighting.php: generates .qw file to user to store current weightings
+**
+*/
+
+include("config.php");
+
+$output = new DOMDocument("1.0","UTF-8");
+$document = $output->createElement('document');
+
+$header = $output->createElement('header');
+$header->appendChild($output->createElement('family', $_POST['family']));
+$document->appendChild($header);
+
+$weighting = $output->createElement('weighting');
+while (list($name, $value) = each($_POST)) { 
+       if ($name != 'family') {
+               $weight = $output->createElement('weight', $value);
+               $weight->setAttribute("id", $name);
+               $weighting->appendChild($weight);
+       }
+}
+
+$document->appendChild($weighting);
+$output->appendChild($document);
+$filename = $temp.uniqid().".qw";
+$download = $_POST["family"].".qw";
+$output->save($filename);
+
+header('Content-type: text/xml');
+header('Content-Disposition: attachment; filename="'.$download.'"');
+readfile($filename);
+exit;
+?>
\ No newline at end of file

Index: search.js
===================================================================
RCS file: search.js
diff -N search.js
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ search.js   2 Feb 2007 07:14:33 -0000       1.1
@@ -0,0 +1,84 @@
+//Taken from http://www.nsftools.com/misc/SearchAndHighlight.htm
+
+/*
+ * This is the function that actually highlights a text string by
+ * adding HTML tags before and after all occurrences of the search
+ * term. You can pass your own tags if you'd like, or if the
+ * highlightStartTag or highlightEndTag parameters are omitted or
+ * are empty strings then the default <font> tags will be used.
+ */
+function doHighlight(bodyText, searchTerm, highlightStartTag, highlightEndTag) 
+{
+  // the highlightStartTag and highlightEndTag parameters are optional
+  if ((!highlightStartTag) || (!highlightEndTag)) {
+    highlightStartTag = "<font style='color:blue; background-color:yellow;'>";
+    highlightEndTag = "</font>";
+  }
+  
+  // find all occurences of the search term in the given text,
+  // and add some "highlight" tags to them (we're not using a
+  // regular expression search, because we want to filter out
+  // matches that occur within HTML tags and script blocks, so
+  // we have to do a little extra validation)
+  var newText = "";
+  var i = -1;
+  var lcSearchTerm = searchTerm.toLowerCase();
+  var lcBodyText = bodyText.toLowerCase();
+    
+  while (bodyText.length > 0) {
+    i = lcBodyText.indexOf(lcSearchTerm, i+1);
+    if (i < 0) {
+      newText += bodyText;
+      bodyText = "";
+    } else {
+      // skip anything inside an HTML tag
+      if (bodyText.lastIndexOf(">", i) >= bodyText.lastIndexOf("<", i)) {
+        // skip anything inside a <script> block
+        if (lcBodyText.lastIndexOf("/script>", i) >= 
lcBodyText.lastIndexOf("<script", i)) {
+          newText += bodyText.substring(0, i) + highlightStartTag + 
bodyText.substr(i, searchTerm.length) + highlightEndTag;
+          bodyText = bodyText.substr(i + searchTerm.length);
+          lcBodyText = bodyText.toLowerCase();
+          i = -1;
+        }
+      }
+    }
+  }
+  
+  return newText;
+}
+
+
+/*
+ * This is sort of a wrapper function to the doHighlight function.
+ * It takes the searchText that you pass, optionally splits it into
+ * separate words, and transforms the text on the current web page.
+ * Only the "searchText" parameter is required; all other parameters
+ * are optional and can be omitted.
+ */
+function highlightSearchTerms(searchText, treatAsPhrase, warnOnFailure, 
highlightStartTag, highlightEndTag)
+{
+  // if the treatAsPhrase parameter is true, then we should search for 
+  // the entire phrase that was entered; otherwise, we will split the
+  // search string so that each word is searched for and highlighted
+  // individually
+  if (treatAsPhrase) {
+    searchArray = [searchText];
+  } else {
+    searchArray = searchText.split(" ");
+  }
+  
+  if (!document.body || typeof(document.body.innerHTML) == "undefined") {
+    if (warnOnFailure) {
+      alert("Sorry, for some reason the text of this page is unavailable. 
Searching will not work.");
+    }
+    return false;
+  }
+  
+  var bodyText = document.body.innerHTML;
+  for (var i = 0; i < searchArray.length; i++) {
+    bodyText = doHighlight(bodyText, searchArray[i], highlightStartTag, 
highlightEndTag);
+  }
+  
+  document.body.innerHTML = bodyText;
+  return true;
+}
\ No newline at end of file

Index: search.php
===================================================================
RCS file: search.php
diff -N search.php
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ search.php  2 Feb 2007 07:14:33 -0000       1.1
@@ -0,0 +1,67 @@
+<?php
+//Based on this script: http://programmabilities.com/php/?id=2
+
+session_start();
+session_unset();
+session_destroy();
+$_SESSION = array();
+
+$searchstr = $_REQUEST['s'];
+
+include("config.php");
+include("locales/$lang.php");
+
+echo "<html>\n";
+echo "<head>\n";
+echo "<LINK REL=StyleSheet HREF='skins/$skin/o3s.css' TYPE='text/css'/>\n";
+echo "</head>\n";
+
+echo "<body>\n";
+echo "<center>\n";
+echo "<img src='skins/$skin/o3s.png'/>\n";
+echo "<br/><br/>\n";
+
+echo "<p><form action='$PHP_SELF' method='post'>\n";
+echo " <input type='text' name='s' value='$searchstr' size='20' 
maxlength='30'/>\n";
+echo " <input type='submit' 
value='".$msg['s1_button_search']."'/><br/><br/>\n";
+echo " <input type='button' value='".$msg['s1_button_back']."' 
onclick=\"location.href='index.php'\"/>\n";
+echo "</form></p>\n";
+
+echo "</center>\n";
+
+if (! empty($searchstr)) {
+     // empty() is used to check if we've any search string.
+     // If we do, call grep and display the results.
+     echo '<hr/>';
+     // Call grep with case-insensitive search mode on all files
+     $cmdstr = "grep -i -l $searchstr $sheet/*/*/*.qsos";
+     $fp = popen($cmdstr, 'r'); // open the output of command as a pipe
+     $myresult = array(); // to hold my search results
+     while ($buffer = fgetss($fp, 4096)) {
+          // grep returns in the format
+          // filename: line
+          // So, we use split() to split the data
+          list($fname, $fline) = split(':', $buffer, 2);
+          // we take only the first hit per file
+          if (! defined($myresult[$fname])) {
+              $myresult[$fname] = $fline;
+          }
+      }
+      // we have results in a hash. lets walk through it and print it
+      if (count($myresult)) {
+           echo '<ul><br/>';
+           while (list($fname, $fline) = each ($myresult)) {
+               $name = basename($fname, ".qsos");
+               echo "<li><a 
href='show.php?svg=yes&s=$searchstr&f[]=$fname'>$name</a></li>\n";
+           }
+           echo '</ul><br/>';
+       } else { 
+            // no hits
+            echo 
$msg['s1_search_msg1']."<strong>$searchstr</strong>".$msg['s1_search_msg2']."<br/>\n";
+       }
+       pclose($fp);
+   }
+
+echo "</body>\n";
+echo "</html>\n";
+?>
\ No newline at end of file

Index: set_weighting.php
===================================================================
RCS file: set_weighting.php
diff -N set_weighting.php
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ set_weighting.php   2 Feb 2007 07:14:33 -0000       1.1
@@ -0,0 +1,242 @@
+<?php
+/*
+**  Copyright (C) 2007 Atos Origin 
+**
+**  Author: Raphael Semeteys <address@hidden>
+**
+**  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., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  
USA
+**
+**
+** O3S
+** set_weighting.php: displays form to enter weigthings
+**
+*/
+
+session_start();
+session_unset();
+session_destroy();
+$_SESSION = array();
+
+include("config.php");
+include("locales/$lang.php");
+
+echo "<html>\n";
+echo "<head>\n";
+echo "<LINK REL=StyleSheet HREF='skins/$skin/o3s.css' TYPE='text/css'/>\n";
+?>
+<script src="commons.js" language="JavaScript" type="text/javascript"></script>
+<script language="JavaScript" type="text/javascript">
+
+function checkWeight(field) {
+       if (isNaN(field.value)) {
+               var oldValue = field.value;
+               field.value = "1";
+               alert(oldValue + " is not an applicable weight value,\n it has 
been set to 1.");
+               field.focus();
+       }
+}
+
+function save() {
+       myForm.action = "save_weighting.php";
+       myForm.submit();
+}
+
+function next() {
+       myForm.action = "software.php";
+       myForm.submit();
+}
+
+function upload() {
+       var file = document.getElementById("weighting");
+       if (file.value == "") {
+               alert("No weight file is provided!");
+               return;
+       }
+       myForm.action = "set_weighting.php";
+       myForm.submit();
+}
+</script>
+<?php
+echo "</head>\n";
+
+echo "<body>\n";
+echo "<center>\n";
+echo "<img src='skins/$skin/o3s.png'/>\n";
+echo "<br/><br/>\n";
+
+include("libs/QSOSDocument.php");
+
+$family = $_REQUEST['family'];
+$svg = $_REQUEST['svg'];
+
+$upload = false;
+$weights = array();
+
+//Upload of weighting file
+if (isset($_FILES['weighting'])) {
+       $weighting = $_FILES['weighting'];
+       $dir = $temp.uniqid();
+       move_uploaded_file($weighting['tmp_name'], $dir);
+       chmod ($dir, 0770);
+
+       $doc = new DOMDocument();
+       $doc->load($dir);
+       $xpath =  new DOMXPath($doc);
+
+       $nodes = $xpath->query("//family");
+       $upload_family = $nodes->item(0)->nodeValue;
+
+       if ($upload_family == $family) {
+               $nodes = $xpath->query("//weight");
+               foreach ($nodes as $node) {
+                       $name = $node->getAttribute('id');
+                       $value = $node->nodeValue;
+                       $weights[$name] = $value;
+               }
+               $text = "<div style='texte-align: center; color: red'>"
+                       .$weighting['name']
+                       .$msg['s2_loaded']
+                       ."</div><br/>";
+               $upload = true;
+       } else {
+               $text = "<div style='texte-align: center; color: red'>"
+                       .$family.$msg['s2_error1']
+                       .$upload_family.$msg['s2_error2']
+                       ."</div><br/>";
+       }
+}
+
+$tree= retrieveTree($sheet.$delim.$family);
+$keys = array_keys($tree);
+function retrieveTree($path)  {
+       global $delim;
+       
+       if (address@hidden($path)) {
+       while (($element=readdir($dir))!== false) {
+               if (is_dir($path.$delim.$element) 
+               && $element != "." 
+               && $element != ".." 
+               && $element != "CVS" 
+               && $element != "template" 
+               && $element != "templates" 
+               && $element != ".svn") {
+                       $array[$element] = retrieveTree($path.$delim.$element);
+               } elseif (substr($element, -5) == ".qsos") {
+                       $array[] = $element;
+               }
+       }
+       closedir($dir);
+       }
+       return (isset($array) ? $array : false);
+}
+
+$file = $tree[$keys[0]][0];
+$file = $sheet.$delim.$family.$delim.$keys[0].$delim.$file;
+
+
+$myDoc = new QSOSDocument($file);
+$tree = $myDoc->getTree();
+$familyname = $myDoc->getkey("qsosappfamily");
+
+echo "<div style='font-weight: bold'>"
+       .$msg['s2_title']
+       ."<br/><br/></div>\n";
+echo $text;
+echo "<form id='myForm' 
+       enctype='multipart/form-data' 
+       method='POST' 
+       action='software.php'>\n";
+echo "<input type='hidden' 
+       name='family' 
+       value='$family'/>\n";
+echo "<table id='table' 
+       style='border-collapse: collapse; font-size: 12pt; table-layout: 
fixed'>\n";
+echo "<tr class='title' style='width: 400px'><td>$familyname</td>\n";
+echo "<td><div style='width: 60px; text-align: center'>"
+       .$msg['s2_weight']
+       ."</div></td>\n";
+echo "</tr>\n";
+
+showtree($myDoc, $tree, 0, '');
+
+echo "<input type='button' 
+       value='".$msg['s2_button_back']."' 
+       onclick='location.href=\"index.php\"'> ";
+echo " <input type='button' 
+       value='".$msg['s2_button_save']."' 
+       onclick='save()'> ";
+echo " <input type='button' 
+       value='".$msg['s2_button_next']."' 
+       onclick='next()'><br/><br/>\n";
+echo "<input type='file' 
+       id='weighting' name='weighting'> 
+      <input type='button' 
+       value='".$msg['s2_button_upload']."' 
+       onclick='upload()'><br/><br/>\n";
+echo "</table>\n";
+echo "</form>\n";
+
+//Recursive function to display tree of criteria
+function showtree($myDoc, $tree, $depth, $idP) {
+       global $upload;
+       global $weights;
+       $new_depth = $depth + 1;
+       $offset = $new_depth*10;
+       $idF = 0;
+
+       for($k=0; $k<count($tree); $k++) {
+               $name = $tree[$k]->name;
+               $title = $tree[$k]->title;
+               $subtree = $tree[$k]->children;
+       
+               $idF++;
+               if ($idP == '') {
+                       $id = $idF;
+               } else  {
+                       $id = $idP."-".$idF;
+               }
+       
+               echo "<tr id='$id' 
+                       class='level$depth' 
+                       onmouseover=\"this.setAttribute('class','highlight')\" 
+                       
onmouseout=\"this.setAttribute('class','level$depth')\">\n";
+               if ($subtree) {
+                       echo "<td style='width: 400px; text-indent: $offset'>
+                               <span onclick=\"collapse(this);\" 
class='expanded'>$title</span></td>\n";
+               } else {
+                       echo "<td style='width: 400px; text-indent: $offset'>
+                               <span>$title</span></td>\n";
+               }
+       
+               echo "<td><div style='width: 60px; text-align: center'>\n";
+               //If a weighting file has been uploaded use $weights array, if 
not use default value 1
+               echo "<input type='text' 
+                       name='$name' size='3' style='text-align: center' 
onblur='checkWeight(this)' 
+                       value='".(($upload)?$weights[$name]:1)."'/>\n";
+
+               echo "</div></td>\n";
+       
+               echo "</tr>\n";
+
+               if ($subtree) {
+                       showtree($myDoc, $subtree, $new_depth, $id);
+               }
+       }
+}
+
+echo "</center>\n";
+echo "</body>\n";
+echo "</html>\n";
+?>
\ No newline at end of file

Index: show.php
===================================================================
RCS file: show.php
diff -N show.php
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ show.php    2 Feb 2007 07:14:33 -0000       1.1
@@ -0,0 +1,306 @@
+<?php
+/*
+**  Copyright (C) 2007 Atos Origin 
+**
+**  Author: Raphael Semeteys <address@hidden>
+**
+**  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., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  
USA
+**
+**
+** O3S
+** show.php: show QSOS evaluation(s)
+**
+*/
+
+session_start();
+//Search pattern
+$s = $_REQUEST['s'];
+//If there is a search pattern, no weights are to be applied
+$is_weighted = !isset($s);
+
+include("config.php");
+include("locales/$lang.php");
+
+echo "<html>\n";
+echo "<head>\n";
+echo "<LINK REL=StyleSheet HREF='skins/$skin/o3s.css' TYPE='text/css'/>\n";
+?>
+<script src="commons.js" language="JavaScript" type="text/javascript"></script>
+<script src="search.js" language="JavaScript" type="text/javascript"></script>
+<script>
+var size = 12;
+
+function showComments() {
+       var cells = document.getElementsByTagName("td");
+       for (var i = 0; i < cells.length; i++) {
+               var c = cells[i];
+               if (c.id == 'comment') {
+                       if (document.all) c.style.display = "block"; //IE4+ 
specific code
+                       else c.style.display = "table-row"; //Netscape and 
Mozilla
+               }
+       }
+       document.getElementById("comment_selector").href = 
"javascript:hideComments();";
+       document.getElementById("column").src = "<?php echo 
"skins/$skin/hide-comments.png"; ?>";
+}
+
+function hideComments() {
+       var cells = document.getElementsByTagName("td");
+       for (var i = 0; i < cells.length; i++) {
+               var c = cells[i];
+               if (c.id == 'comment') {
+                       c.style.display = "none";
+               }
+       }
+       document.getElementById("comment_selector").href = 
"javascript:showComments();";
+       document.getElementById("column").src = "<?php echo 
"skins/$skin/show-comments.png"; ?>";
+}
+
+function decreaseFontSize() {
+       size--;
+       document.getElementById("table").style.fontSize = size + "pt";
+}
+
+function increaseFontSize() {
+       size++;
+       document.getElementById("table").style.fontSize = size + "pt";
+}
+
+function submitForm(c) {
+       document.getElementById("c").value = c;
+       myForm.submit();
+}
+</script>
+<?php
+echo "</head>\n";
+
+include("libs/QSOSDocument.php");
+
+//Software family
+$family = $_REQUEST['family'];
+//QSOS XML files to be displayed
+$files = $_REQUEST['f'];
+//Are graphs to be generated in SVG?
+$svg = $_REQUEST['svg'];
+
+if (isset($s)) {
+       echo "<body onload=\"highlightSearchTerms('$s');\">\n";
+} else {
+       echo "<body>\n";
+}
+echo "<center>\n";
+echo "<img src='skins/$skin/o3s.png'/>\n";
+echo "<br/><br/>\n";
+echo "<div style='font-weight: bold'>".$msg['s4_title']."<br/><br/>\n";
+
+echo "<form id='myForm' method='POST' action='radar.php'>\n";
+
+$weights = $_SESSION;
+
+foreach($files as $file) {
+       echo "<input type='hidden' name='f[]' value='$file'/>\n";
+}
+echo "<input type='hidden' name='svg' value='$svg'/>\n";
+echo "<input type='hidden' name='c' id='c' value=''/>\n";
+echo "<input type='hidden' name='family' value='$family'/>\n";
+echo "<input type='hidden' name='s' value='$s'/>\n";
+
+$num = count($files);
+$myDoc = array();
+$app = array();
+$trees = array();
+
+$i = 0;
+foreach($files as $file) {
+       $myDoc[$i] = new QSOSDocument($file);
+       $app[$i] = $myDoc[$i]->getkey("appname")." 
".$myDoc[$i]->getkey("release");
+       if ($is_weighted) {
+               $trees[$i] = $myDoc[$i]->getWeightedTree($weights);
+       } else {
+               $trees[$i] = $myDoc[$i]->getTree();
+       }
+       $i++;
+}
+
+$familyname = $myDoc[0]->getkey("qsosappfamily");
+
+$f = "";
+foreach($files as $file) {
+       $f .= "f[]=$file&";
+}
+
+echo "<table>\n";
+echo "<tr width='100%' align='center'><td>\n";
+echo "<a id='comment_selector' href='javascript:hideComments();'>";
+echo "<img id='column' 
+       src='skins/$skin/hide-comments.png' 
+       border=0 
+       onmouseover=\"return escape('Hide/Show comments')\"/>";
+echo "</a>\n";
+echo " <a href='javascript:decreaseFontSize();'>";
+echo "<img src='skins/$skin/decrease-font.png' 
+       border=0 
+       onmouseover=\"return escape('Decrease font size')\"/>";
+echo "</a>\n";
+echo " <a href='javascript:increaseFontSize();'>";
+echo "<img src='skins/$skin/increase-font.png' 
+       border=0 
+       onmouseover=\"return escape('Increase font size')\"/>";
+echo "</a>\n";
+if ($is_weighted) {
+       echo " <a href='radar.php?family=$family&".$f."svg=$svg'>";
+       echo "<img src='skins/$skin/graph.png' 
+               border=0 onmouseover=\"return escape('Show graph')\"/>";
+       echo "</a>\n";
+}
+echo "</td></tr>\n";
+echo "<tr><td align='center'>\n";
+if ($is_weighted) {
+       echo "<input type='button' 
+               value='".$msg['s4_button_back']
+               ."' 
onclick='location.href=\"software.php?family=".$family."&svg=$svg\"'><br/><br/>";
+} else {
+       echo "<input type='button' 
+               value='".$msg['s4_button_back_alt']
+               ."' onclick='location.href=\"search.php?s=$s\"'><br/><br/>";
+}
+echo "</td></tr>\n";
+echo "</table>\n";
+
+echo "<table id='table' style='border-collapse: collapse; font-size: 12pt; 
table-layout: fixed'>\n";
+echo "<tr class='title' style='width: 250px'>\n";
+echo "<td rowspan='2'><div style='text-align: 
center'>$familyname</div></td>\n";
+echo "<td style='width: 30px' rowspan='2'>";
+if ($is_weighted) {
+       echo "<img src='skins/$skin/graph.png' border='' style='cursor: 
pointer' onclick='submitForm(\"\")'/>";
+}
+echo "</td>\n";
+for($i=0; $i<$num; $i++) {
+       echo "<td colspan='2'><div style='width: 120px; text-align: 
center'>$app[$i]</div></td>\n";
+       echo "<td id='comment' style='width: 
300px'>".$msg['s4_comments']."</td>\n";
+}
+echo "</tr>\n";
+echo "<tr class='title'>\n";
+for($i=0; $i<$num; $i++) {
+       echo "<td><div style='width: 60px; text-align: 
center'>".$msg['s4_score']."</div></td>\n";
+       echo "<td><div style='width: 60px; text-align: 
center'>".$msg['s4_weight']."</div></td>\n";
+       echo "<td id='comment' style='width: 300px'></td>\n";
+}
+echo "</tr>\n";
+
+showtree($myDoc, $trees, 0, '', $weights);
+echo "</table>\n";
+
+function showtree($myDoc, $trees, $depth, $idP, $weights) {
+       global $svg;
+       global $is_weighted;
+       global $skin;
+       $new_depth = $depth + 1;
+       $offset = $new_depth*10;
+       $idF = 0;
+       $tree = $trees[0];
+
+       for($k=0; $k<count($tree); $k++) {
+               $name = $tree[$k]->name;
+               $title = $tree[$k]->title;
+               $subtree = $tree[$k]->children;
+               $subtrees = array();
+
+               $idF++;
+               if ($idP == '') {
+                       $id = $idF;
+               } else  {
+                       $id = $idP."-".$idF;
+               }
+
+               echo "<tr id='$id' 
+                       name='$name' 
+                       class='level$depth' 
+                       onmouseover=\"this.setAttribute('class','highlight')\" 
+                       
onmouseout=\"this.setAttribute('class','level$depth')\">\n";
+               if ($subtree) {
+                       echo "<td style='width: 250px; text-indent: $offset'>
+                               <span onclick=\"collapse(this);\" 
class='expanded'>$title</span>
+                               </td>\n";
+                       echo "<td style='width: 30px'>";
+                       if ($myDoc[0]->hassubelements($name) > 2) {
+                               $files = $_REQUEST['f'];
+                               $f = "";
+                               foreach($files as $file) {
+                                       $f .= "f[]=$file&";
+                               }
+                               if ($is_weighted) {
+                                       echo "<img src='skins/$skin/graph.png' 
+                                               border='' 
+                                               style='cursor: pointer' 
onclick='submitForm(\"$name\")'/>\n";
+                               }
+                       }
+               } else {
+                       echo "<td style='width: 250px; text-indent: $offset'>
+                               <span>$title</span>
+                               </td>\n";
+                       echo "<td style='width: 30px'></td>\n";;
+               }
+
+               for($i=0; $i<count($trees); $i++) {
+                       $desc = addslashes($myDoc[$i]->getgeneric($name, 
"desc".$trees[$i][$k]->score));
+                       if ($desc != "") {
+                               echo "<td class='score' 
+                                       style='width: 60px; cursor:help' 
onmouseover=\"return escape('".$desc."')\">
+                                       <div style='text-align: center'>"
+                                               .$trees[$i][$k]->score
+                                       ."</div></td>\n";
+                       } else {
+                               echo "<td class='score' 
+                                       style='width: 60px; text-align: center'>
+                                       <div style='text-align: center'>"
+                                               .$trees[$i][$k]->score
+                                       ."</div></td>\n";
+                       }
+                       if ($is_weighted) {
+                               echo "<td>
+                                       <div style='text-align: center'>"
+                                               .$weights[$name]
+                                       ."</div></td>\n";
+                       } else {
+                               echo "<td>
+                                       <div style='text-align: center'>1</div>
+                                       </td>\n";
+                       }
+                       echo "<td id='comment'>
+                                       <div style='width: 300px'>"
+                                               .$myDoc[$i]->getgeneric($name, 
"comment")
+                                       ."</div></td>\n";
+               }
+               echo "</tr>\n";
+;
+               if ($subtree) {
+                       for($i=0; $i<count($trees); $i++) {
+                               $subtrees[$i] = $trees[$i][$k]->children;
+                       }
+                       showtree($myDoc, $subtrees, $new_depth, $id, $weights);
+               }
+       }
+}
+
+echo "</form>";
+
+echo "<br/>";
+echo $msg['g_license_notice'];
+
+echo "</center>\n";
+echo "<script language='JavaScript' type='text/javascript' 
src='libs/wz_tooltip.js'></script>";
+echo "</body>\n";
+echo "</html>\n";
+?>
\ No newline at end of file

Index: software.php
===================================================================
RCS file: software.php
diff -N software.php
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ software.php        2 Feb 2007 07:14:33 -0000       1.1
@@ -0,0 +1,162 @@
+<?php
+/*
+**  Copyright (C) 2007 Atos Origin 
+**
+**  Author: Raphael Semeteys <address@hidden>
+**
+**  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., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  
USA
+**
+**
+** O3S
+** software.php: lists software in a given family
+**
+*/
+
+session_start();
+include("config.php");
+include("locales/$lang.php");
+
+echo "<html>\n";
+echo "<head>\n";
+echo "<LINK REL=StyleSheet HREF='skins/$skin/o3s.css' TYPE='text/css'/>\n";
+?>
+<script>
+function toggleSVG() {
+       var svg = document.getElementById("check").getAttribute("svg");
+       var links = document.getElementsByTagName("a");
+       for(var i=0; i < links.length; i++) {
+               var ref = links[i].getAttribute("href");
+               if (svg == "on") {
+                       if (ref.search(/&svg=yes/) != -1) ref = 
ref.split("&svg=")[0];
+                       document.getElementById("check").setAttribute("svg", 
"off");
+               } else {
+                       if (ref.search(/&svg=yes/) == -1) ref += "&svg=yes";
+                       document.getElementById("check").setAttribute("svg", 
"on");
+               }
+               
+               links[i].setAttribute("href", ref);
+       }
+       
+}
+
+function submitForm() {
+       var ok = false;
+       var inputs = document.getElementsByTagName("input");
+       for(var i=0; i < inputs.length; i++) {
+               if (inputs[i].type == "checkbox" && inputs[i].name == "f[]" && 
inputs[i].checked) {
+                       ok = true;
+               }
+       }
+
+       if (ok == true) {
+               myForm.submit();
+       } else {
+               alert("At least one product must be checked");
+       }
+}
+</script>
+<?php
+echo "</head>\n";
+
+echo "<body>\n";
+echo "<center>\n";
+echo "<img src='skins/$skin/o3s.png'/>\n";
+echo "<br/><br/>\n";
+
+$family = $_REQUEST['family'];
+
+if (!isset($_SESSION["generic"])) {
+       while (list($name, $value) = each($_REQUEST)) { 
+               if (($name != 'f') && ($name != 'svg')) {
+                       $_SESSION[$name] = $value;
+               }
+       }
+}
+
+$tree= retrieveTree($sheet.$delim.$family); 
+$keys = array_keys($tree);
+
+function retrieveTree($path)  {
+       global $delim;
+       
+       if (address@hidden($path)) {
+       while (($element=readdir($dir))!== false) {
+               if (is_dir($path.$delim.$element) 
+               && $element != "." 
+               && $element != ".." 
+               && $element != "CVS" 
+               && $element != "template" 
+               && $element != "templates" 
+               && $element != ".svn") {
+                       $array[$element] = retrieveTree($path.$delim.$element);
+               } elseif (substr($element, -5) == ".qsos") {
+                       $array[] = $element;
+               }
+       }
+       closedir($dir);
+       }
+       return (isset($array) ? $array : false);
+}
+
+echo "<div style='font-weight: bold'>".
+       $msg['s3_title'].
+       "<br/><br/>\n";
+echo "<input type='button' 
+       value='".$msg['s3_button_back']."' 
+       
onclick='location.href=\"set_weighting.php?family=$family\"'/><br/><br/>\n";
+echo "<form id='myForm' action='show.php'>\n";
+echo "<input type='hidden' name='family' value='$family'/>\n";
+echo "<table>\n";
+echo "<tr class='title'>
+               <td>$family</td>
+               <td align='center'>".$msg['s3_format_xml']."</td>
+               <td align='center'>".$msg['s3_format_ods']."</td>
+               <td><input type='button' value='".$msg['s3_button_next']."' 
onclick='submitForm()'></td>
+       </tr>\n";
+for ($i=0; $i<count($keys); $i++) {
+       if (!is_int($keys[$i])) {
+               echo "<tr class='level0'><td colspan='4'>$keys[$i]</td></tr>\n";
+               for ($j=0; $j<count($tree[$keys[$i]]); $j++) {
+                       $file = $tree[$keys[$i]][$j];
+                       $link = 
$sheet.$delim.$family.$delim.$keys[$i].$delim.$file;
+                       $name = basename($file, ".qsos");
+                       $odsfile = $name.".ods";
+                       
+                       echo "<tr class='level1' 
+                               
onmouseover=\"this.setAttribute('class','highlight')\" 
+                               
onmouseout=\"this.setAttribute('class','level1')\">\n";
+                       echo "<td>$name</td>\n";
+                       echo "<td align='center'>
+                               <a href='$link'><img src='skins/$skin/xml.png' 
border='0'/></a>
+                               </td>\n";
+                       echo "<td align='center'>
+                               <a href='export_oo.php?f=$link'><img 
src='skins/$skin/ods.png' border='0'/></a>
+                               </td>\n";
+                       echo "<td align='center' class='html'>
+                               <span class='logo_html'/>
+                               <input type='checkbox' class='logo_html' 
name='f[]' value='$link'>
+                               </td></tr>\n";
+               }
+       }
+}
+echo "</table><br/>";
+echo $msg['s3_check_svg'].
+       " <input id='check' type='checkbox' name='svg' value='yes' 
onclick='toggleSVG()' svg='on' checked>";
+echo "</form></div>\n";
+
+echo "</center>\n";
+echo "</body>\n";
+echo "</html>\n";
+?>
\ No newline at end of file

Index: template.zip
===================================================================
RCS file: template.zip
diff -N template.zip
Binary files /dev/null and /tmp/cvs8GP56O differ

Index: writeremote.php
===================================================================
RCS file: writeremote.php
diff -N writeremote.php
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ writeremote.php     2 Feb 2007 07:14:33 -0000       1.1
@@ -0,0 +1,33 @@
+<?php
+/*
+**  Copyright (C) 2007 Atos Origin 
+**
+**  Author: Raphael Semeteys <address@hidden>
+**
+**  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., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  
USA
+**
+**
+** O3S - Backend for remote clients
+** writeremote.php: stores QSOS evaluations uploaded from remote clients
+**
+*/
+
+$file = $_FILES['myfile'];
+$destination = "incoming/".$file['name']. "." . uniqid().".qsos";
+
+move_uploaded_file($file['tmp_name'], $destination);
+chmod ($destination, 0770);
+echo "File successfully uploaded";
+?>
\ No newline at end of file




reply via email to

[Prev in Thread] Current Thread [Next in Thread]