You are not logged in.
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
activer le mode debug
les requetes sql apparaissent en bas
Xavier Caillaud
Blog GLPI Infotel
Offline
et tu l'active comment ? dans configuration > générale ?
Offline
ui ^^
Plateforme de Test: PHPinfo
Version de GLPI: 0.72 & SVN
Offline
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
tu as declaré ton type et les colonnes liées dans setup.php ?
Xavier Caillaud
Blog GLPI Infotel
Offline
les erreurs php sont aussi tracées dans un fichier ???
Offline
si coché dans la config oui.
Xavier Caillaud
Blog GLPI Infotel
Offline
je trouve pas la case a cocher ! dans Central > Configuration > Générale
Offline
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
tu l'a mal déclaré surement quelque part
Xavier Caillaud
Blog GLPI Infotel
Offline
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
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
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
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
tu as mis quoi dans ton type ?
Xavier Caillaud
Blog GLPI Infotel
Offline
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
dans ton type PLUGIN_ARCHIRES_GENERATION_TYPE dans setup.php
Xavier Caillaud
Blog GLPI Infotel
Offline
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
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
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
ca y est j'ai vu mon erreur ..!
c'est dans les arguments ..! le boulet ....
Offline
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
Offline
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