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

@ -55,13 +55,19 @@ class ActionsContactCardDefault extends ActionsContactCardCommon
*/ */
private function getTitle($action) private function getTitle($action)
{ {
global $langs; global $langs, $conf;
$out = ''; $out = '';
if ($action == 'view') $out .= (!empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("Contact") : $langs->trans("ContactAddress")); if ($action == 'view') {
if ($action == 'edit') $out .= (!empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("EditContact") : $langs->trans("EditContactAddress")); $out .= (!empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("Contact") : $langs->trans("ContactAddress"));
if ($action == 'create') $out .= (!empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("NewContact") : $langs->trans("NewContactAddress")); }
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; return $out;
} }
@ -89,8 +95,7 @@ class ActionsContactCardDefault extends ActionsContactCardCommon
$this->tpl['error'] = $this->error; $this->tpl['error'] = $this->error;
$this->tpl['errors'] = $this->errors; $this->tpl['errors'] = $this->errors;
if ($action == 'view') if ($action == 'view') {
{
// Card header // Card header
$head = contact_prepare_head($this->object); $head = contact_prepare_head($this->object);
$title = $this->getTitle($action); $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); $this->tpl['actionsdone'] = show_actions_done($conf, $langs, $db, $objsoc, $this->object, 1);
} else { } else {
// Confirm delete contact // 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); $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); $this->LoadListDatas($limit, $offset, $sortfield, $sortorder);
} }
} }