The Suppliertag plugin

This extension works with GLPI version 0.70 or greater.

This plugin allows you to import bulk data from manufacturer's warranty of your equipment.

Installation

After decompressing the archive into the plugin folder of GLPI, log on as administrator:

Menu: Configuration / Plugins / Suppliertag / Installation

This will create the tables used by the extension.

Prerequisite

(This is a reproduction of the file prerequis.txt which is in the plugin directory suppliertag)

Dell

  • The equipment must have the serial number field filled with Dell tag
  • The equipment must have the GLPI financial information activated
  • The equipment shall have the right manufacturer (Dell - see config)

HP

  • The equipment must have the serial number field filled with HP tag
  • The equipment must have the Model Number field equipment filled with HP tag (tab plugins - Import manufacturer)
  • The equipment must have the GLPI financial information activated
  • The equipment shall have the right manufacturer (HP - see config)

Fujitsu-Siemens

  • The equipment must have the serial number field filled with fujitsu-siemens tag
  • The equipment must have the financial information of activated
  • The equipment shall have the right manufacturer (fujitsu-siemens - see config)

Toshiba

  • The equipment must have the serial number field filled with Toshiba tag
  • The equipment must have the Model Number field equipment filled with Toshiba tag (tab plugins - Import manufacturer)
  • The equipment must have GLPI financial information activated
  • The equipment shall have the right manufacturer (Toshiba - see config)

Rights Management

GLPI version 0.72:

Menu: Administration / Profiles / Import Tab manufacturer

GLPI version 0.71:

Menu: Configuration / Plugins / Suppliertag / Management rights profile

This step allows you to define user profiles that can use the extension.

Reports

Features

Tips

Automatic calculation of the warranty period (Dell) - GLPI 0.70.X

For GLPI 0.72, the code has been integrated into the plugin. To enable automatic recovery, set the warranty period defaults to zero in the configuration of the plugin (for the vendor "Dell" and "HP")

This change in code will allow you to automatically obtain the warranty period for your Dell machines. (will take into account any extensions of coverage that may be applicable).

The logic is to determine the warranty period by calculating the number of months between the date of delivery and the highest date found on the page.

To enable automatic recovery, set the warranty period defaults to zero in the configuration of the plugin (for the vendor “Dell”).

File: (glpi_home) / plugins / suppliertag / inc / plugin_suppliertag.functions_display.php

Code to be inserted immediately after the following line: No. 909 ($maDate = years.“-”.months.“-”.days;)

//
// C. Pierron, TCS
// Recherche automatique de la date de fin de garantie
// (si la duree de garantie a ete parametree a zero dans
//  l'interface utilisateur)
if ( $warranty == 0 )
{
  $masque='([0-9]{2}/[0-9]{2}/[0-9]{4})';
  
  preg_match_all ($masque, $contents, $liste_resultat);
  $maDateFin = $maDate;
  
  foreach ($liste_resultat[0] as $occurence)
  {
    $maCandidate = str_replace ('/', '-', $occurence);
    list ($jour, $mois, $annee) = explode ('-', $maCandidate);
    $maCandidate = $annee."-".$mois."-".$jour;
    
    if ( $maCandidate > $maDateFin )
      $maDateFin = $maCandidate;
  }
  
  $maDateFin = date ("Y-m-d", strtotime ($maDateFin) + 86400);
  
  list ($adebut, $mdebut, $jdebut) = explode ('-', $maDate);
  list ($afin, $mfin, $jfin) = explode ('-', $maDateFin);
  
  $maGarantie = ($afin * 12 + $mfin) - ($adebut * 12 + $mdebut);
  $warranty = $maGarantie;
}

Problems

Dell problem import - GLPI 0.71.x

During the import if you get this in the result window:

Purchase Date: 0000-00-00 →-valign = “to

You should replace: plugins / suppliertag / inc / plugin_suppliertag.functions_display.php on line 906

$maDate = substr($finduhtml,44,10);

with

$maDate = substr($finduhtml,57,10);

Problem importing via Proxy

For those who encounter problems importing through a proxy: (PHP ERROR: Undefined variable: msgerr in / srv / www / htdocs / glpi_dev / plugins / suppliertag / inc / plugin_suppliertag.functions_display.php at line 1060)

Replace line 872:

fputs($proxy_fp, "GET $urlrnHTTP/1.0rnHost: ".$CFG_GLPI["proxy_name"]."rn");

with

fputs($proxy_fp, "GET $url HTTP/1.0rnHost: ".$CFG_GLPI["proxy_name"]."rn");

Problem when importing

Importing from the site does not complete.

In debug mode GLPI refers to the error here:

PHP ERROR: fopen () [function.fopen]: php_network_getaddresses: getaddrinfo failed: H? Unknown. in C: webxampphtdocsglpipluginssuppliertagincplugin_suppliertag.functions_display.php at line 859 PHP ERROR: fopen (http://www11.itrc.hp.com/service/ewarra … amp; submit) [function.fopen]: failed to open stream: No such file or directory in C: webxampphtdocsglpipluginssuppliertagincplugin_suppliertag.functions_display.php at line 859

This error for the function fopen:

It can not open from the server the URL of manufacturer

line 859 $ fp = fopen ($ url, 'rb')

1st option:

Verify that the server that is hosting GLPI has access to the Internet. You must specify from the server and not from your PC (which connects to the server via your browser) because the server retrieves the information for you from the manufacturer's website.

2nd option

Go to the php.ini configuration file and verify that this setting is enabled

allow_url_fopen = On If this is not the case edit and save PHP.ini

Hoping that this will help some …