diff --git a/htdocs/accountancy/bookkeeping/list.php b/htdocs/accountancy/bookkeeping/list.php index 9a623287fc2..987f7f3fd28 100644 --- a/htdocs/accountancy/bookkeeping/list.php +++ b/htdocs/accountancy/bookkeeping/list.php @@ -640,7 +640,9 @@ $newcardbutton .= dolGetButtonTitle($buttonLabel, $langs->trans("ExportFilteredL $newcardbutton .= dolGetButtonTitle($langs->trans('GroupByAccountAccounting'), '', 'fa fa-stream paddingleft', DOL_URL_ROOT.'/accountancy/bookkeeping/listbyaccount.php?'.$param); -$newcardbutton .= dolGetButtonTitle($langs->trans('NewAccountingMvt'), '', 'fa fa-plus-circle paddingleft', './card.php?action=create', '', $user->rights->accounting->mouvements->creer); +$url = './card.php?action=create'; +if (!empty($socid)) $url .= '&socid='.$socid; +$newcardbutton .= dolGetButtonTitle($langs->trans('NewAccountingMvt'), '', 'fa fa-plus-circle paddingleft', $url, '', $user->rights->accounting->mouvements->creer); print_barre_liste($title_page, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_accountancy', 0, $newcardbutton, '', $limit); diff --git a/htdocs/compta/bank/various_payment/list.php b/htdocs/compta/bank/various_payment/list.php index cfecfecffa5..527ab256f4a 100644 --- a/htdocs/compta/bank/various_payment/list.php +++ b/htdocs/compta/bank/various_payment/list.php @@ -254,7 +254,9 @@ if ($result) $newcardbutton = ''; if ($user->rights->banque->modifier) { - $newcardbutton .= dolGetButtonTitle($langs->trans('MenuNewVariousPayment'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/compta/bank/various_payment/card.php?action=create'); + $url = DOL_URL_ROOT.'/compta/bank/various_payment/card.php?action=create'; + if (!empty($socid)) $url .= '&socid='.$socid; + $newcardbutton .= dolGetButtonTitle($langs->trans('MenuNewVariousPayment'), '', 'fa fa-plus-circle', $url); } print '
'; diff --git a/htdocs/compta/localtax/list.php b/htdocs/compta/localtax/list.php index a8b37c3ef93..4107f1a808e 100644 --- a/htdocs/compta/localtax/list.php +++ b/htdocs/compta/localtax/list.php @@ -45,7 +45,9 @@ $localtax_static = new Localtax($db); $newcardbutton = ''; if ($user->rights->tax->charges->creer) { - $newcardbutton .= dolGetButtonTitle($langs->trans('NewLocalTaxPayment', ($ltt + 1)), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/compta/localtax/card.php?action=create&localTaxType='.$ltt); + $url = DOL_URL_ROOT.'/compta/localtax/card.php?action=create&localTaxType='.$ltt; + if (!empty($socid)) $url .= '&socid='.$socid; + $newcardbutton .= dolGetButtonTitle($langs->trans('NewLocalTaxPayment', ($ltt + 1)), '', 'fa fa-plus-circle', $url); } print load_fiche_titre($langs->transcountry($ltt == 2 ? "LT2Payments" : "LT1Payments", $mysoc->country_code), $newcardbutton, 'title_accountancy'); diff --git a/htdocs/compta/paiement/cheque/list.php b/htdocs/compta/paiement/cheque/list.php index e76936c71fd..a06601d9dd4 100644 --- a/htdocs/compta/paiement/cheque/list.php +++ b/htdocs/compta/paiement/cheque/list.php @@ -127,7 +127,9 @@ if ($resql) $newcardbutton = ''; if ($user->rights->banque->cheque) { - $newcardbutton .= dolGetButtonTitle($langs->trans('NewCheckDeposit'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/compta/paiement/cheque/card.php?action=new'); + $url = DOL_URL_ROOT.'/compta/paiement/cheque/card.php?action=new'; + if (!empty($socid)) $url .= '&socid='.$socid; + $newcardbutton .= dolGetButtonTitle($langs->trans('NewCheckDeposit'), '', 'fa fa-plus-circle', $url); } print ''; diff --git a/htdocs/compta/tva/list.php b/htdocs/compta/tva/list.php index 5b09da5305c..c5ebdcf50d4 100644 --- a/htdocs/compta/tva/list.php +++ b/htdocs/compta/tva/list.php @@ -149,8 +149,10 @@ if ($result) $newcardbutton = ''; if ($user->rights->tax->charges->creer) { - $newcardbutton .= dolGetButtonTitle($langs->trans('NewVATPayment', ($ltt + 1)), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/compta/tva/card.php?action=create'); - } + $url = DOL_URL_ROOT.'/compta/tva/card.php?action=create'; + if (!empty($socid)) $url .= '&socid='.$socid; + $newcardbutton .= dolGetButtonTitle($langs->trans('NewVATPayment', ($ltt + 1)), '', 'fa fa-plus-circle', $url); + } print ''; if ($optioncss != '') print ''; diff --git a/htdocs/contrat/list.php b/htdocs/contrat/list.php index e15d6467755..1d7cf438ce7 100644 --- a/htdocs/contrat/list.php +++ b/htdocs/contrat/list.php @@ -372,7 +372,9 @@ $massactionbutton = $form->selectMassAction('', $arrayofmassactions); $newcardbutton = ''; if ($user->rights->contrat->creer) { - $newcardbutton .= dolGetButtonTitle($langs->trans('NewContractSubscription'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/contrat/card.php?action=create'); + $url = DOL_URL_ROOT.'/contrat/card.php?action=create'; + if (!empty($socid)) $url .= '&socid='.$socid; + $newcardbutton .= dolGetButtonTitle($langs->trans('NewContractSubscription'), '', 'fa fa-plus-circle', $url); } print ''; diff --git a/htdocs/expensereport/list.php b/htdocs/expensereport/list.php index a21ed4d6612..44fbc14b241 100644 --- a/htdocs/expensereport/list.php +++ b/htdocs/expensereport/list.php @@ -464,7 +464,9 @@ if ($resql) $newcardbutton = ''; if ($user->rights->expensereport->creer) { - $newcardbutton .= dolGetButtonTitle($langs->trans('NewTrip'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/expensereport/card.php?action=create'); + $url = DOL_URL_ROOT.'/expensereport/card.php?action=create'; + if (!empty($socid)) $url .= '&socid='.$socid; + $newcardbutton .= dolGetButtonTitle($langs->trans('NewTrip'), '', 'fa fa-plus-circle', $url); } print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'trip', 0, $newcardbutton, '', $limit, 0, 0, 1); diff --git a/htdocs/fichinter/list.php b/htdocs/fichinter/list.php index 0204689b9b0..fcad99c975e 100644 --- a/htdocs/fichinter/list.php +++ b/htdocs/fichinter/list.php @@ -319,7 +319,10 @@ if ($resql) $massactionbutton = $form->selectMassAction('', $arrayofmassactions); $newcardbutton = ''; - $morehtmlcenter .= dolGetButtonTitle($langs->trans('NewIntervention'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/fichinter/card.php?action=create', '', $user->rights->ficheinter->creer); + + $url = DOL_URL_ROOT.'/fichinter/card.php?action=create'; + if (!empty($socid)) $url .= '&socid='.$socid; + $morehtmlcenter .= dolGetButtonTitle($langs->trans('NewIntervention'), '', 'fa fa-plus-circle', $url, '', $user->rights->ficheinter->creer); // Lines of title fields print ''."\n"; diff --git a/htdocs/loan/list.php b/htdocs/loan/list.php index fc0e766ed9b..a4faa006007 100644 --- a/htdocs/loan/list.php +++ b/htdocs/loan/list.php @@ -153,9 +153,10 @@ if ($resql) $newcardbutton = ''; if ($user->rights->loan->write) { - $newcardbutton .= dolGetButtonTitle($langs->trans('NewLoan'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/loan/card.php?action=create'); + $url = DOL_URL_ROOT.'/loan/card.php?action=create'; + if (!empty($socid)) $url .= '&socid='.$socid; + $newcardbutton .= dolGetButtonTitle($langs->trans('NewLoan'), '', 'fa fa-plus-circle', $url); } - print ''."\n"; if ($optioncss != '') print ''; print ''; diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php index a682d7ef383..af6cbb9a57f 100644 --- a/htdocs/projet/list.php +++ b/htdocs/projet/list.php @@ -451,7 +451,9 @@ $massactionbutton = $form->selectMassAction('', $arrayofmassactions); $newcardbutton = ''; if ($user->rights->projet->creer) { - $newcardbutton .= dolGetButtonTitle($langs->trans('NewProject'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/projet/card.php?action=create'); + $url = DOL_URL_ROOT.'/projet/card.php?action=create'; + if (!empty($socid)) $url .= '&socid='.$socid; + $newcardbutton .= dolGetButtonTitle($langs->trans('NewProject'), '', 'fa fa-plus-circle', $url); } print ''; diff --git a/htdocs/salaries/list.php b/htdocs/salaries/list.php index 6c4ee37a979..4c56579c0b5 100644 --- a/htdocs/salaries/list.php +++ b/htdocs/salaries/list.php @@ -156,7 +156,9 @@ if ($result) $newcardbutton = ''; if (!empty($user->rights->salaries->write)) { - $newcardbutton .= dolGetButtonTitle($langs->trans('NewSalaryPayment'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/salaries/card.php?action=create'); + $url = DOL_URL_ROOT.'/salaries/card.php?action=create'; + if (!empty($socid)) $url .= '&socid='.$socid; + $newcardbutton .= dolGetButtonTitle($langs->trans('NewSalaryPayment'), '', 'fa fa-plus-circle', $url); } print ''; diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php index 96b50a34bf8..2569abc28e7 100644 --- a/htdocs/societe/list.php +++ b/htdocs/societe/list.php @@ -612,7 +612,9 @@ if ($user->rights->societe->creer && $contextpage != 'poslist') if ($type == 'f') $label = 'NewSupplier'; } - $newcardbutton .= dolGetButtonTitle($langs->trans($label), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/societe/card.php?action=create'.$typefilter); + $url = DOL_URL_ROOT.'/societe/card.php?action=create'.$typefilter; + if (!empty($socid)) $url .= '&socid='.$socid; + $newcardbutton .= dolGetButtonTitle($langs->trans($label), '', 'fa fa-plus-circle', $url); } print ''; diff --git a/htdocs/ticket/list.php b/htdocs/ticket/list.php index c4c1cbadcc9..8f1021ffecd 100644 --- a/htdocs/ticket/list.php +++ b/htdocs/ticket/list.php @@ -569,7 +569,10 @@ if ($socid) print ''; if ($projectid) print ''; $newcardbutton = ''; -$newcardbutton .= dolGetButtonTitle($langs->trans('NewTicket'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/ticket/card.php?action=create'.($socid ? '&socid='.$socid : '').($projectid ? '&origin=projet_project&originid='.$projectid : ''), '', !empty($user->rights->ticket->write)); + +$url = DOL_URL_ROOT.'/ticket/card.php?action=create'.($socid ? '&socid='.$socid : '').($projectid ? '&origin=projet_project&originid='.$projectid : ''); +if (!empty($socid)) $url .= '&socid='.$socid; +$newcardbutton .= dolGetButtonTitle($langs->trans('NewTicket'), '', 'fa fa-plus-circle', $url, '', !empty($user->rights->ticket->write)); $picto = 'ticket'; if ($socid > 0) $picto = ''; diff --git a/htdocs/user/list.php b/htdocs/user/list.php index b51a486d58d..2e6adde0c66 100644 --- a/htdocs/user/list.php +++ b/htdocs/user/list.php @@ -304,7 +304,9 @@ $text = $langs->trans("ListOfUsers"); $newcardbutton = ''; if ($canadduser) { - $newcardbutton .= dolGetButtonTitle($langs->trans('NewUser'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/user/card.php?action=create'.($mode == 'employee' ? '&employee=1' : '').'&leftmenu='); + $url = DOL_URL_ROOT.'/user/card.php?action=create'.($mode == 'employee' ? '&employee=1' : '').'&leftmenu='; + if (!empty($socid)) $url .= '&socid='.$socid; + $newcardbutton .= dolGetButtonTitle($langs->trans('NewUser'), '', 'fa fa-plus-circle', $url); } print ''."\n";