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 2010-09-23 15:02:32

davidwhite
Member
Registered: 2010-08-31
Posts: 17

Asset Templates and Child Entities

Hi All
I have a problem with asset templates, or maybe I'm not understanding the setup properly?

I've created all of our clients as child entities of the root entity.
I've created asset templates in the root entity and set the child entities drop down to yes.
When I change to a child entity and click the + button to add and asset, I don't see any of the templates.

Does anyone have any idea why?

Thanks

David

Offline

#2 2010-09-23 16:06:01

wawa
GLPI-DEV
From: Montpellier / France
Registered: 2006-07-03
Posts: 6,019
Website

Re: Asset Templates and Child Entities

hello
templates are are managed by entity only for the moment, no way to make them recursive

Offline

#3 2010-09-23 16:38:54

davidwhite
Member
Registered: 2010-08-31
Posts: 17

Re: Asset Templates and Child Entities

Ahh, thanks for the confirmation. So the child assets drop down doesn't work then !

Would it be true then that I should tell the users to create the assets in the root entity and then transfer them? I don't really want to do this, as it complicates matters and is prone to error. Or is it possible to duplicate templates between entities.

Even better, would there be a change I could make to the code to only retrieve templates from the root entity for all entities, or is it not that simple?


Thanks for your help.

Offline

#4 2010-09-24 13:28:48

davidwhite
Member
Registered: 2010-08-31
Posts: 17

Re: Asset Templates and Child Entities

Hi
I've changed the following code to allow child entities to see root entity templates and to be able to add items using those templates. I've only changed the code for network objects.
I know It's a hack and I'm probably going to screw up my installation, but any comments on what I've done would be appreciated!

Changed line 953 in /inc/setup.function.php
added
OR FK_entities=0
to read:
$query = "SELECT * FROM glpi_networking WHERE is_template = '1' AND FK_entities='" . $_SESSION["glpiactive_entity"] . "' OR FK_entities=0 ORDER by tplname";

added Line 313 in /inc/networking.class.php
$canedit= 1;

added line 338 in /inc/networking.class.php
$this->fields["FK_entities"] = $_SESSION["glpiactive_entity"];

Thanks

David

Offline

#5 2010-09-24 15:33:40

remi
GLPI-DEV
From: Champagne
Registered: 2007-04-28
Posts: 7,127
Website

Re: Asset Templates and Child Entities

This change could break database integrity if a template contains link to item in the entity.

+


Dév. Fedora 29 - PHP 5.6/7.0/7.1/7.2/7.3/7.4 - MariaDB 10.3 - GLPI master
Certifié ITILv3 - RPM pour Fedora, RHEL et CentOS sur https://blog.remirepo.net/

Offline

#6 2010-09-24 16:14:57

davidwhite
Member
Registered: 2010-08-31
Posts: 17

Re: Asset Templates and Child Entities

remi wrote:

This change could break database integrity if a template contains link to item in the entity.

+

Hi Remi
Could you elaborate on that please?
For example I'm using templates to quickly create a switch with 48 ports that have various characteristics such as an interface type called LAN for each port.
As far as I can see those parameters are not linked to an entity. I'm not specifying a location, technician, user or anything I else I can see that would be entity based. I presume that is what you mean?

Thanks for your help.

Regards

David

Offline

#7 2010-09-24 16:35:27

remi
GLPI-DEV
From: Champagne
Registered: 2007-04-28
Posts: 7,127
Website

Re: Asset Templates and Child Entities

> I presume that is what you mean?
Yes.


Dév. Fedora 29 - PHP 5.6/7.0/7.1/7.2/7.3/7.4 - MariaDB 10.3 - GLPI master
Certifié ITILv3 - RPM pour Fedora, RHEL et CentOS sur https://blog.remirepo.net/

Offline

#8 2010-09-24 16:45:01

davidwhite
Member
Registered: 2010-08-31
Posts: 17

Re: Asset Templates and Child Entities

Thanks for the clarification. Is this something that will be changed in 0.78 ? Or should I not ask!
It seems there are many things that are entity based that I would prefer to be global, or at least have the choice.
Regards

David

Offline

#9 2010-09-24 18:18:56

davidwhite
Member
Registered: 2010-08-31
Posts: 17

Re: Asset Templates and Child Entities

I've had to undo those changes. If you're in the root entity show all and you update an asset, it moves it to the root entity.
Unfortunately I can't trust the users to always be in the correct entity when they update something sad

Offline

Board footer

Powered by FluxBB