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 2021-02-01 19:16:08

ec2311
Member
Registered: 2016-04-07
Posts: 305

Plugin Reports 1.14.0

Bonjour

Les titres de reports ne semblent pas être pris en compte.

niveau php :
$report = new PluginReportsAutoReport(__('AppliComputer_report_title', 'reports'));

dans repertoire locales, fichier fr_FR.po : ajout de
msgid "AppliComputer_report_title"
msgstr "Liste des Applications"

compilation -> MO

je vois toujours "AppliComputer_report_title" comme titre de report au lieu de voir "Liste des applications"
Y compris dans les autorisations...
j'ai fait un Arret/relance de Apache : pas d'effet.

Ce type de coding fonctionnait en version 1.11.3

Que faut-il faire ?

Merci


GLPI 10.0.10
GLPIinventory 1.3.4

Agents : FI (2.6, 2.5) et Glpiagents (1.7)

Offline

#2 2021-02-02 15:55:43

ec2311
Member
Registered: 2016-04-07
Posts: 305

Re: Plugin Reports 1.14.0

Bonjour

En regardant le source de reports/inc/function.php
//$prefix = Plugin::getPhpDir('repots'). "/plugins/$plugin/report/". $report_name ."/" . $report_name;
   $prefix = GLPI_ROOT . "/plugins/$plugin/report/". $report_name ."/" . $report_name;

j'ai essayé de corriger "repots" en "reports" -> niet meme comportant, il en trouve pas la traduction

en reprenant la ligne de la version precedemment installé (1.11.3)
   $prefix = GLPI_ROOT . "/plugins/$plugin/report/". $report_name ."/" . $report_name;

cela fonctionne : je retrouve les titres des reports...mais a condition d'avoir un fichier *.fr_FR.php en ligne dans le repertoire.

j'utilsie par defaut le fr_FR.PO... et là pour le moment pas reussi.

A suivre...


GLPI 10.0.10
GLPIinventory 1.3.4

Agents : FI (2.6, 2.5) et Glpiagents (1.7)

Offline

#3 2021-03-23 17:01:08

yllen
GLPI-DEV
From: Sillery (51)
Registered: 2008-01-14
Posts: 15,278

Re: Plugin Reports 1.14.0

Le problème est corrigé dans la dernière version du plugin : 1.14.1 (https://forge.glpi-project.org/versions/1320)


CentOS 6.5 - CentOS 7.x
PHP 5.6 - PHP 7.x - MySQL 5.6  - MariaDB 10.2 + APC + oOPcache
GLPI from 0.72 to dev version
Certifiée ITIL (ITV2F, ITILF, ITILOSA)

Offline

#4 2021-03-24 17:12:38

ec2311
Member
Registered: 2016-04-07
Posts: 305

Re: Plugin Reports 1.14.0

Bonjour

Merci Yllen

Il me semble qu'il y a encore un bug sur le titre meme du rapport : on a toujours le 'report_title' qui s'affiche au lieu de sa traduction.

j'effectue la recherche du titre via
$report = new PluginReportsAutoReport(__('xxxxreport_title', 'reports'));

et xxxxreport_title est bien défini dans fr_FR.po, recompilé.

Encore merci


GLPI 10.0.10
GLPIinventory 1.3.4

Agents : FI (2.6, 2.5) et Glpiagents (1.7)

Offline

#5 2021-03-30 13:54:03

yllen
GLPI-DEV
From: Sillery (51)
Registered: 2008-01-14
Posts: 15,278

Re: Plugin Reports 1.14.0

Il faut relancer apache pour vider le cache, je pense que le problème vient de là


CentOS 6.5 - CentOS 7.x
PHP 5.6 - PHP 7.x - MySQL 5.6  - MariaDB 10.2 + APC + oOPcache
GLPI from 0.72 to dev version
Certifiée ITIL (ITV2F, ITILF, ITILOSA)

Offline

#6 2021-08-08 21:37:50

delcroip
Member
Registered: 2020-07-05
Posts: 6

Re: Plugin Reports 1.14.0

Bonjour

tout d'abord merci au dev, le plugins "reports" est vraiment un plus pour les dev de plugins.

Pour un de mes rapport j'ai ajouté une classe "PluginReportsToggleCriteria" (checkbox) assez générique mais je ne trouve pas ou commiter (pas sur github)

donc la voici si ça intéresse les devs de l'ajouter au module

<?php
/**
 * @version $Id: tooglecriteria.class.php 1 2021-08-08 21:00:00Z delcroip $
 -------------------------------------------------------------------------
  LICENSE

 This file is part of Reports plugin for GLPI.

 Reports is free software: you can redistribute it and/or modify
 it under the terms of the GNU Affero General Public License as published by
 the Free Software Foundation, either version 3 of the License, or
 (at your option) any later version.

 Reports 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 Affero General Public License for more details.

 You should have received a copy of the GNU Affero General Public License
 along with Reports. If not, see <http://www.gnu.org/licenses/>.

 @package   reports
 @authors   Patrick Delcroix
 @copyright Copyright (c) 2009-2021 Reports plugin team
 @license   AGPL License 3.0 or (at your option) any later version
            http://www.gnu.org/licenses/agpl-3.0-standalone.html
 @link      https://forge.glpi-project.org/projects/reports
 @link      http://www.glpi-project.org/
 @since     2009
 --------------------------------------------------------------------------
 */

// ----------------------------------------------------------------------
// Original Author of file:
// Purpose of file:
// ----------------------------------------------------------------------

/**
 * Priority selection criteria
**/
class PluginReportsToggleCriteria extends PluginReportsAutoCriteria {


   private $defaultValue;



   /**
    * @param $report
    * @param $name      (default 'toggle')
    * @param $label     (default '')
    * @param $defaultValue value by default
    * @param $sqlField field to select
   **/
   function __construct($report, $name='toggle', $label = '', $defaultValue = 0, $sql_field = '') {
      parent::__construct($report, $name, $sql_field, ($label ? $label : __('Toggle')));
      $this->defaultValue = $defaultValue;
      
      
   }


   public function setDefaultValues() {
      $this->addParameter($this->getName(), 1);

   }


   public function displayCriteria() {

      $this->getReport()->startColumn();
      $buttons =  null;

      if ($this->getParameterValue() == 0) {
         $buttons ="<input  type='checkbox' name = '".$this->GetName()."'>";
      } else {
         $buttons ="<input  type='checkbox' name = '".$this->GetName()."' checked >";
      }
      
      echo $this->getCriteriaLabel().'&nbsp;';
      $this->getReport()->endColumn();
      $this->getReport()->startColumn();
      echo $buttons.'&nbsp;';
      $this->getReport()->endColumn();
   }


   function getSubName() {

      return " ";
   }


   /**
    * @param $priority
   **/
   function setDefaultPriorityValue($priority) {
      $this->addParameter($this->getName(), $priority);
   }


   /**
    * @see plugins/reports/inc/PluginReportsAutoCriteria::getSqlCriteriasRestriction()
   */
   public function getSqlCriteriasRestriction($link='AND') {

      // show restriction only if sqlField is setup
      if ($this->getSqlField() != '') {
         return $link . " " . $this->getSqlField() . "= '" . $this->getParameterValue() . "'";
      }


   }

      /**
    * Get all parameters associated with the criteria
   **/
  function getParameterValue() {
      $value = parent::getParameterValue();
      if ($value == 'on') {
         return 1;
      } else if ( isset($_POST['find'])){
         return 0;
      } else {
         return $this->defaultValue;
      }
}

}

Last edited by delcroip (2021-08-08 21:47:48)

Offline

Board footer

Powered by FluxBB