Fix: Initialise array before assigning values (#28728)

* Qual: Enable PhanUndeclaredVariableDim

# Qual: Enable PhanUndeclaredVariableDim

The notifications are fixed in the code so the detection no longer
needs to be suppressed in the default flow

* Fix: initialise array before adding fields

* Fix: initialise array before adding fields

* Fix: initialise array before adding fields

* Fix: initialise array before adding fields

* Fix: initialise array before adding fields

* Fix: initialise array before adding fields

* Fix: initialise array before adding fields

* Fix: initialise array before adding fields

* Fix: initialise array before adding fields

* Fix: initialise array before adding fields

* Fix: initialise array before adding fields

* Fix: initialise array before adding fields

* Fix: initialise array before adding fields

* Fix: initialise array before adding fields

* Fix: initialise array before adding fields

* Fix: initialise array before adding fields

* Fix: initialise array before adding fields

* Fix: initialise array before adding fields

* Fix: initialise array before adding fields

* Fix: initialise array before adding fields

* Fix: initialise array before adding fields

* Fix: initialise array before adding fields

* Fix: initialise array before adding fields

* Fix: initialise array before adding fields

* Fix: initialise array before adding fields

* Fix: initialise array before adding fields

* Fix: initialise array before adding fields

* Fix: initialise array before adding fields

* Fix: initialise array before adding fields

* Fix: initialise array before adding fields

* Fix: initialise array before adding fields

* Fix: initialise array before adding fields

* Fix: initialise array before adding fields

* Fix: initialise array before adding fields

* Fix: initialise array before adding fields

* Fix: initialise array before adding fields

* Fix: initialise array before adding fields

* Fix: initialise array before adding fields

* Fix: initialise array before adding fields

* Fix: initialise array before adding fields

* Fix: initialise array before adding fields

* Fix: initialise array before adding fields

* Fix: initialise array before adding fields

* Fix: initialise array before adding fields

* Fix: initialise array before adding fields

* Fix: initialise array before adding fields

* Fix: initialise array before adding fields

* Fix: initialise array before adding fields

* Fix: initialise array before adding fields

* Fix: initialise array before adding fields

* Fix: initialise array before adding fields

* Fix: initialise array before adding fields

* Fix: initialise array before adding fields

* Fix: initialise array before adding fields

* Fix: initialise array before adding fields

* Fix: initialise array before adding fields

* Fix: initialise array before adding fields

* Fix: initialise array before adding fields

* Fix: initialise array before adding fields

* Fix: initialise array before adding fields

* Fix: initialise array before adding fields

* Fix: initialise array before adding fields

* Fix: initialise array before adding fields

* Fix: initialise array before adding fields

* Fix: initialise array before adding fields

* Fix: initialise array before adding fields

* Fix: initialise array before adding fields

* Fix: initialise array before adding fields

* Fix: initialise array before adding fields

* Fix: initialise array before adding fields

* Qual: Add type hint to array to avoid phan notification

* Qual: Add type hint to array to avoid phan notification

* Qual: Enable PhanParamSpecial1 (all resolved)

* Qual: Ignore false PhanTypeArraySuspiciousNullable

* Qual: Improve typing to fix PhanTypeArraySuspicious

* Qual: Fix PhanTypeArraySuspicious by replacing null assignment with empty array

* Qual: Fix PhanTypeArraySuspicious by testing as instancof DebugBar

* Qual: Fix PhanTypeComparisonToArray with enhanced typing

* Qual: Fix PhanTypeComparisonToArray with enhanced typing

* Qual: Enable phan messages that no longer appear

* Qual: Exclude phan stubs from codesniffer ruleset
This commit is contained in:
MDW 2024-03-09 16:32:02 +01:00 committed by GitHub
parent ce6958e451
commit 0b19aa415c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
78 changed files with 693 additions and 570 deletions

View File

@ -9,6 +9,7 @@
<!-- info: 'relative' paths are relative to the examined file, so not ok. -->
<exclude-pattern>/build/(html|aps)/</exclude-pattern>
<exclude-pattern>/dev/tools/test/namespacemig/</exclude-pattern>
<exclude-pattern>/dev/tools/phan/stubs/</exclude-pattern>
<!-- <exclude-pattern>dev/initdata/dbf/includes</exclude-pattern> -->
<exclude-pattern>/documents/</exclude-pattern>
<exclude-pattern>/htdocs/core/class/lessc\.class\.php</exclude-pattern>

View File

@ -331,7 +331,7 @@ return [
// Dolibarr uses a lot of internal deprecated stuff, not reporting
'PhanDeprecatedProperty',
'PhanDeprecatedFunction',
'PhanCompatibleNegativeStringOffset',
//'PhanCompatibleNegativeStringOffset',
// Dolibarr has quite a few strange noop assignments like $abc=$abc;
'PhanPluginDuplicateExpressionAssignment',
// Nulls are likely mostly false positives
@ -379,7 +379,7 @@ return [
'PhanPluginUnknownClosureParamType',
'PhanPluginUnknownClosureReturnType',
// 'PhanPluginNoCommentOnProtectedMethod',
'PhanTypeArraySuspicious',
// 'PhanTypeArraySuspicious',
'PhanTypeMismatchPropertyProbablyReal',
// 'PhanPluginNoCommentOnPrivateMethod',
'PhanPluginUnknownArrayFunctionReturnType',
@ -401,7 +401,7 @@ return [
'PhanTypeMismatchDeclaredParamNullable',
'PhanTypeInvalidRightOperandOfAdd',
// 'PhanPluginDescriptionlessCommentOnPrivateProperty',
'PhanUndeclaredVariableDim', // Array initialisation on undeclared var: $abc['x']='ab'
// 'PhanUndeclaredVariableDim', // Array initialisation on undeclared var: $abc['x']='ab'
'PhanTypeInvalidPropertyName',
'PhanPluginDuplicateCatchStatementBody',
'PhanPluginUndeclaredVariableIsset',
@ -439,11 +439,11 @@ return [
'PhanPluginBothLiteralsBinaryOp',
// 'PhanTypeMismatchDeclaredParam',
// 'PhanCommentDuplicateMagicMethod',
'PhanParamSpecial1',
// 'PhanParamSpecial1',
'PhanPluginInlineHTMLLeading',
'PhanPluginUseReturnValueInternalKnown',
'PhanRedefinedInheritedInterface',
'PhanTypeComparisonToArray',
//'PhanRedefinedInheritedInterface',
//'PhanTypeComparisonToArray',
'PhanTypeConversionFromArray',
// 'PhanTypeInvalidLeftOperandOfIntegerOp',
'PhanTypeMismatchArgumentInternalProbablyReal',
@ -458,7 +458,7 @@ return [
// 'PhanTypeInvalidThrowsIsInterface',
'PhanPluginRedundantAssignmentInLoop',
// 'PhanInvalidCommentForDeclarationType',
'PhanParamSignatureMismatchInternal',
//'PhanParamSignatureMismatchInternal',
// 'PhanPluginEmptyStatementForeachLoop',
// 'PhanCompatibleDimAlternativeSyntax',
'PhanInvalidFQSENInClasslike',

View File

@ -230,7 +230,7 @@ class ActionComm extends CommonObject
public $priority;
/**
* @var int[] Array of user ids
* @var array<int,array{id:int,transparency:int}> 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;
}

View File

@ -266,7 +266,7 @@ if ($result < 0) {
$px1 = null;
$graph_datas = null;
$datas = null;
$datamin = null;
$datamin = array();
$dataall = null;
$labels = null;
$amounts = null;

View File

@ -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 '<tr><td class="titlefield">'.$langs->trans("UserTitle").'</td><td>';
print $object->getCivilityLabel();
print '</td></tr>';
$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) {

View File

@ -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 '<input type="hidden" name="mode" value="'.$mode.'">';
$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 .= '</div>';
print '<div class="liste_titre liste_titre_bydiv centpercent">';
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 '</div>';
@ -1149,7 +1152,7 @@ if (!empty($arrayfields['p.email']['checked'])) {
}
if (!empty($arrayfields['unsubscribed']['checked'])) {
print '<td class="liste_titre center">';
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 '</td>';
}
if (isModEnabled('socialnetworks')) {
@ -1176,7 +1179,7 @@ if (!empty($arrayfields['s.name_alias']['checked'])) {
}
if (!empty($arrayfields['p.priv']['checked'])) {
print '<td class="liste_titre center">';
$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 '</td>';
}
@ -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 '<td class="liste_titre center parentonrightofpage">';
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 '</td>';
}
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;

View File

@ -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 '<td class="liste_titre nowraponall center">';
$arrayofoperators = array('0'=>'', '='=>'=', '<='=>'<=', '>='=>'>=');
$arrayofoperators = array('0' => '', '=' => '=', '<=' => '<=', '>=' => '>=');
print $form->selectarray('search_op2df', $arrayofoperators, $search_op2df, 0, 0, 0, '', 0, 0, 0, '', 'maxwidth50imp');
print '</br>';
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 '<div class="box-flex-container kanban">';
}
// 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;

View File

@ -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 '<td class="liste_titre center">';
$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 '<td class="liste_titre center">';
$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 '<td class="liste_titre center">';
$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 '<td class="liste_titre center">';
$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 '<td class="liste_titre right parentonrightofpage">';
$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

View File

@ -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));

View File

@ -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) {

View File

@ -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'=>'<span class="fa fa-sign-in"></span> '.$langs->trans("JumpToLogin"), 'url'=>DOL_URL_ROOT.'/index.php');
$arrayresult = array();
$arrayresult['jumptologin'] = array('img' => 'object_generic', 'label' => $langs->trans("JumpToLogin"), 'text' => '<span class="fa fa-sign-in"></span> '.$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);

View File

@ -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'] : '')) : '';

View File

@ -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'];

View File

@ -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'];

View File

@ -380,31 +380,31 @@ class FormAdmin
print '<option value="-1">&nbsp;</option>';
$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 '<option value="'.$lib.'"';
@ -443,6 +443,8 @@ class FormAdmin
$sql .= " AND code LIKE '%".$this->db->escape($filter)."%'";
}
$paperformat = array();
$resql = $this->db->query($sql);
if ($resql) {
$num = $this->db->num_rows($resql);

View File

@ -184,7 +184,7 @@ class SimpleOpenID
{
// phpcs:enable
$e = $this->error;
return array('code'=>$e[0], 'description'=>$e[1]);
return array('code' => $e[0], 'description' => $e[1]);
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
@ -198,6 +198,7 @@ class SimpleOpenID
public function ErrorStore($code, $desc = null)
{
// phpcs:enable
$errs = array();
$errs['OPENID_NOSERVERSFOUND'] = 'Cannot find OpenID Server TAG on Identity page.';
if ($desc == null) {
$desc = $errs[$code];

View File

@ -1214,11 +1214,12 @@ class SMTPs
* - $_aryEmail[user] = "userName"
*
* @param string $_strAddr Email address
* @return array An array of the various parts of an email address
* @return array{org:string,real?:string,addr:string,user:string,host:string} An array of the various parts of an email address
*/
private function _strip_email($_strAddr)
{
// phpcs:enable
$_aryEmail = array();
// Keep the original
$_aryEmail['org'] = $_strAddr;

View File

@ -794,7 +794,7 @@ class DoliDBPgsql extends DoliDB
'42P07' => 'DB_ERROR_TABLE_OR_KEY_ALREADY_EXISTS',
'42703' => 'DB_ERROR_NOSUCHFIELD',
1060 => 'DB_ERROR_COLUMN_ALREADY_EXISTS',
42701=> 'DB_ERROR_COLUMN_ALREADY_EXISTS',
42701 => 'DB_ERROR_COLUMN_ALREADY_EXISTS',
'42710' => 'DB_ERROR_KEY_NAME_ALREADY_EXISTS',
'23505' => 'DB_ERROR_RECORD_ALREADY_EXISTS',
'42704' => 'DB_ERROR_NO_INDEX_TO_DROP', // May also be Type xxx does not exists
@ -1069,6 +1069,10 @@ class DoliDBPgsql extends DoliDB
// phpcs:enable
// FIXME: $fulltext_keys parameter is unused
$sqlfields = array();
$sqlk = array();
$sqluq = array();
// cles recherchees dans le tableau des descriptions (fields) : type,value,attribute,null,default,extra
// ex. : $fields['rowid'] = array('type'=>'int','value'=>'11','null'=>'not null','extra'=> 'auto_increment');
$sql = "create table ".$table."(";

View File

@ -259,7 +259,7 @@ class DoliDBSqlite3 extends DoliDB
}
//if (preg_match('/rowid\s+.*\s+PRIMARY\s+KEY,/i', $line)) {
//preg_replace('/(rowid\s+.*\s+PRIMARY\s+KEY\s*,)/i', '/* \\1 */', $line);
//preg_replace('/(rowid\s+.*\s+PRIMARY\s+KEY\s*,)/i', '/* \\1 */', $line);
//}
}
@ -971,6 +971,10 @@ class DoliDBSqlite3 extends DoliDB
// phpcs:enable
// FIXME: $fulltext_keys parameter is unused
$sqlfields = array();
$sqlk = array();
$sqluq = array();
// cles recherchees dans le tableau des descriptions (fields) : type,value,attribute,null,default,extra
// ex. : $fields['rowid'] = array('type'=>'int','value'=>'11','null'=>'not null','extra'=> 'auto_increment');
$sql = "create table ".$table."(";

View File

@ -10654,7 +10654,7 @@ function printCommonFooter($zone = 'private')
}
// Add DebugBar data
if ($user->hasRight('debugbar', 'read') && is_object($debugbar)) {
if ($user->hasRight('debugbar', 'read') && $debugbar instanceof DebugBar\DebugBar) {
$debugbar['time']->stopMeasure('pageaftermaster');
print '<!-- Output debugbar data -->'."\n";
$renderer = $debugbar->getRenderer();

View File

@ -24,7 +24,7 @@
/**
* Return if a BVRB number is valid or not (For switzerland)
* Return if a BVRB number is valid or not (For Switzerland)
*
* @param string $bvrb BVRB number
* @return boolean True if OK, false if KO
@ -32,6 +32,7 @@
function dol_ch_controle_bvrb($bvrb)
{
// Init array for control
$tableau = array();
$tableau[0][0] = 0;
$tableau[0][1] = 9;
$tableau[0][2] = 4;

View File

@ -141,6 +141,8 @@ function show_ldap_content($result, $level, $count, $var, $hide = 0, $subcount =
return -1;
}
$lastkey = array();
foreach ($result as $key => $val) {
if ("$key" == "objectclass") {
continue;

View File

@ -206,6 +206,8 @@ class pdf_eratosthene extends ModelePDFCommandes
continue;
}
$pdir = array();
$objphoto->fetch($object->lines[$i]->fk_product);
//var_dump($objphoto->ref);exit;
if (getDolGlobalInt('PRODUCT_USE_OLD_PATH_FOR_PHOTO')) {

View File

@ -165,7 +165,7 @@ class pdf_storm extends ModelePDFDeliveryOrder
$hookmanager = new HookManager($this->db);
}
$hookmanager->initHooks(array('pdfgeneration'));
$parameters = array('file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs);
$parameters = array('file' => $file, 'object' => $object, 'outputlangs' => $outputlangs);
global $action;
$reshook = $hookmanager->executeHooks('beforePDFCreation', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
@ -184,6 +184,7 @@ class pdf_storm extends ModelePDFDeliveryOrder
}
$objphoto->fetch($object->lines[$i]->fk_product);
$pdir = array();
if (getDolGlobalInt('PRODUCT_USE_OLD_PATH_FOR_PHOTO')) {
$pdir[0] = get_exdir($objphoto->id, 2, 0, 0, $objphoto, 'product').$objphoto->id."/photos/";
@ -493,10 +494,10 @@ class pdf_storm extends ModelePDFDeliveryOrder
// Add line
if (getDolGlobalString('MAIN_PDF_DASH_BETWEEN_LINES') && $i < ($nblines - 1)) {
$pdf->setPage($pageposafter);
$pdf->SetLineStyle(array('dash'=>'1,1', 'color'=>array(80, 80, 80)));
$pdf->SetLineStyle(array('dash' => '1,1', 'color' => array(80, 80, 80)));
//$pdf->SetDrawColor(190,190,200);
$pdf->line($this->marge_gauche, $nexY + 1, $this->page_largeur - $this->marge_droite, $nexY + 1);
$pdf->SetLineStyle(array('dash'=>0));
$pdf->SetLineStyle(array('dash' => 0));
}
$nexY += 2; // Add space between lines
@ -568,7 +569,7 @@ class pdf_storm extends ModelePDFDeliveryOrder
$hookmanager = new HookManager($this->db);
}
$hookmanager->initHooks(array('pdfgeneration'));
$parameters = array('file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs);
$parameters = array('file' => $file, 'object' => $object, 'outputlangs' => $outputlangs);
global $action;
$reshook = $hookmanager->executeHooks('afterPDFCreation', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) {
@ -578,7 +579,7 @@ class pdf_storm extends ModelePDFDeliveryOrder
dolChmod($file);
$this->result = array('fullpath'=>$file);
$this->result = array('fullpath' => $file);
return 1; // No error
} else {

View File

@ -242,7 +242,7 @@ class html_cerfafr extends ModeleDon
fclose($handle);
dolChmod($file);
$this->result = array('fullpath'=>$file);
$this->result = array('fullpath' => $file);
return 1;
} else {
@ -294,6 +294,9 @@ class html_cerfafr extends ModeleDon
$chif = array('', 'un', 'deux', 'trois', 'quatre', 'cinq', 'six', 'sept', 'huit', 'neuf', 'dix', 'onze', 'douze', 'treize', 'quatorze', 'quinze', 'seize', 'dix sept', 'dix huit', 'dix neuf');
$secon_c = '';
$trio_c = '';
$prim = array();
$secon = array();
$trio = array();
for ($i = 1; $i <= 3; $i++) {
$prim[$i] = '';
$secon[$i] = '';

View File

@ -244,6 +244,7 @@ class pdf_sponge extends ModelePDFFactures
$objphoto->fetch($object->lines[$i]->fk_product);
//var_dump($objphoto->ref);exit;
$pdir = array();
if (getDolGlobalInt('PRODUCT_USE_OLD_PATH_FOR_PHOTO')) {
$pdir[0] = get_exdir($objphoto->id, 2, 0, 0, $objphoto, 'product').$objphoto->id."/photos/";
$pdir[1] = get_exdir(0, 0, 0, 0, $objphoto, 'product').dol_sanitizeFileName($objphoto->ref).'/';

View File

@ -974,6 +974,7 @@ class ImportCsv extends ModeleImports
$sqlend = " WHERE ".$keyfield." = ".((int) $lastinsertid);
if ($is_table_category_link) {
'@phan-var-force string[] $where';
$sqlend = " WHERE " . implode(' AND ', $where);
}

View File

@ -910,6 +910,7 @@ class ImportXlsx extends ModeleImports
$data = array_combine($listfields, $listvalues);
$where = array(); // filters to forge SQL request
'@phan-var string[] $where';
$filters = array(); // filters to forge output error message
foreach ($updatekeys as $key) {
$col = $objimport->array_import_updatekeys[0][$key];
@ -1020,6 +1021,7 @@ class ImportXlsx extends ModeleImports
$sqlend = " WHERE " . $keyfield . " = ".((int) $lastinsertid);
if ($is_table_category_link) {
'@phan-var-force string[] $where';
$sqlend = " WHERE " . implode(' AND ', $where);
}

View File

@ -324,14 +324,15 @@ class pdf_standard extends CommonStickerGenerator
$nb = 1; // Protection to avoid empty page
}
$arrayofmembers = array();
for ($j = 0; $j < $nb; $j++) {
$arrayofmembers[] = array(
'textleft'=>$textleft,
'textheader'=>$textheader,
'textfooter'=>$textfooter,
'textright'=>$textright,
'id'=>(isset($object->id) ? $object->id : ""),
'photo'=>(isset($object->photo) ? $object->photo : "")
'textleft' => $textleft,
'textheader' => $textheader,
'textfooter' => $textfooter,
'textright' => $textright,
'id' => (isset($object->id) ? $object->id : ""),
'photo' => (isset($object->photo) ? $object->photo : "")
);
}
@ -456,7 +457,7 @@ class pdf_standard extends CommonStickerGenerator
dolChmod($file);
$this->result = array('fullpath'=>$file);
$this->result = array('fullpath' => $file);
// Output to http stream
if (empty($nooutput)) {

View File

@ -233,6 +233,7 @@ class pdf_standard extends ModelePDFProduct
$nexY = $pdf->GetY();
// Show photo
$pdir = array();
if (getDolGlobalInt('PRODUCT_USE_OLD_PATH_FOR_PHOTO')) {
$pdir[0] = get_exdir($object->id, 2, 0, 0, $object, 'product').$object->id."/photos/";
$pdir[1] = get_exdir(0, 0, 0, 0, $object, 'product').dol_sanitizeFileName($object->ref).'/';

View File

@ -220,6 +220,7 @@ class pdf_azur extends ModelePDFPropales
$objphoto->fetch($object->lines[$i]->fk_product);
//var_dump($objphoto->ref);exit;
$pdir = array();
if (getDolGlobalInt('PRODUCT_USE_OLD_PATH_FOR_PHOTO')) {
$pdir[0] = get_exdir($objphoto->id, 2, 0, 0, $objphoto, 'product').$objphoto->id."/photos/";
$pdir[1] = get_exdir(0, 0, 0, 0, $objphoto, 'product').dol_sanitizeFileName($objphoto->ref).'/';

View File

@ -202,6 +202,7 @@ class pdf_cyan extends ModelePDFPropales
$objphoto->fetch($object->lines[$i]->fk_product);
//var_dump($objphoto->ref);exit;
$pdir = array();
if (getDolGlobalInt('PRODUCT_USE_OLD_PATH_FOR_PHOTO')) {
$pdir[0] = get_exdir($objphoto->id, 2, 0, 0, $objphoto, 'product').$objphoto->id."/photos/";
$pdir[1] = get_exdir(0, 0, 0, 0, $objphoto, 'product').dol_sanitizeFileName($objphoto->ref).'/';

View File

@ -187,6 +187,7 @@ class pdf_eagle_proforma extends ModelePDFCommandes
$objphoto->fetch($object->lines[$i]->fk_product);
//var_dump($objphoto->ref);exit;
$pdir = array();
if (getDolGlobalInt('PRODUCT_USE_OLD_PATH_FOR_PHOTO')) {
$pdir[0] = get_exdir($objphoto->id, 2, 0, 0, $objphoto, 'product').$objphoto->id."/photos/";
$pdir[1] = get_exdir(0, 0, 0, 0, $objphoto, 'product').dol_sanitizeFileName($objphoto->ref).'/';

View File

@ -35,6 +35,7 @@ if (empty($conf) || !is_object($conf)) {
exit;
}
$fileparams = array();
if ($action == 'presend') {
$langs->load("mails");
@ -273,10 +274,10 @@ if ($action == 'presend') {
$substitutionarray['__CHECK_READ__'] = "";
if (is_object($object) && is_object($object->thirdparty)) {
$checkRead= '<img src="'.DOL_MAIN_URL_ROOT.'/public/emailing/mailing-read.php';
$checkRead.='?tag='.(!empty($object->thirdparty->tag) ? urlencode($object->thirdparty->tag) : "");
$checkRead.='&securitykey='.(getDolGlobalString('MAILING_EMAIL_UNSUBSCRIBE_KEY') ? urlencode(getDolGlobalString('MAILING_EMAIL_UNSUBSCRIBE_KEY')) : "");
$checkRead.='" width="1" height="1" style="width:1px;height:1px" border="0"/>';
$checkRead = '<img src="'.DOL_MAIN_URL_ROOT.'/public/emailing/mailing-read.php';
$checkRead .= '?tag='.(!empty($object->thirdparty->tag) ? urlencode($object->thirdparty->tag) : "");
$checkRead .= '&securitykey='.(getDolGlobalString('MAILING_EMAIL_UNSUBSCRIBE_KEY') ? urlencode(getDolGlobalString('MAILING_EMAIL_UNSUBSCRIBE_KEY')) : "");
$checkRead .= '" width="1" height="1" style="width:1px;height:1px" border="0"/>';
$substitutionarray['__CHECK_READ__'] = $checkRead;
}
$substitutionarray['__CONTACTCIVNAME__'] = '';

View File

@ -3,6 +3,11 @@
// This tpl file is included into the init part of pages, so before action.
// So no output must be done.
// TODO: Note, supposing $arrayfields is already set
'
@phan-var-force array $arrayfields;
';
// Protection to avoid direct call of template
if (empty($conf) || !is_object($conf)) {
print "Error, template page can't be called as URL";

View File

@ -195,15 +195,16 @@ if ($action == 'delete_section') {
if ($action == 'confirmconvertimgwebp') {
$langs->load("ecm");
$section_dir=GETPOST('section_dir', 'alpha');
$section=GETPOST('section', 'alpha');
$file=GETPOST('filetoregenerate', 'alpha');
$section_dir = GETPOST('section_dir', 'alpha');
$section = GETPOST('section', 'alpha');
$file = GETPOST('filetoregenerate', 'alpha');
$form = new Form($db);
$formquestion['section_dir']=array('type'=>'hidden', 'value'=>$section_dir, 'name'=>'section_dir');
$formquestion['section']=array('type'=>'hidden', 'value'=>$section, 'name'=>'section');
$formquestion['filetoregenerate']=array('type'=>'hidden', 'value'=>$file, 'name'=>'filetoregenerate');
$formquestion = array();
$formquestion['section_dir'] = array('type' => 'hidden', 'value' => $section_dir, 'name' => 'section_dir');
$formquestion['section'] = array('type' => 'hidden', 'value' => $section, 'name' => 'section');
$formquestion['filetoregenerate'] = array('type' => 'hidden', 'value' => $file, 'name' => 'filetoregenerate');
if ($module == 'medias') {
$formquestion['website']=array('type'=>'hidden', 'value'=>$website->ref, 'name'=>'website');
$formquestion['website'] = array('type' => 'hidden', 'value' => $website->ref, 'name' => 'website');
}
$param = '';
if (!empty($sortfield)) {

View File

@ -1,5 +1,7 @@
<?php
'@phan-var-force array{nbfield:int,pos?:array<int,int>,val?:array<int,float>} $totalarray';
// Move fields of totalizable into the common array pos and val
if (!empty($subtotalarray['totalizable']) && is_array($subtotalarray['totalizable'])) {
foreach ($subtotalarray['totalizable'] as $keytotalizable => $valtotalizable) {

View File

@ -1,5 +1,7 @@
<?php
'@phan-var-force array{nbfield:int,type?:array<int,string>,pos?:array<int,int>,val?:array<int,float>} $totalarray';
// Move fields of totalizable into the common array pos and val
if (!empty($totalarray['totalizable']) && is_array($totalarray['totalizable'])) {
foreach ($totalarray['totalizable'] as $keytotalizable => $valtotalizable) {
@ -56,7 +58,7 @@ if (isset($totalarray['pos'])) {
} else {
//dol_print_error($db); // as we're not sure it's ok for ALL lists, we don't print sq errors, they'll be in logs
}
if (is_array($sumsarray) && count($sumsarray) >0) {
if (is_array($sumsarray) && count($sumsarray) > 0) {
print '<tr class="liste_grandtotal">';
$i = 0;
while ($i < $totalarray['nbfield']) {
@ -100,12 +102,12 @@ function printTotalValCell($type, $val)
switch ($type) {
case 'duration':
print '<td class="right">';
print (!empty($val) ? convertSecondToTime($val, 'allhourmin') : 0);
print(!empty($val) ? convertSecondToTime($val, 'allhourmin') : 0);
print '</td>';
break;
case 'string': // This type is no more used. type is now varchar(x)
print '<td class="left">';
print (!empty($val) ? $val : '');
print(!empty($val) ? $val : '');
print '</td>';
break;
case 'stock':

View File

@ -90,9 +90,13 @@ print load_fiche_titre($langs->trans("DonationsArea"), '', 'object_donation');
print '<div class="fichecenter"><div class="fichethirdleft">';
if (!isset($listofsearchfields) || !is_array($listofsearchfields)) {
// Ensure $listofsearchfields is an array
$listofsearchfields = array();
}
if (getDolGlobalString('MAIN_SEARCH_FORM_ON_HOME_AREAS')) { // TODO Add a search into global search combo so we can remove this
if (isModEnabled('don') && $user->hasRight('don', 'lire')) {
$listofsearchfields['search_donation'] = array('text'=>'Donation');
$listofsearchfields['search_donation'] = array('text' => 'Donation');
}
if (count($listofsearchfields)) {
@ -230,7 +234,7 @@ if ($resql) {
print '<td class="nobordernopadding">';
print $obj->societe;
print ($obj->societe && ($obj->lastname || $obj->firstname) ? ' / ' : '');
print($obj->societe && ($obj->lastname || $obj->firstname) ? ' / ' : '');
print dolGetFirstLastname($obj->firstname, $obj->lastname);
print '</td>';

View File

@ -781,6 +781,7 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php';
if ($massaction == 'presetstatus') {
$formquestion = array();
$statuslist = array();
$statuslist[$objecttmp::STATUS_DRAFT] = $objecttmp->LibStatutEvent($objecttmp::STATUS_DRAFT);
$statuslist[$objecttmp::STATUS_SUGGESTED] = $objecttmp->LibStatutEvent($objecttmp::STATUS_SUGGESTED);
$statuslist[$objecttmp::STATUS_CONFIRMED] = $objecttmp->LibStatutEvent($objecttmp::STATUS_CONFIRMED);

View File

@ -129,6 +129,7 @@ print '<th colspan="4">'.$langs->trans("Statistics").'</th>';
print "</tr>\n";
$listoftype = $tripandexpense_static->listOfTypes();
$dataseries = array();
foreach ($listoftype as $code => $label) {
$dataseries[] = array($label, (isset($somme[$code]) ? (int) $somme[$code] : 0));
}

View File

@ -94,10 +94,11 @@ if ($resql) {
$total = 0;
$totalinprocess = 0;
$dataseries = array();
$colorseries = array();
$vals = array();
$bool = false;
// -1=Canceled, 0=Draft, 1=Validated, 2=Accepted/On process, 3=Closed (Sent/Received, billed or not)
if ($num>0) {
if ($num > 0) {
while ($row = $db->fetch_row($resql)) {
if (!isset($vals[$row[1]])) {
$vals[$row[1]] = 0;

View File

@ -807,6 +807,7 @@ while ($i < $imaxinloop) {
}
$objectstatic->duration = $obj->duree;
$arraydata = array();
$arraydata['thirdparty'] = $companystatic;
print $objectstatic->getKanbanView('', $arraydata);
if ($i == ($imaxinloop - 1)) {

View File

@ -92,6 +92,7 @@ if ($resql) {
$total = 0;
$dataseries = array();
$colorseries = array();
$vals = array();
// 0=Draft -> 1=Validated -> 2=Approved -> 3=Process running -> 4=Received partially -> 5=Received totally -> (reopen) 4=Received partially
// -> 7=Canceled/Never received -> (reopen) 3=Process running

View File

@ -3084,6 +3084,7 @@ if ($action == 'create') {
$close[$i]['reason'] = $form->textwithpicto($langs->transnoentities("Other"), $close[$i]['label'], 1);
$i++;
// arrayreasons[code]=reason
$arrayreasons = array();
foreach ($close as $key => $val) {
$arrayreasons[$close[$key]['code']] = $close[$key]['reason'];
}

View File

@ -155,6 +155,7 @@ if (empty($reshook)) {
$totalpayment = 0;
$atleastonepaymentnotnull = 0;
$multicurrency_totalpayment = 0;
$formquestion = array();
// Generate payment array and check if there is payment higher than invoice and payment date before invoice date
$tmpinvoice = new FactureFournisseur($db);

View File

@ -367,7 +367,7 @@ if (empty($reshook)) {
$form = new Form($db);
$object = new Holiday($db);
$listhalfday = array('morning'=>$langs->trans("Morning"), "afternoon"=>$langs->trans("Afternoon"));
$listhalfday = array('morning' => $langs->trans("Morning"), "afternoon" => $langs->trans("Afternoon"));
$title = $langs->trans('Leave');
$help_url = 'EN:Module_Holiday';
@ -498,7 +498,7 @@ if ((empty($id) && empty($ref)) || $action == 'create' || $action == 'add') {
print '<td>';
print img_picto($langs->trans("groups"), 'group', 'class="pictofixedwidth"');
$sql =' SELECT rowid, nom from '.MAIN_DB_PREFIX.'usergroup WHERE entity IN ('.getEntity('usergroup').')';
$sql = ' SELECT rowid, nom from '.MAIN_DB_PREFIX.'usergroup WHERE entity IN ('.getEntity('usergroup').')';
$resql = $db->query($sql);
$Tgroup = array();
while ($obj = $db->fetch_object($resql)) {
@ -520,6 +520,8 @@ if ((empty($id) && empty($ref)) || $action == 'create' || $action == 'add') {
$sql .= ' WHERE 1=1';
$sql .= !empty($morefilter) ? $morefilter : '';
$userlist = array();
$resql = $db->query($sql);
if ($resql) {
while ($obj = $db->fetch_object($resql)) {
@ -703,7 +705,7 @@ function sendMail($id, $cancreate, $now, $autoValidation)
$objStd->error++;
$objStd->msg = $langs->trans('ErrorMailRecipientIsEmpty');
$objStd->status = 'error';
$objStd->style="warnings";
$objStd->style = "warnings";
return $objStd;
}
@ -784,7 +786,7 @@ function sendMail($id, $cancreate, $now, $autoValidation)
if (!$result) {
$objStd->error++;
$objStd->msg = $langs->trans('ErrorMailNotSend');
$objStd->style="warnings";
$objStd->style = "warnings";
$objStd->status = 'error';
} else {
$objStd->msg = $langs->trans('MailSent');
@ -795,7 +797,7 @@ function sendMail($id, $cancreate, $now, $autoValidation)
$objStd->error++;
$objStd->msg = $langs->trans('ErrorVerif');
$objStd->status = 'error';
$objStd->style="errors";
$objStd->style = "errors";
return $objStd;
}
}
@ -803,7 +805,7 @@ function sendMail($id, $cancreate, $now, $autoValidation)
$objStd->error++;
$objStd->msg = $langs->trans('ErrorloadUserOnSendingMail');
$objStd->status = 'error';
$objStd->style="warnings";
$objStd->style = "warnings";
return $objStd;
}

View File

@ -1280,7 +1280,7 @@ class Holiday extends CommonObject
$obj = $this->db->fetch_object($resql);
// Note: $obj->halfday is 0:Full days, 2:Start afternoon end morning, -1:Start afternoon, 1:End morning
$arrayofrecord[$obj->rowid] = array('date_start'=>$this->db->jdate($obj->date_start), 'date_end'=>$this->db->jdate($obj->date_end), 'halfday'=>$obj->halfday, 'status'=>$obj->status);
$arrayofrecord[$obj->rowid] = array('date_start' => $this->db->jdate($obj->date_start), 'date_end' => $this->db->jdate($obj->date_end), 'halfday' => $obj->halfday, 'status' => $obj->status);
$i++;
}
@ -1312,7 +1312,7 @@ class Holiday extends CommonObject
dol_print_error($this->db);
}
$result = array('morning'=>$isavailablemorning, 'afternoon'=>$isavailableafternoon);
$result = array('morning' => $isavailablemorning, 'afternoon' => $isavailableafternoon);
if (!$isavailablemorning) {
$result['morning_reason'] = 'leave_request';
}
@ -1438,7 +1438,7 @@ class Holiday extends CommonObject
global $action;
$hookmanager->initHooks(array($this->element . 'dao'));
$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;
@ -1493,7 +1493,7 @@ class Holiday extends CommonObject
$statusType = 'status6';
if (!empty($startdate) && $startdate >= dol_now()) { // If not yet passed, we use a green "in live" color
$statusType = 'status4';
$params = array('tooltip'=>$this->labelStatus[$status].' - '.$langs->trans("Forthcoming"));
$params = array('tooltip' => $this->labelStatus[$status].' - '.$langs->trans("Forthcoming"));
}
if ($status == self::STATUS_DRAFT) {
$statusType = 'status0';
@ -1543,7 +1543,7 @@ class Holiday extends CommonObject
$out .= '</select>'."\n";
$showempty= 0;
$showempty = 0;
$out .= ajax_combobox($htmlname, array(), 0, 0, 'resolve', ($showempty < 0 ? (string) $showempty : '-1'), $morecss);
return $out;
@ -2270,8 +2270,9 @@ class Holiday extends CommonObject
if ($result) {
$num = $this->db->num_rows($result);
if ($num) {
$types = array();
while ($obj = $this->db->fetch_object($result)) {
$types[$obj->rowid] = array('id'=> $obj->rowid, 'rowid'=> $obj->rowid, 'code'=> $obj->code, 'label'=>$obj->label, 'affect'=>$obj->affect, 'delay'=>$obj->delay, 'newbymonth'=>$obj->newbymonth);
$types[$obj->rowid] = array('id' => $obj->rowid, 'rowid' => $obj->rowid, 'code' => $obj->code, 'label' => $obj->label, 'affect' => $obj->affect, 'delay' => $obj->delay, 'newbymonth' => $obj->newbymonth);
}
return $types;

View File

@ -87,10 +87,10 @@ if (!$user->hasRight('holiday', 'read')) {
}
$arrayfields = array(
'cp.rowid'=>array('label'=>$langs->trans("Employee"), 'checked'=>1, 'position'=>20),
'cp.fk_user'=>array('label'=>$langs->trans("Supervisor"), 'checked'=>1, 'position'=>30),
'cp.nbHoliday'=>array('label'=>$langs->trans("MenuConfCP"), 'checked'=>1, 'position'=>40),
'cp.note_public'=>array('label'=>$langs->trans("Note"), 'checked'=>1, 'position'=>50),
'cp.rowid' => array('label' => $langs->trans("Employee"), 'checked' => 1, 'position' => 20),
'cp.fk_user' => array('label' => $langs->trans("Supervisor"), 'checked' => 1, 'position' => 30),
'cp.nbHoliday' => array('label' => $langs->trans("MenuConfCP"), 'checked' => 1, 'position' => 40),
'cp.note_public' => array('label' => $langs->trans("Note"), 'checked' => 1, 'position' => 50),
);
@ -260,7 +260,7 @@ if ($massaction == 'preincreaseholiday') {
require_once DOL_DOCUMENT_ROOT.'/holiday/class/holiday.class.php';
$staticholiday = new Holiday($db);
$arraytypeholidays = $staticholiday->getTypes(1, 1);
$formquestion[] = array();
$formquestion = array();
$labeltypes = array();
foreach ($typeleaves as $key => $val) {
$labeltypes[$val['id']] = ($langs->trans($val['code']) != $val['code']) ? $langs->trans($val['code']) : $langs->trans($val['label']);

View File

@ -370,6 +370,7 @@ if (!empty($arrayfields['cpl.type_action']['checked'])) {
// Filter: Type
if (!empty($arrayfields['cpl.fk_type']['checked'])) {
$arraytypeleaves = array();
foreach ($alltypeleaves as $key => $val) {
$labeltoshow = ($langs->trans($val['code']) != $val['code'] ? $langs->trans($val['code']) : $val['label']);
$arraytypeleaves[$val['rowid']] = $labeltoshow;

View File

@ -141,7 +141,7 @@ if (empty($reshook)) {
$error++;
}
if (!$error) {
foreach ($TSkillsToAdd as $k=>$v) {
foreach ($TSkillsToAdd as $k => $v) {
$skillAdded = new SkillRank($db);
$skillAdded->fk_skill = $v;
$skillAdded->fk_object = $id;
@ -247,7 +247,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
$linkback = '<a href="' . dol_buildpath('/hrm/job_list.php', 1) . '?restore_lastsearch_values=1' . (!empty($socid) ? '&socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>';
$morehtmlref = '<div class="refid">';
$morehtmlref.= $object->label;
$morehtmlref .= $object->label;
$morehtmlref .= '</div>';
dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'rowid', $morehtmlref);
@ -269,9 +269,9 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
$TAllSkills = $static_skill->fetchAll();
// Array format for multiselectarray function
$TAllSkillsFormatted=array();
$TAllSkillsFormatted = array();
if (!empty($TAllSkills)) {
foreach ($TAllSkills as $k=>$v) {
foreach ($TAllSkills as $k => $v) {
$TAllSkillsFormatted[$k] = $v->label;
}
}
@ -279,12 +279,13 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
// table of skillRank linked to current object
//$TSkillsJob = $skill->fetchAll('ASC', 't.rowid', 0, 0);
$sql_skill = "SELECT sr.fk_object, sr.rowid, s.label,s.skill_type, sr.rankorder, sr.fk_skill";
$sql_skill .=" FROM ".MAIN_DB_PREFIX."hrm_skillrank AS sr";
$sql_skill .=" JOIN ".MAIN_DB_PREFIX."hrm_skill AS s ON sr.fk_skill = s.rowid";
$sql_skill .= " FROM ".MAIN_DB_PREFIX."hrm_skillrank AS sr";
$sql_skill .= " JOIN ".MAIN_DB_PREFIX."hrm_skill AS s ON sr.fk_skill = s.rowid";
$sql_skill .= " AND sr.fk_object = ".((int) $id);
$result = $db->query($sql_skill);
$numSkills = $db->num_rows($result);
for ($i=0; $i < $numSkills; $i++) {
$TSkillsJob = array();
for ($i = 0; $i < $numSkills; $i++) {
$objSkillRank = $db->fetch_object($result);
$TSkillsJob[] = $objSkillRank;
}
@ -307,7 +308,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
//$keyforbreak='fieldkeytoswitchonsecondcolumn'; // We change column just before this field
//unset($object->fields['fk_project']); // Hide field already shown in banner
//unset($object->fields['fk_soc']); // Hide field already shown in banner
$object->fields['label']['visible']=0; // Already in banner
$object->fields['label']['visible'] = 0; // Already in banner
include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_view.tpl.php';
// Other attributes. Fields from hook formObjectOptions and Extrafields.
@ -334,9 +335,9 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
}
print '</tr>'."\n";
$object->fields['label']['visible']=0; // Already in banner
$object->fields['firstname']['visible']=0; // Already in banner
$object->fields['lastname']['visible']=0; // Already in banner
$object->fields['label']['visible'] = 0; // Already in banner
$object->fields['firstname']['visible'] = 0; // Already in banner
$object->fields['lastname']['visible'] = 0; // Already in banner
//include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_view.tpl.php';
// Ref employee

View File

@ -136,6 +136,11 @@ if (empty($versionfrom) && empty($versionto) && !is_writable($conffile)) {
exit;
}
// Ensure $modulesdir is set and array
if (!isset($modulesdir) || !is_array($modulesdir)) {
$modulesdir = array();
}
if ($action == "set" || empty($action) || preg_match('/upgrade/i', $action)) {
$error = 0;

View File

@ -88,7 +88,7 @@ $arrayfields = array();
foreach ($arrayfields as $key => $val) {
// If $val['visible']==0, then we never show the field
if (!empty($val['visible'])) {
$arrayfields['t.'.$key] = array('label'=>$val['label'], 'checked'=>(($val['visible'] < 0) ? 0 : 1), 'enabled'=>$val['enabled'], 'position'=>$val['position']);
$arrayfields['t.'.$key] = array('label' => $val['label'], 'checked' => (($val['visible'] < 0) ? 0 : 1), 'enabled' => $val['enabled'], 'position' => $val['position']);
}
}
// Extra fields
@ -96,10 +96,10 @@ if (isset($extrafields->attributes[$object->table_element]['label']) && is_array
foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) {
if (!empty($extrafields->attributes[$object->table_element]['list'][$key])) {
$arrayfields["ef.".$key] = array(
'label'=>$extrafields->attributes[$object->table_element]['label'][$key],
'checked'=>(($extrafields->attributes[$object->table_element]['list'][$key] < 0) ? 0 : 1),
'position'=>$extrafields->attributes[$object->table_element]['pos'][$key],
'enabled'=>(abs($extrafields->attributes[$object->table_element]['list'][$key]) != 3 && $extrafields->attributes[$object->table_element]['perms'][$key])
'label' => $extrafields->attributes[$object->table_element]['label'][$key],
'checked' => (($extrafields->attributes[$object->table_element]['list'][$key] < 0) ? 0 : 1),
'position' => $extrafields->attributes[$object->table_element]['pos'][$key],
'enabled' => (abs($extrafields->attributes[$object->table_element]['list'][$key]) != 3 && $extrafields->attributes[$object->table_element]['perms'][$key])
);
}
}
@ -293,7 +293,12 @@ $objecttmp = new Opensurveysondage($db);
$trackid = 'surv'.$object->id;
include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php';
if ($sall) {
// Ensure $fieldstosearchall is set and array
if (!isset($fieldstosearchall) || !is_array($fieldstosearchall)) {
$fieldstosearchall = array();
}
foreach ($fieldstosearchall as $key => $val) {
$fieldstosearchall[$key] = $langs->trans($val);
}
@ -344,13 +349,13 @@ print '<td class="liste_titre"></td>';
print '<td class="liste_titre"></td>';
print '<td class="liste_titre"></td>';
print '<td class="liste_titre"></td>';
$arraystatus = array('-1'=>'&nbsp;', '0'=>$langs->trans("Draft"), '1'=>$langs->trans("Opened"), '2'=>$langs->trans("Closed"));
$arraystatus = array('-1' => '&nbsp;', '0' => $langs->trans("Draft"), '1' => $langs->trans("Opened"), '2' => $langs->trans("Closed"));
print '<td class="liste_titre" align="center">'.$form->selectarray('search_status', $arraystatus, $search_status, 0, 0, 0, '', 0, 0, 0, '', 'onroghtofpage').'</td>';
// 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); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
// Action column
@ -381,7 +386,7 @@ print_liste_field_titre("Status", $_SERVER["PHP_SELF"], "p.status", $param, "",
// 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); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
// Action column
@ -503,7 +508,7 @@ while ($i < min($num, $limit)) {
// 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); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
// Action column
@ -544,7 +549,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); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;

View File

@ -55,9 +55,9 @@ $type = 'product';
// Pricing Rules
$select_pricing_rules = array(
'PRODUCT_PRICE_UNIQ'=>$langs->trans('PriceCatalogue'), // Unique price
'PRODUIT_MULTIPRICES'=>$langs->trans('MultiPricesAbility'), // Several prices according to a customer level
'PRODUIT_CUSTOMER_PRICES'=>$langs->trans('PriceByCustomer'), // Different price for each customer
'PRODUCT_PRICE_UNIQ' => $langs->trans('PriceCatalogue'), // Unique price
'PRODUIT_MULTIPRICES' => $langs->trans('MultiPricesAbility'), // Several prices according to a customer level
'PRODUIT_CUSTOMER_PRICES' => $langs->trans('PriceByCustomer'), // Different price for each customer
);
$keyforparam = 'PRODUIT_CUSTOMER_PRICES_BY_QTY';
if (getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 1 || !empty($conf->global->$keyforparam)) {
@ -407,6 +407,7 @@ print "</tr>\n";
clearstatcache();
$filelist = array();
foreach ($dirmodels as $reldir) {
foreach (array('', '/doc') as $valdir) {
$dir = dol_buildpath($reldir."core/modules/product".$valdir);
@ -650,10 +651,10 @@ if (empty($conf->use_javascript_ajax)) {
} else {
print '<td class="right">';
$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).')',
'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_usesearchtoselectproduct", $arrval, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT);
print '</td>';
@ -674,7 +675,7 @@ print '<td class="right">';
print '<!-- PRODUIT_AUTOFILL_DESC -->';
print $form->selectarray(
"activate_FillProductDescAuto",
array(0=>'DoNotAutofillButAutoConcat', 1=>'AutoFillFormFieldBeforeSubmit', 2=>'DoNotUseDescriptionOfProdut'),
array(0 => 'DoNotAutofillButAutoConcat', 1 => 'AutoFillFormFieldBeforeSubmit', 2 => 'DoNotUseDescriptionOfProdut'),
!getDolGlobalString('PRODUIT_AUTOFILL_DESC') ? 0 : $conf->global->PRODUIT_AUTOFILL_DESC,
0,
0,

View File

@ -420,6 +420,7 @@ print "</tr>\n";
clearstatcache();
$filelist = array();
foreach ($dirmodels as $reldir) {
foreach (array('', '/doc') as $valdir) {
$dir = dol_buildpath($reldir . "core/modules/product_batch" . $valdir);

View File

@ -5687,7 +5687,7 @@ class Product extends CommonObject
}
$nbpiece = abs($nbpiece);
}
$op = array();
$op[0] = "+".trim($nbpiece);
$op[1] = "-".trim($nbpiece);
@ -5751,6 +5751,7 @@ class Product extends CommonObject
$nbpiece = abs($nbpiece);
}
$op = array();
$op[0] = "+".trim($nbpiece);
$op[1] = "-".trim($nbpiece);

View File

@ -92,9 +92,13 @@ print '<div class="fichecenter"><div class="fichethirdleft">';
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)) {

View File

@ -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),
);
/**

View File

@ -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 '<td class="liste_titre center">';
$array = array('-1'=>'&nbsp;', '0'=>$langs->trans('Product'), '1'=>$langs->trans('Service'));
$array = array('-1' => '&nbsp;', '0' => $langs->trans('Product'), '1' => $langs->trans('Service'));
print $form->selectarray('search_type', $array, $search_type);
print '</td>';
}
@ -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 '<td class="liste_titre center parentonrightofpage">';
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 '</td>';
}
if (!empty($arrayfields['p.tobuy']['checked'])) {
print '<td class="liste_titre center parentonrightofpage">';
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 '</td>';
}
// 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

View File

@ -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'])) {

View File

@ -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.";";

View File

@ -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);

View File

@ -533,6 +533,7 @@ print "</tr>\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 "</td>";
} else {
print '<td width="60" class="right">';
$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 '</td><td class="right">';
@ -825,13 +826,13 @@ print '</tr>';
$key = 'PROJECT_CLASSIFY_CLOSED_WHEN_ALL_TASKS_DONE';
echo '<tr class="oddeven">',
'<td class="left">',
$form->textwithpicto($langs->transnoentities($key), $langs->transnoentities($key . '_help')),
'</td>',
'<td class="right" colspan="2">',
ajax_constantonoff($key),
'</td>',
'</tr>';
'<td class="left">',
$form->textwithpicto($langs->transnoentities($key), $langs->transnoentities($key . '_help')),
'</td>',
'<td class="right" colspan="2">',
ajax_constantonoff($key),
'</td>',
'</tr>';
print '<tr class="oddeven">';
print '<td>'.$langs->trans("TimesheetPreventAfterFollowingMonths").'</td>';

View File

@ -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 .= '<br><div class="info-box-ref tdoverflowmax150 inline-block valignmiddle">'.$this->thirdparty->getNomUrl(1);
$return .= '</div><div class="inline-block valignmiddle">';
$return .= dol_print_phone($this->thirdparty->phone, $this->thirdparty->country_code, 0, $this->thirdparty->id, 'tel', 'hidenum', 'phone');
$return .='</div>';
$return .= '</div>';
}
if (!empty($arraydata['assignedusers'])) {
$return .= '<br>';
@ -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']);

View File

@ -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 '<tr><td>'.$langs->trans("Gender").'</td>';
print '<td>';
$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 '</td></tr>';
@ -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 '<tr id="trbudget" class="trcompany"><td>'.$langs->trans("TurnoverOrBudget").' <span class="star">*</span></td><td>';
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 '<tr><td>'.$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 '<td class="center">'.yn($objp->vote).'</td>';
}
$membercount = $objp->membercount>0 ? $objp->membercount : "";
$membercount = $objp->membercount > 0 ? $objp->membercount : "";
if ($publiccounters) {
print '<td class="center">'.$membercount.'</td>';
}

View File

@ -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 "</tr>\n";
clearstatcache();
$filelist = array();
foreach ($dirmodels as $reldir) {
foreach (array('', '/doc') as $valdir) {

View File

@ -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 "</tr>\n";
clearstatcache();
$filelist = array();
foreach ($dirmodels as $reldir) {
foreach (array('', '/doc') as $valdir) {

View File

@ -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'));
}

View File

@ -663,6 +663,7 @@ print '<td class="center">'.$langs->trans("MustBeMandatory").'</td>';
print '<td class="center">'.$langs->trans("MustBeInvoiceMandatory").'</td>';
print "</tr>\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 "</td>";
} else {
print '<td width="60" class="right">';
$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 '</td><td class="right">';
@ -804,10 +807,10 @@ if (!$conf->use_javascript_ajax) {
print "</td>";
} else {
print '<td width="60" class="right">';
$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 '</td><td class="right">';

View File

@ -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', '<strong>$1</strong>', $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'));
}

View File

@ -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(

View File

@ -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');

View File

@ -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');

View File

@ -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');

View File

@ -439,6 +439,7 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
print "</tr>\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 '<tr class="oddeven"><td width="100">';
print (empty($module->name) ? $name : $module->name);
print(empty($module->name) ? $name : $module->name);
print "</td><td>\n";
if (method_exists($module, 'info')) {
print $module->info($langs);

View File

@ -581,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();

View File

@ -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;

View File

@ -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 '<input type="hidden" name="page_y" value="">';
print '<input type="hidden" name="mode" value="'.$mode.'">';
$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 '<tr class="trkanban"><td colspan="'.($savnbfield+1).'">';
print '<tr class="trkanban"><td colspan="'.($savnbfield + 1).'">';
print '<div class="box-flex-container kanban">';
}
// 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;