From d79478e66d25364f89b587e5bd2cf933ceb5b3cc Mon Sep 17 00:00:00 2001 From: BENKE Charlie Date: Sat, 30 Jan 2016 09:43:02 +0100 Subject: [PATCH 1/3] Add hook on contacttpl The goal is to display additionnal feature a the bottom of the contact page like display contact adress and print stamp directly Another way is to show on a google maps the travel to do between us and the multiple thirdpartie present --- htdocs/core/tpl/contacts.tpl.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/htdocs/core/tpl/contacts.tpl.php b/htdocs/core/tpl/contacts.tpl.php index 638d54a62ef..e6037637d35 100644 --- a/htdocs/core/tpl/contacts.tpl.php +++ b/htdocs/core/tpl/contacts.tpl.php @@ -1,7 +1,7 @@ * Copyright (C) 2013-2015 Laurent Destailleur - * Copyright (C) 2015 Charlie BENKE + * Copyright (C) 2015-2016 Charlie BENKE * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -228,4 +228,13 @@ $userstatic=new User($db); + +initHooks(array('contacttpl')); + $parameters=array(); + $reshook=$hookmanager->executeHooks('formContactTpl',$parameters,$object,$action); + } +?> From 324c1123e0c847d75d928c3894e70acd3d3fdf70 Mon Sep 17 00:00:00 2001 From: BENKE Charlie Date: Sat, 30 Jan 2016 17:21:42 +0100 Subject: [PATCH 2/3] Update contacts.tpl.php if permission modules right are not in french --- htdocs/core/tpl/contacts.tpl.php | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/htdocs/core/tpl/contacts.tpl.php b/htdocs/core/tpl/contacts.tpl.php index e6037637d35..4908d162f8b 100644 --- a/htdocs/core/tpl/contacts.tpl.php +++ b/htdocs/core/tpl/contacts.tpl.php @@ -27,15 +27,22 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; $module = $object->element; // Special cases -if ($module == 'propal') { $permission=$user->rights->propale->creer; } -elseif ($module == 'fichinter') { $permission=$user->rights->ficheinter->creer; } +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 ($module == 'action') { $permission=$user->rights->agenda->myactions->create; } -elseif ($module == 'shipping') { $permission=$user->rights->expedition->creer; } -elseif ($module == 'project_task') { $permission=$user->rights->projet->creer; } -elseif (! isset($permission)) { $permission=$user->rights->$module->creer; } // If already defined by caller page +elseif ($module == 'project') { $permission=$user->rights->projet->creer; } +elseif ($module == 'action') { $permission=$user->rights->agenda->myactions->create; } +elseif ($module == 'shipping') { $permission=$user->rights->expedition->creer; } +elseif ($module == 'project_task') { $permission=$user->rights->projet->creer; } +elseif (! isset($permission) && isset($user->rights->$module->creer)) +{ + $permission=$user->rights->$module->creer; +} +elseif (! isset($permission) && isset($user->rights->$module->write)) +{ + $permission=$user->rights->$module->write; +} $formcompany= new FormCompany($db); $companystatic=new Societe($db); From 87c5854382640069f4895e4b3253b968b6f22c00 Mon Sep 17 00:00:00 2001 From: BENKE Charlie Date: Thu, 4 Feb 2016 16:58:19 +0100 Subject: [PATCH 3/3] just change for rerun travis cheking --- htdocs/core/tpl/contacts.tpl.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/tpl/contacts.tpl.php b/htdocs/core/tpl/contacts.tpl.php index 4908d162f8b..de3d79a790d 100644 --- a/htdocs/core/tpl/contacts.tpl.php +++ b/htdocs/core/tpl/contacts.tpl.php @@ -1,6 +1,6 @@ - * Copyright (C) 2013-2015 Laurent Destailleur +/* Copyright (C) 2012 Regis Houssin + * Copyright (C) 2013-2015 Laurent Destailleur * Copyright (C) 2015-2016 Charlie BENKE * * This program is free software; you can redistribute it and/or modify