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
d2dbbca9
Commit
d2dbbca9
authored
15 years ago
by
Regis Houssin
Browse files
Options
Downloads
Patches
Plain Diff
Fix: management of time spent in task card
parent
21c5d870
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
htdocs/projet/tasks/time.php
+50
-34
50 additions, 34 deletions
htdocs/projet/tasks/time.php
with
50 additions
and
34 deletions
htdocs/projet/tasks/time.php
+
50
−
34
View file @
d2dbbca9
...
...
@@ -60,6 +60,9 @@ if ($_GET["id"] > 0)
{
$result
=
$projectstatic
->
fetch
(
$task
->
fk_project
);
if
(
!
empty
(
$projectstatic
->
socid
))
$projectstatic
->
societe
->
fetch
(
$projectstatic
->
socid
);
// To verify role of users
$userAccess
=
$projectstatic
->
restrictedProjectArea
(
$user
);
$head
=
task_prepare_head
(
$task
);
...
...
@@ -67,9 +70,6 @@ if ($_GET["id"] > 0)
if
(
$mesg
)
print
$mesg
.
'<br>'
;
print
'<form method="POST" action="'
.
$_SERVER
[
"PHP_SELF"
]
.
'?id='
.
$task
->
id
.
'">'
;
print
'<input type="hidden" name="token" value="'
.
$_SESSION
[
'newtoken'
]
.
'">'
;
print
'<input type="hidden" name="action" value="createtask">'
;
print
'<table class="border" width="100%">'
;
// Ref
...
...
@@ -93,11 +93,34 @@ if ($_GET["id"] > 0)
else
print
' '
;
print
'</td></tr>'
;
print
'</table>'
;
print
'</div>'
;
/*
* Actions
*/
print
'<div class="tabsAction">'
;
// Add time spent
if
(
$user
->
rights
->
projet
->
creer
&&
$userAccess
)
{
print
'<a class="butAction" href="'
.
$_SERVER
[
'PHP_SELF'
]
.
'?id='
.
$task
->
id
.
'&action=addtime">'
.
$langs
->
trans
(
'NewTimeSpent'
)
.
'</a>'
;
}
else
{
print
'<a class="butActionRefused" href="#" title="'
.
$langs
->
trans
(
"NotAllowed"
)
.
'">'
.
$langs
->
trans
(
'Modify'
)
.
'</a>'
;
}
print
'</div>'
;
print
'<br>'
;
/*
* List of time spent
*/
$sql
=
"SELECT t.task_date, t.task_duration, t.fk_user"
;
$sql
.
=
", u.rowid, u.name, u.firstname"
;
$sql
=
"SELECT
t.rowid,
t.task_date, t.task_duration, t.fk_user"
;
$sql
.
=
", u.rowid
as userid
, u.name, u.firstname"
;
$sql
.
=
" FROM "
.
MAIN_DB_PREFIX
.
"projet_task_time as t"
;
$sql
.
=
" , "
.
MAIN_DB_PREFIX
.
"user as u"
;
$sql
.
=
" WHERE t.fk_task ="
.
$task
->
id
;
...
...
@@ -123,38 +146,25 @@ if ($_GET["id"] > 0)
{
dol_print_error
(
$db
);
}
print
'</table></form>'
;
print
'</div>'
;
/*
* Actions
*/
print
'<div class="tabsAction">'
;
/*
if ($user->rights->projet->creer)
{
print '<a class="butActionDelete" href="'.$_SERVER['PHP_SELF'].'?id='.$task->id.'&action=delete">'.$langs->trans('Delete').'</a>';
}
*/
print
'</div>'
;
print
'<br>'
;
print
'<input type="hidden" name="action" value="addtime">'
;
print
'<table class="noborder" width="100%">'
;
print
'<tr class="liste_titre">'
;
print
'<td>'
.
$langs
->
trans
(
"By"
)
.
'</td>'
;
print
'<td>'
.
$langs
->
trans
(
"Date"
)
.
'</td>'
;
print
'<td align="right">'
.
$langs
->
trans
(
"TimeSpent"
)
.
'</td>'
;
print
'<td
align="right">'
.
$langs
->
trans
(
"By"
)
.
'
</td>'
;
print
'<td
colspan="2">
</td>'
;
print
"</tr>
\n
"
;
foreach
(
$tasks
as
$task_time
)
{
$var
=!
$var
;
print
"<tr "
.
$bc
[
$var
]
.
">"
;
// User
$user
->
id
=
$task_time
->
userid
;
$user
->
nom
=
$task_time
->
name
;
$user
->
prenom
=
$task_time
->
firstname
;
print
'<td>'
.
$user
->
getNomUrl
(
1
)
.
'</td>'
;
// Date
print
'<td>'
.
dol_print_date
(
$db
->
jdate
(
$task_time
->
task_date
),
'%A'
)
.
' '
.
dol_print_date
(
$db
->
jdate
(
$task_time
->
task_date
),
'daytext'
)
.
'</td>'
;
...
...
@@ -164,13 +174,19 @@ if ($_GET["id"] > 0)
$minutes
=
round
(((
$task_time
->
task_duration
-
$heure
)
*
60
),
0
);
$minutes
=
substr
(
"00"
.
"
$minutes
"
,
-
2
);
print
'<td align="right">'
.
$heure
.
" h "
.
$minutes
.
"</td>
\n
"
;
// User
$user
->
id
=
$task_time
->
rowid
;
$user
->
nom
=
$task_time
->
name
;
$user
->
prenom
=
$task_time
->
firstname
;
print
'<td align="right">'
.
$user
->
getNomUrl
(
1
)
.
'</td>'
;
print
"</tr>
\n
"
;
// Icon update et delete
print
'<td align="center" nowrap>'
;
if
(
$user
->
rights
->
projet
->
creer
&&
$userAccess
)
{
print
' '
;
print
'<a href="'
.
$_SERVER
[
"PHP_SELF"
]
.
'?id='
.
$task
->
id
.
'&action=deleteline&lineid='
.
$task_time
->
rowid
.
'">'
;
print
img_delete
();
print
'</a>'
;
}
print
'</td>'
;
print
"</tr>
\n
"
;
}
print
"</table>"
;
...
...
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