| '.$langs->trans("Visibility").' | ';
@@ -233,7 +233,7 @@ if ($id > 0 || ! empty($ref))
print '';
print ' ';
- print ' ';
+ print '';
// Description
print '| '.$langs->trans("Description").' | ';
diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php
index dc737e8968c..62680a973bd 100644
--- a/htdocs/projet/element.php
+++ b/htdocs/projet/element.php
@@ -157,7 +157,7 @@ print '';
print ' ';
print ' ';
-print ' ';
+print '';
// Visibility
print '| '.$langs->trans("Visibility").' | ';
@@ -210,7 +210,7 @@ print '';
print ' ';
print ' ';
-print ' ';
+print '';
// Description
print '| '.$langs->trans("Description").' | ';
diff --git a/htdocs/projet/tasks.php b/htdocs/projet/tasks.php
index 068a26b5fe2..166d224d1be 100644
--- a/htdocs/projet/tasks.php
+++ b/htdocs/projet/tasks.php
@@ -356,7 +356,7 @@ if ($id > 0 || ! empty($ref))
print '';
print ' ';
- print ' ';
+ print '';
// Visibility
print '| '.$langs->trans("Visibility").' | ';
@@ -409,7 +409,7 @@ if ($id > 0 || ! empty($ref))
print '';
print ' ';
- print ' ';
+ print '';
// Description
print '| '.$langs->trans("Description").' | ';
diff --git a/htdocs/projet/tasks/contact.php b/htdocs/projet/tasks/contact.php
index af8dc9d39cf..3fe8abfa73b 100644
--- a/htdocs/projet/tasks/contact.php
+++ b/htdocs/projet/tasks/contact.php
@@ -220,7 +220,7 @@ if ($id > 0 || ! empty($ref))
print '';
print ' ';
- print ' ';
+ print '';
// Visibility
print '| '.$langs->trans("Visibility").' | ';
@@ -254,7 +254,7 @@ if ($id > 0 || ! empty($ref))
print '';
print ' ';
- print ' ';
+ print '';
// Description
print '| '.$langs->trans("Description").' | ';
diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php
index 37934aa0957..639960b172d 100644
--- a/htdocs/projet/tasks/time.php
+++ b/htdocs/projet/tasks/time.php
@@ -149,47 +149,61 @@ if ($action == 'addtimespent' && $user->rights->projet->lire)
if (! $error)
{
- if ($id || $ref)
+ if ($id || $ref)
{
$object->fetch($id, $ref);
}
else
{
- $object->fetch(GETPOST('taskid', 'int'));
+ if (! GETPOST('taskid', 'int') || GETPOST('taskid', 'int') < 0)
+ {
+ setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Task")), null, 'errors');
+ $action='createtime';
+ $error++;
+ }
+ else
+ {
+ $object->fetch(GETPOST('taskid', 'int'));
+ }
}
- $object->fetch_projet();
- if (empty($object->project->statut))
+ if (! $error)
{
- setEventMessages($langs->trans("ProjectMustBeValidatedFirst"), null, 'errors');
- $error++;
- }
- else
- {
- $object->timespent_note = $_POST["timespent_note"];
- if (GETPOST('progress', 'int') > 0) $object->progress = GETPOST('progress', 'int'); // If progress is -1 (not defined), we do not change value
- $object->timespent_duration = $_POST["timespent_durationhour"]*60*60; // We store duration in seconds
- $object->timespent_duration+= ($_POST["timespent_durationmin"]?$_POST["timespent_durationmin"]:0)*60; // We store duration in seconds
- if (GETPOST("timehour") != '' && GETPOST("timehour") >= 0) // If hour was entered
- {
- $object->timespent_date = dol_mktime(GETPOST("timehour"), GETPOST("timemin"), 0, GETPOST("timemonth"), GETPOST("timeday"), GETPOST("timeyear"));
- $object->timespent_withhour = 1;
- }
- else
- {
- $object->timespent_date = dol_mktime(12, 0, 0, GETPOST("timemonth"), GETPOST("timeday"), GETPOST("timeyear"));
- }
- $object->timespent_fk_user = $_POST["userid"];
- $result=$object->addTimeSpent($user);
- if ($result >= 0)
- {
- setEventMessages($langs->trans("RecordSaved"), null, 'mesgs');
- }
- else
- {
- setEventMessages($langs->trans($object->error), null, 'errors');
- $error++;
- }
+ $object->fetch_projet();
+
+ if (empty($object->project->statut))
+ {
+ setEventMessages($langs->trans("ProjectMustBeValidatedFirst"), null, 'errors');
+ $action='createtime';
+ $error++;
+ }
+ else
+ {
+ $object->timespent_note = $_POST["timespent_note"];
+ if (GETPOST('progress', 'int') > 0) $object->progress = GETPOST('progress', 'int'); // If progress is -1 (not defined), we do not change value
+ $object->timespent_duration = $_POST["timespent_durationhour"]*60*60; // We store duration in seconds
+ $object->timespent_duration+= ($_POST["timespent_durationmin"]?$_POST["timespent_durationmin"]:0)*60; // We store duration in seconds
+ if (GETPOST("timehour") != '' && GETPOST("timehour") >= 0) // If hour was entered
+ {
+ $object->timespent_date = dol_mktime(GETPOST("timehour"), GETPOST("timemin"), 0, GETPOST("timemonth"), GETPOST("timeday"), GETPOST("timeyear"));
+ $object->timespent_withhour = 1;
+ }
+ else
+ {
+ $object->timespent_date = dol_mktime(12, 0, 0, GETPOST("timemonth"), GETPOST("timeday"), GETPOST("timeyear"));
+ }
+ $object->timespent_fk_user = $_POST["userid"];
+ $result=$object->addTimeSpent($user);
+ if ($result >= 0)
+ {
+ setEventMessages($langs->trans("RecordSaved"), null, 'mesgs');
+ }
+ else
+ {
+ setEventMessages($langs->trans($object->error), null, 'errors');
+ $error++;
+ }
+ }
}
}
else
@@ -488,7 +502,7 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0)
print '';
print ' ';
- print ' ';
+ print '';
// Visibility
print '| '.$langs->trans("Visibility").' | ';
@@ -522,7 +536,7 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0)
print '';
print ' ';
- print ' ';
+ print '';
// Description
print '| '.$langs->trans("Description").' | ';
@@ -1109,7 +1123,7 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0)
$selectedfields.=(count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : '');
print '';
- print ' '."\n";
+ print ''."\n";
// Fields title search
print '';
diff --git a/htdocs/ticket/list.php b/htdocs/ticket/list.php
index 02e441adba0..e13f29b4b05 100644
--- a/htdocs/ticket/list.php
+++ b/htdocs/ticket/list.php
@@ -399,7 +399,7 @@ if ($projectid > 0) {
print '';
print ' ';
- print ' ';
+ print '';
// Visibility
print '| ' . $langs->trans("Visibility") . ' | ';
| | | | | | | | | | |