commit
60ae50abb3
@ -40,11 +40,11 @@ class ActionsContactCardDefault extends ActionsContactCardCommon
|
||||
*/
|
||||
public function __construct($db, $dirmodule, $targetmodule, $canvas, $card)
|
||||
{
|
||||
$this->db = $db;
|
||||
$this->db = $db;
|
||||
$this->dirmodule = $dirmodule;
|
||||
$this->targetmodule = $targetmodule;
|
||||
$this->canvas = $canvas;
|
||||
$this->card = $card;
|
||||
$this->targetmodule = $targetmodule;
|
||||
$this->canvas = $canvas;
|
||||
$this->card = $card;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -55,13 +55,19 @@ class ActionsContactCardDefault extends ActionsContactCardCommon
|
||||
*/
|
||||
private function getTitle($action)
|
||||
{
|
||||
global $langs;
|
||||
global $langs, $conf;
|
||||
|
||||
$out = '';
|
||||
|
||||
if ($action == 'view') $out .= (!empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("Contact") : $langs->trans("ContactAddress"));
|
||||
if ($action == 'edit') $out .= (!empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("EditContact") : $langs->trans("EditContactAddress"));
|
||||
if ($action == 'create') $out .= (!empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("NewContact") : $langs->trans("NewContactAddress"));
|
||||
if ($action == 'view') {
|
||||
$out .= (!empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("Contact") : $langs->trans("ContactAddress"));
|
||||
}
|
||||
if ($action == 'edit') {
|
||||
$out .= (!empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("EditContact") : $langs->trans("EditContactAddress"));
|
||||
}
|
||||
if ($action == 'create') {
|
||||
$out .= (!empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("NewContact") : $langs->trans("NewContactAddress"));
|
||||
}
|
||||
|
||||
return $out;
|
||||
}
|
||||
@ -89,8 +95,7 @@ class ActionsContactCardDefault extends ActionsContactCardCommon
|
||||
$this->tpl['error'] = $this->error;
|
||||
$this->tpl['errors'] = $this->errors;
|
||||
|
||||
if ($action == 'view')
|
||||
{
|
||||
if ($action == 'view') {
|
||||
// Card header
|
||||
$head = contact_prepare_head($this->object);
|
||||
$title = $this->getTitle($action);
|
||||
@ -106,14 +111,12 @@ class ActionsContactCardDefault extends ActionsContactCardCommon
|
||||
$this->tpl['actionsdone'] = show_actions_done($conf, $langs, $db, $objsoc, $this->object, 1);
|
||||
} else {
|
||||
// Confirm delete contact
|
||||
if ($action == 'delete' && $user->rights->societe->contact->supprimer)
|
||||
{
|
||||
if ($action == 'delete' && $user->rights->societe->contact->supprimer) {
|
||||
$this->tpl['action_delete'] = $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$this->object->id, $langs->trans("DeleteContact"), $langs->trans("ConfirmDeleteContact"), "confirm_delete", '', 0, 1);
|
||||
}
|
||||
}
|
||||
|
||||
if ($action == 'list')
|
||||
{
|
||||
if ($action == 'list') {
|
||||
$this->LoadListDatas($limit, $offset, $sortfield, $sortorder);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user