From c2b11782730b80a1f8df6a0e38b5f44cd99eacc7 Mon Sep 17 00:00:00 2001 From: Tobias Sekan Date: Mon, 16 Mar 2020 07:55:15 +0100 Subject: [PATCH 1/2] Add substitution for user_civility for ODT --- .../core/class/commondocgenerator.class.php | 55 ++++++++++--------- 1 file changed, 28 insertions(+), 27 deletions(-) diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php index 279eb1f7a6b..bd3dcb01e76 100644 --- a/htdocs/core/class/commondocgenerator.class.php +++ b/htdocs/core/class/commondocgenerator.class.php @@ -267,33 +267,34 @@ abstract class CommonDocGenerator $object->state = getState($object->state_code, 0); } - $array_contact = array( - $array_key.'_fullname' => $object->getFullName($outputlangs, 1), - $array_key.'_lastname' => $object->lastname, - $array_key.'_firstname' => $object->firstname, - $array_key.'_address' => $object->address, - $array_key.'_zip' => $object->zip, - $array_key.'_town' => $object->town, - $array_key.'_state_id' => $object->state_id, - $array_key.'_state_code' => $object->state_code, - $array_key.'_state' => $object->state, - $array_key.'_country_id' => $object->country_id, - $array_key.'_country_code' => $object->country_code, - $array_key.'_country' => $object->country, - $array_key.'_poste' => $object->poste, - $array_key.'_socid' => $object->socid, - $array_key.'_statut' => $object->statut, - $array_key.'_code' => $object->code, - $array_key.'_email' => $object->email, - $array_key.'_jabberid' => $object->jabberid, - $array_key.'_phone_pro' => $object->phone_pro, - $array_key.'_phone_perso' => $object->phone_perso, - $array_key.'_phone_mobile' => $object->phone_mobile, - $array_key.'_fax' => $object->fax, - $array_key.'_birthday' => $object->birthday, - $array_key.'_default_lang' => $object->default_lang, - $array_key.'_note_public' => $object->note_public, - $array_key.'_note_private' => $object->note_private + $array_contact = array ( + $array_key . '_fullname' => $object->getFullName($outputlangs, 1), + $array_key . '_lastname' => $object->lastname, + $array_key . '_firstname' => $object->firstname, + $array_key . '_address' => $object->address, + $array_key . '_zip' => $object->zip, + $array_key . '_town' => $object->town, + $array_key . '_state_id' => $object->state_id, + $array_key . '_state_code' => $object->state_code, + $array_key . '_state' => $object->state, + $array_key . '_country_id' => $object->country_id, + $array_key . '_country_code' => $object->country_code, + $array_key . '_country' => $object->country, + $array_key . '_poste' => $object->poste, + $array_key . '_socid' => $object->socid, + $array_key . '_statut' => $object->statut, + $array_key . '_code' => $object->code, + $array_key . '_email' => $object->email, + $array_key . '_jabberid' => $object->jabberid, // deprecated + $array_key . '_phone_pro' => $object->phone_pro, + $array_key . '_phone_perso' => $object->phone_perso, + $array_key . '_phone_mobile' => $object->phone_mobile, + $array_key . '_fax' => $object->fax, + $array_key . '_birthday' => $object->birthday, + $array_key . '_default_lang' => $object->default_lang, + $array_key . '_note_public' => $object->note_public, + $array_key . '_note_private' => $object->note_private, + $array_key . '_civility' => $object->civility, ); // Retrieve extrafields From c38e16460e028914cf2f8b8307aace9427896a71 Mon Sep 17 00:00:00 2001 From: Tobias Sekan Date: Wed, 25 Mar 2020 10:31:40 +0100 Subject: [PATCH 2/2] Add new category button in sub categories --- htdocs/categories/viewcat.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/htdocs/categories/viewcat.php b/htdocs/categories/viewcat.php index 727ef8b0610..c7242077da4 100644 --- a/htdocs/categories/viewcat.php +++ b/htdocs/categories/viewcat.php @@ -4,6 +4,7 @@ * Copyright (C) 2007 Patrick Raguin * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2015 Raphaƫl Doursenaud + * Copyright (C) 2020 Tobias Sekan * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -290,8 +291,18 @@ if ($user->rights->categorie->supprimer) print ""; +if (! empty($user->rights->categorie->creer)) +{ + $link = DOL_URL_ROOT.'/categories/card.php'; + $link .= '?action=create'; + $link .= '&type='.$type; + $link .= '&catorigin='.$object->id; + $link .= '&backtopage='.urlencode($_SERVER["PHP_SELF"].'?type='.$type.'&id='.$id); - + print '
'; + print dolGetButtonTitle($langs->trans('NewCategory'), '', 'fa fa-plus-circle', $link); + print "
"; +} $cats = $object->get_filles(); if ($cats < 0)