Add warning if we try to add a task on a draft project

This commit is contained in:
Laurent Destailleur 2020-10-12 12:53:57 +02:00
parent 1538823b4c
commit a514c20183
5 changed files with 24 additions and 6 deletions

View File

@ -269,6 +269,7 @@ WarningYourLoginWasModifiedPleaseLogin=Your login was modified. For security pur
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
WarningDateOfLineMustBeInExpenseReportRange=Warning, the date of line is not in the range of the expense report
WarningProjectDraft=Project is still in draft mode. Don't forget to validate it if you plan to use tasks.
WarningProjectClosed=Project is closed. You must re-open it first.
WarningSomeBankTransactionByChequeWereRemovedAfter=Some bank transaction were removed after that the receipt including them were generated. So nb of cheques and total of receipt may differ from number and total in list.
WarningFailedToAddFileIntoDatabaseIndex=Warning, failed to add file entry into ECM database index table

View File

@ -239,7 +239,7 @@ $linktotasks = dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-list-alt
$linktotasks .= dolGetButtonTitle($langs->trans('ViewGantt'), '', 'fa fa-stream paddingleft imgforviewmode', DOL_URL_ROOT.'/projet/ganttview.php?id='.$object->id.'&withproject=1', '', 1, array('morecss'=>'reposition marginleftonly btnTitleSelected'));
//print_barre_liste($title, 0, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, $linktotasks, $num, $totalnboflines, 'generic', 0, '', '', 0, 1);
print load_fiche_titre($title, $linktotasks.' &nbsp; '.$linktocreatetask, 'generic');
print load_fiche_titre($title, $linktotasks.' &nbsp; '.$linktocreatetask, 'projecttask');
// Get list of tasks in tasksarray and taskarrayfiltered

View File

@ -492,13 +492,20 @@ if ($action == 'create' && $user->rights->projet->creer && (empty($object->third
print load_fiche_titre($langs->trans("NewTask"), '', 'projecttask');
if ($object->statut == Project::STATUS_CLOSED)
{
if ($object->statut == Project::STATUS_CLOSED) {
print '<div class="warning">';
$langs->load("errors");
print $langs->trans("WarningProjectClosed");
print '</div>';
} else {
if ($object->statut == Project::STATUS_DRAFT)
{
print '<div class="warning">';
$langs->load("errors");
print $langs->trans("WarningProjectDraft");
print '</div>';
}
print '<form action="'.$_SERVER['PHP_SELF'].'" method="POST">';
print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="action" value="createtask">';
@ -636,7 +643,7 @@ if ($action == 'create' && $user->rights->projet->creer && (empty($object->third
$linktotasks .= dolGetButtonTitle($langs->trans('ViewGantt'), '', 'fa fa-stream paddingleft imgforviewmode', DOL_URL_ROOT.'/projet/ganttview.php?id='.$object->id.'&withproject=1', '', 1, array('morecss'=>'reposition marginleftonly'));
//print_barre_liste($title, 0, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, $linktotasks, $num, $totalnboflines, 'generic', 0, '', '', 0, 1);
print load_fiche_titre($title, $linktotasks.' &nbsp; '.$linktocreatetask, 'generic');
print load_fiche_titre($title, $linktotasks.' &nbsp; '.$linktocreatetask, 'projecttask');
// Get list of tasks in tasksarray and taskarrayfiltered
// We need all tasks (even not limited to a user because a task to user can have a parent that is not affected to him).

View File

@ -4987,9 +4987,14 @@ div.scroll2 {
width: <?php print isset($_SESSION['dol_screenwidth']) ?max($_SESSION['dol_screenwidth'] - 830, 450) : '450'; ?>px !important;
}
.gtaskname div, .gtaskname {
div#GanttChartDIVglisthead, div#GanttChartDIVgcharthead {
line-height: 2;
}
.gtaskname div, .gtaskname, .gstartdate div, .gstartdate, .genddate div, .genddate {
font-size: unset !important;
}
div.gantt, .gtaskheading, .gmajorheading, .gminorheading, .gminorheadingwkend {
font-size: unset !important;
font-weight: normal !important;

View File

@ -4885,9 +4885,14 @@ div.scroll2 {
width: <?php print isset($_SESSION['dol_screenwidth']) ?max($_SESSION['dol_screenwidth'] - 830, 450) : '450'; ?>px !important;
}
.gtaskname div, .gtaskname {
div#GanttChartDIVglisthead, div#GanttChartDIVgcharthead {
line-height: 2;
}
.gtaskname div, .gtaskname, .gstartdate div, .gstartdate, .genddate div, .genddate {
font-size: unset !important;
}
div.gantt, .gtaskheading, .gmajorheading, .gminorheading, .gminorheadingwkend {
font-size: unset !important;
font-weight: normal !important;