From 6305c6c8fa4b9f1620753977a981e3a35078159b Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Thu, 4 Nov 2010 07:48:28 +0000 Subject: [PATCH] Works on contact canvas in relation to the thirdparty canvas module --- .../default/tpl/contactcard_view.tpl.php | 18 ++++++++++++ htdocs/contact/fiche.php | 25 +--------------- .../canvas/default/tpl/card_view.tpl.php | 16 ++++++++++ htdocs/societe/soc.php | 29 +------------------ 4 files changed, 36 insertions(+), 52 deletions(-) diff --git a/htdocs/contact/canvas/default/tpl/contactcard_view.tpl.php b/htdocs/contact/canvas/default/tpl/contactcard_view.tpl.php index 0b0ae5e922f..28c0360b775 100644 --- a/htdocs/contact/canvas/default/tpl/contactcard_view.tpl.php +++ b/htdocs/contact/canvas/default/tpl/contactcard_view.tpl.php @@ -126,4 +126,22 @@ +societe_id) { ?> +
+ +rights->societe->contact->creer) { ?> +">trans('Modify'); ?> + + +control->tpl['user_id'] && $user->rights->user->user->creer) { ?> +">trans("CreateDolibarrLogin"); ?> + + +rights->societe->contact->supprimer) { ?> +">trans('Delete'); ?> + + +

+ + \ No newline at end of file diff --git a/htdocs/contact/fiche.php b/htdocs/contact/fiche.php index 38b690e568d..76bbc228b01 100644 --- a/htdocs/contact/fiche.php +++ b/htdocs/contact/fiche.php @@ -2,7 +2,7 @@ /* Copyright (C) 2004-2005 Rodolphe Quiedeville * Copyright (C) 2004-2010 Laurent Destailleur * Copyright (C) 2004 Benoit Mortier - * Copyright (C) 2005-2009 Regis Houssin + * Copyright (C) 2005-2010 Regis Houssin * Copyright (C) 2007 Franky Van Liedekerke * * This program is free software; you can redistribute it and/or modify @@ -359,29 +359,6 @@ if (! empty($canvas)) // Display canvas $objcanvas->display_canvas(); - // Barre d'actions - if (! $user->societe_id) - { - print '
'; - - if ($user->rights->societe->contact->creer) - { - print ''.$langs->trans('Modify').''; - } - - if (! $objcanvas->control->object->user_id && $user->rights->user->user->creer) - { - print ''.$langs->trans("CreateDolibarrLogin").''; - } - - if ($user->rights->societe->contact->supprimer) - { - print ''.$langs->trans('Delete').''; - } - - print "

"; - } - print show_actions_todo($conf,$langs,$db,$objsoc,$objcanvas->control->object); print show_actions_done($conf,$langs,$db,$objsoc,$objcanvas->control->object); diff --git a/htdocs/societe/canvas/default/tpl/card_view.tpl.php b/htdocs/societe/canvas/default/tpl/card_view.tpl.php index 8577330effe..d9e7d3ccb34 100644 --- a/htdocs/societe/canvas/default/tpl/card_view.tpl.php +++ b/htdocs/societe/canvas/default/tpl/card_view.tpl.php @@ -241,4 +241,20 @@ function CheckVAT(a) { +
+rights->societe->creer) { ?> +">trans("Modify"); ?> + + +rights->societe->contact->creer) { ?> +trans("AddContact"); ?> + + +rights->societe->supprimer) { ?> +">trans('Delete'); ?> + +
+ +
+ \ No newline at end of file diff --git a/htdocs/societe/soc.php b/htdocs/societe/soc.php index 7327496a674..fc976ff1f02 100644 --- a/htdocs/societe/soc.php +++ b/htdocs/societe/soc.php @@ -470,32 +470,6 @@ if (! empty($canvas)) // Display canvas $soccanvas->display_canvas(); - /* - * Actions - */ - if ($_GET["action"] == '') - { - print '
'; - - if ($user->rights->societe->creer) - { - print ''.$langs->trans("Modify").''; - } - - if ($user->rights->societe->contact->creer) - { - print ''.$langs->trans("AddContact").''; - } - - if ($user->rights->societe->supprimer) - { - print ''.$langs->trans('Delete').''; - } - - print '
'; - print '
'; - } - print ''; - print ''; + print ''; print ''; print '
'; print ''; // ancre @@ -513,8 +487,7 @@ if (! empty($canvas)) $somethingshown=$formfile->show_documents('company',$socid,$filedir,$urlsource,$genallowed,$delallowed,'',0,0,0,28,0,'',0,'',$soccanvas->control->object->default_lang); print ''; - print '
';