Skip to content
Snippets Groups Projects
Commit ea26c7a4 authored by Laurent Destailleur's avatar Laurent Destailleur
Browse files

Can remove a project if project has task.

parent af0a8fcc
No related branches found
No related tags found
No related merge requests found
......@@ -49,7 +49,8 @@ For users:
- New: task #11003: checkbox on checks to deposit
- New: Numbering module for invoice use same number for invoice
and credit note if mask is same.
- New: Add status into export. Add default language into export.
- New: Add status into export. Add default language into export.
- New: Can remove a project if project has tasks.
- Fix: Better Postgresql compatibility.
For developers:
......
......@@ -83,6 +83,7 @@ NoTasks=No tasks for this project
LinkedToAnotherCompany=Linked to other third party
TaskIsNotAffectedToYou=Task not allocated to you
ErrorTimeSpentIsEmpty=Time spent is empty
ThisWillAlsoRemoveTasks=This action will also delete all tasks of project (<b>%s</b> tasks at the moment) and all inputs of time spent.
##### Types de contacts #####
TypeContact_project_internal_PROJECTLEADER=Project leader
TypeContact_project_external_PROJECTLEADER=Project leader
......
......@@ -83,6 +83,7 @@ NoTasks=Aucune tâche pour ce projet
LinkedToAnotherCompany=Liés à autre société
TaskIsNotAffectedToYou=Tâche qui ne vous est pas affectée
ErrorTimeSpentIsEmpty=Le temps consommé n'est pas renseigné
ThisWillAlsoRemoveTasks=Cette opération détruira également les taches du projet (<b>%s</b> taches actuellement) et le suivi des consommés.
##### Types de contacts #####
TypeContact_project_internal_PROJECTLEADER=Chef de projet
TypeContact_project_external_PROJECTLEADER=Chef de projet
......
......@@ -281,9 +281,9 @@ class Project extends CommonObject
}
/**
* \brief Return list of projects
* \param socid To filter on a particular third party
* \return array Liste of projects
* Return list of projects
* @param socid To filter on a particular third party
* @return array Liste of projects
*/
function liste_array($socid='')
{
......
......@@ -27,6 +27,7 @@
require("../main.inc.php");
require_once(DOL_DOCUMENT_ROOT."/projet/class/project.class.php");
require_once(DOL_DOCUMENT_ROOT."/projet/class/task.class.php");
require_once(DOL_DOCUMENT_ROOT."/lib/project.lib.php");
require_once(DOL_DOCUMENT_ROOT."/core/class/html.formfile.class.php");
require_once(DOL_DOCUMENT_ROOT."/includes/modules/project/modules_project.php");
......@@ -364,7 +365,12 @@ else
// Confirmation delete
if ($_GET["action"] == 'delete')
{
$ret=$html->form_confirm($_SERVER["PHP_SELF"]."?id=".$project->id,$langs->trans("DeleteAProject"),$langs->trans("ConfirmDeleteAProject"),"confirm_delete",'','',1);
$text=$langs->trans("ConfirmDeleteAProject");
$task=new Task($db);
$taskarray=$task->getTasksArray(0,0,$project->id,0,0);
$nboftask=sizeof($taskarray);
if ($nboftask) $text.='<br>'.img_warning().' '.$langs->trans("ThisWillAlsoRemoveTasks",$nboftask);
$ret=$html->form_confirm($_SERVER["PHP_SELF"]."?id=".$project->id,$langs->trans("DeleteAProject"),$text,"confirm_delete",'','',1);
if ($ret == 'html') print '<br>';
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment