Make button visiblity identical on most lists

This commit is contained in:
Sekan, Tobias 2020-09-18 10:46:23 +02:00
parent 1b04ef8aad
commit dc4250aed7
19 changed files with 83 additions and 120 deletions

View File

@ -481,12 +481,10 @@ if ($resql)
$massactionbutton = $form->selectMassAction('', $arrayofmassactions); $massactionbutton = $form->selectMassAction('', $arrayofmassactions);
$newcardbutton = ''; $newcardbutton = '';
if ($user->rights->propal->creer)
{ $url = 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;
if (!empty($socid)) $url .= '&socid='.$socid; $newcardbutton .= dolGetButtonTitle($langs->trans('NewPropal'), '', 'fa fa-plus-circle', $url, '', $user->rights->propal->creer);
$newcardbutton .= dolGetButtonTitle($langs->trans('NewPropal'), '', 'fa fa-plus-circle', $url);
}
// Fields title search // Fields title search
print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">'; print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">';

View File

@ -484,12 +484,10 @@ if ($resql)
$massactionbutton = $form->selectMassAction('', $arrayofmassactions); $massactionbutton = $form->selectMassAction('', $arrayofmassactions);
$newcardbutton = ''; $newcardbutton = '';
if ($contextpage == 'orderlist' && $user->rights->commande->creer)
{ $url = DOL_URL_ROOT.'/commande/card.php?action=create';
$url = DOL_URL_ROOT.'/commande/card.php?action=create'; if (!empty($socid)) $url .= '&socid='.$socid;
if (!empty($socid)) $url .= '&socid='.$socid; $newcardbutton .= dolGetButtonTitle($langs->trans('NewOrder'), '', 'fa fa-plus-circle', $url, '', $contextpage == 'orderlist' && $user->rights->commande->creer);
$newcardbutton .= dolGetButtonTitle($langs->trans('NewOrder'), '', 'fa fa-plus-circle', $url);
}
// Lines of title fields // Lines of title fields
print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">'; print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">';

View File

@ -252,12 +252,10 @@ if ($result)
if ($optioncss != '') $param .= '&amp;optioncss='.urlencode($optioncss); if ($optioncss != '') $param .= '&amp;optioncss='.urlencode($optioncss);
$newcardbutton = ''; $newcardbutton = '';
if ($user->rights->banque->modifier)
{ $url = 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;
if (!empty($socid)) $url .= '&socid='.$socid; $newcardbutton .= dolGetButtonTitle($langs->trans('MenuNewVariousPayment'), '', 'fa fa-plus-circle', $url, '' $user->rights->banque->modifier);
$newcardbutton .= dolGetButtonTitle($langs->trans('MenuNewVariousPayment'), '', 'fa fa-plus-circle', $url);
}
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">'; print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';

View File

@ -675,12 +675,10 @@ if ($resql)
$massactionbutton = $form->selectMassAction('', $arrayofmassactions); $massactionbutton = $form->selectMassAction('', $arrayofmassactions);
$newcardbutton = ''; $newcardbutton = '';
if ($user->rights->facture->creer && $contextpage != 'poslist')
{ $url = 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;
if (!empty($socid)) $url .= '&socid='.$socid; $newcardbutton .= dolGetButtonTitle($langs->trans('NewBill'), '', 'fa fa-plus-circle', $url, '', $user->rights->facture->creer && $contextpage != 'poslist');
$newcardbutton .= dolGetButtonTitle($langs->trans('NewBill'), '', 'fa fa-plus-circle', $url);
}
$i = 0; $i = 0;
print '<form method="POST" name="searchFormList" action="'.$_SERVER["PHP_SELF"].'">'."\n"; print '<form method="POST" name="searchFormList" action="'.$_SERVER["PHP_SELF"].'">'."\n";

View File

@ -43,12 +43,10 @@ llxHeader();
$localtax_static = new Localtax($db); $localtax_static = new Localtax($db);
$newcardbutton = ''; $newcardbutton = '';
if ($user->rights->tax->charges->creer)
{ $url = 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;
if (!empty($socid)) $url .= '&socid='.$socid; $newcardbutton .= dolGetButtonTitle($langs->trans('NewLocalTaxPayment', ($ltt + 1)), '', 'fa fa-plus-circle', $url, '', $user->rights->tax->charges->creer);
$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'); print load_fiche_titre($langs->transcountry($ltt == 2 ? "LT2Payments" : "LT1Payments", $mysoc->country_code), $newcardbutton, 'title_accountancy');

View File

@ -125,12 +125,10 @@ if ($resql)
if ($limit > 0 && $limit != $conf->liste_limit) $param .= '&limit='.$limit; if ($limit > 0 && $limit != $conf->liste_limit) $param .= '&limit='.$limit;
$newcardbutton = ''; $newcardbutton = '';
if ($user->rights->banque->cheque)
{ $url = 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;
if (!empty($socid)) $url .= '&socid='.$socid; $newcardbutton .= dolGetButtonTitle($langs->trans('NewCheckDeposit'), '', 'fa fa-plus-circle', $url, '', $user->rights->banque->cheque);
$newcardbutton .= dolGetButtonTitle($langs->trans('NewCheckDeposit'), '', 'fa fa-plus-circle', $url);
}
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">'; print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">'; if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';

View File

@ -147,12 +147,10 @@ if ($result)
if ($typeid) $param .= '&amp;typeid='.$typeid; if ($typeid) $param .= '&amp;typeid='.$typeid;
$newcardbutton = ''; $newcardbutton = '';
if ($user->rights->tax->charges->creer)
{ $url = 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;
if (!empty($socid)) $url .= '&socid='.$socid; $newcardbutton .= dolGetButtonTitle($langs->trans('NewVATPayment', ($ltt + 1)), '', 'fa fa-plus-circle', $url, '', $user->rights->tax->charges->creer);
$newcardbutton .= dolGetButtonTitle($langs->trans('NewVATPayment', ($ltt + 1)), '', 'fa fa-plus-circle', $url);
}
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">'; print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">'; if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';

View File

@ -370,12 +370,10 @@ if (in_array($massaction, array('presend', 'predelete'))) $arrayofmassactions =
$massactionbutton = $form->selectMassAction('', $arrayofmassactions); $massactionbutton = $form->selectMassAction('', $arrayofmassactions);
$newcardbutton = ''; $newcardbutton = '';
if ($user->rights->contrat->creer)
{ $url = DOL_URL_ROOT.'/contrat/card.php?action=create';
$url = DOL_URL_ROOT.'/contrat/card.php?action=create'; if (!empty($socid)) $url .= '&socid='.$socid;
if (!empty($socid)) $url .= '&socid='.$socid; $newcardbutton .= dolGetButtonTitle($langs->trans('NewContractSubscription'), '', 'fa fa-plus-circle', $url, '', $user->rights->contrat->creer);
$newcardbutton .= dolGetButtonTitle($langs->trans('NewContractSubscription'), '', 'fa fa-plus-circle', $url);
}
print '<form method="POST" action="'.$_SERVER['PHP_SELF'].'">'; print '<form method="POST" action="'.$_SERVER['PHP_SELF'].'">';
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">'; if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';

View File

@ -360,14 +360,12 @@ if ($resql)
$massactionbutton = $form->selectMassAction('', $arrayofmassactions); $massactionbutton = $form->selectMassAction('', $arrayofmassactions);
$newcardbutton = ''; $newcardbutton = '';
if ($user->rights->expedition->creer)
{ // Currently: a sending can't create from sending list
// Currently: a sending can't create from sending list // $url = DOL_URL_ROOT.'/expedition/card.php?action=create';
// $url = DOL_URL_ROOT.'/expedition/card.php?action=create'; // if (!empty($socid)) $url .= '&socid='.$socid;
// if (!empty($socid)) $url .= '&socid='.$socid; // $newcardbutton .= dolGetButtonTitle($langs->trans('NewSending'), '', 'fa fa-plus-circle', $url, '', $user->rights->expedition->creer);
// $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', '' , $user->rights->expedition->creer);
$newcardbutton .= dolGetButtonTitle($langs->trans('NewSending'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/expedition/card.php?action=create2');
}
$i = 0; $i = 0;
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">'."\n"; print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">'."\n";

View File

@ -462,12 +462,10 @@ if ($resql)
$title = $langs->trans("ListTripsAndExpenses"); $title = $langs->trans("ListTripsAndExpenses");
$newcardbutton = ''; $newcardbutton = '';
if ($user->rights->expensereport->creer)
{ $url = DOL_URL_ROOT.'/expensereport/card.php?action=create';
$url = DOL_URL_ROOT.'/expensereport/card.php?action=create'; if (!empty($socid)) $url .= '&socid='.$socid;
if (!empty($socid)) $url .= '&socid='.$socid; $newcardbutton .= dolGetButtonTitle($langs->trans('NewTrip'), '', 'fa fa-plus-circle', $url, '', $user->rights->expensereport->creer);
$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); print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'trip', 0, $newcardbutton, '', $limit, 0, 0, 1);
} }

View File

@ -650,12 +650,10 @@ if ($resql)
$massactionbutton = $form->selectMassAction('', $arrayofmassactions); $massactionbutton = $form->selectMassAction('', $arrayofmassactions);
$newcardbutton = ''; $newcardbutton = '';
if ($user->rights->fournisseur->commande->creer)
{ $url = 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;
if (!empty($socid)) $url .= '&socid='.$socid; $newcardbutton .= dolGetButtonTitle($langs->trans('NewOrder'), '', 'fa fa-plus-circle', $url, '', $user->rights->fournisseur->commande->creer);
$newcardbutton .= dolGetButtonTitle($langs->trans('NewOrder'), '', 'fa fa-plus-circle', $url);
}
// Fields title search // Fields title search
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">'; print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';

View File

@ -509,12 +509,10 @@ if ($resql)
$massactionbutton = $form->selectMassAction('', $arrayofmassactions); $massactionbutton = $form->selectMassAction('', $arrayofmassactions);
$newcardbutton = ''; $newcardbutton = '';
if ($user->rights->fournisseur->facture->creer)
{ $url = 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;
if (!empty($socid)) $url .= '&socid='.$socid; $newcardbutton .= dolGetButtonTitle($langs->trans('NewBill'), '', 'fa fa-plus-circle', $url, '', $user->rights->fournisseur->facture->creer);
$newcardbutton .= dolGetButtonTitle($langs->trans('NewBill'), '', 'fa fa-plus-circle', $url);
}
$i = 0; $i = 0;
print '<form method="POST" name="searchFormList" action="'.$_SERVER["PHP_SELF"].'">'."\n"; print '<form method="POST" name="searchFormList" action="'.$_SERVER["PHP_SELF"].'">'."\n";

View File

@ -151,12 +151,11 @@ if ($resql)
if ($optioncss != '') $param .= '&optioncss='.urlencode($optioncss); if ($optioncss != '') $param .= '&optioncss='.urlencode($optioncss);
$newcardbutton = ''; $newcardbutton = '';
if ($user->rights->loan->write)
{ $url = DOL_URL_ROOT.'/loan/card.php?action=create';
$url = DOL_URL_ROOT.'/loan/card.php?action=create'; if (!empty($socid)) $url .= '&socid='.$socid;
if (!empty($socid)) $url .= '&socid='.$socid; $newcardbutton .= dolGetButtonTitle($langs->trans('NewLoan'), '', 'fa fa-plus-circle', $url, '', $user->rights->loan->write);
$newcardbutton .= dolGetButtonTitle($langs->trans('NewLoan'), '', 'fa fa-plus-circle', $url);
}
print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">'."\n"; print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">'."\n";
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">'; if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
print '<input type="hidden" name="token" value="'.newToken().'">'; print '<input type="hidden" name="token" value="'.newToken().'">';

View File

@ -449,12 +449,10 @@ if (in_array($massaction, array('presend', 'predelete'))) $arrayofmassactions =
$massactionbutton = $form->selectMassAction('', $arrayofmassactions); $massactionbutton = $form->selectMassAction('', $arrayofmassactions);
$newcardbutton = ''; $newcardbutton = '';
if ($user->rights->projet->creer)
{ $url = DOL_URL_ROOT.'/projet/card.php?action=create';
$url = DOL_URL_ROOT.'/projet/card.php?action=create'; if (!empty($socid)) $url .= '&socid='.$socid;
if (!empty($socid)) $url .= '&socid='.$socid; $newcardbutton .= dolGetButtonTitle($langs->trans('NewProject'), '', 'fa fa-plus-circle', $url, '', $user->rights->projet->creer);
$newcardbutton .= dolGetButtonTitle($langs->trans('NewProject'), '', 'fa fa-plus-circle', $url);
}
print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">'; print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">';
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">'; if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';

View File

@ -154,12 +154,10 @@ if ($result)
if ($optioncss != '') $param .= '&amp;optioncss='.$optioncss; if ($optioncss != '') $param .= '&amp;optioncss='.$optioncss;
$newcardbutton = ''; $newcardbutton = '';
if (!empty($user->rights->salaries->write))
{ $url = DOL_URL_ROOT.'/salaries/card.php?action=create';
$url = DOL_URL_ROOT.'/salaries/card.php?action=create'; if (!empty($socid)) $url .= '&socid='.$socid;
if (!empty($socid)) $url .= '&socid='.$socid; $newcardbutton .= dolGetButtonTitle($langs->trans('NewSalaryPayment'), '', 'fa fa-plus-circle', $url, '', $user->rights->salaries->write);
$newcardbutton .= dolGetButtonTitle($langs->trans('NewSalaryPayment'), '', 'fa fa-plus-circle', $url);
}
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">'; print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">'; if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';

View File

@ -599,24 +599,21 @@ if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'pr
$massactionbutton = $form->selectMassAction('', $arrayofmassactions); $massactionbutton = $form->selectMassAction('', $arrayofmassactions);
$newcardbutton = ''; $newcardbutton = '';
if ($user->rights->societe->creer && $contextpage != 'poslist') $typefilter = '';
$label = 'MenuNewThirdParty';
if (!empty($type))
{ {
$typefilter = ''; $typefilter = '&amp;type='.$type;
$label = 'MenuNewThirdParty'; if ($type == 'p') $label = 'MenuNewProspect';
if ($type == 'c') $label = 'MenuNewCustomer';
if (!empty($type)) if ($type == 'f') $label = 'NewSupplier';
{
$typefilter = '&amp;type='.$type;
if ($type == 'p') $label = 'MenuNewProspect';
if ($type == 'c') $label = 'MenuNewCustomer';
if ($type == 'f') $label = 'NewSupplier';
}
$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);
} }
$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, '', $user->rights->societe->creer && $contextpage != 'poslist');
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'" name="formfilter" autocomplete="off">'; print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'" name="formfilter" autocomplete="off">';
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">'; if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
print '<input type="hidden" name="token" value="'.newToken().'">'; print '<input type="hidden" name="token" value="'.newToken().'">';

View File

@ -415,12 +415,10 @@ if ($resql)
$massactionbutton = $form->selectMassAction('', $arrayofmassactions); $massactionbutton = $form->selectMassAction('', $arrayofmassactions);
$newcardbutton = ''; $newcardbutton = '';
if ($user->rights->supplier_proposal->creer)
{ $url = 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;
if (!empty($socid)) $url .= '&socid='.$socid; $newcardbutton .= dolGetButtonTitle($langs->trans('NewAskPrice'), '', 'fa fa-plus-circle', $url, '', $user->rights->supplier_proposal->creer);
$newcardbutton .= dolGetButtonTitle($langs->trans('NewAskPrice'), '', 'fa fa-plus-circle', $url);
}
// Fields title search // Fields title search
print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">'; print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">';

View File

@ -572,7 +572,7 @@ $newcardbutton = '';
$url = DOL_URL_ROOT.'/ticket/card.php?action=create'.($socid ? '&socid='.$socid : '').($projectid ? '&origin=projet_project&originid='.$projectid : ''); $url = DOL_URL_ROOT.'/ticket/card.php?action=create'.($socid ? '&socid='.$socid : '').($projectid ? '&origin=projet_project&originid='.$projectid : '');
if (!empty($socid)) $url .= '&socid='.$socid; if (!empty($socid)) $url .= '&socid='.$socid;
$newcardbutton .= dolGetButtonTitle($langs->trans('NewTicket'), '', 'fa fa-plus-circle', $url, '', !empty($user->rights->ticket->write)); $newcardbutton .= dolGetButtonTitle($langs->trans('NewTicket'), '', 'fa fa-plus-circle', $url, '', $user->rights->ticket->write);
$picto = 'ticket'; $picto = 'ticket';
if ($socid > 0) $picto = ''; if ($socid > 0) $picto = '';

View File

@ -302,12 +302,9 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
$text = $langs->trans("ListOfUsers"); $text = $langs->trans("ListOfUsers");
$newcardbutton = ''; $newcardbutton = '';
if ($canadduser) $url = DOL_URL_ROOT.'/user/card.php?action=create'.($mode == 'employee' ? '&employee=1' : '').'&leftmenu=';
{ if (!empty($socid)) $url .= '&socid='.$socid;
$url = DOL_URL_ROOT.'/user/card.php?action=create'.($mode == 'employee' ? '&employee=1' : '').'&leftmenu='; $newcardbutton .= dolGetButtonTitle($langs->trans('NewUser'), '', 'fa fa-plus-circle', $url, '', $canadduser);
if (!empty($socid)) $url .= '&socid='.$socid;
$newcardbutton .= dolGetButtonTitle($langs->trans('NewUser'), '', 'fa fa-plus-circle', $url);
}
print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">'."\n"; print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">'."\n";
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">'; if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';