You are not logged in.
Pages: 1
Hello. I'm new to GLPI, and at work they asked me to fix a plugin they made to print custom PDF form for an equipment. It worked without a hitch until version 9.3, but when they migrated to 9.5, it stopped working. Now, I managed to install the plugin, but when I open an equipment page, the plugin doesn't show on the tab menu. So, my question is, where in the GLPI code is decided that a plugin should be given its own tab on the glpi_tabs div?
Offline
What is the name of your plugin ?
Offline
It's an internal plugin fmade by someone at my company some 5 years ago. It's based on the PDF plugin, tho, for printing info about the assets you have.
Offline
Tabs are typically defined in the setup.php file in the plugin folder. The lines should be a Plugin::registerClass call with a "addtabon" option.
I would also suggest checking in your Profile to see if there are rights associated with the plugin that are not enabled for you.
GLPI Collaborator and Plugin Developer.
My non-English comments are automated translations. Sorry for any confusion that causes.
Mes commentaires non anglais sont des traductions automatiques. Désolé pour toute confusion qui cause.
Mis comentarios que no están en inglés son traducciones automáticas. Perdón por cualquier confusión que cause.
Offline
If you can not fix your problem maybe it´s a way to install the pdf plugin from glpi marketplace ?
Offline
I tried to do it with the RegisterClass option, but as far as I can see, none of the lines with that command helped.
What I ended up doing was modifying the original PDF plugin, adding what I needed and changing the layout of the report. But now I have a new problem: I can't figure out what I need to do so GLPI recognizes it as a new plugin instead of the PDF one. I changed the name in the setup.php file, but if I try to add both my plugin and the PDF plugin, I get an error about a function already declared. Is there a place where I can specify what folder the plugin should be installed in?
Offline
You need to change the plugin's folder name to the internal name of your plugin (no spaces, all lowercase). Each function in hooks.php and setup.php need renamed replacing "pdf" with your plugin's internal name.
There are probably other places referring to the "pdf" plugin that you need to change.
GLPI Collaborator and Plugin Developer.
My non-English comments are automated translations. Sorry for any confusion that causes.
Mes commentaires non anglais sont des traductions automatiques. Désolé pour toute confusion qui cause.
Mis comentarios que no están en inglés son traducciones automáticas. Perdón por cualquier confusión que cause.
Offline
I figured the name thingy, and I managed to be able to install both plugins at the same time (I just did a massive Find and Replace, replacing all the instances of PluginPdf for PluginNewPdf, and so on), but now I have another new problem: I can't make it show the new Tab on the menu. I even figured out where it's added in the latest PDF Plugin: it's in the plugin_pdf_postinit() function in hook.php; if I comment the line CommonGLPI[...] in the original PDF plugin, the menu tab disappears. But, no matter how I change the name in my modified plugin, it just won't show. I'm honestly at a loss as to what am I supposed to do.
Offline
Pages: 1