diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php
index e926611ccd4..9522a45c383 100644
--- a/htdocs/categories/class/categorie.class.php
+++ b/htdocs/categories/class/categorie.class.php
@@ -125,7 +125,7 @@ class Categorie extends CommonObject
'contact' => 'socpeople',
'user' => 'user',
'account' => 'bank_account',
- 'project' => 'project',
+ 'project' => 'projet',
);
public $element='category';
diff --git a/htdocs/categories/viewcat.php b/htdocs/categories/viewcat.php
index fdde86ff1f9..4411061e0c0 100644
--- a/htdocs/categories/viewcat.php
+++ b/htdocs/categories/viewcat.php
@@ -657,6 +657,61 @@ if ($object->type == Categorie::TYPE_ACCOUNT)
}
}
+// List of Project
+if ($object->type == Categorie::TYPE_PROJECT)
+{
+ require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
+
+ $projects = $object->getObjectsInCateg("project");
+ if ($projects < 0)
+ {
+ dol_print_error($db, $object->error, $object->errors);
+ }
+ else
+ {
+ print "
";
+ print "
| '.$langs->trans("Project")." | |||
| '; + print $project->getNomUrl(1,0); + print " | \n"; + print ''.$project->ref." | \n"; + print ''.$project->title." | \n"; + // Link to delete from category + print ''; + $typeid=$object->type; + $permission=0; + if ($typeid == Categorie::TYPE_PRODUCT) $permission=($user->rights->produit->creer || $user->rights->service->creer); + if ($typeid == Categorie::TYPE_SUPPLIER) $permission=$user->rights->societe->creer; + if ($typeid == Categorie::TYPE_CUSTOMER) $permission=$user->rights->societe->creer; + if ($typeid == Categorie::TYPE_MEMBER) $permission=$user->rights->adherent->creer; + if ($typeid == Categorie::TYPE_ACCOUNT) $permission=$user->rights->banque->configurer; + if ($typeid == Categorie::TYPE_PROJECT) $permission=$user->rights->projet->creer; + if ($permission) + { + print "id."&type=".$typeid."&removeelem=".$project->id."'>"; + print img_delete($langs->trans("DeleteFromCat")).' '; + print $langs->trans("DeleteFromCat").""; + } + print " |
| '.$langs->trans("ThisCategoryHasNoProject").' | |||