Forum

Welcome to ProjeQtOr new Forum. We migrated old forum to the new website.
You will find all your posts here, with your usual account.
Just one point : you’ll have to reinitialize your password. Use “Lost password” feature.

Resouce Affectation
 
Notifications
Clear all

Resouce Affectation

4 Posts
2 Users
0 Reactions
2,371 Views
(@antonio-grr)
Posts: 84
Active Member
Topic starter
 
[#4109]

Could you please explain me the exact meaning ad usage of fields
idResourceSelect
idResource
idContact
idUser

Obviously idContact is used when a contact is affected, but I'm not able to understand usage and meaning of other fields.
And what about code

if (SqlList::getNameFromId('Resource', $this->idResource) == $this->idResource) {
$this->idResource = null;
}
in Affectation construct method ?

Thank you for your attention


 
Posted : 16 Feb 2017 11H01
(@babynus)
Posts: 14952
Member Admin
 

idResource is always set.
It is the id in the table resource, whatever the personn is a resource, a user or a constact.
If personn allocated is a contact, idContact is set.
If personn allocated is a user, idUser is set.
If personn allocated is a resource, idResourceSelect is set.
(it is historical that idResource is the always set field, so we had to rename idResourceSelect for selected resource)

if (SqlList::getNameFromId('Resource', $this->idResource) == $this->idResource) {
$this->idResource = null;
}

This wa shistorically used to reset idResource if it's not a resource. It will be re-calculated on control() function.


 
Posted : 16 Feb 2017 21H19
(@antonio-grr)
Posts: 84
Active Member
Topic starter
 

But the method SqlList::getNameFromId returns the name of the resource, that cannot be compared with the id .


 
Posted : 17 Feb 2017 9H53
(@babynus)
Posts: 14952
Member Admin
 

If id is returned , it means name has not been found 😉


 
Posted : 17 Feb 2017 10H20
Share:

Scroll to Top