Merge pull request #16270 from frederic34/patch-3

fix unknown variable
This commit is contained in:
Laurent Destailleur 2021-02-11 23:00:36 +01:00 committed by GitHub
commit 60ae50abb3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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);
}
}