View ProjeQtOr On SourceForge.net
ProjeQtOr - Project Management Tool
Support us on Capterra
OIN - Open Invention Network
ProjeQtOr free project management software - [SOLVED] Find from API the working days for a given resource in a week - Page 3 - ProjeQtOr
 
 

[SOLVED] Find from API the working days for a given resource in a week

More
22 Sep 2022 10:46 #13 by babynus
For CalendarDefinition, you should have dayOfWeek0 to dayOfWeek6 fields.
It seems API does not retreive them.
We'll have a look.

Babynus
Administrator of ProjeQtOr web site

Please Log in or Create an account to join the conversation.

More
19 Dec 2022 13:13 #14 by cmarti
Hello Babynus,

I haven't look at this item for a long time, but tried again today.
It seems that the latest version still have the same issue of not having the "dayOfWeek<x>" information available through the API.

I looked a bit on the code and found that those fields have an "hidden" attribute, that seems to be filtered out by the API interface.
Obviously I'm not sure of the root reason, but by removing, on a test database, this attribute I have indeed the visibility of those field.
I do not know the drawback of removing those attribute.

Could you please check that this is fully resolving the item without drawbacks?

Thank you

Please Log in or Create an account to join the conversation.

More
20 Dec 2022 08:47 #15 by babynus
Jyst try and change (for each X not only for 0)
self::$_fieldsAttributes["dayOfWeek0"] = "readonly,hidden";
with
self::$_fieldsAttributes["dayOfWeek0"] = "readonly,hidden,forceExport";

Possibly it will fix the issue

Babynus
Administrator of ProjeQtOr web site

Please Log in or Create an account to join the conversation.

More
20 Dec 2022 09:49 #16 by cmarti
I've just did the change on model/CalendarDefinition.php (Construct function), but it didn't change the final result.

It seems to me that the point is on the "jsonDumpObj" function (tool/jsonFunctions.php) where the filter is done on the hidden attribute
if (is_object($val)) {
  if ($res!="") {
    $res.=", ";
  }
  $res.=jsonDumpObj($val, true);
} else if (pq_substr($fld, 0, 1)=='_' or $obj->isAttributeSetToField($fld, 'hidden') or $obj->isAttributeSetToField($fld, 'noExport') or $fld=='apiKey' or $fld=='password' or $included and ($fld=='id' or $fld=='refType' or $fld=='refId' or $fld=='refName' or $fld=='handled' or $fld=='done' or $fld=='idle' or $fld=='cancelled')) {
  // Nothing
} else {

I can't see the influence of the forceExport so I doubt that it is really change the behavior

But by filtering the hidden by the forceExport I can see all the dayOfWeek<X> items

    } else if (pq_substr($fld, 0, 1)=='_' or ($obj->isAttributeSetToField($fld, 'forceExport')== false and $obj->isAttributeSetToField($fld, 'hidden')) or $obj->isAttributeSetToField($fld, 'noExport') or $fld=='apiKey' or $fld=='password' or $included and ($fld=='id' or $fld=='refType' or $fld=='refId' or $fld=='refName' or $fld=='handled' or $fld=='done' or $fld=='idle' or $fld=='cancelled')) {


But obviously I do not know the full effect of such change on the whole software.

Hope this help

Please Log in or Create an account to join the conversation.

More
20 Dec 2022 11:37 #17 by babynus
Yes, this is the good way to fix this

Babynus
Administrator of ProjeQtOr web site

Please Log in or Create an account to join the conversation.

More
20 Dec 2022 13:34 #18 by cmarti
Thank you for your feed-back.

When do you think it will be integrated on the main source?
I've tried on a test database, but do not want to mess-up on the main one.

 

Please Log in or Create an account to join the conversation.

Moderators: babynusprotion
Time to create page: 0.033 seconds

Cookies settings

×

Functional Cookies

Ce site utilise des cookies pour assurer son bon fonctionnement et ne peuvent pas être désactivés de nos systèmes. Nous ne les utilisons pas à des fins publicitaires. Si ces cookies sont bloqués, certaines parties du site ne pourront pas fonctionner.

Session

Please login to see yours activities!

Other cookies

Ce site web utilise un certain nombre de cookies pour gérer, par exemple, les sessions utilisateurs.