You are not logged in.
Hello,
I'm writing my own software management plugin. In the end it should inform you of all entities/ PC's that have software that need updating. I also added an option that the entire software packages may be ignored.
Here's my problem:
I can list my entire database table of models by adding them in the hook.php. But it always shows everything. I'd like to filter on a boolean in my table, if it's true then display it, if it's false then don't. (And then make 2 buttons, 1 to show all NOT-ignored and 1 to show all ignored)
If I search for a text the "plugin_****_addWhere" is called, but the initial ShowForm doesn't check this function. Is there any way to do my filtering without editing the GLPI source code?
Offline
Version of GLPI ?
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
Version of GLPI ?
0.72.4
Offline
Anyone got any advice?
Offline
I temporary solved my problem by adjusting the link to look like "?ignore=0&contains[0]=*". On the main php page I check if ignore is set. If so it sets a session variable.
In hook.php (plugin_plugin_addWhere) it checks if ignore is set in the session variable and then adjusts the query to set "ignore = 0". and if you search for * it will display everything.
This way a user can search for another item and the hook function automatically adds the "AND ignore = 0 / 1".
There is still one problem: If the user clears the search field and presses search, the hook function is never called. This causes all information to be displayed.
The only currently way to solve this (according to me:)) is to write a code that is similar to the helpdesk page. But that is quite allot of work for something that could be solved more easily.
(I hope the above makes any sence:P)
Last edited by concept (2010-05-07 12:58:25)
Offline