View ProjeQtOr On SourceForge.net
ProjeQtOr - Project Management Tool
Supportez nous sur Capterra
OIN - Open Invention Network
ProjeQtOr free project management software - Imputation Line - getLines - ProjeQtOr

Prochaines sessions de formation

Les prochaines formations et démonstrations sont ouvertes, inscrivez-vous rapidement !

 

Démonstration de ProjeQtOr

(gratuit, sur inscription)

Mardi 23 avril (10h30-12h)

Jeudi 16 mai (16h-17h30)

Jeudi 13 juin (10h30-12h)

 
 

Planifiez avec ProjeQtOr

3 et 4 avril (9h - 12h30)

 
 

Administrez avec ProjeQtOr

10 et 11 avril (9h - 12h30)

 

 

 
 

Imputation Line - getLines

More
31 Jan 2017 12:27 - 31 Jan 2017 12:28 #1 by antonio.grr
Hi.
I hope you can help me to understand the following fragment of code from method getLines in Imputation line.

// fetch all work stored in database for this assignment
foreach ( $workList as $work ) {
if (($work->idAssignment and $work->idAssignment == $elt->idAssignment and !$work->idWorkElement and !isset($elt->_idWorkElement)) or
(!$work->idAssignment and $work->refType == $elt->refType and $work->refId == $elt->refId) or
($work->idAssignment and $work->idAssignment == $elt->idAssignment and $work->idWorkElement and isset($elt->_idWorkElement) and $elt->_idWorkElement == $work->idWorkElement)) {
$workDate=$work->workDate;
$offset=dayDiffDates($startDate, $workDate) + 1;
if (isset($elt->arrayWork [$offset])) {
$elt->arrayWork [$offset]->work+=$work->work;
} else {
$elt->arrayWork [$offset]=$work;
}
}
}


It seems that you collect in the same work object the amount of work from work table having
a) a given assignment and no _idWorkElement
b) no assignment , a given reference
c) a given assignment and a given idWorkElement

Now, I'm to create a) just as a real work referred to an activity, b) as the real work for a ticket, but I'm not able to create c) .
How can I ?
Furthermore, how can I create two or more lines in work table that will be added in the same imputation line ( as in the previous fragment of code ) ?
Conditions appear incompatible, but if not, what will happen at save ?
Thank you for your help
Last edit: 31 Jan 2017 12:28 by antonio.grr.

Please Connexion or Create an account to join the conversation.

More
31 Jan 2017 14:51 #2 by babynus
Replied by babynus on topic Imputation Line - getLines
Real work in never linekd directly to the activity but to the assignment.
For Tickets, :link is through WorkElement, that may be linked to Activity if PlanningActivity is set on Ticket.

Each line in Real Work allocation is dedicated to corresponding Assignment or WorkElement (in this last case it is read only)

Babynus
Administrator of ProjeQtOr web site

Please Connexion or Create an account to join the conversation.

More
31 Jan 2017 15:57 #3 by antonio.grr
Thank you for your explanation.
Now I'm able to create a work line with assignment and idWorkElement.
But at the moment I could believe that the condition to add to different amount of work as in the code line
$elt->arrayWork [$offset]->work+=$work->work;
will never happen.
It's true ?

Please Connexion or Create an account to join the conversation.

More
31 Jan 2017 23:38 #4 by babynus
Replied by babynus on topic Imputation Line - getLines

But at the moment I could believe that the condition to add to different amount of work as in the code line
$elt->arrayWork [$offset]->work+=$work->work;
will never happen.
It's true ?

I don't understand the question.

Could you explain ?

Babynus
Administrator of ProjeQtOr web site

Please Connexion or Create an account to join the conversation.

More
01 Fév 2017 09:20 #5 by antonio.grr
Ok, I try to explain.
In the code you test isset($elt->arrayWork [$offset])
If true you add the new work amount to the previously stored.
I cannot understand how this condition can happen : you should find two lines in db having the same date and matching one of the three conditions above.
Is this possible ?

Please Connexion or Create an account to join the conversation.

More
01 Fév 2017 10:20 #6 by babynus
Replied by babynus on topic Imputation Line - getLines
It is a security trick to be sure to display all data.
But you're right it should not happen.

Babynus
Administrator of ProjeQtOr web site

Please Connexion or Create an account to join the conversation.

Moderators: babynusprotion
Time to create page: 0.041 seconds

Paramétrages de cookies

×

Cookies fonctionnels

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

Veuillez vous connecter pour voir vos activités!

Autres cookies

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