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 2 - ProjeQtOr
 
 

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

More
15 Sep 2022 09:46 - 15 Sep 2022 09:56 #7 by cmarti
I didn't know that, I thought it was only on the object listed on the "importable" table.

Could you please give me an example of POST transaction for grabbing the CalendarDefinition information?

[EDIT] I think I was too fast here - I've tried from php instead of python and it works well as for any other element - I need to check my python code

Thank you for the help
Last edit: 15 Sep 2022 09:56 by cmarti. Reason: Found a solution

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

More
15 Sep 2022 10:51 #8 by cmarti
I've almost solved my point, but notice that in case of a partial time - when a fix day (like Wednesday) is a non working day, I can't find the information on the "CalendarDefinition" object, whereas it is clearly present on the SQL database.

Did I miss a point here or isn't it present on the API?

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

More
15 Sep 2022 17:24 #9 by babynus
It is defined on Calendar object.

Babynus
Administrator of ProjeQtOr web site

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

More
19 Sep 2022 08:57 #10 by cmarti
Hello Babynus,

I probably did not explain my point well - also because it was probably not so clear for me.

To finalize the number of working days, I can find the day off (like Christmas, Easter, and so on).
What is now missing is on the calendar of people that are not 100%.

I've created a calendar for people working 80% - Wednesday being a kind of "day-off".
I can find the information on the calendar definition ("Week days off") - but can't find it through the API.
If I use the "Mark every" "Wednesday" as "off days" - they are all present on the Calendar object list, but I do not understand why the "Week days off" part which is working well on the tool itself is not reachable (or I can't reach it) through the API?

Thank you
 

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

More
20 Sep 2022 09:34 #11 by babynus
First Request on object CalendarDefinition.
You'll get information on "global off days" for this calendar.
Then you can request on Calendar to get all specific off days.

Babynus
Administrator of ProjeQtOr web site

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

More
22 Sep 2022 09:47 #12 by cmarti
Hello Babynus,

I probably missed a point on the way I'm using the API or the tool itself, but I'm still not able to have the off-days of a 80% work week.
So I will try to show what are the steps I've used
First I'm taking the "CalendarDefinition" as below:
$fullUrl="https://url/api/CalendarDefinition/all";
$curl = curl_init($fullUrl);
curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
curl_setopt($curl, CURLOPT_USERPWD, $user);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
$curl_response = curl_exec($curl);
echo $curl_response;
curl_close($curl);

With the following result:

{"identifier":"id", "items":[{"id":"1", "name":"default", "idle":"0"},
{"id":"2", "name":"CH - Part-time 80% - No Wednesday", "idle":"0"},
{"id":"3", "name":"CH", "idle":"0"},
{"id":"4", "name":"Belgique", "idle":"0"},
{"id":"5", "name":"Italy", "idle":"0"}] }

After that I'm taking the data from the calendar 2 - the one that has a 80% week working time.
So on the code above I'm using the following url
$fullUrl="https://url/api/Calendar/search/idCalendarDefinition=2/calendarDate>='2022-01-01'";

And the result is :

{"identifier":"id", "items":[{"id":"386", "name":"Jour de l'an", "idCalendarDefinition":"2", "nameCalendarDefinition":"Bern - Part-time 80% - No Wednesday", "calendarDate":"2022-01-01", "isOffDay":"1"},
{"id":"387", "name":"Christmas", "idCalendarDefinition":"2", "nameCalendarDefinition":"Bern - Part-time 80% - No Wednesday", "calendarDate":"2022-12-25", "isOffDay":"1"},
{"id":"388", "name":"Saint Berchtold", "idCalendarDefinition":"2", "nameCalendarDefinition":"Bern - Part-time 80% - No Wednesday", "calendarDate":"2022-01-02", "isOffDay":"1"},
{"id":"389", "name":"Easter", "idCalendarDefinition":"2", "nameCalendarDefinition":"Bern - Part-time 80% - No Wednesday", "calendarDate":"2022-04-18", "isOffDay":"1"},
{"id":"390", "name":"Ascension", "idCalendarDefinition":"2", "nameCalendarDefinition":"Bern - Part-time 80% - No Wednesday", "calendarDate":"2022-05-26", "isOffDay":"1"},
{"id":"391", "name":"Pentecost", "idCalendarDefinition":"2", "nameCalendarDefinition":"Bern - Part-time 80% - No Wednesday", "calendarDate":"2022-06-06", "isOffDay":"1"},
{"id":"392", "name":"Swiss Federal", "idCalendarDefinition":"2", "nameCalendarDefinition":"Bern - Part-time 80% - No Wednesday", "calendarDate":"2022-08-01", "isOffDay":"1"},
{"id":"393", "name":"Saint Etienne", "idCalendarDefinition":"2", "nameCalendarDefinition":"Bern - Part-time 80% - No Wednesday", "calendarDate":"2022-12-26", "isOffDay":"1"},
{"id":"394", "name":"Holy Friday", "idCalendarDefinition":"2", "nameCalendarDefinition":"Bern - Part-time 80% - No Wednesday", "calendarDate":"2022-04-02", "isOffDay":"1"}] }


This corresponds to the same dates as the calendar 3, so no Wednesday are present on the list.

On the tool - calendar definition part - the Wednesday is indicated as day-off (see picture)
 

Could you please let me know what is the code needed or what I should do on the tool for having the Wednesday off days indicated through the API?

Thank you,

 
Attachments:

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

Moderators: babynusprotion
Time to create page: 0.060 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.