index.html

index.html
More Reports for GLPI V 2.1

glpi-mreporting-2.1.tar.gz  glpi 0.84.x  Miércoles, 08 de Enero de 2014
14:22:28 +0100
The plugin " More Reports " you from simple extraction SQL database
(slightly formatting) to display graphs based on these extractions
Creating a new set of report

Creating a new set of report requires the report .

For this you must create a class in the file inc /
names must comply with the standards of GLPI.

name.class.php for filename
Extends class PluginMreportingName PluginMreportingBaseclass for class
name

Replace occurrences name with a name of your choice
Note the class inheritance , it is necessary for the plugin detects that
your class is a class of reporting (and not eg libraries )

Finally, add the local file ( local / fr_FR.php ), the declaration of
your class to assign a title and a description to it

$ LANG [' plugin_mreporting '] [' Name' ] [ 'title' ] = " reportings (
Example Wiki) - Title" ;
$ LANG [' plugin_mreporting '] [' Name' ] [' desc' ] = " reportings (
Example Wiki) - Description " ;

Declaration and operation functions extractions

You must add functionality to this class that the plugin generates
graphs
The plugin framework provides two main types of graphics :

Simple data ( camembert, horizontal bar , line or area )
Multiple data ( horizontal bars and grouped lines / multiple areas)

your functions must be called in a particular way :

reportTypeNomDeLaFonction function ( ) {
...
}

they must always be prefixed by report
Then comes the type of graph ( Hd , Pie, Hgbar , Area, Line, Garea ,
Gline )
And finally a suffix to your liking

Must be assigned to the class title ( description of optionally) for
each function .
Also in the file local ( local / fr_FR.php )

$ LANG [' plugin_mreporting '] [' Name' ] [' NomDeLaFonction '] [
'title' ] = " my title function " ;
$ LANG [' plugin_mreporting '] [' Name' ] [' NomDeLaFonction '] [' desc'
] = " my job description " ;

They must return an array () whose structure is described in the
following paragraph .
Expected by the framework Returns

simple data

return array (
' datas ' => array (
"apples" = > 25 ,
" Pear " => 52,
" strawberry " => 23 ,
"Peaches " = > 10
)
'unit' => ' Kg ' / / optionnal
) ;

multiple data

return array (
" datas " => array (
" Paris " = > array (12 , 84, 65 , 31)
"Bordeaux" => array (84 , 72, 18 , 23)
"Lille" => array (54 , 81, 25, 26)
)
" labels2 " => array (" apples ", " pears ", " strawberry ", " Peaches"
)
'unit' => ' Kg ' / / optionnal
) ;

Note: For Type area / Garea / line / gline an additional parameter is
available
spline: curves the lines in order to have a more rounded record

return array (
' datas ' => array (
"apples" = > 25 ,
" Pear " => 52,
" strawberry " => 23 ,
"Peaches " = > 10
)
'unit' => ' Kg ' / / optionnal
' spline' => true '/ / optionnal
) ;