FIX Show warning when trying to create task on closed project

This commit is contained in:
Laurent Destailleur 2018-12-10 15:06:54 +01:00
parent 853566cc28
commit f3a67d6c3f
2 changed files with 108 additions and 97 deletions

View File

@ -235,3 +235,4 @@ WarningYourLoginWasModifiedPleaseLogin=Your login was modified. For security pur
WarningAnEntryAlreadyExistForTransKey=An entry already exists for the translation key for this language WarningAnEntryAlreadyExistForTransKey=An entry already exists for the translation key for this language
WarningNumberOfRecipientIsRestrictedInMassAction=Warning, number of different recipient is limited to <b>%s</b> when using the mass actions on lists WarningNumberOfRecipientIsRestrictedInMassAction=Warning, number of different recipient is limited to <b>%s</b> when using the mass actions on lists
WarningDateOfLineMustBeInExpenseReportRange=Warning, the date of line is not in the range of the expense report WarningDateOfLineMustBeInExpenseReportRange=Warning, the date of line is not in the range of the expense report
WarningProjectClosed=Project is closed. You must re-open it before.

View File

@ -450,6 +450,15 @@ if ($action == 'create' && $user->rights->projet->creer && (empty($object->third
print load_fiche_titre($langs->trans("NewTask"), '', 'title_project'); print load_fiche_titre($langs->trans("NewTask"), '', 'title_project');
if ($object->statut == Project::STATUS_CLOSED)
{
print '<div class="warning">';
$langs->load("errors");
print $langs->trans("WarningProjectClosed");
print '</div>';
}
else
{
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">';
@ -553,6 +562,7 @@ if ($action == 'create' && $user->rights->projet->creer && (empty($object->third
print '</form>'; print '</form>';
} }
}
else if ($id > 0 || ! empty($ref)) else if ($id > 0 || ! empty($ref))
{ {
/* /*