Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dolibarr
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Software_Artifact_Infrastructure_Repository
dolibarr
Commits
aafc56e7
Commit
aafc56e7
authored
13 years ago
by
Juanjo Menent
Browse files
Options
Downloads
Patches
Plain Diff
Proyects: Add Total time to tasks tables
parent
75db959b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
htdocs/lib/project.lib.php
+15
-2
15 additions, 2 deletions
htdocs/lib/project.lib.php
htdocs/projet/tasks/time.php
+10
-4
10 additions, 4 deletions
htdocs/projet/tasks/time.php
with
25 additions
and
6 deletions
htdocs/lib/project.lib.php
+
15
−
2
View file @
aafc56e7
<?php
/* Copyright (C) 2006-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2010 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
...
...
@@ -22,7 +23,7 @@
* \file htdocs/lib/project.lib.php
* \brief Functions used by project module
* \ingroup project
* \version $Id: project.lib.php,v 1.6
8
2011/07/
0
4
09:01:38 eldy
Exp $
* \version $Id: project.lib.php,v 1.6
9
2011/07/
1
4
15:37:37 simnandez
Exp $
*/
require_once
(
DOL_DOCUMENT_ROOT
.
"/projet/class/project.class.php"
);
...
...
@@ -98,7 +99,7 @@ function project_prepare_head($object)
* \file htdocs/lib/project.lib.php
* \brief Ensemble de fonctions de base pour le module projet
* \ingroup societe
* \version $Id: project.lib.php,v 1.6
8
2011/07/
0
4
09:01:38 eldy
Exp $
* \version $Id: project.lib.php,v 1.6
9
2011/07/
1
4
15:37:37 simnandez
Exp $
*/
function
task_prepare_head
(
$object
)
{
...
...
@@ -375,6 +376,9 @@ function PLines(&$inc, $parent, &$lines, &$level, $var, $showproject, &$taskrole
$projectsArrayId
=
explode
(
','
,
$projectsListId
);
$numlines
=
sizeof
(
$lines
);
$total
=
0
;
for
(
$i
=
0
;
$i
<
$numlines
;
$i
++
)
{
if
(
$parent
==
0
)
$level
=
0
;
...
...
@@ -485,6 +489,7 @@ function PLines(&$inc, $parent, &$lines, &$level, $var, $showproject, &$taskrole
$level
++
;
if
(
$lines
[
$i
]
->
id
)
PLines
(
$inc
,
$lines
[
$i
]
->
id
,
$lines
,
$level
,
$var
,
$showproject
,
$taskrole
,
$projectsListId
);
$level
--
;
$total
+=
$lines
[
$i
]
->
duration
;
}
}
else
...
...
@@ -493,6 +498,14 @@ function PLines(&$inc, $parent, &$lines, &$level, $var, $showproject, &$taskrole
}
}
if
(
$total
>
0
)
{
print
'<tr class="liste_total"><td class="liste_total">'
.
$langs
->
trans
(
"Total"
)
.
'</td>'
;
print
'<td></td>'
;
print
'<td></td>'
;
print
'<td align="right" nowrap="nowrap" class="liste_total">'
.
ConvertSecondToTime
(
$total
)
.
'</td></tr>'
;
}
return
$inc
;
}
...
...
This diff is collapsed.
Click to expand it.
htdocs/projet/tasks/time.php
+
10
−
4
View file @
aafc56e7
...
...
@@ -2,6 +2,7 @@
/* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2006-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2010 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
...
...
@@ -22,7 +23,7 @@
* \file htdocs/projet/tasks/time.php
* \ingroup projet
* \brief Page to add new time spent on a task
* \version $Id$
* \version $Id
: time.php,v 1.32 2011/07/14 15:37:37 simnandez Exp
$
*/
require
(
"../../main.inc.php"
);
...
...
@@ -307,7 +308,8 @@ if ($_GET["id"] > 0)
print
'<td align="right">'
.
$langs
->
trans
(
"Duration"
)
.
'</td>'
;
print
'<td> </td>'
;
print
"</tr>
\n
"
;
$total
=
0
;
foreach
(
$tasks
as
$task_time
)
{
$var
=!
$var
;
...
...
@@ -389,8 +391,12 @@ if ($_GET["id"] > 0)
print
'</td>'
;
print
"</tr>
\n
"
;
$total
+=
$task_time
->
task_duration
;
}
print
'<tr class="liste_total"><td colspan="3" class="liste_total">'
.
$langs
->
trans
(
"Total"
)
.
'</td>'
;
print
'<td align="right" nowrap="nowrap" class="liste_total">'
.
ConvertSecondToTime
(
$total
)
.
'</td><td> </td>'
;
print
'</tr>'
;
print
"</table>"
;
print
"</form>"
;
}
...
...
@@ -398,5 +404,5 @@ if ($_GET["id"] > 0)
$db
->
close
();
llxFooter
(
'$Date$ - $Revision$'
);
llxFooter
(
'$Date
: 2011/07/14 15:37:37
$ - $Revision
: 1.32
$'
);
?>
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment