Works on contact canvas in relation to the thirdparty canvas module

This commit is contained in:
Regis Houssin 2010-11-04 17:50:01 +00:00
parent dc3fd00557
commit 05ed583cf1
6 changed files with 15 additions and 35 deletions

View File

@ -181,7 +181,7 @@ class ActionsContactCardCommon
if ($action == 'view') if ($action == 'view')
{ {
$this->tpl['showrefnav'] = $form->showrefnav($this->object,'id'); $this->tpl['showrefnav'] = $form->showrefnav($this->object,'id');
if ($this->object->socid > 0) if ($this->object->socid > 0)
{ {
@ -207,8 +207,8 @@ class ActionsContactCardCommon
$this->tpl['phone_pro'] = dol_print_phone($this->object->phone_pro,$this->object->pays_code,0,$this->object->id,'AC_TEL'); $this->tpl['phone_pro'] = dol_print_phone($this->object->phone_pro,$this->object->pays_code,0,$this->object->id,'AC_TEL');
$this->tpl['phone_perso'] = dol_print_phone($this->object->phone_perso,$this->object->pays_code,0,$this->object->id,'AC_TEL'); $this->tpl['phone_perso'] = dol_print_phone($this->object->phone_perso,$this->object->pays_code,0,$this->object->id,'AC_TEL');
$this->tpl['phone_mobile'] = dol_print_phone($this->object->phone_mobile,$this->object->pays_code,0,$this->object->id,'AC_TEL'); $this->tpl['phone_mobile'] = dol_print_phone($this->object->phone_mobile,$this->object->pays_code,0,$this->object->id,'AC_TEL');
$this->tpl['fax'] = dol_print_phone($this->object->fax,$this->object->pays_code,0,$this->object->id,'AC_FAX'); $this->tpl['fax'] = dol_print_phone($this->object->fax,$this->object->pays_code,0,$this->object->id,'AC_FAX');
$this->tpl['email'] = dol_print_email($this->object->email,0,$this->object->id,'AC_EMAIL'); $this->tpl['email'] = dol_print_email($this->object->email,0,$this->object->id,'AC_EMAIL');
$this->tpl['visibility'] = $this->object->LibPubPriv($this->object->priv); $this->tpl['visibility'] = $this->object->LibPubPriv($this->object->priv);

View File

@ -84,23 +84,21 @@ class ActionsContactCardDefault extends ActionsContactCardCommon
*/ */
function assign_values($action='') function assign_values($action='')
{ {
global $conf, $langs, $user, $mysoc; global $langs, $user;
global $form, $formadmin, $formcompany; global $form;
parent::assign_values($action); parent::assign_values($action);
if ($action == 'create' || $action == 'edit')
{
}
if ($action == 'view') if ($action == 'view')
{ {
// Confirm delete third party // Confirm delete contact
if ($_GET["action"] == 'delete') if ($user->rights->societe->contact->supprimer)
{ {
$this->tpl['action_delete'] = $form->formconfirm($_SERVER["PHP_SELF"]."?socid=".$this->object->id,$langs->trans("DeleteACompany"),$langs->trans("ConfirmDeleteCompany"),"confirm_delete",'',0,2); if ($_GET["action"] == 'delete')
} {
$this->tpl['action_delete'] = $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$this->object->id,$langs->trans("DeleteContact"),$langs->trans("ConfirmDeleteContact"),"confirm_delete",'',0,1);
}
}
} }
} }

View File

@ -21,6 +21,8 @@
<!-- BEGIN PHP TEMPLATE --> <!-- BEGIN PHP TEMPLATE -->
<?php if ($this->control->tpl['action_delete']) echo $this->control->tpl['action_delete']; ?>
<table class="border" width="100%"> <table class="border" width="100%">
<tr> <tr>

View File

@ -249,18 +249,6 @@ if (! empty($canvas))
// When used with CANVAS // When used with CANVAS
// ----------------------------------------- // -----------------------------------------
/*
* Confirmation de la suppression du contact
*/
if ($user->rights->societe->contact->supprimer)
{
if ($_GET["action"] == 'delete')
{
$ret=$form->form_confirm($_SERVER["PHP_SELF"]."?id=".$_GET["id"],$langs->trans("DeleteContact"),$langs->trans("ConfirmDeleteContact"),"confirm_delete",'',0,1);
if ($ret == 'html') print '<br>';
}
}
if (GETPOST("action") == 'create') if (GETPOST("action") == 'create')
{ {
// Set action type // Set action type

View File

@ -23,10 +23,6 @@
<?php if ($this->control->tpl['action_delete']) echo $this->control->tpl['action_delete']; ?> <?php if ($this->control->tpl['action_delete']) echo $this->control->tpl['action_delete']; ?>
<?php if ($mesg) { ?>
<div class="error"><?php echo $mesg; ?></div>
<?php } ?>
<form name="formsoc" method="POST"> <form name="formsoc" method="POST">
<input type="hidden" name="canvas" value="<?php echo $canvas ?>"> <input type="hidden" name="canvas" value="<?php echo $canvas ?>">
<input type="hidden" name="token" value="<?php echo $_SESSION['newtoken']; ?>"> <input type="hidden" name="token" value="<?php echo $_SESSION['newtoken']; ?>">

View File

@ -23,10 +23,6 @@
<?php if ($this->control->tpl['action_delete']) echo $this->control->tpl['action_delete']; ?> <?php if ($this->control->tpl['action_delete']) echo $this->control->tpl['action_delete']; ?>
<?php if ($mesg) { ?>
<div class="error"><?php echo $mesg; ?></div>
<?php } ?>
<form name="formsoc" method="POST"> <form name="formsoc" method="POST">
<input type="hidden" name="canvas" value="<?php echo $canvas ?>"> <input type="hidden" name="canvas" value="<?php echo $canvas ?>">
<input type="hidden" name="token" value="<?php echo $_SESSION['newtoken']; ?>"> <input type="hidden" name="token" value="<?php echo $_SESSION['newtoken']; ?>">