Verified Commit bfd56aea authored by David Beniamine's avatar David Beniamine
Browse files

Add parameter to set day duration for gitlab timetracking

FIX #7
parent 3f4637e8
......@@ -57,6 +57,7 @@ $arrayofparameters=array(
'GITLABWORKFLOW_GITLAB_INSTANCE_URL'=>array('css'=>'minwidth200','enabled'=>1, 'type'=>'text'),
'GITLABWORKFLOW_GITLAB_API_TOKEN'=>array('css'=>'minwidth200','enabled'=>1, 'type'=>'text'),
'GITLABWORKFLOW_GITLAB_ISSUES_ALL_CONFIDENTIAL'=>array('css'=>'minwidth200','enabled'=>1, 'type'=>'checkbox', 'value'=>'bike'),
'GITLABWORKFLOW_GITLAB_HOURS_PER_DAY'=>array('css'=>'minwidth200','enabled'=>1, 'type'=>'integer' ),
);
......
......@@ -190,6 +190,7 @@ class Gitlab extends CommonObject
*/
function createIssue($title, $text, $projectid, $assigneeid, $due,
$confidential, $duration, $milestone=-1){
global $conf;
dol_syslog("gitlabwf :: createIssue ".$title);
// Transform list into checkable list
// newline or start then list marker *,+ - or 1., 2. etc.
......@@ -208,8 +209,9 @@ class Gitlab extends CommonObject
'confidential' => $confidential?$confidential:0,
);
$answer=$this->post($url, $params);
$dayduratation = empty($conf->global->GITLABWORKFLOW_GITLAB_HOURS_PER_DAY) ? 7 :$conf->global->GITLABWORKFLOW_GITLAB_HOURS_PER_DAY;
$params=array(
'duration' => $duration.'d',
'duration' => $duration*$dayduratation.'h',
);
$output = $this->post($url.'/'.$answer->iid.'/time_estimate', $params);
dol_syslog("gitlabwf :: seting estimate time, answer ".json_encode($output));
......
......@@ -51,6 +51,10 @@ GITLABWORKFLOW_GITLAB_INSTANCE_URLTooltip=Ex : https://gitlab.com
GITLABWORKFLOW_GITLAB_ISSUES_ALL_CONFIDENTIAL=Make all issues confidential
GITLABWORKFLOW_GITLAB_ISSUES_ALL_CONFIDENTIALTooltip=If not checked, issue can be set to confidential at milestone level
GITLABWORKFLOW_GITLAB_HOURS_PER_DAY=Hours per day
GITLABWORKFLOW_GITLAB_HOURS_PER_DAYTooltip=Number of hours per day for gitlab timetracking
globalAssignee=Default Assignee
globalProject=Default project
......
......@@ -55,6 +55,8 @@ GITLABWORKFLOW_GITLAB_INSTANCE_URLTooltip=Ex : https://gitlab.com
GITLABWORKFLOW_GITLAB_ISSUES_ALL_CONFIDENTIAL=Forcer la confidentialité des issues
GITLABWORKFLOW_GITLAB_ISSUES_ALL_CONFIDENTIALTooltip=Si non coché, pourra être fixé pour chaque jalon
GITLABWORKFLOW_GITLAB_HOURS_PER_DAY=Nombre d'heures par jours
GITLABWORKFLOW_GITLAB_HOURS_PER_DAYTooltip=Nombre d'heures par jours le suivi de temps Gitlab
globalAssignee=Responsable par défaut
globalProject=Projet par défaut
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment