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

@ -84,22 +84,20 @@ class ActionsContactCardDefault extends ActionsContactCardCommon
*/
function assign_values($action='')
{
global $conf, $langs, $user, $mysoc;
global $form, $formadmin, $formcompany;
global $langs, $user;
global $form;
parent::assign_values($action);
if ($action == 'create' || $action == 'edit')
{
}
if ($action == 'view')
{
// Confirm delete third party
// Confirm delete contact
if ($user->rights->societe->contact->supprimer)
{
if ($_GET["action"] == 'delete')
{
$this->tpl['action_delete'] = $form->formconfirm($_SERVER["PHP_SELF"]."?socid=".$this->object->id,$langs->trans("DeleteACompany"),$langs->trans("ConfirmDeleteCompany"),"confirm_delete",'',0,2);
$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 -->
<?php if ($this->control->tpl['action_delete']) echo $this->control->tpl['action_delete']; ?>
<table class="border" width="100%">
<tr>

View File

@ -249,18 +249,6 @@ if (! empty($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')
{
// Set action type

View File

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