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 2008-09-10 11:09:59

axil_76
Member
Registered: 2008-05-28
Posts: 135

Ajout fonction au plugin architecture reseau

Bonjour,
je suis en train de modifier le plugins architecture reseau pour lui ajouter une nouvelle fonction
generer une vue du matériel réseau
Je rencontre un petit souci au niveau d'une requete sql j'ai ca !

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'FROM ORDER BY ID LIMIT 0, 20' at line 1

je ne vois pas ou il faut modifier la requete !
Merci par avance
Cdlt

Offline

#2 2008-09-10 12:28:16

tsmr
GLPI-DEV
From: Rennes
Registered: 2005-08-26
Posts: 11,632
Website

Re: Ajout fonction au plugin architecture reseau

activer le mode debug

les requetes sql apparaissent en bas


Xavier Caillaud
Blog GLPI Infotel

Offline

#3 2008-09-10 15:03:07

axil_76
Member
Registered: 2008-05-28
Posts: 135

Re: Ajout fonction au plugin architecture reseau

et tu l'active comment ? dans configuration > générale ?

Offline

#4 2008-09-10 15:23:56

Ro9eR
Member
From: Montigny le Bx (78)
Registered: 2007-11-02
Posts: 727

Re: Ajout fonction au plugin architecture reseau

ui ^^


Plateforme de Test: PHPinfo
Version de GLPI: 0.72 & SVN

Offline

#5 2008-09-10 16:37:15

axil_76
Member
Registered: 2008-05-28
Posts: 135

Re: Ajout fonction au plugin architecture reseau

c'est dans cette partie la  :

if ((isset($_SESSION["glpi_plugin_network_installed"]) && $_SESSION["glpi_plugin_network_installed"]==1)){
        $plugin_archires_query_generation=new plugin_archires_query_generation();
        $plugin_archires_query_generation->title();
        }
       
    manageGetValuesInSearch(PLUGIN_ARCHIRES_GENERATION_TYPE);
       
    searchForm(PLUGIN_ARCHIRES_GENERATION_TYPE,$_SERVER['PHP_SELF'],$_GET["field"],$_GET["contains"],$_GET["sort"],$_GET["deleted"],$_GET["link"],$_GET["distinct"],$_GET["link2"],$_GET["contains2"],$_GET["field2"],$_GET["type2"]);
       
    showList(PLUGIN_ARCHIRES_GENERATION_TYPE,$_SERVER['PHP_SELF'],$_GET["field"],$_GET["contains"],$_GET["sort"],$_GET["order"],$_GET["start"],$_GET["deleted"],$_GET["link"],$_GET["distinct"],$_GET["link2"],$_GET["contains2"],$_GET["field2"],$_GET["type2"]);

dans la fonction showList je ne recupere pas la valeur PLUGIN_ARCHIRES_GENERATION_TYPE

Offline

#6 2008-09-10 16:45:46

tsmr
GLPI-DEV
From: Rennes
Registered: 2005-08-26
Posts: 11,632
Website

Re: Ajout fonction au plugin architecture reseau

tu as declaré ton type et les colonnes liées dans setup.php ?


Xavier Caillaud
Blog GLPI Infotel

Offline

#7 2008-09-10 17:17:46

axil_76
Member
Registered: 2008-05-28
Posts: 135

Re: Ajout fonction au plugin architecture reseau

les erreurs php sont aussi tracées dans un fichier   ???

Offline

#8 2008-09-10 18:17:26

tsmr
GLPI-DEV
From: Rennes
Registered: 2005-08-26
Posts: 11,632
Website

Re: Ajout fonction au plugin architecture reseau

si coché dans la config oui.


Xavier Caillaud
Blog GLPI Infotel

Offline

#9 2008-09-11 10:04:53

axil_76
Member
Registered: 2008-05-28
Posts: 135

Re: Ajout fonction au plugin architecture reseau

je trouve pas la case a cocher ! sad dans  Central  > Configuration > Générale

Offline

#10 2008-09-11 11:12:38

axil_76
Member
Registered: 2008-05-28
Posts: 135

Re: Ajout fonction au plugin architecture reseau

j'ai bien declarer les variables dans setup.php
je me retrouve avec le message d'erreur suivant :
Error: Table 'glpi.plugin_archires_query_generation' doesn't exist

la table existe ! mais son nom c'est glpi_plugin_archires_query_generation et non pas glpi.plugin_archires_query_generation il manque peut etre le prefix ?

Offline

#11 2008-09-11 11:23:58

tsmr
GLPI-DEV
From: Rennes
Registered: 2005-08-26
Posts: 11,632
Website

Re: Ajout fonction au plugin architecture reseau

tu l'a mal déclaré surement quelque part


Xavier Caillaud
Blog GLPI Infotel

Offline

#12 2008-09-11 11:27:55

axil_76
Member
Registered: 2008-05-28
Posts: 135

Re: Ajout fonction au plugin architecture reseau

if faut déclarer les variables comme ca  ?

    $sopt[PLUGIN_ARCHIRES_GENERATION_TYPE]['common']=$LANGARCHIRES["title"][5];
   
    $sopt[PLUGIN_ARCHIRES_GENERATION_TYPE][1]['table']='glpi_plugin_archires_query_generation';
    $sopt[PLUGIN_ARCHIRES_GENERATION_TYPE][1]['field']='name';
    $sopt[PLUGIN_ARCHIRES_GENERATION_TYPE][1]['linkfield']='name';
    $sopt[PLUGIN_ARCHIRES_GENERATION_TYPE][1]['name']=$LANGARCHIRES["search"][1];
   
    $sopt[PLUGIN_ARCHIRES_GENERATION_TYPE][2]['table']='glpi_networking';
    $sopt[PLUGIN_ARCHIRES_GENERATION_TYPE][2]['field']='name';
    $sopt[PLUGIN_ARCHIRES_GENERATION_TYPE][2]['linkfield']='switch';
    $sopt[PLUGIN_ARCHIRES_GENERATION_TYPE][2]['name']=$LANG["help"][26];
       
    $sopt[PLUGIN_ARCHIRES_GENERATION_TYPE][3]['table']='glpi_dropdown_network';
    $sopt[PLUGIN_ARCHIRES_GENERATION_TYPE][3]['field']='name';
    $sopt[PLUGIN_ARCHIRES_GENERATION_TYPE][3]['linkfield']='network';
    $sopt[PLUGIN_ARCHIRES_GENERATION_TYPE][3]['name']=$LANGARCHIRES["search"][4];


   
    $sopt[PLUGIN_ARCHIRES_GENERATION_TYPE][4]['table']='glpi_dropdown_state';
    $sopt[PLUGIN_ARCHIRES_GENERATION_TYPE][4]['field']='name';
    $sopt[PLUGIN_ARCHIRES_GENERATION_TYPE][4]['linkfield']='status';
    $sopt[PLUGIN_ARCHIRES_GENERATION_TYPE][4]['name']=$LANGARCHIRES["search"][5];
   
    $sopt[PLUGIN_ARCHIRES_GENERATION_TYPE][5]['table']='glpi_groups';
    $sopt[PLUGIN_ARCHIRES_GENERATION_TYPE][5]['field']='name';
    $sopt[PLUGIN_ARCHIRES_GENERATION_TYPE][5]['linkfield']='FK_group';
    $sopt[PLUGIN_ARCHIRES_GENERATION_TYPE][5]['name']=$LANG["common"][35];
   
    $sopt[PLUGIN_ARCHIRES_GENERATION_TYPE][6]['table']='glpi_dropdown_vlan';
    $sopt[PLUGIN_ARCHIRES_GENERATION_TYPE][6]['field']='name';
    $sopt[PLUGIN_ARCHIRES_GENERATION_TYPE][6]['linkfield']='FK_vlan';
    $sopt[PLUGIN_ARCHIRES_GENERATION_TYPE][6]['name']=$LANG["networking"][56];
   
    $sopt[PLUGIN_ARCHIRES_GENERATION_TYPE][7]['table']='glpi_plugin_archires_config';
    $sopt[PLUGIN_ARCHIRES_GENERATION_TYPE][7]['field']='name';
    $sopt[PLUGIN_ARCHIRES_GENERATION_TYPE][7]['linkfield']='FK_config';
    $sopt[PLUGIN_ARCHIRES_GENERATION_TYPE][7]['name']=$LANGARCHIRES["setup"][20];
   
    $sopt[PLUGIN_ARCHIRES_GENERATION_TYPE][8]['table']='glpi_plugin_archires_query_switch';
    $sopt[PLUGIN_ARCHIRES_GENERATION_TYPE][8]['field']='link';
    $sopt[PLUGIN_ARCHIRES_GENERATION_TYPE][8]['linkfield']='';
    $sopt[PLUGIN_ARCHIRES_GENERATION_TYPE][8]['name']=$LANGARCHIRES["archires"][0];
   
    $sopt[PLUGIN_ARCHIRES_GENERATION_TYPE][30]['table']='glpi_plugin_archires_query_switch';
    $sopt[PLUGIN_ARCHIRES_GENERATION_TYPE][30]['field']='ID';
    $sopt[PLUGIN_ARCHIRES_GENERATION_TYPE][30]['linkfield']='';
    $sopt[PLUGIN_ARCHIRES_GENERATION_TYPE][30]['name']=$LANG["common"][2];
   
    $sopt[PLUGIN_ARCHIRES_GENERATION_TYPE][80]['table']='glpi_entities';
    $sopt[PLUGIN_ARCHIRES_GENERATION_TYPE][80]['field']='completename';
    $sopt[PLUGIN_ARCHIRES_GENERATION_TYPE][80]['linkfield']='FK_entities';
    $sopt[PLUGIN_ARCHIRES_GENERATION_TYPE][80]['name']=$LANG["entity"][0];   
    //fin modif

Offline

#13 2008-09-15 15:43:11

axil_76
Member
Registered: 2008-05-28
Posts: 135

Re: Ajout fonction au plugin architecture reseau

bonjour,
j'ai besoin d'un petit coup de main .... j'arrive bien a inserer des lignes dans la base par contre je n'arrive pas a les afficher .. faut-il ajouter quelques choses dans la table glpi_plugin_archires_query_type ???
j'ai egalament une erreur quand je rajoute la ligne
include_once ("inc/plugin_archires.functions_display.generation.php"); dans le setup.php

Offline

#14 2008-09-16 09:45:11

axil_76
Member
Registered: 2008-05-28
Posts: 135

Re: Ajout fonction au plugin architecture reseau

j'ai trouvé pour l'erreur en fait j'avais une fonction qui avait le meme nom .. le boulet ..
par contre j'ai toujours mon erreur sql je trouve pas .... un petit coup de main ...svp :-(
merci

Offline

#15 2008-09-16 09:57:30

axil_76
Member
Registered: 2008-05-28
Posts: 135

Re: Ajout fonction au plugin architecture reseau

mon erreur sql
*** MySQL query error :
***
SQL: SELECT glpi_plugin_archires_query_switch.name AS ITEM_0, plugin_archires_query_generation.ID AS ID  FROM plugin_archires_query_generation LEFT JOIN glpi_plugin_archires_query_switch  ON (plugin_archires_query_generation.name = glpi_plugin_archires_query_switch.ID)  ORDER BY glpi_plugin_archires_query_switch.name ASC  LIMIT 0, 250


en fait j'ai plugin_archires_query_generation.name au lieu de glpi_plugin_archires_query_generation.name et je vois pas  ...
j'ai pourtant déclaré les variables :

$sopt[PLUGIN_ARCHIRES_GENERATION_TYPE]['common']=$LANGARCHIRES["title"][5];
   
    $sopt[PLUGIN_ARCHIRES_GENERATION_TYPE][1]['table']='glpi_plugin_archires_query_generation';
    $sopt[PLUGIN_ARCHIRES_GENERATION_TYPE][1]['field']='name';
    $sopt[PLUGIN_ARCHIRES_GENERATION_TYPE][1]['linkfield']='name';
    $sopt[PLUGIN_ARCHIRES_GENERATION_TYPE][1]['name']=$LANGARCHIRES["search"][1];

Last edited by axil_76 (2008-09-16 09:57:59)

Offline

#16 2008-09-16 10:31:48

tsmr
GLPI-DEV
From: Rennes
Registered: 2005-08-26
Posts: 11,632
Website

Re: Ajout fonction au plugin architecture reseau

tu as mis quoi dans ton type ?


Xavier Caillaud
Blog GLPI Infotel

Offline

#17 2008-09-16 11:36:46

axil_76
Member
Registered: 2008-05-28
Posts: 135

Re: Ajout fonction au plugin architecture reseau

c'est le debut de la fonction

class plugin_archires_query_generation extends CommonDBTM {

    function plugin_archires_query_generation () {
        $this->table="glpi_plugin_archires_query_generation";
        $this->type=PLUGIN_ARCHIRES_GENERATION_TYPE;
    }

Last edited by axil_76 (2008-09-16 11:39:20)

Offline

#18 2008-09-16 11:46:47

tsmr
GLPI-DEV
From: Rennes
Registered: 2005-08-26
Posts: 11,632
Website

Re: Ajout fonction au plugin architecture reseau

dans ton type PLUGIN_ARCHIRES_GENERATION_TYPE dans setup.php


Xavier Caillaud
Blog GLPI Infotel

Offline

#19 2008-09-16 11:59:44

axil_76
Member
Registered: 2008-05-28
Posts: 135

Re: Ajout fonction au plugin architecture reseau

en fait j'ai declaré de la meme facon que pour les autres fonctions applicatifs , switch
comme ci-dessus :

$sopt[PLUGIN_ARCHIRES_GENERATION_TYPE]['common']=$LANGARCHIRES["title"][5];
   
    $sopt[PLUGIN_ARCHIRES_GENERATION_TYPE][1]['table']='glpi_plugin_archires_query_generation';
    $sopt[PLUGIN_ARCHIRES_GENERATION_TYPE][1]['field']='name';
    $sopt[PLUGIN_ARCHIRES_GENERATION_TYPE][1]['linkfield']='name';
    $sopt[PLUGIN_ARCHIRES_GENERATION_TYPE][1]['name']=$LANGARCHIRES["search"][1];
   
......
ci je post le setup.php ca risque d'etre illisible ?

Last edited by axil_76 (2008-09-16 11:59:58)

Offline

#20 2008-09-16 12:01:37

tsmr
GLPI-DEV
From: Rennes
Registered: 2005-08-26
Posts: 11,632
Website

Re: Ajout fonction au plugin architecture reseau

tu dois avoir un truc du style

pluginNewType('archires',"PLUGIN_ARCHIRES_VIEW_TYPE",3003,"plugin_archires_config","glpi_plugin_archires_config","front/plugin_archires.form.config.php");

Xavier Caillaud
Blog GLPI Infotel

Offline

#21 2008-09-16 14:16:30

axil_76
Member
Registered: 2008-05-28
Posts: 135

Re: Ajout fonction au plugin architecture reseau

oui j'ai rajouter la  ligne

pluginNewType('archires',"PLUGIN_ARCHIRES_GENERATION_TYPE",3004,"plugin_archires_query_generation","plugin_archires_query_generation","front/plugin_archires.form.generation.php");

Last edited by axil_76 (2008-09-16 14:17:05)

Offline

#22 2008-09-16 14:23:08

axil_76
Member
Registered: 2008-05-28
Posts: 135

Re: Ajout fonction au plugin architecture reseau

ca y est j'ai vu mon erreur ..!
c'est dans les arguments ..! le boulet ....

Offline

#23 2008-09-16 14:37:23

axil_76
Member
Registered: 2008-05-28
Posts: 135

Re: Ajout fonction au plugin architecture reseau

c'est la fonction showList (...) qui affiche les colonnes
nom Enfants  Lieu  Réseau  Statut  Groupe     VLAN  Vue associée  Afficher ou c'est une fonction dans le plugins archires ???

Offline

#24 2008-09-16 15:33:53

tsmr
GLPI-DEV
From: Rennes
Registered: 2005-08-26
Posts: 11,632
Website

Re: Ajout fonction au plugin architecture reseau

c'est showlist.


Xavier Caillaud
Blog GLPI Infotel

Offline

#25 2008-09-19 10:13:30

axil_76
Member
Registered: 2008-05-28
Posts: 135

Re: Ajout fonction au plugin architecture reseau

oki merci pour tout ;-)
j'ai de nouveau un petit soucy ....
a la ligne $switch_id=$plugin_archires_query_generation->fields["generation"];
dans mon fichier plugin_archires.functions_display.generation.php je recupère 0  a chaque fois ..!
je vois pas pourquoi ..!
Merci

Offline

Board footer

Powered by FluxBB