*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -620,7 +620,7 @@ if ($resql) {
$valideurobjects = $validator->listUsersForGroup($excludefilter, 1);
$valideurarray = array();
foreach ($valideurobjects as $val) {
- $valideurarray[$val->id] = $val->id;
+ $valideurarray[$val] = $val;
}
print $form->select_dolusers($search_valideur, "search_valideur", 1, "", 0, $valideurarray, '', 0, 0, 0, $morefilter, 0, '', 'maxwidth125');
print '';
diff --git a/htdocs/holiday/view_log.php b/htdocs/holiday/view_log.php
index 4235b7261eb..d0ba35add68 100644
--- a/htdocs/holiday/view_log.php
+++ b/htdocs/holiday/view_log.php
@@ -336,7 +336,7 @@ if (!empty($arrayfields['cpl.fk_user_action']['checked'])) {
$valideurobjects = $validator->listUsersForGroup($excludefilter, 1);
$valideurarray = array();
foreach ($valideurobjects as $val) {
- $valideurarray[$val->id] = $val->id;
+ $valideurarray[$val] = $val;
}
print '';
diff --git a/htdocs/hrm/evaluation_list.php b/htdocs/hrm/evaluation_list.php
index 999d6d0d44e..adf642597f2 100644
--- a/htdocs/hrm/evaluation_list.php
+++ b/htdocs/hrm/evaluation_list.php
@@ -134,13 +134,13 @@ $object->fields = dol_sort_array($object->fields, 'position');
$arrayfields = dol_sort_array($arrayfields, 'position');
// Permissions
-$permissiontoread = $user->rights->hrm->evaluation->read;
-$permissiontoreadall = $user->rights->hrm->evaluation->readall;
-$permissiontoadd = $user->rights->hrm->evaluation->write;
-$permissiontodelete = $user->rights->hrm->evaluation->delete;
+$permissiontoread = $user->hasRight('hrm', 'evaluation', 'read');
+$permissiontoreadall = $user->hasRight('hrm', 'evaluation', 'readall');
+$permissiontoadd = $user->hasRight('hrm', 'evaluation', 'write');
+$permissiontodelete = $user->hasRight('hrm', 'evaluation', 'delete');
// Security check
-if (empty($conf->hrm->enabled)) {
+if (!isModEnabled('hrm')) {
accessforbidden('Module not enabled');
}
diff --git a/htdocs/knowledgemanagement/class/api_knowledgemanagement.class.php b/htdocs/knowledgemanagement/class/api_knowledgemanagement.class.php
index 8232287b23b..0806514b968 100644
--- a/htdocs/knowledgemanagement/class/api_knowledgemanagement.class.php
+++ b/htdocs/knowledgemanagement/class/api_knowledgemanagement.class.php
@@ -70,7 +70,7 @@ class KnowledgeManagement extends DolibarrApi
*/
public function get($id)
{
- if (!DolibarrApiAccess::$user->rights->knowledgemanagement->knowledgerecord->read) {
+ if (!DolibarrApiAccess::$user->hasRight('knowledgemanagement', 'knowledgerecord', 'read')) {
throw new RestException(401);
}
@@ -144,7 +144,7 @@ class KnowledgeManagement extends DolibarrApi
$obj_ret = array();
$tmpobject = new KnowledgeRecord($this->db);
- if (!DolibarrApiAccess::$user->rights->knowledgemanagement->knowledgerecord->read) {
+ if (!DolibarrApiAccess::$user->hasRight('knowledgemanagement', 'knowledgerecord', 'read')) {
throw new RestException(401);
}
@@ -249,7 +249,7 @@ class KnowledgeManagement extends DolibarrApi
*/
public function post($request_data = null)
{
- if (!DolibarrApiAccess::$user->rights->knowledgemanagement->knowledgerecord->write) {
+ if (!DolibarrApiAccess::$user->hasRight('knowledgemanagement', 'knowledgerecord', 'write')) {
throw new RestException(401);
}
@@ -282,7 +282,7 @@ class KnowledgeManagement extends DolibarrApi
*/
public function put($id, $request_data = null)
{
- if (!DolibarrApiAccess::$user->rights->knowledgemanagement->knowledgerecord->write) {
+ if (!DolibarrApiAccess::$user->hasRight('knowledgemanagement', 'knowledgerecord', 'write')) {
throw new RestException(401);
}
@@ -324,7 +324,7 @@ class KnowledgeManagement extends DolibarrApi
*/
public function delete($id)
{
- if (!DolibarrApiAccess::$user->rights->knowledgemanagement->knowledgerecord->delete) {
+ if (!DolibarrApiAccess::$user->hasRight('knowledgemanagement', 'knowledgerecord', 'delete')) {
throw new RestException(401);
}
$result = $this->knowledgerecord->fetch($id);
diff --git a/htdocs/knowledgemanagement/class/knowledgerecord.class.php b/htdocs/knowledgemanagement/class/knowledgerecord.class.php
index 3f9f1b40223..f85b2f8e9cf 100644
--- a/htdocs/knowledgemanagement/class/knowledgerecord.class.php
+++ b/htdocs/knowledgemanagement/class/knowledgerecord.class.php
@@ -129,7 +129,15 @@ class KnowledgeRecord extends CommonObject
public $fk_user_valid;
public $import_key;
public $model_pdf;
+
+ /**
+ * @var string question asked
+ */
public $question;
+
+ /**
+ * @var string answer to question
+ */
public $answer;
public $url;
public $status;
@@ -192,7 +200,7 @@ class KnowledgeRecord extends CommonObject
}
// Example to show how to set values of fields definition dynamically
- /*if ($user->rights->knowledgemanagement->knowledgerecord->read) {
+ /*if ($user->hasRight('knowledgemanagement', 'knowledgerecord', 'read')) {
$this->fields['myfield']['visible'] = 1;
$this->fields['myfield']['noteditable'] = 0;
}*/
@@ -265,8 +273,8 @@ class KnowledgeRecord extends CommonObject
if (property_exists($object, 'ref')) {
$object->ref = empty($this->fields['ref']['default']) ? "Copy_Of_".$object->ref : $this->fields['ref']['default'];
}
- if (property_exists($object, 'label')) {
- $object->label = empty($this->fields['label']['default']) ? $langs->trans("CopyOf")." ".$object->label : $this->fields['label']['default'];
+ if (property_exists($object, 'question')) {
+ $object->question = empty($this->fields['question']['default']) ? $langs->trans("CopyOf")." ".$object->question : $this->fields['question']['default'];
}
if (property_exists($object, 'status')) {
$object->status = self::STATUS_DRAFT;
@@ -530,7 +538,7 @@ class KnowledgeRecord extends CommonObject
return 0;
}
- /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->knowledgemanagement->knowledgerecord->write))
+ /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->hasRight('knowledgemanagement', 'knowledgerecord', 'write'))
|| (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->knowledgemanagement->knowledgerecord->knowledgerecord_advance->validate))))
{
$this->error='NotEnoughPermissions';
@@ -706,6 +714,39 @@ class KnowledgeRecord extends CommonObject
return $this->setStatusCommon($user, self::STATUS_VALIDATED, $notrigger, 'KNOWLEDGERECORD_REOPEN');
}
+ /**
+ * getTooltipContentArray
+ *
+ * @param array $params ex option, infologin
+ * @since v18
+ * @return array
+ */
+ public function getTooltipContentArray($params)
+ {
+ global $conf, $langs;
+
+ $langs->loadLangs(['knowledgemanagement', 'languages']);
+
+ $datas = [];
+ $nofetch = empty($params['nofetch']) ? false : true;
+ $datas['picto'] = img_picto('', $this->picto).' '.$langs->trans("KnowledgeRecord").'';
+ if (isset($this->statut)) {
+ $datas['picto'] .= ' '.$this->getLibStatut(5);
+ }
+ $datas['label'] = ' '.$langs->trans('Ref').': '.$this->ref;
+ $datas['question'] = ' '.$langs->trans('Question').': '.$this->question;
+ $labellang = ($this->lang ? $langs->trans('Language_'.$this->lang) : '');
+ $datas['lang'] = ' '.$langs->trans('Language').': ' . picto_from_langcode($this->lang, 'class="paddingrightonly saturatemedium opacitylow"') . $labellang;
+ // show categories for this record only in ajax to not overload lists
+ if (isModEnabled('categorie') && !$nofetch) {
+ require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
+ $form = new Form($this->db);
+ $datas['categories'] = ' ' . $form->showCategories($this->id, Categorie::TYPE_KNOWLEDGEMANAGEMENT, 1);
+ }
+
+ return $datas;
+ }
+
/**
* Return a link to the object card (with optionaly the picto)
*
@@ -726,12 +767,19 @@ class KnowledgeRecord extends CommonObject
$result = '';
- $label = img_picto('', $this->picto).' '.$langs->trans("KnowledgeRecord").'';
- if (isset($this->status)) {
- $label .= ' '.$this->getLibStatut(5);
+ $params = [
+ 'id' => $this->id,
+ 'objecttype' => $this->element,
+ 'option' => $option,
+ 'nofetch' => 1,
+ ];
+ $classfortooltip = 'classfortooltip';
+ $dataparams = '';
+ if (getDolGlobalInt('MAIN_ENABLE_AJAX_TOOLTIP')) {
+ $classfortooltip = 'classforajaxtooltip';
+ $dataparams = ' data-params='.json_encode($params);
}
- $label .= ' ';
- $label .= ''.$langs->trans('Ref').': '.$this->ref;
+ $label = implode($this->getTooltipContentArray($params));
$url = dol_buildpath('/knowledgemanagement/knowledgerecord_card.php', 1).'?id='.$this->id;
@@ -752,8 +800,8 @@ class KnowledgeRecord extends CommonObject
$label = $langs->trans("ShowKnowledgeRecord");
$linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
}
- $linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"';
- $linkclose .= ' class="classfortooltip'.($morecss ? ' '.$morecss : '').'"';
+ $linkclose .= $dataparams.' title="'.dol_escape_htmltag($label, 1).'"';
+ $linkclose .= ' class="'.$classfortooltip.($morecss ? ' '.$morecss : '').'"';
} else {
$linkclose = ($morecss ? ' class="'.$morecss.'"' : '');
}
@@ -774,7 +822,7 @@ class KnowledgeRecord extends CommonObject
if (empty($this->showphoto_on_popup)) {
if ($withpicto) {
- $result .= img_object(($notooltip ? '' : $label), ($this->picto ? $this->picto : 'generic'), ($notooltip ? (($withpicto != 2) ? 'class="paddingright"' : '') : 'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip"'), 0, 0, $notooltip ? 0 : 1);
+ $result .= img_object(($notooltip ? '' : $label), ($this->picto ? $this->picto : 'generic'), ($notooltip ? (($withpicto != 2) ? 'class="paddingright"' : '') : $dataparams.' class="'.(($withpicto != 2) ? 'paddingright ' : '').$classfortooltip.'"'), 0, 0, $notooltip ? 0 : 1);
}
} else {
if ($withpicto) {
diff --git a/htdocs/knowledgemanagement/knowledgerecord_agenda.php b/htdocs/knowledgemanagement/knowledgerecord_agenda.php
index e24e23b14e7..6cf8428d06b 100644
--- a/htdocs/knowledgemanagement/knowledgerecord_agenda.php
+++ b/htdocs/knowledgemanagement/knowledgerecord_agenda.php
@@ -90,7 +90,7 @@ if ($id > 0 || !empty($ref)) {
$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
restrictedArea($user, $object->module, $object->id, $object->table_element, $object->element, '', 'rowid', $isdraft);
-$permissiontoadd = $user->rights->knowledgemanagement->knowledgerecord->write; // Used by the include of actions_addupdatedelete.inc.php
+$permissiontoadd = $user->hasRight('knowledgemanagement', 'knowledgerecord', 'write'); // Used by the include of actions_addupdatedelete.inc.php
/*
diff --git a/htdocs/knowledgemanagement/knowledgerecord_card.php b/htdocs/knowledgemanagement/knowledgerecord_card.php
index 52143048f72..495b095fb4d 100644
--- a/htdocs/knowledgemanagement/knowledgerecord_card.php
+++ b/htdocs/knowledgemanagement/knowledgerecord_card.php
@@ -74,12 +74,12 @@ if (empty($action) && empty($id) && empty($ref)) {
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once.
-$permissiontoread = $user->rights->knowledgemanagement->knowledgerecord->read;
-$permissiontovalidate = $user->rights->knowledgemanagement->knowledgerecord->write;
-$permissiontoadd = $user->rights->knowledgemanagement->knowledgerecord->write; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
-$permissiontodelete = $user->rights->knowledgemanagement->knowledgerecord->delete || ($permissiontoadd && isset($object->status) && $object->status == $object::STATUS_DRAFT);
-$permissionnote = $user->rights->knowledgemanagement->knowledgerecord->write; // Used by the include of actions_setnotes.inc.php
-$permissiondellink = $user->rights->knowledgemanagement->knowledgerecord->write; // Used by the include of actions_dellink.inc.php
+$permissiontoread = $user->hasRight('knowledgemanagement', 'knowledgerecord', 'read');
+$permissiontovalidate = $user->hasRight('knowledgemanagement', 'knowledgerecord', 'write');
+$permissiontoadd = $user->hasRight('knowledgemanagement', 'knowledgerecord', 'write'); // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
+$permissiontodelete = $user->hasRight('knowledgemanagement', 'knowledgerecord', 'delete') || ($permissiontoadd && isset($object->status) && $object->status == $object::STATUS_DRAFT);
+$permissionnote = $user->hasRight('knowledgemanagement', 'knowledgerecord', 'write'); // Used by the include of actions_setnotes.inc.php
+$permissiondellink = $user->hasRight('knowledgemanagement', 'knowledgerecord', 'write'); // Used by the include of actions_dellink.inc.php
$upload_dir = $conf->knowledgemanagement->multidir_output[isset($object->entity) ? $object->entity : 1];
// Security check - Protection if external user
@@ -538,8 +538,8 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
$relativepath = $objref.'/'.$objref.'.pdf';
$filedir = $conf->knowledgemanagement->dir_output.'/'.$object->element.'/'.$objref;
$urlsource = $_SERVER["PHP_SELF"]."?id=".$object->id;
- $genallowed = $user->rights->knowledgemanagement->knowledgerecord->read; // If you can read, you can build the PDF to read content
- $delallowed = $user->rights->knowledgemanagement->knowledgerecord->write; // If you can create/edit, you can remove a file on card
+ $genallowed = $user->hasRight('knowledgemanagement', 'knowledgerecord', 'read'); // If you can read, you can build the PDF to read content
+ $delallowed = $user->hasRight('knowledgemanagement', 'knowledgerecord', 'write'); // If you can create/edit, you can remove a file on card
print $formfile->showdocuments('knowledgemanagement:KnowledgeRecord', $object->element.'/'.$objref, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf, 1, 0, 0, 28, 0, '', '', '', $langs->defaultlang);
}
diff --git a/htdocs/knowledgemanagement/knowledgerecord_contact.php b/htdocs/knowledgemanagement/knowledgerecord_contact.php
index 4e557a3e1ae..751cdff5c9e 100644
--- a/htdocs/knowledgemanagement/knowledgerecord_contact.php
+++ b/htdocs/knowledgemanagement/knowledgerecord_contact.php
@@ -56,7 +56,7 @@ include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be includ
$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
restrictedArea($user, $object->module, $object->id, $object->table_element, $object->element, '', 'rowid', $isdraft);
-$permission = $user->rights->knowledgemanagement->knowledgerecord->write;
+$permission = $user->hasRight('knowledgemanagement', 'knowledgerecord', 'write');
/*
diff --git a/htdocs/knowledgemanagement/knowledgerecord_document.php b/htdocs/knowledgemanagement/knowledgerecord_document.php
index 7430de8a495..8d8fe6ac769 100644
--- a/htdocs/knowledgemanagement/knowledgerecord_document.php
+++ b/htdocs/knowledgemanagement/knowledgerecord_document.php
@@ -81,7 +81,7 @@ if ($id > 0 || !empty($ref)) {
$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
restrictedArea($user, $object->module, $object->id, $object->table_element, $object->element, '', 'rowid', $isdraft);
-$permissiontoadd = $user->rights->knowledgemanagement->knowledgerecord->write; // Used by the include of actions_addupdatedelete.inc.php and actions_linkedfiles.inc.php
+$permissiontoadd = $user->hasRight('knowledgemanagement', 'knowledgerecord', 'write'); // Used by the include of actions_addupdatedelete.inc.php and actions_linkedfiles.inc.php
@@ -183,9 +183,9 @@ if ($object->id) {
print dol_get_fiche_end();
$modulepart = 'knowledgemanagement';
- //$permission = $user->rights->knowledgemanagement->knowledgerecord->write;
+ //$permission = $user->hasRight('knowledgemanagement', 'knowledgerecord', 'write');
$permission = 1;
- //$permtoedit = $user->rights->knowledgemanagement->knowledgerecord->write;
+ //$permtoedit = $user->hasRight('knowledgemanagement', 'knowledgerecord', 'write');
$permtoedit = 1;
$param = '&id='.$object->id;
diff --git a/htdocs/knowledgemanagement/knowledgerecord_list.php b/htdocs/knowledgemanagement/knowledgerecord_list.php
index 7cd5a24c764..3a916cb96ef 100644
--- a/htdocs/knowledgemanagement/knowledgerecord_list.php
+++ b/htdocs/knowledgemanagement/knowledgerecord_list.php
@@ -140,9 +140,9 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php';
$object->fields = dol_sort_array($object->fields, 'position');
$arrayfields = dol_sort_array($arrayfields, 'position');
-$permissiontoread = $user->rights->knowledgemanagement->knowledgerecord->read;
-$permissiontoadd = $user->rights->knowledgemanagement->knowledgerecord->write;
-$permissiontodelete = $user->rights->knowledgemanagement->knowledgerecord->delete;
+$permissiontoread = $user->hasRight('knowledgemanagement', 'knowledgerecord', 'read');
+$permissiontoadd = $user->hasRight('knowledgemanagement', 'knowledgerecord', 'write');
+$permissiontodelete = $user->hasRight('knowledgemanagement', 'knowledgerecord', 'delete');
// Security check
if (empty($conf->knowledgemanagement->enabled)) {
@@ -428,7 +428,7 @@ if ($permissiontodelete) {
$arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete");
}
-if (isModEnabled('category') && $user->rights->knowledgemanagement->knowledgerecord->write) {
+if (isModEnabled('category') && $user->hasRight('knowledgemanagement', 'knowledgerecord', 'write')) {
$arrayofmassactions['preaffecttag'] = img_picto('', 'category', 'class="pictofixedwidth"').$langs->trans("AffectTag");
}
diff --git a/htdocs/knowledgemanagement/knowledgerecord_note.php b/htdocs/knowledgemanagement/knowledgerecord_note.php
index 28a2bcaa9d0..ea1052ccc98 100644
--- a/htdocs/knowledgemanagement/knowledgerecord_note.php
+++ b/htdocs/knowledgemanagement/knowledgerecord_note.php
@@ -52,8 +52,8 @@ if ($id > 0 || !empty($ref)) {
$upload_dir = $conf->knowledgemanagement->multidir_output[$object->entity]."/".$object->id;
}
-$permissionnote = $user->rights->knowledgemanagement->knowledgerecord->write; // Used by the include of actions_setnotes.inc.php
-$permissiontoadd = $user->rights->knowledgemanagement->knowledgerecord->write; // Used by the include of actions_addupdatedelete.inc.php
+$permissionnote = $user->hasRight('knowledgemanagement', 'knowledgerecord', 'write'); // Used by the include of actions_setnotes.inc.php
+$permissiontoadd = $user->hasRight('knowledgemanagement', 'knowledgerecord', 'write'); // Used by the include of actions_addupdatedelete.inc.php
// Security check - Protection if external user
//if ($user->socid > 0) accessforbidden();
diff --git a/htdocs/langs/en_US/knowledgemanagement.lang b/htdocs/langs/en_US/knowledgemanagement.lang
index 38c1624afad..050ecbcc03a 100644
--- a/htdocs/langs/en_US/knowledgemanagement.lang
+++ b/htdocs/langs/en_US/knowledgemanagement.lang
@@ -51,4 +51,10 @@ SuggestedForTicketsInGroup=Suggested on ticket creation
SetObsolete=Set as obsolete
ConfirmCloseKM=Do you confirm the closing of this article as obsolete ?
-ConfirmReopenKM=Do you want to restore this article to status "Validated" ?
\ No newline at end of file
+ConfirmReopenKM=Do you want to restore this article to status "Validated" ?
+BoxLastKnowledgerecordDescription=Last %s articles
+BoxLastKnowledgerecord=Last articles
+BoxLastKnowledgerecordContent=Last articles
+BoxLastKnowledgerecordModifiedContent=Last modified articles
+BoxLastModifiedKnowledgerecordDescription=Last %s modified articles
+BoxLastModifiedKnowledgerecord=Last modified articles
diff --git a/htdocs/langs/en_US/members.lang b/htdocs/langs/en_US/members.lang
index 5876a019d25..b0237c5578b 100644
--- a/htdocs/langs/en_US/members.lang
+++ b/htdocs/langs/en_US/members.lang
@@ -233,3 +233,4 @@ CreateDolibarrThirdPartyDesc=A thirdparty is the legal entity that will be used
MemberFirstname=Member firstname
MemberLastname=Member lastname
MemberCodeDesc=Member Code, unique for all members
+NoRecordedMembers=No registered member
diff --git a/htdocs/langs/en_US/mrp.lang b/htdocs/langs/en_US/mrp.lang
index 82cf7c38012..6c8af64f69a 100644
--- a/htdocs/langs/en_US/mrp.lang
+++ b/htdocs/langs/en_US/mrp.lang
@@ -119,3 +119,5 @@ BomCantAddChildBom=The nomenclature %s is already present in the tree leading to
BOMNetNeeds = BOM Net Needs
BOMProductsList=BOM's products
BOMServicesList=BOM's services
+Manufacturing=Manufacturing
+Disassemble=Disassemble
diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php
index bdb10c58003..889a1900139 100644
--- a/htdocs/main.inc.php
+++ b/htdocs/main.inc.php
@@ -15,6 +15,7 @@
* Copyright (C) 2020 Charlene Benke
* Copyright (C) 2021 Frédéric France
* Copyright (C) 2021 Alexandre Spangaro
+ * Copyright (C) 2023 Joachim Küter
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -1397,7 +1398,7 @@ if (!function_exists("llxHeader")) {
* @param string $head Optionnal head lines
* @param string $title HTML title
* @param string $help_url Url links to help page
- * Syntax is: For a wiki page: EN:EnglishPage|FR:FrenchPage|ES:SpanishPage
+ * Syntax is: For a wiki page: EN:EnglishPage|FR:FrenchPage|ES:SpanishPage|DE:GermanPage
* For other external page: http://server/url
* @param string $target Target to use on links
* @param int $disablejs More content into html header
@@ -1958,7 +1959,7 @@ function top_htmlhead($head, $title = '', $disablejs = 0, $disablehead = 0, $arr
* @param array $arrayofcss Array of css files to add in header
* @param string $morequerystring Query string to add to the link "print" to get same parameters (use only if autodetect fails)
* @param string $helppagename Name of wiki page for help ('' by default).
- * Syntax is: For a wiki page: EN:EnglishPage|FR:FrenchPage|ES:SpanishPage
+ * Syntax is: For a wiki page: EN:EnglishPage|FR:FrenchPage|ES:SpanishPage|DE:GermanPage
* For other external page: http://server/url
* @return void
*/
@@ -2091,7 +2092,7 @@ function top_menu($head, $title = '', $target = '', $disablejs = 0, $disablehead
$helppresent = '';
if (empty($helppagename)) {
- $helppagename = 'EN:User_documentation|FR:Documentation_utilisateur|ES:Documentación_usuarios';
+ $helppagename = 'EN:User_documentation|FR:Documentation_utilisateur|ES:Documentación_usuarios|DE:Benutzerdokumentation';
} else {
$helppresent = 'helppresent';
}
@@ -2888,7 +2889,7 @@ function top_menu_search()
*
* @param array $menu_array_before Table of menu entries to show before entries of menu handler. This param is deprectaed and must be provided to ''.
* @param string $helppagename Name of wiki page for help ('' by default).
- * Syntax is: For a wiki page: EN:EnglishPage|FR:FrenchPage|ES:SpanishPage
+ * Syntax is: For a wiki page: EN:EnglishPage|FR:FrenchPage|ES:SpanishPage|DE:GermanPage
* For other external page: http://server/url
* @param string $notused Deprecated. Used in past to add content into left menu. Hooks can be used now.
* @param array $menu_array_after Table of menu entries to show after entries of menu handler
@@ -3177,7 +3178,7 @@ function main_area($title = '')
/**
* Return helpbaseurl, helppage and mode
*
- * @param string $helppagename Page name ('EN:xxx,ES:eee,FR:fff...' or 'http://localpage')
+ * @param string $helppagename Page name ('EN:xxx,ES:eee,FR:fff,DE:ddd...' or 'http://localpage')
* @param Translate $langs Language
* @return array Array of help urls
*/
@@ -3207,6 +3208,12 @@ function getHelpParamFor($helppagename, $langs)
$helppage = $reg[1];
}
}
+ if (preg_match('/^de/i', $langs->defaultlang)) {
+ $helpbaseurl = 'http://wiki.dolibarr.org/index.php/%s';
+ if (preg_match('/DE:([^|]+)/i', $helppagename, $reg)) {
+ $helppage = $reg[1];
+ }
+ }
if (empty($helppage)) { // If help page not already found
$helpbaseurl = 'http://wiki.dolibarr.org/index.php/%s';
if (preg_match('/EN:([^|]+)/i', $helppagename, $reg)) {
diff --git a/htdocs/mrp/class/mo.class.php b/htdocs/mrp/class/mo.class.php
index ddfd8a7f57b..afdac2d16a8 100644
--- a/htdocs/mrp/class/mo.class.php
+++ b/htdocs/mrp/class/mo.class.php
@@ -93,7 +93,6 @@ class Mo extends CommonObject
* Note: To have value dynamic, you can set value to 0 in definition and edit the value on the fly into the constructor.
*/
- // BEGIN MODULEBUILDER PROPERTIES
/**
* @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor.
*/
@@ -126,6 +125,10 @@ class Mo extends CommonObject
public $rowid;
public $entity;
public $ref;
+
+ /**
+ * @var int mrptype
+ */
public $mrptype;
public $label;
public $qty;
@@ -154,8 +157,17 @@ class Mo extends CommonObject
public $fk_user_modif;
public $import_key;
public $status;
+
+ /**
+ * @var int ID of product
+ */
public $fk_product;
+ /**
+ * @var Product product object
+ */
+ public $product;
+
/**
* @var integer|string date_start_planned
*/
@@ -167,10 +179,20 @@ class Mo extends CommonObject
public $date_end_planned;
+ /**
+ * @var int ID bom
+ */
public $fk_bom;
- public $fk_project;
- // END MODULEBUILDER PROPERTIES
+ /**
+ * @var Bom bom
+ */
+ public $bom;
+
+ /**
+ * @var int ID project
+ */
+ public $fk_project;
// If this object has a subtable with lines
@@ -204,12 +226,24 @@ class Mo extends CommonObject
*/
public $lines = array();
+ /**
+ * @var MoLine MO line
+ */
+ public $line = array();
+
/**
* @var integer Mo parent line
* */
+ /**
+ * @var int ID of parent line
+ */
public $fk_parent_line;
+ /**
+ * @var array tpl
+ */
+ public $tpl = array();
/**
* Constructor
@@ -1100,6 +1134,9 @@ class Mo extends CommonObject
if (isset($this->label)) {
$datas['label'] = ' '.$langs->trans('Label').': '.$this->label;
}
+ if (isset($this->mrptype)) {
+ $datas['type'] = ' '.$langs->trans('Type').': '.$this->fields['mrptype']['arrayofkeyval'][$this->mrptype];
+ }
return $datas;
}
@@ -1458,7 +1495,7 @@ class Mo extends CommonObject
* If lines are into a template, title must also be into a template
* But for the moment we don't know if it's possible as we keep a method available on overloaded objects.
*
- * @param CommonObjectLine $line Line
+ * @param MoLine $line Line
* @param string $var Var
* @param string $restrictlist ''=All lines, 'services'=Restrict to services only (strike line if not)
* @param string $defaulttpldir Directory where to find the template
@@ -1519,7 +1556,7 @@ class Mo extends CommonObject
/**
* Function used to return childs of Mo
*
- * @return array|int array if OK, -1 if KO
+ * @return Mo[]|int array if OK, -1 if KO
*/
public function getMoChilds()
{
@@ -1557,7 +1594,7 @@ class Mo extends CommonObject
/**
* Function used to return childs of Mo
*
- * @return Object|int MO object if OK, -1 if KO, 0 if not exist
+ * @return Mo|int MO object if OK, -1 if KO, 0 if not exist
*/
public function getMoParent()
{
@@ -1680,6 +1717,7 @@ class MoLine extends CommonObjectLine
public $qty;
public $qty_frozen;
public $disable_stock_change;
+ public $efficiency;
public $batch;
public $role;
public $fk_mrp_production;
@@ -1689,6 +1727,7 @@ class MoLine extends CommonObjectLine
public $fk_user_creat;
public $fk_user_modif;
public $import_key;
+ public $fk_parent_line;
/**
* Constructor
diff --git a/htdocs/mrp/mo_movements.php b/htdocs/mrp/mo_movements.php
index c0357aa5e4b..a82f36c913e 100644
--- a/htdocs/mrp/mo_movements.php
+++ b/htdocs/mrp/mo_movements.php
@@ -257,7 +257,7 @@ $productlot = new ProductLot($db);
$warehousestatic = new Entrepot($db);
$userstatic = new User($db);
-$help_url = 'EN:Module_Manufacturing_Orders|FR:Module_Ordres_de_Fabrication';
+$help_url = 'EN:Module_Manufacturing_Orders|FR:Module_Ordres_de_Fabrication|DE:Modul_Fertigungsauftrag';
llxHeader('', $langs->trans('Mo'), $help_url);
diff --git a/htdocs/mrp/mo_production.php b/htdocs/mrp/mo_production.php
index b274f4b89df..4e149201ba3 100644
--- a/htdocs/mrp/mo_production.php
+++ b/htdocs/mrp/mo_production.php
@@ -431,7 +431,7 @@ $tmpwarehouse = new Entrepot($db);
$tmpbatch = new Productlot($db);
$tmpstockmovement = new MouvementStock($db);
-$help_url = 'EN:Module_Manufacturing_Orders|FR:Module_Ordres_de_Fabrication';
+$help_url = 'EN:Module_Manufacturing_Orders|FR:Module_Ordres_de_Fabrication|DE:Modul_Fertigungsauftrag';
llxHeader('', $langs->trans('Mo'), $help_url, '', 0, 0, array('/mrp/js/lib_dispatch.js.php'));
$newToken = newToken();
diff --git a/htdocs/opensurvey/class/opensurveysondage.class.php b/htdocs/opensurvey/class/opensurveysondage.class.php
index e928c2f3cd6..b141da8d392 100644
--- a/htdocs/opensurvey/class/opensurveysondage.class.php
+++ b/htdocs/opensurvey/class/opensurveysondage.class.php
@@ -115,6 +115,11 @@ class Opensurveysondage extends CommonObject
*/
public $allow_spy;
+ /**
+ * @var array fields
+ */
+ public $fields = array();
+
/**
* Draft status (not used)
diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php
index e9755559a50..74025356811 100644
--- a/htdocs/product/class/product.class.php
+++ b/htdocs/product/class/product.class.php
@@ -5012,6 +5012,7 @@ class Product extends CommonObject
$langs->load('products');
$datas = [];
+ $nofetch = empty($params['nofetch']) ? false : true;
if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
return ['optimize' => $langs->trans("ShowProduct")];
@@ -5104,6 +5105,12 @@ class Product extends CommonObject
$datas['accountancybuy'] = $buylabel;
}
}
+ // show categories for this record only in ajax to not overload lists
+ if (isModEnabled('categorie') && !$nofetch) {
+ require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
+ $form = new Form($this->db);
+ $datas['categories'] = ' ' . $form->showCategories($this->id, Categorie::TYPE_PRODUCT, 1);
+ }
return $datas;
}
@@ -5136,6 +5143,7 @@ class Product extends CommonObject
'id' => $this->id,
'objecttype' => $this->element,
'option' => $option,
+ 'nofetch' => 1,
];
$classfortooltip = 'classfortooltip';
$dataparams = '';
diff --git a/htdocs/projet/class/api_projects.class.php b/htdocs/projet/class/api_projects.class.php
index fc10f49d38d..fa936969754 100644
--- a/htdocs/projet/class/api_projects.class.php
+++ b/htdocs/projet/class/api_projects.class.php
@@ -229,7 +229,7 @@ class Projects extends DolibarrApi
*
* @param int $id Id of project
* @param int $includetimespent 0=Return only list of tasks. 1=Include a summary of time spent, 2=Include details of time spent lines
- * @return int
+ * @return array
*
* @url GET {id}/tasks
*/
diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php
index 41b829aa5ef..e180d9ab13e 100644
--- a/htdocs/societe/class/societe.class.php
+++ b/htdocs/societe/class/societe.class.php
@@ -2612,6 +2612,7 @@ class Societe extends CommonObject
$datas = [];
$option = $params['option'] ?? '';
+ $nofetch = empty($params['nofetch']) ? false : true;
$name = $this->name;
if (!empty($this->name_alias) && empty($noaliasinname)) {
@@ -2724,6 +2725,17 @@ class Societe extends CommonObject
if (isModEnabled('accounting') && $this->fournisseur) {
$datas['accountancysuppliercode'] = ' '.$langs->trans('SupplierAccountancyCode').': '.$this->code_compta_fournisseur;
}
+ // show categories for this record only in ajax to not overload lists
+ if (isModEnabled('categorie') && !$nofetch) {
+ require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
+ $form = new Form($this->db);
+ if ($this->client) {
+ $datas['categories_customer'] = ' ' . $form->showCategories($this->id, Categorie::TYPE_CUSTOMER, 1);
+ }
+ if ($this->fournisseur) {
+ $datas['categories_supplier'] = ' ' . $form->showCategories($this->id, Categorie::TYPE_SUPPLIER, 1);
+ }
+ }
$datas['divclose'] = '';
@@ -2789,6 +2801,7 @@ class Societe extends CommonObject
'id' => $this->id,
'objecttype' => $this->element,
'option' => $option,
+ 'nofetch' => 1,
];
$classfortooltip = 'classfortooltip';
$dataparams = '';
diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php
index 932ed171cea..bc50c0e31f8 100644
--- a/htdocs/ticket/class/ticket.class.php
+++ b/htdocs/ticket/class/ticket.class.php
@@ -1433,6 +1433,7 @@ class Ticket extends CommonObject
$langs->load('ticket');
+ $nofetch = empty($params['nofetch']) ? false : true;
$datas = [];
$datas['picto'] = img_picto('', $this->picto).' '.$langs->trans("Ticket").'';
$datas['picto'] .= ' '.$this->getLibStatut(4);
@@ -1440,10 +1441,16 @@ class Ticket extends CommonObject
$datas['track_id'] = ' '.$langs->trans('TicketTrackId').': '.$this->track_id;
$datas['subject'] = ' '.$langs->trans('Subject').': '.$this->subject;
if ($this->date_creation) {
- $datas['date_creation'] = ' '.$langs->trans('DateCreation').': '.$this->date_creation;
+ $datas['date_creation'] = ' '.$langs->trans('DateCreation').': '.dol_print_date($this->date_creation, 'dayhour');
}
if ($this->date_modification) {
- $datas['date_modification'] = ' '.$langs->trans('DateModification').': '.$this->date_modification;
+ $datas['date_modification'] = ' '.$langs->trans('DateModification').': '.dol_print_date($this->date_modification, 'dayhour');
+ }
+ // show categories for this record only in ajax to not overload lists
+ if (isModEnabled('categorie') && !$nofetch) {
+ require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
+ $form = new Form($this->db);
+ $datas['categories'] = ' ' . $form->showCategories($this->id, Categorie::TYPE_TICKET, 1);
}
return $datas;
@@ -1474,6 +1481,8 @@ class Ticket extends CommonObject
$params = [
'id' => $this->id,
'objecttype' => $this->element,
+ 'option' => $option,
+ 'nofetch' => 1,
];
$classfortooltip = 'classfortooltip';
$dataparams = '';
diff --git a/htdocs/ticket/contact.php b/htdocs/ticket/contact.php
index b5453ed638b..d858a4d7334 100644
--- a/htdocs/ticket/contact.php
+++ b/htdocs/ticket/contact.php
@@ -252,7 +252,7 @@ if ($id > 0 || !empty($track_id) || !empty($ref)) {
$linkback = ''.$langs->trans("BackToList").' ';
- dol_banner_tab($object, 'ref', $linkback, ($user->socid ? 0 : 1), 'ref', 'ref', $morehtmlref, $param, 0, '', '', 1, '');
+ dol_banner_tab($object, 'ref', $linkback, ($user->socid ? 0 : 1), 'ref', 'ref', $morehtmlref, '', 0, '', '', 1, '');
print dol_get_fiche_end();
diff --git a/htdocs/ticket/index.php b/htdocs/ticket/index.php
index 243084ec89f..f75a93f7082 100644
--- a/htdocs/ticket/index.php
+++ b/htdocs/ticket/index.php
@@ -65,7 +65,7 @@ $object = new Ticket($db);
// Security check
//$result = restrictedArea($user, 'ticket|knowledgemanagement', 0, '', '', '', '');
-if (empty($user->rights->ticket->read) && empty($user->rights->knowledgemanagement->knowledgerecord->read)) {
+if (empty($user->rights->ticket->read) && !$user->hasRight('knowledgemanagement', 'knowledgerecord', 'read')) {
accessforbidden('Not enought permissions');
}
diff --git a/htdocs/user/class/api_users.class.php b/htdocs/user/class/api_users.class.php
index 2bbadd267cf..d91fcafffa6 100644
--- a/htdocs/user/class/api_users.class.php
+++ b/htdocs/user/class/api_users.class.php
@@ -593,7 +593,7 @@ class Users extends DolibarrApi
*
* @param int $group ID of group
* @param int $load_members Load members list or not {@min 0} {@max 1}
- * @return array Array of User objects
+ * @return object object of User objects
*
* @throws RestException 401 Not allowed
* @throws RestException 404 User not found
|