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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Software_Artifact_Infrastructure_Repository
dolibarr
Commits
cf13e466
Commit
cf13e466
authored
15 years ago
by
Regis Houssin
Browse files
Options
Downloads
Patches
Plain Diff
Works on enhancement of project tasks
parent
5c0d4b89
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
htdocs/projet/fiche.php
+2
-0
2 additions, 0 deletions
htdocs/projet/fiche.php
htdocs/projet/tasks/fiche.php
+8
-38
8 additions, 38 deletions
htdocs/projet/tasks/fiche.php
htdocs/projet/tasks/index.php
+1
-1
1 addition, 1 deletion
htdocs/projet/tasks/index.php
with
11 additions
and
39 deletions
htdocs/projet/fiche.php
+
2
−
0
View file @
cf13e466
...
@@ -86,6 +86,8 @@ if ($_POST["action"] == 'add' && $user->rights->projet->creer)
...
@@ -86,6 +86,8 @@ if ($_POST["action"] == 'add' && $user->rights->projet->creer)
$result
=
$project
->
create
(
$user
);
$result
=
$project
->
create
(
$user
);
if
(
$result
>
0
)
if
(
$result
>
0
)
{
{
$result
=
$project
->
add_contact
(
$_POST
[
"officer_project"
],
'PROJECTLEADER'
,
'internal'
);
Header
(
"Location:fiche.php?id="
.
$project
->
id
);
Header
(
"Location:fiche.php?id="
.
$project
->
id
);
exit
;
exit
;
}
}
...
...
This diff is collapsed.
Click to expand it.
htdocs/projet/tasks/fiche.php
+
8
−
38
View file @
cf13e466
...
@@ -48,9 +48,9 @@ if ($_POST["action"] == 'createtask' && $user->rights->projet->creer)
...
@@ -48,9 +48,9 @@ if ($_POST["action"] == 'createtask' && $user->rights->projet->creer)
if
(
empty
(
$_POST
[
"cancel"
]))
if
(
empty
(
$_POST
[
"cancel"
]))
{
{
if
(
empty
(
$_POST
[
'
task_parent
'
]))
if
(
empty
(
$_POST
[
'
label
'
]))
{
{
$mesg
=
$langs
->
trans
(
"ErrorFieldRequired"
,
$langs
->
transnoentities
(
"
ChildOfTask
"
));
$mesg
=
$langs
->
trans
(
"ErrorFieldRequired"
,
$langs
->
transnoentities
(
"
Label
"
));
$_GET
[
"action"
]
=
'create'
;
$_GET
[
"action"
]
=
'create'
;
$error
++
;
$error
++
;
}
}
...
@@ -59,6 +59,7 @@ if ($_POST["action"] == 'createtask' && $user->rights->projet->creer)
...
@@ -59,6 +59,7 @@ if ($_POST["action"] == 'createtask' && $user->rights->projet->creer)
{
{
$tmparray
=
explode
(
'_'
,
$_POST
[
'task_parent'
]);
$tmparray
=
explode
(
'_'
,
$_POST
[
'task_parent'
]);
$projectid
=
$tmparray
[
0
];
$projectid
=
$tmparray
[
0
];
if
(
empty
(
$projectid
))
$projectid
=
$_POST
[
"projectid"
];
// If projectid is ''
$task_parent
=
$tmparray
[
1
];
$task_parent
=
$tmparray
[
1
];
if
(
empty
(
$task_parent
))
$task_parent
=
0
;
// If task_parent is ''
if
(
empty
(
$task_parent
))
$task_parent
=
0
;
// If task_parent is ''
...
@@ -90,43 +91,12 @@ if ($_POST["action"] == 'createtask' && $user->rights->projet->creer)
...
@@ -90,43 +91,12 @@ if ($_POST["action"] == 'createtask' && $user->rights->projet->creer)
}
}
else
else
{
{
Header
(
"Location: "
.
DOL_URL_ROOT
.
'/projet/tasks/
fiche
.php?id='
.
$
project
id
);
Header
(
"Location: "
.
DOL_URL_ROOT
.
'/projet/tasks/
task
.php?id='
.
$
task
id
);
exit
;
exit
;
}
}
}
}
}
}
if
(
$_POST
[
"action"
]
==
'addtime'
&&
$user
->
rights
->
projet
->
creer
)
{
$task
=
new
Task
(
$db
);
$result
=
$task
->
fetch
(
$_GET
[
"id"
]);
if
(
$result
==
0
)
{
foreach
(
$_POST
as
$key
=>
$post
)
{
//$pro->CreateTask($user, $_POST["task_name"]);
if
(
substr
(
$key
,
0
,
4
)
==
'task'
)
{
if
(
$post
>
0
)
{
$post
=
intval
(
$post
)
+
((
$post
-
intval
(
$post
))
*
(
1
+
2
/
3
));
$post
=
price2num
(
$post
);
$id
=
str_replace
(
"task"
,
""
,
$key
);
$date
=
dol_mktime
(
12
,
0
,
0
,
$_POST
[
"
$id
"
.
"month"
],
$_POST
[
"
$id
"
.
"day"
],
$_POST
[
"
$id
"
.
"year"
]);
$task
->
addTimeSpent
(
$user
,
$post
,
$date
);
}
}
}
Header
(
"Location:fiche.php?id="
.
$task
->
id
);
exit
;
}
}
/*
/*
* View
* View
*/
*/
...
@@ -157,13 +127,13 @@ if ($_GET["action"] == 'create' && $user->rights->projet->creer)
...
@@ -157,13 +127,13 @@ if ($_GET["action"] == 'create' && $user->rights->projet->creer)
print
'<form action="'
.
$_SERVER
[
'PHP_SELF'
]
.
'" method="POST">'
;
print
'<form action="'
.
$_SERVER
[
'PHP_SELF'
]
.
'" method="POST">'
;
print
'<input type="hidden" name="token" value="'
.
$_SESSION
[
'newtoken'
]
.
'">'
;
print
'<input type="hidden" name="token" value="'
.
$_SESSION
[
'newtoken'
]
.
'">'
;
print
'<input type="hidden" name="action" value="createtask">'
;
print
'<input type="hidden" name="action" value="createtask">'
;
if
(
$_GET
[
'id'
])
print
'<input type="hidden" name="id" value="'
.
$_GET
[
'id'
]
.
'">'
;
if
(
$_GET
[
'id'
])
print
'<input type="hidden" name="
project
id" value="'
.
$_GET
[
'id'
]
.
'">'
;
if
(
$_GET
[
'mode'
])
print
'<input type="hidden" name="mode" value="'
.
$_GET
[
'mode'
]
.
'">'
;
if
(
$_GET
[
'mode'
])
print
'<input type="hidden" name="mode" value="'
.
$_GET
[
'mode'
]
.
'">'
;
print
'<table class="border" width="100%">'
;
print
'<table class="border" width="100%">'
;
print
'<tr><td>'
.
$langs
->
trans
(
"Label"
)
.
'</td><td>'
;
print
'<tr><td>'
.
$langs
->
trans
(
"Label"
)
.
'</td><td>'
;
print
'<input type="text" size="25" name="label" class="flat">'
;
print
'<input type="text" size="25" name="label" class="flat"
value="'
.
$_POST
[
"label"
]
.
'"
>'
;
print
'</td></tr>'
;
print
'</td></tr>'
;
print
'<tr><td>'
.
$langs
->
trans
(
"ChildOfTask"
)
.
'</td><td>'
;
print
'<tr><td>'
.
$langs
->
trans
(
"ChildOfTask"
)
.
'</td><td>'
;
...
...
This diff is collapsed.
Click to expand it.
htdocs/projet/tasks/index.php
+
1
−
1
View file @
cf13e466
...
@@ -67,7 +67,7 @@ $task = new Task($db);
...
@@ -67,7 +67,7 @@ $task = new Task($db);
// can have a parent that is not affected to him).
// can have a parent that is not affected to him).
$tasksarray
=
$task
->
getTasksArray
(
0
,
0
,
0
,
$socid
);
$tasksarray
=
$task
->
getTasksArray
(
0
,
0
,
0
,
$socid
);
// We load also tasks limited to a particular user
// We load also tasks limited to a particular user
$tasksrole
=
$task
->
getTasksRoleForUser
(
$user
);
var_dump
(
$tasksrole
);
$tasksrole
=
$task
->
getTasksRoleForUser
(
$user
);
$tasksrole
=
(
$_REQUEST
[
"mode"
]
==
'mine'
?
$task
->
getTasksRoleForUser
(
$user
)
:
''
);
$tasksrole
=
(
$_REQUEST
[
"mode"
]
==
'mine'
?
$task
->
getTasksRoleForUser
(
$user
)
:
''
);
print
'<table class="noborder" width="100%">'
;
print
'<table class="noborder" width="100%">'
;
...
...
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