From 853bacd545f65e09316c93f8d7604e36143a9fcf Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Wed, 2 Sep 2020 23:43:36 +0200 Subject: [PATCH 1/3] New Accountancy Add predefined url in getNomUrl --- htdocs/accountancy/class/accountingaccount.class.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/htdocs/accountancy/class/accountingaccount.class.php b/htdocs/accountancy/class/accountingaccount.class.php index 43442fa0ca5..06e73a07d9d 100644 --- a/htdocs/accountancy/class/accountingaccount.class.php +++ b/htdocs/accountancy/class/accountingaccount.class.php @@ -448,9 +448,10 @@ class AccountingAccount extends CommonObject * @param int $notooltip 1=Disable tooltip * @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking * @param int $withcompletelabel 0=Short label (field short label), 1=Complete label (field label) + * @param int $targeturl 0=bookkeeping, 1=bookkeeping listbyaccount, 2=account card * @return string String with URL */ - public function getNomUrl($withpicto = 0, $withlabel = 0, $nourl = 0, $moretitle = '', $notooltip = 0, $save_lastsearch_value = -1, $withcompletelabel = 0) + public function getNomUrl($withpicto = 0, $withlabel = 0, $nourl = 0, $moretitle = '', $notooltip = 0, $save_lastsearch_value = -1, $withcompletelabel = 0, $targeturl = 0) { global $langs, $conf, $user; require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php'; @@ -459,7 +460,13 @@ class AccountingAccount extends CommonObject $result = ''; - $url = DOL_URL_ROOT.'/accountancy/admin/card.php?id='.$this->id; + if (empty($targeturl)) { + $url = DOL_URL_ROOT . '/accountancy/bookkeeping/list.php?search_accountancy_code_start=' . $this->account_number . '&search_accountancy_code_end=' . $this->account_number; + } elseif ($targeturl == 1) { + $url = DOL_URL_ROOT . '/accountancy/bookkeeping/listbyaccount.php?search_accountancy_code_start=' . $this->account_number . '&search_accountancy_code_end=' . $this->account_number; + } elseif ($targeturl == 2) { + $url = DOL_URL_ROOT . '/accountancy/admin/card.php?id=' . $this->id; + } // Add param to save lastsearch_values or not $add_save_lastsearch_values = ($save_lastsearch_value == 1 ? 1 : 0); From b3cd9688d5c30fbe9408ecce16c9aca7d06df3e6 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Wed, 2 Sep 2020 23:43:47 +0200 Subject: [PATCH 2/3] Typo --- htdocs/core/class/html.formfile.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index 31b16b7fb65..65e44b86efc 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -122,7 +122,7 @@ class FormFile $out .= ''; } - $out .= ''; + $out .= '
'; $out .= ''; if (!empty($options)) $out .= ''; From 87113a77b448a748757ab9487bb229d1f6ee04e1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 3 Sep 2020 12:32:51 +0200 Subject: [PATCH 3/3] Update accountingaccount.class.php --- htdocs/accountancy/class/accountingaccount.class.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/accountancy/class/accountingaccount.class.php b/htdocs/accountancy/class/accountingaccount.class.php index 06e73a07d9d..7cb30a74bc6 100644 --- a/htdocs/accountancy/class/accountingaccount.class.php +++ b/htdocs/accountancy/class/accountingaccount.class.php @@ -448,10 +448,10 @@ class AccountingAccount extends CommonObject * @param int $notooltip 1=Disable tooltip * @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking * @param int $withcompletelabel 0=Short label (field short label), 1=Complete label (field label) - * @param int $targeturl 0=bookkeeping, 1=bookkeeping listbyaccount, 2=account card + * @param int $option 'bookkeeping', 'bookkeepinglistbyaccount', 'accountcard' * @return string String with URL */ - public function getNomUrl($withpicto = 0, $withlabel = 0, $nourl = 0, $moretitle = '', $notooltip = 0, $save_lastsearch_value = -1, $withcompletelabel = 0, $targeturl = 0) + public function getNomUrl($withpicto = 0, $withlabel = 0, $nourl = 0, $moretitle = '', $notooltip = 0, $save_lastsearch_value = -1, $withcompletelabel = 0, $option = '') { global $langs, $conf, $user; require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php'; @@ -460,11 +460,11 @@ class AccountingAccount extends CommonObject $result = ''; - if (empty($targeturl)) { + if (empty($option)) { $url = DOL_URL_ROOT . '/accountancy/bookkeeping/list.php?search_accountancy_code_start=' . $this->account_number . '&search_accountancy_code_end=' . $this->account_number; - } elseif ($targeturl == 1) { + } elseif ($option == 'bookkeepinglistbyaccount') { $url = DOL_URL_ROOT . '/accountancy/bookkeeping/listbyaccount.php?search_accountancy_code_start=' . $this->account_number . '&search_accountancy_code_end=' . $this->account_number; - } elseif ($targeturl == 2) { + } elseif ($option == 'accountcard') { $url = DOL_URL_ROOT . '/accountancy/admin/card.php?id=' . $this->id; }
'.$options.'