[Tutos-commits] CVS: tutos/php/report-engine README,NONE,1.1 report_list_default.php,1.5,1.6 report_
Projects / CRM / PLM / Calendar / Tasks / SCRUM / Test / Inventory
Brought to you by:
gokohnert
From: Gero K. <gok...@us...> - 2005-02-19 13:45:10
|
Update of /cvsroot/tutos/tutos/php/report-engine In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17342/php/report-engine Modified Files: report_list_default.php report_overview.php report_show.php reporter.pinc Added Files: README Log Message: some updates to the report engine --- NEW FILE: README --- # # Copyright 2004 - 2005 by Gero Kohnert # # 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; version 2 of the License. # # # CVS Info: $Id: README,v 1.1 2005/02/19 13:45:00 gokohnert Exp $ # $Author: gokohnert $ The report-engine module allows an easy definition and programming of tasks and reports for varios pages inside the TUTOS system. Programmers Hints: All possible reports are defined in tutos/php/report-engine/report_list.php in the following way: $report['NAME OF REPORT'] = array( 'class' => 'CLASSNAME IN TUTOS', 'type' => 'TYPE OF PAGE', 'dir' => 'DIRNAME OF REPORT', 'file' => 'FILE TO LOAD', 'classname' => 'CLASS IN LOADED FILE', OPTIONAL: 'something1' => 'WHATEVER YOU WANT', 'something2' => 'WHATEVER YOU NEED', ); 'CLASSNAME IN TUTOS' and 'TYPE OF PAGE' is the type of TUTOS page. See the loadmodules call on top of the relevant TUTOS script. For example on top of product_show you will see a loadmodules('product','show') call which tells us that this page is about products and will display (i.e show) a object. 'DIRNAME OF REPORT' the subdirectory name where we find a report. This is relative to tutos/php/report-engine 'FILE TO LOAD' the report file to load (something.pinc) 'CLASS IN LOADED FILE' the classname in the loaded file. This class has to be a subclass of rep_base. Example: Filename : tutos/php/report-engine/'DIRNAME OF REPORT'/'FILE TO LOAD' class 'CLASS IN LOADED FILE' extends rep_base { } You can access additional data from the above definition as $this->data['something1'] inside your report class. And as always look at the examples coming with TUTOS. Index: report_list_default.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/report-engine/report_list_default.php,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- report_list_default.php 8 Feb 2005 06:58:43 -0000 1.5 +++ report_list_default.php 19 Feb 2005 13:45:00 -0000 1.6 @@ -1,6 +1,10 @@ <?php /** - * Copyright 2004 by Gero Kohnert + * Copyright 2004 - 2005 by Gero Kohnert + * + * 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; version 2 of the License. * * * CVS Info: $Id$ @@ -37,14 +41,14 @@ 'file' => "rep_spine.pinc", 'classname' => "rep_spine", ); -$report['rep_envelope'] = array( +$report['rep_envelope1'] = array( 'class' => "address", 'type' => "show", 'dir' => "rep_envelope", 'file' => "rep_envelope.pinc", 'classname' => "rep_envelope", ); -$report['rep_envelope'] = array( +$report['rep_envelope2'] = array( 'class' => "company", 'type' => "show", 'dir' => "rep_envelope", Index: report_overview.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/report-engine/report_overview.php,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- report_overview.php 2 Oct 2004 17:17:03 -0000 1.1 +++ report_overview.php 19 Feb 2005 13:45:00 -0000 1.2 @@ -1,8 +1,12 @@ <?php /** - * Copyright 2004 by Gero Kohnert + * Copyright 2004 - 2005 by Gero Kohnert * - * select a report available for the given page + * 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; version 2 of the License. + * + * select a report available for the given page * * @modulegroup report-engine * @module report_select @@ -51,6 +55,8 @@ } echo $x->report->ask_form() ."\n"; echo " <input type=\"submit\" value=\"SHOW\" title=\"SHOW\">\n"; + hiddenFormElements(); + echo $this->getHidden(); echo " </form>\n"; echo " </td>\n"; echo " <td> ". $x->report->getInfo() ."</td>\n"; Index: report_show.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/report-engine/report_show.php,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- report_show.php 2 Oct 2004 17:17:03 -0000 1.1 +++ report_show.php 19 Feb 2005 13:45:00 -0000 1.2 @@ -1,8 +1,12 @@ <?php /** - * Copyright 2004 by Gero Kohnert + * Copyright 2004 - 2005 by Gero Kohnert * - * select a report available for the given page + * 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; version 2 of the License. + * + * select a report available for the given page * * @modulegroup report-engine * @module report_select Index: reporter.pinc =================================================================== RCS file: /cvsroot/tutos/tutos/php/report-engine/reporter.pinc,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- reporter.pinc 12 Oct 2004 06:35:20 -0000 1.3 +++ reporter.pinc 19 Feb 2005 13:45:00 -0000 1.4 @@ -1,6 +1,10 @@ <?php /** - * Copyright 2004 by Gero Kohnert + * Copyright 2004 - 2005 by Gero Kohnert + * + * 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; version 2 of the License. * * CVS Info: $Id$ * $Author$ @@ -20,8 +24,8 @@ global $tutos,$current_user,$table; $this->init($dbconn); - $this->class = ""; - $this->type = ""; + $this->class = ''; + $this->type = ''; $this->rep_obj_id = -1; $this->rep_obj = -1; $this->report = -1; @@ -65,7 +69,7 @@ * get the type of object */ function gettype () { - return "report"; + return 'report'; } /** * get the type id of object @@ -134,13 +138,13 @@ report::obj_read($obj,$tutos['pageclass'],$tutos['pagetype']); if (count( $obj->list[usereporter]) == 0 ) { - return ""; + return ''; } - $x = array( url => "report-engine/report_overview.php?class=".$tutos['pageclass']."&type=".$tutos['pagetype']."&id=".$obj->id, + $x = array( url => 'report-engine/report_overview.php?class='.$tutos['pageclass'].'&type='.$tutos['pagetype'].'&id='.$obj->id, confirm => false, - text => ($text == "" ? $lang['Reports']:$text), + text => ($text == '' ? $lang['Reports']:$text), info => $lang['ReportsInfo'], - category => array("module") + category => array('module') ); return $x; } |