';
print ''.$staticcontratligne->LibStatut($status, 0, ($bool ? 1 : 0)).' ';
- print ''.($nb[$status.$bool] ? $nb[$status.$bool] : 0).' '.$staticcontratligne->LibStatut($status, 3, ($bool ? 1 : 0)).' ';
+ print ''.($nb[$status.$bool_str] ? $nb[$status.$bool_str] : 0).' '.$staticcontratligne->LibStatut($status, 3, ($bool ? 1 : 0)).' ';
if ($status == 4 && !$bool) {
$bool = true;
} else {
diff --git a/htdocs/contrat/list.php b/htdocs/contrat/list.php
index 455d801cb3e..a8704ff8da3 100644
--- a/htdocs/contrat/list.php
+++ b/htdocs/contrat/list.php
@@ -67,7 +67,7 @@ $search_ref_supplier = GETPOST('search_ref_supplier', 'alpha');
$search_all = (GETPOST('search_all', 'alphanohtml') != '') ? GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml');
$search_status = GETPOST('search_status', 'alpha');
$socid = GETPOSTINT('socid');
-$search_user = GETPOSTINT('search_user');
+$search_user = GETPOST('search_user', 'intcomma');
$search_sale = GETPOSTINT('search_sale');
$search_product_category = GETPOSTINT('search_product_category');
$search_dfmonth = GETPOSTINT('search_dfmonth');
@@ -128,7 +128,7 @@ if (!$sortorder) {
// Security check
$id = GETPOSTINT('id');
-if ($user->socid) {
+if ($user->socid > 0) {
$socid = $user->socid;
}
$result = restrictedArea($user, 'contrat', $id);
@@ -162,7 +162,7 @@ $fieldstosearchall["s.nom"] = "ThirdParty";
if (empty($user->socid)) {
$fieldstosearchall["c.note_private"] = "NotePrivate";
}
-$parameters = array('fieldstosearchall'=>$fieldstosearchall);
+$parameters = array('fieldstosearchall' => $fieldstosearchall);
$reshook = $hookmanager->executeHooks('completeFieldsToSearchAll', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook > 0) {
$fieldstosearchall = $hookmanager->resArray['fieldstosearchall'];
@@ -173,21 +173,21 @@ if ($reshook > 0) {
}
$arrayfields = array(
- 'c.ref'=>array('label'=>$langs->trans("Ref"), 'checked'=>1, 'position'=>10),
- 'c.ref_customer'=>array('label'=>$langs->trans("RefCustomer"), 'checked'=>1, 'position'=>12),
- 'c.ref_supplier'=>array('label'=>$langs->trans("RefSupplier"), 'checked'=>1, 'position'=>14),
- 's.nom'=>array('label'=>$langs->trans("ThirdParty"), 'checked'=>1, 'position'=>30),
- 's.email'=>array('label'=>$langs->trans("ThirdPartyEmail"), 'checked'=>0, 'position'=>30),
- 's.town'=>array('label'=>$langs->trans("Town"), 'checked'=>0, 'position'=>31),
- 's.zip'=>array('label'=>$langs->trans("Zip"), 'checked'=>1, 'position'=>32),
- 'state.nom'=>array('label'=>$langs->trans("StateShort"), 'checked'=>0, 'position'=>33),
- 'country.code_iso'=>array('label'=>$langs->trans("Country"), 'checked'=>0, 'position'=>34),
- 'sale_representative'=>array('label'=>$langs->trans("SaleRepresentativesOfThirdParty"), 'checked'=>-1, 'position'=>80),
- 'c.date_contrat'=>array('label'=>$langs->trans("DateContract"), 'checked'=>1, 'position'=>45),
- 'c.datec'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500),
- 'c.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500),
- 'lower_planned_end_date'=>array('label'=>$langs->trans("LowerDateEndPlannedShort"), 'checked'=>1, 'position'=>900, 'help'=>$langs->trans("LowerDateEndPlannedShort")),
- 'status'=>array('label'=>$langs->trans("Status"), 'checked'=>1, 'position'=>1000),
+ 'c.ref' => array('label' => $langs->trans("Ref"), 'checked' => 1, 'position' => 10),
+ 'c.ref_customer' => array('label' => $langs->trans("RefCustomer"), 'checked' => 1, 'position' => 12),
+ 'c.ref_supplier' => array('label' => $langs->trans("RefSupplier"), 'checked' => 1, 'position' => 14),
+ 's.nom' => array('label' => $langs->trans("ThirdParty"), 'checked' => 1, 'position' => 30),
+ 's.email' => array('label' => $langs->trans("ThirdPartyEmail"), 'checked' => 0, 'position' => 30),
+ 's.town' => array('label' => $langs->trans("Town"), 'checked' => 0, 'position' => 31),
+ 's.zip' => array('label' => $langs->trans("Zip"), 'checked' => 1, 'position' => 32),
+ 'state.nom' => array('label' => $langs->trans("StateShort"), 'checked' => 0, 'position' => 33),
+ 'country.code_iso' => array('label' => $langs->trans("Country"), 'checked' => 0, 'position' => 34),
+ 'sale_representative' => array('label' => $langs->trans("SaleRepresentativesOfThirdParty"), 'checked' => -1, 'position' => 80),
+ 'c.date_contrat' => array('label' => $langs->trans("DateContract"), 'checked' => 1, 'position' => 45),
+ 'c.datec' => array('label' => $langs->trans("DateCreation"), 'checked' => 0, 'position' => 500),
+ 'c.tms' => array('label' => $langs->trans("DateModificationShort"), 'checked' => 0, 'position' => 500),
+ 'lower_planned_end_date' => array('label' => $langs->trans("LowerDateEndPlannedShort"), 'checked' => 1, 'position' => 900, 'help' => $langs->trans("LowerDateEndPlannedShort")),
+ 'status' => array('label' => $langs->trans("Status"), 'checked' => 1, 'position' => 1000),
);
// Extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php';
@@ -219,7 +219,7 @@ if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massa
$massaction = '';
}
-$parameters = array('socid'=>$socid);
+$parameters = array('socid' => $socid);
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) {
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
@@ -498,11 +498,11 @@ if (!empty($extrafields->attributes[$object->table_element]['label'])) {
}
}
// Add where from hooks
-$parameters = array('search_dfyear' => $search_dfyear, 'search_op2df'=>$search_op2df);
+$parameters = array('search_dfyear' => $search_dfyear, 'search_op2df' => $search_op2df);
$reshook = $hookmanager->executeHooks('printFieldListGroupBy', $parameters, $object); // Note that $action and $object may have been modified by hook
$sql .= $hookmanager->resPrint;
// Add HAVING from hooks
-$parameters = array('search_dfyear' => $search_dfyear, 'search_op2df'=>$search_op2df);
+$parameters = array('search_dfyear' => $search_dfyear, 'search_op2df' => $search_op2df);
$reshook = $hookmanager->executeHooks('printFieldListHaving', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
if (empty($reshook)) {
if ($search_dfyear > 0 && $search_op2df) {
@@ -726,9 +726,9 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
// List of mass actions available
$arrayofmassactions = array(
- 'generate_doc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("ReGeneratePDF"),
- 'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"),
- 'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"),
+ 'generate_doc' => img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("ReGeneratePDF"),
+ 'builddoc' => img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"),
+ 'presend' => img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"),
);
if (!empty($permissiontodelete)) {
$arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete");
@@ -743,8 +743,8 @@ if (!empty($socid)) {
$url .= '&socid='.((int) $socid);
}
$newcardbutton = '';
-$newcardbutton .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-bars imgforviewmode', $_SERVER["PHP_SELF"].'?mode=common'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ((empty($mode) || $mode == 'common') ? 2 : 1), array('morecss'=>'reposition'));
-$newcardbutton .= dolGetButtonTitle($langs->trans('ViewKanban'), '', 'fa fa-th-list imgforviewmode', $_SERVER["PHP_SELF"].'?mode=kanban'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ($mode == 'kanban' ? 2 : 1), array('morecss'=>'reposition'));
+$newcardbutton .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-bars imgforviewmode', $_SERVER["PHP_SELF"].'?mode=common'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ((empty($mode) || $mode == 'common') ? 2 : 1), array('morecss' => 'reposition'));
+$newcardbutton .= dolGetButtonTitle($langs->trans('ViewKanban'), '', 'fa fa-th-list imgforviewmode', $_SERVER["PHP_SELF"].'?mode=kanban'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ($mode == 'kanban' ? 2 : 1), array('morecss' => 'reposition'));
$newcardbutton .= dolGetButtonTitleSeparator();
$newcardbutton .= dolGetButtonTitle($langs->trans('NewContractSubscription'), '', 'fa fa-plus-circle', $url, '', $user->hasRight('contrat', 'creer'));
@@ -921,7 +921,7 @@ if (!empty($arrayfields['c.date_contrat']['checked'])) {
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php';
// Fields from hook
-$parameters = array('arrayfields'=>$arrayfields);
+$parameters = array('arrayfields' => $arrayfields);
$reshook = $hookmanager->executeHooks('printFieldListOption', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
// Creation date
@@ -949,7 +949,7 @@ if (!empty($arrayfields['c.tms']['checked'])) {
// First end date
if (!empty($arrayfields['lower_planned_end_date']['checked'])) {
print '';
- $arrayofoperators = array('0'=>'', '='=>'=', '<='=>'<=', '>='=>'>=');
+ $arrayofoperators = array('0' => '', '=' => '=', '<=' => '<=', '>=' => '>=');
print $form->selectarray('search_op2df', $arrayofoperators, $search_op2df, 0, 0, 0, '', 0, 0, 0, '', 'maxwidth50imp');
print '';
print $formother->select_month($search_dfmonth, 'search_dfmonth', 1, 0);
@@ -1032,7 +1032,7 @@ if (!empty($arrayfields['c.date_contrat']['checked'])) {
// Extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php';
// Hook fields
-$parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder, 'totalarray'=>&$totalarray);
+$parameters = array('arrayfields' => $arrayfields, 'param' => $param, 'sortfield' => $sortfield, 'sortorder' => $sortorder, 'totalarray' => &$totalarray);
$reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
if (!empty($arrayfields['c.datec']['checked'])) {
@@ -1101,7 +1101,7 @@ while ($i < $imaxinloop) {
if ($obj->country_id > 0) {
if (!isset($cacheCountryIDCode[$obj->country_id]['code'])) {
$tmparray = getCountry($obj->country_id, 'all');
- $cacheCountryIDCode[$obj->country_id] = array('code'=> empty($tmparray['code']) ? '' : $tmparray['code'], 'label' => empty($tmparray['label']) ? '' : $tmparray['label']);
+ $cacheCountryIDCode[$obj->country_id] = array('code' => empty($tmparray['code']) ? '' : $tmparray['code'], 'label' => empty($tmparray['label']) ? '' : $tmparray['label']);
}
$socstatic->country_code = $cacheCountryIDCode[$obj->country_id]['code'];
$socstatic->country = $cacheCountryIDCode[$obj->country_id]['label'];
@@ -1113,6 +1113,7 @@ while ($i < $imaxinloop) {
print '';
}
// Output Kanban
+ $arraydata = array();
$arraydata['thirdparty'] = $socstatic;
$arraydata['selected'] = in_array($obj->rowid, $arrayofselected);
$contracttmp->date_contrat = $obj->date_contrat;
@@ -1282,7 +1283,7 @@ while ($i < $imaxinloop) {
// Extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';
// Fields from hook
- $parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray);
+ $parameters = array('arrayfields' => $arrayfields, 'obj' => $obj, 'i' => $i, 'totalarray' => &$totalarray);
$reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
// Date creation
@@ -1359,7 +1360,7 @@ if ($num == 0) {
$db->free($resql);
-$parameters = array('arrayfields'=>$arrayfields, 'sql'=>$sql);
+$parameters = array('arrayfields' => $arrayfields, 'sql' => $sql);
$reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
diff --git a/htdocs/contrat/services_list.php b/htdocs/contrat/services_list.php
index 928482bc1be..a2542669485 100644
--- a/htdocs/contrat/services_list.php
+++ b/htdocs/contrat/services_list.php
@@ -118,21 +118,21 @@ $staticcontratligne = new ContratLigne($db);
$companystatic = new Societe($db);
$arrayfields = array(
- 'c.ref'=>array('label'=>"Contract", 'checked'=>1, 'position'=>80),
- 'p.description'=>array('label'=>"Service", 'checked'=>1, 'position'=>80),
- 's.nom'=>array('label'=>"ThirdParty", 'checked'=>1, 'position'=>90),
- 'cd.tva_tx'=>array('label'=>"VATRate", 'checked'=>-1, 'position'=>100),
- 'cd.subprice'=>array('label'=>"PriceUHT", 'checked'=>-1, 'position'=>105),
- 'cd.qty'=>array('label'=>"Qty", 'checked'=>1, 'position'=>108),
- 'cd.total_ht'=>array('label'=>"TotalHT", 'checked'=>-1, 'position'=>109, 'isameasure'=>1),
- 'cd.total_tva'=>array('label'=>"TotalVAT", 'checked'=>-1, 'position'=>110),
- 'cd.date_ouverture_prevue'=>array('label'=>"DateStartPlannedShort", 'checked'=>1, 'position'=>150),
- 'cd.date_ouverture'=>array('label'=>"DateStartRealShort", 'checked'=>1, 'position'=>160),
- 'cd.date_fin_validite'=>array('label'=>"DateEndPlannedShort", 'checked'=>1, 'position'=>170),
- 'cd.date_cloture'=>array('label'=>"DateEndRealShort", 'checked'=>1, 'position'=>180),
+ 'c.ref' => array('label' => "Contract", 'checked' => 1, 'position' => 80),
+ 'p.description' => array('label' => "Service", 'checked' => 1, 'position' => 80),
+ 's.nom' => array('label' => "ThirdParty", 'checked' => 1, 'position' => 90),
+ 'cd.tva_tx' => array('label' => "VATRate", 'checked' => -1, 'position' => 100),
+ 'cd.subprice' => array('label' => "PriceUHT", 'checked' => -1, 'position' => 105),
+ 'cd.qty' => array('label' => "Qty", 'checked' => 1, 'position' => 108),
+ 'cd.total_ht' => array('label' => "TotalHT", 'checked' => -1, 'position' => 109, 'isameasure' => 1),
+ 'cd.total_tva' => array('label' => "TotalVAT", 'checked' => -1, 'position' => 110),
+ 'cd.date_ouverture_prevue' => array('label' => "DateStartPlannedShort", 'checked' => 1, 'position' => 150),
+ 'cd.date_ouverture' => array('label' => "DateStartRealShort", 'checked' => 1, 'position' => 160),
+ 'cd.date_fin_validite' => array('label' => "DateEndPlannedShort", 'checked' => 1, 'position' => 170),
+ 'cd.date_cloture' => array('label' => "DateEndRealShort", 'checked' => 1, 'position' => 180),
//'cd.datec'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500),
- 'cd.tms'=>array('label'=>"DateModificationShort", 'checked'=>0, 'position'=>500),
- 'status'=>array('label'=>"Status", 'checked'=>1, 'position'=>1000)
+ 'cd.tms' => array('label' => "DateModificationShort", 'checked' => 0, 'position' => 500),
+ 'status' => array('label' => "Status", 'checked' => 1, 'position' => 1000)
);
// Extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php';
@@ -159,7 +159,7 @@ if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massa
$massaction = '';
}
-$parameters = array('socid'=>$socid);
+$parameters = array('socid' => $socid);
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) {
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
@@ -518,6 +518,7 @@ $newcardbutton = '';
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'contract', 0, '', '', $limit);
if (!empty($sall)) {
+ $fieldstosearchall = array();
foreach ($fieldstosearchall as $key => $val) {
$fieldstosearchall[$key] = $langs->trans($val);
}
@@ -619,7 +620,7 @@ if (!empty($arrayfields['s.nom']['checked'])) {
if (!empty($arrayfields['cd.date_ouverture_prevue']['checked'])) {
print '
';
- $arrayofoperators = array('<'=>'<', '>'=>'>');
+ $arrayofoperators = array('<' => '<', '>' => '>');
print $form->selectarray('filter_opouvertureprevue', $arrayofoperators, $filter_opouvertureprevue, 1, 0, 0, '', 0, 0, 0, '', 'width50');
print ' ';
$filter_dateouvertureprevue = dol_mktime(0, 0, 0, $opouvertureprevuemonth, $opouvertureprevueday, $opouvertureprevueyear);
@@ -628,7 +629,7 @@ if (!empty($arrayfields['cd.date_ouverture_prevue']['checked'])) {
}
if (!empty($arrayfields['cd.date_ouverture']['checked'])) {
print ' ';
- $arrayofoperators = array('<'=>'<', '>'=>'>');
+ $arrayofoperators = array('<' => '<', '>' => '>');
print $form->selectarray('filter_op1', $arrayofoperators, $filter_op1, 1, 0, 0, '', 0, 0, 0, '', 'width50');
print ' ';
$filter_date1 = dol_mktime(0, 0, 0, $op1month, $op1day, $op1year);
@@ -637,7 +638,7 @@ if (!empty($arrayfields['cd.date_ouverture']['checked'])) {
}
if (!empty($arrayfields['cd.date_fin_validite']['checked'])) {
print ' ';
- $arrayofoperators = array('<'=>'<', '>'=>'>');
+ $arrayofoperators = array('<' => '<', '>' => '>');
print $form->selectarray('filter_op2', $arrayofoperators, $filter_op2, 1, 0, 0, '', 0, 0, 0, '', 'width50');
print ' ';
$filter_date2 = dol_mktime(0, 0, 0, $op2month, $op2day, $op2year);
@@ -646,7 +647,7 @@ if (!empty($arrayfields['cd.date_fin_validite']['checked'])) {
}
if (!empty($arrayfields['cd.date_cloture']['checked'])) {
print ' ';
- $arrayofoperators = array('<'=>'<', '>'=>'>');
+ $arrayofoperators = array('<' => '<', '>' => '>');
print $form->selectarray('filter_opcloture', $arrayofoperators, $filter_opcloture, 1, 0, 0, '', 0, 0, 0, '', 'width50');
print ' ';
$filter_date_cloture = dol_mktime(0, 0, 0, $opcloturemonth, $opclotureday, $opclotureyear);
@@ -657,7 +658,7 @@ if (!empty($arrayfields['cd.date_cloture']['checked'])) {
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php';
// Fields from hook
-$parameters = array('arrayfields'=>$arrayfields);
+$parameters = array('arrayfields' => $arrayfields);
$reshook = $hookmanager->executeHooks('printFieldListOption', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
if (!empty($arrayfields['cd.datec']['checked'])) {
@@ -674,11 +675,11 @@ if (!empty($arrayfields['status']['checked'])) {
// Status
print ' ';
$arrayofstatus = array(
- '0'=>$langs->trans("ServiceStatusInitial"),
- '4'=>$langs->trans("ServiceStatusRunning"),
- '4&filter=notexpired'=>$langs->trans("ServiceStatusNotLate"),
- '4&filter=expired'=>$langs->trans("ServiceStatusLate"),
- '5'=>$langs->trans("ServiceStatusClosed")
+ '0' => $langs->trans("ServiceStatusInitial"),
+ '4' => $langs->trans("ServiceStatusRunning"),
+ '4&filter=notexpired' => $langs->trans("ServiceStatusNotLate"),
+ '4&filter=expired' => $langs->trans("ServiceStatusLate"),
+ '5' => $langs->trans("ServiceStatusClosed")
);
$search_status_new = GETPOST('search_status', 'alpha');
if ($filter == 'expired' && !preg_match('/expired/', $search_status_new)) {
@@ -746,7 +747,7 @@ if (!empty($arrayfields['cd.date_cloture']['checked'])) {
// Extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php';
// Hook fields
-$parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder);
+$parameters = array('arrayfields' => $arrayfields, 'param' => $param, 'sortfield' => $sortfield, 'sortorder' => $sortorder);
$reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
if (!empty($arrayfields['cd.datec']['checked'])) {
@@ -774,7 +775,7 @@ $productstatic = new Product($db);
$i = 0;
$savnbfield = $totalarray['nbfield'];
-$totalarray = array('nbfield'=>0, 'cd.qty'=>0, 'cd.total_ht'=>0, 'cd.total_tva'=>0);
+$totalarray = array('nbfield' => 0, 'cd.qty' => 0, 'cd.total_ht' => 0, 'cd.total_tva' => 0);
$imaxinloop = ($limit ? min($num, $limit) : $num);
while ($i < $imaxinloop) {
$obj = $db->fetch_object($resql);
@@ -961,7 +962,7 @@ while ($i < $imaxinloop) {
// Extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';
// Fields from hook
- $parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray);
+ $parameters = array('arrayfields' => $arrayfields, 'obj' => $obj, 'i' => $i, 'totalarray' => &$totalarray);
$reshook = $hookmanager->executeHooks('printFieldListValue', $parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
// Date creation
diff --git a/htdocs/core/actions_addupdatedelete.inc.php b/htdocs/core/actions_addupdatedelete.inc.php
index 5c37dacedbe..ab0186f9e2f 100644
--- a/htdocs/core/actions_addupdatedelete.inc.php
+++ b/htdocs/core/actions_addupdatedelete.inc.php
@@ -587,7 +587,7 @@ if ($action == 'confirm_reopen' && $confirm == 'yes' && $permissiontoadd) {
if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
$newlang = GETPOST('lang_id', 'aZ09');
}
- if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) {
+ if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && is_object($object->thirdparty)) {
$newlang = $object->thirdparty->default_lang;
}
if (!empty($newlang)) {
diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php
index 1acea501327..9649ef6252c 100644
--- a/htdocs/core/actions_massactions.inc.php
+++ b/htdocs/core/actions_massactions.inc.php
@@ -4,6 +4,7 @@
* Copyright (C) 2018 Juanjo Menent
* Copyright (C) 2019 Ferran Marcet
* Copyright (C) 2019-2024 Frédéric France
+ * Copyright (C) 2024 MDW
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -373,9 +374,9 @@ if (!$error && $massaction == 'confirm_presend') {
if ($filepath_found) {
// Create form object
$attachedfilesThirdpartyObj[$thirdpartyid][$objectid] = array(
- 'paths'=>array($filepath_found),
- 'names'=>array($filename_found),
- 'mimes'=>array(dol_mimetype($filepath_found))
+ 'paths' => array($filepath_found),
+ 'names' => array($filename_found),
+ 'mimes' => array(dol_mimetype($filepath_found))
);
} else {
$nbignored++;
@@ -477,7 +478,7 @@ if (!$error && $massaction == 'confirm_presend') {
$substitutionarray['__EMAIL__'] = $thirdparty->email;
$substitutionarray['__CHECK_READ__'] = ' ';
- $parameters = array('mode'=>'formemail');
+ $parameters = array('mode' => 'formemail');
if (!empty($listofobjectthirdparties)) {
$parameters['listofobjectthirdparties'] = $listofobjectthirdparties;
@@ -491,16 +492,16 @@ if (!$error && $massaction == 'confirm_presend') {
$subjectreplaced = make_substitutions($subject, $substitutionarray);
$messagereplaced = make_substitutions($message, $substitutionarray);
- $attachedfiles = array('paths'=>array(), 'names'=>array(), 'mimes'=>array());
+ $attachedfiles = array('paths' => array(), 'names' => array(), 'mimes' => array());
if ($oneemailperrecipient) {
// if "one email per recipient" is check we must collate $attachedfiles by thirdparty
if (is_array($attachedfilesThirdpartyObj[$thirdparty->id]) && count($attachedfilesThirdpartyObj[$thirdparty->id])) {
foreach ($attachedfilesThirdpartyObj[$thirdparty->id] as $keyObjId => $objAttachedFiles) {
// Create form object
$attachedfiles = array(
- 'paths'=>array_merge($attachedfiles['paths'], $objAttachedFiles['paths']),
- 'names'=>array_merge($attachedfiles['names'], $objAttachedFiles['names']),
- 'mimes'=>array_merge($attachedfiles['mimes'], $objAttachedFiles['mimes'])
+ 'paths' => array_merge($attachedfiles['paths'], $objAttachedFiles['paths']),
+ 'names' => array_merge($attachedfiles['names'], $objAttachedFiles['names']),
+ 'mimes' => array_merge($attachedfiles['mimes'], $objAttachedFiles['mimes'])
);
}
}
@@ -720,11 +721,7 @@ if (!$error && $massaction == 'cancelorders') {
}
}
if (!$error) {
- if ($nbok > 1) {
- setEventMessages($langs->trans("RecordsModified", $nbok), null, 'mesgs');
- } else {
- setEventMessages($langs->trans("RecordsModified", $nbok), null, 'mesgs');
- }
+ setEventMessages($langs->trans("RecordsModified", $nbok), null, 'mesgs');
$db->commit();
} else {
$db->rollback();
@@ -1205,9 +1202,9 @@ if (!$error && $massaction == 'generate_doc' && $permissiontoread) {
if (!$error && ($action == 'affecttag' && $confirm == 'yes') && $permissiontoadd) {
$db->begin();
- $affecttag_type=GETPOST('affecttag_type', 'alpha');
+ $affecttag_type = GETPOST('affecttag_type', 'alpha');
if (!empty($affecttag_type)) {
- $affecttag_type_array=explode(',', $affecttag_type);
+ $affecttag_type_array = explode(',', $affecttag_type);
} else {
setEventMessage('CategTypeNotFound', 'errors');
}
@@ -1215,8 +1212,8 @@ if (!$error && ($action == 'affecttag' && $confirm == 'yes') && $permissiontoadd
//check if tag type submitted exists into Tag Map categorie class
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
$categ = new Categorie($db);
- $to_affecttag_type_array=array();
- $categ_type_array=$categ->getMapList();
+ $to_affecttag_type_array = array();
+ $categ_type_array = $categ->getMapList();
foreach ($categ_type_array as $categdef) {
if (in_array($categdef['code'], $affecttag_type_array)) {
$to_affecttag_type_array[] = $categdef['code'];
@@ -1250,13 +1247,9 @@ if (!$error && ($action == 'affecttag' && $confirm == 'yes') && $permissiontoadd
}
if (!$error) {
- if ($nbok > 1) {
- setEventMessages($langs->trans("RecordsModified", $nbok), null);
- } else {
- setEventMessages($langs->trans("RecordsModified", $nbok), null);
- }
+ setEventMessages($langs->trans("RecordsModified", $nbok), null);
$db->commit();
- $toselect=array();
+ $toselect = array();
} else {
$db->rollback();
}
@@ -1265,7 +1258,7 @@ if (!$error && ($action == 'affecttag' && $confirm == 'yes') && $permissiontoadd
if (!$error && ($action == 'updateprice' && $confirm == 'yes') && $permissiontoadd) {
$db->begin();
if (GETPOSTISSET('pricerate')) {
- $pricepercentage=GETPOSTINT('pricerate');
+ $pricepercentage = GETPOSTINT('pricerate');
if ($pricepercentage == 0) {
setEventMessages($langs->trans("RecordsModified", 0), null);
} else {
@@ -1300,7 +1293,7 @@ if (!$error && ($action == 'updateprice' && $confirm == 'yes') && $permissiontoa
setEventMessages($langs->trans("RecordsModified", $nbok), null);
}
$db->commit();
- $toselect=array();
+ $toselect = array();
} else {
$db->rollback();
}
@@ -1308,7 +1301,7 @@ if (!$error && ($action == 'updateprice' && $confirm == 'yes') && $permissiontoa
if (!$error && ($action == 'setsupervisor' && $confirm == 'yes') && $permissiontoadd) {
$db->begin();
- $supervisortoset=GETPOST('supervisortoset');
+ $supervisortoset = GETPOST('supervisortoset');
if (!empty($supervisortoset)) {
foreach ($toselect as $toselectid) {
$result = $object->fetch($toselectid);
@@ -1333,13 +1326,9 @@ if (!$error && ($action == 'setsupervisor' && $confirm == 'yes') && $permissiont
}
if (!$error) {
- if ($nbok > 1) {
- setEventMessages($langs->trans("RecordsModified", $nbok), null);
- } else {
- setEventMessages($langs->trans("RecordsModified", $nbok), null);
- }
+ setEventMessages($langs->trans("RecordsModified", $nbok), null);
$db->commit();
- $toselect=array();
+ $toselect = array();
} else {
$db->rollback();
}
@@ -1348,9 +1337,9 @@ if (!$error && ($action == 'setsupervisor' && $confirm == 'yes') && $permissiont
if (!$error && ($action == 'affectuser' && $confirm == 'yes') && $permissiontoadd) {
$db->begin();
- $usertoaffect=GETPOST('usertoaffect');
- $projectrole=GETPOST('projectrole');
- $tasksrole=GETPOST('tasksrole');
+ $usertoaffect = GETPOST('usertoaffect');
+ $projectrole = GETPOST('projectrole');
+ $tasksrole = GETPOST('tasksrole');
if (!empty($usertoaffect)) {
foreach ($toselect as $toselectid) {
$result = $object->fetch($toselectid);
@@ -1387,13 +1376,9 @@ if (!$error && ($action == 'affectuser' && $confirm == 'yes') && $permissiontoad
}
if (!$error) {
- if ($nbok > 1) {
- setEventMessages($langs->trans("RecordsModified", $nbok), null);
- } else {
- setEventMessages($langs->trans("RecordsModified", $nbok), null);
- }
+ setEventMessages($langs->trans("RecordsModified", $nbok), null);
$db->commit();
- $toselect=array();
+ $toselect = array();
} else {
$db->rollback();
}
@@ -1406,9 +1391,9 @@ if (!$error && ($massaction == 'enable' || ($action == 'enable' && $confirm == '
$nbok = 0;
foreach ($toselect as $toselectid) {
$result = $objecttmp->fetch($toselectid);
- if ($result>0) {
+ if ($result > 0) {
if (in_array($objecttmp->element, array('societe'))) {
- $result =$objecttmp->setStatut(1);
+ $result = $objecttmp->setStatut(1);
}
if ($result <= 0) {
setEventMessages($objecttmp->error, $objecttmp->errors, 'errors');
@@ -1443,9 +1428,9 @@ if (!$error && ($massaction == 'disable' || ($action == 'disable' && $confirm ==
$nbok = 0;
foreach ($toselect as $toselectid) {
$result = $objecttmp->fetch($toselectid);
- if ($result>0) {
+ if ($result > 0) {
if (in_array($objecttmp->element, array('societe'))) {
- $result =$objecttmp->setStatut(0);
+ $result = $objecttmp->setStatut(0);
}
if ($result <= 0) {
setEventMessages($objecttmp->error, $objecttmp->errors, 'errors');
@@ -1488,7 +1473,7 @@ if (!$error && $action == 'confirm_edit_value_extrafields' && $confirm == 'yes'
/** @var CommonObject $objecttmp */
$objecttmp = new $objectclass($db); // to avoid ghost data
$result = $objecttmp->fetch($toselectid);
- if ($result>0) {
+ if ($result > 0) {
// Fill array 'array_options' with data from add form
$ret = $e->setOptionalsFromPost(null, $objecttmp, $extrafieldKeyToUpdate);
if ($ret > 0) {
@@ -1524,7 +1509,7 @@ if (!$error && ($massaction == 'affectcommercial' || ($action == 'affectcommerci
foreach ($toselect as $toselectid) {
$result = $objecttmp->fetch($toselectid);
- if ($result>0) {
+ if ($result > 0) {
if (in_array($objecttmp->element, array('societe'))) {
$result = $objecttmp->setSalesRep(GETPOST("commercial", "alpha"));
}
@@ -1719,7 +1704,7 @@ if (!$error && ($massaction == 'increaseholiday' || ($action == 'increaseholiday
setEventMessages($langs->trans("HolidayRecordIncreased"), null, 'mesgs');
}
$db->commit();
- $toselect=array();
+ $toselect = array();
} else {
$db->rollback();
}
diff --git a/htdocs/core/ajax/ajaxdirpreview.php b/htdocs/core/ajax/ajaxdirpreview.php
index 0f869a97ac0..48ee32f5de2 100644
--- a/htdocs/core/ajax/ajaxdirpreview.php
+++ b/htdocs/core/ajax/ajaxdirpreview.php
@@ -220,7 +220,7 @@ if ($type == 'directory') {
'mrp-mo'
);
- $parameters = array('modulepart'=>$module);
+ $parameters = array('modulepart' => $module);
$reshook = $hookmanager->executeHooks('addSectionECMAuto', $parameters);
if ($reshook > 0 && is_array($hookmanager->resArray) && count($hookmanager->resArray) > 0) {
$automodules[] = $hookmanager->resArray['module'];
@@ -274,7 +274,7 @@ if ($type == 'directory') {
} elseif ($module == 'mrp-mo') {
$upload_dir = $conf->mrp->dir_output;
} else {
- $parameters = array('modulepart'=>$module);
+ $parameters = array('modulepart' => $module);
$reshook = $hookmanager->executeHooks('addSectionECMAuto', $parameters);
if ($reshook > 0 && is_array($hookmanager->resArray) && count($hookmanager->resArray) > 0) {
$upload_dir = $hookmanager->resArray['directory'];
@@ -422,20 +422,21 @@ if ($useajax || $action == 'deletefile') {
require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php';
$form = new Form($db);
- $formquestion['urlfile'] = array('type'=>'hidden', 'value'=>$urlfile, 'name'=>'urlfile'); // We must always put field, even if empty because it is filled by javascript later
- $formquestion['section'] = array('type'=>'hidden', 'value'=>$section, 'name'=>'section'); // We must always put field, even if empty because it is filled by javascript later
- $formquestion['section_id'] = array('type'=>'hidden', 'value'=>$section_id, 'name'=>'section_id'); // We must always put field, even if empty because it is filled by javascript later
- $formquestion['section_dir'] = array('type'=>'hidden', 'value'=>$section_dir, 'name'=>'section_dir'); // We must always put field, even if empty because it is filled by javascript later
- $formquestion['sortfield'] = array('type'=>'hidden', 'value'=>$sortfield, 'name'=>'sortfield'); // We must always put field, even if empty because it is filled by javascript later
- $formquestion['sortorder'] = array('type'=>'hidden', 'value'=>$sortorder, 'name'=>'sortorder'); // We must always put field, even if empty because it is filled by javascript later
+ $formquestion = array();
+ $formquestion['urlfile'] = array('type' => 'hidden', 'value' => $urlfile, 'name' => 'urlfile'); // We must always put field, even if empty because it is filled by javascript later
+ $formquestion['section'] = array('type' => 'hidden', 'value' => $section, 'name' => 'section'); // We must always put field, even if empty because it is filled by javascript later
+ $formquestion['section_id'] = array('type' => 'hidden', 'value' => $section_id, 'name' => 'section_id'); // We must always put field, even if empty because it is filled by javascript later
+ $formquestion['section_dir'] = array('type' => 'hidden', 'value' => $section_dir, 'name' => 'section_dir'); // We must always put field, even if empty because it is filled by javascript later
+ $formquestion['sortfield'] = array('type' => 'hidden', 'value' => $sortfield, 'name' => 'sortfield'); // We must always put field, even if empty because it is filled by javascript later
+ $formquestion['sortorder'] = array('type' => 'hidden', 'value' => $sortorder, 'name' => 'sortorder'); // We must always put field, even if empty because it is filled by javascript later
if (!empty($action) && $action == 'file_manager') {
- $formquestion['file_manager'] = array('type'=>'hidden', 'value'=>1, 'name'=>'file_manager');
+ $formquestion['file_manager'] = array('type' => 'hidden', 'value' => 1, 'name' => 'file_manager');
}
if (!empty($websitekey)) {
- $formquestion['website'] = array('type'=>'hidden', 'value'=>$websitekey, 'name'=>'website');
+ $formquestion['website'] = array('type' => 'hidden', 'value' => $websitekey, 'name' => 'website');
}
if (!empty($pageid) && $pageid > 0) {
- $formquestion['pageid'] = array('type'=>'hidden', 'value'=>$pageid, 'name'=>'pageid');
+ $formquestion['pageid'] = array('type' => 'hidden', 'value' => $pageid, 'name' => 'pageid');
}
print $form->formconfirm($url, $langs->trans("DeleteFile"), $langs->trans("ConfirmDeleteFile"), 'confirm_deletefile', $formquestion, "no", ($useajax ? 'deletefile' : 0));
diff --git a/htdocs/core/ajax/locationincoterms.php b/htdocs/core/ajax/locationincoterms.php
index df330e00741..5d541238466 100644
--- a/htdocs/core/ajax/locationincoterms.php
+++ b/htdocs/core/ajax/locationincoterms.php
@@ -96,6 +96,7 @@ if (GETPOST('location_incoterms')) {
$resql = $db->query($sql);
//var_dump($db);
if ($resql) {
+ $row_array = array();
while ($row = $db->fetch_array($resql)) {
$row_array['label'] = $row['location_incoterms'].($row['label'] ? ' - '.$row['label'] : '');
if ($location_incoterms) {
diff --git a/htdocs/core/ajax/selectsearchbox.php b/htdocs/core/ajax/selectsearchbox.php
index f91e87c8d36..00a86ccd9a9 100644
--- a/htdocs/core/ajax/selectsearchbox.php
+++ b/htdocs/core/ajax/selectsearchbox.php
@@ -50,7 +50,8 @@ if (!isset($usedbyinclude) || empty($usedbyinclude)) {
if ($res == 'ERROR_NOT_LOGGED') {
$langs->load("other");
- $arrayresult['jumptologin'] = array('img'=>'object_generic', 'label'=>$langs->trans("JumpToLogin"), 'text'=>' '.$langs->trans("JumpToLogin"), 'url'=>DOL_URL_ROOT.'/index.php');
+ $arrayresult = array();
+ $arrayresult['jumptologin'] = array('img' => 'object_generic', 'label' => $langs->trans("JumpToLogin"), 'text' => ' '.$langs->trans("JumpToLogin"), 'url' => DOL_URL_ROOT.'/index.php');
print json_encode($arrayresult);
if (is_object($db)) {
$db->close();
@@ -70,114 +71,114 @@ $arrayresult = array();
// Define $searchform
if (isModEnabled('member') && !getDolGlobalString('MAIN_SEARCHFORM_ADHERENT_DISABLED') && $user->hasRight('adherent', 'lire')) {
- $arrayresult['searchintomember'] = array('position'=>8, 'shortcut'=>'M', 'img'=>'object_member', 'label'=>$langs->trans("SearchIntoMembers", $search_boxvalue), 'text'=>img_picto('', 'object_member', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoMembers", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/adherents/list.php'.($search_boxvalue ? '?search_all='.urlencode($search_boxvalue) : ''));
+ $arrayresult['searchintomember'] = array('position' => 8, 'shortcut' => 'M', 'img' => 'object_member', 'label' => $langs->trans("SearchIntoMembers", $search_boxvalue), 'text' => img_picto('', 'object_member', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoMembers", $search_boxvalue), 'url' => DOL_URL_ROOT.'/adherents/list.php'.($search_boxvalue ? '?search_all='.urlencode($search_boxvalue) : ''));
}
if (((isModEnabled('societe') && (!getDolGlobalString('SOCIETE_DISABLE_PROSPECTS') || !getDolGlobalString('SOCIETE_DISABLE_CUSTOMERS'))) || isModEnabled('supplier_order') || isModEnabled('supplier_invoice') || isModEnabled('supplier_proposal')) && !getDolGlobalString('MAIN_SEARCHFORM_SOCIETE_DISABLED') && $user->hasRight('societe', 'lire')) {
- $arrayresult['searchintothirdparty'] = array('position'=>10, 'shortcut'=>'T', 'img'=>'object_company', 'label'=>$langs->trans("SearchIntoThirdparties", $search_boxvalue), 'text'=>img_picto('', 'object_company', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoThirdparties", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/societe/list.php'.($search_boxvalue ? '?search_all='.urlencode($search_boxvalue) : ''));
+ $arrayresult['searchintothirdparty'] = array('position' => 10, 'shortcut' => 'T', 'img' => 'object_company', 'label' => $langs->trans("SearchIntoThirdparties", $search_boxvalue), 'text' => img_picto('', 'object_company', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoThirdparties", $search_boxvalue), 'url' => DOL_URL_ROOT.'/societe/list.php'.($search_boxvalue ? '?search_all='.urlencode($search_boxvalue) : ''));
}
if (isModEnabled('societe') && !getDolGlobalString('MAIN_SEARCHFORM_CONTACT_DISABLED') && $user->hasRight('societe', 'lire')) {
- $arrayresult['searchintocontact'] = array('position'=>15, 'shortcut'=>'A', 'img'=>'object_contact', 'label'=>$langs->trans("SearchIntoContacts", $search_boxvalue), 'text'=>img_picto('', 'object_contact', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoContacts", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/contact/list.php'.($search_boxvalue ? '?search_all='.urlencode($search_boxvalue) : ''));
+ $arrayresult['searchintocontact'] = array('position' => 15, 'shortcut' => 'A', 'img' => 'object_contact', 'label' => $langs->trans("SearchIntoContacts", $search_boxvalue), 'text' => img_picto('', 'object_contact', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoContacts", $search_boxvalue), 'url' => DOL_URL_ROOT.'/contact/list.php'.($search_boxvalue ? '?search_all='.urlencode($search_boxvalue) : ''));
}
if (((isModEnabled('product') && $user->hasRight('product', 'read')) || (isModEnabled('service') && $user->hasRight('service', 'read'))) && !getDolGlobalString('MAIN_SEARCHFORM_PRODUITSERVICE_DISABLED')) {
- $arrayresult['searchintoproduct'] = array('position'=>30, 'shortcut'=>'P', 'img'=>'object_product', 'label'=>$langs->trans("SearchIntoProductsOrServices", $search_boxvalue), 'text'=>img_picto('', 'object_product', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoProductsOrServices", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/product/list.php'.($search_boxvalue ? '?search_all='.urlencode($search_boxvalue) : ''));
+ $arrayresult['searchintoproduct'] = array('position' => 30, 'shortcut' => 'P', 'img' => 'object_product', 'label' => $langs->trans("SearchIntoProductsOrServices", $search_boxvalue), 'text' => img_picto('', 'object_product', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoProductsOrServices", $search_boxvalue), 'url' => DOL_URL_ROOT.'/product/list.php'.($search_boxvalue ? '?search_all='.urlencode($search_boxvalue) : ''));
// search on lot/serial numbers
if (isModEnabled('productbatch')) {
- $arrayresult['searchintobatch'] = array('position'=>32, 'shortcut'=>'B', 'img'=>'object_lot', 'label'=>$langs->trans("SearchIntoBatch", $search_boxvalue), 'text'=>img_picto('', 'object_lot', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoBatch", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/product/stock/productlot_list.php'.($search_boxvalue ? '?search_all='.urlencode($search_boxvalue) : ''));
+ $arrayresult['searchintobatch'] = array('position' => 32, 'shortcut' => 'B', 'img' => 'object_lot', 'label' => $langs->trans("SearchIntoBatch", $search_boxvalue), 'text' => img_picto('', 'object_lot', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoBatch", $search_boxvalue), 'url' => DOL_URL_ROOT.'/product/stock/productlot_list.php'.($search_boxvalue ? '?search_all='.urlencode($search_boxvalue) : ''));
}
}
if (isModEnabled('mrp') && $user->hasRight('mrp', 'read') && !getDolGlobalString('MAIN_SEARCHFORM_MRP_DISABLED')) {
- $arrayresult['searchintomo'] = array('position'=>35, 'shortcut'=>'', 'img'=>'object_mrp', 'label'=>$langs->trans("SearchIntoMO", $search_boxvalue), 'text'=>img_picto('', 'object_mrp', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoMO", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/mrp/mo_list.php'.($search_boxvalue ? '?search_all='.urlencode($search_boxvalue) : ''));
+ $arrayresult['searchintomo'] = array('position' => 35, 'shortcut' => '', 'img' => 'object_mrp', 'label' => $langs->trans("SearchIntoMO", $search_boxvalue), 'text' => img_picto('', 'object_mrp', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoMO", $search_boxvalue), 'url' => DOL_URL_ROOT.'/mrp/mo_list.php'.($search_boxvalue ? '?search_all='.urlencode($search_boxvalue) : ''));
}
if (isModEnabled('project') && !getDolGlobalString('MAIN_SEARCHFORM_PROJECT_DISABLED') && $user->hasRight('projet', 'lire')) {
- $arrayresult['searchintoprojects'] = array('position'=>40, 'shortcut'=>'Q', 'img'=>'object_project', 'label'=>$langs->trans("SearchIntoProjects", $search_boxvalue), 'text'=>img_picto('', 'object_project', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoProjects", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/projet/list.php'.($search_boxvalue ? '?search_all='.urlencode($search_boxvalue) : ''));
+ $arrayresult['searchintoprojects'] = array('position' => 40, 'shortcut' => 'Q', 'img' => 'object_project', 'label' => $langs->trans("SearchIntoProjects", $search_boxvalue), 'text' => img_picto('', 'object_project', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoProjects", $search_boxvalue), 'url' => DOL_URL_ROOT.'/projet/list.php'.($search_boxvalue ? '?search_all='.urlencode($search_boxvalue) : ''));
}
if (isModEnabled('project') && !getDolGlobalString('MAIN_SEARCHFORM_TASK_DISABLED') && $user->hasRight('projet', 'lire')) {
- $arrayresult['searchintotasks'] = array('position'=>45, 'img'=>'object_projecttask', 'label'=>$langs->trans("SearchIntoTasks", $search_boxvalue), 'text'=>img_picto('', 'object_projecttask', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoTasks", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/projet/tasks/list.php'.($search_boxvalue ? '?search_all='.urlencode($search_boxvalue) : ''));
+ $arrayresult['searchintotasks'] = array('position' => 45, 'img' => 'object_projecttask', 'label' => $langs->trans("SearchIntoTasks", $search_boxvalue), 'text' => img_picto('', 'object_projecttask', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoTasks", $search_boxvalue), 'url' => DOL_URL_ROOT.'/projet/tasks/list.php'.($search_boxvalue ? '?search_all='.urlencode($search_boxvalue) : ''));
}
if (isModEnabled('propal') && !getDolGlobalString('MAIN_SEARCHFORM_CUSTOMER_PROPAL_DISABLED') && $user->hasRight('propal', 'lire')) {
- $arrayresult['searchintopropal'] = array('position'=>60, 'img'=>'object_propal', 'label'=>$langs->trans("SearchIntoCustomerProposals", $search_boxvalue), 'text'=>img_picto('', 'object_propal', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoCustomerProposals", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/comm/propal/list.php'.($search_boxvalue ? '?search_all='.urlencode($search_boxvalue) : ''));
+ $arrayresult['searchintopropal'] = array('position' => 60, 'img' => 'object_propal', 'label' => $langs->trans("SearchIntoCustomerProposals", $search_boxvalue), 'text' => img_picto('', 'object_propal', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoCustomerProposals", $search_boxvalue), 'url' => DOL_URL_ROOT.'/comm/propal/list.php'.($search_boxvalue ? '?search_all='.urlencode($search_boxvalue) : ''));
}
if (isModEnabled('order') && !getDolGlobalString('MAIN_SEARCHFORM_CUSTOMER_ORDER_DISABLED') && $user->hasRight('commande', 'lire')) {
- $arrayresult['searchintoorder'] = array('position'=>70, 'img'=>'object_order', 'label'=>$langs->trans("SearchIntoCustomerOrders", $search_boxvalue), 'text'=>img_picto('', 'object_order', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoCustomerOrders", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/commande/list.php'.($search_boxvalue ? '?search_all='.urlencode($search_boxvalue) : ''));
+ $arrayresult['searchintoorder'] = array('position' => 70, 'img' => 'object_order', 'label' => $langs->trans("SearchIntoCustomerOrders", $search_boxvalue), 'text' => img_picto('', 'object_order', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoCustomerOrders", $search_boxvalue), 'url' => DOL_URL_ROOT.'/commande/list.php'.($search_boxvalue ? '?search_all='.urlencode($search_boxvalue) : ''));
}
if (isModEnabled('delivery_note') && !getDolGlobalString('MAIN_SEARCHFORM_CUSTOMER_SHIPMENT_DISABLED') && $user->hasRight('expedition', 'lire')) {
- $arrayresult['searchintoshipment'] = array('position'=>80, 'img'=>'object_shipment', 'label'=>$langs->trans("SearchIntoCustomerShipments", $search_boxvalue), 'text'=>img_picto('', 'object_shipment', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoCustomerShipments", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/expedition/list.php'.($search_boxvalue ? '?search_all='.urlencode($search_boxvalue) : ''));
+ $arrayresult['searchintoshipment'] = array('position' => 80, 'img' => 'object_shipment', 'label' => $langs->trans("SearchIntoCustomerShipments", $search_boxvalue), 'text' => img_picto('', 'object_shipment', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoCustomerShipments", $search_boxvalue), 'url' => DOL_URL_ROOT.'/expedition/list.php'.($search_boxvalue ? '?search_all='.urlencode($search_boxvalue) : ''));
}
if (isModEnabled('invoice') && !getDolGlobalString('MAIN_SEARCHFORM_CUSTOMER_INVOICE_DISABLED') && $user->hasRight('facture', 'lire')) {
- $arrayresult['searchintoinvoice'] = array('position'=>90, 'img'=>'object_bill', 'label'=>$langs->trans("SearchIntoCustomerInvoices", $search_boxvalue), 'text'=>img_picto('', 'object_bill', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoCustomerInvoices", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/compta/facture/list.php'.($search_boxvalue ? '?search_all='.urlencode($search_boxvalue) : ''));
+ $arrayresult['searchintoinvoice'] = array('position' => 90, 'img' => 'object_bill', 'label' => $langs->trans("SearchIntoCustomerInvoices", $search_boxvalue), 'text' => img_picto('', 'object_bill', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoCustomerInvoices", $search_boxvalue), 'url' => DOL_URL_ROOT.'/compta/facture/list.php'.($search_boxvalue ? '?search_all='.urlencode($search_boxvalue) : ''));
}
if (isModEnabled('supplier_proposal') && !getDolGlobalString('MAIN_SEARCHFORM_SUPPLIER_PROPAL_DISABLED') && $user->hasRight('supplier_proposal', 'lire')) {
- $arrayresult['searchintosupplierpropal'] = array('position'=>100, 'img'=>'object_supplier_proposal', 'label'=>$langs->trans("SearchIntoSupplierProposals", $search_boxvalue), 'text'=>img_picto('', 'object_supplier_proposal', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoSupplierProposals", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/supplier_proposal/list.php'.($search_boxvalue ? '?search_all='.urlencode($search_boxvalue) : ''));
+ $arrayresult['searchintosupplierpropal'] = array('position' => 100, 'img' => 'object_supplier_proposal', 'label' => $langs->trans("SearchIntoSupplierProposals", $search_boxvalue), 'text' => img_picto('', 'object_supplier_proposal', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoSupplierProposals", $search_boxvalue), 'url' => DOL_URL_ROOT.'/supplier_proposal/list.php'.($search_boxvalue ? '?search_all='.urlencode($search_boxvalue) : ''));
}
if (((isModEnabled('fournisseur') && !getDolGlobalString('MAIN_USE_NEW_SUPPLIERMOD') && $user->hasRight('fournisseur', 'commande', 'lire')) || (isModEnabled('supplier_order') && $user->hasRight('supplier_order', 'lire'))) && !getDolGlobalString('MAIN_SEARCHFORM_SUPPLIER_ORDER_DISABLED')) {
- $arrayresult['searchintosupplierorder'] = array('position'=>110, 'img'=>'object_supplier_order', 'label'=>$langs->trans("SearchIntoSupplierOrders", $search_boxvalue), 'text'=>img_picto('', 'object_supplier_order', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoSupplierOrders", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/fourn/commande/list.php'.($search_boxvalue ? '?search_all='.urlencode($search_boxvalue) : ''));
+ $arrayresult['searchintosupplierorder'] = array('position' => 110, 'img' => 'object_supplier_order', 'label' => $langs->trans("SearchIntoSupplierOrders", $search_boxvalue), 'text' => img_picto('', 'object_supplier_order', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoSupplierOrders", $search_boxvalue), 'url' => DOL_URL_ROOT.'/fourn/commande/list.php'.($search_boxvalue ? '?search_all='.urlencode($search_boxvalue) : ''));
}
if (((isModEnabled('fournisseur') && !getDolGlobalString('MAIN_USE_NEW_SUPPLIERMOD') && $user->hasRight('fournisseur', 'facture', 'lire')) || (isModEnabled('supplier_invoice') && $user->hasRight('supplier_invoice', 'lire'))) && !getDolGlobalString('MAIN_SEARCHFORM_SUPPLIER_INVOICE_DISABLED')) {
- $arrayresult['searchintosupplierinvoice'] = array('position'=>120, 'img'=>'object_supplier_invoice', 'label'=>$langs->trans("SearchIntoSupplierInvoices", $search_boxvalue), 'text'=>img_picto('', 'object_supplier_invoice', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoSupplierInvoices", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/fourn/facture/list.php'.($search_boxvalue ? '?search_all='.urlencode($search_boxvalue) : ''));
+ $arrayresult['searchintosupplierinvoice'] = array('position' => 120, 'img' => 'object_supplier_invoice', 'label' => $langs->trans("SearchIntoSupplierInvoices", $search_boxvalue), 'text' => img_picto('', 'object_supplier_invoice', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoSupplierInvoices", $search_boxvalue), 'url' => DOL_URL_ROOT.'/fourn/facture/list.php'.($search_boxvalue ? '?search_all='.urlencode($search_boxvalue) : ''));
}
// Customer payments
if (isModEnabled('invoice') && !getDolGlobalString('MAIN_SEARCHFORM_CUSTOMER_INVOICE_DISABLED') && $user->hasRight('facture', 'lire')) {
$arrayresult['searchintocustomerpayments'] = array(
- 'position'=>170,
- 'img'=>'object_payment',
- 'label'=>$langs->trans("SearchIntoCustomerPayments", $search_boxvalue),
- 'text'=>img_picto('', 'object_payment', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoCustomerPayments", $search_boxvalue),
- 'url'=>DOL_URL_ROOT.'/compta/paiement/list.php?leftmenu=customers_bills_payment'.($search_boxvalue ? '&search_all='.urlencode($search_boxvalue) : ''));
+ 'position' => 170,
+ 'img' => 'object_payment',
+ 'label' => $langs->trans("SearchIntoCustomerPayments", $search_boxvalue),
+ 'text' => img_picto('', 'object_payment', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoCustomerPayments", $search_boxvalue),
+ 'url' => DOL_URL_ROOT.'/compta/paiement/list.php?leftmenu=customers_bills_payment'.($search_boxvalue ? '&search_all='.urlencode($search_boxvalue) : ''));
}
// Vendor payments
if (((isModEnabled('fournisseur') && !getDolGlobalString('MAIN_USE_NEW_SUPPLIERMOD') && $user->hasRight('fournisseur', 'facture', 'lire')) || (isModEnabled('supplier_invoice') && $user->hasRight('supplier_invoice', 'lire'))) && !getDolGlobalString('MAIN_SEARCHFORM_SUPPLIER_INVOICE_DISABLED')) {
$arrayresult['searchintovendorpayments'] = array(
- 'position'=>175,
- 'img'=>'object_payment',
- 'label'=>$langs->trans("SearchIntoVendorPayments", $search_boxvalue),
- 'text'=>img_picto('', 'object_payment', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoVendorPayments", $search_boxvalue),
- 'url'=>DOL_URL_ROOT.'/fourn/paiement/list.php?leftmenu=suppliers_bills_payment'.($search_boxvalue ? '&search_all='.urlencode($search_boxvalue) : ''));
+ 'position' => 175,
+ 'img' => 'object_payment',
+ 'label' => $langs->trans("SearchIntoVendorPayments", $search_boxvalue),
+ 'text' => img_picto('', 'object_payment', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoVendorPayments", $search_boxvalue),
+ 'url' => DOL_URL_ROOT.'/fourn/paiement/list.php?leftmenu=suppliers_bills_payment'.($search_boxvalue ? '&search_all='.urlencode($search_boxvalue) : ''));
}
// Miscellaneous payments
if (isModEnabled('bank') && !getDolGlobalString('MAIN_SEARCHFORM_MISC_PAYMENTS_DISABLED') && $user->hasRight('banque', 'lire')) {
$arrayresult['searchintomiscpayments'] = array(
- 'position'=>180,
- 'img'=>'object_payment',
- 'label'=>$langs->trans("SearchIntoMiscPayments", $search_boxvalue),
- 'text'=>img_picto('', 'object_payment', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoMiscPayments", $search_boxvalue),
- 'url'=>DOL_URL_ROOT.'/compta/bank/various_payment/list.php?leftmenu=tax_various'.($search_boxvalue ? '&search_all='.urlencode($search_boxvalue) : ''));
+ 'position' => 180,
+ 'img' => 'object_payment',
+ 'label' => $langs->trans("SearchIntoMiscPayments", $search_boxvalue),
+ 'text' => img_picto('', 'object_payment', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoMiscPayments", $search_boxvalue),
+ 'url' => DOL_URL_ROOT.'/compta/bank/various_payment/list.php?leftmenu=tax_various'.($search_boxvalue ? '&search_all='.urlencode($search_boxvalue) : ''));
}
if (isModEnabled('contract') && !getDolGlobalString('MAIN_SEARCHFORM_CONTRACT_DISABLED') && $user->hasRight('contrat', 'lire')) {
- $arrayresult['searchintocontract'] = array('position'=>130, 'img'=>'object_contract', 'label'=>$langs->trans("SearchIntoContracts", $search_boxvalue), 'text'=>img_picto('', 'object_contract', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoContracts", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/contrat/list.php'.($search_boxvalue ? '?search_all='.urlencode($search_boxvalue) : ''));
+ $arrayresult['searchintocontract'] = array('position' => 130, 'img' => 'object_contract', 'label' => $langs->trans("SearchIntoContracts", $search_boxvalue), 'text' => img_picto('', 'object_contract', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoContracts", $search_boxvalue), 'url' => DOL_URL_ROOT.'/contrat/list.php'.($search_boxvalue ? '?search_all='.urlencode($search_boxvalue) : ''));
}
if (isModEnabled('intervention') && !getDolGlobalString('MAIN_SEARCHFORM_FICHINTER_DISABLED') && $user->hasRight('ficheinter', 'lire')) {
- $arrayresult['searchintointervention'] = array('position'=>140, 'img'=>'object_intervention', 'label'=>$langs->trans("SearchIntoInterventions", $search_boxvalue), 'text'=>img_picto('', 'object_intervention', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoInterventions", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/fichinter/list.php'.($search_boxvalue ? '?search_all='.urlencode($search_boxvalue) : ''));
+ $arrayresult['searchintointervention'] = array('position' => 140, 'img' => 'object_intervention', 'label' => $langs->trans("SearchIntoInterventions", $search_boxvalue), 'text' => img_picto('', 'object_intervention', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoInterventions", $search_boxvalue), 'url' => DOL_URL_ROOT.'/fichinter/list.php'.($search_boxvalue ? '?search_all='.urlencode($search_boxvalue) : ''));
}
if (isModEnabled('knowledgemanagement') && !getDolGlobalString('MAIN_SEARCHFORM_KNOWLEDGEMANAGEMENT_DISABLED') && $user->hasRight('knowledgemanagement', 'knowledgerecord', 'read')) {
- $arrayresult['searchintoknowledgemanagement'] = array('position'=>145, 'img'=>'object_knowledgemanagement', 'label'=>$langs->trans("SearchIntoKM", $search_boxvalue), 'text'=>img_picto('', 'object_knowledgemanagement', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoKM", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/knowledgemanagement/knowledgerecord_list.php?mainmenu=ticket'.($search_boxvalue ? '&search_all='.urlencode($search_boxvalue) : ''));
+ $arrayresult['searchintoknowledgemanagement'] = array('position' => 145, 'img' => 'object_knowledgemanagement', 'label' => $langs->trans("SearchIntoKM", $search_boxvalue), 'text' => img_picto('', 'object_knowledgemanagement', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoKM", $search_boxvalue), 'url' => DOL_URL_ROOT.'/knowledgemanagement/knowledgerecord_list.php?mainmenu=ticket'.($search_boxvalue ? '&search_all='.urlencode($search_boxvalue) : ''));
}
if (isModEnabled('ticket') && !getDolGlobalString('MAIN_SEARCHFORM_TICKET_DISABLED') && $user->hasRight('ticket', 'read')) {
- $arrayresult['searchintotickets'] = array('position'=>146, 'img'=>'object_ticket', 'label'=>$langs->trans("SearchIntoTickets", $search_boxvalue), 'text'=>img_picto('', 'object_ticket', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoTickets", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/ticket/list.php?mainmenu=ticket'.($search_boxvalue ? '&search_all='.urlencode($search_boxvalue) : ''));
+ $arrayresult['searchintotickets'] = array('position' => 146, 'img' => 'object_ticket', 'label' => $langs->trans("SearchIntoTickets", $search_boxvalue), 'text' => img_picto('', 'object_ticket', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoTickets", $search_boxvalue), 'url' => DOL_URL_ROOT.'/ticket/list.php?mainmenu=ticket'.($search_boxvalue ? '&search_all='.urlencode($search_boxvalue) : ''));
}
// HR
if (isModEnabled('user') && !getDolGlobalString('MAIN_SEARCHFORM_USER_DISABLED') && $user->hasRight('user', 'user', 'lire')) {
- $arrayresult['searchintouser'] = array('position'=>200, 'shortcut'=>'U', 'img'=>'object_user', 'label'=>$langs->trans("SearchIntoUsers", $search_boxvalue), 'text'=>img_picto('', 'object_user', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoUsers", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/user/list.php'.($search_boxvalue ? '?search_all='.urlencode($search_boxvalue) : ''));
+ $arrayresult['searchintouser'] = array('position' => 200, 'shortcut' => 'U', 'img' => 'object_user', 'label' => $langs->trans("SearchIntoUsers", $search_boxvalue), 'text' => img_picto('', 'object_user', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoUsers", $search_boxvalue), 'url' => DOL_URL_ROOT.'/user/list.php'.($search_boxvalue ? '?search_all='.urlencode($search_boxvalue) : ''));
}
if (isModEnabled('expensereport') && !getDolGlobalString('MAIN_SEARCHFORM_EXPENSEREPORT_DISABLED') && $user->hasRight('expensereport', 'lire')) {
- $arrayresult['searchintoexpensereport'] = array('position'=>210, 'img'=>'object_trip', 'label'=>$langs->trans("SearchIntoExpenseReports", $search_boxvalue), 'text'=>img_picto('', 'object_trip', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoExpenseReports", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/expensereport/list.php?mainmenu=hrm'.($search_boxvalue ? '&search_all='.urlencode($search_boxvalue) : ''));
+ $arrayresult['searchintoexpensereport'] = array('position' => 210, 'img' => 'object_trip', 'label' => $langs->trans("SearchIntoExpenseReports", $search_boxvalue), 'text' => img_picto('', 'object_trip', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoExpenseReports", $search_boxvalue), 'url' => DOL_URL_ROOT.'/expensereport/list.php?mainmenu=hrm'.($search_boxvalue ? '&search_all='.urlencode($search_boxvalue) : ''));
}
if (isModEnabled('holiday') && !getDolGlobalString('MAIN_SEARCHFORM_HOLIDAY_DISABLED') && $user->hasRight('holiday', 'read')) {
- $arrayresult['searchintoleaves'] = array('position'=>220, 'img'=>'object_holiday', 'label'=>$langs->trans("SearchIntoLeaves", $search_boxvalue), 'text'=>img_picto('', 'object_holiday', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoLeaves", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/holiday/list.php?mainmenu=hrm'.($search_boxvalue ? '&search_all='.urlencode($search_boxvalue) : ''));
+ $arrayresult['searchintoleaves'] = array('position' => 220, 'img' => 'object_holiday', 'label' => $langs->trans("SearchIntoLeaves", $search_boxvalue), 'text' => img_picto('', 'object_holiday', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoLeaves", $search_boxvalue), 'url' => DOL_URL_ROOT.'/holiday/list.php?mainmenu=hrm'.($search_boxvalue ? '&search_all='.urlencode($search_boxvalue) : ''));
}
// Execute hook addSearchEntry
-$parameters = array('search_boxvalue'=>$search_boxvalue, 'arrayresult'=>$arrayresult);
+$parameters = array('search_boxvalue' => $search_boxvalue, 'arrayresult' => $arrayresult);
$reshook = $hookmanager->executeHooks('addSearchEntry', $parameters);
if (empty($reshook)) {
$arrayresult = array_merge($arrayresult, $hookmanager->resArray);
diff --git a/htdocs/core/ajax/ziptown.php b/htdocs/core/ajax/ziptown.php
index 999ba16e49e..21ccd582933 100644
--- a/htdocs/core/ajax/ziptown.php
+++ b/htdocs/core/ajax/ziptown.php
@@ -111,6 +111,7 @@ if (GETPOST('zipcode') || GETPOST('town')) {
//var_dump($db);
if ($resql) {
while ($row = $db->fetch_array($resql)) {
+ $row_array = [];
$country = $row['country_id'] ? ($langs->transnoentitiesnoconv('Country'.$row['country_code']) != 'Country'.$row['country_code'] ? $langs->transnoentitiesnoconv('Country'.$row['country_code']) : $row['country_label']) : '';
$county = $row['state_id'] ? ($langs->transnoentitiesnoconv($row['state_code']) != $row['state_code'] ? $langs->transnoentitiesnoconv($row['state_code']) : ($row['state_label'] != '-' ? $row['state_label'] : '')) : '';
diff --git a/htdocs/core/boxes/box_members_by_tags.php b/htdocs/core/boxes/box_members_by_tags.php
index 429b8fba2d7..99c71e59063 100644
--- a/htdocs/core/boxes/box_members_by_tags.php
+++ b/htdocs/core/boxes/box_members_by_tags.php
@@ -89,7 +89,7 @@ class box_members_by_tags extends ModeleBoxes
$stats = new AdherentStats($this->db, $user->socid, $user->id);
// Show array
- $sumMembers= $stats->countMembersByTagAndStatus($numberyears);
+ $sumMembers = $stats->countMembersByTagAndStatus($numberyears);
if ($sumMembers) {
$line = 0;
$this->info_box_contents[$line][] = array(
@@ -138,11 +138,12 @@ class box_members_by_tags extends ModeleBoxes
'text' => $langs->trans("Total")
);
$line++;
+ $AdherentTag = array();
foreach ($sumMembers as $key => $data) {
$adhtag = new Categorie($this->db);
$adhtag->id = $key;
- if ($key=='total') {
+ if ($key == 'total') {
break;
}
$adhtag->label = $data['label'];
diff --git a/htdocs/core/boxes/box_members_by_type.php b/htdocs/core/boxes/box_members_by_type.php
index f5412dec5ea..05f886e2858 100644
--- a/htdocs/core/boxes/box_members_by_type.php
+++ b/htdocs/core/boxes/box_members_by_type.php
@@ -82,7 +82,7 @@ class box_members_by_type extends ModeleBoxes
$year = date('Y');
$numberyears = getDolGlobalInt("MAIN_NB_OF_YEAR_IN_MEMBERSHIP_WIDGET_GRAPH");
- $this->info_box_head = array('text' => $langs->trans("BoxTitleMembersByType").($numberyears ? ' ('.($year-$numberyears).' - '.$year.')' : ''));
+ $this->info_box_head = array('text' => $langs->trans("BoxTitleMembersByType").($numberyears ? ' ('.($year - $numberyears).' - '.$year.')' : ''));
if ($user->hasRight('adherent', 'lire')) {
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherentstats.class.php';
@@ -138,11 +138,12 @@ class box_members_by_type extends ModeleBoxes
'text' => $langs->trans("Total")
);
$line++;
+ $AdherentType = array();
foreach ($sumMembers as $key => $data) {
$adhtype = new AdherentType($this->db);
$adhtype->id = $key;
- if ($key=='total') {
+ if ($key == 'total') {
break;
}
$adhtype->label = $data['label'];
diff --git a/htdocs/core/boxes/modules_boxes.php b/htdocs/core/boxes/modules_boxes.php
index 9be28e8bfc0..3ada87e0a10 100644
--- a/htdocs/core/boxes/modules_boxes.php
+++ b/htdocs/core/boxes/modules_boxes.php
@@ -3,6 +3,7 @@
* Copyright (C) 2005-2012 Regis Houssin
* Copyright (C) 2014 Raphaël Doursenaud
* Copyright (C) 2015 Frederic France
+ * Copyright (C) 2024 MDW
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -194,7 +195,7 @@ class ModeleBoxes // Can't be abstract as it is instantiated to build "empty" bo
* Standard method to show a box (usage by boxes not mandatory, a box can still use its own showBox function)
*
* @param array $head Array with properties of box title
- * @param array $contents Array with properties of box lines
+ * @param array> $contents Array with properties of box lines
* @param int $nooutput No print, only return string
* @return string
*/
diff --git a/htdocs/core/class/cgenericdic.class.php b/htdocs/core/class/cgenericdic.class.php
index 9c617d9c78d..c39f8cbbf23 100644
--- a/htdocs/core/class/cgenericdic.class.php
+++ b/htdocs/core/class/cgenericdic.class.php
@@ -4,6 +4,7 @@
* Copyright (C) 2016 Florian Henry
* Copyright (C) 2015 Raphaël Doursenaud
* Copyright (C) 2024 Frédéric France
+ * Copyright (C) 2024 MDW
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -220,16 +221,15 @@ class CGenericDic extends CommonDict
/**
* Load object in memory from the database
*
- * @param string $sortorder Sort Order
- * @param string $sortfield Sort field
- * @param int $limit offset limit
- * @param int $offset offset limit
- * @param array $filter filter array
- * @param string $filtermode filter mode (AND or OR)
- *
- * @return int Return integer <0 if KO, >0 if OK
+ * @param string $sortorder Sort Order
+ * @param string $sortfield Sort field
+ * @param int $limit Limit
+ * @param int $offset offset limit
+ * @param string|array $filter filter USF
+ * @param string $filtermode filter mode (AND or OR)
+ * @return int Return integer <0 if KO, >0 if OK
*/
- public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = 0, array $filter = array(), $filtermode = 'AND')
+ public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = 0, $filter = '', $filtermode = 'AND')
{
dol_syslog(__METHOD__, LOG_DEBUG);
@@ -243,23 +243,36 @@ class CGenericDic extends CommonDict
}
$sql = "SELECT";
- $sql .= " t.".$fieldrowid.",";
+ $sql .= " t.".$this->db->sanitize($fieldrowid).",";
$sql .= " t.code,";
- $sql .= " t.".$fieldlabel." as label,";
+ $sql .= " t.".$this->db->sanitize($fieldlabel)." as label,";
$sql .= " t.active";
$sql .= " FROM ".$this->db->prefix().$this->table_element." as t";
// Manage filter
- $sqlwhere = array();
- if (count($filter) > 0) {
- foreach ($filter as $key => $value) {
- $sqlwhere[] = $key." LIKE '%".$this->db->escape($value)."%'";
+ if (is_array($filter)) {
+ $sqlwhere = array();
+ if (count($filter) > 0) {
+ foreach ($filter as $key => $value) {
+ $sqlwhere[] = $this->db->sanitize($key)." LIKE '%".$this->db->escape($value)."%'";
+ }
}
+ if (count($sqlwhere) > 0) {
+ $sql .= " WHERE ".implode(' '.$this->db->escape($filtermode).' ', $sqlwhere);
+ }
+
+ $filter = '';
}
- if (count($sqlwhere) > 0) {
- $sql .= " WHERE ".implode(' '.$this->db->escape($filtermode).' ', $sqlwhere);
+ // Manage filter
+ $errormessage = '';
+ $sql .= forgeSQLFromUniversalSearchCriteria($filter, $errormessage);
+ if ($errormessage) {
+ $this->errors[] = $errormessage;
+ dol_syslog(__METHOD__.' '.implode(',', $this->errors), LOG_ERR);
+ return -1;
}
+
if (!empty($sortfield)) {
$sql .= $this->db->order($sortfield, $sortorder);
}
diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php
index 75b45b1850a..b80ce304f94 100644
--- a/htdocs/core/class/commondocgenerator.class.php
+++ b/htdocs/core/class/commondocgenerator.class.php
@@ -111,7 +111,18 @@ abstract class CommonDocGenerator
public $tva;
public $tva_array;
+ /**
+ * Local tax rates Array[tax_type][tax_rate]
+ *
+ * @var array>
+ */
public $localtax1;
+
+ /**
+ * Local tax rates Array[tax_type][tax_rate]
+ *
+ * @var array>
+ */
public $localtax2;
/**
@@ -196,28 +207,28 @@ abstract class CommonDocGenerator
$logotouse = $conf->user->dir_output . '/' . get_exdir(0, 0, 0, 0, $user, 'user') . 'photos/' . getImageFileNameForSize($user->photo, '_small');
$array_user = array(
- 'myuser_lastname'=>$user->lastname,
- 'myuser_firstname'=>$user->firstname,
- 'myuser_fullname'=>$user->getFullName($outputlangs, 1),
- 'myuser_login'=>$user->login,
- 'myuser_phone'=>$user->office_phone,
- 'myuser_address'=>$user->address,
- 'myuser_zip'=>$user->zip,
- 'myuser_town'=>$user->town,
- 'myuser_country'=>$user->country,
- 'myuser_country_code'=>$user->country_code,
- 'myuser_state'=>$user->state,
- 'myuser_state_code'=>$user->state_code,
- 'myuser_fax'=>$user->office_fax,
- 'myuser_mobile'=>$user->user_mobile,
- 'myuser_email'=>$user->email,
- 'myuser_logo'=>$logotouse,
- 'myuser_job'=>$user->job,
- 'myuser_web'=>'', // url not exist in $user object
- 'myuser_birth'=>dol_print_date($user->birth, 'day', 'gmt'),
- 'myuser_dateemployment'=>dol_print_date($user->dateemployment, 'day', 'tzuser'),
- 'myuser_dateemploymentend'=>dol_print_date($user->dateemploymentend, 'day', 'tzuser'),
- 'myuser_gender'=>$user->gender,
+ 'myuser_lastname' => $user->lastname,
+ 'myuser_firstname' => $user->firstname,
+ 'myuser_fullname' => $user->getFullName($outputlangs, 1),
+ 'myuser_login' => $user->login,
+ 'myuser_phone' => $user->office_phone,
+ 'myuser_address' => $user->address,
+ 'myuser_zip' => $user->zip,
+ 'myuser_town' => $user->town,
+ 'myuser_country' => $user->country,
+ 'myuser_country_code' => $user->country_code,
+ 'myuser_state' => $user->state,
+ 'myuser_state_code' => $user->state_code,
+ 'myuser_fax' => $user->office_fax,
+ 'myuser_mobile' => $user->user_mobile,
+ 'myuser_email' => $user->email,
+ 'myuser_logo' => $logotouse,
+ 'myuser_job' => $user->job,
+ 'myuser_web' => '', // url not exist in $user object
+ 'myuser_birth' => dol_print_date($user->birth, 'day', 'gmt'),
+ 'myuser_dateemployment' => dol_print_date($user->dateemployment, 'day', 'tzuser'),
+ 'myuser_dateemploymentend' => dol_print_date($user->dateemploymentend, 'day', 'tzuser'),
+ 'myuser_gender' => $user->gender,
);
// Retrieve extrafields
if (is_array($user->array_options) && count($user->array_options)) {
@@ -299,32 +310,32 @@ abstract class CommonDocGenerator
$logotouse = $conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_small;
return array(
- 'mycompany_logo'=>$logotouse,
- 'mycompany_name'=>$mysoc->name,
- 'mycompany_email'=>$mysoc->email,
- 'mycompany_phone'=>$mysoc->phone,
- 'mycompany_fax'=>$mysoc->fax,
- 'mycompany_address'=>$mysoc->address,
- 'mycompany_zip'=>$mysoc->zip,
- 'mycompany_town'=>$mysoc->town,
- 'mycompany_country'=>$mysoc->country,
- 'mycompany_country_code'=>$mysoc->country_code,
- 'mycompany_state'=>$mysoc->state,
- 'mycompany_state_code'=>$mysoc->state_code,
- 'mycompany_web'=>$mysoc->url,
- 'mycompany_juridicalstatus'=>$mysoc->forme_juridique,
- 'mycompany_managers'=>$mysoc->managers,
- 'mycompany_capital'=>$mysoc->capital,
- 'mycompany_barcode'=>$mysoc->barcode,
- 'mycompany_idprof1'=>$mysoc->idprof1,
- 'mycompany_idprof2'=>$mysoc->idprof2,
- 'mycompany_idprof3'=>$mysoc->idprof3,
- 'mycompany_idprof4'=>$mysoc->idprof4,
- 'mycompany_idprof5'=>$mysoc->idprof5,
- 'mycompany_idprof6'=>$mysoc->idprof6,
- 'mycompany_vatnumber'=>$mysoc->tva_intra,
- 'mycompany_socialobject'=>$mysoc->socialobject,
- 'mycompany_note_private'=>$mysoc->note_private,
+ 'mycompany_logo' => $logotouse,
+ 'mycompany_name' => $mysoc->name,
+ 'mycompany_email' => $mysoc->email,
+ 'mycompany_phone' => $mysoc->phone,
+ 'mycompany_fax' => $mysoc->fax,
+ 'mycompany_address' => $mysoc->address,
+ 'mycompany_zip' => $mysoc->zip,
+ 'mycompany_town' => $mysoc->town,
+ 'mycompany_country' => $mysoc->country,
+ 'mycompany_country_code' => $mysoc->country_code,
+ 'mycompany_state' => $mysoc->state,
+ 'mycompany_state_code' => $mysoc->state_code,
+ 'mycompany_web' => $mysoc->url,
+ 'mycompany_juridicalstatus' => $mysoc->forme_juridique,
+ 'mycompany_managers' => $mysoc->managers,
+ 'mycompany_capital' => $mysoc->capital,
+ 'mycompany_barcode' => $mysoc->barcode,
+ 'mycompany_idprof1' => $mysoc->idprof1,
+ 'mycompany_idprof2' => $mysoc->idprof2,
+ 'mycompany_idprof3' => $mysoc->idprof3,
+ 'mycompany_idprof4' => $mysoc->idprof4,
+ 'mycompany_idprof5' => $mysoc->idprof5,
+ 'mycompany_idprof6' => $mysoc->idprof6,
+ 'mycompany_vatnumber' => $mysoc->tva_intra,
+ 'mycompany_socialobject' => $mysoc->socialobject,
+ 'mycompany_note_private' => $mysoc->note_private,
//'mycompany_note_public'=>$mysoc->note_public, // Only private not exists for "mysoc" but both for thirdparties
);
}
@@ -353,38 +364,38 @@ abstract class CommonDocGenerator
}
$array_thirdparty = array(
- 'company_name'=>$object->name,
+ 'company_name' => $object->name,
'company_name_alias' => $object->name_alias,
- 'company_email'=>$object->email,
- 'company_phone'=>$object->phone,
- 'company_fax'=>$object->fax,
- 'company_address'=>$object->address,
- 'company_zip'=>$object->zip,
- 'company_town'=>$object->town,
- 'company_country'=>$object->country,
- 'company_country_code'=>$object->country_code,
- 'company_state'=>$object->state,
- 'company_state_code'=>$object->state_code,
- 'company_web'=>$object->url,
- 'company_barcode'=>$object->barcode,
- 'company_vatnumber'=>$object->tva_intra,
- 'company_customercode'=>$object->code_client,
- 'company_suppliercode'=>$object->code_fournisseur,
- 'company_customeraccountancycode'=>$object->code_compta,
- 'company_supplieraccountancycode'=>$object->code_compta_fournisseur,
- 'company_juridicalstatus'=>$object->forme_juridique,
- 'company_outstanding_limit'=>$object->outstanding_limit,
- 'company_capital'=>$object->capital,
- 'company_idprof1'=>$object->idprof1,
- 'company_idprof2'=>$object->idprof2,
- 'company_idprof3'=>$object->idprof3,
- 'company_idprof4'=>$object->idprof4,
- 'company_idprof5'=>$object->idprof5,
- 'company_idprof6'=>$object->idprof6,
- 'company_note_public'=>$object->note_public,
- 'company_note_private'=>$object->note_private,
- 'company_default_bank_iban'=>(is_object($object->bank_account) ? $object->bank_account->iban : ''),
- 'company_default_bank_bic'=>(is_object($object->bank_account) ? $object->bank_account->bic : '')
+ 'company_email' => $object->email,
+ 'company_phone' => $object->phone,
+ 'company_fax' => $object->fax,
+ 'company_address' => $object->address,
+ 'company_zip' => $object->zip,
+ 'company_town' => $object->town,
+ 'company_country' => $object->country,
+ 'company_country_code' => $object->country_code,
+ 'company_state' => $object->state,
+ 'company_state_code' => $object->state_code,
+ 'company_web' => $object->url,
+ 'company_barcode' => $object->barcode,
+ 'company_vatnumber' => $object->tva_intra,
+ 'company_customercode' => $object->code_client,
+ 'company_suppliercode' => $object->code_fournisseur,
+ 'company_customeraccountancycode' => $object->code_compta,
+ 'company_supplieraccountancycode' => $object->code_compta_fournisseur,
+ 'company_juridicalstatus' => $object->forme_juridique,
+ 'company_outstanding_limit' => $object->outstanding_limit,
+ 'company_capital' => $object->capital,
+ 'company_idprof1' => $object->idprof1,
+ 'company_idprof2' => $object->idprof2,
+ 'company_idprof3' => $object->idprof3,
+ 'company_idprof4' => $object->idprof4,
+ 'company_idprof5' => $object->idprof5,
+ 'company_idprof6' => $object->idprof6,
+ 'company_note_public' => $object->note_public,
+ 'company_note_private' => $object->note_private,
+ 'company_default_bank_iban' => (is_object($object->bank_account) ? $object->bank_account->iban : ''),
+ 'company_default_bank_bic' => (is_object($object->bank_account) ? $object->bank_account->bic : '')
);
// Retrieve extrafields
@@ -471,15 +482,15 @@ abstract class CommonDocGenerator
$now = dol_now('gmt'); // gmt
$array_other = array(
// Date in default language
- 'current_date'=>dol_print_date($now, 'day', 'tzuser'),
- 'current_datehour'=>dol_print_date($now, 'dayhour', 'tzuser'),
- 'current_server_date'=>dol_print_date($now, 'day', 'tzserver'),
- 'current_server_datehour'=>dol_print_date($now, 'dayhour', 'tzserver'),
+ 'current_date' => dol_print_date($now, 'day', 'tzuser'),
+ 'current_datehour' => dol_print_date($now, 'dayhour', 'tzuser'),
+ 'current_server_date' => dol_print_date($now, 'day', 'tzserver'),
+ 'current_server_datehour' => dol_print_date($now, 'dayhour', 'tzserver'),
// Date in requested output language
- 'current_date_locale'=>dol_print_date($now, 'day', 'tzuser', $outputlangs),
- 'current_datehour_locale'=>dol_print_date($now, 'dayhour', 'tzuser', $outputlangs),
- 'current_server_date_locale'=>dol_print_date($now, 'day', 'tzserver', $outputlangs),
- 'current_server_datehour_locale'=>dol_print_date($now, 'dayhour', 'tzserver', $outputlangs),
+ 'current_date_locale' => dol_print_date($now, 'day', 'tzuser', $outputlangs),
+ 'current_datehour_locale' => dol_print_date($now, 'dayhour', 'tzuser', $outputlangs),
+ 'current_server_date_locale' => dol_print_date($now, 'day', 'tzserver', $outputlangs),
+ 'current_server_datehour_locale' => dol_print_date($now, 'dayhour', 'tzserver', $outputlangs),
);
@@ -534,45 +545,45 @@ abstract class CommonDocGenerator
$object->date_commande = $object->date;
}
$resarray = array(
- $array_key.'_id'=>$object->id,
+ $array_key.'_id' => $object->id,
$array_key.'_ref' => (property_exists($object, 'ref') ? $object->ref : ''),
$array_key.'_label' => (property_exists($object, 'label') ? $object->label : ''),
$array_key.'_ref_ext' => (property_exists($object, 'ref_ext') ? $object->ref_ext : ''),
- $array_key.'_ref_customer'=>(!empty($object->ref_client) ? $object->ref_client : (empty($object->ref_customer) ? '' : $object->ref_customer)),
- $array_key.'_ref_supplier'=>(!empty($object->ref_fournisseur) ? $object->ref_fournisseur : (empty($object->ref_supplier) ? '' : $object->ref_supplier)),
- $array_key.'_source_invoice_ref'=>((empty($invoice_source) || empty($invoice_source->ref)) ? '' : $invoice_source->ref),
+ $array_key.'_ref_customer' => (!empty($object->ref_client) ? $object->ref_client : (empty($object->ref_customer) ? '' : $object->ref_customer)),
+ $array_key.'_ref_supplier' => (!empty($object->ref_fournisseur) ? $object->ref_fournisseur : (empty($object->ref_supplier) ? '' : $object->ref_supplier)),
+ $array_key.'_source_invoice_ref' => ((empty($invoice_source) || empty($invoice_source->ref)) ? '' : $invoice_source->ref),
// Dates
- $array_key.'_hour'=>dol_print_date($date, 'hour'),
- $array_key.'_date'=>dol_print_date($date, 'day'),
- $array_key.'_date_rfc'=>dol_print_date($date, 'dayrfc'),
- $array_key.'_date_limit'=>(!empty($object->date_lim_reglement) ? dol_print_date($object->date_lim_reglement, 'day') : ''),
- $array_key.'_date_limit_rfc'=>(!empty($object->date_lim_reglement) ? dol_print_date($object->date_lim_reglement, 'dayrfc') : ''),
- $array_key.'_date_end'=>(!empty($object->fin_validite) ? dol_print_date($object->fin_validite, 'day') : ''),
- $array_key.'_date_creation'=>dol_print_date($object->date_creation, 'day'),
- $array_key.'_date_modification'=>(!empty($object->date_modification) ? dol_print_date($object->date_modification, 'day') : ''),
- $array_key.'_date_validation'=>(!empty($object->date_validation) ? dol_print_date($object->date_validation, 'dayhour') : ''),
- $array_key.'_date_approve'=>(!empty($object->date_approve) ? dol_print_date($object->date_approve, 'day') : ''),
- $array_key.'_date_delivery_planed'=>(!empty($object->delivery_date) ? dol_print_date($object->delivery_date, 'day') : ''),
- $array_key.'_date_close'=>(!empty($object->date_cloture) ? dol_print_date($object->date_cloture, 'dayhour') : ''),
+ $array_key.'_hour' => dol_print_date($date, 'hour'),
+ $array_key.'_date' => dol_print_date($date, 'day'),
+ $array_key.'_date_rfc' => dol_print_date($date, 'dayrfc'),
+ $array_key.'_date_limit' => (!empty($object->date_lim_reglement) ? dol_print_date($object->date_lim_reglement, 'day') : ''),
+ $array_key.'_date_limit_rfc' => (!empty($object->date_lim_reglement) ? dol_print_date($object->date_lim_reglement, 'dayrfc') : ''),
+ $array_key.'_date_end' => (!empty($object->fin_validite) ? dol_print_date($object->fin_validite, 'day') : ''),
+ $array_key.'_date_creation' => dol_print_date($object->date_creation, 'day'),
+ $array_key.'_date_modification' => (!empty($object->date_modification) ? dol_print_date($object->date_modification, 'day') : ''),
+ $array_key.'_date_validation' => (!empty($object->date_validation) ? dol_print_date($object->date_validation, 'dayhour') : ''),
+ $array_key.'_date_approve' => (!empty($object->date_approve) ? dol_print_date($object->date_approve, 'day') : ''),
+ $array_key.'_date_delivery_planed' => (!empty($object->delivery_date) ? dol_print_date($object->delivery_date, 'day') : ''),
+ $array_key.'_date_close' => (!empty($object->date_cloture) ? dol_print_date($object->date_cloture, 'dayhour') : ''),
- $array_key.'_payment_mode_code'=>$object->mode_reglement_code,
- $array_key.'_payment_mode'=>($outputlangs->transnoentitiesnoconv('PaymentType'.$object->mode_reglement_code) != 'PaymentType'.$object->mode_reglement_code ? $outputlangs->transnoentitiesnoconv('PaymentType'.$object->mode_reglement_code) : $object->mode_reglement),
- $array_key.'_payment_term_code'=>$object->cond_reglement_code,
- $array_key.'_payment_term'=>($outputlangs->transnoentitiesnoconv('PaymentCondition'.$object->cond_reglement_code) != 'PaymentCondition'.$object->cond_reglement_code ? $outputlangs->transnoentitiesnoconv('PaymentCondition'.$object->cond_reglement_code) : ($object->cond_reglement_doc ? $object->cond_reglement_doc : $object->cond_reglement)),
+ $array_key.'_payment_mode_code' => $object->mode_reglement_code,
+ $array_key.'_payment_mode' => ($outputlangs->transnoentitiesnoconv('PaymentType'.$object->mode_reglement_code) != 'PaymentType'.$object->mode_reglement_code ? $outputlangs->transnoentitiesnoconv('PaymentType'.$object->mode_reglement_code) : $object->mode_reglement),
+ $array_key.'_payment_term_code' => $object->cond_reglement_code,
+ $array_key.'_payment_term' => ($outputlangs->transnoentitiesnoconv('PaymentCondition'.$object->cond_reglement_code) != 'PaymentCondition'.$object->cond_reglement_code ? $outputlangs->transnoentitiesnoconv('PaymentCondition'.$object->cond_reglement_code) : ($object->cond_reglement_doc ? $object->cond_reglement_doc : $object->cond_reglement)),
$array_key.'_incoterms' => (method_exists($object, 'display_incoterms') ? $object->display_incoterms() : ''),
- $array_key.'_total_ht_locale'=>price($object->total_ht, 0, $outputlangs),
- $array_key.'_total_vat_locale'=>(!empty($object->total_vat) ? price($object->total_vat, 0, $outputlangs) : price($object->total_tva, 0, $outputlangs)),
- $array_key.'_total_localtax1_locale'=>price($object->total_localtax1, 0, $outputlangs),
- $array_key.'_total_localtax2_locale'=>price($object->total_localtax2, 0, $outputlangs),
- $array_key.'_total_ttc_locale'=>price($object->total_ttc, 0, $outputlangs),
+ $array_key.'_total_ht_locale' => price($object->total_ht, 0, $outputlangs),
+ $array_key.'_total_vat_locale' => (!empty($object->total_vat) ? price($object->total_vat, 0, $outputlangs) : price($object->total_tva, 0, $outputlangs)),
+ $array_key.'_total_localtax1_locale' => price($object->total_localtax1, 0, $outputlangs),
+ $array_key.'_total_localtax2_locale' => price($object->total_localtax2, 0, $outputlangs),
+ $array_key.'_total_ttc_locale' => price($object->total_ttc, 0, $outputlangs),
- $array_key.'_total_ht'=>price2num($object->total_ht),
- $array_key.'_total_vat'=>(!empty($object->total_vat) ? price2num($object->total_vat) : price2num($object->total_tva)),
- $array_key.'_total_localtax1'=>price2num($object->total_localtax1),
- $array_key.'_total_localtax2'=>price2num($object->total_localtax2),
- $array_key.'_total_ttc'=>price2num($object->total_ttc),
+ $array_key.'_total_ht' => price2num($object->total_ht),
+ $array_key.'_total_vat' => (!empty($object->total_vat) ? price2num($object->total_vat) : price2num($object->total_tva)),
+ $array_key.'_total_localtax1' => price2num($object->total_localtax1),
+ $array_key.'_total_localtax2' => price2num($object->total_localtax2),
+ $array_key.'_total_ttc' => price2num($object->total_ttc),
$array_key.'_multicurrency_code' => $object->multicurrency_code,
$array_key.'_multicurrency_tx' => price2num($object->multicurrency_tx),
@@ -583,24 +594,24 @@ abstract class CommonDocGenerator
$array_key.'_multicurrency_total_tva_locale' => price($object->multicurrency_total_tva, 0, $outputlangs),
$array_key.'_multicurrency_total_ttc_locale' => price($object->multicurrency_total_ttc, 0, $outputlangs),
- $array_key.'_note_private'=>$object->note_private,
- $array_key.'_note_public'=>$object->note_public,
- $array_key.'_note'=>$object->note_public, // For backward compatibility
+ $array_key.'_note_private' => $object->note_private,
+ $array_key.'_note_public' => $object->note_public,
+ $array_key.'_note' => $object->note_public, // For backward compatibility
// Payments
- $array_key.'_already_payed_locale'=>price($sumpayed, 0, $outputlangs),
- $array_key.'_already_payed'=>price2num($sumpayed),
- $array_key.'_already_deposit_locale'=>price($sumdeposit, 0, $outputlangs),
- $array_key.'_already_deposit'=>price2num($sumdeposit),
- $array_key.'_already_creditnote_locale'=>price($sumcreditnote, 0, $outputlangs),
- $array_key.'_already_creditnote'=>price2num($sumcreditnote),
+ $array_key.'_already_payed_locale' => price($sumpayed, 0, $outputlangs),
+ $array_key.'_already_payed' => price2num($sumpayed),
+ $array_key.'_already_deposit_locale' => price($sumdeposit, 0, $outputlangs),
+ $array_key.'_already_deposit' => price2num($sumdeposit),
+ $array_key.'_already_creditnote_locale' => price($sumcreditnote, 0, $outputlangs),
+ $array_key.'_already_creditnote' => price2num($sumcreditnote),
- $array_key.'_already_payed_all_locale'=>price(price2num($already_payed_all, 'MT'), 0, $outputlangs),
- $array_key.'_already_payed_all'=> price2num($already_payed_all, 'MT'),
+ $array_key.'_already_payed_all_locale' => price(price2num($already_payed_all, 'MT'), 0, $outputlangs),
+ $array_key.'_already_payed_all' => price2num($already_payed_all, 'MT'),
// Remain to pay with all known information (except open direct debit requests)
- $array_key.'_remain_to_pay_locale'=>price(price2num($object->total_ttc - $already_payed_all, 'MT'), 0, $outputlangs),
- $array_key.'_remain_to_pay'=>price2num($object->total_ttc - $already_payed_all, 'MT')
+ $array_key.'_remain_to_pay_locale' => price(price2num($object->total_ttc - $already_payed_all, 'MT'), 0, $outputlangs),
+ $array_key.'_remain_to_pay' => price2num($object->total_ttc - $already_payed_all, 'MT')
);
if (in_array($object->element, array('facture', 'invoice', 'supplier_invoice', 'facture_fournisseur'))) {
@@ -616,10 +627,10 @@ abstract class CommonDocGenerator
$resarray[$array_key.'_bank_bic'] = (empty($bank_account) ? '' : $bank_account->bic);
$resarray[$array_key.'_bank_label'] = (empty($bank_account) ? '' : $bank_account->label);
$resarray[$array_key.'_bank_number'] = (empty($bank_account) ? '' : $bank_account->number);
- $resarray[$array_key.'_bank_proprio'] =(empty($bank_account) ? '' : $bank_account->proprio);
- $resarray[$array_key.'_bank_address'] =(empty($bank_account) ? '' : $bank_account->address);
- $resarray[$array_key.'_bank_state'] =(empty($bank_account) ? '' : $bank_account->state);
- $resarray[$array_key.'_bank_country'] =(empty($bank_account) ? '' : $bank_account->country);
+ $resarray[$array_key.'_bank_proprio'] = (empty($bank_account) ? '' : $bank_account->proprio);
+ $resarray[$array_key.'_bank_address'] = (empty($bank_account) ? '' : $bank_account->address);
+ $resarray[$array_key.'_bank_state'] = (empty($bank_account) ? '' : $bank_account->state);
+ $resarray[$array_key.'_bank_country'] = (empty($bank_account) ? '' : $bank_account->country);
}
if (method_exists($object, 'getTotalDiscount') && in_array(get_class($object), array('Propal', 'Proposal', 'Commande', 'Facture', 'SupplierProposal', 'CommandeFournisseur', 'FactureFournisseur'))) {
@@ -642,7 +653,7 @@ abstract class CommonDocGenerator
$resarray[$array_key.'_project_date_start'] = dol_print_date($object->project->date_start, 'day');
$resarray[$array_key.'_project_date_end'] = dol_print_date($object->project->date_end, 'day');
} else { // empty replacement
- $resarray[$array_key.'_project_ref'] ='';
+ $resarray[$array_key.'_project_ref'] = '';
$resarray[$array_key.'_project_title'] = '';
$resarray[$array_key.'_project_description'] = '';
$resarray[$array_key.'_project_date_start'] = '';
@@ -714,38 +725,38 @@ abstract class CommonDocGenerator
// phpcs:enable
$resarray = array(
'line_pos' => $linenumber,
- 'line_fulldesc'=>doc_getlinedesc($line, $outputlangs),
+ 'line_fulldesc' => doc_getlinedesc($line, $outputlangs),
- 'line_product_ref'=>(empty($line->product_ref) ? '' : $line->product_ref),
- 'line_product_ref_fourn'=>(empty($line->ref_fourn) ? '' : $line->ref_fourn), // for supplier doc lines
- 'line_product_label'=>(empty($line->product_label) ? '' : $line->product_label),
- 'line_product_type'=>(empty($line->product_type) ? '' : $line->product_type),
- 'line_product_barcode'=>(empty($line->product_barcode) ? '' : $line->product_barcode),
- 'line_product_desc'=>(empty($line->product_desc) ? '' : $line->product_desc),
+ 'line_product_ref' => (empty($line->product_ref) ? '' : $line->product_ref),
+ 'line_product_ref_fourn' => (empty($line->ref_fourn) ? '' : $line->ref_fourn), // for supplier doc lines
+ 'line_product_label' => (empty($line->product_label) ? '' : $line->product_label),
+ 'line_product_type' => (empty($line->product_type) ? '' : $line->product_type),
+ 'line_product_barcode' => (empty($line->product_barcode) ? '' : $line->product_barcode),
+ 'line_product_desc' => (empty($line->product_desc) ? '' : $line->product_desc),
- 'line_desc'=>$line->desc,
- 'line_vatrate'=>vatrate($line->tva_tx, true, $line->info_bits),
- 'line_localtax1_rate'=>vatrate($line->localtax1_tx),
- 'line_localtax2_rate'=>vatrate($line->localtax1_tx),
- 'line_up'=>price2num($line->subprice),
- 'line_up_locale'=>price($line->subprice, 0, $outputlangs),
- 'line_total_up'=>price2num($line->subprice * $line->qty),
- 'line_total_up_locale'=>price($line->subprice * $line->qty, 0, $outputlangs),
- 'line_qty'=>$line->qty,
- 'line_discount_percent'=>($line->remise_percent ? $line->remise_percent.'%' : ''),
- 'line_price_ht'=>price2num($line->total_ht),
- 'line_price_ttc'=>price2num($line->total_ttc),
- 'line_price_vat'=>price2num($line->total_tva),
- 'line_price_ht_locale'=>price($line->total_ht, 0, $outputlangs),
- 'line_price_ttc_locale'=>price($line->total_ttc, 0, $outputlangs),
- 'line_price_vat_locale'=>price($line->total_tva, 0, $outputlangs),
+ 'line_desc' => $line->desc,
+ 'line_vatrate' => vatrate($line->tva_tx, true, $line->info_bits),
+ 'line_localtax1_rate' => vatrate($line->localtax1_tx),
+ 'line_localtax2_rate' => vatrate($line->localtax1_tx),
+ 'line_up' => price2num($line->subprice),
+ 'line_up_locale' => price($line->subprice, 0, $outputlangs),
+ 'line_total_up' => price2num($line->subprice * $line->qty),
+ 'line_total_up_locale' => price($line->subprice * $line->qty, 0, $outputlangs),
+ 'line_qty' => $line->qty,
+ 'line_discount_percent' => ($line->remise_percent ? $line->remise_percent.'%' : ''),
+ 'line_price_ht' => price2num($line->total_ht),
+ 'line_price_ttc' => price2num($line->total_ttc),
+ 'line_price_vat' => price2num($line->total_tva),
+ 'line_price_ht_locale' => price($line->total_ht, 0, $outputlangs),
+ 'line_price_ttc_locale' => price($line->total_ttc, 0, $outputlangs),
+ 'line_price_vat_locale' => price($line->total_tva, 0, $outputlangs),
// Dates
- 'line_date_start'=>dol_print_date($line->date_start, 'day'),
- 'line_date_start_locale'=>dol_print_date($line->date_start, 'day', 'tzserver', $outputlangs),
- 'line_date_start_rfc'=>dol_print_date($line->date_start, 'dayrfc'),
- 'line_date_end'=>dol_print_date($line->date_end, 'day'),
- 'line_date_end_locale'=>dol_print_date($line->date_end, 'day', 'tzserver', $outputlangs),
- 'line_date_end_rfc'=>dol_print_date($line->date_end, 'dayrfc'),
+ 'line_date_start' => dol_print_date($line->date_start, 'day'),
+ 'line_date_start_locale' => dol_print_date($line->date_start, 'day', 'tzserver', $outputlangs),
+ 'line_date_start_rfc' => dol_print_date($line->date_start, 'dayrfc'),
+ 'line_date_end' => dol_print_date($line->date_end, 'day'),
+ 'line_date_end_locale' => dol_print_date($line->date_end, 'day', 'tzserver', $outputlangs),
+ 'line_date_end_rfc' => dol_print_date($line->date_end, 'dayrfc'),
'line_multicurrency_code' => price2num($line->multicurrency_code),
'line_multicurrency_subprice' => price2num($line->multicurrency_subprice),
@@ -844,27 +855,27 @@ abstract class CommonDocGenerator
$calculatedVolume = ($object->trueWidth * $object->trueHeight * $object->trueDepth);
$array_shipment = array(
- $array_key.'_id'=>$object->id,
- $array_key.'_ref'=>$object->ref,
- $array_key.'_ref_ext'=>$object->ref_ext,
- $array_key.'_ref_customer'=>$object->ref_customer,
- $array_key.'_date_delivery'=>dol_print_date($object->date_delivery, 'day'),
- $array_key.'_hour_delivery'=>dol_print_date($object->date_delivery, 'hour'),
- $array_key.'_date_creation'=>dol_print_date($object->date_creation, 'day'),
- $array_key.'_total_ht'=>price($object->total_ht),
- $array_key.'_total_vat'=>price($object->total_tva),
- $array_key.'_total_ttc'=>price($object->total_ttc),
+ $array_key.'_id' => $object->id,
+ $array_key.'_ref' => $object->ref,
+ $array_key.'_ref_ext' => $object->ref_ext,
+ $array_key.'_ref_customer' => $object->ref_customer,
+ $array_key.'_date_delivery' => dol_print_date($object->date_delivery, 'day'),
+ $array_key.'_hour_delivery' => dol_print_date($object->date_delivery, 'hour'),
+ $array_key.'_date_creation' => dol_print_date($object->date_creation, 'day'),
+ $array_key.'_total_ht' => price($object->total_ht),
+ $array_key.'_total_vat' => price($object->total_tva),
+ $array_key.'_total_ttc' => price($object->total_ttc),
$array_key.'_total_discount_ht' => price($object->getTotalDiscount()),
- $array_key.'_note_private'=>$object->note_private,
- $array_key.'_note'=>$object->note_public,
- $array_key.'_tracking_number'=>$object->tracking_number,
- $array_key.'_tracking_url'=>$object->tracking_url,
- $array_key.'_shipping_method'=>$object->listmeths[0]['libelle'],
- $array_key.'_weight'=>$object->trueWeight.' '.measuringUnitString(0, 'weight', $object->weight_units),
- $array_key.'_width'=>$object->trueWidth.' '.measuringUnitString(0, 'size', $object->width_units),
- $array_key.'_height'=>$object->trueHeight.' '.measuringUnitString(0, 'size', $object->height_units),
- $array_key.'_depth'=>$object->trueDepth.' '.measuringUnitString(0, 'size', $object->depth_units),
- $array_key.'_size'=>$calculatedVolume.' '.measuringUnitString(0, 'volume'),
+ $array_key.'_note_private' => $object->note_private,
+ $array_key.'_note' => $object->note_public,
+ $array_key.'_tracking_number' => $object->tracking_number,
+ $array_key.'_tracking_url' => $object->tracking_url,
+ $array_key.'_shipping_method' => $object->listmeths[0]['libelle'],
+ $array_key.'_weight' => $object->trueWeight.' '.measuringUnitString(0, 'weight', $object->weight_units),
+ $array_key.'_width' => $object->trueWidth.' '.measuringUnitString(0, 'size', $object->width_units),
+ $array_key.'_height' => $object->trueHeight.' '.measuringUnitString(0, 'size', $object->height_units),
+ $array_key.'_depth' => $object->trueDepth.' '.measuringUnitString(0, 'size', $object->depth_units),
+ $array_key.'_size' => $calculatedVolume.' '.measuringUnitString(0, 'volume'),
);
// Add vat by rates
@@ -1367,7 +1378,7 @@ abstract class CommonDocGenerator
'object' => $object,
'extrafields' => $extrafields,
'extrafieldKey' => $extrafieldKey,
- 'extrafieldOutputContent' =>& $extrafieldOutputContent
+ 'extrafieldOutputContent' => & $extrafieldOutputContent
);
$reshook = $hookmanager->executeHooks('getPDFExtrafieldContent', $parameters, $this); // Note that $action and $object may have been modified by hook
if ($reshook < 0) {
diff --git a/htdocs/core/class/commoninvoice.class.php b/htdocs/core/class/commoninvoice.class.php
index 708e198ac98..a32425ceef4 100644
--- a/htdocs/core/class/commoninvoice.class.php
+++ b/htdocs/core/class/commoninvoice.class.php
@@ -551,7 +551,6 @@ abstract class CommonInvoice extends CommonObject
public function is_erasable()
{
// phpcs:enable
- global $conf;
// We check if invoice is a temporary number (PROVxxxx)
$tmppart = substr($this->ref, 1, 4);
diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php
index edca6bd2b10..549d76c1cd8 100644
--- a/htdocs/core/class/commonobject.class.php
+++ b/htdocs/core/class/commonobject.class.php
@@ -138,8 +138,9 @@ abstract class CommonObject
*/
public $array_options = array();
+
/**
- * @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor.
+ * @var array,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor.
*/
public $fields = array();
@@ -775,7 +776,7 @@ abstract class CommonObject
public $extraparams = array();
/**
- * @var array List of child tables. To test if we can delete object.
+ * @var array List of child tables. To test if we can delete object.
*/
protected $childtables = array();
@@ -1666,11 +1667,7 @@ abstract class CommonObject
$tmpelement = $obj->element;
$transkey = "TypeContact_".$tmpelement."_".$source."_".$obj->code;
$libelle_type = ($langs->trans($transkey) != $transkey ? $langs->trans($transkey) : $obj->type_label);
- if (empty($option)) {
- $tab[$obj->rowid] = $libelle_element.' - '.$libelle_type;
- } else {
- $tab[$obj->rowid] = $libelle_element.' - '.$libelle_type;
- }
+ $tab[$obj->rowid] = $libelle_element.' - '.$libelle_type;
}
}
}
@@ -7317,7 +7314,7 @@ abstract class CommonObject
$isDependList = 1;
}
$tmpselect .= (!empty($parent) ? ' parent="'.$parent.'"' : '');
- $tmpselect .= '>'.$valb.'';
+ $tmpselect .= '>'.$langs->trans($valb).'';
}
$out .= '';
@@ -7947,7 +7944,7 @@ abstract class CommonObject
} elseif ($type == 'select') {
$value = isset($param['options'][$value]) ? $param['options'][$value] : '';
if (strpos($value, "|") !== false) {
- $value = explode('|', $value)[0];
+ $value = $langs->trans(explode('|', $value)[0]);
}
} elseif ($type == 'sellist') {
$param_list = array_keys($param['options']);
@@ -8542,7 +8539,7 @@ abstract class CommonObject
}
$visibility = 1;
- if ($visibility && isset($extrafields->attributes[$this->table_element]['list'][$key])) {
+ if (isset($extrafields->attributes[$this->table_element]['list'][$key])) {
$visibility = (int) dol_eval($extrafields->attributes[$this->table_element]['list'][$key], 1, 1, '2');
}
@@ -8551,9 +8548,9 @@ abstract class CommonObject
$perms = (int) dol_eval($extrafields->attributes[$this->table_element]['perms'][$key], 1, 1, '2');
}
- if (($mode == 'create') && abs($visibility) != 1 && abs($visibility) != 3) {
+ if (($mode == 'create') && !in_array(abs($visibility), array(1, 3))) {
continue; // <> -1 and <> 1 and <> 3 = not visible on forms, only on list
- } elseif (($mode == 'edit') && abs($visibility) != 1 && abs($visibility) != 3 && abs($visibility) != 4) {
+ } elseif (($mode == 'edit') && !in_array(abs($visibility), array(1, 3, 4))) {
continue; // <> -1 and <> 1 and <> 3 = not visible on forms, only on list and <> 4 = not visible at the creation
} elseif ($mode == 'view' && empty($visibility)) {
continue;
@@ -8767,13 +8764,7 @@ abstract class CommonObject
}
$out .= ($display_type == 'card' ? ' ' : '
');
-
- if (getDolGlobalString('MAIN_EXTRAFIELDS_USE_TWO_COLUMS') && (($e % 2) == 1)) {
- $out .= ($display_type == 'card' ? ' ' : '');
- } else {
- $out .= ($display_type == 'card' ? '' : '');
- }
-
+ $out .= ($display_type == 'card' ? '' : '');
$e++;
}
}
diff --git a/htdocs/core/class/commonstickergenerator.class.php b/htdocs/core/class/commonstickergenerator.class.php
index ba63bba320e..9e32529e9b1 100644
--- a/htdocs/core/class/commonstickergenerator.class.php
+++ b/htdocs/core/class/commonstickergenerator.class.php
@@ -296,7 +296,7 @@ abstract class CommonStickerGenerator extends CommonDocGenerator
* protected Set format
*
* @param TCPDF $pdf PDF reference
- * @param string $format Format
+ * @param array{metric:string,name:string,code:string,marginLeft:float,marginTip:float,SpaceX:float,SpaceY:float,NX:int,NY:int,width:float,height:float,font-size:float} $format Format
* @return void
*/
protected function _Set_Format(&$pdf, $format)
diff --git a/htdocs/core/class/cproductnature.class.php b/htdocs/core/class/cproductnature.class.php
index b395bf8983f..749b07b4029 100644
--- a/htdocs/core/class/cproductnature.class.php
+++ b/htdocs/core/class/cproductnature.class.php
@@ -1,6 +1,7 @@
* Copyright (C) 2020 Florian HENRY