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 'db->escape($filter)."%'";
}
+ $paperformat = array();
+
$resql = $this->db->query($sql);
if ($resql) {
$num = $this->db->num_rows($resql);
diff --git a/htdocs/core/class/html.formcategory.class.php b/htdocs/core/class/html.formcategory.class.php
index 34a1961bc84..193967845ab 100644
--- a/htdocs/core/class/html.formcategory.class.php
+++ b/htdocs/core/class/html.formcategory.class.php
@@ -1,5 +1,6 @@
+ * Copyright (C) 2024 Frédéric France
*
* 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
@@ -81,7 +82,7 @@ class FormCategory extends Form
$filter .= $langs->trans('UseOrOperatorShort');
$filter .= '';
- $filter .= '";
@@ -835,7 +835,7 @@ if ($id > 0 || $ref) {
if (!empty($extralabels)) {
if (empty($rowid)) {
foreach ($extralabels as $key => $value) {
- if (!empty($extrafields->attributes["product_fournisseur_price"]['list'][$key]) && ($extrafields->attributes["product_fournisseur_price"]['list'][$key] == 1 || $extrafields->attributes["product_fournisseur_price"]['list'][$key] == 3 || ($action == "update_price" && $extrafields->attributes["product_fournisseur_price"]['list'][$key] == 4))) {
+ if (!empty($extrafields->attributes["product_fournisseur_price"]['list'][$key]) && ($extrafields->attributes["product_fournisseur_price"]['list'][$key] == 1 || $extrafields->attributes["product_fournisseur_price"]['list'][$key] == 3 || ($action == "edit_price" && $extrafields->attributes["product_fournisseur_price"]['list'][$key] == 4))) {
if (!empty($extrafields->attributes["product_fournisseur_price"]['langfile'][$key])) {
$langs->load($extrafields->attributes["product_fournisseur_price"]['langfile'][$key]);
}
@@ -861,7 +861,7 @@ if ($id > 0 || $ref) {
if ($resql) {
$obj = $db->fetch_object($resql);
foreach ($extralabels as $key => $value) {
- if (!empty($extrafields->attributes["product_fournisseur_price"]['list'][$key]) && ($extrafields->attributes["product_fournisseur_price"]['list'][$key] == 1 || $extrafields->attributes["product_fournisseur_price"]['list'][$key] == 3 || ($action == "update_price" && $extrafields->attributes["product_fournisseur_price"]['list'][$key] == 4))) {
+ if (!empty($extrafields->attributes["product_fournisseur_price"]['list'][$key]) && ($extrafields->attributes["product_fournisseur_price"]['list'][$key] == 1 || $extrafields->attributes["product_fournisseur_price"]['list'][$key] == 3 || ($action == "edit_price" && $extrafields->attributes["product_fournisseur_price"]['list'][$key] == 4))) {
if (!empty($extrafields->attributes["product_fournisseur_price"]['langfile'][$key])) {
$langs->load($extrafields->attributes["product_fournisseur_price"]['langfile'][$key]);
}
@@ -906,7 +906,7 @@ if ($id > 0 || $ref) {
print ''."\n";
- if ($action != 'create_price' && $action != 'update_price') {
+ if ($action != 'create_price' && $action != 'edit_price') {
$parameters = array();
$reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
if (empty($reshook)) {
@@ -1291,7 +1291,7 @@ if ($id > 0 || $ref) {
print '
';
if ($usercancreate) {
- print ''.img_edit()." ";
+ print ''.img_edit()." ";
print ' ';
print ''.img_picto($langs->trans("Remove"), 'delete').' ';
}
diff --git a/htdocs/product/index.php b/htdocs/product/index.php
index 9abf9bd5326..4c95be804b3 100644
--- a/htdocs/product/index.php
+++ b/htdocs/product/index.php
@@ -92,9 +92,13 @@ print '';
if (getDolGlobalString('MAIN_SEARCH_FORM_ON_HOME_AREAS')) { // This may be useless due to the global search combo
+ if (!isset($listofsearchfields) || !is_array($listofsearchfields)) {
+ // Ensure $listofsearchfields is set and array
+ $listofsearchfields = array();
+ }
// Search contract
if ((isModEnabled("product") || isModEnabled("service")) && ($user->hasRight('produit', 'lire') || $user->hasRight('service', 'lire'))) {
- $listofsearchfields['search_product'] = array('text'=>'ProductOrService');
+ $listofsearchfields['search_product'] = array('text' => 'ProductOrService');
}
if (count($listofsearchfields)) {
diff --git a/htdocs/product/inventory/class/inventory.class.php b/htdocs/product/inventory/class/inventory.class.php
index d20e7336110..cb3da2f695a 100644
--- a/htdocs/product/inventory/class/inventory.class.php
+++ b/htdocs/product/inventory/class/inventory.class.php
@@ -98,22 +98,22 @@ class Inventory extends CommonObject
* @var array Array with all fields and their property
*/
public $fields = array(
- 'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'visible'=>-1, 'enabled'=>1, 'position'=>1, 'notnull'=>1, 'index'=>1, 'comment'=>'Id',),
- 'ref' => array('type'=>'varchar(64)', 'label'=>'Ref', 'visible'=>1, 'enabled'=>1, 'position'=>10, 'notnull'=>1, 'index'=>1, 'searchall'=>1, 'comment'=>'Reference of object', 'css'=>'maxwidth150'),
- 'entity' => array('type'=>'integer', 'label'=>'Entity', 'visible'=>0, 'enabled'=>1, 'position'=>20, 'notnull'=>1, 'index'=>1,),
- 'title' => array('type'=>'varchar(255)', 'label'=>'Label', 'visible'=>1, 'enabled'=>1, 'position'=>25, 'css'=>'minwidth300', 'csslist'=>'tdoverflowmax150', 'alwayseditable'=>1),
- 'fk_warehouse' => array('type'=>'integer:Entrepot:product/stock/class/entrepot.class.php', 'label'=>'Warehouse', 'visible'=>1, 'enabled'=>1, 'position'=>30, 'index'=>1, 'help'=>'InventoryForASpecificWarehouse', 'picto'=>'stock', 'css'=>'minwidth300 maxwidth500 widthcentpercentminusx', 'csslist'=>'tdoverflowmax150'),
- 'fk_product' => array('type'=>'integer:Product:product/class/product.class.php', 'label'=>'Product', 'get_name_url_params' => '0::0:-1:0::1', 'visible'=>1, 'enabled'=>1, 'position'=>32, 'index'=>1, 'help'=>'InventoryForASpecificProduct', 'picto'=>'product', 'css'=>'minwidth300 maxwidth500 widthcentpercentminusx', 'csslist'=>'tdoverflowmax150'),
- 'categories_product' => array('type'=>'chkbxlst:categorie:label:rowid::type=0:0:', 'label'=>'OrProductsWithCategories', 'visible'=>3, 'enabled'=>1, 'position'=>33, 'help'=>'', 'picto'=>'category', 'css'=>'minwidth300 maxwidth500 widthcentpercentminusx'),
- 'date_inventory' => array('type'=>'date', 'label'=>'DateValue', 'visible'=>1, 'enabled'=>'$conf->global->STOCK_INVENTORY_ADD_A_VALUE_DATE', 'position'=>35, 'csslist'=>'nowraponall'), // This date is not used so disabled by default.
- 'date_creation' => array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>500, 'csslist'=>'nowraponall'),
- 'tms' => array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>501, 'csslist'=>'nowraponall'),
- 'date_validation' => array('type'=>'datetime', 'label'=>'DateValidation', 'visible'=>-2, 'enabled'=>1, 'position'=>502, 'csslist'=>'nowraponall'),
- 'fk_user_creat' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserAuthor', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>510, 'foreignkey'=>'user.rowid', 'csslist'=>'tdoverflowmax150'),
- 'fk_user_modif' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserModif', 'enabled'=>1, 'visible'=>-2, 'notnull'=>-1, 'position'=>511, 'csslist'=>'tdoverflowmax150'),
- 'fk_user_valid' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserValidation', 'visible'=>-2, 'enabled'=>1, 'position'=>512, 'csslist'=>'tdoverflowmax150'),
- 'import_key' => array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'notnull'=>-1, 'index'=>0, 'position'=>1000),
- 'status' => array('type'=>'integer', 'label'=>'Status', 'visible'=>4, 'enabled'=>1, 'position'=>1000, 'notnull'=>1, 'default'=>0, 'index'=>1, 'arrayofkeyval'=>array(0=>'Draft', 1=>'Validated', 2=>'Closed', 9=>'Canceled'))
+ 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'visible' => -1, 'enabled' => 1, 'position' => 1, 'notnull' => 1, 'index' => 1, 'comment' => 'Id',),
+ 'ref' => array('type' => 'varchar(64)', 'label' => 'Ref', 'visible' => 1, 'enabled' => 1, 'position' => 10, 'notnull' => 1, 'index' => 1, 'searchall' => 1, 'comment' => 'Reference of object', 'css' => 'maxwidth150'),
+ 'entity' => array('type' => 'integer', 'label' => 'Entity', 'visible' => 0, 'enabled' => 1, 'position' => 20, 'notnull' => 1, 'index' => 1,),
+ 'title' => array('type' => 'varchar(255)', 'label' => 'Label', 'visible' => 1, 'enabled' => 1, 'position' => 25, 'css' => 'minwidth300', 'csslist' => 'tdoverflowmax150', 'alwayseditable' => 1),
+ 'fk_warehouse' => array('type' => 'integer:Entrepot:product/stock/class/entrepot.class.php', 'label' => 'Warehouse', 'visible' => 1, 'enabled' => 1, 'position' => 30, 'index' => 1, 'help' => 'InventoryForASpecificWarehouse', 'picto' => 'stock', 'css' => 'minwidth300 maxwidth500 widthcentpercentminusx', 'csslist' => 'tdoverflowmax150'),
+ 'fk_product' => array('type' => 'integer:Product:product/class/product.class.php', 'label' => 'Product', 'get_name_url_params' => '0::0:-1:0::1', 'visible' => 1, 'enabled' => 1, 'position' => 32, 'index' => 1, 'help' => 'InventoryForASpecificProduct', 'picto' => 'product', 'css' => 'minwidth300 maxwidth500 widthcentpercentminusx', 'csslist' => 'tdoverflowmax150'),
+ 'categories_product' => array('type' => 'chkbxlst:categorie:label:rowid::type=0:0:', 'label' => 'OrProductsWithCategories', 'visible' => 3, 'enabled' => 1, 'position' => 33, 'help' => '', 'picto' => 'category', 'css' => 'minwidth300 maxwidth500 widthcentpercentminusx'),
+ 'date_inventory' => array('type' => 'date', 'label' => 'DateValue', 'visible' => 1, 'enabled' => '$conf->global->STOCK_INVENTORY_ADD_A_VALUE_DATE', 'position' => 35, 'csslist' => 'nowraponall'), // This date is not used so disabled by default.
+ 'date_creation' => array('type' => 'datetime', 'label' => 'DateCreation', 'enabled' => 1, 'visible' => -2, 'notnull' => 1, 'position' => 500, 'csslist' => 'nowraponall'),
+ 'tms' => array('type' => 'timestamp', 'label' => 'DateModification', 'enabled' => 1, 'visible' => -2, 'notnull' => 1, 'position' => 501, 'csslist' => 'nowraponall'),
+ 'date_validation' => array('type' => 'datetime', 'label' => 'DateValidation', 'visible' => -2, 'enabled' => 1, 'position' => 502, 'csslist' => 'nowraponall'),
+ 'fk_user_creat' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserAuthor', 'enabled' => 1, 'visible' => -2, 'notnull' => 1, 'position' => 510, 'foreignkey' => 'user.rowid', 'csslist' => 'tdoverflowmax150'),
+ 'fk_user_modif' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserModif', 'enabled' => 1, 'visible' => -2, 'notnull' => -1, 'position' => 511, 'csslist' => 'tdoverflowmax150'),
+ 'fk_user_valid' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserValidation', 'visible' => -2, 'enabled' => 1, 'position' => 512, 'csslist' => 'tdoverflowmax150'),
+ 'import_key' => array('type' => 'varchar(14)', 'label' => 'ImportId', 'enabled' => 1, 'visible' => -2, 'notnull' => -1, 'index' => 0, 'position' => 1000),
+ 'status' => array('type' => 'integer', 'label' => 'Status', 'visible' => 4, 'enabled' => 1, 'position' => 1000, 'notnull' => 1, 'default' => 0, 'index' => 1, 'arrayofkeyval' => array(0 => 'Draft', 1 => 'Validated', 2 => 'Closed', 9 => 'Canceled'))
);
/**
@@ -645,6 +645,7 @@ class Inventory extends CommonObject
global $langs;
$labelStatus = array();
+ $labelStatusShort = array();
$labelStatus[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv('Draft');
$labelStatus[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv('Validated').' ('.$langs->transnoentitiesnoconv('InventoryStartedShort').')';
$labelStatus[self::STATUS_CANCELED] = $langs->transnoentitiesnoconv('Canceled');
@@ -760,10 +761,10 @@ class Inventory extends CommonObject
public function getChildWarehouse($id, &$TChildWarehouse)
{
$sql = 'SELECT rowid FROM '.MAIN_DB_PREFIX.'entrepot';
- $sql.= ' WHERE fk_parent='.(int) $id;
- $sql.= ' ORDER BY rowid';
+ $sql .= ' WHERE fk_parent='.(int) $id;
+ $sql .= ' ORDER BY rowid';
$resql = $this->db->query($sql);
- if ($resql && $this->db->num_rows($resql)>0) {
+ if ($resql && $this->db->num_rows($resql) > 0) {
while ($obj = $this->db->fetch_object($resql)) {
$TChildWarehouse[] = $obj->rowid;
$this->getChildWarehouse($obj->rowid, $TChildWarehouse);
@@ -827,18 +828,18 @@ class InventoryLine extends CommonObjectLine
* @var array Array with all fields and their property
*/
public $fields = array(
- 'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'visible'=>-1, 'enabled'=>1, 'position'=>1, 'notnull'=>1, 'index'=>1, 'comment'=>'Id',),
- 'fk_inventory' => array('type'=>'integer:Inventory:product/inventory/class/inventory.class.php', 'label'=>'Inventory', 'visible'=>1, 'enabled'=>1, 'position'=>30, 'index'=>1, 'help'=>'LinkToInventory'),
- 'fk_warehouse' => array('type'=>'integer:Entrepot:product/stock/class/entrepot.class.php', 'label'=>'Warehouse', 'visible'=>1, 'enabled'=>1, 'position'=>30, 'index'=>1, 'help'=>'LinkToThirdparty'),
- 'fk_product' => array('type'=>'integer:Product:product/class/product.class.php', 'label'=>'Product', 'visible'=>1, 'enabled'=>1, 'position'=>32, 'index'=>1, 'help'=>'LinkToProduct'),
- 'batch' => array('type'=>'string', 'label'=>'Batch', 'visible'=>1, 'enabled'=>1, 'position'=>32, 'index'=>1, 'help'=>'LinkToProduct'),
- 'datec' => array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>500),
- 'tms' => array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>501),
- 'qty_stock' => array('type'=>'double', 'label'=>'QtyFound', 'visible'=>1, 'enabled'=>1, 'position'=>32, 'index'=>1, 'help'=>'Qty we found/want (to define during draft edition)'),
- 'qty_view' => array('type'=>'double', 'label'=>'QtyBefore', 'visible'=>1, 'enabled'=>1, 'position'=>33, 'index'=>1, 'help'=>'Qty before (filled once movements are validated)'),
- 'qty_regulated' => array('type'=>'double', 'label'=>'QtyDelta', 'visible'=>1, 'enabled'=>1, 'position'=>34, 'index'=>1, 'help'=>'Qty added or removed (filled once movements are validated)'),
- 'pmp_real' => array('type'=>'double', 'label'=>'PMPReal', 'visible'=>1, 'enabled'=>1, 'position'=>35),
- 'pmp_expected' => array('type'=>'double', 'label'=>'PMPExpected', 'visible'=>1, 'enabled'=>1, 'position'=>36),
+ 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'visible' => -1, 'enabled' => 1, 'position' => 1, 'notnull' => 1, 'index' => 1, 'comment' => 'Id',),
+ 'fk_inventory' => array('type' => 'integer:Inventory:product/inventory/class/inventory.class.php', 'label' => 'Inventory', 'visible' => 1, 'enabled' => 1, 'position' => 30, 'index' => 1, 'help' => 'LinkToInventory'),
+ 'fk_warehouse' => array('type' => 'integer:Entrepot:product/stock/class/entrepot.class.php', 'label' => 'Warehouse', 'visible' => 1, 'enabled' => 1, 'position' => 30, 'index' => 1, 'help' => 'LinkToThirdparty'),
+ 'fk_product' => array('type' => 'integer:Product:product/class/product.class.php', 'label' => 'Product', 'visible' => 1, 'enabled' => 1, 'position' => 32, 'index' => 1, 'help' => 'LinkToProduct'),
+ 'batch' => array('type' => 'string', 'label' => 'Batch', 'visible' => 1, 'enabled' => 1, 'position' => 32, 'index' => 1, 'help' => 'LinkToProduct'),
+ 'datec' => array('type' => 'datetime', 'label' => 'DateCreation', 'enabled' => 1, 'visible' => -2, 'notnull' => 1, 'position' => 500),
+ 'tms' => array('type' => 'timestamp', 'label' => 'DateModification', 'enabled' => 1, 'visible' => -2, 'notnull' => 1, 'position' => 501),
+ 'qty_stock' => array('type' => 'double', 'label' => 'QtyFound', 'visible' => 1, 'enabled' => 1, 'position' => 32, 'index' => 1, 'help' => 'Qty we found/want (to define during draft edition)'),
+ 'qty_view' => array('type' => 'double', 'label' => 'QtyBefore', 'visible' => 1, 'enabled' => 1, 'position' => 33, 'index' => 1, 'help' => 'Qty before (filled once movements are validated)'),
+ 'qty_regulated' => array('type' => 'double', 'label' => 'QtyDelta', 'visible' => 1, 'enabled' => 1, 'position' => 34, 'index' => 1, 'help' => 'Qty added or removed (filled once movements are validated)'),
+ 'pmp_real' => array('type' => 'double', 'label' => 'PMPReal', 'visible' => 1, 'enabled' => 1, 'position' => 35),
+ 'pmp_expected' => array('type' => 'double', 'label' => 'PMPExpected', 'visible' => 1, 'enabled' => 1, 'position' => 36),
);
/**
diff --git a/htdocs/product/list.php b/htdocs/product/list.php
index 88248cc0d8a..92f95dad523 100644
--- a/htdocs/product/list.php
+++ b/htdocs/product/list.php
@@ -188,11 +188,11 @@ if (getDolGlobalString('STOCK_CALCULATE_ON_SHIPMENT')
// List of fields to search into when doing a "search in all"
$fieldstosearchall = array(
- 'p.ref'=>"Ref",
- 'p.label'=>"ProductLabel",
- 'p.description'=>"Description",
- "p.note"=>"Note",
- 'pfp.ref_fourn'=>'RefSupplier'
+ 'p.ref' => "Ref",
+ 'p.label' => "ProductLabel",
+ 'p.description' => "Description",
+ "p.note" => "Note",
+ 'pfp.ref_fourn' => 'RefSupplier'
);
// multilang
if (getDolGlobalInt('MAIN_MULTILANGS')) {
@@ -220,57 +220,58 @@ $isInEEC = isInEEC($mysoc);
$alias_product_perentity = !getDolGlobalString('MAIN_PRODUCT_PERENTITY_SHARED') ? "p" : "ppe";
+$arraypricelevel = array();
// Definition of array of fields for columns
$arrayfields = array(
- 'p.rowid'=>array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-2, 'noteditable'=>1, 'notnull'=> 1, 'index'=>1, 'position'=>1, 'comment'=>'Id', 'css'=>'left'),
- 'p.ref'=>array('label'=>'ProductRef', 'checked'=>1, 'position'=>10),
+ 'p.rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => -2, 'noteditable' => 1, 'notnull' => 1, 'index' => 1, 'position' => 1, 'comment' => 'Id', 'css' => 'left'),
+ 'p.ref' => array('label' => 'ProductRef', 'checked' => 1, 'position' => 10),
//'pfp.ref_fourn'=>array('label'=>$langs->trans("RefSupplier"), 'checked'=>1, 'enabled'=>(isModEnabled('barcode'))),
- 'thumbnail'=>array('label'=>'Photo', 'checked'=>0, 'position'=>10),
- 'p.description'=>array('label'=>'Description', 'checked'=>0, 'position'=>10),
- 'p.label'=>array('label'=>"Label", 'checked'=>1, 'position'=>10),
- 'p.fk_product_type'=>array('label'=>"Type", 'checked'=>0, 'enabled'=>(isModEnabled("product") && isModEnabled("service")), 'position'=>11),
- 'p.barcode'=>array('label'=>"Gencod", 'checked'=>1, 'enabled'=>(isModEnabled('barcode')), 'position'=>12),
- 'p.duration'=>array('label'=>"Duration", 'checked'=>($contextpage != 'productlist'), 'enabled'=>(isModEnabled("service") && (string) $type == '1'), 'position'=>13),
- 'pac.fk_product_parent' => array('label'=>"ParentProductOfVariant", 'checked'=>-1, 'enabled'=>(isModEnabled('variants')), 'position'=>14),
- 'p.finished'=>array('label'=>"Nature", 'checked'=>0, 'enabled'=>(isModEnabled("product") && $type != '1'), 'position'=>19),
- 'p.weight'=>array('label'=>'Weight', 'checked'=>0, 'enabled'=>(isModEnabled("product") && $type != '1'), 'position'=>20),
- 'p.weight_units'=>array('label'=>'WeightUnits', 'checked'=>0, 'enabled'=>(isModEnabled("product") && $type != '1'), 'position'=>21),
- 'p.length'=>array('label'=>'Length', 'checked'=>0, 'enabled'=>(isModEnabled("product") && !getDolGlobalString('PRODUCT_DISABLE_SIZE') && $type != '1'), 'position'=>22),
- 'p.length_units'=>array('label'=>'LengthUnits', 'checked'=>0, 'enabled'=>(isModEnabled("product") && !getDolGlobalString('PRODUCT_DISABLE_SIZE') && $type != '1'), 'position'=>23),
- 'p.width'=>array('label'=>'Width', 'checked'=>0, 'enabled'=>(isModEnabled("product") && !getDolGlobalString('PRODUCT_DISABLE_SIZE') && $type != '1'), 'position'=>24),
- 'p.width_units'=>array('label'=>'WidthUnits', 'checked'=>0, 'enabled'=>(isModEnabled("product") && !getDolGlobalString('PRODUCT_DISABLE_SIZE') && $type != '1'), 'position'=>25),
- 'p.height'=>array('label'=>'Height', 'checked'=>0, 'enabled'=>(isModEnabled("product") && !getDolGlobalString('PRODUCT_DISABLE_SIZE') && $type != '1'), 'position'=>26),
- 'p.height_units'=>array('label'=>'HeightUnits', 'checked'=>0, 'enabled'=>(isModEnabled("product") && !getDolGlobalString('PRODUCT_DISABLE_SIZE') && $type != '1'), 'position'=>27),
- 'p.surface'=>array('label'=>'Surface', 'checked'=>0, 'enabled'=>(isModEnabled("product") && !getDolGlobalString('PRODUCT_DISABLE_SURFACE') && $type != '1'), 'position'=>28),
- 'p.surface_units'=>array('label'=>'SurfaceUnits', 'checked'=>0, 'enabled'=>(isModEnabled("product") && !getDolGlobalString('PRODUCT_DISABLE_SURFACE') && $type != '1'), 'position'=>29),
- 'p.volume'=>array('label'=>'Volume', 'checked'=>0, 'enabled'=>(isModEnabled("product") && !getDolGlobalString('PRODUCT_DISABLE_VOLUME') && $type != '1'), 'position'=>30),
- 'p.volume_units'=>array('label'=>'VolumeUnits', 'checked'=>0, 'enabled'=>(isModEnabled("product") && !getDolGlobalString('PRODUCT_DISABLE_VOLUME') && $type != '1'), 'position'=>31),
- 'cu.label'=>array('label'=>"DefaultUnitToShow", 'checked'=>0, 'enabled'=>(isModEnabled("product") && getDolGlobalString('PRODUCT_USE_UNITS')), 'position'=>32),
- 'p.fk_default_workstation'=>array('label'=>'DefaultWorkstation', 'checked'=>0, 'enabled'=>isModEnabled('workstation') && $type == 1, 'position'=>33),
- 'p.sellprice'=>array('label'=>"SellingPrice", 'checked'=>1, 'enabled'=>!getDolGlobalString('PRODUIT_MULTIPRICES'), 'position'=>40),
- 'p.tva_tx'=>array('label'=>"VATRate", 'checked'=>0, 'enabled'=>!getDolGlobalString('PRODUIT_MULTIPRICES'), 'position'=>41),
- 'p.minbuyprice'=>array('label'=>"BuyingPriceMinShort", 'checked'=>1, 'enabled'=>($user->hasRight('fournisseur', 'lire')), 'position'=>42),
- 'p.numbuyprice'=>array('label'=>"BuyingPriceNumShort", 'checked'=>0, 'enabled'=>($user->hasRight('fournisseur', 'lire')), 'position'=>43),
- 'p.pmp'=>array('label'=>"PMPValueShort", 'checked'=>0, 'enabled'=>($user->hasRight('fournisseur', 'lire')), 'position'=>44),
- 'p.cost_price'=>array('label'=>"CostPrice", 'checked'=>0, 'enabled'=>($user->hasRight('fournisseur', 'lire')), 'position'=>45),
- 'p.seuil_stock_alerte'=>array('label'=>"StockLimit", 'checked'=>0, 'enabled'=>(isModEnabled('stock') && $user->hasRight('stock', 'lire') && ($contextpage != 'servicelist' || getDolGlobalString('STOCK_SUPPORTS_SERVICES'))), 'position'=>50),
- 'p.desiredstock'=>array('label'=>"DesiredStock", 'checked'=>1, 'enabled'=>(isModEnabled('stock') && $user->hasRight('stock', 'lire') && ($contextpage != 'servicelist' || getDolGlobalString('STOCK_SUPPORTS_SERVICES'))), 'position'=>51),
- 'p.stock'=>array('label'=>"PhysicalStock", 'checked'=>1, 'enabled'=>(isModEnabled('stock') && $user->hasRight('stock', 'lire') && ($contextpage != 'servicelist' || getDolGlobalString('STOCK_SUPPORTS_SERVICES'))), 'position'=>52),
- 'stock_virtual'=>array('label'=>"VirtualStock", 'checked'=>1, 'enabled'=>(isModEnabled('stock') && $user->hasRight('stock', 'lire') && ($contextpage != 'servicelist' || getDolGlobalString('STOCK_SUPPORTS_SERVICES')) && $virtualdiffersfromphysical), 'position'=>53),
- 'p.tobatch'=>array('label'=>"ManageLotSerial", 'checked'=>0, 'enabled'=>(isModEnabled('productbatch')), 'position'=>60),
- 'p.fk_country'=>array('label'=>"Country", 'checked'=>0, 'position'=>100),
- 'p.fk_state'=>array('label'=>"State", 'checked'=>0, 'position'=>101),
- $alias_product_perentity . '.accountancy_code_sell'=>array('label'=>"ProductAccountancySellCode", 'checked'=>0, 'enabled'=>!getDolGlobalString('PRODUCT_DISABLE_ACCOUNTING'), 'position'=>400),
- $alias_product_perentity . '.accountancy_code_sell_intra'=>array('label'=>"ProductAccountancySellIntraCode", 'checked'=>0, 'enabled'=>$isInEEC && !getDolGlobalString('PRODUCT_DISABLE_ACCOUNTING'), 'position'=>401),
- $alias_product_perentity . '.accountancy_code_sell_export'=>array('label'=>"ProductAccountancySellExportCode", 'checked'=>0, 'enabled'=>!getDolGlobalString('PRODUCT_DISABLE_ACCOUNTING'), 'position'=>402),
- $alias_product_perentity . '.accountancy_code_buy'=>array('label'=>"ProductAccountancyBuyCode", 'checked'=>0, 'enabled'=>!getDolGlobalString('PRODUCT_DISABLE_ACCOUNTING'), 'position'=>403),
- $alias_product_perentity . '.accountancy_code_buy_intra'=>array('label'=>"ProductAccountancyBuyIntraCode", 'checked'=>0, 'enabled'=>$isInEEC && !getDolGlobalString('PRODUCT_DISABLE_ACCOUNTING'), 'position'=>404),
- $alias_product_perentity . '.accountancy_code_buy_export'=>array('label'=>"ProductAccountancyBuyExportCode", 'checked'=>0, 'enabled'=>!getDolGlobalString('PRODUCT_DISABLE_ACCOUNTING'), 'position'=>405),
- 'p.datec'=>array('label'=>"DateCreation", 'checked'=>0, 'position'=>500),
- 'p.tms'=>array('label'=>"DateModificationShort", 'checked'=>0, 'position'=>500),
- 'p.tosell'=>array('label'=>$langs->transnoentitiesnoconv("Status").' ('.$langs->transnoentitiesnoconv("Sell").')', 'checked'=>1, 'position'=>1000),
- 'p.tobuy'=>array('label'=>$langs->transnoentitiesnoconv("Status").' ('.$langs->transnoentitiesnoconv("Buy").')', 'checked'=>1, 'position'=>1000),
- 'p.import_key' => array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'notnull'=>-1, 'index'=>0, 'checked'=>-1, 'position'=>1100),
+ 'thumbnail' => array('label' => 'Photo', 'checked' => 0, 'position' => 10),
+ 'p.description' => array('label' => 'Description', 'checked' => 0, 'position' => 10),
+ 'p.label' => array('label' => "Label", 'checked' => 1, 'position' => 10),
+ 'p.fk_product_type' => array('label' => "Type", 'checked' => 0, 'enabled' => (isModEnabled("product") && isModEnabled("service")), 'position' => 11),
+ 'p.barcode' => array('label' => "Gencod", 'checked' => 1, 'enabled' => (isModEnabled('barcode')), 'position' => 12),
+ 'p.duration' => array('label' => "Duration", 'checked' => ($contextpage != 'productlist'), 'enabled' => (isModEnabled("service") && (string) $type == '1'), 'position' => 13),
+ 'pac.fk_product_parent' => array('label' => "ParentProductOfVariant", 'checked' => -1, 'enabled' => (isModEnabled('variants')), 'position' => 14),
+ 'p.finished' => array('label' => "Nature", 'checked' => 0, 'enabled' => (isModEnabled("product") && $type != '1'), 'position' => 19),
+ 'p.weight' => array('label' => 'Weight', 'checked' => 0, 'enabled' => (isModEnabled("product") && $type != '1'), 'position' => 20),
+ 'p.weight_units' => array('label' => 'WeightUnits', 'checked' => 0, 'enabled' => (isModEnabled("product") && $type != '1'), 'position' => 21),
+ 'p.length' => array('label' => 'Length', 'checked' => 0, 'enabled' => (isModEnabled("product") && !getDolGlobalString('PRODUCT_DISABLE_SIZE') && $type != '1'), 'position' => 22),
+ 'p.length_units' => array('label' => 'LengthUnits', 'checked' => 0, 'enabled' => (isModEnabled("product") && !getDolGlobalString('PRODUCT_DISABLE_SIZE') && $type != '1'), 'position' => 23),
+ 'p.width' => array('label' => 'Width', 'checked' => 0, 'enabled' => (isModEnabled("product") && !getDolGlobalString('PRODUCT_DISABLE_SIZE') && $type != '1'), 'position' => 24),
+ 'p.width_units' => array('label' => 'WidthUnits', 'checked' => 0, 'enabled' => (isModEnabled("product") && !getDolGlobalString('PRODUCT_DISABLE_SIZE') && $type != '1'), 'position' => 25),
+ 'p.height' => array('label' => 'Height', 'checked' => 0, 'enabled' => (isModEnabled("product") && !getDolGlobalString('PRODUCT_DISABLE_SIZE') && $type != '1'), 'position' => 26),
+ 'p.height_units' => array('label' => 'HeightUnits', 'checked' => 0, 'enabled' => (isModEnabled("product") && !getDolGlobalString('PRODUCT_DISABLE_SIZE') && $type != '1'), 'position' => 27),
+ 'p.surface' => array('label' => 'Surface', 'checked' => 0, 'enabled' => (isModEnabled("product") && !getDolGlobalString('PRODUCT_DISABLE_SURFACE') && $type != '1'), 'position' => 28),
+ 'p.surface_units' => array('label' => 'SurfaceUnits', 'checked' => 0, 'enabled' => (isModEnabled("product") && !getDolGlobalString('PRODUCT_DISABLE_SURFACE') && $type != '1'), 'position' => 29),
+ 'p.volume' => array('label' => 'Volume', 'checked' => 0, 'enabled' => (isModEnabled("product") && !getDolGlobalString('PRODUCT_DISABLE_VOLUME') && $type != '1'), 'position' => 30),
+ 'p.volume_units' => array('label' => 'VolumeUnits', 'checked' => 0, 'enabled' => (isModEnabled("product") && !getDolGlobalString('PRODUCT_DISABLE_VOLUME') && $type != '1'), 'position' => 31),
+ 'cu.label' => array('label' => "DefaultUnitToShow", 'checked' => 0, 'enabled' => (isModEnabled("product") && getDolGlobalString('PRODUCT_USE_UNITS')), 'position' => 32),
+ 'p.fk_default_workstation' => array('label' => 'DefaultWorkstation', 'checked' => 0, 'enabled' => isModEnabled('workstation') && $type == 1, 'position' => 33),
+ 'p.sellprice' => array('label' => "SellingPrice", 'checked' => 1, 'enabled' => !getDolGlobalString('PRODUIT_MULTIPRICES'), 'position' => 40),
+ 'p.tva_tx' => array('label' => "VATRate", 'checked' => 0, 'enabled' => !getDolGlobalString('PRODUIT_MULTIPRICES'), 'position' => 41),
+ 'p.minbuyprice' => array('label' => "BuyingPriceMinShort", 'checked' => 1, 'enabled' => ($user->hasRight('fournisseur', 'lire')), 'position' => 42),
+ 'p.numbuyprice' => array('label' => "BuyingPriceNumShort", 'checked' => 0, 'enabled' => ($user->hasRight('fournisseur', 'lire')), 'position' => 43),
+ 'p.pmp' => array('label' => "PMPValueShort", 'checked' => 0, 'enabled' => ($user->hasRight('fournisseur', 'lire')), 'position' => 44),
+ 'p.cost_price' => array('label' => "CostPrice", 'checked' => 0, 'enabled' => ($user->hasRight('fournisseur', 'lire')), 'position' => 45),
+ 'p.seuil_stock_alerte' => array('label' => "StockLimit", 'checked' => 0, 'enabled' => (isModEnabled('stock') && $user->hasRight('stock', 'lire') && ($contextpage != 'servicelist' || getDolGlobalString('STOCK_SUPPORTS_SERVICES'))), 'position' => 50),
+ 'p.desiredstock' => array('label' => "DesiredStock", 'checked' => 1, 'enabled' => (isModEnabled('stock') && $user->hasRight('stock', 'lire') && ($contextpage != 'servicelist' || getDolGlobalString('STOCK_SUPPORTS_SERVICES'))), 'position' => 51),
+ 'p.stock' => array('label' => "PhysicalStock", 'checked' => 1, 'enabled' => (isModEnabled('stock') && $user->hasRight('stock', 'lire') && ($contextpage != 'servicelist' || getDolGlobalString('STOCK_SUPPORTS_SERVICES'))), 'position' => 52),
+ 'stock_virtual' => array('label' => "VirtualStock", 'checked' => 1, 'enabled' => (isModEnabled('stock') && $user->hasRight('stock', 'lire') && ($contextpage != 'servicelist' || getDolGlobalString('STOCK_SUPPORTS_SERVICES')) && $virtualdiffersfromphysical), 'position' => 53),
+ 'p.tobatch' => array('label' => "ManageLotSerial", 'checked' => 0, 'enabled' => (isModEnabled('productbatch')), 'position' => 60),
+ 'p.fk_country' => array('label' => "Country", 'checked' => 0, 'position' => 100),
+ 'p.fk_state' => array('label' => "State", 'checked' => 0, 'position' => 101),
+ $alias_product_perentity . '.accountancy_code_sell' => array('label' => "ProductAccountancySellCode", 'checked' => 0, 'enabled' => !getDolGlobalString('PRODUCT_DISABLE_ACCOUNTING'), 'position' => 400),
+ $alias_product_perentity . '.accountancy_code_sell_intra' => array('label' => "ProductAccountancySellIntraCode", 'checked' => 0, 'enabled' => $isInEEC && !getDolGlobalString('PRODUCT_DISABLE_ACCOUNTING'), 'position' => 401),
+ $alias_product_perentity . '.accountancy_code_sell_export' => array('label' => "ProductAccountancySellExportCode", 'checked' => 0, 'enabled' => !getDolGlobalString('PRODUCT_DISABLE_ACCOUNTING'), 'position' => 402),
+ $alias_product_perentity . '.accountancy_code_buy' => array('label' => "ProductAccountancyBuyCode", 'checked' => 0, 'enabled' => !getDolGlobalString('PRODUCT_DISABLE_ACCOUNTING'), 'position' => 403),
+ $alias_product_perentity . '.accountancy_code_buy_intra' => array('label' => "ProductAccountancyBuyIntraCode", 'checked' => 0, 'enabled' => $isInEEC && !getDolGlobalString('PRODUCT_DISABLE_ACCOUNTING'), 'position' => 404),
+ $alias_product_perentity . '.accountancy_code_buy_export' => array('label' => "ProductAccountancyBuyExportCode", 'checked' => 0, 'enabled' => !getDolGlobalString('PRODUCT_DISABLE_ACCOUNTING'), 'position' => 405),
+ 'p.datec' => array('label' => "DateCreation", 'checked' => 0, 'position' => 500),
+ 'p.tms' => array('label' => "DateModificationShort", 'checked' => 0, 'position' => 500),
+ 'p.tosell' => array('label' => $langs->transnoentitiesnoconv("Status").' ('.$langs->transnoentitiesnoconv("Sell").')', 'checked' => 1, 'position' => 1000),
+ 'p.tobuy' => array('label' => $langs->transnoentitiesnoconv("Status").' ('.$langs->transnoentitiesnoconv("Buy").')', 'checked' => 1, 'position' => 1000),
+ 'p.import_key' => array('type' => 'varchar(14)', 'label' => 'ImportId', 'enabled' => 1, 'visible' => -2, 'notnull' => -1, 'index' => 0, 'checked' => -1, 'position' => 1100),
);
/*foreach ($object->fields as $key => $val) {
// If $val['visible']==0, then we never show the field
@@ -295,7 +296,7 @@ if (getDolGlobalString('PRODUIT_MULTIPRICES')) {
} else {
$labelp = $langs->transnoentitiesnoconv("SellingPrice")." ".$i;
}
- $arrayfields['p.sellprice'.$i] = array('label'=>$labelp, 'checked'=>($i == 1 ? 1 : 0), 'enabled'=>getDolGlobalString('PRODUIT_MULTIPRICES'), 'position'=>(float) ('40.'.sprintf('%03s', $i)));
+ $arrayfields['p.sellprice'.$i] = array('label' => $labelp, 'checked' => ($i == 1 ? 1 : 0), 'enabled' => getDolGlobalString('PRODUIT_MULTIPRICES'), 'position' => (float) ('40.'.sprintf('%03s', $i)));
$arraypricelevel[$i] = array($i);
}
}
@@ -828,8 +829,8 @@ $param .= $hookmanager->resPrint;
// List of mass actions available
$arrayofmassactions = array(
- 'generate_doc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("ReGeneratePDF"),
- 'edit_extrafields'=>img_picto('', 'edit', 'class="pictofixedwidth"').$langs->trans("ModifyValueExtrafields"),
+ 'generate_doc' => img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("ReGeneratePDF"),
+ 'edit_extrafields' => img_picto('', 'edit', 'class="pictofixedwidth"').$langs->trans("ModifyValueExtrafields"),
//'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"),
//'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"),
);
@@ -850,8 +851,8 @@ if ($user->hasRight($rightskey, 'supprimer')) {
$massactionbutton = $form->selectMassAction('', $arrayofmassactions);
$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'));
if ($type === "") {
$perm = ($user->hasRight('produit', 'creer') || $user->hasRight('service', 'creer'));
@@ -860,8 +861,8 @@ if ($type === "") {
} elseif ($type == Product::TYPE_PRODUCT) {
$perm = $user->hasRight('produit', 'creer');
}
- $oldtype = $type;
- $params = array();
+$oldtype = $type;
+$params = array();
if ($type === "") {
$params['forcenohideoftext'] = 1;
}
@@ -998,7 +999,7 @@ if (!empty($arrayfields['p.label']['checked'])) {
// Type
if (!empty($arrayfields['p.fk_product_type']['checked'])) {
print '
';
- $array = array('-1'=>' ', '0'=>$langs->trans('Product'), '1'=>$langs->trans('Service'));
+ $array = array('-1' => ' ', '0' => $langs->trans('Product'), '1' => $langs->trans('Service'));
print $form->selectarray('search_type', $array, $search_type);
print ' ';
}
@@ -1217,7 +1218,7 @@ if (!empty($arrayfields[$alias_product_perentity . '.accountancy_code_buy_export
// Extra fields
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
@@ -1236,12 +1237,12 @@ if (!empty($arrayfields['p.import_key']['checked'])) {
}
if (!empty($arrayfields['p.tosell']['checked'])) {
print '';
- print $form->selectarray('search_tosell', array('0'=>$langs->trans('ProductStatusNotOnSellShort'), '1'=>$langs->trans('ProductStatusOnSellShort')), $search_tosell, 1, 0, 0, '', 0, 0, 0, '', 'search_status width100 onrightofpage');
+ print $form->selectarray('search_tosell', array('0' => $langs->trans('ProductStatusNotOnSellShort'), '1' => $langs->trans('ProductStatusOnSellShort')), $search_tosell, 1, 0, 0, '', 0, 0, 0, '', 'search_status width100 onrightofpage');
print ' ';
}
if (!empty($arrayfields['p.tobuy']['checked'])) {
print '';
- print $form->selectarray('search_tobuy', array('0'=>$langs->trans('ProductStatusNotOnBuyShort'), '1'=>$langs->trans('ProductStatusOnBuyShort')), $search_tobuy, 1, 0, 0, '', 0, 0, 0, '', 'search_status width100 onrightofpage');
+ print $form->selectarray('search_tobuy', array('0' => $langs->trans('ProductStatusNotOnBuyShort'), '1' => $langs->trans('ProductStatusOnBuyShort')), $search_tobuy, 1, 0, 0, '', 0, 0, 0, '', 'search_status width100 onrightofpage');
print ' ';
}
// Action column
@@ -1454,7 +1455,7 @@ if (!empty($arrayfields[$alias_product_perentity . '.accountancy_code_buy_export
// 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'])) {
@@ -1716,9 +1717,9 @@ while ($i < $imaxinloop) {
$duration_unit = substr($obj->duration, -1);
if ((float) $duration_value > 1) {
- $dur = array("i"=>$langs->trans("Minutes"), "h"=>$langs->trans("Hours"), "d"=>$langs->trans("Days"), "w"=>$langs->trans("Weeks"), "m"=>$langs->trans("Months"), "y"=>$langs->trans("Years"));
+ $dur = array("i" => $langs->trans("Minutes"), "h" => $langs->trans("Hours"), "d" => $langs->trans("Days"), "w" => $langs->trans("Weeks"), "m" => $langs->trans("Months"), "y" => $langs->trans("Years"));
} elseif ((float) $duration_value > 0) {
- $dur = array("i"=>$langs->trans("Minute"), "h"=>$langs->trans("Hour"), "d"=>$langs->trans("Day"), "w"=>$langs->trans("Week"), "m"=>$langs->trans("Month"), "y"=>$langs->trans("Year"));
+ $dur = array("i" => $langs->trans("Minute"), "h" => $langs->trans("Hour"), "d" => $langs->trans("Day"), "w" => $langs->trans("Week"), "m" => $langs->trans("Month"), "y" => $langs->trans("Year"));
}
print $duration_value;
print((!empty($duration_unit) && isset($dur[$duration_unit]) && $duration_value != '') ? ' '.$langs->trans($dur[$duration_unit]) : '');
@@ -1738,7 +1739,7 @@ while ($i < $imaxinloop) {
if (!empty($conf->cache['product'][$obj->fk_product_parent])) {
$product_parent_static = $conf->cache['product'][$obj->fk_product_parent];
} else {
- $product_parent_static= new Product($db);
+ $product_parent_static = new Product($db);
$product_parent_static->fetch($obj->fk_product_parent);
$conf->cache['product'][$obj->fk_product_parent] = $product_parent_static;
}
@@ -1925,7 +1926,7 @@ while ($i < $imaxinloop) {
// Multiprices
if (getDolGlobalString('PRODUIT_MULTIPRICES')) {
if (! isset($productpricescache)) {
- $productpricescache=array();
+ $productpricescache = array();
}
if (! isset($productpricescache[$obj->rowid])) {
$productpricescache[$obj->rowid] = array();
@@ -2173,7 +2174,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
diff --git a/htdocs/product/stock/movement_card.php b/htdocs/product/stock/movement_card.php
index 5eb441f835e..6c8671175ec 100644
--- a/htdocs/product/stock/movement_card.php
+++ b/htdocs/product/stock/movement_card.php
@@ -103,21 +103,21 @@ $extrafields->fetch_name_optionals_label($object->table_element);
$search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
$arrayfields = array(
- 'm.rowid'=>array('label'=>$langs->trans("Ref"), 'checked'=>1),
- 'm.datem'=>array('label'=>$langs->trans("Date"), 'checked'=>1),
- 'p.ref'=>array('label'=>$langs->trans("ProductRef"), 'checked'=>1, 'css'=>'maxwidth100'),
- 'p.label'=>array('label'=>$langs->trans("ProductLabel"), 'checked'=>1),
- 'm.batch'=>array('label'=>$langs->trans("BatchNumberShort"), 'checked'=>1, 'enabled'=>(isModEnabled('productbatch'))),
- 'pl.eatby'=>array('label'=>$langs->trans("EatByDate"), 'checked'=>0, 'position'=>10, 'enabled'=>(isModEnabled('productbatch'))),
- 'pl.sellby'=>array('label'=>$langs->trans("SellByDate"), 'checked'=>0, 'position'=>10, 'enabled'=>(isModEnabled('productbatch'))),
- 'e.ref'=>array('label'=>$langs->trans("Warehouse"), 'checked'=>1, 'enabled'=>(!($id > 0))), // If we are on specific warehouse, we hide it
- 'm.fk_user_author'=>array('label'=>$langs->trans("Author"), 'checked'=>0),
- 'm.inventorycode'=>array('label'=>$langs->trans("InventoryCodeShort"), 'checked'=>1),
- 'm.label'=>array('label'=>$langs->trans("MovementLabel"), 'checked'=>1),
- 'm.type_mouvement'=>array('label'=>$langs->trans("TypeMovement"), 'checked'=>1),
- 'origin'=>array('label'=>$langs->trans("Origin"), 'checked'=>1),
- 'm.value'=>array('label'=>$langs->trans("Qty"), 'checked'=>1),
- 'm.price'=>array('label'=>$langs->trans("UnitPurchaseValue"), 'checked'=>0),
+ 'm.rowid' => array('label' => $langs->trans("Ref"), 'checked' => 1),
+ 'm.datem' => array('label' => $langs->trans("Date"), 'checked' => 1),
+ 'p.ref' => array('label' => $langs->trans("ProductRef"), 'checked' => 1, 'css' => 'maxwidth100'),
+ 'p.label' => array('label' => $langs->trans("ProductLabel"), 'checked' => 1),
+ 'm.batch' => array('label' => $langs->trans("BatchNumberShort"), 'checked' => 1, 'enabled' => (isModEnabled('productbatch'))),
+ 'pl.eatby' => array('label' => $langs->trans("EatByDate"), 'checked' => 0, 'position' => 10, 'enabled' => (isModEnabled('productbatch'))),
+ 'pl.sellby' => array('label' => $langs->trans("SellByDate"), 'checked' => 0, 'position' => 10, 'enabled' => (isModEnabled('productbatch'))),
+ 'e.ref' => array('label' => $langs->trans("Warehouse"), 'checked' => 1, 'enabled' => (!($id > 0))), // If we are on specific warehouse, we hide it
+ 'm.fk_user_author' => array('label' => $langs->trans("Author"), 'checked' => 0),
+ 'm.inventorycode' => array('label' => $langs->trans("InventoryCodeShort"), 'checked' => 1),
+ 'm.label' => array('label' => $langs->trans("MovementLabel"), 'checked' => 1),
+ 'm.type_mouvement' => array('label' => $langs->trans("TypeMovement"), 'checked' => 1),
+ 'origin' => array('label' => $langs->trans("Origin"), 'checked' => 1),
+ 'm.value' => array('label' => $langs->trans("Qty"), 'checked' => 1),
+ 'm.price' => array('label' => $langs->trans("UnitPurchaseValue"), 'checked' => 0),
//'m.datec'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500),
//'m.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500)
);
@@ -754,6 +754,10 @@ if ($resql) {
}
if ($sall) {
+ if (!isset($fieldstosearchall) || !is_array($fieldstosearchall)) {
+ // Ensure $fieldstosearchall is array
+ $fieldstosearchall = array();
+ }
foreach ($fieldstosearchall as $key => $val) {
$fieldstosearchall[$key] = $langs->trans($val);
}
@@ -891,7 +895,7 @@ if ($resql) {
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); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
// Date creation
@@ -963,7 +967,7 @@ if ($resql) {
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); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
if (!empty($arrayfields['m.datec']['checked'])) {
diff --git a/htdocs/product/stock/movement_list.php b/htdocs/product/stock/movement_list.php
index 969b058cf81..95e7b87a203 100644
--- a/htdocs/product/stock/movement_list.php
+++ b/htdocs/product/stock/movement_list.php
@@ -1117,6 +1117,10 @@ if ($massaction == 'prereverse') {
if ($search_all) {
$setupstring = '';
+ if (!isset($fieldstosearchall) || !is_array($fieldstosearchall)) {
+ // Ensure $fieldstosearchall is array
+ $fieldstosearchall = array();
+ }
foreach ($fieldstosearchall as $key => $val) {
$fieldstosearchall[$key] = $langs->trans($val);
$setupstring .= $key."=".$val.";";
diff --git a/htdocs/product/stock/stocktransfer/class/stocktransferline.class.php b/htdocs/product/stock/stocktransfer/class/stocktransferline.class.php
index 8eb2c92c8cb..f726293c5e4 100644
--- a/htdocs/product/stock/stocktransfer/class/stocktransferline.class.php
+++ b/htdocs/product/stock/stocktransfer/class/stocktransferline.class.php
@@ -427,6 +427,7 @@ class StockTransferLine extends CommonObjectLine
$p = new Product($this->db);
$p->fetch($this->fk_product);
+ $op = array();
$op[0] = "+".trim($this->qty);
$op[1] = "-".trim($this->qty);
$movementstock = new MouvementStock($this->db);
diff --git a/htdocs/projet/admin/project.php b/htdocs/projet/admin/project.php
index a3fa658764d..625b0bd76f7 100644
--- a/htdocs/projet/admin/project.php
+++ b/htdocs/projet/admin/project.php
@@ -533,6 +533,7 @@ print "\n";
clearstatcache();
+$filelist = array();
foreach ($dirmodels as $reldir) {
foreach (array('', '/doc') as $valdir) {
$dir = dol_buildpath($reldir."core/modules/project/".$valdir);
@@ -801,10 +802,10 @@ if (!$conf->use_javascript_ajax) {
print " ";
} else {
print '
';
- $arrval = array('0'=>$langs->trans("No"),
- '1'=>$langs->trans("Yes").' ('.$langs->trans("NumberOfKeyToSearch", 1).')',
- '2'=>$langs->trans("Yes").' ('.$langs->trans("NumberOfKeyToSearch", 2).')',
- '3'=>$langs->trans("Yes").' ('.$langs->trans("NumberOfKeyToSearch", 3).')',
+ $arrval = array('0' => $langs->trans("No"),
+ '1' => $langs->trans("Yes").' ('.$langs->trans("NumberOfKeyToSearch", 1).')',
+ '2' => $langs->trans("Yes").' ('.$langs->trans("NumberOfKeyToSearch", 2).')',
+ '3' => $langs->trans("Yes").' ('.$langs->trans("NumberOfKeyToSearch", 3).')',
);
print $form->selectarray("activate_PROJECT_USE_SEARCH_TO_SELECT", $arrval, getDolGlobalString("PROJECT_USE_SEARCH_TO_SELECT"));
print ' ';
@@ -825,13 +826,13 @@ print '';
$key = 'PROJECT_CLASSIFY_CLOSED_WHEN_ALL_TASKS_DONE';
echo ' ',
- '',
- $form->textwithpicto($langs->transnoentities($key), $langs->transnoentities($key . '_help')),
- ' ',
- '',
- ajax_constantonoff($key),
- ' ',
- ' ';
+'
',
+$form->textwithpicto($langs->transnoentities($key), $langs->transnoentities($key . '_help')),
+' ',
+'
',
+ajax_constantonoff($key),
+' ',
+'';
print '
';
print ''.$langs->trans("TimesheetPreventAfterFollowingMonths").' ';
diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php
index 4f6e2b36480..eb5675e23be 100644
--- a/htdocs/projet/class/project.class.php
+++ b/htdocs/projet/class/project.class.php
@@ -295,46 +295,46 @@ class Project extends CommonObject
* @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor.
*/
public $fields = array(
- 'rowid' =>array('type'=>'integer', 'label'=>'ID', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>10),
- 'fk_project' =>array('type'=>'integer', 'label'=>'Parent', 'enabled'=>1, 'visible'=>1, 'notnull'=>0, 'position'=>12),
- 'ref' =>array('type'=>'varchar(50)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>1, 'showoncombobox'=>1, 'position'=>15, 'searchall'=>1),
- 'title' =>array('type'=>'varchar(255)', 'label'=>'ProjectLabel', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'position'=>17, 'showoncombobox'=>2, 'searchall'=>1),
- 'entity' =>array('type'=>'integer', 'label'=>'Entity', 'default'=>1, 'enabled'=>1, 'visible'=>3, 'notnull'=>1, 'position'=>19),
- 'fk_soc' =>array('type'=>'integer', 'label'=>'Thirdparty', 'enabled'=>1, 'visible'=>0, 'position'=>20),
- 'dateo' =>array('type'=>'date', 'label'=>'DateStart', 'enabled'=>1, 'visible'=>1, 'position'=>30),
- 'datee' =>array('type'=>'date', 'label'=>'DateEnd', 'enabled'=>1, 'visible'=>1, 'position'=>35),
- 'description' =>array('type'=>'text', 'label'=>'Description', 'enabled'=>1, 'visible'=>3, 'position'=>55, 'searchall'=>1),
- 'public' =>array('type'=>'integer', 'label'=>'Visibility', 'enabled'=>1, 'visible'=>1, 'position'=>65),
- 'fk_opp_status' =>array('type'=>'integer', 'label'=>'OpportunityStatusShort', 'enabled'=>'getDolGlobalString("PROJECT_USE_OPPORTUNITIES")', 'visible'=>1, 'position'=>75),
- 'opp_percent' =>array('type'=>'double(5,2)', 'label'=>'OpportunityProbabilityShort', 'enabled'=>'getDolGlobalString("PROJECT_USE_OPPORTUNITIES")', 'visible'=>1, 'position'=>80),
- 'note_private' =>array('type'=>'html', 'label'=>'NotePrivate', 'enabled'=>1, 'visible'=>0, 'position'=>85, 'searchall'=>1),
- 'note_public' =>array('type'=>'html', 'label'=>'NotePublic', 'enabled'=>1, 'visible'=>0, 'position'=>90, 'searchall'=>1),
- 'model_pdf' =>array('type'=>'varchar(255)', 'label'=>'ModelPdf', 'enabled'=>1, 'visible'=>0, 'position'=>95),
- 'date_close' =>array('type'=>'datetime', 'label'=>'DateClosing', 'enabled'=>1, 'visible'=>0, 'position'=>105),
- 'fk_user_close' =>array('type'=>'integer', 'label'=>'UserClosing', 'enabled'=>1, 'visible'=>0, 'position'=>110),
- 'opp_amount' =>array('type'=>'double(24,8)', 'label'=>'OpportunityAmountShort', 'enabled'=>1, 'visible'=>'getDolGlobalString("PROJECT_USE_OPPORTUNITIES")', 'position'=>115),
- 'budget_amount' =>array('type'=>'double(24,8)', 'label'=>'Budget', 'enabled'=>1, 'visible'=>-1, 'position'=>119),
- 'usage_opportunity' =>array('type'=>'integer', 'label'=>'UsageOpportunity', 'enabled'=>1, 'visible'=>-1, 'position'=>130),
- 'usage_task' =>array('type'=>'integer', 'label'=>'UsageTasks', 'enabled'=>1, 'visible'=>-1, 'position'=>135),
- 'usage_bill_time' =>array('type'=>'integer', 'label'=>'UsageBillTimeShort', 'enabled'=>1, 'visible'=>-1, 'position'=>140),
- 'usage_organize_event' =>array('type'=>'integer', 'label'=>'UsageOrganizeEvent', 'enabled'=>1, 'visible'=>-1, 'position'=>145),
+ 'rowid' => array('type' => 'integer', 'label' => 'ID', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 10),
+ 'fk_project' => array('type' => 'integer', 'label' => 'Parent', 'enabled' => 1, 'visible' => 1, 'notnull' => 0, 'position' => 12),
+ 'ref' => array('type' => 'varchar(50)', 'label' => 'Ref', 'enabled' => 1, 'visible' => 1, 'showoncombobox' => 1, 'position' => 15, 'searchall' => 1),
+ 'title' => array('type' => 'varchar(255)', 'label' => 'ProjectLabel', 'enabled' => 1, 'visible' => 1, 'notnull' => 1, 'position' => 17, 'showoncombobox' => 2, 'searchall' => 1),
+ 'entity' => array('type' => 'integer', 'label' => 'Entity', 'default' => 1, 'enabled' => 1, 'visible' => 3, 'notnull' => 1, 'position' => 19),
+ 'fk_soc' => array('type' => 'integer', 'label' => 'Thirdparty', 'enabled' => 1, 'visible' => 0, 'position' => 20),
+ 'dateo' => array('type' => 'date', 'label' => 'DateStart', 'enabled' => 1, 'visible' => 1, 'position' => 30),
+ 'datee' => array('type' => 'date', 'label' => 'DateEnd', 'enabled' => 1, 'visible' => 1, 'position' => 35),
+ 'description' => array('type' => 'text', 'label' => 'Description', 'enabled' => 1, 'visible' => 3, 'position' => 55, 'searchall' => 1),
+ 'public' => array('type' => 'integer', 'label' => 'Visibility', 'enabled' => 1, 'visible' => 1, 'position' => 65),
+ 'fk_opp_status' => array('type' => 'integer', 'label' => 'OpportunityStatusShort', 'enabled' => 'getDolGlobalString("PROJECT_USE_OPPORTUNITIES")', 'visible' => 1, 'position' => 75),
+ 'opp_percent' => array('type' => 'double(5,2)', 'label' => 'OpportunityProbabilityShort', 'enabled' => 'getDolGlobalString("PROJECT_USE_OPPORTUNITIES")', 'visible' => 1, 'position' => 80),
+ 'note_private' => array('type' => 'html', 'label' => 'NotePrivate', 'enabled' => 1, 'visible' => 0, 'position' => 85, 'searchall' => 1),
+ 'note_public' => array('type' => 'html', 'label' => 'NotePublic', 'enabled' => 1, 'visible' => 0, 'position' => 90, 'searchall' => 1),
+ 'model_pdf' => array('type' => 'varchar(255)', 'label' => 'ModelPdf', 'enabled' => 1, 'visible' => 0, 'position' => 95),
+ 'date_close' => array('type' => 'datetime', 'label' => 'DateClosing', 'enabled' => 1, 'visible' => 0, 'position' => 105),
+ 'fk_user_close' => array('type' => 'integer', 'label' => 'UserClosing', 'enabled' => 1, 'visible' => 0, 'position' => 110),
+ 'opp_amount' => array('type' => 'double(24,8)', 'label' => 'OpportunityAmountShort', 'enabled' => 1, 'visible' => 'getDolGlobalString("PROJECT_USE_OPPORTUNITIES")', 'position' => 115),
+ 'budget_amount' => array('type' => 'double(24,8)', 'label' => 'Budget', 'enabled' => 1, 'visible' => -1, 'position' => 119),
+ 'usage_opportunity' => array('type' => 'integer', 'label' => 'UsageOpportunity', 'enabled' => 1, 'visible' => -1, 'position' => 130),
+ 'usage_task' => array('type' => 'integer', 'label' => 'UsageTasks', 'enabled' => 1, 'visible' => -1, 'position' => 135),
+ 'usage_bill_time' => array('type' => 'integer', 'label' => 'UsageBillTimeShort', 'enabled' => 1, 'visible' => -1, 'position' => 140),
+ 'usage_organize_event' => array('type' => 'integer', 'label' => 'UsageOrganizeEvent', 'enabled' => 1, 'visible' => -1, 'position' => 145),
// Properties for event organization
- 'date_start_event' =>array('type'=>'date', 'label'=>'DateStartEvent', 'enabled'=>"isModEnabled('eventorganization')", 'visible'=>1, 'position'=>200),
- 'date_end_event' =>array('type'=>'date', 'label'=>'DateEndEvent', 'enabled'=>"isModEnabled('eventorganization')", 'visible'=>1, 'position'=>201),
- 'location' =>array('type'=>'text', 'label'=>'Location', 'enabled'=>1, 'visible'=>3, 'position'=>55, 'searchall'=>202),
- 'accept_conference_suggestions' =>array('type'=>'integer', 'label'=>'AllowUnknownPeopleSuggestConf', 'enabled'=>1, 'visible'=>-1, 'position'=>210),
- 'accept_booth_suggestions' =>array('type'=>'integer', 'label'=>'AllowUnknownPeopleSuggestBooth', 'enabled'=>1, 'visible'=>-1, 'position'=>211),
- 'price_registration' =>array('type'=>'double(24,8)', 'label'=>'PriceOfRegistration', 'enabled'=>1, 'visible'=>-1, 'position'=>212),
- 'price_booth' =>array('type'=>'double(24,8)', 'label'=>'PriceOfBooth', 'enabled'=>1, 'visible'=>-1, 'position'=>215),
- 'max_attendees' =>array('type'=>'integer', 'label'=>'MaxNbOfAttendees', 'enabled'=>1, 'visible'=>-1, 'position'=>215),
+ 'date_start_event' => array('type' => 'date', 'label' => 'DateStartEvent', 'enabled' => "isModEnabled('eventorganization')", 'visible' => 1, 'position' => 200),
+ 'date_end_event' => array('type' => 'date', 'label' => 'DateEndEvent', 'enabled' => "isModEnabled('eventorganization')", 'visible' => 1, 'position' => 201),
+ 'location' => array('type' => 'text', 'label' => 'Location', 'enabled' => 1, 'visible' => 3, 'position' => 55, 'searchall' => 202),
+ 'accept_conference_suggestions' => array('type' => 'integer', 'label' => 'AllowUnknownPeopleSuggestConf', 'enabled' => 1, 'visible' => -1, 'position' => 210),
+ 'accept_booth_suggestions' => array('type' => 'integer', 'label' => 'AllowUnknownPeopleSuggestBooth', 'enabled' => 1, 'visible' => -1, 'position' => 211),
+ 'price_registration' => array('type' => 'double(24,8)', 'label' => 'PriceOfRegistration', 'enabled' => 1, 'visible' => -1, 'position' => 212),
+ 'price_booth' => array('type' => 'double(24,8)', 'label' => 'PriceOfBooth', 'enabled' => 1, 'visible' => -1, 'position' => 215),
+ 'max_attendees' => array('type' => 'integer', 'label' => 'MaxNbOfAttendees', 'enabled' => 1, 'visible' => -1, 'position' => 215),
// Generic
- 'datec' =>array('type'=>'datetime', 'label'=>'DateCreationShort', 'enabled'=>1, 'visible'=>-2, 'position'=>400),
- 'tms' =>array('type'=>'timestamp', 'label'=>'DateModificationShort', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>405),
- 'fk_user_creat' =>array('type'=>'integer', 'label'=>'UserCreation', 'enabled'=>1, 'visible'=>0, 'notnull'=>1, 'position'=>410),
- 'fk_user_modif' =>array('type'=>'integer', 'label'=>'UserModification', 'enabled'=>1, 'visible'=>0, 'position'=>415),
- 'import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-1, 'position'=>420),
- 'email_msgid'=>array('type'=>'varchar(255)', 'label'=>'EmailMsgID', 'enabled'=>1, 'visible'=>-1, 'position'=>450, 'help'=>'EmailMsgIDWhenSourceisEmail', 'csslist'=>'tdoverflowmax125'),
- 'fk_statut' =>array('type'=>'smallint(6)', 'label'=>'Status', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'position'=>500),
+ 'datec' => array('type' => 'datetime', 'label' => 'DateCreationShort', 'enabled' => 1, 'visible' => -2, 'position' => 400),
+ 'tms' => array('type' => 'timestamp', 'label' => 'DateModificationShort', 'enabled' => 1, 'visible' => -2, 'notnull' => 1, 'position' => 405),
+ 'fk_user_creat' => array('type' => 'integer', 'label' => 'UserCreation', 'enabled' => 1, 'visible' => 0, 'notnull' => 1, 'position' => 410),
+ 'fk_user_modif' => array('type' => 'integer', 'label' => 'UserModification', 'enabled' => 1, 'visible' => 0, 'position' => 415),
+ 'import_key' => array('type' => 'varchar(14)', 'label' => 'ImportId', 'enabled' => 1, 'visible' => -1, 'position' => 420),
+ 'email_msgid' => array('type' => 'varchar(255)', 'label' => 'EmailMsgID', 'enabled' => 1, 'visible' => -1, 'position' => 450, 'help' => 'EmailMsgIDWhenSourceisEmail', 'csslist' => 'tdoverflowmax125'),
+ 'fk_statut' => array('type' => 'smallint(6)', 'label' => 'Status', 'enabled' => 1, 'visible' => 1, 'notnull' => 1, 'position' => 500),
);
// END MODULEBUILDER PROPERTIES
@@ -876,7 +876,7 @@ class Project extends CommonObject
}
$parameters = array(
- 'sql'=>$sql,
+ 'sql' => $sql,
'type' => $type,
'tablename' => $tablename,
'datefieldname' => $datefieldname,
@@ -950,14 +950,14 @@ class Project extends CommonObject
// Set fk_projet into elements to null
$listoftables = array(
- 'propal'=>'fk_projet', 'commande'=>'fk_projet', 'facture'=>'fk_projet',
- 'supplier_proposal'=>'fk_projet', 'commande_fournisseur'=>'fk_projet', 'facture_fourn'=>'fk_projet',
- 'expensereport_det'=>'fk_projet', 'contrat'=>'fk_projet',
- 'fichinter'=>'fk_projet',
- 'don'=>array('field'=>'fk_projet', 'module'=>'don'),
- 'actioncomm'=>'fk_project',
- 'mrp_mo'=>'fk_project',
- 'entrepot'=>'fk_project'
+ 'propal' => 'fk_projet', 'commande' => 'fk_projet', 'facture' => 'fk_projet',
+ 'supplier_proposal' => 'fk_projet', 'commande_fournisseur' => 'fk_projet', 'facture_fourn' => 'fk_projet',
+ 'expensereport_det' => 'fk_projet', 'contrat' => 'fk_projet',
+ 'fichinter' => 'fk_projet',
+ 'don' => array('field' => 'fk_projet', 'module' => 'don'),
+ 'actioncomm' => 'fk_project',
+ 'mrp_mo' => 'fk_project',
+ 'entrepot' => 'fk_project'
);
foreach ($listoftables as $key => $value) {
if (is_array($value)) {
@@ -1461,7 +1461,7 @@ class Project extends CommonObject
global $action;
$hookmanager->initHooks(array('projectdao'));
- $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;
@@ -1804,7 +1804,7 @@ class Project extends CommonObject
foreach (array('internal', 'external') as $source) {
$tab = $origin_project->liste_contact(-1, $source);
- if (is_array($tab) && count($tab)>0) {
+ if (is_array($tab) && count($tab) > 0) {
foreach ($tab as $contacttoadd) {
$clone_project->add_contact($contacttoadd['id'], $contacttoadd['code'], $contacttoadd['source'], $notrigger);
if ($clone_project->error == 'DB_ERROR_RECORD_ALREADY_EXISTS') {
@@ -2490,7 +2490,7 @@ class Project extends CommonObject
$return .= ''.$this->thirdparty->getNomUrl(1);
$return .= '
';
$return .= dol_print_phone($this->thirdparty->phone, $this->thirdparty->country_code, 0, $this->thirdparty->id, 'tel', 'hidenum', 'phone');
- $return .='
';
+ $return .= '';
}
if (!empty($arraydata['assignedusers'])) {
$return .= ' ';
@@ -2564,6 +2564,7 @@ class Project extends CommonObject
$now = dol_now();
$nowDate = dol_getdate($now, true);
+ $errorsMsg = array();
$firstDayOfWeekTS = dol_get_first_day_week($nowDate['mday'], $nowDate['mon'], $nowDate['year']);
diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php
index df339ae9004..a8217136ff6 100644
--- a/htdocs/projet/class/task.class.php
+++ b/htdocs/projet/class/task.class.php
@@ -1190,7 +1190,7 @@ class Task extends CommonObjectLine
*
* @param User|null $userp Return roles on project for this internal user. If set, usert and taskid must not be defined.
* @param User|null $usert Return roles on task for this internal user. If set userp must NOT be defined. -1 means no filter.
- * @param int $projectid Project id list separated with , to filter on project
+ * @param string $projectid Project id list separated with , to filter on project
* @param int $taskid Task id to filter on a task
* @param integer $filteronprojstatus Filter on project status if userp is set. Not used if userp not defined.
* @return array|int Array (projectid => 'list of roles for project' or taskid => 'list of roles for task')
@@ -1595,7 +1595,7 @@ class Task extends CommonObjectLine
/**
* Calculate quantity and value of time consumed using the thm (hourly amount value of work for user entering time)
*
- * @param User $fuser Filter on a dedicated user
+ * @param User|string $fuser Filter on a dedicated user
* @param string $dates Start date (ex 00:00:00)
* @param string $datee End date (ex 23:59:59)
* @return array Array of info for task array('amount','nbseconds','nblinesnull')
diff --git a/htdocs/public/members/new.php b/htdocs/public/members/new.php
index 9d2c29f6068..cbf976a9377 100644
--- a/htdocs/public/members/new.php
+++ b/htdocs/public/members/new.php
@@ -598,6 +598,7 @@ if (getDolGlobalString('MEMBER_SKIP_TABLE') || getDolGlobalString('MEMBER_NEWFOR
}
// Moral/Physic attribute
+ $morphys = array();
$morphys["phy"] = $langs->trans("Physical");
$morphys["mor"] = $langs->trans("Moral");
if (!getDolGlobalString('MEMBER_NEWFORM_FORCEMORPHY')) {
@@ -641,7 +642,7 @@ if (getDolGlobalString('MEMBER_SKIP_TABLE') || getDolGlobalString('MEMBER_NEWFOR
// Gender
print ' '.$langs->trans("Gender").' ';
print '';
- $arraygender = array('man'=>$langs->trans("Genderman"), 'woman'=>$langs->trans("Genderwoman"), 'other'=>$langs->trans("Genderother"));
+ $arraygender = array('man' => $langs->trans("Genderman"), 'woman' => $langs->trans("Genderwoman"), 'other' => $langs->trans("Genderother"));
print $form->selectarray('gender', $arraygender, GETPOST('gender', 'alphanohtml'), 1, 0, 0, '', 0, 0, 0, '', '', 1);
print ' ';
@@ -703,7 +704,7 @@ if (getDolGlobalString('MEMBER_SKIP_TABLE') || getDolGlobalString('MEMBER_NEWFOR
}
// Other attributes
- $parameters['tpl_context']='public'; // define template context to public
+ $parameters['tpl_context'] = 'public'; // define template context to public
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php';
// Comments
@@ -715,7 +716,7 @@ if (getDolGlobalString('MEMBER_SKIP_TABLE') || getDolGlobalString('MEMBER_NEWFOR
// Add specific fields used by Dolibarr foundation for example
// TODO Move this into generic feature.
if (getDolGlobalString('MEMBER_NEWFORM_DOLIBARRTURNOVER')) {
- $arraybudget = array('50'=>'<= 100 000', '100'=>'<= 200 000', '200'=>'<= 500 000', '300'=>'<= 1 500 000', '600'=>'<= 3 000 000', '1000'=>'<= 5 000 000', '2000'=>'5 000 000+');
+ $arraybudget = array('50' => '<= 100 000', '100' => '<= 200 000', '200' => '<= 500 000', '300' => '<= 1 500 000', '600' => '<= 3 000 000', '1000' => '<= 5 000 000', '2000' => '5 000 000+');
print '
'.$langs->trans("TurnoverOrBudget").' * ';
print $form->selectarray('budget', $arraybudget, GETPOST('budget'), 1);
print ' € or $';
@@ -778,7 +779,7 @@ if (getDolGlobalString('MEMBER_SKIP_TABLE') || getDolGlobalString('MEMBER_NEWFOR
// Clean the amount
$amount = price2num($amount);
- $showedamount = $amount>0 ? $amount : 0;
+ $showedamount = $amount > 0 ? $amount : 0;
// $conf->global->MEMBER_NEWFORM_PAYONLINE is 'paypal', 'paybox' or 'stripe'
print ' '.$langs->trans("Subscription");
if (getDolGlobalString('MEMBER_EXT_URL_SUBSCRIPTION_INFO')) {
@@ -896,7 +897,7 @@ if (getDolGlobalString('MEMBER_SKIP_TABLE') || getDolGlobalString('MEMBER_NEWFOR
if ($displayedamount > 0 || !$caneditamount) {
print price($displayedamount, 1, $langs, 1, 0, -1, $conf->currency);
}
- if ($caneditamount && $displayedamount>0) {
+ if ($caneditamount && $displayedamount > 0) {
print $form->textwithpicto('', $langs->transnoentities("CanEditAmountShortForValues"), 1, 'help', '', 0, 3);
} elseif ($caneditamount) {
print $langs->transnoentities("CanEditAmountShort");
@@ -917,7 +918,7 @@ if (getDolGlobalString('MEMBER_SKIP_TABLE') || getDolGlobalString('MEMBER_NEWFOR
if (empty($hidevoteallowed)) {
print ' '.yn($objp->vote).' ';
}
- $membercount = $objp->membercount>0 ? $objp->membercount : "–";
+ $membercount = $objp->membercount > 0 ? $objp->membercount : "–";
if ($publiccounters) {
print ''.$membercount.' ';
}
diff --git a/htdocs/public/webportal/css/global.css b/htdocs/public/webportal/css/global.css
index dfecfe391b4..3053047f4e6 100644
--- a/htdocs/public/webportal/css/global.css
+++ b/htdocs/public/webportal/css/global.css
@@ -47,7 +47,7 @@ body > nav {
.spacer{
--spacer-margin: calc(var(--font-size) * 2);
margin-top: var(--spacer-margin);
- margin-bottom: var(--spacer-margin);;
+ margin-bottom: var(--spacer-margin);
}
html{
@@ -142,4 +142,4 @@ Home Styles
*/
.home-links-card{
-}
\ No newline at end of file
+}
diff --git a/htdocs/recruitment/admin/setup.php b/htdocs/recruitment/admin/setup.php
index 02c9ceeb336..daf74ba39d7 100644
--- a/htdocs/recruitment/admin/setup.php
+++ b/htdocs/recruitment/admin/setup.php
@@ -28,7 +28,10 @@ if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) {
$res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php";
}
// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME
-$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1;
+$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME'];
+$tmp2 = realpath(__FILE__);
+$i = strlen($tmp) - 1;
+$j = strlen($tmp2) - 1;
while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) {
$i--;
$j--;
@@ -264,7 +267,7 @@ if ($action == 'edit') {
$moduledir = 'recruitment';
$myTmpObjects = array();
-$myTmpObjects['RecruitmentJobPosition'] = array('includerefgeneration'=>1, 'includedocgeneration'=>1);
+$myTmpObjects['RecruitmentJobPosition'] = array('includerefgeneration' => 1, 'includedocgeneration' => 1);
foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
@@ -414,6 +417,7 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
print "\n";
clearstatcache();
+ $filelist = array();
foreach ($dirmodels as $reldir) {
foreach (array('', '/doc') as $valdir) {
diff --git a/htdocs/recruitment/admin/setup_candidatures.php b/htdocs/recruitment/admin/setup_candidatures.php
index c8ca0c09a42..37c641c8b29 100644
--- a/htdocs/recruitment/admin/setup_candidatures.php
+++ b/htdocs/recruitment/admin/setup_candidatures.php
@@ -235,7 +235,7 @@ if ($action == 'edit') {
$moduledir = 'recruitment';
$myTmpObjects = array();
-$myTmpObjects['RecruitmentCandidature'] = array('includerefgeneration'=>1, 'includedocgeneration'=>0);
+$myTmpObjects['RecruitmentCandidature'] = array('includerefgeneration' => 1, 'includedocgeneration' => 0);
foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
@@ -386,6 +386,7 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
print "\n";
clearstatcache();
+ $filelist = array();
foreach ($dirmodels as $reldir) {
foreach (array('', '/doc') as $valdir) {
diff --git a/htdocs/salaries/ajax/ajaxsalaries.php b/htdocs/salaries/ajax/ajaxsalaries.php
index aec5e304e14..50f32055837 100644
--- a/htdocs/salaries/ajax/ajaxsalaries.php
+++ b/htdocs/salaries/ajax/ajaxsalaries.php
@@ -65,6 +65,7 @@ if (!empty(GETPOSTINT('fk_user'))) {
if ($resql) {
$obj = $db->fetch_object($resql);
$label = "Salary amount";
+ $row_array = array();
$row_array['label'] = $label;
$row_array['value'] = price2num($obj->amount, 'MT');
$row_array['key'] = "Amount";
@@ -72,8 +73,8 @@ if (!empty(GETPOSTINT('fk_user'))) {
array_push($return_arr, $row_array);
echo json_encode($return_arr);
} else {
- echo json_encode(array('nom'=>'Error', 'label'=>'Error', 'key'=>'Error', 'value'=>'Error'));
+ echo json_encode(array('nom' => 'Error', 'label' => 'Error', 'key' => 'Error', 'value' => 'Error'));
}
} else {
- echo json_encode(array('nom'=>'ErrorBadParameter', 'label'=>'ErrorBadParameter', 'key'=>'ErrorBadParameter', 'value'=>'ErrorBadParameter'));
+ echo json_encode(array('nom' => 'ErrorBadParameter', 'label' => 'ErrorBadParameter', 'key' => 'ErrorBadParameter', 'value' => 'ErrorBadParameter'));
}
diff --git a/htdocs/societe/admin/societe.php b/htdocs/societe/admin/societe.php
index 1000eaf142a..acfd93d1740 100644
--- a/htdocs/societe/admin/societe.php
+++ b/htdocs/societe/admin/societe.php
@@ -663,6 +663,7 @@ print '
'.$langs->trans("MustBeMandatory").' ';
print '
'.$langs->trans("MustBeInvoiceMandatory").' ';
print "\n";
+$profid = array('IDPROF1' => array(), 'IDPROF2' => array(), 'IDPROF3' => array(), 'IDPROF4' => array(), 'IDPROF5' => array(),'IDPROF6' => array(), 'EMAIL' => array());
$profid['IDPROF1'][0] = $langs->trans("ProfId1");
$profid['IDPROF1'][1] = $langs->transcountry('ProfId1', $mysoc->country_code);
$profid['IDPROF2'][0] = $langs->trans("ProfId2");
@@ -678,8 +679,10 @@ $profid['IDPROF6'][1] = $langs->transcountry('ProfId6', $mysoc->country_code);
$profid['EMAIL'][0] = $langs->trans("EMail");
$profid['EMAIL'][1] = $langs->trans('Email');
if (isModEnabled('accounting')) {
+ $profid['ACCOUNTANCY_CODE_CUSTOMER'] = array();
$profid['ACCOUNTANCY_CODE_CUSTOMER'][0] = $langs->trans("CustomerAccountancyCodeShort");
$profid['ACCOUNTANCY_CODE_CUSTOMER'][1] = $langs->trans('CustomerAccountancyCodeShort');
+ $profid['ACCOUNTANCY_CODE_SUPPLIER'] = array();
$profid['ACCOUNTANCY_CODE_SUPPLIER'][0] = $langs->trans("SupplierAccountancyCodeShort");
$profid['ACCOUNTANCY_CODE_SUPPLIER'][1] = $langs->trans('SupplierAccountancyCodeShort');
}
@@ -783,10 +786,10 @@ if (!$conf->use_javascript_ajax) {
print "
";
} else {
print '
';
- $arrval = array('0'=>$langs->trans("No"),
- '1'=>$langs->trans("Yes").' ('.$langs->trans("NumberOfKeyToSearch", 1).')',
- '2'=>$langs->trans("Yes").' ('.$langs->trans("NumberOfKeyToSearch", 2).')',
- '3'=>$langs->trans("Yes").' ('.$langs->trans("NumberOfKeyToSearch", 3).')',
+ $arrval = array('0' => $langs->trans("No"),
+ '1' => $langs->trans("Yes").' ('.$langs->trans("NumberOfKeyToSearch", 1).')',
+ '2' => $langs->trans("Yes").' ('.$langs->trans("NumberOfKeyToSearch", 2).')',
+ '3' => $langs->trans("Yes").' ('.$langs->trans("NumberOfKeyToSearch", 3).')',
);
print $form->selectarray("activate_COMPANY_USE_SEARCH_TO_SELECT", $arrval, getDolGlobalString('COMPANY_USE_SEARCH_TO_SELECT'), 0, 0, 0, '', 0, 0, 0, '', 'minwidth75imp');
print ' ';
@@ -804,10 +807,10 @@ if (!$conf->use_javascript_ajax) {
print " ";
} else {
print '
';
- $arrval = array('0'=>$langs->trans("No"),
- '1'=>$langs->trans("Yes").' ('.$langs->trans("NumberOfKeyToSearch", 1).')',
- '2'=>$langs->trans("Yes").' ('.$langs->trans("NumberOfKeyToSearch", 2).')',
- '3'=>$langs->trans("Yes").' ('.$langs->trans("NumberOfKeyToSearch", 3).')',
+ $arrval = array('0' => $langs->trans("No"),
+ '1' => $langs->trans("Yes").' ('.$langs->trans("NumberOfKeyToSearch", 1).')',
+ '2' => $langs->trans("Yes").' ('.$langs->trans("NumberOfKeyToSearch", 2).')',
+ '3' => $langs->trans("Yes").' ('.$langs->trans("NumberOfKeyToSearch", 3).')',
);
print $form->selectarray("activate_CONTACT_USE_SEARCH_TO_SELECT", $arrval, getDolGlobalString('CONTACT_USE_SEARCH_TO_SELECT'), 0, 0, 0, '', 0, 0, 0, '', 'minwidth75imp');
print ' ';
diff --git a/htdocs/societe/ajax/ajaxcompanies.php b/htdocs/societe/ajax/ajaxcompanies.php
index b80c581b85b..f7bb0ce0c60 100644
--- a/htdocs/societe/ajax/ajaxcompanies.php
+++ b/htdocs/societe/ajax/ajaxcompanies.php
@@ -83,7 +83,7 @@ if (!$socid) {
// Generate list of companies
if (! $socid) {
- echo json_encode(array('nom'=>'ErrorBadParameter', 'label'=>'ErrorBadParameter', 'key'=>'ErrorBadParameter', 'value'=>'ErrorBadParameter'));
+ echo json_encode(array('nom' => 'ErrorBadParameter', 'label' => 'ErrorBadParameter', 'key' => 'ErrorBadParameter', 'value' => 'ErrorBadParameter'));
exit;
}
@@ -147,6 +147,7 @@ if ($resql) {
if ($socid) {
$label = preg_replace('/('.preg_quote($socid, '/').')/i', '$1 ', $label, 1);
}
+ $row_array = array();
$row_array['label'] = $label;
$row_array['value'] = $row['nom'];
@@ -175,5 +176,5 @@ if ($resql) {
echo json_encode($return_arr);
} else {
- echo json_encode(array('nom'=>'Error', 'label'=>'Error', 'key'=>'Error', 'value'=>'Error'));
+ echo json_encode(array('nom' => 'Error', 'label' => 'Error', 'key' => 'Error', 'value' => 'Error'));
}
diff --git a/htdocs/societe/checkvat/checkVatGr.php b/htdocs/societe/checkvat/checkVatGr.php
index ac94cb9dadc..15c8e65a590 100644
--- a/htdocs/societe/checkvat/checkVatGr.php
+++ b/htdocs/societe/checkvat/checkVatGr.php
@@ -76,6 +76,7 @@ function checkVATGR($username, $password, $AFMcalledby, $AFMcalledfor)
$authHeader->UsernameToken = new stdClass();
$authHeader->UsernameToken->Username = "$username";
$authHeader->UsernameToken->Password = "$password";
+ $Headers = array();
$Headers[] = new SoapHeader('https://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd', 'Security', $authHeader, true);
$client->__setSoapHeaders($Headers);
$result = $client->rgWsPublicAfmMethod(
diff --git a/htdocs/societe/consumption.php b/htdocs/societe/consumption.php
index 8a828fb6c39..506810c806d 100644
--- a/htdocs/societe/consumption.php
+++ b/htdocs/societe/consumption.php
@@ -99,7 +99,7 @@ $hookmanager->initHooks(array('consumptionthirdparty', 'globalcard'));
* Actions
*/
-$parameters = array('id'=>$socid);
+$parameters = array('id' => $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');
@@ -168,6 +168,7 @@ if ($object->client) {
$obj = $db->fetch_object($resql);
$nbFactsClient = $obj->nb;
+ $thirdTypeArray = array();
$thirdTypeArray['customer'] = $langs->trans("customer");
if (isModEnabled("propal") && $user->hasRight('propal', 'lire')) {
$elementTypeArray['propal'] = $langs->transnoentitiesnoconv('Proposals');
diff --git a/htdocs/societe/paymentmodes.php b/htdocs/societe/paymentmodes.php
index f5ca849233e..3029aa323a7 100644
--- a/htdocs/societe/paymentmodes.php
+++ b/htdocs/societe/paymentmodes.php
@@ -718,6 +718,7 @@ if (empty($reshook)) {
} else {
try {
$stripesup = \Stripe\Account::retrieve($newsup);
+ $tokenstring = array();
$tokenstring['stripe_user_id'] = $stripesup->id;
$tokenstring['type'] = $stripesup->type;
$sql = "UPDATE ".MAIN_DB_PREFIX."oauth_token";
@@ -971,6 +972,8 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard'
$obj = $db->fetch_object($resql);
$nbFactsClient = $obj->nb;
+ $thirdTypeArray = array();
+ $elementTypeArray = array();
$thirdTypeArray['customer'] = $langs->trans("customer");
if (isModEnabled("propal") && $user->hasRight('propal', 'lire')) {
$elementTypeArray['propal'] = $langs->transnoentitiesnoconv('Proposals');
diff --git a/htdocs/user/card.php b/htdocs/user/card.php
index 984bed16d5c..9c074307e31 100644
--- a/htdocs/user/card.php
+++ b/htdocs/user/card.php
@@ -742,6 +742,7 @@ if (empty($reshook)) {
$ldap_mobile = $attribute[getDolGlobalString('LDAP_FIELD_MOBILE')];
$ldap_mail = $attribute[getDolGlobalString('LDAP_FIELD_MAIL')];
$ldap_sid = $attribute[getDolGlobalString('LDAP_FIELD_SID')];
+ $ldap_social = array();
if (isModEnabled('socialnetworks')) {
$arrayofsocialnetworks = array('skype', 'twitter', 'facebook', 'linkedin');
diff --git a/htdocs/webportal/admin/setup.php b/htdocs/webportal/admin/setup.php
index 78e183d2a95..48a3f73e2a4 100644
--- a/htdocs/webportal/admin/setup.php
+++ b/htdocs/webportal/admin/setup.php
@@ -439,6 +439,7 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
print "\n";
clearstatcache();
+ $filelist = array();
foreach ($dirmodels as $reldir) {
foreach (array('', '/doc') as $valdir) {
@@ -473,7 +474,7 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
if ($modulequalified) {
print ' ';
- print (empty($module->name) ? $name : $module->name);
+ print(empty($module->name) ? $name : $module->name);
print " \n";
if (method_exists($module, 'info')) {
print $module->info($langs);
diff --git a/htdocs/webportal/class/html.formlistwebportal.class.php b/htdocs/webportal/class/html.formlistwebportal.class.php
index 7bdd0bc4311..524c4e99548 100644
--- a/htdocs/webportal/class/html.formlistwebportal.class.php
+++ b/htdocs/webportal/class/html.formlistwebportal.class.php
@@ -2,6 +2,7 @@
/* Copyright (C) 2023-2024 Laurent Destailleur
* Copyright (C) 2023-2024 Lionel Vessiller
* Copyright (C) 2023-2024 Patrice Andreani
+ * Copyright (C) 2024 Frédéric France
*
* 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
@@ -539,14 +540,14 @@ class FormListWebPortal
// Remain to pay
if (!empty($arrayfields['remain_to_pay']['checked'])) {
$html .= '';
- $html .= $langs->trans($arrayfields['remain_to_pay']['label']);;
+ $html .= $langs->trans($arrayfields['remain_to_pay']['label']);
$html .= ' ';
$totalarray['nbfield']++;
}
// Download link
if (!empty($arrayfields['download_link']['checked'])) {
$html .= '';
- $html .= $langs->trans($arrayfields['download_link']['label']);;
+ $html .= $langs->trans($arrayfields['download_link']['label']);
$html .= ' ';
$totalarray['nbfield']++;
}
@@ -580,12 +581,12 @@ class FormListWebPortal
if ($elementEn == 'invoice') {
// store company
$idCompany = (int) $obj->fk_soc;
- if (!isset($companyStaticList[$obj->fk_soc])) {
+ if (!isset($this->companyStaticList[$obj->fk_soc])) {
$companyStatic = new Societe($this->db);
$companyStatic->fetch($idCompany);
- $companyStaticList[$idCompany] = $companyStatic;
+ $this->companyStaticList[$idCompany] = $companyStatic;
}
- $companyStatic = $companyStaticList[$obj->fk_soc];
+ $companyStatic = $this->companyStaticList[$obj->fk_soc];
// paid sum
$payment = $object->getSommePaiement();
diff --git a/htdocs/webservices/server_contact.php b/htdocs/webservices/server_contact.php
index 0bf215eb94e..388fe0392c2 100644
--- a/htdocs/webservices/server_contact.php
+++ b/htdocs/webservices/server_contact.php
@@ -78,11 +78,11 @@ $server->wsdl->addComplexType(
'all',
'',
array(
- 'dolibarrkey' => array('name'=>'dolibarrkey', 'type'=>'xsd:string'),
- 'sourceapplication' => array('name'=>'sourceapplication', 'type'=>'xsd:string'),
- 'login' => array('name'=>'login', 'type'=>'xsd:string'),
- 'password' => array('name'=>'password', 'type'=>'xsd:string'),
- 'entity' => array('name'=>'entity', 'type'=>'xsd:string'),
+ 'dolibarrkey' => array('name' => 'dolibarrkey', 'type' => 'xsd:string'),
+ 'sourceapplication' => array('name' => 'sourceapplication', 'type' => 'xsd:string'),
+ 'login' => array('name' => 'login', 'type' => 'xsd:string'),
+ 'password' => array('name' => 'password', 'type' => 'xsd:string'),
+ 'entity' => array('name' => 'entity', 'type' => 'xsd:string'),
)
);
@@ -94,44 +94,44 @@ $server->wsdl->addComplexType(
'all',
'',
array(
- 'result_code' => array('name'=>'result_code', 'type'=>'xsd:string'),
- 'result_label' => array('name'=>'result_label', 'type'=>'xsd:string'),
+ 'result_code' => array('name' => 'result_code', 'type' => 'xsd:string'),
+ 'result_label' => array('name' => 'result_label', 'type' => 'xsd:string'),
)
);
$contact_fields = array(
- 'id' => array('name'=>'id', 'type'=>'xsd:string'),
- 'ref_ext' => array('name'=>'ref_ext', 'type'=>'xsd:string'),
- 'lastname' => array('name'=>'lastname', 'type'=>'xsd:string'),
- 'firstname' => array('name'=>'firstname', 'type'=>'xsd:string'),
- 'address' => array('name'=>'address', 'type'=>'xsd:string'),
- 'zip' => array('name'=>'zip', 'type'=>'xsd:string'),
- 'town' => array('name'=>'town', 'type'=>'xsd:string'),
- 'state_id' => array('name'=>'state_id', 'type'=>'xsd:string'),
- 'state_code' => array('name'=>'state_code', 'type'=>'xsd:string'),
- 'state' => array('name'=>'state', 'type'=>'xsd:string'),
- 'country_id' => array('name'=>'country_id', 'type'=>'xsd:string'),
- 'country_code' => array('name'=>'country_code', 'type'=>'xsd:string'),
- 'country' => array('name'=>'country', 'type'=>'xsd:string'),
- 'socid' => array('name'=>'socid', 'type'=>'xsd:string'),
- 'status' => array('name'=>'status', 'type'=>'xsd:string'),
- 'phone_pro' => array('name'=>'phone_pro', 'type'=>'xsd:string'),
- 'fax' => array('name'=>'fax', 'type'=>'xsd:string'),
- 'phone_perso' => array('name'=>'phone_perso', 'type'=>'xsd:string'),
- 'phone_mobile' => array('name'=>'phone_mobile', 'type'=>'xsd:string'),
- 'code' => array('name'=>'code', 'type'=>'xsd:string'),
- 'email' => array('name'=>'email', 'type'=>'xsd:string'),
- 'birthday' => array('name'=>'birthday', 'type'=>'xsd:string'),
- 'default_lang' => array('name'=>'default_lang', 'type'=>'xsd:string'),
- 'note' => array('name'=>'note', 'type'=>'xsd:string'),
- 'ref_facturation' => array('name'=>'ref_facturation', 'type'=>'xsd:string'),
- 'ref_contrat' => array('name'=>'ref_contrat', 'type'=>'xsd:string'),
- 'ref_commande' => array('name'=>'ref_commande', 'type'=>'xsd:string'),
- 'ref_propal' => array('name'=>'ref_propal', 'type'=>'xsd:string'),
- 'user_id' => array('name'=>'user_id', 'type'=>'xsd:string'),
- 'user_login' => array('name'=>'user_login', 'type'=>'xsd:string'),
- 'civility_id' => array('name'=>'civility_id', 'type'=>'xsd:string'),
- 'poste' => array('name'=>'poste', 'type'=>'xsd:string')
+ 'id' => array('name' => 'id', 'type' => 'xsd:string'),
+ 'ref_ext' => array('name' => 'ref_ext', 'type' => 'xsd:string'),
+ 'lastname' => array('name' => 'lastname', 'type' => 'xsd:string'),
+ 'firstname' => array('name' => 'firstname', 'type' => 'xsd:string'),
+ 'address' => array('name' => 'address', 'type' => 'xsd:string'),
+ 'zip' => array('name' => 'zip', 'type' => 'xsd:string'),
+ 'town' => array('name' => 'town', 'type' => 'xsd:string'),
+ 'state_id' => array('name' => 'state_id', 'type' => 'xsd:string'),
+ 'state_code' => array('name' => 'state_code', 'type' => 'xsd:string'),
+ 'state' => array('name' => 'state', 'type' => 'xsd:string'),
+ 'country_id' => array('name' => 'country_id', 'type' => 'xsd:string'),
+ 'country_code' => array('name' => 'country_code', 'type' => 'xsd:string'),
+ 'country' => array('name' => 'country', 'type' => 'xsd:string'),
+ 'socid' => array('name' => 'socid', 'type' => 'xsd:string'),
+ 'status' => array('name' => 'status', 'type' => 'xsd:string'),
+ 'phone_pro' => array('name' => 'phone_pro', 'type' => 'xsd:string'),
+ 'fax' => array('name' => 'fax', 'type' => 'xsd:string'),
+ 'phone_perso' => array('name' => 'phone_perso', 'type' => 'xsd:string'),
+ 'phone_mobile' => array('name' => 'phone_mobile', 'type' => 'xsd:string'),
+ 'code' => array('name' => 'code', 'type' => 'xsd:string'),
+ 'email' => array('name' => 'email', 'type' => 'xsd:string'),
+ 'birthday' => array('name' => 'birthday', 'type' => 'xsd:string'),
+ 'default_lang' => array('name' => 'default_lang', 'type' => 'xsd:string'),
+ 'note' => array('name' => 'note', 'type' => 'xsd:string'),
+ 'ref_facturation' => array('name' => 'ref_facturation', 'type' => 'xsd:string'),
+ 'ref_contrat' => array('name' => 'ref_contrat', 'type' => 'xsd:string'),
+ 'ref_commande' => array('name' => 'ref_commande', 'type' => 'xsd:string'),
+ 'ref_propal' => array('name' => 'ref_propal', 'type' => 'xsd:string'),
+ 'user_id' => array('name' => 'user_id', 'type' => 'xsd:string'),
+ 'user_login' => array('name' => 'user_login', 'type' => 'xsd:string'),
+ 'civility_id' => array('name' => 'civility_id', 'type' => 'xsd:string'),
+ 'poste' => array('name' => 'poste', 'type' => 'xsd:string')
//...
);
@@ -155,7 +155,7 @@ if (isset($extrafields->attributes[$elementtype]['label']) && is_array($extrafie
$type = 'xsd:string';
}
- $extrafield_array['options_'.$key] = array('name'=>'options_'.$key, 'type'=>$type);
+ $extrafield_array['options_'.$key] = array('name' => 'options_'.$key, 'type' => $type);
}
}
if (is_array($extrafield_array)) {
@@ -203,9 +203,9 @@ $styleuse = 'encoded'; // encoded/literal/literal wrapped
$server->register(
'getContact',
// Entry values
- array('authentication'=>'tns:authentication', 'id'=>'xsd:string', 'ref_ext'=>'xsd:string'),
+ array('authentication' => 'tns:authentication', 'id' => 'xsd:string', 'ref_ext' => 'xsd:string'),
// Exit values
- array('result'=>'tns:result', 'contact'=>'tns:contact'),
+ array('result' => 'tns:result', 'contact' => 'tns:contact'),
$ns,
$ns.'#getContact',
$styledoc,
@@ -217,9 +217,9 @@ $server->register(
$server->register(
'createContact',
// Entry values
- array('authentication'=>'tns:authentication', 'contact'=>'tns:contact'),
+ array('authentication' => 'tns:authentication', 'contact' => 'tns:contact'),
// Exit values
- array('result'=>'tns:result', 'id'=>'xsd:string'),
+ array('result' => 'tns:result', 'id' => 'xsd:string'),
$ns,
$ns.'#createContact',
$styledoc,
@@ -230,9 +230,9 @@ $server->register(
$server->register(
'getContactsForThirdParty',
// Entry values
- array('authentication'=>'tns:authentication', 'idthirdparty'=>'xsd:string'),
+ array('authentication' => 'tns:authentication', 'idthirdparty' => 'xsd:string'),
// Exit values
- array('result'=>'tns:result', 'contacts'=>'tns:ContactsArray2'),
+ array('result' => 'tns:result', 'contacts' => 'tns:ContactsArray2'),
$ns,
$ns.'#getContactsForThirdParty',
$styledoc,
@@ -244,9 +244,9 @@ $server->register(
$server->register(
'updateContact',
// Entry values
- array('authentication'=>'tns:authentication', 'contact'=>'tns:contact'),
+ array('authentication' => 'tns:authentication', 'contact' => 'tns:contact'),
// Exit values
- array('result'=>'tns:result', 'id'=>'xsd:string'),
+ array('result' => 'tns:result', 'id' => 'xsd:string'),
$ns,
$ns.'#updateContact',
$styledoc,
@@ -349,8 +349,8 @@ function getContact($authentication, $id, $ref_ext)
// Create
$objectresp = array(
- 'result'=>array('result_code'=>'OK', 'result_label'=>''),
- 'contact'=>$contact_result_fields
+ 'result' => array('result_code' => 'OK', 'result_label' => ''),
+ 'contact' => $contact_result_fields
);
} else {
$error++;
@@ -365,7 +365,7 @@ function getContact($authentication, $id, $ref_ext)
}
if ($error) {
- $objectresp = array('result'=>array('result_code' => $errorcode, 'result_label' => $errorlabel));
+ $objectresp = array('result' => array('result_code' => $errorcode, 'result_label' => $errorlabel));
}
return $objectresp;
@@ -465,7 +465,7 @@ function createContact($authentication, $contact)
if (!$error) {
$db->commit();
- $objectresp = array('result'=>array('result_code'=>'OK', 'result_label'=>''), 'id'=>$newobject->id, 'ref'=>$newobject->ref);
+ $objectresp = array('result' => array('result_code' => 'OK', 'result_label' => ''), 'id' => $newobject->id, 'ref' => $newobject->ref);
} else {
$db->rollback();
$error++;
@@ -475,7 +475,7 @@ function createContact($authentication, $contact)
}
if ($error) {
- $objectresp = array('result'=>array('result_code' => $errorcode, 'result_label' => $errorlabel));
+ $objectresp = array('result' => array('result_code' => $errorcode, 'result_label' => $errorlabel));
}
return $objectresp;
@@ -533,6 +533,7 @@ function getContactsForThirdParty($authentication, $idthirdparty)
$resql = $db->query($sql);
if ($resql) {
+ $linescontact = array();
$num = $db->num_rows($resql);
$i = 0;
while ($i < $num) {
@@ -590,8 +591,8 @@ function getContactsForThirdParty($authentication, $idthirdparty)
}
$objectresp = array(
- 'result'=>array('result_code'=>'OK', 'result_label'=>''),
- 'contacts'=>$linescontact
+ 'result' => array('result_code' => 'OK', 'result_label' => ''),
+ 'contacts' => $linescontact
);
} else {
@@ -602,7 +603,7 @@ function getContactsForThirdParty($authentication, $idthirdparty)
}
if ($error) {
- $objectresp = array('result'=>array('result_code' => $errorcode, 'result_label' => $errorlabel));
+ $objectresp = array('result' => array('result_code' => $errorcode, 'result_label' => $errorlabel));
}
return $objectresp;
@@ -709,8 +710,8 @@ function updateContact($authentication, $contact)
if ((!$error) && ($objectfound)) {
$db->commit();
$objectresp = array(
- 'result'=>array('result_code'=>'OK', 'result_label'=>''),
- 'id'=>$object->id
+ 'result' => array('result_code' => 'OK', 'result_label' => ''),
+ 'id' => $object->id
);
} elseif ($objectfound) {
$db->rollback();
@@ -725,7 +726,7 @@ function updateContact($authentication, $contact)
}
if ($error) {
- $objectresp = array('result'=>array('result_code' => $errorcode, 'result_label' => $errorlabel));
+ $objectresp = array('result' => array('result_code' => $errorcode, 'result_label' => $errorlabel));
}
return $objectresp;
diff --git a/htdocs/workstation/workstation_list.php b/htdocs/workstation/workstation_list.php
index fb749bd6a4c..2d1e9d9fefc 100644
--- a/htdocs/workstation/workstation_list.php
+++ b/htdocs/workstation/workstation_list.php
@@ -116,20 +116,20 @@ foreach ($object->fields as $key => $val) {
if (!empty($val['visible'])) {
$visible = (int) dol_eval($val['visible'], 1);
$arrayfields['t.'.$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'] : ''
);
}
}
$arrayfields['wug.fk_usergroup'] = array(
- 'label'=>$langs->trans('UserGroups'),
- 'checked'=>(($visible < 0) ? 0 : 1),
- 'enabled'=>(abs($visible) != 3 && (int) dol_eval($val['enabled'], 1)),
- 'position'=>1000,
+ 'label' => $langs->trans('UserGroups'),
+ 'checked' => (($visible < 0) ? 0 : 1),
+ 'enabled' => (abs($visible) != 3 && (int) dol_eval($val['enabled'], 1)),
+ 'position' => 1000,
'help' => empty($val['help']) ? '' : $val['help'],
'csslist' => 'minwidth100'
);
@@ -189,7 +189,7 @@ if (empty($reshook)) {
$search[$key.'_dtend'] = '';
}
}
- $groups = $resources=array();
+ $groups = $resources = array();
$toselect = array();
$search_array_options = array();
}
@@ -229,6 +229,7 @@ $sql .= $object->getFieldList('t');
// Add fields from extrafields
if (!empty($extrafields->attributes[$object->table_element]['label'])) {
foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) {
+ // @phan-suppress-next-line PhanTypeArraySuspiciousNullable
$sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key." as options_".$key : '');
}
}
@@ -245,10 +246,10 @@ if (isset($extrafields->attributes[$object->table_element]['label']) && is_array
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (t.rowid = ef.fk_object)";
}
if (!empty($groups)) {
- $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'workstation_workstation_usergroup wug ON (wug.fk_workstation = t.rowid)';
+ $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'workstation_workstation_usergroup wug ON (wug.fk_workstation = t.rowid)';
}
if (!empty($resources)) {
- $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'workstation_workstation_resource wr ON (wr.fk_workstation = t.rowid)';
+ $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'workstation_workstation_resource wr ON (wr.fk_workstation = t.rowid)';
}
// Add table from hooks
$parameters = array();
@@ -296,12 +297,12 @@ if ($search_all) {
// usergroups
if (!empty($groups)) {
- $sql.= ' AND wug.fk_usergroup IN('.$db->sanitize(implode(',', $groups)).')';
+ $sql .= ' AND wug.fk_usergroup IN('.$db->sanitize(implode(',', $groups)).')';
}
// resources
if (!empty($resources)) {
- $sql.= ' AND wr.fk_resource IN('.$db->sanitize(implode(',', $resources)).')';
+ $sql .= ' AND wr.fk_resource IN('.$db->sanitize(implode(',', $resources)).')';
}
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php';
@@ -310,13 +311,14 @@ $parameters = array();
$reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
$sql .= $hookmanager->resPrint;
-$sql.= " GROUP BY ";
+$sql .= " GROUP BY ";
foreach ($object->fields as $key => $val) {
$sql .= "t.".$db->escape($key).", ";
}
// Add fields from extrafields
if (! empty($extrafields->attributes[$object->table_element]['label'])) {
foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) {
+ // @phan-suppress-next-line PhanTypeArraySuspiciousNullable
$sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? "ef.".$key.', ' : '');
}
}
@@ -444,8 +446,8 @@ print ' ';
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();
$newcardbutton .= dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', dol_buildpath('/workstation/workstation_card.php', 1).'?action=create&backtopage='.urlencode($_SERVER['PHP_SELF']), '', $permissiontoadd);
@@ -563,7 +565,7 @@ if (!empty($arrayfields['wr.fk_resource']['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;
// Action column
@@ -617,7 +619,7 @@ if (!empty($arrayfields['wr.fk_resource']['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;
// Action column
@@ -660,7 +662,7 @@ while ($i < $imaxinloop) {
if ($mode == 'kanban') {
if ($i == 0) {
- print '';
+ print ' ';
print '';
}
// Output Kanban
@@ -787,7 +789,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, '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;
// Action column
@@ -829,7 +831,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;