Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop
This commit is contained in:
commit
b3160b7dc5
2
.github/workflows/code_quality.yml
vendored
2
.github/workflows/code_quality.yml
vendored
@ -18,7 +18,7 @@ jobs:
|
||||
fetch-depth: 1
|
||||
#php-version: '7.1'
|
||||
- name: 'Qodana Scan'
|
||||
uses: JetBrains/qodana-action@v2022.3.2
|
||||
uses: JetBrains/qodana-action@v2022.3.3
|
||||
#with:
|
||||
# php-version: '7.1'
|
||||
env:
|
||||
|
||||
@ -2288,6 +2288,7 @@ class Adherent extends CommonObject
|
||||
|
||||
$datas = [];
|
||||
|
||||
$nofetch = empty($params['nofetch']) ? false : true;
|
||||
if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
|
||||
$langs->load("users");
|
||||
return ['optimize' => $langs->trans("ShowUser")];
|
||||
@ -2318,6 +2319,12 @@ class Adherent extends CommonObject
|
||||
$datas['email'] = '<br><b>'.$langs->trans("EMail").':</b> '.$this->email;
|
||||
}
|
||||
$datas['address'] = '<br><b>'.$langs->trans("Address").':</b> '.dol_format_address($this, 1, ' ', $langs);
|
||||
// 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'] = '<br>' . $form->showCategories($this->id, Categorie::TYPE_MEMBER, 1);
|
||||
}
|
||||
$datas['divclose'] = '</div>';
|
||||
|
||||
return $datas;
|
||||
@ -2353,6 +2360,7 @@ class Adherent extends CommonObject
|
||||
'id' => $this->id,
|
||||
'objecttype' => $this->element,
|
||||
'option' => $option,
|
||||
'nofetch' => 1,
|
||||
];
|
||||
if (getDolGlobalInt('MAIN_ENABLE_AJAX_TOOLTIP')) {
|
||||
$classfortooltip = 'classforajaxtooltip';
|
||||
|
||||
@ -461,7 +461,7 @@ class Documents extends DolibarrApi
|
||||
} elseif ($modulepart == 'knowledgemanagement') {
|
||||
require_once DOL_DOCUMENT_ROOT.'/knowledgemanagement/class/knowledgerecord.class.php';
|
||||
|
||||
if (!DolibarrApiAccess::$user->rights->knowledgemanagement->knowledgerecord->read && !DolibarrApiAccess::$user->rights->knowledgemanagement->knowledgerecord->read) {
|
||||
if (!DolibarrApiAccess::$user->hasRight('knowledgemanagement', 'knowledgerecord', 'read') && !DolibarrApiAccess::$user->hasRight('knowledgemanagement', 'knowledgerecord', 'read')) {
|
||||
throw new RestException(401);
|
||||
}
|
||||
|
||||
|
||||
@ -323,7 +323,7 @@ class Categories extends DolibarrApi
|
||||
throw new RestException(401);
|
||||
} elseif ($type == Categorie::TYPE_PROJECT && !DolibarrApiAccess::$user->rights->projet->lire) {
|
||||
throw new RestException(401);
|
||||
} elseif ($type == Categorie::TYPE_KNOWLEDGEMANAGEMENT && !DolibarrApiAccess::$user->rights->knowledgemanagement->knowledgerecord->read) {
|
||||
} elseif ($type == Categorie::TYPE_KNOWLEDGEMANAGEMENT && !DolibarrApiAccess::$user->hasRight('knowledgemanagement', 'knowledgerecord', 'read')) {
|
||||
throw new RestException(401);
|
||||
}
|
||||
|
||||
|
||||
@ -1580,6 +1580,7 @@ class ActionComm extends CommonObject
|
||||
$langs->load('agenda');
|
||||
$datas = [];
|
||||
|
||||
$nofetch = empty($params['nofetch']) ? false : true;
|
||||
// Set label of type
|
||||
$labeltype = '';
|
||||
if ($this->type_code) {
|
||||
@ -1631,6 +1632,12 @@ class ActionComm extends CommonObject
|
||||
$datas['note'] .= (dol_textishtml($texttoshow) ? str_replace(array("\r", "\n"), "", $texttoshow) : str_replace(array("\r", "\n"), '<br>', $texttoshow));
|
||||
$datas['note'] .= '</div>';
|
||||
}
|
||||
// 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'] = '<br>' . $form->showCategories($this->id, Categorie::TYPE_ACTIONCOMM, 1);
|
||||
}
|
||||
|
||||
return $datas;
|
||||
}
|
||||
@ -1734,6 +1741,7 @@ class ActionComm extends CommonObject
|
||||
'id' => $this->id,
|
||||
'objecttype' => $this->element,
|
||||
'option' => $option,
|
||||
'nofetch' => 1,
|
||||
];
|
||||
$classfortooltip = 'classforajaxtooltip';
|
||||
$dataparams = ' data-params='.json_encode($params);
|
||||
|
||||
@ -736,9 +736,9 @@ if ($action == 'create') {
|
||||
|
||||
print '<tr><td class="fieldrequired titlefieldcreate">'.$langs->trans("MailTitle").'</td><td><input class="flat minwidth300" name="title" value="'.dol_escape_htmltag(GETPOST('title')).'" autofocus="autofocus"></td></tr>';
|
||||
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans("MailFrom").'</td><td><input class="flat minwidth200" name="from" value="'.$conf->global->MAILING_EMAIL_FROM.'"></td></tr>';
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans("MailFrom").'</td><td><input class="flat minwidth200" name="from" value="'.getDolGlobalString('MAILING_EMAIL_FROM').'"></td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("MailErrorsTo").'</td><td><input class="flat minwidth200" name="errorsto" value="'.(!empty($conf->global->MAILING_EMAIL_ERRORSTO) ? $conf->global->MAILING_EMAIL_ERRORSTO : $conf->global->MAIN_MAIL_ERRORS_TO).'"></td></tr>';
|
||||
print '<tr><td>'.$langs->trans("MailErrorsTo").'</td><td><input class="flat minwidth200" name="errorsto" value="'.(getDolGlobalString('MAILING_EMAIL_ERRORSTO', getDolGlobalString('MAIN_MAIL_ERRORS_TO'))).'"></td></tr>';
|
||||
|
||||
// Other attributes
|
||||
$parameters = array();
|
||||
|
||||
@ -1417,6 +1417,7 @@ class Account extends CommonObject
|
||||
|
||||
$datas = [];
|
||||
|
||||
$nofetch = empty($params['nofetch']) ? false : true;
|
||||
$pictos = img_picto('', $this->picto).' <u class="paddingrightnow">'.$langs->trans("BankAccount").'</u>';
|
||||
if (isset($this->status)) {
|
||||
$pictos .= ' '.$this->getLibStatut(5);
|
||||
@ -1434,6 +1435,12 @@ class Account extends CommonObject
|
||||
$datas['accountaccounting'] = '<br><b>'.$langs->trans('AccountAccounting').':</b> '.length_accountg($this->account_number);
|
||||
$datas['accountancyjournal'] = '<br><b>'.$langs->trans('AccountancyJournal').':</b> '.$this->accountancy_journal;
|
||||
}
|
||||
// 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'] = '<br>' . $form->showCategories($this->id, Categorie::TYPE_ACCOUNT, 1);
|
||||
}
|
||||
|
||||
return $datas;
|
||||
}
|
||||
@ -1454,38 +1461,20 @@ class Account extends CommonObject
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/bank.lib.php';
|
||||
|
||||
$result = '';
|
||||
$label = img_picto('', $this->picto).' <u class="paddingrightnow">'.$langs->trans("BankAccount").'</u>';
|
||||
if (isset($this->status)) {
|
||||
$label .= ' '.$this->getLibStatut(5);
|
||||
}
|
||||
$label .= '<br><b>'.$langs->trans('Label').':</b> '.$this->label;
|
||||
$label .= '<br><b>'.$langs->trans('AccountNumber').':</b> '.$this->number;
|
||||
$label .= '<br><b>'.$langs->trans('IBAN').':</b> '.getIbanHumanReadable($this);
|
||||
$label .= '<br><b>'.$langs->trans('BIC').':</b> '.$this->bic;
|
||||
$label .= '<br><b>'.$langs->trans("AccountCurrency").':</b> '.$this->currency_code;
|
||||
|
||||
if (empty($user->rights->banque->lire) || !empty($user->socid)) {
|
||||
$option = 'nolink';
|
||||
}
|
||||
|
||||
if (isModEnabled('accounting')) {
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
|
||||
$langs->load("accountancy");
|
||||
$label .= '<br><b>'.$langs->trans('AccountAccounting').':</b> '.length_accountg($this->account_number);
|
||||
$label .= '<br><b>'.$langs->trans('AccountancyJournal').':</b> '.$this->accountancy_journal;
|
||||
}
|
||||
$classfortooltip = 'classfortooltip';
|
||||
$dataparams = '';
|
||||
$params = [
|
||||
'id' => $this->id,
|
||||
'objecttype' => $this->element,
|
||||
'option' => $option,
|
||||
'nofetch' => 1,
|
||||
];
|
||||
if (getDolGlobalInt('MAIN_ENABLE_AJAX_TOOLTIP')) {
|
||||
$params = [
|
||||
'id' => $this->id,
|
||||
'objecttype' => $this->element,
|
||||
'option' => $option,
|
||||
];
|
||||
$classfortooltip = 'classforajaxtooltip';
|
||||
$dataparams = ' data-params='.json_encode($params);
|
||||
$label = $langs->trans('Loading');
|
||||
}
|
||||
$label = implode($this->getTooltipContentArray($params));
|
||||
|
||||
$linkclose = '"'.$dataparams.' title="'.dol_escape_htmltag($label, 1).'" class="'.$classfortooltip.'">';
|
||||
|
||||
$url = DOL_URL_ROOT.'/compta/bank/card.php?id='.$this->id;
|
||||
@ -1871,7 +1860,7 @@ class Account extends CommonObject
|
||||
/**
|
||||
* Class to manage bank transaction lines
|
||||
*/
|
||||
class AccountLine extends CommonObject
|
||||
class AccountLine extends CommonObjectLine
|
||||
{
|
||||
/**
|
||||
* @var string Error code (or message)
|
||||
|
||||
@ -778,7 +778,7 @@ class Invoices extends DolibarrApi
|
||||
*
|
||||
* @url POST {id}/contacts
|
||||
*
|
||||
* @return array
|
||||
* @return object
|
||||
*
|
||||
* @throws RestException 304
|
||||
* @throws RestException 401
|
||||
|
||||
@ -163,6 +163,10 @@ if ($objecttype == 'facture' || $objecttype == 'invoice') {
|
||||
$classpath = 'opensurvey/class';
|
||||
$module = 'opensurvey';
|
||||
$myobject = 'opensurveysondage';
|
||||
} elseif ($objecttype == 'knowledgerecord') {
|
||||
$classpath = 'knowledgemanagement/class';
|
||||
$module = 'knowledgemanagement';
|
||||
$myobject = 'knowledgerecord';
|
||||
}
|
||||
|
||||
// Generic case for $classfile and $classname
|
||||
|
||||
@ -48,7 +48,6 @@ $element = GETPOST('element', 'alpha');
|
||||
|
||||
$upload_handler = new FileUpload(null, $fk_element, $element);
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
|
||||
217
htdocs/core/boxes/box_last_knowledgerecord.php
Normal file
217
htdocs/core/boxes/box_last_knowledgerecord.php
Normal file
@ -0,0 +1,217 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright (C) 2013-2016 Jean-François FERRY <hello@librethic.io>
|
||||
* Copyright (C) 2016 Christophe Battarel <christophe@altairis.fr>
|
||||
* Copyright (C) 2018-2023 Frédéric France <frederic.france@netlogic.fr>
|
||||
*
|
||||
* 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
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/core/boxes/box_last_knowledgerecord.php
|
||||
* \ingroup knowledgerecord
|
||||
* \brief This box shows latest created knowledgerecords
|
||||
*/
|
||||
require_once DOL_DOCUMENT_ROOT."/core/boxes/modules_boxes.php";
|
||||
|
||||
/**
|
||||
* Class to manage the box
|
||||
*/
|
||||
class box_last_knowledgerecord extends ModeleBoxes
|
||||
{
|
||||
/**
|
||||
* @var string boxcode
|
||||
*/
|
||||
public $boxcode = "box_last_knowledgerecord";
|
||||
|
||||
/**
|
||||
* @var string box img
|
||||
*/
|
||||
public $boximg = "knowledgemanagement";
|
||||
|
||||
/**
|
||||
* @var string boc label
|
||||
*/
|
||||
public $boxlabel;
|
||||
|
||||
/**
|
||||
* @var array box dependancies
|
||||
*/
|
||||
public $depends = array("knowledgemanagement");
|
||||
|
||||
/**
|
||||
* @var DoliDB Database handler.
|
||||
*/
|
||||
public $db;
|
||||
|
||||
/**
|
||||
* @var string param
|
||||
*/
|
||||
public $param;
|
||||
|
||||
/**
|
||||
* @var array box info heads
|
||||
*/
|
||||
public $info_box_head = array();
|
||||
|
||||
/**
|
||||
* @var array box info content
|
||||
*/
|
||||
public $info_box_contents = array();
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
* @param DoliDB $db Database handler
|
||||
* @param string $param More parameters
|
||||
*/
|
||||
public function __construct($db, $param = '')
|
||||
{
|
||||
global $langs;
|
||||
$langs->load("boxes", "languages");
|
||||
$this->db = $db;
|
||||
|
||||
$this->boxlabel = $langs->transnoentitiesnoconv("BoxLastKnowledgerecord");
|
||||
}
|
||||
|
||||
/**
|
||||
* Load data into info_box_contents array to show array later.
|
||||
*
|
||||
* @param int $max Maximum number of records to load
|
||||
* @return void
|
||||
*/
|
||||
public function loadBox($max = 5)
|
||||
{
|
||||
global $user, $langs;
|
||||
|
||||
$this->max = $max;
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT."/knowledgemanagement/class/knowledgerecord.class.php";
|
||||
|
||||
$text = $langs->trans("BoxLastKnowledgerecordDescription", $max);
|
||||
$this->info_box_head = array(
|
||||
'text' => $text,
|
||||
'limit' => dol_strlen($text),
|
||||
);
|
||||
|
||||
$this->info_box_contents[0][0] = array(
|
||||
'td' => 'class="left"',
|
||||
'text' => $langs->trans("BoxLastKnowledgerecordContent"),
|
||||
);
|
||||
|
||||
if ($user->hasRight('knowledgemanagement', 'knowledgerecord', 'read')) {
|
||||
$sql = 'SELECT k.rowid as id, k.date_creation, k.ref, k.lang, k.question, k.status as status';
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."knowledgemanagement_knowledgerecord as k";
|
||||
$sql .= " WHERE k.entity IN (".getEntity('knowledgemanagement').")";
|
||||
|
||||
if ($user->socid) {
|
||||
$sql .= " AND k.fk_soc= ".((int) $user->socid);
|
||||
}
|
||||
|
||||
$sql.= " AND k.status > 0";
|
||||
|
||||
$sql .= " ORDER BY k.date_creation DESC, k.rowid DESC ";
|
||||
$sql .= $this->db->plimit($max, 0);
|
||||
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql) {
|
||||
$num = $this->db->num_rows($resql);
|
||||
|
||||
$i = 0;
|
||||
|
||||
while ($i < $num) {
|
||||
$objp = $this->db->fetch_object($resql);
|
||||
|
||||
$datec = $this->db->jdate($objp->date_creation);
|
||||
|
||||
$knowledgerecord = new KnowledgeRecord($this->db);
|
||||
$knowledgerecord->id = $objp->id;
|
||||
$knowledgerecord->date_creation = $objp->date_creation;
|
||||
$knowledgerecord->ref = $objp->ref;
|
||||
$knowledgerecord->status = $objp->status;
|
||||
$knowledgerecord->question = $objp->question;
|
||||
|
||||
$r = 0;
|
||||
|
||||
// Ticket
|
||||
$this->info_box_contents[$i][$r] = array(
|
||||
'td' => 'class="nowraponall"',
|
||||
'text' => $knowledgerecord->getNomUrl(1),
|
||||
'asis' => 1
|
||||
);
|
||||
$r++;
|
||||
|
||||
// Question
|
||||
$this->info_box_contents[$i][$r] = array(
|
||||
'td' => 'class="tdoverflowmax200"',
|
||||
'text' => '<span title="'.dol_escape_htmltag($objp->question).'">'.dol_escape_htmltag($objp->question).'</span>',
|
||||
'url' => DOL_URL_ROOT."/knowledgemanagement/knowledgerecord_card.php?id=".urlencode($objp->id),
|
||||
);
|
||||
$r++;
|
||||
|
||||
// Language
|
||||
$labellang = ($objp->lang ? $langs->trans('Language_'.$objp->lang) : '');
|
||||
$this->info_box_contents[$i][$r] = array(
|
||||
'td' => 'class="tdoverflowmax100"',
|
||||
'text' => picto_from_langcode($objp->lang, 'class="paddingrightonly saturatemedium opacitylow"') . $labellang,
|
||||
'asis' => 1,
|
||||
);
|
||||
$r++;
|
||||
|
||||
// Date creation
|
||||
$this->info_box_contents[$i][$r] = array(
|
||||
'td' => 'class="center nowraponall" title="'.dol_escape_htmltag($langs->trans("DateCreation").': '.dol_print_date($datec, 'dayhour', 'tzuserrel')).'"',
|
||||
'text' => dol_print_date($datec, 'dayhour', 'tzuserrel'),
|
||||
);
|
||||
$r++;
|
||||
|
||||
// Statut
|
||||
$this->info_box_contents[$i][$r] = array(
|
||||
'td' => 'class="right nowraponall"',
|
||||
'text' => $knowledgerecord->getLibStatut(3),
|
||||
);
|
||||
$r++;
|
||||
|
||||
$i++;
|
||||
}
|
||||
|
||||
if ($num == 0) {
|
||||
$this->info_box_contents[$i][0] = array(
|
||||
'td' => '',
|
||||
'text' => '<span class="opacitymedium">'.$langs->trans("BoxLastTicketNoRecordedTickets").'</span>',
|
||||
);
|
||||
}
|
||||
} else {
|
||||
dol_print_error($this->db);
|
||||
}
|
||||
} else {
|
||||
$this->info_box_contents[0][0] = array(
|
||||
'td' => '',
|
||||
'text' => '<span class="opacitymedium">'.$langs->trans("ReadPermissionNotAllowed").'</span>',
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to show box
|
||||
*
|
||||
* @param array $head Array with properties of box title
|
||||
* @param array $contents Array with properties of box lines
|
||||
* @param int $nooutput No print, only return string
|
||||
* @return string
|
||||
*/
|
||||
public function showBox($head = null, $contents = null, $nooutput = 0)
|
||||
{
|
||||
return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput);
|
||||
}
|
||||
}
|
||||
217
htdocs/core/boxes/box_last_modified_knowledgerecord.php
Normal file
217
htdocs/core/boxes/box_last_modified_knowledgerecord.php
Normal file
@ -0,0 +1,217 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright (C) 2013-2016 Jean-François FERRY <hello@librethic.io>
|
||||
* Copyright (C) 2016 Christophe Battarel <christophe@altairis.fr>
|
||||
* Copyright (C) 2018-2023 Frédéric France <frederic.france@netlogic.fr>
|
||||
*
|
||||
* 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
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/core/boxes/box_last_modified_knowledgerecord.php
|
||||
* \ingroup knowledgerecord
|
||||
* \brief This box shows latest created knowledgerecords
|
||||
*/
|
||||
require_once DOL_DOCUMENT_ROOT."/core/boxes/modules_boxes.php";
|
||||
|
||||
/**
|
||||
* Class to manage the box
|
||||
*/
|
||||
class box_last_modified_knowledgerecord extends ModeleBoxes
|
||||
{
|
||||
/**
|
||||
* @var string boxcode
|
||||
*/
|
||||
public $boxcode = "box_last_modified_knowledgerecord";
|
||||
|
||||
/**
|
||||
* @var string box img
|
||||
*/
|
||||
public $boximg = "knowledgemanagement";
|
||||
|
||||
/**
|
||||
* @var string boc label
|
||||
*/
|
||||
public $boxlabel;
|
||||
|
||||
/**
|
||||
* @var array box dependancies
|
||||
*/
|
||||
public $depends = array("knowledgemanagement");
|
||||
|
||||
/**
|
||||
* @var DoliDB Database handler.
|
||||
*/
|
||||
public $db;
|
||||
|
||||
/**
|
||||
* @var string param
|
||||
*/
|
||||
public $param;
|
||||
|
||||
/**
|
||||
* @var array box info heads
|
||||
*/
|
||||
public $info_box_head = array();
|
||||
|
||||
/**
|
||||
* @var array box info content
|
||||
*/
|
||||
public $info_box_contents = array();
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
* @param DoliDB $db Database handler
|
||||
* @param string $param More parameters
|
||||
*/
|
||||
public function __construct($db, $param = '')
|
||||
{
|
||||
global $langs;
|
||||
$langs->load("boxes", "knowledgemanagement", "languages");
|
||||
$this->db = $db;
|
||||
|
||||
$this->boxlabel = $langs->transnoentitiesnoconv("BoxLastModifiedKnowledgerecord");
|
||||
}
|
||||
|
||||
/**
|
||||
* Load data into info_box_contents array to show array later.
|
||||
*
|
||||
* @param int $max Maximum number of records to load
|
||||
* @return void
|
||||
*/
|
||||
public function loadBox($max = 5)
|
||||
{
|
||||
global $user, $langs;
|
||||
|
||||
$this->max = $max;
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT."/knowledgemanagement/class/knowledgerecord.class.php";
|
||||
|
||||
$text = $langs->trans("BoxLastModifiedKnowledgerecordDescription", $max);
|
||||
$this->info_box_head = array(
|
||||
'text' => $text,
|
||||
'limit' => dol_strlen($text),
|
||||
);
|
||||
|
||||
$this->info_box_contents[0][0] = array(
|
||||
'td' => 'class="left"',
|
||||
'text' => $langs->trans("BoxLastKnowledgerecordContent"),
|
||||
);
|
||||
|
||||
if ($user->hasRight('knowledgemanagement', 'knowledgerecord', 'read')) {
|
||||
$sql = 'SELECT k.rowid as id, k.date_creation, k.ref, k.lang, k.question, k.status as status';
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."knowledgemanagement_knowledgerecord as k";
|
||||
$sql .= " WHERE k.entity IN (".getEntity('knowledgemanagement').")";
|
||||
|
||||
if ($user->socid) {
|
||||
$sql .= " AND k.fk_soc= ".((int) $user->socid);
|
||||
}
|
||||
|
||||
$sql.= " AND k.status > 0";
|
||||
|
||||
$sql .= " ORDER BY k.tms DESC, k.rowid DESC ";
|
||||
$sql .= $this->db->plimit($max, 0);
|
||||
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql) {
|
||||
$num = $this->db->num_rows($resql);
|
||||
|
||||
$i = 0;
|
||||
|
||||
while ($i < $num) {
|
||||
$objp = $this->db->fetch_object($resql);
|
||||
|
||||
$datec = $this->db->jdate($objp->date_creation);
|
||||
|
||||
$knowledgerecord = new KnowledgeRecord($this->db);
|
||||
$knowledgerecord->id = $objp->id;
|
||||
$knowledgerecord->date_creation = $objp->date_creation;
|
||||
$knowledgerecord->ref = $objp->ref;
|
||||
$knowledgerecord->status = $objp->status;
|
||||
$knowledgerecord->question = $objp->question;
|
||||
|
||||
$r = 0;
|
||||
|
||||
// Ticket
|
||||
$this->info_box_contents[$i][$r] = array(
|
||||
'td' => 'class="nowraponall"',
|
||||
'text' => $knowledgerecord->getNomUrl(1),
|
||||
'asis' => 1
|
||||
);
|
||||
$r++;
|
||||
|
||||
// Question
|
||||
$this->info_box_contents[$i][$r] = array(
|
||||
'td' => 'class="tdoverflowmax200"',
|
||||
'text' => '<span title="'.dol_escape_htmltag($objp->question).'">'.dol_escape_htmltag($objp->question).'</span>',
|
||||
'url' => DOL_URL_ROOT."/knowledgemanagement/knowledgerecord_card.php?id=".urlencode($objp->id),
|
||||
);
|
||||
$r++;
|
||||
|
||||
// Language
|
||||
$labellang = ($objp->lang ? $langs->trans('Language_'.$objp->lang) : '');
|
||||
$this->info_box_contents[$i][$r] = array(
|
||||
'td' => 'class="tdoverflowmax100"',
|
||||
'text' => picto_from_langcode($objp->lang, 'class="paddingrightonly saturatemedium opacitylow"') . $labellang,
|
||||
'asis' => 1,
|
||||
);
|
||||
$r++;
|
||||
|
||||
// Date creation
|
||||
$this->info_box_contents[$i][$r] = array(
|
||||
'td' => 'class="center nowraponall" title="'.dol_escape_htmltag($langs->trans("DateCreation").': '.dol_print_date($datec, 'dayhour', 'tzuserrel')).'"',
|
||||
'text' => dol_print_date($datec, 'dayhour', 'tzuserrel'),
|
||||
);
|
||||
$r++;
|
||||
|
||||
// Statut
|
||||
$this->info_box_contents[$i][$r] = array(
|
||||
'td' => 'class="right nowraponall"',
|
||||
'text' => $knowledgerecord->getLibStatut(3),
|
||||
);
|
||||
$r++;
|
||||
|
||||
$i++;
|
||||
}
|
||||
|
||||
if ($num == 0) {
|
||||
$this->info_box_contents[$i][0] = array(
|
||||
'td' => '',
|
||||
'text' => '<span class="opacitymedium">'.$langs->trans("BoxLastTicketNoRecordedTickets").'</span>',
|
||||
);
|
||||
}
|
||||
} else {
|
||||
dol_print_error($this->db);
|
||||
}
|
||||
} else {
|
||||
$this->info_box_contents[0][0] = array(
|
||||
'td' => '',
|
||||
'text' => '<span class="opacitymedium">'.$langs->trans("ReadPermissionNotAllowed").'</span>',
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to show box
|
||||
*
|
||||
* @param array $head Array with properties of box title
|
||||
* @param array $contents Array with properties of box lines
|
||||
* @param int $nooutput No print, only return string
|
||||
* @return string
|
||||
*/
|
||||
public function showBox($head = null, $contents = null, $nooutput = 0)
|
||||
{
|
||||
return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput);
|
||||
}
|
||||
}
|
||||
@ -191,7 +191,7 @@ class box_members_subscriptions_by_year extends ModeleBoxes
|
||||
|
||||
if ($num == 0) {
|
||||
$this->info_box_contents[$line][0] = array(
|
||||
'td' => 'class="center"',
|
||||
'td' => 'class="left" colspan="4"',
|
||||
'text' => $langs->trans("NoRecordedMembers"),
|
||||
);
|
||||
} else {
|
||||
|
||||
@ -935,7 +935,7 @@ class dolReceiptPrinter extends Printer
|
||||
* Function Init Printer
|
||||
*
|
||||
* @param int $printerid Printer id
|
||||
* @return int 0 if OK; >0 if KO
|
||||
* @return void|int 0 if OK; >0 if KO
|
||||
*/
|
||||
public function initPrinter($printerid)
|
||||
{
|
||||
|
||||
@ -2114,7 +2114,7 @@ class ExtraFields
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
if (empty($visibility)) {
|
||||
if (empty($visibility) || $visibility == 5) {
|
||||
continue;
|
||||
}
|
||||
if (empty($perms)) {
|
||||
|
||||
@ -484,7 +484,7 @@ class FileUpload
|
||||
/**
|
||||
* Output data
|
||||
*
|
||||
* @return void
|
||||
* @return string|void
|
||||
*/
|
||||
public function post()
|
||||
{
|
||||
|
||||
@ -77,7 +77,7 @@ class HookManager
|
||||
* Then when a hook executeHooks('aMethod'...) is called, the method aMethod found into class will be executed.
|
||||
*
|
||||
* @param string[] $arraycontext Array list of searched hooks tab/features. For example: 'thirdpartycard' (for hook methods into page card thirdparty), 'thirdpartydao' (for hook methods into Societe), ...
|
||||
* @return int Always 1
|
||||
* @return int|void Always 1
|
||||
*/
|
||||
public function initHooks($arraycontext)
|
||||
{
|
||||
@ -167,32 +167,31 @@ class HookManager
|
||||
// TODO Remove hooks with type 'output' (exemple createFrom). All hooks must be converted into 'addreplace' hooks.
|
||||
if (in_array($method, array(
|
||||
'createFrom',
|
||||
'dashboardMembers',
|
||||
'dashboardEmailings',
|
||||
'dashboardPropals',
|
||||
'dashboardPropals',
|
||||
'dashboardCommercials',
|
||||
'dashboardOrders',
|
||||
'dashboardSpecialBills',
|
||||
'dashboardAccountancy',
|
||||
'dashboardActivities',
|
||||
'dashboardCommercials',
|
||||
'dashboardContracts',
|
||||
'dashboardDonation',
|
||||
'dashboardWarehouseSendings',
|
||||
'dashboardEmailings',
|
||||
'dashboardExpenseReport',
|
||||
'dashboardInterventions',
|
||||
'dashboardOrdersSuppliers',
|
||||
'dashboardHRM',
|
||||
'dashboardInterventions',
|
||||
'dashboardMRP',
|
||||
'dashboardMembers',
|
||||
'dashboardOpensurvey',
|
||||
'dashboardWarehouse',
|
||||
'dashboardOrders',
|
||||
'dashboardOrdersSuppliers',
|
||||
'dashboardProductServices',
|
||||
'dashboardActivities',
|
||||
'dashboardProjects',
|
||||
'dashboardWarehouseReceptions',
|
||||
'dashboardThirdparties',
|
||||
'dashboardPropals',
|
||||
'dashboardSpecialBills',
|
||||
'dashboardSupplierProposal',
|
||||
'dashboardThirdparties',
|
||||
'dashboardTickets',
|
||||
'dashboardUsersGroups',
|
||||
'dashboardWarehouse',
|
||||
'dashboardWarehouseReceptions',
|
||||
'dashboardWarehouseSendings',
|
||||
'insertExtraHeader',
|
||||
'insertExtraFooter',
|
||||
'printLeftBlock',
|
||||
|
||||
@ -916,7 +916,7 @@ class pdf_standard_asset extends ModelePDFAsset
|
||||
* @param int $showaddress 0=no, 1=yes
|
||||
* @param Translate $outputlangs Object lang for output
|
||||
* @param Translate $outputlangsbis Object lang for output bis
|
||||
* @return void
|
||||
* @return float
|
||||
*/
|
||||
protected function _pagehead(&$pdf, $object, $showaddress, $outputlangs, $outputlangsbis = null)
|
||||
{
|
||||
|
||||
@ -478,7 +478,7 @@ class pdf_sepamandate extends ModeleBankAccountDoc
|
||||
* @param CompanyBankAccount $object Object to show
|
||||
* @param int $posy Y
|
||||
* @param Translate $outputlangs Langs object
|
||||
* @return void
|
||||
* @return float
|
||||
*/
|
||||
protected function _tableau_info(&$pdf, $object, $posy, $outputlangs)
|
||||
{
|
||||
|
||||
@ -401,7 +401,7 @@ class BordereauChequeBlochet extends ModeleChequeReceipts
|
||||
* @param Object $object Object to show
|
||||
* @param Translate $outputlangs Object lang for output
|
||||
* @param int $hidefreetext 1=Hide free text
|
||||
* @return void
|
||||
* @return mixed
|
||||
*/
|
||||
protected function _pagefoot(&$pdf, $object, $outputlangs, $hidefreetext = 0)
|
||||
{
|
||||
|
||||
@ -2057,7 +2057,7 @@ class pdf_sponge extends ModelePDFFactures
|
||||
* @param int $showaddress 0=no, 1=yes (usually set to 1 for first page, and 0 for next pages)
|
||||
* @param Translate $outputlangs Object lang for output
|
||||
* @param Translate $outputlangsbis Object lang for output bis
|
||||
* @return int top shift of linked object lines
|
||||
* @return array top shift of linked object lines
|
||||
*/
|
||||
protected function _pagehead(&$pdf, $object, $showaddress, $outputlangs, $outputlangsbis = null)
|
||||
{
|
||||
|
||||
@ -238,7 +238,7 @@ class ImportCsv extends ModeleImports
|
||||
/**
|
||||
* Return array of next record in input file.
|
||||
*
|
||||
* @return Array Array of field values. Data are UTF8 encoded. [fieldpos] => (['val']=>val, ['type']=>-1=null,0=blank,1=not empty string)
|
||||
* @return array|boolean Array of field values. Data are UTF8 encoded. [fieldpos] => (['val']=>val, ['type']=>-1=null,0=blank,1=not empty string)
|
||||
*/
|
||||
public function import_read_record()
|
||||
{
|
||||
|
||||
@ -304,7 +304,7 @@ class ImportXlsx extends ModeleImports
|
||||
/**
|
||||
* Return array of next record in input file.
|
||||
*
|
||||
* @return Array Array of field values. Data are UTF8 encoded. [fieldpos] => (['val']=>val, ['type']=>-1=null,0=blank,1=not empty string)
|
||||
* @return array|boolean Array of field values. Data are UTF8 encoded. [fieldpos] => (['val']=>val, ['type']=>-1=null,0=blank,1=not empty string)
|
||||
*/
|
||||
public function import_read_record()
|
||||
{
|
||||
|
||||
@ -201,12 +201,14 @@ class modKnowledgeManagement extends DolibarrModules
|
||||
// Boxes/Widgets
|
||||
// Add here list of php file(s) stored in knowledgemanagement/core/boxes that contains a class to show a widget.
|
||||
$this->boxes = array(
|
||||
// 0 => array(
|
||||
// 'file' => 'knowledgemanagementwidget1.php@knowledgemanagement',
|
||||
// 'note' => 'Widget provided by KnowledgeManagement',
|
||||
// 'enabledbydefaulton' => 'Home',
|
||||
// ),
|
||||
// ...
|
||||
0 => array(
|
||||
'file' => 'box_last_knowledgerecord.php',
|
||||
'enabledbydefaulton' => 'ticketindex',
|
||||
),
|
||||
1 => array(
|
||||
'file' => 'box_last_modified_knowledgerecord.php',
|
||||
'enabledbydefaulton' => 'ticketindex',
|
||||
),
|
||||
);
|
||||
|
||||
// Cronjobs (List of cron jobs entries to add when module is enabled)
|
||||
@ -271,7 +273,7 @@ class modKnowledgeManagement extends DolibarrModules
|
||||
'langs'=>'knowledgemanagement', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
|
||||
'position'=>1000 + $r,
|
||||
'enabled'=>'$conf->knowledgemanagement->enabled', // Define condition to show or hide menu entry. Use '$conf->knowledgemanagement->enabled' if entry must be visible if module is enabled.
|
||||
'perms'=>'1', // Use 'perms'=>'$user->rights->knowledgemanagement->knowledgerecord->read' if you want your menu with a permission rules
|
||||
'perms'=>'1', // Use 'perms'=>'$user->hasRight('knowledgemanagement', 'knowledgerecord', 'read')' if you want your menu with a permission rules
|
||||
'target'=>'',
|
||||
'user'=>2, // 0=Menu for internal users, 1=external users, 2=both
|
||||
);
|
||||
@ -334,7 +336,7 @@ class modKnowledgeManagement extends DolibarrModules
|
||||
// Define condition to show or hide menu entry. Use '$conf->knowledgemanagement->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected.
|
||||
'enabled'=>'$conf->knowledgemanagement->enabled',
|
||||
// Use 'perms'=>'$user->rights->knowledgemanagement->level1->level2' if you want your menu with a permission rules
|
||||
'perms'=>'$user->rights->knowledgemanagement->knowledgerecord->write',
|
||||
'perms'=>'$user->hasRight("knowledgemanagement", "knowledgerecord", "write")',
|
||||
'target'=>'',
|
||||
// 0=Menu for internal users, 1=external users, 2=both
|
||||
'user'=>2
|
||||
|
||||
@ -1067,7 +1067,7 @@ class pdf_vinci extends ModelePDFMo
|
||||
* @param CommandeFournisseur $object Object to show
|
||||
* @param int $showaddress 0=no, 1=yes
|
||||
* @param Translate $outputlangs Object lang for output
|
||||
* @return void
|
||||
* @return float|int
|
||||
*/
|
||||
protected function _pagehead(&$pdf, $object, $showaddress, $outputlangs)
|
||||
{
|
||||
|
||||
@ -191,7 +191,7 @@ abstract class ModeleProductCode
|
||||
*
|
||||
* @param DoliDB $dbs Database handler
|
||||
* @param integer $maxfilenamelength Max length of value to show
|
||||
* @return array List of numbers
|
||||
* @return array|int List of numbers
|
||||
*/
|
||||
public static function liste_modeles($dbs, $maxfilenamelength = 0)
|
||||
{
|
||||
|
||||
@ -1484,7 +1484,7 @@ class pdf_azur extends ModelePDFPropales
|
||||
* @param int $showaddress 0=no, 1=yes
|
||||
* @param Translate $outputlangs Object lang for output
|
||||
* @param Translate $outputlangsbis Object lang for output bis
|
||||
* @return void
|
||||
* @return int|float
|
||||
*/
|
||||
protected function _pagehead(&$pdf, $object, $showaddress, $outputlangs, $outputlangsbis = null)
|
||||
{
|
||||
|
||||
@ -1547,7 +1547,7 @@ class pdf_cyan extends ModelePDFPropales
|
||||
* @param int $showaddress 0=no, 1=yes
|
||||
* @param Translate $outputlangs Object lang for output
|
||||
* @param Translate $outputlangsbis Object lang for output bis
|
||||
* @return void
|
||||
* @return float|int
|
||||
*/
|
||||
protected function _pagehead(&$pdf, $object, $showaddress, $outputlangs, $outputlangsbis = null)
|
||||
{
|
||||
|
||||
@ -1223,7 +1223,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders
|
||||
* @param CommandeFournisseur $object Object to show
|
||||
* @param int $showaddress 0=no, 1=yes
|
||||
* @param Translate $outputlangs Object lang for output
|
||||
* @return void
|
||||
* @return float|int
|
||||
*/
|
||||
protected function _pagehead(&$pdf, $object, $showaddress, $outputlangs)
|
||||
{
|
||||
|
||||
@ -1130,7 +1130,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
||||
* @param CommandeFournisseur $object Object to show
|
||||
* @param int $showaddress 0=no, 1=yes
|
||||
* @param Translate $outputlangs Object lang for output
|
||||
* @return void
|
||||
* @return float|int
|
||||
*/
|
||||
protected function _pagehead(&$pdf, $object, $showaddress, $outputlangs)
|
||||
{
|
||||
|
||||
@ -1232,7 +1232,7 @@ class pdf_aurore extends ModelePDFSupplierProposal
|
||||
* @param Object $object Object to show
|
||||
* @param int $showaddress 0=no, 1=yes
|
||||
* @param Translate $outputlangs Object lang for output
|
||||
* @return void
|
||||
* @return float|int
|
||||
*/
|
||||
protected function _pagehead(&$pdf, $object, $showaddress, $outputlangs)
|
||||
{
|
||||
|
||||
@ -535,7 +535,7 @@ class PaiementFourn extends Paiement
|
||||
* Return list of supplier invoices the payment point to
|
||||
*
|
||||
* @param string $filter SQL filter. Warning: This value must not come from a user input.
|
||||
* @return array Array of supplier invoice id
|
||||
* @return array|int Array of supplier invoice id | <0 si ko
|
||||
*/
|
||||
public function getBillsArray($filter = '')
|
||||
{
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
* Copyright (C) 2013-2020 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2012-2016 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2018 Charlene Benke <charlie@patas-monkey.com>
|
||||
* Copyright (C) 2019-2022 Frédéric France <frederic.france@netlogic.fr>
|
||||
* Copyright (C) 2019-2023 Frédéric France <frederic.france@netlogic.fr>
|
||||
*
|
||||
* 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 '</td>';
|
||||
|
||||
@ -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 '<td class="liste_titre">';
|
||||
|
||||
@ -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');
|
||||
}
|
||||
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -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).' <u class="paddingrightonly">'.$langs->trans("KnowledgeRecord").'</u>';
|
||||
if (isset($this->statut)) {
|
||||
$datas['picto'] .= ' '.$this->getLibStatut(5);
|
||||
}
|
||||
$datas['label'] = '<br><b>'.$langs->trans('Ref').':</b> '.$this->ref;
|
||||
$datas['question'] = '<br><b>'.$langs->trans('Question').':</b> '.$this->question;
|
||||
$labellang = ($this->lang ? $langs->trans('Language_'.$this->lang) : '');
|
||||
$datas['lang'] = '<br><b>'.$langs->trans('Language').':</b> ' . 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'] = '<br>' . $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).' <u>'.$langs->trans("KnowledgeRecord").'</u>';
|
||||
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 .= '<br>';
|
||||
$label .= '<b>'.$langs->trans('Ref').':</b> '.$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) {
|
||||
|
||||
@ -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
|
||||
|
||||
|
||||
/*
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
|
||||
@ -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');
|
||||
|
||||
|
||||
/*
|
||||
|
||||
@ -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;
|
||||
|
||||
|
||||
@ -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");
|
||||
}
|
||||
|
||||
|
||||
@ -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();
|
||||
|
||||
@ -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" ?
|
||||
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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -15,6 +15,7 @@
|
||||
* Copyright (C) 2020 Charlene Benke <charlie@patas-monkey.com>
|
||||
* Copyright (C) 2021 Frédéric France <frederic.france@netlogic.fr>
|
||||
* Copyright (C) 2021 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2023 Joachim Küter <git-jk@bloxera.com>
|
||||
*
|
||||
* 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)) {
|
||||
|
||||
@ -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'] = '<br><b>'.$langs->trans('Label').':</b> '.$this->label;
|
||||
}
|
||||
if (isset($this->mrptype)) {
|
||||
$datas['type'] = '<br><b>'.$langs->trans('Type').':</b> '.$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
|
||||
|
||||
@ -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);
|
||||
|
||||
|
||||
@ -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();
|
||||
|
||||
@ -115,6 +115,11 @@ class Opensurveysondage extends CommonObject
|
||||
*/
|
||||
public $allow_spy;
|
||||
|
||||
/**
|
||||
* @var array fields
|
||||
*/
|
||||
public $fields = array();
|
||||
|
||||
|
||||
/**
|
||||
* Draft status (not used)
|
||||
|
||||
@ -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'] = '<br>' . $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 = '';
|
||||
|
||||
@ -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
|
||||
*/
|
||||
|
||||
@ -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'] = '<br><b>'.$langs->trans('SupplierAccountancyCode').':</b> '.$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'] = '<br>' . $form->showCategories($this->id, Categorie::TYPE_CUSTOMER, 1);
|
||||
}
|
||||
if ($this->fournisseur) {
|
||||
$datas['categories_supplier'] = '<br>' . $form->showCategories($this->id, Categorie::TYPE_SUPPLIER, 1);
|
||||
}
|
||||
}
|
||||
|
||||
$datas['divclose'] = '</div>';
|
||||
|
||||
@ -2789,6 +2801,7 @@ class Societe extends CommonObject
|
||||
'id' => $this->id,
|
||||
'objecttype' => $this->element,
|
||||
'option' => $option,
|
||||
'nofetch' => 1,
|
||||
];
|
||||
$classfortooltip = 'classfortooltip';
|
||||
$dataparams = '';
|
||||
|
||||
@ -1433,6 +1433,7 @@ class Ticket extends CommonObject
|
||||
|
||||
$langs->load('ticket');
|
||||
|
||||
$nofetch = empty($params['nofetch']) ? false : true;
|
||||
$datas = [];
|
||||
$datas['picto'] = img_picto('', $this->picto).' <u class="paddingrightonly">'.$langs->trans("Ticket").'</u>';
|
||||
$datas['picto'] .= ' '.$this->getLibStatut(4);
|
||||
@ -1440,10 +1441,16 @@ class Ticket extends CommonObject
|
||||
$datas['track_id'] = '<br><b>'.$langs->trans('TicketTrackId').':</b> '.$this->track_id;
|
||||
$datas['subject'] = '<br><b>'.$langs->trans('Subject').':</b> '.$this->subject;
|
||||
if ($this->date_creation) {
|
||||
$datas['date_creation'] = '<br><b>'.$langs->trans('DateCreation').':</b> '.$this->date_creation;
|
||||
$datas['date_creation'] = '<br><b>'.$langs->trans('DateCreation').':</b> '.dol_print_date($this->date_creation, 'dayhour');
|
||||
}
|
||||
if ($this->date_modification) {
|
||||
$datas['date_modification'] = '<br><b>'.$langs->trans('DateModification').':</b> '.$this->date_modification;
|
||||
$datas['date_modification'] = '<br><b>'.$langs->trans('DateModification').':</b> '.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'] = '<br>' . $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 = '';
|
||||
|
||||
@ -252,7 +252,7 @@ if ($id > 0 || !empty($track_id) || !empty($ref)) {
|
||||
|
||||
$linkback = '<a href="'.dol_buildpath('/ticket/list.php', 1).'"><strong>'.$langs->trans("BackToList").'</strong></a> ';
|
||||
|
||||
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();
|
||||
|
||||
|
||||
@ -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');
|
||||
}
|
||||
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user