From 0366e645d516191699b30188fa0028e27e80c0a3 Mon Sep 17 00:00:00 2001 From: Marc de Lima Lucio Date: Fri, 30 Mar 2018 16:54:38 +0200 Subject: [PATCH] NEW: generalize button to create object from list, for most of the lists --- htdocs/comm/propal/list.php | 8 +++++++- htdocs/commande/list.php | 8 +++++++- htdocs/compta/bank/various_payment/index.php | 4 +++- htdocs/compta/facture/list.php | 8 +++++++- htdocs/compta/paiement/cheque/list.php | 8 +++++++- htdocs/compta/prelevement/bons.php | 4 +++- htdocs/compta/salaries/index.php | 4 +++- htdocs/compta/sociales/index.php | 10 ++++++++-- htdocs/compta/tva/list.php | 7 ++++++- htdocs/contact/list.php | 8 +++++++- htdocs/contrat/list.php | 8 +++++++- htdocs/don/list.php | 4 +++- htdocs/expedition/list.php | 8 +++++++- htdocs/expensereport/list.php | 9 ++++++++- htdocs/fichinter/list.php | 8 +++++++- htdocs/fourn/commande/list.php | 9 +++++++-- htdocs/fourn/facture/list.php | 8 +++++++- htdocs/holiday/list.php | 5 ++++- htdocs/langs/en_US/compta.lang | 1 + htdocs/loan/index.php | 8 +++++++- htdocs/product/list.php | 12 +++++++++++- htdocs/product/stock/list.php | 8 +++++++- htdocs/projet/list.php | 8 +++++++- htdocs/projet/tasks/list.php | 8 +++++++- htdocs/societe/list.php | 19 ++++++++++++++++++- htdocs/supplier_proposal/list.php | 8 +++++++- 26 files changed, 173 insertions(+), 27 deletions(-) diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index de7715bdcf4..ab5c50d7056 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -395,6 +395,12 @@ if ($resql) if (in_array($massaction, array('presend','predelete','closed'))) $arrayofmassactions=array(); $massactionbutton=$form->selectMassAction('', $arrayofmassactions); + $newcardbutton=''; + if ($user->rights->propal->creer) + { + $newcardbutton=''.$langs->trans('NewPropal').''; + } + // Lignes des champs de filtre print '
'; if ($optioncss != '') print ''; @@ -406,7 +412,7 @@ if ($resql) print ''; print ''; - print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_commercial.png', 0, '', '', $limit); + print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_commercial.png', 0, $newcardbutton, '', $limit); $topicmail="SendPropalRef"; $modelmail="proposal_send"; diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index 784f44aad4c..1a29fe712ae 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -420,6 +420,12 @@ if ($resql) if (in_array($massaction, array('presend','predelete','createbills'))) $arrayofmassactions=array(); $massactionbutton=$form->selectMassAction('', $arrayofmassactions); + $newcardbutton=''; + if ($contextpage == 'orderlist' && $user->rights->commande->creer) + { + $newcardbutton=''.$langs->trans('NewOrder').''; + } + // Lines of title fields print ''; if ($optioncss != '') print ''; @@ -432,7 +438,7 @@ if ($resql) print ''; print ''; - print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_commercial.png', 0, '', '', $limit); + print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_commercial.png', 0, $newcardbutton, '', $limit); $topicmail="SendOrderRef"; $modelmail="order_send"; diff --git a/htdocs/compta/bank/various_payment/index.php b/htdocs/compta/bank/various_payment/index.php index 5e24463566c..aa47d714bd9 100644 --- a/htdocs/compta/bank/various_payment/index.php +++ b/htdocs/compta/bank/various_payment/index.php @@ -153,6 +153,8 @@ if ($result) if ($optioncss != '') $param.='&optioncss='.urlencode($optioncss); + $newcardbutton=''.$langs->trans('MenuNewVariousPayment').''; + print ''; if ($optioncss != '') print ''; @@ -163,7 +165,7 @@ if ($result) print ''; print ''; - print_barre_liste($langs->trans("VariousPayments"),$page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num, $totalnboflines, 'title_accountancy.png', 0, '', '', $limit); + print_barre_liste($langs->trans("VariousPayments"),$page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num, $totalnboflines, 'title_accountancy.png', 0, $newcardbutton, '', $limit); print '
'; print ''."\n"; diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index a3576a438aa..0d2adec10b2 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -590,6 +590,12 @@ if ($resql) if (in_array($massaction, array('presend','predelete'))) $arrayofmassactions=array(); $massactionbutton=$form->selectMassAction('', $arrayofmassactions); + $newcardbutton=''; + if($user->rights->facture->creer) + { + $newcardbutton=''.$langs->trans('NewBill').''; + } + $i = 0; print ''."\n"; @@ -603,7 +609,7 @@ if ($resql) print ''; print ''; - print_barre_liste($langs->trans('BillsCustomers').' '.($socid?' '.$soc->name:''), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_accountancy.png', 0, '', '', $limit); + print_barre_liste($langs->trans('BillsCustomers').' '.($socid?' '.$soc->name:''), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_accountancy.png', 0, $newcardbutton, '', $limit); $topicmail="SendBillRef"; $modelmail="facture_send"; diff --git a/htdocs/compta/paiement/cheque/list.php b/htdocs/compta/paiement/cheque/list.php index 76c52215281..532d2e4c9b8 100644 --- a/htdocs/compta/paiement/cheque/list.php +++ b/htdocs/compta/paiement/cheque/list.php @@ -131,6 +131,12 @@ if ($resql) if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage; if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit; + $newcardbutton=''; + if ($user->rights->banque->cheque) + { + $newcardbutton = ''.$langs->trans('NewCheckDeposit').''; + } + print ''; if ($optioncss != '') print ''; print ''; @@ -140,7 +146,7 @@ if ($resql) print ''; print ''; - print_barre_liste($langs->trans("MenuChequeDeposits"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_bank.png', '', '', $limit); + print_barre_liste($langs->trans("MenuChequeDeposits"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_bank.png', 0, $newcardbutton, '', $limit); $moreforfilter=''; diff --git a/htdocs/compta/prelevement/bons.php b/htdocs/compta/prelevement/bons.php index 9d3da39e5c3..31dfbd5b610 100644 --- a/htdocs/compta/prelevement/bons.php +++ b/htdocs/compta/prelevement/bons.php @@ -101,6 +101,8 @@ if ($result) $selectedfields=''; + $newcardbutton = ''.$langs->trans('NewStandingOrder').''; + // Lines of title fields print ''; if ($optioncss != '') print ''; @@ -112,7 +114,7 @@ if ($result) print ''; print ''; - print_barre_liste($langs->trans("WithdrawalsReceipts"), $page, $_SERVER["PHP_SELF"], $urladd, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_generic', 0, '', '', $limit); + print_barre_liste($langs->trans("WithdrawalsReceipts"), $page, $_SERVER["PHP_SELF"], $urladd, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_generic', 0, $newcardbutton, '', $limit); $moreforfilter=''; diff --git a/htdocs/compta/salaries/index.php b/htdocs/compta/salaries/index.php index 4cad9117040..f9b9adf616c 100644 --- a/htdocs/compta/salaries/index.php +++ b/htdocs/compta/salaries/index.php @@ -150,6 +150,8 @@ if ($result) if ($typeid) $param.='&typeid='.$typeid; if ($optioncss != '') $param.='&optioncss='.$optioncss; + $newcardbutton=''.$langs->trans('NewSalaryPayment').''; + print ''; if ($optioncss != '') print ''; print ''; @@ -159,7 +161,7 @@ if ($result) print ''; print ''; - print_barre_liste($langs->trans("SalariesPayments"),$page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num, $totalnboflines, 'title_accountancy.png', 0, '', '', $limit); + print_barre_liste($langs->trans("SalariesPayments"),$page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num, $totalnboflines, 'title_accountancy.png', 0, $newcardbutton, '', $limit); print '
'; print '
'."\n"; diff --git a/htdocs/compta/sociales/index.php b/htdocs/compta/sociales/index.php index 281a0afb377..3850ddfe5c5 100644 --- a/htdocs/compta/sociales/index.php +++ b/htdocs/compta/sociales/index.php @@ -146,6 +146,12 @@ if ($resql) if ($year) $param.='&year='.$year; if ($typeid) $param.='&typeid='.$typeid; + $newcardbutton=''; + if($user->rights->tax->charges->creer) + { + $newcardbutton=''.$langs->trans('MenuNewSocialContribution').''; + } + print ''; if ($optioncss != '') print ''; print ''; @@ -158,11 +164,11 @@ if ($resql) if ($year) { $center=($year?"".img_previous()." ".$langs->trans("Year")." $year ".img_next()."":""); - print_barre_liste($langs->trans("SocialContributions"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $center, $num, $totalnboflines, 'title_accountancy.png', 0, '', '', $limit); + print_barre_liste($langs->trans("SocialContributions"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $center, $num, $totalnboflines, 'title_accountancy.png', 0, $newcardbutton, '', $limit); } else { - print_barre_liste($langs->trans("SocialContributions"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $totalnboflines, 'title_accountancy.png', 0, '', '', $limit); + print_barre_liste($langs->trans("SocialContributions"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $totalnboflines, 'title_accountancy.png', 0, $newcardbutton, '', $limit); } if (empty($mysoc->country_id) && empty($mysoc->country_code)) diff --git a/htdocs/compta/tva/list.php b/htdocs/compta/tva/list.php index 8f2044369a1..056e16b4d5b 100644 --- a/htdocs/compta/tva/list.php +++ b/htdocs/compta/tva/list.php @@ -148,6 +148,11 @@ if ($result) if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit; if ($typeid) $param.='&typeid='.$typeid; + $newcardbutton=''; + if ($user->rights->tax->charges->creer) + { + $newcardbutton=''.$langs->trans('NewVATPayment').''; + } print ''; if ($optioncss != '') print ''; @@ -157,7 +162,7 @@ if ($result) print ''; print ''; - print_barre_liste($langs->trans("VATPayments"),$page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num,$totalnboflines, 'title_accountancy', 0, '', '', $limit); + print_barre_liste($langs->trans("VATPayments"),$page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num,$totalnboflines, 'title_accountancy', 0, $newcardbutton, '', $limit); print '
'; print '
'; diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index e2ad6031937..1351afeba4e 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -411,6 +411,12 @@ if ($user->rights->societe->supprimer) $arrayofmassactions['predelete']=$langs-> if (in_array($massaction, array('presend','predelete'))) $arrayofmassactions=array(); $massactionbutton=$form->selectMassAction('', $arrayofmassactions); +$newcardbutton=''; +if ($user->rights->societe->contact->creer) +{ + $newcardbutton=''.$langs->trans('NewContactAddress').''; +} + print ''; if ($optioncss != '') print ''; print ''; @@ -420,7 +426,7 @@ print ''; print ''; print ''; -print_barre_liste($titre, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_companies.png', 0, '', '', $limit); +print_barre_liste($titre, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_companies.png', 0, $newcardbutton, '', $limit); $topicmail="Information"; $modelmail="contact"; diff --git a/htdocs/contrat/list.php b/htdocs/contrat/list.php index 55dfacdf2c5..4b634042df1 100644 --- a/htdocs/contrat/list.php +++ b/htdocs/contrat/list.php @@ -370,6 +370,12 @@ if ($user->rights->contrat->supprimer) $arrayofmassactions['predelete']=$langs-> if (in_array($massaction, array('presend','predelete'))) $arrayofmassactions=array(); $massactionbutton=$form->selectMassAction('', $arrayofmassactions); +$newcardbutton=''; +if ($user->rights->contrat->creer) +{ + $newcardbutton=''.$langs->trans('NewContractSubscription').''; +} + print ''; if ($optioncss != '') print ''; print ''; @@ -379,7 +385,7 @@ print ''; print ''; print ''; -print_barre_liste($langs->trans("ListOfContracts"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $totalnboflines, 'title_commercial.png', 0, '', '', $limit); +print_barre_liste($langs->trans("ListOfContracts"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $totalnboflines, 'title_commercial.png', 0, $newcardbutton, '', $limit); $topicmail="SendContractRef"; $modelmail="contract"; diff --git a/htdocs/don/list.php b/htdocs/don/list.php index 46692c9025b..9c5aec63951 100644 --- a/htdocs/don/list.php +++ b/htdocs/don/list.php @@ -131,7 +131,9 @@ if ($resql) //if ($page > 0) $param.= '&page='.$page; if ($optioncss != '') $param.='&optioncss='.$optioncss; - print_barre_liste($langs->trans("Donations"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num,$nbtotalofrecords); + $newcardbutton=''.$langs->trans('NewDonation').''; + + print_barre_liste($langs->trans("Donations"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num,$nbtotalofrecords, 'title_generic.png', 0, $newcardbutton); print ''."\n"; if ($optioncss != '') print ''; diff --git a/htdocs/expedition/list.php b/htdocs/expedition/list.php index d8e9925c08f..3058f0364fe 100644 --- a/htdocs/expedition/list.php +++ b/htdocs/expedition/list.php @@ -265,6 +265,12 @@ if ($resql) //$massactionbutton=$form->selectMassAction('', $massaction == 'presend' ? array() : array('presend'=>$langs->trans("SendByMail"), 'builddoc'=>$langs->trans("PDFMerge"))); + $newcardbutton=''; + if ($user->rights->expedition->creer) + { + $newcardbutton=''.$langs->trans('NewSending').''; + } + $i = 0; print ''."\n"; if ($optioncss != '') print ''; @@ -275,7 +281,7 @@ if ($resql) print ''; print ''; - print_barre_liste($langs->trans('ListOfSendings'), $page, $_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num, $nbtotalofrecords, '', 0, '', '', $limit); + print_barre_liste($langs->trans('ListOfSendings'), $page, $_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num, $nbtotalofrecords, '', 0, $newcardbutton, '', $limit); if ($sall) { diff --git a/htdocs/expensereport/list.php b/htdocs/expensereport/list.php index 097a912b6c1..7c8e8199b50 100644 --- a/htdocs/expensereport/list.php +++ b/htdocs/expensereport/list.php @@ -466,7 +466,14 @@ if ($resql) else { $title = $langs->trans("ListTripsAndExpenses"); - print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_generic.png', 0, '', '', $limit); + + $newcardbutton=''; + if ($user->rights->expensereport->creer) + { + $newcardbutton=''.$langs->trans('NewTrip').''; + } + + print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_generic.png', 0, $newcardbutton, '', $limit); } $topicmail="SendExpenseReport"; diff --git a/htdocs/fichinter/list.php b/htdocs/fichinter/list.php index 7fc7ca244de..9320a6c2df1 100644 --- a/htdocs/fichinter/list.php +++ b/htdocs/fichinter/list.php @@ -272,6 +272,12 @@ if ($resql) if (in_array($massaction, array('presend','predelete'))) $arrayofmassactions=array(); $massactionbutton=$form->selectMassAction('', $arrayofmassactions); + $newcardbutton=''; + if ($user->rights->ficheinter->creer) + { + $newcardbutton=''.$langs->trans('NewIntervention').''; + } + // Lines of title fields print ''."\n"; if ($optioncss != '') print ''; @@ -283,7 +289,7 @@ if ($resql) print ''; print ''; - print_barre_liste($title, $page, $_SERVER['PHP_SELF'], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_commercial.png', 0, '', '', $limit); + print_barre_liste($title, $page, $_SERVER['PHP_SELF'], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_commercial.png', 0, $newcardbutton, '', $limit); $topicmail="Information"; $modelmail="intervention"; diff --git a/htdocs/fourn/commande/list.php b/htdocs/fourn/commande/list.php index 760c80737f4..95ec5e835d6 100644 --- a/htdocs/fourn/commande/list.php +++ b/htdocs/fourn/commande/list.php @@ -646,6 +646,12 @@ if ($resql) if ($user->rights->fournisseur->commande->supprimer) $arrayofmassactions['predelete']=$langs->trans("Delete"); if (in_array($massaction, array('presend','predelete','createbills'))) $arrayofmassactions=array(); $massactionbutton=$form->selectMassAction('', $arrayofmassactions); + + $newcardbutton=''; + if($user->rights->fournisseur->commande->creer) + { + $newcardbutton=''.$langs->trans('NewOrder').''; + } // Lignes des champs de filtre print ''; @@ -658,8 +664,7 @@ if ($resql) print ''; print ''; print ''; - - print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_commercial.png', 0, '', '', $limit); + print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_commercial.png', 0, $newcardbutton, '', $limit); $topicmail="SendOrderRef"; $modelmail="order_supplier_send"; diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index efe029d7adf..f46fe9c83eb 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -474,6 +474,12 @@ if ($resql) if (in_array($massaction, array('presend','predelete','createbills'))) $arrayofmassactions=array(); $massactionbutton=$form->selectMassAction('', $arrayofmassactions); + $newcardbutton=''; + if ($user->rights->fournisseur->facture->creer) + { + $newcardbutton=''.$langs->trans('NewBill').''; + } + $i = 0; print ''."\n"; if ($optioncss != '') print ''; @@ -486,7 +492,7 @@ if ($resql) print ''; print ''; - print_barre_liste($langs->trans("BillsSuppliers").($socid?' '.$soc->name:''), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_accountancy', 0, '', '', $limit); + print_barre_liste($langs->trans("BillsSuppliers").($socid?' '.$soc->name:''), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_accountancy', 0, $newcardbutton, '', $limit); $topicmail="SendBillRef"; $modelmail="supplier_invoice_send"; diff --git a/htdocs/holiday/list.php b/htdocs/holiday/list.php index 03f4108e02e..e00c182f949 100644 --- a/htdocs/holiday/list.php +++ b/htdocs/holiday/list.php @@ -377,7 +377,10 @@ else $nbtotalofrecords = count($holiday->holiday); //print $num; //print count($holiday->holiday); - print_barre_liste($langs->trans("ListeCP"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_hrm.png', 0, '', '', $limit); + + $newcardbutton=''.$langs->trans('MenuAddCP').''; + + print_barre_liste($langs->trans("ListeCP"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_hrm.png', 0, $newcardbutton, '', $limit); $topicmail="Information"; $modelmail="leaverequest"; diff --git a/htdocs/langs/en_US/compta.lang b/htdocs/langs/en_US/compta.lang index 83f2b96c839..25e2849b949 100644 --- a/htdocs/langs/en_US/compta.lang +++ b/htdocs/langs/en_US/compta.lang @@ -103,6 +103,7 @@ LT2PaymentsES=IRPF Payments VATPayment=Sales tax payment VATPayments=Sales tax payments VATRefund=Sales tax refund +NewVATPayment=New sales tax payment Refund=Refund SocialContributionsPayments=Social/fiscal taxes payments ShowVatPayment=Show VAT payment diff --git a/htdocs/loan/index.php b/htdocs/loan/index.php index d1436287db3..24ea1ab72f9 100644 --- a/htdocs/loan/index.php +++ b/htdocs/loan/index.php @@ -111,6 +111,12 @@ if ($resql) if ($search_amount) $param.="&search_amount=".urlencode($search_amount_ht); if ($optioncss != '') $param.='&optioncss='.urlencode($optioncss); + $newcardbutton=''; + if ($user->rights->loan->write) + { + $newcardbutton=''.$langs->trans('NewLoan').''; + } + print ''."\n"; if ($optioncss != '') print ''; print ''; @@ -120,7 +126,7 @@ if ($resql) print ''; print ''; - print_barre_liste($langs->trans("Loans"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_accountancy.png', 0, '', '', $limit); + print_barre_liste($langs->trans("Loans"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_accountancy.png', 0, $newcardbutton, '', $limit); print '
'; print '
'."\n"; diff --git a/htdocs/product/list.php b/htdocs/product/list.php index e31a88e6f5c..a21648e140d 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -412,6 +412,16 @@ else if (in_array($massaction, array('presend','predelete'))) $arrayofmassactions=array(); $massactionbutton=$form->selectMassAction('', $arrayofmassactions); + $newcardbutton=''; + $rightskey='produit'; + if($type == Product::TYPE_SERVICE) $rightskey='service'; + if($user->rights->{$rightskey}->creer) + { + $label='NewProduct'; + if($type == Product::TYPE_SERVICE) $label='NewService'; + $newcardbutton=''.$langs->trans($label).''; + } + print ''; if ($optioncss != '') print ''; print ''; @@ -423,7 +433,7 @@ else print ''; if (empty($arrayfields['p.fk_product_type']['checked'])) print ''; - print_barre_liste($texte, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_products.png', 0, '', '', $limit); + print_barre_liste($texte, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_products.png', 0, $newcardbutton, '', $limit); $topicmail="Information"; $modelmail="product"; diff --git a/htdocs/product/stock/list.php b/htdocs/product/stock/list.php index 58ea5eadc21..34121148544 100644 --- a/htdocs/product/stock/list.php +++ b/htdocs/product/stock/list.php @@ -130,6 +130,12 @@ if ($result) if ($search_status) $param.="&search_status=".urlencode($search_status); if ($sall) $param.="&sall=".urlencode($sall); + $newcardbutton=''; + if ($user->rights->stock->creer) + { + $newcardbutton=''.$langs->trans('MenuNewWarehouse').''; + } + print ''; print ''; print ''; @@ -137,7 +143,7 @@ if ($result) print ''; print ''; - print_barre_liste($langs->trans("ListOfWarehouses"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $totalnboflines, 'title_generic.png', 0, '', '', $limit); + print_barre_liste($langs->trans("ListOfWarehouses"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $totalnboflines, 'title_generic.png', 0, $newcardbutton, '', $limit); if ($sall) { diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php index 22887c5e42d..688628e4884 100644 --- a/htdocs/projet/list.php +++ b/htdocs/projet/list.php @@ -441,6 +441,12 @@ if (in_array($massaction, array('presend','predelete'))) $arrayofmassactions=arr $massactionbutton=$form->selectMassAction('', $arrayofmassactions); +$newcardbutton=''; +if ($user->rights->projet->creer) +{ + $newcardbutton = ''.$langs->trans('NewProject').''; +} + print ''; if ($optioncss != '') print ''; print ''; @@ -452,7 +458,7 @@ print ''; print ''; print ''; -print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_project', 0, '', '', $limit); +print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_project', 0, $newcardbutton, '', $limit); // Show description of content print '
'; diff --git a/htdocs/projet/tasks/list.php b/htdocs/projet/tasks/list.php index 6ad2e51425f..1bdea8e3591 100644 --- a/htdocs/projet/tasks/list.php +++ b/htdocs/projet/tasks/list.php @@ -391,6 +391,12 @@ if ($user->rights->societe->supprimer) $arrayofmassactions['predelete']=$langs-> if (in_array($massaction, array('presend','predelete'))) $arrayofmassactions=array(); $massactionbutton=$form->selectMassAction('', $arrayofmassactions); +$newcardbutton=''; +if ($user->rights->projet->creer) +{ + $newcardbutton = ''.$langs->trans('NewTask').''; +} + print ''; if ($optioncss != '') print ''; print ''; @@ -402,7 +408,7 @@ print ''; print ''; print ''; -print_barre_liste($title, $page, $_SERVER["PHP_SELF"], "", $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_project', 0, '', '', $limit); +print_barre_liste($title, $page, $_SERVER["PHP_SELF"], "", $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_project', 0, $newcardbutton, '', $limit); // Show description of content print '
'; diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php index d56e5b1e22a..710d997580c 100644 --- a/htdocs/societe/list.php +++ b/htdocs/societe/list.php @@ -573,6 +573,23 @@ if ($user->rights->societe->supprimer) $arrayofmassactions['predelete']=$langs-> if (in_array($massaction, array('presend','predelete'))) $arrayofmassactions=array(); $massactionbutton=$form->selectMassAction('', $arrayofmassactions); +$newcardbutton=''; +if ($user->rights->societe->creer) +{ + $typefilter=''; + $label='MenuNewThirdParty'; + + if(! empty($type)) + { + $typefilter = '&type='.$type; + if($type == 'p') $label='MenuNewProspect'; + if($type == 'c') $label='MenuNewCustomer'; + if($type == 'f') $label='NewSupplier'; + } + + $newcardbutton = ''.$langs->trans($label).''; +} + print ''; if ($optioncss != '') print ''; print ''; @@ -581,7 +598,7 @@ print ''; print ''; print ''; -print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_companies', 0, '', '', $limit); +print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_companies', 0, $newcardbutton, '', $limit); $langs->load("other"); $textprofid=array(); diff --git a/htdocs/supplier_proposal/list.php b/htdocs/supplier_proposal/list.php index 685e9531072..fd9ac1a593f 100644 --- a/htdocs/supplier_proposal/list.php +++ b/htdocs/supplier_proposal/list.php @@ -387,6 +387,12 @@ if ($resql) if (in_array($massaction, array('presend','predelete'))) $arrayofmassactions=array(); $massactionbutton=$form->selectMassAction('', $arrayofmassactions); + $newcardbutton=''; + if($user->rights->supplier_proposal->creer) + { + $newcardbutton=''.$langs->trans('NewAskPrice').''; + } + // Lignes des champs de filtre print ''; if ($optioncss != '') print ''; @@ -397,7 +403,7 @@ if ($resql) print ''; print ''; - print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_commercial.png', 0, '', '', $limit); + print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_commercial.png', 0, $newcardbutton, '', $limit); $topicmail="SendSupplierProposalRef"; $modelmail="supplier_proposal_send";