You are not logged in.

Announcement

 Téléchargez la dernière version stable de GLPI      -     Et vous, que pouvez vous faire pour le projet GLPI ? :  Contribuer
 Download last stable version of GLPI                      -     What can you do for GLPI ? :  Contribute

#1 2012-11-01 23:20:06

danh
Member
From: Chicago, USA
Registered: 2012-03-08
Posts: 546
Website

How to create proper report name in reports plugin?

Right now I am creating report directories as:  computerreport
My php files reflect this naming.

What do I have to change so that in GLPI my report shows as: Computer Report


Thanks,
Dan

Offline

#2 2012-11-05 12:43:41

berserker
Member
From: Toulouse
Registered: 2009-09-15
Posts: 160

Re: How to create proper report name in reports plugin?

Hi,

It's in your language files (ak : "computerreport.en_GB.php")

This first value is your plugin name : $LANG['plugin_reports']['computerreport'][1]= " Computer Report"


GLPI : 9.1.6 - OCS : 2.1.2
Plateforme : Windows Server 2008R2 Standard Edition Service Pack 1
Apache/2.2.31 (Win32) mod_ssl/2.2.31 OpenSSL/1.0.1p PHP/5.4.45 mod_perl/2.0.8 Perl/v5.16.3 ()
MySQL: 5.7.10-log

Offline

#3 2012-11-05 16:00:24

danh
Member
From: Chicago, USA
Registered: 2012-03-08
Posts: 546
Website

Re: How to create proper report name in reports plugin?

That just doesn't work for me.

This is my file:

<?php
$LANG['plugin_reports']['computerusers'][1] = "Computer User Info";
?>

and it still shows as computerusers in the report list.


Thanks,
Dan

Offline

#4 2012-11-05 16:48:24

berserker
Member
From: Toulouse
Registered: 2009-09-15
Posts: 160

Re: How to create proper report name in reports plugin?

In first post you said your report directory is : computerreport

In your file you have $LANG['plugin_reports']['computerusers']

Folder name must be equal to file name and to this entry


GLPI : 9.1.6 - OCS : 2.1.2
Plateforme : Windows Server 2008R2 Standard Edition Service Pack 1
Apache/2.2.31 (Win32) mod_ssl/2.2.31 OpenSSL/1.0.1p PHP/5.4.45 mod_perl/2.0.8 Perl/v5.16.3 ()
MySQL: 5.7.10-log

Offline

#5 2012-11-05 16:53:37

danh
Member
From: Chicago, USA
Registered: 2012-03-08
Posts: 546
Website

Re: How to create proper report name in reports plugin?

Thanks.  I have tried several attempts with different names and I posted incorrectly here.  I did reconfirm that both parts are named the same and tried again and it still is not working. 

What am I missing?

Here is my latest attempt:

/var/www/glpi/plugins/reports/report/computerreport
- computerreport.en_US.php
- computerreport.php

computerreport.php:

<?
define('GLPI_ROOT', '../../../..');
include(GLPI_ROOT."/inc/includes.php");

$USEDBREPLICATE=0;
$DBCONNECTION_REQUIRED=1;


$report = new PluginReportsAutoReport($LANG['plugin_reports']['computerreport'][1]);

// write columns Computer name with sql id computername ..... 
// (sql field, column name)
$columns= array(new PluginReportsColumn('computername','Computer'),
                new PluginReportsColumn('username',$LANG['stats'][20]), 
                new PluginReportsColumn('serial',$LANG['common'][19]),   
                new PluginReportsColumn('contact_num','Location'));   


$report->setColumnsNames($columns);

//SQL Statement
$sql="select A.name as computername,serial,contact_num,B.name as username from glpi_computers as A left join glpi_users as B on A.users_id=B.id";
$report->setSqlRequest($sql);
$report->execute();
?>

computerreport.en_US.php:

<?php
$LANG['plugin_reports']['computerreport'][1] = "Computer Report";
?>

Last edited by danh (2012-11-05 17:02:36)


Thanks,
Dan

Offline

#6 2012-11-12 00:03:05

danh
Member
From: Chicago, USA
Registered: 2012-03-08
Posts: 546
Website

Re: How to create proper report name in reports plugin?

checking in...

Last edited by danh (2012-11-21 23:35:35)


Thanks,
Dan

Offline

#7 2012-11-21 23:36:31

danh
Member
From: Chicago, USA
Registered: 2012-03-08
Posts: 546
Website

Re: How to create proper report name in reports plugin?

I am still no closer to fixing this.  I even tried on a brand new install and I get the same results.


Thanks,
Dan

Offline

#8 2012-12-08 19:50:56

danh
Member
From: Chicago, USA
Registered: 2012-03-08
Posts: 546
Website

Re: How to create proper report name in reports plugin?

I'm still seeking help on this one?
Anyone having this issue?


Thanks,
Dan

Offline

#9 2012-12-11 17:00:47

ftrojahn
Member
Registered: 2012-12-07
Posts: 8

Re: How to create proper report name in reports plugin?

Hello Dan,

well, just followed your advice to create the report from your post #5,
copied computerreport.en_US.php to computerreport.de_DE.php,
then changed "Computer Report" to "PC Report" in there.

In Setup->Plugins->Reports -> Rights management by report
I found "PC Report" on first position and changed it's rights accordingly.

Then, the "PC Report" could be accessed via Tools->Reports-> PC Report.

Are you sure, that your locale is en_US -> standard seems "en_GB" if you set
language to English in user's settings.

In debug mode you can see variable "glpilanguage" for locale.

I was using GLPI 0.83.31 and reports 1.5.0.

Falko

Offline

#10 2012-12-11 17:27:23

danh
Member
From: Chicago, USA
Registered: 2012-03-08
Posts: 546
Website

Re: How to create proper report name in reports plugin?

WOW!          THANK YOU!..!

I can't believe that was it.

Again, thank you :-)


Thanks,
Dan

Offline

Board footer

Powered by FluxBB