';
print "\n";
}
diff --git a/htdocs/core/boxes/modules_boxes.php b/htdocs/core/boxes/modules_boxes.php
index d29b16da734..8413ac37b6b 100644
--- a/htdocs/core/boxes/modules_boxes.php
+++ b/htdocs/core/boxes/modules_boxes.php
@@ -166,8 +166,8 @@ class ModeleBoxes // Can't be abtract as it is instanciated to build "empty"
{
print '
';
// The image must have the class 'boxhandle' beause it's value used in DOM draggable objects to define the area used to catch the full object
- print img_picto($langs->trans("MoveBox",$this->box_id),'grip','class="boxhandle hideonsmartphone" style="cursor:move;"');
- print img_picto($langs->trans("Close",$this->box_id),'close','class="boxclose" rel="x:y" style="cursor:pointer;" id="imgclose'.$this->box_id.'"');
+ print img_picto($langs->trans("MoveBox",$this->box_id),'grip_title','class="boxhandle hideonsmartphone" style="cursor:move;"');
+ print img_picto($langs->trans("Close",$this->box_id),'close_title','class="boxclose" rel="x:y" style="cursor:pointer;" id="imgclose'.$this->box_id.'"');
$label=$head['text'];
if (! empty($head['graph'])) $label.=' ('.$langs->trans("Graph").')';
print '';
@@ -242,7 +242,7 @@ class ModeleBoxes // Can't be abtract as it is instanciated to build "empty"
else print $text2withnotags; // show text with html cleaning
if (! empty($textnoformat)) print "\n".$textnoformat."\n";
-
+
print "
";
}
diff --git a/htdocs/core/tpl/contacts.tpl.php b/htdocs/core/tpl/contacts.tpl.php
index dc97d84e9b6..33b98d56f48 100644
--- a/htdocs/core/tpl/contacts.tpl.php
+++ b/htdocs/core/tpl/contacts.tpl.php
@@ -14,6 +14,9 @@
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
+ *
+ * This template needs:
+ * $object
*/
if (! class_exists('Contact')) {
@@ -30,6 +33,7 @@ if ($module == 'propal') { $permission=$user->rights->propale->creer; }
elseif ($module == 'fichinter') { $permission=$user->rights->ficheinter->creer; }
elseif ($module == 'invoice_supplier') { $permission=$user->rights->fournisseur->facture->creer; }
elseif ($module == 'order_supplier') { $permission=$user->rights->fournisseur->commande->creer; }
+elseif ($module == 'project') { $permission=$user->rights->projet->creer; }
elseif (! isset($permission)) { $permission=$user->rights->$module->creer; } // If already defined by caller page
$formcompany= new FormCompany($db);
diff --git a/htdocs/langs/en_US/categories.lang b/htdocs/langs/en_US/categories.lang
index bddaf125aec..e883ab24ed0 100644
--- a/htdocs/langs/en_US/categories.lang
+++ b/htdocs/langs/en_US/categories.lang
@@ -17,6 +17,7 @@ SuppliersCategoriesArea=Suppliers categories area
CustomersCategoriesArea=Customers categories area
ThirdPartyCategoriesArea=Third parties categories area
MembersCategoriesArea=Members categories area
+ContactsCategoriesArea=Contacts categories area
MainCats=Main categories
SubCats=Subcategories
CatStatistics=Statistics
@@ -86,6 +87,7 @@ ThisCategoryHasNoProduct=This category does not contain any product.
ThisCategoryHasNoSupplier=This category does not contain any supplier.
ThisCategoryHasNoCustomer=This category does not contain any customer.
ThisCategoryHasNoMember=This category does not contain any member.
+ThisCategoryHasNoContact=This category does not contain any contact.
AssignedToCustomer=Assigned to a customer
AssignedToTheCustomer=Assigned to the customer
InternalCategory=Internal category
diff --git a/htdocs/langs/fr_FR/categories.lang b/htdocs/langs/fr_FR/categories.lang
index c14906dd2fb..bf0c646c034 100644
--- a/htdocs/langs/fr_FR/categories.lang
+++ b/htdocs/langs/fr_FR/categories.lang
@@ -17,6 +17,7 @@ SuppliersCategoriesArea=Espace des catégories de tiers fournisseurs
CustomersCategoriesArea=Espace des catégories de tiers clients ou prospects
ThirdPartyCategoriesArea=Espace des catégories de tiers
MembersCategoriesArea=Espace des catégories d'adhérents
+ContactsCategoriesArea=Espace des catégories des contacts
MainCats=Catégories principales
SubCats=Sous-catégories
CatStatistics=Statistiques
@@ -86,6 +87,7 @@ ThisCategoryHasNoProduct=Cette catégorie ne contient aucun produit.
ThisCategoryHasNoSupplier=Cette catégorie ne contient aucun fournisseur.
ThisCategoryHasNoCustomer=Cette catégorie ne contient aucun client.
ThisCategoryHasNoMember=Cette catégorie ne contient aucun adhérent.
+ThisCategoryHasNoContact=Cette catégorie ne contient aucun contact.
AssignedToCustomer=Attribuer à un client
AssignedToTheCustomer=Attribué au client
InternalCategory=Catégorie interne
diff --git a/htdocs/projet/contact.php b/htdocs/projet/contact.php
index 2f253112cdf..0674bcaf24b 100644
--- a/htdocs/projet/contact.php
+++ b/htdocs/projet/contact.php
@@ -31,17 +31,20 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
$langs->load("projects");
$langs->load("companies");
-$id = GETPOST('id','int');
-$ref= GETPOST('ref','alpha');
+$id = GETPOST('id','int');
+$ref = GETPOST('ref','alpha');
+$lineid = GETPOST('lineid','int');
+$socid = GETPOST('socid','int');
+$action = GETPOST('action','alpha');
-$mine = $_REQUEST['mode']=='mine' ? 1 : 0;
+$mine = GETPOST('mode')=='mine' ? 1 : 0;
//if (! $user->rights->projet->all->lire) $mine=1; // Special for projects
-$project = new Project($db);
+$object = new Project($db);
if ($ref)
{
- $project->fetch(0,$ref);
- $id=$project->id;
+ $object->fetch(0,$ref);
+ $id=$object->id;
}
// Security check
@@ -55,41 +58,42 @@ $result = restrictedArea($user, 'projet', $id);
*/
// Add new contact
-if ($_POST["action"] == 'addcontact' && $user->rights->projet->creer)
+if ($action == 'addcontact' && $user->rights->projet->creer)
{
$result = 0;
- $result = $project->fetch($id);
+ $result = $object->fetch($id);
if ($result > 0 && $id > 0)
{
- $result = $project->add_contact($_POST["contactid"], $_POST["type"], $_POST["source"]);
+ $contactid = (GETPOST('userid') ? GETPOST('userid','int') : GETPOST('contactid','int'));
+ $result = $object->add_contact($contactid, $_POST["type"], $_POST["source"]);
}
if ($result >= 0)
{
- header("Location: contact.php?id=".$project->id);
+ header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
exit;
}
else
{
- if ($project->error == 'DB_ERROR_RECORD_ALREADY_EXISTS')
+ if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS')
{
$langs->load("errors");
$mesg = '
';
-
- /*
- * Ajouter une ligne de contact
- * Non affiche en mode modification de ligne
- */
- if ($_GET["action"] != 'editline')
+ // Contacts lines (modules that overwrite templates must declare this into descriptor)
+ $dirtpls=array_merge($conf->modules_parts['tpl'],array('/core/tpl'));
+ foreach($dirtpls as $reldir)
{
- print '
';
- print '
'.$langs->trans("Source").'
';
- print '
'.$langs->trans("Company").'
';
- print '
'.$langs->trans("Contacts").'
';
- print '
'.$langs->trans("ContactType").'
';
- print '
';
- print "
\n";
-
- $var = false;
-
- print '';
-
- // Line to add external contact. Only if project is linked to a third party.
- //if ($project->societe->id)
- //{
- print '";
- //}
-
- print '