You are not logged in.
Hello,
I read the doc https://glpi-plugins.readthedocs.io/en/ … index.html but I do not know where to put the file xxx.constant.php and the file xxx.fr_Fr.php because apparently the doc does not correspond to what is indicated in recent exchanges.
Unable to have custom fields? How to do ?
If I work in the fields.constant.php file it works but it's not ideal!
How to do ? Does generic object work in glpi 9.5.2, . Nothing in log
Thank you
Last edited by falco2001 (2020-12-03 13:59:08)
Offline
Hi,
When you created your custom object, a new folder was created on your server.
[GLPI Root Folder]/files/_plugins/genericobject/locales/[YourObject]/[yourobject].fr_FR.php is the locale file.
An existing folder may receive your custom field:
[GLPI Root Folder]/files/_plugins/genericobject/fields/[yourobject].constant.php contains your additionnal fields.
Be careful, your .constant.php file needs to be not closed by a ?>
There is a small error in the documentation, in the exemple file...
Have fun !
Offline
Hello and thank you
I had to create the biomedical folder in the local myself.
Moreover I don't have a?> At the end of the two files.
I copied the two files from the doc!
I don't see the fields added in "Adding a new field"
Note that has nothing to do with it! :
I also tried to add an entry (sortie_inventaires_exercices) in the field.constant.php file I can see it in "adding a field" that seems to work but it is not the normal operation! Moreover I do not understand why when adding the glpi_plugin_genericobject_glpis_sorties_inventaires_exercices` table is empty!
Offline
Hello,
in fact I had not seen the _plugin and I was working on plugin and not _plugin!
Sorry that actually works.
thank you so much
Offline
Hello,
in fact I had not seen the _plugin and I was working on plugin and not _plugin!
Sorry that actually works.
thank you so much
Nice to hear that :-)
Maybe you should make sure your plugin folder is right.
If I were you, I would disable the plugin (NOT UNINSTALL), delete the /plugin/genericobject folder, reinstall it from the archive and reactivate the plugin in the setup. Just to be sure you do not build on something that will be erased next time you update the plugin.
Offline
Hello,
with this
inventaire.constant :
_________________________
<?php
global $GO_FIELDS, $LANG;
// Exercice
$GO_FIELDS['plugin_genericobject_exercice_id']['name'] = $LANG['genericobject']['PluginGenericobjectInventaire'][1];
$GO_FIELDS['plugin_genericobject_exercice_id']['field'] = 'exercice';
$GO_FIELDS['plugin_genericobject_exercice_id']['input_type'] = 'dropdown';
// Famille
$GO_FIELDS['plugin_genericobject_famille_id']['name'] = $LANG['genericobject']['PluginGenericobjectInventaire'][2];
$GO_FIELDS['plugin_genericobject_famille_id']['field'] = 'famille';
$GO_FIELDS['plugin_genericobject_famille_id']['input_type'] = 'text';
// Acquisition
$GO_FIELDS['plugin_genericobject_acquisition_id']['name'] = $LANG['genericobject']['PluginGenericobjectInventaire'][3];
$GO_FIELDS['plugin_genericobject_acquisition_id']['field'] = 'acquisition';
$GO_FIELDS['plugin_genericobject_acquisition_id']['input_type'] = 'date';
// Utile
$GO_FIELDS['plugin_genericobject_utile_id']['name'] = $LANG['genericobject']['PluginGenericobjectInventaire'][4];
$GO_FIELDS['plugin_genericobject_utile_id']['field'] = 'utile';
$GO_FIELDS['plugin_genericobject_utile_id']['input_type'] = 'bool';
// Motif de sortie
$GO_FIELDS['plugin_genericobject_motifdesortie_id']['name'] = $LANG['genericobject']['PluginGenericobjectInventaire'][5];
$GO_FIELDS['plugin_genericobject_motifdesortie_id']['field'] = 'motifdesortie';
$GO_FIELDS['plugin_genericobject_motifdesortie_id']['input_type'] = 'multitext';
________________________________
et inventaire.fr_FR
$LANG['genericobject']['PluginGenericobjectInventaire'][1]="Exercice comptable";
$LANG['genericobject']['PluginGenericobjectInventaire'][2]="Famille";
$LANG['genericobject']['PluginGenericobjectInventaire'][3]="Date d'acquisition";
$LANG['genericobject']['PluginGenericobjectInventaire'][4]="Est-ce utile ?";
$LANG['genericobject']['PluginGenericobjectInventaire'][5]="Motif de sortie";
_________________________________
the inventory table contains all the data and the tables for exemple as utile and acquisitions are empty!
The structure of these are identical id, name, comment, date_mod, date_creation!
Is this a bug?
Normally we should have in the inventory table the id to the utile and acquisitions tables?
moreover the drop-down list no longer works, but it's a bug on github but it is not possible to add from list for exemple exercice_id. The botton add is not visible
Thank you
Last edited by falco2001 (2020-12-01 17:43:28)
Offline
Yes, you had to read the documentation!
The fields must be of the form xxxxxxx_s_id ..
I reset the code and the tables to zero! It's OK now !
Thanks to the developer for his very well done documentation ..
Offline
Hello,
I would also like to make a 1 to N link. For example if I create a license object I would like to associate several computers with it. Did you find the solution?
Offline