From d1f70a37df0f7dc7987967b1c6a49a8a20961116 Mon Sep 17 00:00:00 2001 From: "Sekan, Tobias" Date: Fri, 18 Sep 2020 07:56:13 +0200 Subject: [PATCH] Preselect thirparty on new from list (part 1) --- htdocs/comm/propal/list.php | 4 +++- htdocs/commande/list.php | 6 ++++-- htdocs/compta/facture/list.php | 4 +++- htdocs/expedition/list.php | 4 ++++ htdocs/fourn/commande/list.php | 6 ++++-- htdocs/fourn/facture/list.php | 4 +++- htdocs/supplier_proposal/list.php | 6 ++++-- 7 files changed, 25 insertions(+), 9 deletions(-) diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index 7bce96633fc..a13c0fd0436 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -483,7 +483,9 @@ if ($resql) $newcardbutton = ''; if ($user->rights->propal->creer) { - $newcardbutton .= dolGetButtonTitle($langs->trans('NewPropal'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/propal/card.php?action=create'); + $url = DOL_URL_ROOT.'/comm/propal/card.php?action=create'; + if (!empty($socid)) $url .= '&socid='.$socid; + $newcardbutton .= dolGetButtonTitle($langs->trans('NewPropal'), '', 'fa fa-plus-circle', $url); } // Fields title search diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index 898c581407f..dc33f4dda54 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -486,8 +486,10 @@ if ($resql) $newcardbutton = ''; if ($contextpage == 'orderlist' && $user->rights->commande->creer) { - $newcardbutton .= dolGetButtonTitle($langs->trans('NewOrder'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/commande/card.php?action=create'); - } + $url = DOL_URL_ROOT.'/commande/card.php?action=create'; + if (!empty($socid)) $url .= '&socid='.$socid; + $newcardbutton .= dolGetButtonTitle($langs->trans('NewOrder'), '', 'fa fa-plus-circle', $url); + } // Lines of title fields print '
'; diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index 41e0817310e..557170b44dd 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -677,7 +677,9 @@ if ($resql) $newcardbutton = ''; if ($user->rights->facture->creer && $contextpage != 'poslist') { - $newcardbutton .= dolGetButtonTitle($langs->trans('NewBill'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/compta/facture/card.php?action=create'); + $url = DOL_URL_ROOT.'/compta/facture/card.php?action=create'; + if (!empty($socid)) $url .= '&socid='.$socid; + $newcardbutton .= dolGetButtonTitle($langs->trans('NewBill'), '', 'fa fa-plus-circle', $url); } $i = 0; diff --git a/htdocs/expedition/list.php b/htdocs/expedition/list.php index 5c94ff3da95..fb4bc36e0fd 100644 --- a/htdocs/expedition/list.php +++ b/htdocs/expedition/list.php @@ -362,6 +362,10 @@ if ($resql) $newcardbutton = ''; if ($user->rights->expedition->creer) { + // Currently: a sending can't create from sending list + // $url = DOL_URL_ROOT.'/expedition/card.php?action=create'; + // if (!empty($socid)) $url .= '&socid='.$socid; + // $newcardbutton .= dolGetButtonTitle($langs->trans('NewSending'), '', 'fa fa-plus-circle', $url); $newcardbutton .= dolGetButtonTitle($langs->trans('NewSending'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/expedition/card.php?action=create2'); } diff --git a/htdocs/fourn/commande/list.php b/htdocs/fourn/commande/list.php index ea2e44b775d..676aa050e63 100644 --- a/htdocs/fourn/commande/list.php +++ b/htdocs/fourn/commande/list.php @@ -652,8 +652,10 @@ if ($resql) $newcardbutton = ''; if ($user->rights->fournisseur->commande->creer) { - $newcardbutton .= dolGetButtonTitle($langs->trans('NewOrder'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/fourn/commande/card.php?action=create'); - } + $url = DOL_URL_ROOT.'/fourn/commande/card.php?action=create'; + if (!empty($socid)) $url .= '&socid='.$socid; + $newcardbutton .= dolGetButtonTitle($langs->trans('NewOrder'), '', 'fa fa-plus-circle', $url); + } // Fields title search print ''; diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index 655798deac7..9146a8aecc5 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -511,7 +511,9 @@ if ($resql) $newcardbutton = ''; if ($user->rights->fournisseur->facture->creer) { - $newcardbutton .= dolGetButtonTitle($langs->trans('NewBill'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/fourn/facture/card.php?action=create'); + $url = DOL_URL_ROOT.'/fourn/facture/card.php?action=create'; + if (!empty($socid)) $url .= '&socid='.$socid; + $newcardbutton .= dolGetButtonTitle($langs->trans('NewBill'), '', 'fa fa-plus-circle', $url); } $i = 0; diff --git a/htdocs/supplier_proposal/list.php b/htdocs/supplier_proposal/list.php index 008a81542ec..26254f33b79 100644 --- a/htdocs/supplier_proposal/list.php +++ b/htdocs/supplier_proposal/list.php @@ -417,8 +417,10 @@ if ($resql) $newcardbutton = ''; if ($user->rights->supplier_proposal->creer) { - $newcardbutton .= dolGetButtonTitle($langs->trans('NewAskPrice'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/supplier_proposal/card.php?action=create'); - } + $url = DOL_URL_ROOT.'/supplier_proposal/card.php?action=create'; + if (!empty($socid)) $url .= '&socid='.$socid; + $newcardbutton .= dolGetButtonTitle($langs->trans('NewAskPrice'), '', 'fa fa-plus-circle', $url); + } // Fields title search print '';