diff --git a/dev/setup/codesniffer/ruleset.xml b/dev/setup/codesniffer/ruleset.xml index ce59db18665..50b107f5fcc 100644 --- a/dev/setup/codesniffer/ruleset.xml +++ b/dev/setup/codesniffer/ruleset.xml @@ -9,6 +9,7 @@ /build/(html|aps)/ /dev/tools/test/namespacemig/ + /dev/tools/phan/stubs/ /documents/ /htdocs/core/class/lessc\.class\.php diff --git a/dev/tools/phan/config.php b/dev/tools/phan/config.php index 178a021e00c..2defcc784e7 100644 --- a/dev/tools/phan/config.php +++ b/dev/tools/phan/config.php @@ -331,7 +331,7 @@ return [ // Dolibarr uses a lot of internal deprecated stuff, not reporting 'PhanDeprecatedProperty', 'PhanDeprecatedFunction', - 'PhanCompatibleNegativeStringOffset', + //'PhanCompatibleNegativeStringOffset', // Dolibarr has quite a few strange noop assignments like $abc=$abc; 'PhanPluginDuplicateExpressionAssignment', // Nulls are likely mostly false positives @@ -379,7 +379,7 @@ return [ 'PhanPluginUnknownClosureParamType', 'PhanPluginUnknownClosureReturnType', // 'PhanPluginNoCommentOnProtectedMethod', - 'PhanTypeArraySuspicious', + // 'PhanTypeArraySuspicious', 'PhanTypeMismatchPropertyProbablyReal', // 'PhanPluginNoCommentOnPrivateMethod', 'PhanPluginUnknownArrayFunctionReturnType', @@ -401,7 +401,7 @@ return [ 'PhanTypeMismatchDeclaredParamNullable', 'PhanTypeInvalidRightOperandOfAdd', // 'PhanPluginDescriptionlessCommentOnPrivateProperty', - 'PhanUndeclaredVariableDim', // Array initialisation on undeclared var: $abc['x']='ab' + // 'PhanUndeclaredVariableDim', // Array initialisation on undeclared var: $abc['x']='ab' 'PhanTypeInvalidPropertyName', 'PhanPluginDuplicateCatchStatementBody', 'PhanPluginUndeclaredVariableIsset', @@ -439,11 +439,11 @@ return [ 'PhanPluginBothLiteralsBinaryOp', // 'PhanTypeMismatchDeclaredParam', // 'PhanCommentDuplicateMagicMethod', - 'PhanParamSpecial1', + // 'PhanParamSpecial1', 'PhanPluginInlineHTMLLeading', 'PhanPluginUseReturnValueInternalKnown', - 'PhanRedefinedInheritedInterface', - 'PhanTypeComparisonToArray', + //'PhanRedefinedInheritedInterface', + //'PhanTypeComparisonToArray', 'PhanTypeConversionFromArray', // 'PhanTypeInvalidLeftOperandOfIntegerOp', 'PhanTypeMismatchArgumentInternalProbablyReal', @@ -458,7 +458,7 @@ return [ // 'PhanTypeInvalidThrowsIsInterface', 'PhanPluginRedundantAssignmentInLoop', // 'PhanInvalidCommentForDeclarationType', - 'PhanParamSignatureMismatchInternal', + //'PhanParamSignatureMismatchInternal', // 'PhanPluginEmptyStatementForeachLoop', // 'PhanCompatibleDimAlternativeSyntax', 'PhanInvalidFQSENInClasslike', diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index a716a92d884..a73b24e9d28 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -230,7 +230,7 @@ class ActionComm extends CommonObject public $priority; /** - * @var int[] Array of user ids + * @var array Array of users */ public $userassigned = array(); @@ -488,7 +488,7 @@ class ActionComm extends CommonObject if (!is_array($this->userassigned) && !empty($this->userassigned)) { // For backward compatibility when userassigned was an int instead of an array $tmpid = (int) $this->userassigned; $this->userassigned = array(); - $this->userassigned[$tmpid] = array('id'=>$tmpid, 'transparency'=>$this->transparency); + $this->userassigned[$tmpid] = array('id' => $tmpid, 'transparency' => $this->transparency); } $userownerid = $this->userownerid; @@ -496,7 +496,7 @@ class ActionComm extends CommonObject // Be sure assigned user is defined as an array of array('id'=>,'mandatory'=>,...). if (empty($this->userassigned) || count($this->userassigned) == 0 || !is_array($this->userassigned)) { - $this->userassigned = array($userownerid=>array('id'=>$userownerid, 'transparency'=>$this->transparency)); + $this->userassigned = array($userownerid => array('id' => $userownerid, 'transparency' => $this->transparency)); } if (!$this->type_id || !$this->type_code) { @@ -630,7 +630,7 @@ class ActionComm extends CommonObject foreach ($this->userassigned as $key => $val) { // Common value with new behavior is to have $val = array('id'=>iduser, 'transparency'=>0|1) and $this->userassigned is an array of iduser => $val. if (!is_array($val)) { // For backward compatibility when $val='id'. - $val = array('id'=>$val); + $val = array('id' => $val); } if ($val['id'] > 0) { @@ -749,7 +749,7 @@ class ActionComm extends CommonObject if (!$error) { // Hook of thirdparty module if (is_object($hookmanager)) { - $parameters = array('objFrom'=>$objFrom); + $parameters = array('objFrom' => $objFrom); $action = ''; $reshook = $hookmanager->executeHooks('createFrom', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { @@ -904,14 +904,14 @@ class ActionComm extends CommonObject $this->status = $obj->status; //email information - $this->email_msgid=$obj->email_msgid; - $this->email_from=$obj->email_from; - $this->email_sender=$obj->email_sender; - $this->email_to=$obj->email_to; - $this->email_tocc=$obj->email_tocc; - $this->email_tobcc=$obj->email_tobcc; - $this->email_subject=$obj->email_subject; - $this->errors_to=$obj->errors_to; + $this->email_msgid = $obj->email_msgid; + $this->email_from = $obj->email_from; + $this->email_sender = $obj->email_sender; + $this->email_to = $obj->email_to; + $this->email_tocc = $obj->email_tocc; + $this->email_tobcc = $obj->email_tobcc; + $this->email_subject = $obj->email_subject; + $this->errors_to = $obj->errors_to; $this->fetch_optionals(); @@ -947,20 +947,20 @@ class ActionComm extends CommonObject if ($resql) { // If owner is known, we must but id first into list if ($this->userownerid > 0) { - $this->userassigned[$this->userownerid] = array('id'=>$this->userownerid); // Set first so will be first into list. + $this->userassigned[$this->userownerid] = array('id' => $this->userownerid); // Set first so will be first into list. } while ($obj = $this->db->fetch_object($resql)) { if ($obj->fk_element > 0) { switch ($obj->element_type) { case 'user': - $this->userassigned[$obj->fk_element] = array('id'=>$obj->fk_element, 'mandatory'=>$obj->mandatory, 'answer_status'=>$obj->answer_status, 'transparency'=>$obj->transparency); + $this->userassigned[$obj->fk_element] = array('id' => $obj->fk_element, 'mandatory' => $obj->mandatory, 'answer_status' => $obj->answer_status, 'transparency' => $obj->transparency); if (empty($this->userownerid)) { $this->userownerid = $obj->fk_element; // If not defined (should not happened, we fix this) } break; case 'socpeople': - $this->socpeopleassigned[$obj->fk_element] = array('id'=>$obj->fk_element, 'mandatory'=>$obj->mandatory, 'answer_status'=>$obj->answer_status, 'transparency'=>$obj->transparency); + $this->socpeopleassigned[$obj->fk_element] = array('id' => $obj->fk_element, 'mandatory' => $obj->mandatory, 'answer_status' => $obj->answer_status, 'transparency' => $obj->transparency); break; } } @@ -994,15 +994,15 @@ class ActionComm extends CommonObject // If owner is known, we must but id first into list if ($this->userownerid > 0) { // Set first so will be first into list. - $this->userassigned[$this->userownerid] = array('id'=>$this->userownerid); + $this->userassigned[$this->userownerid] = array('id' => $this->userownerid); } while ($obj = $this->db->fetch_object($resql2)) { if ($obj->fk_element > 0) { - $this->userassigned[$obj->fk_element] = array('id'=>$obj->fk_element, - 'mandatory'=>$obj->mandatory, - 'answer_status'=>$obj->answer_status, - 'transparency'=>$obj->transparency); + $this->userassigned[$obj->fk_element] = array('id' => $obj->fk_element, + 'mandatory' => $obj->mandatory, + 'answer_status' => $obj->answer_status, + 'transparency' => $obj->transparency); } if ($override === true) { @@ -1245,7 +1245,7 @@ class ActionComm extends CommonObject $already_inserted = array(); foreach ($this->userassigned as $key => $val) { if (!is_array($val)) { // For backward compatibility when val=id - $val = array('id'=>$val); + $val = array('id' => $val); } if (!empty($already_inserted[$val['id']])) { continue; @@ -1273,7 +1273,7 @@ class ActionComm extends CommonObject $already_inserted = array(); foreach (array_keys($this->socpeopleassigned) as $key => $val) { if (!is_array($val)) { // For backward compatibility when val=id - $val = array('id'=>$val); + $val = array('id' => $val); } if (!empty($already_inserted[$val['id']])) { continue; @@ -1351,7 +1351,7 @@ class ActionComm extends CommonObject $parameters = array('sql' => &$sql, 'socid' => $socid, 'fk_element' => $fk_element, 'elementtype' => $elementtype); $reshook = $hookmanager->executeHooks('getActionsListFrom', $parameters); // Note that $action and $object may have been modified by hook if (!empty($hookmanager->resPrint)) { - $sql.= $hookmanager->resPrint; + $sql .= $hookmanager->resPrint; } $sql .= " WHERE a.entity IN (".getEntity('agenda').")"; if (!empty($socid)) { @@ -1375,7 +1375,7 @@ class ActionComm extends CommonObject $parameters = array('sql' => &$sql, 'socid' => $socid, 'fk_element' => $fk_element, 'elementtype' => $elementtype); $reshook = $hookmanager->executeHooks('getActionsListWhere', $parameters); // Note that $action and $object may have been modified by hook if (!empty($hookmanager->resPrint)) { - $sql.= $hookmanager->resPrint; + $sql .= $hookmanager->resPrint; } if ($sortorder && $sortfield) { $sql .= $this->db->order($sortfield, $sortorder); @@ -1847,7 +1847,7 @@ class ActionComm extends CommonObject global $action; $hookmanager->initHooks(array('actiondao')); - $parameters = array('id'=>$this->id, 'getnomurl' => &$result); + $parameters = array('id' => $this->id, 'getnomurl' => &$result); $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks if ($reshook > 0) { $result = $hookmanager->resPrint; @@ -2442,7 +2442,7 @@ class ActionComm extends CommonObject $this->note_private = "This is a 'private' note."; $this->userownerid = $user->id; - $this->userassigned[$user->id] = array('id'=>$user->id, 'transparency'=> 1); + $this->userassigned[$user->id] = array('id' => $user->id, 'transparency' => 1); return 1; } diff --git a/htdocs/compta/bank/graph.php b/htdocs/compta/bank/graph.php index 6ef7b315179..8d2b44c40af 100644 --- a/htdocs/compta/bank/graph.php +++ b/htdocs/compta/bank/graph.php @@ -266,7 +266,7 @@ if ($result < 0) { $px1 = null; $graph_datas = null; $datas = null; - $datamin = null; + $datamin = array(); $dataall = null; $labels = null; $amounts = null; diff --git a/htdocs/contact/consumption.php b/htdocs/contact/consumption.php index fb761a5b541..67714ae131e 100644 --- a/htdocs/contact/consumption.php +++ b/htdocs/contact/consumption.php @@ -96,7 +96,7 @@ $result = restrictedArea($user, 'contact', $object->id, 'socpeople&societe'); * Actions */ -$parameters = array('id'=>$id); +$parameters = array('id' => $id); $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'); @@ -153,6 +153,9 @@ print ''.$langs->trans("UserTitle").''; print $object->getCivilityLabel(); print ''; +$thirdTypeArray = array(); +$elementTypeArray = array(); + if (!empty($object->thirdparty->client)) { $thirdTypeArray['customer'] = $langs->trans("customer"); if (isModEnabled("propal") && $user->hasRight('propal', 'lire')) { @@ -370,7 +373,7 @@ if (!empty($socid)) { $param .= "&type_element=".urlencode($type_element); $total_qty = 0; -$num=0; +$num = 0; if ($sql_select) { $resql = $db->query($sql); if (!$resql) { diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index 8501ef26165..6fefaccd5cc 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -89,6 +89,9 @@ if (isModEnabled('mailing')) { } else { $search_no_email = -1; } + +$search_ = array(); + if (isModEnabled('socialnetworks')) { foreach ($socialnetworks as $key => $value) { if ($value['active']) { @@ -210,7 +213,7 @@ if (!getDolGlobalString('SOCIETE_DISABLE_CONTACTS')) { $fieldstosearchall['s.name_alias'] = "AliasNames"; } -$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 = empty($hookmanager->resArray['fieldstosearchall']) ? array() : $hookmanager->resArray['fieldstosearchall']; @@ -225,27 +228,27 @@ foreach ($object->fields as $key => $val) { if (!empty($val['visible'])) { $visible = (int) dol_eval($val['visible'], 1); $arrayfields['p.'.$key] = array( - 'label'=>$val['label'], - 'checked'=>(($visible < 0) ? 0 : 1), - 'enabled'=>(abs($visible) != 3 && (int) dol_eval($val['enabled'], 1)), - 'position'=>$val['position'], - 'help'=> isset($val['help']) ? $val['help'] : '' + 'label' => $val['label'], + 'checked' => (($visible < 0) ? 0 : 1), + 'enabled' => (abs($visible) != 3 && (int) dol_eval($val['enabled'], 1)), + 'position' => $val['position'], + 'help' => isset($val['help']) ? $val['help'] : '' ); } } // Add none object fields to fields for list -$arrayfields['country.code_iso'] = array('label'=>"Country", 'position'=>66, 'checked'=>0); +$arrayfields['country.code_iso'] = array('label' => "Country", 'position' => 66, 'checked' => 0); if (!getDolGlobalString('SOCIETE_DISABLE_CONTACTS')) { - $arrayfields['s.nom'] = array('label'=>"ThirdParty", 'position'=>113, 'checked'=> 1); - $arrayfields['s.name_alias'] = array('label'=>"AliasNameShort", 'position'=>114, 'checked'=> 1); + $arrayfields['s.nom'] = array('label' => "ThirdParty", 'position' => 113, 'checked' => 1); + $arrayfields['s.name_alias'] = array('label' => "AliasNameShort", 'position' => 114, 'checked' => 1); } $arrayfields['unsubscribed'] = array( - 'label'=>'No_Email', - 'checked'=>0, - 'enabled'=>(isModEnabled('mailing')), - 'position'=>111); + 'label' => 'No_Email', + 'checked' => 0, + 'enabled' => (isModEnabled('mailing')), + 'position' => 111); if (isModEnabled('socialnetworks')) { foreach ($socialnetworks as $key => $value) { @@ -570,10 +573,10 @@ if (!empty($searchCategoryContactList)) { } } - // Search Customer Categories +// Search Customer Categories $searchCategoryCustomerList = $search_categ_thirdparty ? array($search_categ_thirdparty) : array(); $searchCategoryCustomerOperator = 0; - // Search for tag/category ($searchCategoryCustomerList is an array of ID) +// Search for tag/category ($searchCategoryCustomerList is an array of ID) if (!empty($searchCategoryCustomerList)) { $searchCategoryCustomerSqlList = array(); $listofcategoryid = ''; @@ -605,7 +608,7 @@ if (!empty($searchCategoryCustomerList)) { // Search Supplier Categories $searchCategorySupplierList = $search_categ_supplier ? array($search_categ_supplier) : array(); $searchCategorySupplierOperator = 0; - // Search for tag/category ($searchCategorySupplierList is an array of ID) +// Search for tag/category ($searchCategorySupplierList is an array of ID) if (!empty($searchCategorySupplierList)) { $searchCategorySupplierSqlList = array(); $listofcategoryid = ''; @@ -959,8 +962,8 @@ print ''; $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(); if ($contextpage != 'poslist') { $newcardbutton .= dolGetButtonTitle($langs->trans('NewContactAddress'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/contact/card.php?action=create', '', $permissiontoadd); @@ -1040,7 +1043,7 @@ $moreforfilter .= ''; print '
'; print $moreforfilter; -$parameters = array('type'=>$type); +$parameters = array('type' => $type); $reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; print '
'; @@ -1149,7 +1152,7 @@ if (!empty($arrayfields['p.email']['checked'])) { } if (!empty($arrayfields['unsubscribed']['checked'])) { print ''; - print $form->selectarray('search_no_email', array('-1'=>'', '0'=>$langs->trans('No'), '1'=>$langs->trans('Yes')), $search_no_email); + print $form->selectarray('search_no_email', array('-1' => '', '0' => $langs->trans('No'), '1' => $langs->trans('Yes')), $search_no_email); print ''; } if (isModEnabled('socialnetworks')) { @@ -1176,7 +1179,7 @@ if (!empty($arrayfields['s.name_alias']['checked'])) { } if (!empty($arrayfields['p.priv']['checked'])) { print ''; - $selectarray = array('0'=>$langs->trans("ContactPublic"), '1'=>$langs->trans("ContactPrivate")); + $selectarray = array('0' => $langs->trans("ContactPublic"), '1' => $langs->trans("ContactPrivate")); print $form->selectarray('search_priv', $selectarray, $search_priv, 1); print ''; } @@ -1211,7 +1214,7 @@ if (!empty($arrayfields['p.birthday']['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; // Date creation @@ -1227,7 +1230,7 @@ if (!empty($arrayfields['p.tms']['checked'])) { // Status if (!empty($arrayfields['p.statut']['checked'])) { print ''; - print $form->selectarray('search_status', array('-1'=>'', '0'=>$langs->trans('ActivityCeased'), '1'=>$langs->trans('InActivity')), $search_status, 0, 0, 0, '', 0, 0, 0, '', 'search_status width100 onrightofpage'); + print $form->selectarray('search_status', array('-1' => '', '0' => $langs->trans('ActivityCeased'), '1' => $langs->trans('InActivity')), $search_status, 0, 0, 0, '', 0, 0, 0, '', 'search_status width100 onrightofpage'); print ''; } if (!empty($arrayfields['p.import_key']['checked'])) { @@ -1351,7 +1354,7 @@ if (!empty($arrayfields['p.birthday']['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['p.datec']['checked'])) { @@ -1708,7 +1711,7 @@ while ($i < $imaxinloop) { include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php'; // Fields from hook - $parameters = array('arrayfields'=>$arrayfields, 'object'=>$object, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray); + $parameters = array('arrayfields' => $arrayfields, 'object' => $object, '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 @@ -1786,7 +1789,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/list.php b/htdocs/contrat/list.php index 455d801cb3e..20345dd7d50 100644 --- a/htdocs/contrat/list.php +++ b/htdocs/contrat/list.php @@ -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/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/class/html.formadmin.class.php b/htdocs/core/class/html.formadmin.class.php index 7b1eb01c1a2..08902344ce0 100644 --- a/htdocs/core/class/html.formadmin.class.php +++ b/htdocs/core/class/html.formadmin.class.php @@ -380,31 +380,31 @@ class FormAdmin print ''; $arraytz = array( - "Pacific/Midway"=>"GMT-11:00", - "Pacific/Fakaofo"=>"GMT-10:00", - "America/Anchorage"=>"GMT-09:00", - "America/Los_Angeles"=>"GMT-08:00", - "America/Dawson_Creek"=>"GMT-07:00", - "America/Chicago"=>"GMT-06:00", - "America/Bogota"=>"GMT-05:00", - "America/Anguilla"=>"GMT-04:00", - "America/Araguaina"=>"GMT-03:00", - "America/Noronha"=>"GMT-02:00", - "Atlantic/Azores"=>"GMT-01:00", - "Africa/Abidjan"=>"GMT+00:00", - "Europe/Paris"=>"GMT+01:00", - "Europe/Helsinki"=>"GMT+02:00", - "Europe/Moscow"=>"GMT+03:00", - "Asia/Dubai"=>"GMT+04:00", - "Asia/Karachi"=>"GMT+05:00", - "Indian/Chagos"=>"GMT+06:00", - "Asia/Jakarta"=>"GMT+07:00", - "Asia/Hong_Kong"=>"GMT+08:00", - "Asia/Tokyo"=>"GMT+09:00", - "Australia/Sydney"=>"GMT+10:00", - "Pacific/Noumea"=>"GMT+11:00", - "Pacific/Auckland"=>"GMT+12:00", - "Pacific/Enderbury"=>"GMT+13:00" + "Pacific/Midway" => "GMT-11:00", + "Pacific/Fakaofo" => "GMT-10:00", + "America/Anchorage" => "GMT-09:00", + "America/Los_Angeles" => "GMT-08:00", + "America/Dawson_Creek" => "GMT-07:00", + "America/Chicago" => "GMT-06:00", + "America/Bogota" => "GMT-05:00", + "America/Anguilla" => "GMT-04:00", + "America/Araguaina" => "GMT-03:00", + "America/Noronha" => "GMT-02:00", + "Atlantic/Azores" => "GMT-01:00", + "Africa/Abidjan" => "GMT+00:00", + "Europe/Paris" => "GMT+01:00", + "Europe/Helsinki" => "GMT+02:00", + "Europe/Moscow" => "GMT+03:00", + "Asia/Dubai" => "GMT+04:00", + "Asia/Karachi" => "GMT+05:00", + "Indian/Chagos" => "GMT+06:00", + "Asia/Jakarta" => "GMT+07:00", + "Asia/Hong_Kong" => "GMT+08:00", + "Asia/Tokyo" => "GMT+09:00", + "Australia/Sydney" => "GMT+10:00", + "Pacific/Noumea" => "GMT+11:00", + "Pacific/Auckland" => "GMT+12:00", + "Pacific/Enderbury" => "GMT+13:00" ); foreach ($arraytz as $lib => $gmt) { print '