2021-04-28 10:11:49 +02:00
< ? php
/* Copyright ( C ) 2017 Laurent Destailleur < eldy @ users . sourceforge . net >
2024-03-02 16:38:35 +01:00
* Copyright ( C ) 2024 Frédéric France < frederic . france @ free . fr >
2025-02-03 11:24:16 +01:00
* Copyright ( C ) 2024 - 2025 MDW < mdeweerd @ users . noreply . github . com >
2021-04-28 10:11:49 +02:00
*
* 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 />.
*/
/**
2021-06-06 21:35:39 +02:00
* \file htdocs / knowledgemanagement / class / knowledgerecord . class . php
2021-04-28 10:11:49 +02:00
* \ingroup knowledgemanagement
* \brief This file is a CRUD class file for KnowledgeRecord ( Create / Read / Update / Delete )
*/
// Put here all includes required by your class file
require_once DOL_DOCUMENT_ROOT . '/core/class/commonobject.class.php' ;
//require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php';
//require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
/**
* Class for KnowledgeRecord
*/
class KnowledgeRecord extends CommonObject
{
/**
* @ var string ID of module .
*/
public $module = 'knowledgemanagement' ;
/**
* @ var string ID to identify managed object .
*/
public $element = 'knowledgerecord' ;
/**
* @ var string Name of table without prefix where object is stored . This is also the key used for extrafields management .
*/
public $table_element = 'knowledgemanagement_knowledgerecord' ;
/**
* @ var string String with name of icon for knowledgerecord . Must be the part after the 'object_' into object_knowledgerecord . png
*/
2021-04-30 15:37:26 +02:00
public $picto = 'knowledgemanagement' ;
2021-04-28 10:11:49 +02:00
const STATUS_DRAFT = 0 ;
const STATUS_VALIDATED = 1 ;
const STATUS_CANCELED = 9 ;
/**
2021-09-07 14:10:26 +02:00
* 'type' field format ( 'integer' , 'integer:ObjectClass:PathToClass[:AddCreateButtonOrNot[:Filter[:SortField]]]' , 'sellist:TableName:LabelFieldName[:KeyFieldName[:KeyFieldParent[:Filter]]]' , 'varchar(x)' , 'double(24,8)' , 'real' , 'price' , 'text' , 'text:none' , 'html' , 'date' , 'datetime' , 'timestamp' , 'duration' , 'mail' , 'phone' , 'url' , 'password' )
2021-04-28 10:11:49 +02:00
* Note : Filter can be a string like " (t.ref:like:'SO-%') or (t.date_creation:<:'20160101') or (t.nature:is:NULL) "
* 'label' the translation key .
* 'picto' is code of a picto to show before value in forms
2024-03-22 00:37:56 +01:00
* 'enabled' is a condition when the field must be managed ( Example : 1 or 'getDolGlobalString("MY_SETUP_PARAM")'
2021-04-28 10:11:49 +02:00
* 'position' is the sort order of field .
* 'notnull' is set to 1 if not null in database . Set to - 1 if we must set data to null if empty ( '' or 0 ) .
* 'visible' says if field is visible in list ( Examples : 0 = Not visible , 1 = Visible on list and create / update / view forms , 2 = Visible on list only , 3 = Visible on create / update / view form only ( not list ), 4 = Visible on list and update / view form only ( not create ) . 5 = Visible on list and view only ( not create / not update ) . Using a negative value means field is not shown by default on list but can be selected for viewing )
* 'noteditable' says if field is not editable ( 1 or 0 )
* 'default' is a default value for creation ( can still be overwrote by the Setup of Default Values if field is editable in creation form ) . Note : If default is set to '(PROV)' and field is 'ref' , the default value will be set to '(PROVid)' where id is rowid when a new record is created .
* 'index' if we want an index in database .
2024-01-13 19:48:41 +01:00
* 'foreignkey' => 'tablename.field' if the field is a foreign key ( it is recommended to name the field fk_ ... ) .
2021-04-28 10:11:49 +02:00
* 'searchall' is 1 if we want to search in this field when making a search from the quick search button .
* 'isameasure' must be set to 1 if you want to have a total on list for this field . Field type must be summable like integer or double ( 24 , 8 ) .
* 'css' and 'cssview' and 'csslist' is the CSS style to use on field . 'css' is used in creation and update . 'cssview' is used in view mode . 'csslist' is used for columns in lists . For example : 'maxwidth200' , 'wordbreak' , 'tdoverflowmax200'
* 'help' is a 'TranslationString' to use to show a tooltip on field . You can also use 'TranslationString:keyfortooltiponlick' for a tooltip on click .
* 'showoncombobox' if value of the field must be visible into the label of the combobox that list record
* 'disabled' is 1 if we want to have the field locked by a 'disabled' attribute . In most cases , this is never set into the definition of $fields into class , but is set dynamically by some part of code .
* 'arraykeyval' to set list of value if type is a list of predefined values . For example : array ( " 0 " => " Draft " , " 1 " => " Active " , " -1 " => " Cancel " )
* 'autofocusoncreate' to have field having the focus on a create form . Only 1 field should have this property set to 1.
* 'comment' is not used . You can store here any text of your choice . It is not used by application .
2021-08-24 13:19:53 +02:00
* 'copytoclipboard' is 1 or 2 to allow to add a picto to copy value into clipboard ( 1 = picto after label , 2 = picto after value )
2021-04-28 10:11:49 +02:00
*
* 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
/**
2025-02-05 00:40:06 +01:00
* @ var array < string , array { type : string , label : string , enabled : int < 0 , 2 >| string , position : int , notnull ? : int , visible : int <- 6 , 6 >| string , alwayseditable ? : int < 0 , 1 > , noteditable ? : int < 0 , 1 > , default ? : string , index ? : int , foreignkey ? : string , searchall ? : int < 0 , 1 > , isameasure ? : int < 0 , 1 > , css ? : string , csslist ? : string , help ? : string , showoncombobox ? : int < 0 , 4 > , disabled ? : int < 0 , 1 > , arrayofkeyval ? : array < int | string , string > , autofocusoncreate ? : int < 0 , 1 > , comment ? : string , copytoclipboard ? : int < 1 , 2 > , validate ? : int < 0 , 1 > , showonheader ? : int < 0 , 1 > } > Array with all fields and their property . Do not use it as a static var . It may be modified by constructor .
2021-04-28 10:11:49 +02:00
*/
2024-03-11 12:55:55 +01:00
public $fields = array (
2024-03-15 00:31:25 +01:00
'rowid' => array ( 'type' => 'integer' , 'label' => 'TechnicalID' , 'enabled' => 1 , 'position' => 1 , 'notnull' => 1 , 'visible' => 0 , 'noteditable' => 1 , 'index' => 1 , 'css' => 'left' , 'comment' => " Id " ),
'ref' => array ( 'type' => 'varchar(128)' , 'label' => 'Ref' , 'enabled' => 1 , 'position' => 10 , 'notnull' => 1 , 'default' => '(PROV)' , 'visible' => 5 , 'index' => 1 , 'searchall' => 1 , 'comment' => " Reference of object " , " csslist " => " nowraponall " , " showoncombobox " => 1 ),
'entity' => array ( 'type' => 'integer' , 'label' => 'Entity' , 'default' => '1' , 'enabled' => 1 , 'visible' => 0 , 'notnull' => 1 , 'position' => 20 , 'index' => 1 ),
2024-05-09 18:15:57 +02:00
'question' => array ( 'type' => 'text' , 'label' => 'Question' , 'enabled' => 1 , 'position' => 30 , 'notnull' => 1 , 'visible' => 1 , 'searchall' => 1 , 'csslist' => 'tdoverflowmax300 small' , 'copytoclipboard' => 1 , 'tdcss' => 'titlefieldcreate nowraponall' ),
'lang' => array ( 'type' => 'varchar(6)' , 'label' => 'Language' , 'enabled' => 1 , 'position' => 40 , 'notnull' => 0 , 'visible' => 1 , 'tdcss' => 'titlefieldcreate nowraponall' , " csslist " => " minwidth100 maxwidth200 " ),
'date_creation' => array ( 'type' => 'datetime' , 'label' => 'DateCreation' , 'enabled' => 1 , 'position' => 500 , 'notnull' => 1 , 'visible' => - 2 , 'csslist' => 'nowraponall' ),
2024-03-15 00:31:25 +01:00
'tms' => array ( 'type' => 'timestamp' , 'label' => 'DateModification' , 'enabled' => 1 , 'position' => 501 , 'notnull' => 0 , 'visible' => 2 ,),
'last_main_doc' => array ( 'type' => 'varchar(255)' , 'label' => 'LastMainDoc' , 'enabled' => 1 , 'position' => 600 , 'notnull' => 0 , 'visible' => 0 ,),
'fk_user_creat' => array ( 'type' => 'integer:User:user/class/user.class.php' , 'label' => 'UserCreation' , 'enabled' => 1 , 'position' => 510 , 'notnull' => 1 , 'visible' => - 2 , 'foreignkey' => 'user.rowid' ,),
'fk_user_modif' => array ( 'type' => 'integer:User:user/class/user.class.php' , 'label' => 'UserModif' , 'enabled' => 1 , 'position' => 511 , 'notnull' => - 1 , 'visible' => - 2 ,),
'fk_user_valid' => array ( 'type' => 'integer:User:user/class/user.class.php' , 'label' => 'UserValidation' , 'enabled' => 1 , 'position' => 512 , 'notnull' => 0 , 'visible' => - 2 ,),
'import_key' => array ( 'type' => 'varchar(14)' , 'label' => 'ImportId' , 'enabled' => 1 , 'position' => 1000 , 'notnull' => - 1 , 'visible' => - 2 ,),
'model_pdf' => array ( 'type' => 'varchar(255)' , 'label' => 'Model pdf' , 'enabled' => 1 , 'position' => 1010 , 'notnull' => - 1 , 'visible' => 0 ,),
2021-06-16 22:49:26 +02:00
//'url' => array('type'=>'varchar(255)', 'label'=>'URL', 'enabled'=>'1', 'position'=>55, 'notnull'=>0, 'visible'=>-1, 'csslist'=>'tdoverflow200', 'help'=>'UrlForInfoPage'),
2024-03-11 12:55:55 +01:00
'fk_c_ticket_category' => array ( 'type' => 'integer:CTicketCategory:ticket/class/cticketcategory.class.php:0:(t.active:=:1):pos' , 'label' => 'SuggestedForTicketsInGroup' , 'enabled' => 'isModEnabled("ticket")' , 'position' => 520 , 'notnull' => 0 , 'visible' => - 1 , 'help' => 'YouCanLinkArticleToATicketCategory' , 'csslist' => 'minwidth200 tdoverflowmax250' ),
2024-03-15 00:31:25 +01:00
'answer' => array ( 'type' => 'html' , 'label' => 'Solution' , 'enabled' => 1 , 'position' => 600 , 'notnull' => 0 , 'visible' => 3 , 'searchall' => 1 , 'csslist' => 'tdoverflowmax300' , 'copytoclipboard' => 1 , 'tdcss' => 'titlefieldcreate nowraponall' ),
2024-12-05 00:06:24 +01:00
'status' => array ( 'type' => 'integer' , 'label' => 'Status' , 'enabled' => 1 , 'position' => 1000 , 'notnull' => 1 , 'visible' => 5 , 'default' => '0' , 'index' => 1 , 'arrayofkeyval' => array ( 0 => 'Draft' , 1 => 'Validated' , 9 => 'Obsolete' ),),
2021-04-28 10:11:49 +02:00
);
2024-10-03 19:40:34 +02:00
/**
* @ var int
*/
2021-04-28 10:11:49 +02:00
public $rowid ;
2024-10-03 19:40:34 +02:00
/**
* @ var string
*/
2021-04-28 10:11:49 +02:00
public $ref ;
2024-10-03 19:40:34 +02:00
/**
* @ var int
*/
2021-09-05 12:17:23 +02:00
public $entity ;
2024-10-03 19:40:34 +02:00
/**
* @ var string
*/
2021-04-28 10:11:49 +02:00
public $last_main_doc ;
2024-10-03 19:40:34 +02:00
/**
* @ var int
*/
2021-04-28 10:11:49 +02:00
public $fk_user_creat ;
2024-10-03 19:40:34 +02:00
/**
* @ var int
*/
2021-04-28 10:11:49 +02:00
public $fk_user_modif ;
2024-10-03 19:40:34 +02:00
/**
* @ var int
*/
2021-04-28 10:11:49 +02:00
public $fk_user_valid ;
2024-10-03 19:40:34 +02:00
/**
* @ var string
*/
2021-04-28 10:11:49 +02:00
public $import_key ;
2024-10-03 19:40:34 +02:00
/**
* @ var string
*/
2021-04-28 10:11:49 +02:00
public $model_pdf ;
2023-02-11 21:34:21 +01:00
/**
* @ var string question asked
*/
2021-04-28 10:11:49 +02:00
public $question ;
2023-02-11 21:34:21 +01:00
/**
* @ var string answer to question
*/
2021-04-28 10:11:49 +02:00
public $answer ;
2024-10-03 19:40:34 +02:00
/**
* @ var string
*/
2021-06-16 22:49:26 +02:00
public $url ;
2024-10-03 19:40:34 +02:00
/**
* @ var int
*/
2021-04-28 10:11:49 +02:00
public $status ;
2024-10-03 19:40:34 +02:00
/**
* @ var string
*/
2021-07-16 15:47:17 +02:00
public $lang ;
2021-04-28 10:11:49 +02:00
// END MODULEBUILDER PROPERTIES
// If this object has a subtable with lines
// /**
// * @var string Name of subtable line
// */
// public $table_element_line = 'knowledgemanagement_knowledgerecordline';
// /**
// * @var string Field with ID of parent key if this object has a parent
// */
// public $fk_element = 'fk_knowledgerecord';
// /**
// * @var string Name of subtable class that manage subtable lines
// */
// public $class_element_line = 'KnowledgeRecordline';
// /**
// * @var array List of child tables. To test if we can delete object.
// */
// protected $childtables = array();
// /**
// * @var array List of child tables. To know object to delete on cascade.
// * If name matches '@ClassNAme:FilePathClass;ParentFkFieldName' it will
// * call method deleteByParentField(parentId, ParentFkFieldName) to fetch and delete child object
// */
// protected $childtablesoncascade = array('knowledgemanagement_knowledgerecorddet');
// /**
// * @var KnowledgeRecordLine[] Array of subtable lines
// */
// public $lines = array();
/**
* Constructor
*
2024-01-13 15:50:02 +01:00
* @ param DoliDB $db Database handler
2021-04-28 10:11:49 +02:00
*/
public function __construct ( DoliDB $db )
{
2024-03-16 11:04:54 +01:00
global $langs ;
2021-04-28 10:11:49 +02:00
$this -> db = $db ;
2024-05-05 00:34:19 +02:00
$this -> ismultientitymanaged = 1 ;
$this -> isextrafieldmanaged = 1 ;
2023-11-27 11:56:32 +01:00
if ( ! getDolGlobalString ( 'MAIN_SHOW_TECHNICAL_ID' ) && isset ( $this -> fields [ 'rowid' ])) {
2021-04-28 10:11:49 +02:00
$this -> fields [ 'rowid' ][ 'visible' ] = 0 ;
}
2022-08-28 13:45:14 +02:00
if ( ! isModEnabled ( 'multicompany' ) && isset ( $this -> fields [ 'entity' ])) {
2021-04-28 10:11:49 +02:00
$this -> fields [ 'entity' ][ 'enabled' ] = 0 ;
}
// Unset fields that are disabled
foreach ( $this -> fields as $key => $val ) {
if ( isset ( $val [ 'enabled' ]) && empty ( $val [ 'enabled' ])) {
unset ( $this -> fields [ $key ]);
}
}
// Translate some data of arrayofkeyval
if ( is_object ( $langs )) {
foreach ( $this -> fields as $key => $val ) {
if ( ! empty ( $val [ 'arrayofkeyval' ]) && is_array ( $val [ 'arrayofkeyval' ])) {
foreach ( $val [ 'arrayofkeyval' ] as $key2 => $val2 ) {
$this -> fields [ $key ][ 'arrayofkeyval' ][ $key2 ] = $langs -> trans ( $val2 );
}
}
}
}
}
/**
* Create object into database
*
* @ param User $user User that creates
2024-01-12 17:47:54 +01:00
* @ param int $notrigger 0 = launch triggers after , 1 = disable triggers
2023-12-01 19:51:32 +01:00
* @ return int Return integer < 0 if KO , Id of created object if OK
2021-04-28 10:11:49 +02:00
*/
2024-01-12 17:47:54 +01:00
public function create ( User $user , $notrigger = 0 )
2021-04-28 10:11:49 +02:00
{
return $this -> createCommon ( $user , $notrigger );
}
/**
* Clone an object into another one
*
* @ param User $user User that creates
* @ param int $fromid Id of object to clone
* @ return mixed New object created , < 0 if KO
*/
public function createFromClone ( User $user , $fromid )
{
global $langs , $extrafields ;
$error = 0 ;
dol_syslog ( __METHOD__ , LOG_DEBUG );
$object = new self ( $this -> db );
$this -> db -> begin ();
// Load source object
$result = $object -> fetchCommon ( $fromid );
if ( $result > 0 && ! empty ( $object -> table_element_line )) {
$object -> fetchLines ();
}
// get lines so they will be clone
//foreach($this->lines as $line)
// $line->fetch_optionals();
// Reset some properties
unset ( $object -> id );
unset ( $object -> fk_user_creat );
unset ( $object -> import_key );
// Clear fields
if ( property_exists ( $object , 'ref' )) {
2024-08-21 13:23:35 +02:00
// @phan-suppress-next-line PhanTypeMismatchProperty
2021-04-28 10:11:49 +02:00
$object -> ref = empty ( $this -> fields [ 'ref' ][ 'default' ]) ? " Copy_Of_ " . $object -> ref : $this -> fields [ 'ref' ][ 'default' ];
}
2023-02-11 21:34:21 +01:00
if ( property_exists ( $object , 'question' )) {
2024-09-29 21:52:31 +02:00
// @phan-suppress-next-line PhanTypeInvalidDimOffset
2023-02-11 21:34:21 +01:00
$object -> question = empty ( $this -> fields [ 'question' ][ 'default' ]) ? $langs -> trans ( " CopyOf " ) . " " . $object -> question : $this -> fields [ 'question' ][ 'default' ];
2021-04-28 10:11:49 +02:00
}
if ( property_exists ( $object , 'status' )) {
$object -> status = self :: STATUS_DRAFT ;
}
if ( property_exists ( $object , 'date_creation' )) {
$object -> date_creation = dol_now ();
}
if ( property_exists ( $object , 'date_modification' )) {
$object -> date_modification = null ;
}
// ...
// Clear extrafields that are unique
if ( is_array ( $object -> array_options ) && count ( $object -> array_options ) > 0 ) {
$extrafields -> fetch_name_optionals_label ( $this -> table_element );
foreach ( $object -> array_options as $key => $option ) {
$shortkey = preg_replace ( '/options_/' , '' , $key );
if ( ! empty ( $extrafields -> attributes [ $this -> table_element ][ 'unique' ][ $shortkey ])) {
2022-05-17 14:55:38 +02:00
//var_dump($key);
//var_dump($clonedObj->array_options[$key]); exit;
2021-04-28 10:11:49 +02:00
unset ( $object -> array_options [ $key ]);
}
}
}
// Create clone
$object -> context [ 'createfromclone' ] = 'createfromclone' ;
$result = $object -> createCommon ( $user );
if ( $result < 0 ) {
$error ++ ;
$this -> error = $object -> error ;
$this -> errors = $object -> errors ;
}
if ( ! $error ) {
// copy internal contacts
if ( $this -> copy_linked_contact ( $object , 'internal' ) < 0 ) {
$error ++ ;
}
}
if ( ! $error ) {
// copy external contacts if same company
if ( property_exists ( $this , 'fk_soc' ) && $this -> fk_soc == $object -> socid ) {
if ( $this -> copy_linked_contact ( $object , 'external' ) < 0 ) {
$error ++ ;
}
}
}
unset ( $object -> context [ 'createfromclone' ]);
// End
if ( ! $error ) {
$this -> db -> commit ();
return $object ;
} else {
$this -> db -> rollback ();
return - 1 ;
}
}
/**
* Load object in memory from the database
*
* @ param int $id Id object
* @ param string $ref Ref
2023-12-01 19:51:32 +01:00
* @ return int Return integer < 0 if KO , 0 if not found , > 0 if OK
2021-04-28 10:11:49 +02:00
*/
public function fetch ( $id , $ref = null )
{
$result = $this -> fetchCommon ( $id , $ref );
if ( $result > 0 && ! empty ( $this -> table_element_line )) {
$this -> fetchLines ();
}
return $result ;
}
/**
* Load object lines in memory from the database
*
2023-12-01 19:51:32 +01:00
* @ return int Return integer < 0 if KO , 0 if not found , > 0 if OK
2021-04-28 10:11:49 +02:00
*/
public function fetchLines ()
{
$this -> lines = array ();
$result = $this -> fetchLinesCommon ();
return $result ;
}
/**
* Load list of objects in memory from the database .
*
2024-03-11 11:23:34 +01:00
* @ param string $sortorder Sort Order
* @ param string $sortfield Sort field
* @ param int $limit Limit
* @ param int $offset Offset
2024-10-03 19:40:34 +02:00
* @ param string | array < string , string > $filter Filter USF .
* @ param 'AND' | 'OR' $filtermode Filter mode ( AND or OR )
* @ return self [] | int int < 0 if KO , array of pages if OK
2021-04-28 10:11:49 +02:00
*/
2024-03-11 11:23:34 +01:00
public function fetchAll ( $sortorder = '' , $sortfield = '' , $limit = 0 , $offset = 0 , $filter = '' , $filtermode = 'AND' )
2021-04-28 10:11:49 +02:00
{
dol_syslog ( __METHOD__ , LOG_DEBUG );
$records = array ();
$sql = 'SELECT ' ;
$sql .= $this -> getFieldList ( 't' );
$sql .= ' FROM ' . MAIN_DB_PREFIX . $this -> table_element . ' as t' ;
if ( isset ( $this -> ismultientitymanaged ) && $this -> ismultientitymanaged == 1 ) {
2023-01-16 14:40:35 +01:00
$sql .= ' WHERE t.entity IN (' . getEntity ( $this -> element ) . ')' ;
2021-04-28 10:11:49 +02:00
} else {
$sql .= ' WHERE 1 = 1' ;
}
2024-03-11 11:23:34 +01:00
2021-04-28 10:11:49 +02:00
// Manage filter
2024-03-11 11:23:34 +01:00
if ( is_array ( $filter )) {
$sqlwhere = array ();
if ( count ( $filter ) > 0 ) {
foreach ( $filter as $key => $value ) {
if ( $key == 't.rowid' ) {
$sqlwhere [] = $this -> db -> sanitize ( $key ) . " = " . (( int ) $value );
} elseif ( array_key_exists ( $key , $this -> fields ) && in_array ( $this -> fields [ $key ][ 'type' ], array ( 'date' , 'datetime' , 'timestamp' ))) {
2025-02-04 00:02:03 +01:00
$sqlwhere [] = $this -> db -> sanitize ( $key ) . " = ' " . $this -> db -> idate (( int ) $value ) . " ' " ;
2024-03-11 11:23:34 +01:00
} elseif ( strpos ( $value , '%' ) === false ) {
$sqlwhere [] = $this -> db -> sanitize ( $key ) . ' IN (' . $this -> db -> sanitize ( $this -> db -> escape ( $value )) . ')' ;
} else {
$sqlwhere [] = $this -> db -> sanitize ( $key ) . " LIKE '% " . $this -> db -> escape ( $this -> db -> escapeforlike ( $value )) . " %' " ;
}
2021-04-28 10:11:49 +02:00
}
}
2024-03-11 11:23:34 +01:00
if ( count ( $sqlwhere ) > 0 ) {
$sql .= ' AND (' . implode ( ' ' . $this -> db -> escape ( $filtermode ) . ' ' , $sqlwhere ) . ')' ;
}
$filter = '' ;
2021-04-28 10:11:49 +02:00
}
2024-03-11 11:23:34 +01:00
// Manage filter
$errormessage = '' ;
$sql .= forgeSQLFromUniversalSearchCriteria ( $filter , $errormessage );
if ( $errormessage ) {
$this -> errors [] = $errormessage ;
2024-03-11 12:38:21 +01:00
dol_syslog ( __METHOD__ . ' ' . implode ( ',' , $this -> errors ), LOG_ERR );
2024-03-11 11:23:34 +01:00
return - 1 ;
2021-04-28 10:11:49 +02:00
}
if ( ! empty ( $sortfield )) {
$sql .= $this -> db -> order ( $sortfield , $sortorder );
}
if ( ! empty ( $limit )) {
2021-08-27 22:42:04 +02:00
$sql .= $this -> db -> plimit ( $limit , $offset );
2021-04-28 10:11:49 +02:00
}
$resql = $this -> db -> query ( $sql );
if ( $resql ) {
$num = $this -> db -> num_rows ( $resql );
$i = 0 ;
while ( $i < ( $limit ? min ( $limit , $num ) : $num )) {
$obj = $this -> db -> fetch_object ( $resql );
$record = new self ( $this -> db );
$record -> setVarsFromFetchObj ( $obj );
$records [ $record -> id ] = $record ;
$i ++ ;
}
$this -> db -> free ( $resql );
return $records ;
} else {
$this -> errors [] = 'Error ' . $this -> db -> lasterror ();
Qual: Apply automatic phan fixes (deprecations, unneeded imports) (#28154)
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
* Qual: Apply automatic phan fixes (deprecations, unneeded imports)
# Qual: Apply automatic phan fixes (deprecations, unneeded imports)
This applies automatic fixes by phan for deprecated functions, unneeded imports).
2024-02-13 21:46:12 +01:00
dol_syslog ( __METHOD__ . ' ' . implode ( ',' , $this -> errors ), LOG_ERR );
2021-04-28 10:11:49 +02:00
return - 1 ;
}
}
/**
* Update object into database
*
* @ param User $user User that modifies
2024-01-12 17:47:54 +01:00
* @ param int $notrigger 0 = launch triggers after , 1 = disable triggers
2023-12-01 19:51:32 +01:00
* @ return int Return integer < 0 if KO , > 0 if OK
2021-04-28 10:11:49 +02:00
*/
2024-01-12 17:47:54 +01:00
public function update ( User $user , $notrigger = 0 )
2021-04-28 10:11:49 +02:00
{
return $this -> updateCommon ( $user , $notrigger );
}
/**
* Delete object in database
*
2024-01-12 19:48:18 +01:00
* @ param User $user User that deletes
* @ param int $notrigger 0 = launch triggers after , 1 = disable triggers
* @ return int Return integer < 0 if KO , > 0 if OK
2021-04-28 10:11:49 +02:00
*/
2024-01-12 18:07:53 +01:00
public function delete ( User $user , $notrigger = 0 )
2021-04-28 10:11:49 +02:00
{
2021-09-13 11:22:55 +02:00
$error = 0 ;
2022-02-10 09:19:14 +01:00
$sql = " DELETE FROM " . MAIN_DB_PREFIX . " categorie_knowledgemanagement WHERE fk_knowledgemanagement = " . (( int ) $this -> id );
2021-09-13 11:22:55 +02:00
dol_syslog ( get_class ( $this ) . " ::delete " , LOG_DEBUG );
$resql = $this -> db -> query ( $sql );
if ( ! $resql ) {
$error ++ ;
$this -> error .= $this -> db -> lasterror ();
$errorflag = - 1 ;
}
2022-07-26 13:50:53 +02:00
// Delete all child tables
if ( ! $error ) {
2022-08-03 18:25:32 +02:00
$elements = array ( 'categorie_knowledgemanagement' );
2022-07-26 13:50:53 +02:00
foreach ( $elements as $table ) {
if ( ! $error ) {
$sql = " DELETE FROM " . MAIN_DB_PREFIX . $table ;
$sql .= " WHERE fk_knowledgemanagement = " . ( int ) $this -> id ;
$result = $this -> db -> query ( $sql );
if ( ! $result ) {
$error ++ ;
$this -> errors [] = $this -> db -> lasterror ();
}
}
}
}
2021-04-28 10:11:49 +02:00
return $this -> deleteCommon ( $user , $notrigger );
//return $this->deleteCommon($user, $notrigger, 1);
}
/**
* Delete a line of object in database
*
* @ param User $user User that delete
* @ param int $idline Id of line to delete
2024-01-12 19:48:18 +01:00
* @ param int $notrigger 0 = launch triggers after , 1 = disable triggers
* @ return int Return > 0 if OK , < 0 if KO
2021-04-28 10:11:49 +02:00
*/
2024-01-12 20:51:10 +01:00
public function deleteLine ( User $user , $idline , $notrigger = 0 )
2021-04-28 10:11:49 +02:00
{
if ( $this -> status < 0 ) {
$this -> error = 'ErrorDeleteLineNotAllowedByObjectStatus' ;
return - 2 ;
}
return $this -> deleteLineCommon ( $user , $idline , $notrigger );
}
/**
* Validate object
*
* @ param User $user User making status change
* @ param int $notrigger 1 = Does not execute triggers , 0 = execute triggers
2023-12-06 15:46:39 +01:00
* @ return int Return integer <= 0 if OK , 0 = Nothing done , > 0 if KO
2021-04-28 10:11:49 +02:00
*/
public function validate ( $user , $notrigger = 0 )
{
global $conf , $langs ;
require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php' ;
$error = 0 ;
// Protection
if ( $this -> status == self :: STATUS_VALIDATED ) {
2024-01-13 19:48:41 +01:00
dol_syslog ( get_class ( $this ) . " ::validate action abandoned: already validated " , LOG_WARNING );
2021-04-28 10:11:49 +02:00
return 0 ;
}
2023-02-11 22:13:15 +01:00
/* if ( ! (( empty ( $conf -> global -> MAIN_USE_ADVANCED_PERMS ) && $user -> hasRight ( 'knowledgemanagement' , 'knowledgerecord' , 'write' ))
2022-08-31 22:14:20 +02:00
|| ( ! empty ( $conf -> global -> MAIN_USE_ADVANCED_PERMS ) && ! empty ( $user -> rights -> knowledgemanagement -> knowledgerecord -> knowledgerecord_advance -> validate ))))
2021-04-28 10:11:49 +02:00
{
$this -> error = 'NotEnoughPermissions' ;
dol_syslog ( get_class ( $this ) . " ::valid " . $this -> error , LOG_ERR );
return - 1 ;
} */
$now = dol_now ();
$this -> db -> begin ();
// Define new ref
if ( ! $error && ( preg_match ( '/^[\(]?PROV/i' , $this -> ref ) || empty ( $this -> ref ))) { // empty should not happened, but when it occurs, the test save life
$num = $this -> getNextNumRef ();
} else {
$num = $this -> ref ;
}
$this -> newref = $num ;
if ( ! empty ( $num )) {
// Validate
$sql = " UPDATE " . MAIN_DB_PREFIX . $this -> table_element ;
$sql .= " SET ref = ' " . $this -> db -> escape ( $num ) . " ', " ;
$sql .= " status = " . self :: STATUS_VALIDATED ;
if ( ! empty ( $this -> fields [ 'date_validation' ])) {
$sql .= " , date_validation = ' " . $this -> db -> idate ( $now ) . " ' " ;
}
2024-08-21 13:23:35 +02:00
if ( ! empty ( $this -> fields [ 'fk_user_valid' ])) { // @phan-suppress-current-line PhanTypeMismatchProperty
2021-04-28 10:11:49 +02:00
$sql .= " , fk_user_valid = " . (( int ) $user -> id );
}
$sql .= " WHERE rowid = " . (( int ) $this -> id );
dol_syslog ( get_class ( $this ) . " ::validate() " , LOG_DEBUG );
$resql = $this -> db -> query ( $sql );
if ( ! $resql ) {
dol_print_error ( $this -> db );
$this -> error = $this -> db -> lasterror ();
$error ++ ;
}
if ( ! $error && ! $notrigger ) {
// Call trigger
$result = $this -> call_trigger ( 'KNOWLEDGERECORD_VALIDATE' , $user );
if ( $result < 0 ) {
$error ++ ;
}
// End call triggers
}
}
if ( ! $error ) {
$this -> oldref = $this -> ref ;
// Rename directory if dir was a temporary ref
if ( preg_match ( '/^[\(]?PROV/i' , $this -> ref )) {
// Now we rename also files into index
$sql = 'UPDATE ' . MAIN_DB_PREFIX . " ecm_files set filename = CONCAT(' " . $this -> db -> escape ( $this -> newref ) . " ', SUBSTR(filename, " . ( strlen ( $this -> ref ) + 1 ) . " )), filepath = 'knowledgerecord/ " . $this -> db -> escape ( $this -> newref ) . " ' " ;
$sql .= " WHERE filename LIKE ' " . $this -> db -> escape ( $this -> ref ) . " %' AND filepath = 'knowledgerecord/ " . $this -> db -> escape ( $this -> ref ) . " ' and entity = " . $conf -> entity ;
$resql = $this -> db -> query ( $sql );
if ( ! $resql ) {
2023-12-04 13:46:42 +01:00
$error ++ ;
$this -> error = $this -> db -> lasterror ();
2021-04-28 10:11:49 +02:00
}
2023-10-31 19:28:11 +01:00
$sql = 'UPDATE ' . MAIN_DB_PREFIX . " ecm_files set filepath = 'knowledgerecord/ " . $this -> db -> escape ( $this -> newref ) . " ' " ;
$sql .= " WHERE filepath = 'knowledgerecord/ " . $this -> db -> escape ( $this -> ref ) . " ' and entity = " . $conf -> entity ;
$resql = $this -> db -> query ( $sql );
if ( ! $resql ) {
2023-12-04 13:46:42 +01:00
$error ++ ;
$this -> error = $this -> db -> lasterror ();
2023-10-31 19:28:11 +01:00
}
2021-04-28 10:11:49 +02:00
// We rename directory ($this->ref = old ref, $num = new ref) in order not to lose the attachments
$oldref = dol_sanitizeFileName ( $this -> ref );
$newref = dol_sanitizeFileName ( $num );
$dirsource = $conf -> knowledgemanagement -> dir_output . '/knowledgerecord/' . $oldref ;
$dirdest = $conf -> knowledgemanagement -> dir_output . '/knowledgerecord/' . $newref ;
if ( ! $error && file_exists ( $dirsource )) {
dol_syslog ( get_class ( $this ) . " ::validate() rename dir " . $dirsource . " into " . $dirdest );
if ( @ rename ( $dirsource , $dirdest )) {
dol_syslog ( " Rename ok " );
// Rename docs starting with $oldref with $newref
$listoffiles = dol_dir_list ( $conf -> knowledgemanagement -> dir_output . '/knowledgerecord/' . $newref , 'files' , 1 , '^' . preg_quote ( $oldref , '/' ));
foreach ( $listoffiles as $fileentry ) {
$dirsource = $fileentry [ 'name' ];
$dirdest = preg_replace ( '/^' . preg_quote ( $oldref , '/' ) . '/' , $newref , $dirsource );
$dirsource = $fileentry [ 'path' ] . '/' . $dirsource ;
$dirdest = $fileentry [ 'path' ] . '/' . $dirdest ;
@ rename ( $dirsource , $dirdest );
}
}
}
}
}
// Set new ref and current status
if ( ! $error ) {
$this -> ref = $num ;
$this -> status = self :: STATUS_VALIDATED ;
}
if ( ! $error ) {
$this -> db -> commit ();
return 1 ;
} else {
$this -> db -> rollback ();
return - 1 ;
}
}
/**
* Set draft status
*
* @ param User $user Object user that modify
* @ param int $notrigger 1 = Does not execute triggers , 0 = Execute triggers
2023-12-01 19:51:32 +01:00
* @ return int Return integer < 0 if KO , > 0 if OK
2021-04-28 10:11:49 +02:00
*/
public function setDraft ( $user , $notrigger = 0 )
{
// Protection
if ( $this -> status <= self :: STATUS_DRAFT ) {
return 0 ;
}
2022-08-31 22:14:20 +02:00
/* if ( ! (( empty ( $conf -> global -> MAIN_USE_ADVANCED_PERMS ) && ! empty ( $user -> rights -> knowledgemanagement -> write ))
|| ( ! empty ( $conf -> global -> MAIN_USE_ADVANCED_PERMS ) && ! empty ( $user -> rights -> knowledgemanagement -> knowledgemanagement_advance -> validate ))))
2021-04-28 10:11:49 +02:00
{
$this -> error = 'Permission denied' ;
return - 1 ;
} */
return $this -> setStatusCommon ( $user , self :: STATUS_DRAFT , $notrigger , 'KNOWLEDGERECORD_UNVALIDATE' );
}
/**
* Set cancel status
*
* @ param User $user Object user that modify
* @ param int $notrigger 1 = Does not execute triggers , 0 = Execute triggers
2023-12-06 15:46:39 +01:00
* @ return int Return integer < 0 if KO , 0 = Nothing done , > 0 if OK
2021-04-28 10:11:49 +02:00
*/
public function cancel ( $user , $notrigger = 0 )
{
// Protection
if ( $this -> status != self :: STATUS_VALIDATED ) {
return 0 ;
}
2022-08-31 22:14:20 +02:00
/* if ( ! (( empty ( $conf -> global -> MAIN_USE_ADVANCED_PERMS ) && ! empty ( $user -> rights -> knowledgemanagement -> write ))
|| ( ! empty ( $conf -> global -> MAIN_USE_ADVANCED_PERMS ) && ! empty ( $user -> rights -> knowledgemanagement -> knowledgemanagement_advance -> validate ))))
2021-04-28 10:11:49 +02:00
{
$this -> error = 'Permission denied' ;
return - 1 ;
} */
return $this -> setStatusCommon ( $user , self :: STATUS_CANCELED , $notrigger , 'KNOWLEDGERECORD_CANCEL' );
}
/**
* Set back to validated status
*
* @ param User $user Object user that modify
* @ param int $notrigger 1 = Does not execute triggers , 0 = Execute triggers
2023-12-06 15:46:39 +01:00
* @ return int Return integer < 0 if KO , 0 = Nothing done , > 0 if OK
2021-04-28 10:11:49 +02:00
*/
public function reopen ( $user , $notrigger = 0 )
{
// Protection
if ( $this -> status != self :: STATUS_CANCELED ) {
return 0 ;
}
2022-08-31 22:14:20 +02:00
/* if ( ! (( empty ( $conf -> global -> MAIN_USE_ADVANCED_PERMS ) && ! empty ( $user -> rights -> knowledgemanagement -> write ))
|| ( ! empty ( $conf -> global -> MAIN_USE_ADVANCED_PERMS ) && ! empty ( $user -> rights -> knowledgemanagement -> knowledgemanagement_advance -> validate ))))
2021-04-28 10:11:49 +02:00
{
$this -> error = 'Permission denied' ;
return - 1 ;
} */
return $this -> setStatusCommon ( $user , self :: STATUS_VALIDATED , $notrigger , 'KNOWLEDGERECORD_REOPEN' );
}
2023-02-11 21:34:21 +01:00
/**
* getTooltipContentArray
2024-09-23 03:24:19 +02:00
* @ param array < string , mixed > $params params to construct tooltip data
2023-02-11 21:34:21 +01:00
* @ since v18
2024-09-23 03:24:19 +02:00
* @ return array { picto ? : string , ref ? : string , refsupplier ? : string , label ? : string , date ? : string , date_echeance ? : string , amountht ? : string , total_ht ? : string , totaltva ? : string , amountlt1 ? : string , amountlt2 ? : string , amountrevenustamp ? : string , totalttc ? : string } | array { optimize : string }
2023-02-11 21:34:21 +01:00
*/
public function getTooltipContentArray ( $params )
{
global $conf , $langs ;
$langs -> loadLangs ([ 'knowledgemanagement' , 'languages' ]);
2023-02-22 01:09:23 +01:00
$datas = array ();
$nofetch = ! empty ( $params [ 'nofetch' ]);
2023-02-11 21:34:21 +01:00
$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 ) : '' );
2023-02-11 21:49:06 +01:00
$datas [ 'lang' ] = '<br><b>' . $langs -> trans ( 'Language' ) . ':</b> ' . picto_from_langcode ( $this -> lang , 'class="paddingrightonly saturatemedium opacitylow"' ) . $labellang ;
2023-02-11 21:58:57 +01:00
// show categories for this record only in ajax to not overload lists
2024-02-27 15:30:37 +01:00
if ( isModEnabled ( 'category' ) && ! $nofetch ) {
2023-02-11 21:49:06 +01:00
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 );
}
2023-02-11 21:34:21 +01:00
return $datas ;
}
2021-04-28 10:11:49 +02:00
/**
2024-01-13 19:48:41 +01:00
* Return a link to the object card ( with optionally the picto )
2021-04-28 10:11:49 +02:00
*
* @ param int $withpicto Include picto in link ( 0 = No picto , 1 = Include picto into link , 2 = Only picto )
* @ param string $option On what the link point to ( 'nolink' , ... )
* @ param int $notooltip 1 = Disable tooltip
* @ param string $morecss Add more css on link
* @ param int $save_lastsearch_value - 1 = Auto , 0 = No save of lastsearch_values when clicking , 1 = Save lastsearch_values whenclicking
* @ return string String with URL
*/
public function getNomUrl ( $withpicto = 0 , $option = '' , $notooltip = 0 , $morecss = '' , $save_lastsearch_value = - 1 )
{
global $conf , $langs , $hookmanager ;
if ( ! empty ( $conf -> dol_no_mouse_hover )) {
$notooltip = 1 ; // Force disable tooltips
}
$result = '' ;
2023-02-11 21:34:21 +01:00
$params = [
'id' => $this -> id ,
2023-03-27 10:00:12 +02:00
'objecttype' => $this -> element . ( $this -> module ? '@' . $this -> module : '' ),
2023-02-11 21:58:57 +01:00
'option' => $option ,
'nofetch' => 1 ,
2023-02-11 21:34:21 +01:00
];
$classfortooltip = 'classfortooltip' ;
$dataparams = '' ;
if ( getDolGlobalInt ( 'MAIN_ENABLE_AJAX_TOOLTIP' )) {
$classfortooltip = 'classforajaxtooltip' ;
2023-04-03 19:51:40 +02:00
$dataparams = ' data-params="' . dol_escape_htmltag ( json_encode ( $params )) . '"' ;
$label = '' ;
} else {
$label = implode ( $this -> getTooltipContentArray ( $params ));
2021-04-28 10:11:49 +02:00
}
$url = dol_buildpath ( '/knowledgemanagement/knowledgerecord_card.php' , 1 ) . '?id=' . $this -> id ;
if ( $option != 'nolink' ) {
// Add param to save lastsearch_values or not
$add_save_lastsearch_values = ( $save_lastsearch_value == 1 ? 1 : 0 );
2023-09-10 17:41:22 +02:00
if ( $save_lastsearch_value == - 1 && isset ( $_SERVER [ " PHP_SELF " ]) && preg_match ( '/list\.php/' , $_SERVER [ " PHP_SELF " ])) {
2021-04-28 10:11:49 +02:00
$add_save_lastsearch_values = 1 ;
}
if ( $add_save_lastsearch_values ) {
$url .= '&save_lastsearch_values=1' ;
}
}
$linkclose = '' ;
if ( empty ( $notooltip )) {
2023-11-27 11:56:32 +01:00
if ( getDolGlobalString ( 'MAIN_OPTIMIZEFORTEXTBROWSER' )) {
2021-04-28 10:11:49 +02:00
$label = $langs -> trans ( " ShowKnowledgeRecord " );
2025-01-09 02:01:49 +01:00
$linkclose .= ' alt="' . dolPrintHTMLForAttribute ( $label ) . '"' ;
2021-04-28 10:11:49 +02:00
}
2025-01-09 02:01:49 +01:00
$linkclose .= ( $label ? ' title="' . dolPrintHTMLForAttribute ( $label ) . '"' : ' title="tocomplete"' );
2023-04-03 19:51:40 +02:00
$linkclose .= $dataparams . ' class="' . $classfortooltip . ( $morecss ? ' ' . $morecss : '' ) . '"' ;
2021-04-28 10:11:49 +02:00
} else {
$linkclose = ( $morecss ? ' class="' . $morecss . '"' : '' );
}
if ( $option == 'nolink' ) {
$linkstart = '<span' ;
} else {
$linkstart = '<a href="' . $url . '"' ;
}
$linkstart .= $linkclose . '>' ;
if ( $option == 'nolink' ) {
$linkend = '</span>' ;
} else {
$linkend = '</a>' ;
}
$result .= $linkstart ;
if ( empty ( $this -> showphoto_on_popup )) {
if ( $withpicto ) {
2023-02-11 21:34:21 +01:00
$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 );
2021-04-28 10:11:49 +02:00
}
} else {
if ( $withpicto ) {
require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php' ;
list ( $class , $module ) = explode ( '@' , $this -> picto );
$upload_dir = $conf -> $module -> multidir_output [ $conf -> entity ] . " / $class / " . dol_sanitizeFileName ( $this -> ref );
$filearray = dol_dir_list ( $upload_dir , " files " );
$filename = $filearray [ 0 ][ 'name' ];
if ( ! empty ( $filename )) {
$pospoint = strpos ( $filearray [ 0 ][ 'name' ], '.' );
$pathtophoto = $class . '/' . $this -> ref . '/thumbs/' . substr ( $filename , 0 , $pospoint ) . '_mini' . substr ( $filename , $pospoint );
2023-08-05 15:44:28 +02:00
if ( ! getDolGlobalString ( strtoupper ( $module . '_' . $class ) . '_FORMATLISTPHOTOSASUSERS' )) {
2021-04-28 10:11:49 +02:00
$result .= '<div class="floatleft inline-block valignmiddle divphotoref"><div class="photoref"><img class="photo' . $module . '" alt="No photo" border="0" src="' . DOL_URL_ROOT . '/viewimage.php?modulepart=' . $module . '&entity=' . $conf -> entity . '&file=' . urlencode ( $pathtophoto ) . '"></div></div>' ;
} else {
$result .= '<div class="floatleft inline-block valignmiddle divphotoref"><img class="photouserphoto userphoto" alt="No photo" border="0" src="' . DOL_URL_ROOT . '/viewimage.php?modulepart=' . $module . '&entity=' . $conf -> entity . '&file=' . urlencode ( $pathtophoto ) . '"></div>' ;
}
$result .= '</div>' ;
} else {
2023-09-12 10:52:15 +02:00
$result .= img_object (( $notooltip ? '' : $label ), ( $this -> picto ? $this -> picto : 'generic' ), (( $withpicto != 2 ) ? 'class="paddingright"' : '' ), 0 , 0 , $notooltip ? 0 : 1 );
2021-04-28 10:11:49 +02:00
}
}
}
if ( $withpicto != 2 ) {
$result .= $this -> ref ;
}
$result .= $linkend ;
//if ($withpicto != 2) $result.=(($addlabel && $this->label) ? $sep . dol_trunc($this->label, ($addlabel > 1 ? $addlabel : 0)) : '');
global $action , $hookmanager ;
$hookmanager -> initHooks ( array ( 'knowledgerecorddao' ));
2024-03-11 12:55:55 +01:00
$parameters = array ( 'id' => $this -> id , 'getnomurl' => & $result );
2021-04-28 10:11:49 +02:00
$reshook = $hookmanager -> executeHooks ( 'getNomUrl' , $parameters , $this , $action ); // Note that $action and $object may have been modified by some hooks
if ( $reshook > 0 ) {
$result = $hookmanager -> resPrint ;
} else {
$result .= $hookmanager -> resPrint ;
}
return $result ;
}
/**
* Return the label of the status
*
* @ param int $mode 0 = long label , 1 = short label , 2 = Picto + short label , 3 = Picto , 4 = Picto + long label , 5 = Short label + Picto , 6 = Long label + Picto
* @ return string Label of status
*/
public function getLibStatut ( $mode = 0 )
{
return $this -> LibStatut ( $this -> status , $mode );
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Return the status
*
* @ param int $status Id status
* @ param int $mode 0 = long label , 1 = short label , 2 = Picto + short label , 3 = Picto , 4 = Picto + long label , 5 = Short label + Picto , 6 = Long label + Picto
* @ return string Label of status
*/
public function LibStatut ( $status , $mode = 0 )
{
// phpcs:enable
if ( empty ( $this -> labelStatus ) || empty ( $this -> labelStatusShort )) {
global $langs ;
2021-04-28 14:57:49 +02:00
//$langs->load("knowledgemanagement");
2021-10-16 19:37:57 +02:00
$this -> labelStatus [ self :: STATUS_DRAFT ] = $langs -> transnoentitiesnoconv ( 'Draft' );
$this -> labelStatus [ self :: STATUS_VALIDATED ] = $langs -> transnoentitiesnoconv ( 'Validated' );
2022-01-26 11:29:27 +01:00
$this -> labelStatus [ self :: STATUS_CANCELED ] = $langs -> transnoentitiesnoconv ( 'Obsolete' );
2021-10-16 19:37:57 +02:00
$this -> labelStatusShort [ self :: STATUS_DRAFT ] = $langs -> transnoentitiesnoconv ( 'Draft' );
$this -> labelStatusShort [ self :: STATUS_VALIDATED ] = $langs -> transnoentitiesnoconv ( 'Validated' );
2022-01-26 11:29:27 +01:00
$this -> labelStatusShort [ self :: STATUS_CANCELED ] = $langs -> transnoentitiesnoconv ( 'Obsolete' );
2021-04-28 10:11:49 +02:00
}
$statusType = 'status' . $status ;
2023-12-04 13:46:42 +01:00
if ( $status == self :: STATUS_VALIDATED ) {
$statusType = 'status4' ;
}
2021-04-28 10:11:49 +02:00
if ( $status == self :: STATUS_CANCELED ) {
$statusType = 'status6' ;
}
return dolGetStatus ( $this -> labelStatus [ $status ], $this -> labelStatusShort [ $status ], '' , $statusType , $mode );
}
/**
* Load the info information in the object
*
* @ param int $id Id of object
* @ return void
*/
public function info ( $id )
{
$sql = 'SELECT rowid, date_creation as datec, tms as datem,' ;
$sql .= ' fk_user_creat, fk_user_modif' ;
$sql .= ' FROM ' . MAIN_DB_PREFIX . $this -> table_element . ' as t' ;
$sql .= ' WHERE t.rowid = ' . (( int ) $id );
$result = $this -> db -> query ( $sql );
if ( $result ) {
if ( $this -> db -> num_rows ( $result )) {
$obj = $this -> db -> fetch_object ( $result );
2023-10-24 11:37:29 +02:00
2021-04-28 10:11:49 +02:00
$this -> id = $obj -> rowid ;
2022-06-28 13:09:53 +02:00
$this -> user_creation_id = $obj -> fk_user_creat ;
$this -> user_modification_id = $obj -> fk_user_modif ;
2021-04-28 10:11:49 +02:00
$this -> date_creation = $this -> db -> jdate ( $obj -> datec );
2022-06-28 13:09:53 +02:00
$this -> date_modification = empty ( $obj -> datem ) ? '' : $this -> db -> jdate ( $obj -> datem );
2021-04-28 10:11:49 +02:00
}
$this -> db -> free ( $result );
} else {
dol_print_error ( $this -> db );
}
}
/**
* Initialise object with example values
* Id must be 0 if object instance is a specimen
*
2024-03-02 16:38:35 +01:00
* @ return int
2021-04-28 10:11:49 +02:00
*/
public function initAsSpecimen ()
{
2021-04-29 10:54:24 +02:00
$this -> question = " ABCD " ;
2024-03-02 16:38:35 +01:00
return $this -> initAsSpecimenCommon ();
2021-04-28 10:11:49 +02:00
}
/**
* Create an array of lines
*
2024-10-03 19:40:34 +02:00
* @ return KnowledgeRecordLine [] | int array of lines if OK , < 0 if KO
2021-04-28 10:11:49 +02:00
*/
public function getLinesArray ()
{
$this -> lines = array ();
$objectline = new KnowledgeRecordLine ( $this -> db );
2024-03-05 03:51:36 +01:00
$result = $objectline -> fetchAll ( 'ASC' , 'position' , 0 , 0 , '(fk_knowledgerecord:=:' . (( int ) $this -> id ) . ')' );
2021-04-28 10:11:49 +02:00
if ( is_numeric ( $result )) {
2022-12-31 14:43:31 +01:00
$this -> error = $objectline -> error ;
$this -> errors = $objectline -> errors ;
2021-04-28 10:11:49 +02:00
return $result ;
} else {
$this -> lines = $result ;
2024-10-13 16:45:42 +02:00
// @phpstan-ignore-next-line
return $result ; // @phan-suppress-current-line PhanTypeMismatchReturn
2021-04-28 10:11:49 +02:00
}
}
/**
* Returns the reference to the following non used object depending on the active numbering module .
*
* @ return string Object free reference
*/
public function getNextNumRef ()
{
global $langs , $conf ;
2021-04-28 14:57:49 +02:00
$langs -> load ( " knowledgemanagement " );
2021-04-28 10:11:49 +02:00
2023-11-27 11:56:32 +01:00
if ( ! getDolGlobalString ( 'KNOWLEDGEMANAGEMENT_KNOWLEDGERECORD_ADDON' )) {
2021-04-28 10:11:49 +02:00
$conf -> global -> KNOWLEDGEMANAGEMENT_KNOWLEDGERECORD_ADDON = 'mod_knowledgerecord_standard' ;
}
2023-11-27 11:56:32 +01:00
if ( getDolGlobalString ( 'KNOWLEDGEMANAGEMENT_KNOWLEDGERECORD_ADDON' )) {
2021-04-28 10:11:49 +02:00
$mybool = false ;
2023-10-15 18:39:13 +02:00
$file = getDolGlobalString ( 'KNOWLEDGEMANAGEMENT_KNOWLEDGERECORD_ADDON' ) . " .php " ;
2024-01-05 04:18:53 +01:00
$classname = getDolGlobalString ( 'KNOWLEDGEMANAGEMENT_KNOWLEDGERECORD_ADDON' );
2021-04-28 10:11:49 +02:00
// Include file with class
$dirmodels = array_merge ( array ( '/' ), ( array ) $conf -> modules_parts [ 'models' ]);
foreach ( $dirmodels as $reldir ) {
$dir = dol_buildpath ( $reldir . " core/modules/knowledgemanagement/ " );
// Load file with numbering class (if found)
2024-03-21 13:22:00 +01:00
$mybool = (( bool ) @ include_once $dir . $file ) || $mybool ;
2021-04-28 10:11:49 +02:00
}
2024-08-07 03:05:02 +02:00
if ( ! $mybool ) {
2024-01-20 09:22:38 +01:00
dol_print_error ( null , " Failed to include file " . $file );
2021-04-28 10:11:49 +02:00
return '' ;
}
if ( class_exists ( $classname )) {
$obj = new $classname ();
2024-10-03 19:40:34 +02:00
'@phan-var-force ModeleNumRefKnowledgeRecord $obj' ;
2021-04-28 10:11:49 +02:00
$numref = $obj -> getNextValue ( $this );
if ( $numref != '' && $numref != '-1' ) {
return $numref ;
} else {
$this -> error = $obj -> error ;
//dol_print_error($this->db,get_class($this)."::getNextNumRef ".$obj->error);
return " " ;
}
} else {
print $langs -> trans ( " Error " ) . " " . $langs -> trans ( " ClassNotFound " ) . ' ' . $classname ;
return " " ;
}
} else {
print $langs -> trans ( " ErrorNumberingModuleNotSetup " , $this -> element );
return " " ;
}
}
/**
* Create a document onto disk according to template module .
*
* @ param string $modele Force template to use ( '' to not force )
2024-01-13 19:48:41 +01:00
* @ param Translate $outputlangs object lang a utiliser pour traduction
2024-10-03 19:40:34 +02:00
* @ param int < 0 , 1 > $hidedetails Hide details of lines
* @ param int < 0 , 1 > $hidedesc Hide description
* @ param int < 0 , 1 > $hideref Hide ref
* @ param ? array < string , mixed > $moreparams Array to provide more information
2021-04-28 10:11:49 +02:00
* @ return int 0 if KO , 1 if OK
*/
public function generateDocument ( $modele , $outputlangs , $hidedetails = 0 , $hidedesc = 0 , $hideref = 0 , $moreparams = null )
{
global $conf , $langs ;
$result = 0 ;
$includedocgeneration = 0 ;
2021-04-28 14:57:49 +02:00
$langs -> load ( " knowledgemanagement " );
2021-04-28 10:11:49 +02:00
if ( ! dol_strlen ( $modele )) {
$modele = 'standard_knowledgerecord' ;
if ( ! empty ( $this -> model_pdf )) {
$modele = $this -> model_pdf ;
2023-11-27 11:56:32 +01:00
} elseif ( getDolGlobalString ( 'KNOWLEDGERECORD_ADDON_PDF' )) {
2024-01-05 04:18:53 +01:00
$modele = getDolGlobalString ( 'KNOWLEDGERECORD_ADDON_PDF' );
2021-04-28 10:11:49 +02:00
}
}
$modelpath = " core/modules/knowledgemanagement/doc/ " ;
if ( $includedocgeneration && ! empty ( $modele )) {
$result = $this -> commonGenerateDocument ( $modelpath , $modele , $outputlangs , $hidedetails , $hidedesc , $hideref , $moreparams );
}
return $result ;
}
/**
* Action executed by scheduler
* CAN BE A CRON TASK . In such a case , parameters come from the schedule job setup field 'Parameters'
* Use public function doScheduledJob ( $param1 , $param2 , ... ) to get parameters
*
* @ return int 0 if OK , <> 0 if KO ( this function is used also by cron so only 0 is OK )
*/
public function doScheduledJob ()
{
global $conf , $langs ;
//$conf->global->SYSLOG_FILE = 'DOL_DATA_ROOT/dolibarr_mydedicatedlofile.log';
$error = 0 ;
$this -> output = '' ;
$this -> error = '' ;
dol_syslog ( __METHOD__ , LOG_DEBUG );
$now = dol_now ();
$this -> db -> begin ();
// ...
$this -> db -> commit ();
return $error ;
}
2021-09-13 11:22:55 +02:00
/**
* Sets object to supplied categories .
*
* Deletes object from existing categories not supplied .
* Adds it to non existing supplied categories .
* Existing categories are left untouch .
*
2022-12-31 14:01:03 +01:00
* @ param int [] | int $categories Category or categories IDs
2023-12-01 19:51:32 +01:00
* @ return int Return integer < 0 if KO , > 0 if OK
2021-09-13 11:22:55 +02:00
*/
public function setCategories ( $categories )
{
require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php' ;
return parent :: setCategoriesCommon ( $categories , Categorie :: TYPE_KNOWLEDGEMANAGEMENT );
}
2023-01-17 14:39:47 +01:00
/**
2024-08-07 01:20:43 +02:00
* Return clickable link of object ( with eventually picto )
2023-01-17 14:39:47 +01:00
*
2024-08-22 03:31:04 +02:00
* @ param string $option Where point the link ( 0 => main card , 1 , 2 => shipment , 'nolink' => No link )
2025-02-03 11:24:16 +01:00
* @ param ? array < string , mixed > $arraydata Array of data
2024-08-22 03:31:04 +02:00
* @ return string HTML Code for Kanban thumb .
2023-01-17 14:39:47 +01:00
*/
2023-01-18 22:27:52 +01:00
public function getKanbanView ( $option = '' , $arraydata = null )
2023-01-17 14:39:47 +01:00
{
2023-03-07 22:04:40 +01:00
$selected = ( empty ( $arraydata [ 'selected' ]) ? 0 : $arraydata [ 'selected' ]);
2023-01-17 14:39:47 +01:00
$return = '<div class="box-flex-item box-flex-grow-zero">' ;
$return .= '<div class="info-box info-box-sm">' ;
$return .= '<span class="info-box-icon bg-infobox-action">' ;
$return .= img_picto ( '' , $this -> picto );
$return .= '</span>' ;
$return .= '<div class="info-box-content">' ;
2023-05-11 11:03:26 +02:00
$return .= '<span class="info-box-ref inline-block tdoverflowmax150 valignmiddle">' . ( method_exists ( $this , 'getNomUrl' ) ? $this -> getNomUrl ( 1 ) : $this -> ref ) . '</span>' ;
2023-10-17 15:43:56 +02:00
if ( $selected >= 0 ) {
$return .= '<input id="cb' . $this -> id . '" class="flat checkforselect fright" type="checkbox" name="toselect[]" value="' . $this -> id . '"' . ( $selected ? ' checked="checked"' : '' ) . '>' ;
}
2023-01-17 14:39:47 +01:00
if ( property_exists ( $this , 'lang' ) && ! empty ( $this -> lang )) {
2023-02-21 02:12:20 +01:00
//$return .= '<br><span class="opacitymedium">'.$langs->trans("Language").'</span> : <span class="info-box-label" title="'.$langs->trans("Language_".$this->lang).'">'.$langs->trans("Language_".$this->lang, '', '', '', '', 12).'</span>';
$return .= '<br>' . picto_from_langcode ( $this -> lang , 'class="paddingrightonly saturatemedium opacitylow paddingrightonly"' );
}
if ( property_exists ( $this , 'question' )) {
2024-05-09 19:07:46 +02:00
$return .= '<div class="info-box-label tdoverflowmax150 classfortooltip" title="' . dolPrintHTMLForAttribute ( $this -> question ) . '">' . dolGetFirstLineOfText ( $this -> question ) . '</div>' ;
2023-01-17 14:39:47 +01:00
}
if ( method_exists ( $this , 'getLibStatut' )) {
2024-05-09 19:07:46 +02:00
$return .= '<div class="info-box-status">' . $this -> getLibStatut ( 3 ) . '</div>' ;
2023-01-17 14:39:47 +01:00
}
$return .= '</div>' ;
$return .= '</div>' ;
$return .= '</div>' ;
return $return ;
}
2021-04-28 10:11:49 +02:00
}
require_once DOL_DOCUMENT_ROOT . '/core/class/commonobjectline.class.php' ;
/**
* Class KnowledgeRecordLine . You can also remove this and generate a CRUD class for lines objects .
*/
class KnowledgeRecordLine extends CommonObjectLine
{
// To complete with content of an object KnowledgeRecordLine
// We should have a field rowid, fk_knowledgerecord and position
/**
* Constructor
*
2024-01-13 15:50:02 +01:00
* @ param DoliDB $db Database handler
2021-04-28 10:11:49 +02:00
*/
public function __construct ( DoliDB $db )
{
$this -> db = $db ;
2024-05-05 00:34:19 +02:00
$this -> isextrafieldmanaged = 0 ;
2021-04-28 10:11:49 +02:00
}
}