merge variable declaration

This commit is contained in:
Sekan, Tobias 2020-09-18 10:52:17 +02:00
parent dc4250aed7
commit ae8c302c19
20 changed files with 21 additions and 57 deletions

View File

@ -480,11 +480,9 @@ if ($resql)
if (in_array($massaction, array('presend', 'predelete', 'closed'))) $arrayofmassactions = array();
$massactionbutton = $form->selectMassAction('', $arrayofmassactions);
$newcardbutton = '';
$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, '', $user->rights->propal->creer);
$newcardbutton = dolGetButtonTitle($langs->trans('NewPropal'), '', 'fa fa-plus-circle', $url, '', $user->rights->propal->creer);
// Fields title search
print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">';

View File

@ -483,11 +483,9 @@ if ($resql)
if (in_array($massaction, array('presend', 'predelete', 'createbills'))) $arrayofmassactions = array();
$massactionbutton = $form->selectMassAction('', $arrayofmassactions);
$newcardbutton = '';
$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, '', $contextpage == 'orderlist' && $user->rights->commande->creer);
$newcardbutton = dolGetButtonTitle($langs->trans('NewOrder'), '', 'fa fa-plus-circle', $url, '', $contextpage == 'orderlist' && $user->rights->commande->creer);
// Lines of title fields
print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">';

View File

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

View File

@ -674,11 +674,9 @@ if ($resql)
if (in_array($massaction, array('presend', 'predelete'))) $arrayofmassactions = array();
$massactionbutton = $form->selectMassAction('', $arrayofmassactions);
$newcardbutton = '';
$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, '', $user->rights->facture->creer && $contextpage != 'poslist');
$newcardbutton = dolGetButtonTitle($langs->trans('NewBill'), '', 'fa fa-plus-circle', $url, '', $user->rights->facture->creer && $contextpage != 'poslist');
$i = 0;
print '<form method="POST" name="searchFormList" action="'.$_SERVER["PHP_SELF"].'">'."\n";

View File

@ -42,11 +42,9 @@ llxHeader();
$localtax_static = new Localtax($db);
$newcardbutton = '';
$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, '', $user->rights->tax->charges->creer);
$newcardbutton = dolGetButtonTitle($langs->trans('NewLocalTaxPayment', ($ltt + 1)), '', 'fa fa-plus-circle', $url, '', $user->rights->tax->charges->creer);
print load_fiche_titre($langs->transcountry($ltt == 2 ? "LT2Payments" : "LT1Payments", $mysoc->country_code), $newcardbutton, 'title_accountancy');

View File

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

View File

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

View File

@ -369,11 +369,9 @@ if ($user->rights->contrat->supprimer) $arrayofmassactions['predelete'] = '<span
if (in_array($massaction, array('presend', 'predelete'))) $arrayofmassactions = array();
$massactionbutton = $form->selectMassAction('', $arrayofmassactions);
$newcardbutton = '';
$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, '', $user->rights->contrat->creer);
$newcardbutton = dolGetButtonTitle($langs->trans('NewContractSubscription'), '', 'fa fa-plus-circle', $url, '', $user->rights->contrat->creer);
print '<form method="POST" action="'.$_SERVER['PHP_SELF'].'">';
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';

View File

@ -359,13 +359,11 @@ if ($resql)
if (in_array($massaction, array('presend'))) $arrayofmassactions = array();
$massactionbutton = $form->selectMassAction('', $arrayofmassactions);
$newcardbutton = '';
// 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, '', $user->rights->expedition->creer);
$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', $url, '', $user->rights->expedition->creer);
$newcardbutton = dolGetButtonTitle($langs->trans('NewSending'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/expedition/card.php?action=create2', '' , $user->rights->expedition->creer);
$i = 0;
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">'."\n";

View File

@ -461,11 +461,9 @@ if ($resql)
} else {
$title = $langs->trans("ListTripsAndExpenses");
$newcardbutton = '';
$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, '', $user->rights->expensereport->creer);
$newcardbutton = dolGetButtonTitle($langs->trans('NewTrip'), '', 'fa fa-plus-circle', $url, '', $user->rights->expensereport->creer);
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'trip', 0, $newcardbutton, '', $limit, 0, 0, 1);
}

View File

@ -322,7 +322,7 @@ if ($resql)
$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);
$newcardbutton = dolGetButtonTitle($langs->trans('NewIntervention'), '', 'fa fa-plus-circle', $url, '', $user->rights->ficheinter->creer);
// Lines of title fields
print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">'."\n";

View File

@ -649,11 +649,9 @@ if ($resql)
if (in_array($massaction, array('presend', 'predelete', 'createbills'))) $arrayofmassactions = array();
$massactionbutton = $form->selectMassAction('', $arrayofmassactions);
$newcardbutton = '';
$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, '', $user->rights->fournisseur->commande->creer);
$newcardbutton = dolGetButtonTitle($langs->trans('NewOrder'), '', 'fa fa-plus-circle', $url, '', $user->rights->fournisseur->commande->creer);
// Fields title search
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';

View File

@ -508,11 +508,9 @@ if ($resql)
if (in_array($massaction, array('presend', 'predelete', 'createbills'))) $arrayofmassactions = array();
$massactionbutton = $form->selectMassAction('', $arrayofmassactions);
$newcardbutton = '';
$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, '', $user->rights->fournisseur->facture->creer);
$newcardbutton = dolGetButtonTitle($langs->trans('NewBill'), '', 'fa fa-plus-circle', $url, '', $user->rights->fournisseur->facture->creer);
$i = 0;
print '<form method="POST" name="searchFormList" action="'.$_SERVER["PHP_SELF"].'">'."\n";

View File

@ -150,11 +150,9 @@ if ($resql)
if ($search_amount) $param .= "&search_amount=".urlencode($search_amount);
if ($optioncss != '') $param .= '&optioncss='.urlencode($optioncss);
$newcardbutton = '';
$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, '', $user->rights->loan->write);
$newcardbutton = dolGetButtonTitle($langs->trans('NewLoan'), '', 'fa fa-plus-circle', $url, '', $user->rights->loan->write);
print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">'."\n";
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';

View File

@ -448,11 +448,9 @@ if (in_array($massaction, array('presend', 'predelete'))) $arrayofmassactions =
$massactionbutton = $form->selectMassAction('', $arrayofmassactions);
$newcardbutton = '';
$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, '', $user->rights->projet->creer);
$newcardbutton = dolGetButtonTitle($langs->trans('NewProject'), '', 'fa fa-plus-circle', $url, '', $user->rights->projet->creer);
print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">';
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';

View File

@ -153,11 +153,9 @@ if ($result)
if ($typeid) $param .= '&amp;typeid='.$typeid;
if ($optioncss != '') $param .= '&amp;optioncss='.$optioncss;
$newcardbutton = '';
$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, '', $user->rights->salaries->write);
$newcardbutton = dolGetButtonTitle($langs->trans('NewSalaryPayment'), '', 'fa fa-plus-circle', $url, '', $user->rights->salaries->write);
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';

View File

@ -598,7 +598,6 @@ if ($user->rights->societe->supprimer) $arrayofmassactions['predelete'] = '<span
if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete'))) $arrayofmassactions = array();
$massactionbutton = $form->selectMassAction('', $arrayofmassactions);
$newcardbutton = '';
$typefilter = '';
$label = 'MenuNewThirdParty';
@ -612,7 +611,7 @@ if (!empty($type))
$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');
$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">';
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';

View File

@ -414,11 +414,9 @@ if ($resql)
if (in_array($massaction, array('presend', 'predelete'))) $arrayofmassactions = array();
$massactionbutton = $form->selectMassAction('', $arrayofmassactions);
$newcardbutton = '';
$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, '', $user->rights->supplier_proposal->creer);
$newcardbutton = dolGetButtonTitle($langs->trans('NewAskPrice'), '', 'fa fa-plus-circle', $url, '', $user->rights->supplier_proposal->creer);
// Fields title search
print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">';

View File

@ -568,11 +568,9 @@ print '<input type="hidden" name="mode" value="'.$mode.'" >';
if ($socid) print '<input type="hidden" name="socid" value="'.$socid.'" >';
if ($projectid) print '<input type="hidden" name="projectid" value="'.$projectid.'" >';
$newcardbutton = '';
$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, '', $user->rights->ticket->write);
$newcardbutton = dolGetButtonTitle($langs->trans('NewTicket'), '', 'fa fa-plus-circle', $url, '', $user->rights->ticket->write);
$picto = 'ticket';
if ($socid > 0) $picto = '';

View File

@ -301,10 +301,9 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
$text = $langs->trans("ListOfUsers");
$newcardbutton = '';
$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, '', $canadduser);
$newcardbutton = dolGetButtonTitle($langs->trans('NewUser'), '', 'fa fa-plus-circle', $url, '', $canadduser);
print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">'."\n";
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';