dolibarr/htdocs/core/lib/admin.lib.php

2177 lines
76 KiB
PHP
Raw Normal View History

<?php
/* Copyright (C) 2008-2011 Laurent Destailleur <eldy@users.sourceforge.net>
2018-10-27 14:43:12 +02:00
* Copyright (C) 2005-2016 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2012 J. Fernando Lagrange <fernando@demo-tic.org>
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* Copyright (C) 2023 Eric Seigne <eric.seigne@cap-rel.fr>
2024-03-13 00:29:40 +01:00
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
2024-07-06 14:30:13 +02:00
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
2019-09-23 21:55:30 +02:00
* along with this program. If not, see <https://www.gnu.org/licenses/>.
* or see https://www.gnu.org/
*/
/**
2011-10-24 11:25:54 +02:00
* \file htdocs/core/lib/admin.lib.php
* \brief Library of admin functions
*/
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
/**
2011-09-16 20:25:10 +02:00
* Renvoi une version en chaine depuis une version en tableau
*
* @param array<int<0,2>,int|string> $versionarray Tableau de version (vermajeur,vermineur,autre)
2011-09-16 20:25:10 +02:00
* @return string Chaine version
2019-03-11 01:01:15 +01:00
* @see versioncompare()
2009-01-26 22:57:14 +01:00
*/
function versiontostring($versionarray)
{
$string = '?';
2020-12-04 20:28:05 +01:00
if (isset($versionarray[0])) {
$string = $versionarray[0];
}
if (isset($versionarray[1])) {
$string .= '.'.$versionarray[1];
}
if (isset($versionarray[2])) {
$string .= '.'.$versionarray[2];
}
return $string;
}
/**
2015-07-27 17:09:16 +02:00
* Compare 2 versions (stored into 2 arrays).
2016-03-25 17:14:20 +01:00
* To check if Dolibarr version is lower than (x,y,z), do "if versioncompare(versiondolibarrarray(), array(x.y.z)) <= 0"
2020-10-12 14:01:15 +02:00
* For example: if (versioncompare(versiondolibarrarray(),array(4,0,-5)) >= 0) is true if version is 4.0 alpha or higher.
2016-03-25 17:14:20 +01:00
* For example: if (versioncompare(versiondolibarrarray(),array(4,0,0)) >= 0) is true if version is 4.0 final or higher.
* For example: if (versioncompare(versiondolibarrarray(),array(4,0,1)) >= 0) is true if version is 4.0.1 or higher.
2016-07-12 13:03:56 +02:00
* Alternative way to compare: if ((float) DOL_VERSION >= 4.0) is true if version is 4.0 alpha or higher (works only to compare first and second level)
2011-09-16 20:25:10 +02:00
*
* @param array<int|string> $versionarray1 Array of version (vermajor,verminor,patch)
* @param array<int|string> $versionarray2 Array of version (vermajor,verminor,patch)
* @return int<-4,4> -4,-3,-2,-1 if versionarray1<versionarray2 (value depends on level of difference)
2011-09-16 20:25:10 +02:00
* 0 if same
* 1,2,3,4 if versionarray1>versionarray2 (value depends on level of difference)
2019-03-11 01:01:15 +01:00
* @see versiontostring()
2009-05-04 22:57:26 +02:00
*/
function versioncompare($versionarray1, $versionarray2)
{
$ret = 0;
$level = 0;
$count1 = count($versionarray1);
$count2 = count($versionarray2);
$maxcount = max($count1, $count2);
2020-12-04 20:28:05 +01:00
while ($level < $maxcount) {
$operande1 = isset($versionarray1[$level]) ? $versionarray1[$level] : 0;
$operande2 = isset($versionarray2[$level]) ? $versionarray2[$level] : 0;
2020-12-04 20:28:05 +01:00
if (preg_match('/alpha|dev/i', $operande1)) {
$operande1 = -5;
}
if (preg_match('/alpha|dev/i', $operande2)) {
$operande2 = -5;
}
if (preg_match('/beta$/i', $operande1)) {
$operande1 = -4;
}
if (preg_match('/beta$/i', $operande2)) {
$operande2 = -4;
}
if (preg_match('/beta([0-9])+/i', $operande1)) {
$operande1 = -3;
}
if (preg_match('/beta([0-9])+/i', $operande2)) {
$operande2 = -3;
}
if (preg_match('/rc$/i', $operande1)) {
$operande1 = -2;
}
if (preg_match('/rc$/i', $operande2)) {
$operande2 = -2;
}
if (preg_match('/rc([0-9])+/i', $operande1)) {
$operande1 = -1;
}
if (preg_match('/rc([0-9])+/i', $operande2)) {
$operande2 = -1;
}
$level++;
//print 'level '.$level.' '.$operande1.'-'.$operande2.'<br>';
2020-12-04 20:28:05 +01:00
if ($operande1 < $operande2) {
2021-03-01 20:37:16 +01:00
$ret = -$level;
break;
2020-12-04 20:28:05 +01:00
}
if ($operande1 > $operande2) {
2021-03-01 20:37:16 +01:00
$ret = $level;
break;
2020-12-04 20:28:05 +01:00
}
}
//print join('.',$versionarray1).'('.count($versionarray1).') / '.join('.',$versionarray2).'('.count($versionarray2).') => '.$ret.'<br>'."\n";
return $ret;
}
/**
2011-01-16 02:14:48 +01:00
* Return version PHP
2011-09-16 20:25:10 +02:00
*
* @return array<int<0,2>,string> Tableau de version (vermajeur,vermineur,autre)
* @see versioncompare()
2009-05-04 22:57:26 +02:00
*/
function versionphparray()
{
return explode('.', PHP_VERSION);
}
/**
2011-09-16 20:25:10 +02:00
* Return version Dolibarr
*
* @return array<int<0,2>,string> Tableau de version (vermajeur,vermineur,autre)
* @see versioncompare()
2009-05-04 22:57:26 +02:00
*/
2011-09-16 20:25:10 +02:00
function versiondolibarrarray()
2010-04-30 19:31:46 +02:00
{
return explode('.', DOL_VERSION);
}
/**
2018-08-16 21:48:16 +02:00
* Launch a sql file. Function is used by:
2010-09-29 01:17:31 +02:00
* - Migrate process (dolibarr-xyz-abc.sql)
* - Loading sql menus (auguria)
* - Running specific Sql by a module init
2018-08-16 21:48:16 +02:00
* - Loading sql file of website import package
2010-09-29 01:17:31 +02:00
* Install process however does not use it.
2018-08-16 21:48:16 +02:00
* Note that Sql files must have all comments at start of line. Also this function take ';' as the char to detect end of sql request
2011-09-16 20:25:10 +02:00
*
* @param string $sqlfile Full path to sql file
* @param int $silent 1=Do not output anything, 0=Output line for update page
* @param int $entity Entity targeted for multicompany module
* @param int $usesavepoint 1=Run a savepoint before each request and a rollback to savepoint if error (this allow to have some request with errors inside global transactions).
2023-06-26 23:12:56 +02:00
* @param string $handler Handler targeted for menu (replace __HANDLER__ with this value between quotes)
* @param string $okerror Family of errors we accept ('default', 'none')
* @param int $linelengthlimit Limit for length of each line (Use 0 if unknown, may be faster if defined)
* @param int $nocommentremoval Do no try to remove comments (in such a case, we consider that each line is a request, so use also $linelengthlimit=0)
* @param int $offsetforchartofaccount Offset to use to load chart of account table to update sql on the fly to add offset to rowid and account_parent value
* @param int $colspan 2=Add a colspan=2 on td
* @param int $onlysqltoimportwebsite Only sql requests used to import a website template are allowed
* @param string $database Database (replace __DATABASE__ with this value)
2023-12-06 15:46:39 +01:00
* @return int Return integer <=0 if KO, >0 if OK
2009-05-04 22:57:26 +02:00
*/
function run_sql($sqlfile, $silent = 1, $entity = 0, $usesavepoint = 1, $handler = '', $okerror = 'default', $linelengthlimit = 32768, $nocommentremoval = 0, $offsetforchartofaccount = 0, $colspan = 0, $onlysqltoimportwebsite = 0, $database = '')
{
global $db, $conf, $langs, $user;
dol_syslog("Admin.lib::run_sql run sql file ".$sqlfile." silent=".$silent." entity=".$entity." usesavepoint=".$usesavepoint." handler=".$handler." okerror=".$okerror, LOG_DEBUG);
2020-12-04 20:28:05 +01:00
if (!is_numeric($linelengthlimit)) {
dol_syslog("Admin.lib::run_sql param linelengthlimit is not a numeric", LOG_ERR);
return -1;
}
$ok = 0;
$error = 0;
$i = 0;
$buffer = '';
$arraysql = array();
// Get version of database
$versionarray = $db->getVersionArray();
$fp = fopen($sqlfile, "r");
2020-12-04 20:28:05 +01:00
if ($fp) {
while (!feof($fp)) {
// Warning fgets with second parameter that is null or 0 hang.
2020-12-04 20:28:05 +01:00
if ($linelengthlimit > 0) {
$buf = fgets($fp, $linelengthlimit);
} else {
$buf = fgets($fp);
}
// Test if request must be ran only for particular database or version (if yes, we must remove the -- comment)
$reg = array();
2020-12-04 20:28:05 +01:00
if (preg_match('/^--\sV(MYSQL|PGSQL)([^\s]*)/i', $buf, $reg)) {
$qualified = 1;
// restrict on database type
2020-12-04 20:28:05 +01:00
if (!empty($reg[1])) {
if (!preg_match('/'.preg_quote($reg[1]).'/i', $db->type)) {
$qualified = 0;
}
}
// restrict on version
2020-12-04 20:28:05 +01:00
if ($qualified) {
if (!empty($reg[2])) {
if (is_numeric($reg[2])) { // This is a version
$versionrequest = explode('.', $reg[2]);
//var_dump($versionrequest);
//var_dump($versionarray);
2020-12-04 20:28:05 +01:00
if (!count($versionrequest) || !count($versionarray) || versioncompare($versionrequest, $versionarray) > 0) {
$qualified = 0;
}
2023-12-04 12:05:28 +01:00
} else { // This is a test on a constant. For example when we have -- VMYSQLUTF8UNICODE, we test constant $conf->global->UTF8UNICODE
$dbcollation = strtoupper(preg_replace('/_/', '', $conf->db->dolibarr_main_db_collation));
//var_dump($reg[2]);
//var_dump($dbcollation);
2020-12-04 20:28:05 +01:00
if (empty($conf->db->dolibarr_main_db_collation) || ($reg[2] != $dbcollation)) {
$qualified = 0;
}
//var_dump($qualified);
}
}
}
2020-12-04 20:28:05 +01:00
if ($qualified) {
// Version qualified, delete SQL comments
$buf = preg_replace('/^--\sV(MYSQL|PGSQL)([^\s]*)/i', '', $buf);
//print "Ligne $i qualifi?e par version: ".$buf.'<br>';
}
}
// Add line buf to buffer if not a comment
2020-12-04 20:28:05 +01:00
if ($nocommentremoval || !preg_match('/^\s*--/', $buf)) {
if (empty($nocommentremoval)) {
$buf = preg_replace('/([,;ERLT\)])\s*--.*$/i', '\1', $buf); //remove comment from a line that not start with -- before add it to the buffer
}
2023-12-04 12:05:28 +01:00
if ($buffer) {
$buffer .= ' ';
}
$buffer .= trim($buf);
}
//print $buf.'<br>';exit;
2020-12-04 20:28:05 +01:00
if (preg_match('/;/', $buffer)) { // If string contains ';', it's end of a request string, we save it in arraysql.
2020-12-04 20:31:53 +01:00
// Found new request
2020-12-04 20:28:05 +01:00
if ($buffer) {
$arraysql[$i] = $buffer;
}
$i++;
$buffer = '';
}
}
2020-12-04 20:28:05 +01:00
if ($buffer) {
$arraysql[$i] = $buffer;
}
fclose($fp);
} else {
dol_syslog("Admin.lib::run_sql failed to open file ".$sqlfile, LOG_ERR);
}
// Loop on each request to see if there is a __+MAX_table__ key
$listofmaxrowid = array(); // This is a cache table
2020-12-04 20:28:05 +01:00
foreach ($arraysql as $i => $sql) {
$newsql = $sql;
// Replace __+MAX_table__ with max of table
2020-12-04 20:28:05 +01:00
while (preg_match('/__\+MAX_([A-Za-z0-9_]+)__/i', $newsql, $reg)) {
$table = $reg[1];
2020-12-04 20:28:05 +01:00
if (!isset($listofmaxrowid[$table])) {
//var_dump($db);
$sqlgetrowid = 'SELECT MAX(rowid) as max from '.preg_replace('/^llx_/', MAIN_DB_PREFIX, $table);
$resql = $db->query($sqlgetrowid);
2020-12-04 20:28:05 +01:00
if ($resql) {
$obj = $db->fetch_object($resql);
$listofmaxrowid[$table] = $obj->max;
2020-12-04 20:28:05 +01:00
if (empty($listofmaxrowid[$table])) {
$listofmaxrowid[$table] = 0;
}
} else {
2020-12-04 20:28:05 +01:00
if (!$silent) {
2021-08-18 19:32:07 +02:00
print '<tr><td class="tdtop"'.($colspan ? ' colspan="'.$colspan.'"' : '').'>';
print '<div class="error">'.$langs->trans("Failed to get max rowid for ".$table)."</div>";
print '</td></tr>';
2020-12-04 20:28:05 +01:00
}
$error++;
break;
}
}
// Replace __+MAX_llx_table__ with +999
$from = '__+MAX_'.$table.'__';
$to = '+'.$listofmaxrowid[$table];
$newsql = str_replace($from, $to, $newsql);
dol_syslog('Admin.lib::run_sql New Request '.($i + 1).' (replacing '.$from.' to '.$to.')', LOG_DEBUG);
$arraysql[$i] = $newsql;
}
2020-12-04 20:28:05 +01:00
if ($offsetforchartofaccount > 0) {
// Replace lines
// 'INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1401, 'PCG99-ABREGE', 'CAPIT', '1234', 1400,...'
// with
// 'INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1401 + 200100000, 'PCG99-ABREGE','CAPIT', '1234', 1400 + 200100000,...'
// Note: string with 'PCG99-ABREGE','CAPIT', 1234 instead of 'PCG99-ABREGE','CAPIT', '1234' is also supported
2021-08-28 00:55:51 +02:00
$newsql = preg_replace('/VALUES\s*\(__ENTITY__, \s*(\d+)\s*,(\s*\'[^\',]*\'\s*,\s*\'[^\',]*\'\s*,\s*\'?[^\',]*\'?\s*),\s*\'?([^\',]*)\'?/ims', 'VALUES (__ENTITY__, \1 + '.((int) $offsetforchartofaccount).', \2, \3 + '.((int) $offsetforchartofaccount), $newsql);
$newsql = preg_replace('/([,\s])0 \+ '.((int) $offsetforchartofaccount).'/ims', '\1 0', $newsql);
//var_dump($newsql);
$arraysql[$i] = $newsql;
// FIXME Because we force the rowid during insert, we must also update the sequence with postgresql by running
// SELECT dol_util_rebuild_sequences();
}
}
// Loop on each request to execute request
$cursorinsert = 0;
$listofinsertedrowid = array();
2022-02-23 19:24:17 +01:00
$keyforsql = md5($sqlfile);
2020-12-04 20:28:05 +01:00
foreach ($arraysql as $i => $sql) {
if ($sql) {
// Test if the SQL is allowed SQL
2022-06-07 16:05:01 +02:00
if ($onlysqltoimportwebsite) {
$newsql = str_replace(array("\'"), '__BACKSLASHQUOTE__', $sql); // Replace the \' char
2022-07-12 10:56:03 +02:00
// Remove all strings contents including the ' so we can analyse SQL instruction only later
2022-06-07 16:05:01 +02:00
$l = strlen($newsql);
$is = 0;
$quoteopen = 0;
$newsqlclean = '';
while ($is < $l) {
$char = $newsql[$is];
if ($char == "'") {
if ($quoteopen) {
$quoteopen--;
} else {
$quoteopen++;
}
} elseif (empty($quoteopen)) {
$newsqlclean .= $char;
}
$is++;
}
$newsqlclean = str_replace(array("null"), '__000__', $newsqlclean);
//print $newsqlclean."<br>\n";
$qualified = 0;
2022-07-12 10:56:03 +02:00
// A very small control. This can still by bypassed by adding a second SQL request concatenated
2022-06-07 16:05:01 +02:00
if (preg_match('/^--/', $newsqlclean)) {
$qualified = 1;
2022-07-12 10:56:03 +02:00
} elseif (preg_match('/^UPDATE llx_website SET \w+ = \d+\+\d+ WHERE rowid = \d+;$/', $newsqlclean)) {
2022-06-07 16:05:01 +02:00
$qualified = 1;
} elseif (preg_match('/^INSERT INTO llx_website_page\([a-z0-9_\s,]+\) VALUES\([0-9_\s,\+]+\);$/', $newsqlclean)) {
// Insert must match
// INSERT INTO llx_website_page(rowid, fk_page, fk_website, pageurl, aliasalt, title, description, lang, image, keywords, status, date_creation, tms, import_key, grabbed_from, type_container, htmlheader, content, author_alias) VALUES(1+123, null, 17, , , , , , , , , , , null, , , , , );
$qualified = 1;
}
2022-07-12 10:56:03 +02:00
// Another check to allow some legitimate original urls
if (!$qualified) {
if (preg_match('/^UPDATE llx_website SET \w+ = \'[a-zA-Z,\s]*\' WHERE rowid = \d+;$/', $sql)) {
$qualified = 1;
}
}
// We also check content
$extractphp = dolKeepOnlyPhpCode($sql);
$extractphpold = '';
// Security analysis
$errorphpcheck = checkPHPCode($extractphpold, $extractphp); // Contains the setEventMessages
if ($errorphpcheck) {
$error++;
//print 'Request '.($i + 1)." contains non allowed instructions.<br>\n";
//print "newsqlclean = ".$newsqlclean."<br>\n";
dol_syslog('Admin.lib::run_sql Request '.($i + 1)." contains PHP code and checking this code returns errorphpcheck='.$errorphpcheck.'", LOG_WARNING);
2024-04-23 17:14:10 +02:00
dol_syslog("sql=".$sql, LOG_DEBUG);
break;
}
2022-06-07 16:05:01 +02:00
if (!$qualified) {
$error++;
//print 'Request '.($i + 1)." contains non allowed instructions.<br>\n";
//print "newsqlclean = ".$newsqlclean."<br>\n";
2022-07-12 10:56:03 +02:00
dol_syslog('Admin.lib::run_sql Request '.($i + 1)." contains non allowed instructions.", LOG_WARNING);
2022-06-07 16:05:01 +02:00
dol_syslog('$newsqlclean='.$newsqlclean, LOG_DEBUG);
break;
}
}
// Replace the prefix tables
2020-12-04 20:28:05 +01:00
if (MAIN_DB_PREFIX != 'llx_') {
$sql = preg_replace('/llx_/i', MAIN_DB_PREFIX, $sql);
}
2020-12-04 20:28:05 +01:00
if (!empty($handler)) {
$sql = preg_replace('/__HANDLER__/i', "'".$db->escape($handler)."'", $sql);
}
if (!empty($database)) {
2023-06-26 23:12:56 +02:00
$sql = preg_replace('/__DATABASE__/i', $db->escape($database), $sql);
}
2024-03-25 22:15:43 +01:00
$newsql = preg_replace('/__ENTITY__/i', (!empty($entity) ? $entity : (string) $conf->entity), $sql);
// Add log of request
2020-12-04 20:28:05 +01:00
if (!$silent) {
2022-02-23 19:24:17 +01:00
print '<tr class="trforrunsql'.$keyforsql.'"><td class="tdtop opacitymedium"'.($colspan ? ' colspan="'.$colspan.'"' : '').'>'.$langs->trans("Request").' '.($i + 1)." sql='".dol_htmlentities($newsql, ENT_NOQUOTES)."'</td></tr>\n";
2020-12-04 20:28:05 +01:00
}
dol_syslog('Admin.lib::run_sql Request '.($i + 1), LOG_DEBUG);
$sqlmodified = 0;
2011-09-21 17:53:54 +02:00
// Replace for encrypt data
2020-12-04 20:28:05 +01:00
if (preg_match_all('/__ENCRYPT\(\'([^\']+)\'\)__/i', $newsql, $reg)) {
$num = count($reg[0]);
2020-12-04 20:28:05 +01:00
for ($j = 0; $j < $num; $j++) {
$from = $reg[0][$j];
2021-09-02 13:25:00 +02:00
$to = $db->encrypt($reg[1][$j]);
$newsql = str_replace($from, $to, $newsql);
}
$sqlmodified++;
}
// Replace for decrypt data
2020-12-04 20:28:05 +01:00
if (preg_match_all('/__DECRYPT\(\'([A-Za-z0-9_]+)\'\)__/i', $newsql, $reg)) {
$num = count($reg[0]);
2020-12-04 20:28:05 +01:00
for ($j = 0; $j < $num; $j++) {
$from = $reg[0][$j];
$to = $db->decrypt($reg[1][$j]);
$newsql = str_replace($from, $to, $newsql);
}
$sqlmodified++;
}
2022-06-07 16:05:01 +02:00
// Replace __x__ with the rowid of the result of the insert number x
2020-12-04 20:28:05 +01:00
while (preg_match('/__([0-9]+)__/', $newsql, $reg)) {
$cursor = $reg[1];
2020-12-04 20:28:05 +01:00
if (empty($listofinsertedrowid[$cursor])) {
if (!$silent) {
2021-08-18 19:32:07 +02:00
print '<tr><td class="tdtop"'.($colspan ? ' colspan="'.$colspan.'"' : '').'>';
print '<div class="error">'.$langs->trans("FileIsNotCorrect")."</div>";
print '</td></tr>';
2020-12-04 20:28:05 +01:00
}
$error++;
break;
}
2022-07-12 10:56:03 +02:00
$from = '__'.$cursor.'__';
$to = $listofinsertedrowid[$cursor];
$newsql = str_replace($from, $to, $newsql);
$sqlmodified++;
}
2020-12-04 20:28:05 +01:00
if ($sqlmodified) {
dol_syslog('Admin.lib::run_sql New Request '.($i + 1), LOG_DEBUG);
}
$result = $db->query($newsql, $usesavepoint);
2020-12-04 20:28:05 +01:00
if ($result) {
if (!$silent) {
print '<!-- Result = OK -->'."\n";
}
2020-12-04 20:28:05 +01:00
if (preg_replace('/insert into ([^\s]+)/i', $newsql, $reg)) {
$cursorinsert++;
// It's an insert
$table = preg_replace('/([^a-zA-Z_]+)/i', '', $reg[1]);
$insertedrowid = $db->last_insert_id($table);
$listofinsertedrowid[$cursorinsert] = $insertedrowid;
dol_syslog('Admin.lib::run_sql Insert nb '.$cursorinsert.', done in table '.$table.', rowid is '.$listofinsertedrowid[$cursorinsert], LOG_DEBUG);
}
// print '<td class="right">OK</td>';
} else {
$errno = $db->errno();
2020-12-04 20:28:05 +01:00
if (!$silent) {
print '<!-- Result = '.$errno.' -->'."\n";
}
2011-09-21 17:53:54 +02:00
// Define list of errors we accept (array $okerrors)
$okerrors = array( // By default
'DB_ERROR_TABLE_ALREADY_EXISTS',
'DB_ERROR_COLUMN_ALREADY_EXISTS',
'DB_ERROR_KEY_NAME_ALREADY_EXISTS',
'DB_ERROR_TABLE_OR_KEY_ALREADY_EXISTS', // PgSql use same code for table and key already exist
'DB_ERROR_RECORD_ALREADY_EXISTS',
'DB_ERROR_NOSUCHTABLE',
'DB_ERROR_NOSUCHFIELD',
'DB_ERROR_NO_FOREIGN_KEY_TO_DROP',
'DB_ERROR_NO_INDEX_TO_DROP',
'DB_ERROR_CANNOT_CREATE', // Qd contrainte deja existante
'DB_ERROR_CANT_DROP_PRIMARY_KEY',
2016-04-28 13:56:17 +02:00
'DB_ERROR_PRIMARY_KEY_ALREADY_EXISTS',
'DB_ERROR_22P02'
);
2020-12-04 20:28:05 +01:00
if ($okerror == 'none') {
$okerrors = array();
}
// Is it an error we accept
2020-12-04 20:28:05 +01:00
if (!in_array($errno, $okerrors)) {
if (!$silent) {
2021-08-18 19:32:07 +02:00
print '<tr><td class="tdtop"'.($colspan ? ' colspan="'.$colspan.'"' : '').'>';
2023-06-26 22:16:19 +02:00
print '<div class="error">'.$langs->trans("Error")." ".$db->errno()." (Req ".($i + 1)."): ".$newsql."<br>".$db->error()."</div>";
2021-08-18 19:32:07 +02:00
print '</td></tr>'."\n";
2020-12-04 20:28:05 +01:00
}
dol_syslog('Admin.lib::run_sql Request '.($i + 1)." Error ".$db->errno()." ".$newsql."<br>".$db->error(), LOG_ERR);
$error++;
}
}
}
}
if (!$silent) {
print '<tr><td>'.$langs->trans("ProcessMigrateScript").'</td>';
print '<td class="right">';
if ($error == 0) {
print '<span class="ok">'.$langs->trans("OK").'</span>';
} else {
print '<span class="error">'.$langs->trans("Error").'</span>';
}
2021-02-27 12:45:07 +01:00
//if (!empty($conf->use_javascript_ajax)) { // use_javascript_ajax is not defined
print '<script type="text/javascript">
2021-02-27 12:45:07 +01:00
jQuery(document).ready(function() {
2022-02-23 19:24:17 +01:00
function init_trrunsql'.$keyforsql.'()
2021-02-27 12:45:07 +01:00
{
2022-02-23 19:24:17 +01:00
console.log("toggle .trforrunsql'.$keyforsql.'");
jQuery(".trforrunsql'.$keyforsql.'").toggle();
2021-02-27 12:45:07 +01:00
}
2022-02-23 19:24:17 +01:00
init_trrunsql'.$keyforsql.'();
jQuery(".trforrunsqlshowhide'.$keyforsql.'").click(function() {
init_trrunsql'.$keyforsql.'();
});
2021-02-27 12:45:07 +01:00
});
</script>';
if (count($arraysql)) {
print ' - <a class="trforrunsqlshowhide'.$keyforsql.'" href="#" title="'.($langs->trans("ShowHideTheNRequests", count($arraysql))).'">'.$langs->trans("ShowHideDetails").'</a>';
} else {
print ' - <span class="opacitymedium">'.$langs->trans("ScriptIsEmpty").'</span>';
}
//}
2021-02-27 12:45:07 +01:00
print '</td></tr>'."\n";
}
if ($error == 0) {
$ok = 1;
} else {
2024-05-30 13:37:17 +02:00
$ok = 0;
}
return $ok;
}
/**
2021-09-02 13:25:00 +02:00
* Delete a constant
2011-09-16 20:25:10 +02:00
*
* @param DoliDB $db Database handler
2024-08-24 14:25:51 +02:00
* @param int|string $name Name of constant or rowid of line
2011-09-16 20:25:10 +02:00
* @param int $entity Multi company id, -1 for all entities
2023-12-01 19:51:32 +01:00
* @return int Return integer <0 if KO, >0 if OK
2011-09-16 20:25:10 +02:00
*
2019-03-11 01:01:15 +01:00
* @see dolibarr_get_const(), dolibarr_set_const(), dol_set_user_param()
2009-05-04 22:57:26 +02:00
*/
function dolibarr_del_const($db, $name, $entity = 1)
{
2024-08-20 03:31:02 +02:00
global $conf, $hookmanager;
2011-09-21 17:53:54 +02:00
2020-12-04 20:28:05 +01:00
if (empty($name)) {
2024-01-20 09:22:38 +01:00
dol_print_error(null, 'Error call dolibar_del_const with parameter name empty');
return -1;
}
2024-08-20 03:31:02 +02:00
if (! is_object($hookmanager)) {
require_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php';
$hookmanager = new HookManager($db);
}
$parameters = array(
'name' => $name,
'entity' => $entity,
);
$reshook = $hookmanager->executeHooks('dolibarrDelConst', $parameters); // Note that $action and $object may have been modified by some hooks
if ($reshook != 0) {
return $reshook;
}
$sql = "DELETE FROM ".MAIN_DB_PREFIX."const";
2024-08-24 14:25:51 +02:00
$sql .= " WHERE (".$db->decrypt('name')." = '".$db->escape((string) $name)."'";
if (is_numeric($name)) { // This case seems used in the setup of constant page only, to delete a line.
2021-09-02 13:25:00 +02:00
$sql .= " OR rowid = ".((int) $name);
2020-12-04 20:28:05 +01:00
}
$sql .= ")";
2020-12-04 20:28:05 +01:00
if ($entity >= 0) {
2021-05-02 16:24:52 +02:00
$sql .= " AND entity = ".((int) $entity);
2020-12-04 20:28:05 +01:00
}
2011-09-21 17:53:54 +02:00
dol_syslog("admin.lib::dolibarr_del_const", LOG_DEBUG);
$resql = $db->query($sql);
2020-12-04 20:28:05 +01:00
if ($resql) {
$conf->global->$name = '';
return 1;
} else {
dol_print_error($db);
return -1;
}
}
/**
2021-04-10 12:44:41 +02:00
* Get the value of a setup constant from database
2011-09-16 20:25:10 +02:00
*
* @param DoliDB $db Database handler
2021-04-10 12:44:41 +02:00
* @param string $name Name of constant
2011-09-16 20:25:10 +02:00
* @param int $entity Multi company id
2021-04-10 12:44:41 +02:00
* @return string Value of constant
2011-09-16 20:25:10 +02:00
*
2019-03-11 01:01:15 +01:00
* @see dolibarr_del_const(), dolibarr_set_const(), dol_set_user_param()
2009-05-04 22:57:26 +02:00
*/
function dolibarr_get_const($db, $name, $entity = 1)
{
$value = '';
2011-09-21 17:53:54 +02:00
$sql = "SELECT ".$db->decrypt('value')." as value";
$sql .= " FROM ".MAIN_DB_PREFIX."const";
2021-09-02 13:25:00 +02:00
$sql .= " WHERE name = ".$db->encrypt($name);
2021-04-10 12:44:41 +02:00
$sql .= " AND entity = ".((int) $entity);
2011-09-21 17:53:54 +02:00
dol_syslog("admin.lib::dolibarr_get_const", LOG_DEBUG);
$resql = $db->query($sql);
2020-12-04 20:28:05 +01:00
if ($resql) {
$obj = $db->fetch_object($resql);
2020-12-04 20:28:05 +01:00
if ($obj) {
include_once DOL_DOCUMENT_ROOT.'/core/lib/security.lib.php';
$value = dolDecrypt($obj->value);
2020-12-04 20:28:05 +01:00
}
}
return $value;
}
/**
* Insert a parameter (key,value) into database (delete old key then insert it again).
2011-09-16 20:25:10 +02:00
*
* @param DoliDB $db Database handler
* @param string $name Name of constant
* @param int|string $value Value of constant
* @param string $type Type of constant. Deprecated, only strings are allowed for $value. Caller must json encode/decode to store other type of data.
2011-09-16 20:25:10 +02:00
* @param int $visible Is constant visible in Setup->Other page (0 by default)
* @param string $note Note on parameter
* @param int $entity Multi company id (0 means all entities)
* @return int -1 if KO, 1 if OK
*
2019-03-11 01:01:15 +01:00
* @see dolibarr_del_const(), dolibarr_get_const(), dol_set_user_param()
2009-05-04 22:57:26 +02:00
*/
function dolibarr_set_const($db, $name, $value, $type = 'chaine', $visible = 0, $note = '', $entity = 1)
{
global $conf, $hookmanager;
// Clean parameters
$name = trim($name);
fix ignored phpstan (most of expects string, int given) (#30649) * fix ignored phpstan * fix ignored phpstan * fix ignored phpstan * fix ignored phpstan * fix ignored phpstan * fix ignored phpstan * fix ignored phpstan * fix ignored phpstan * fix ignored phpstan * fix ignored phpstan * fix ignored phpstan * fix ignored phpstan * fix ignored phpstan * fix ignored phpstan * fix ignored phpstan * fix ignored phpstan * fix ignored phpstan * fix ignored phpstan * fix ignored phpstan * fix ignored phpstan * fix ignored phpstan * fix ignored phpstan * fix ignored phpstan * fix ignored phpstan * fix ignored phpstan * fix ignored phpstan * fix ignored phpstan * fix ignored phpstan * fix ignored phpstan * fix ignored phpstan * fix ignored phpstan * fix ignored phpstan * fix ignored phpstan * fix ignored phpstan * fix ignored phpstan * fix ignored phpstan * fix ignored phpstan * fix ignored phpstan * fix ignored phpstan * fix ignored phpstan * fix ignored phpstan * fix ignored phpstan * fix ignored phpstan * fix ignored phpstan fix ignored phpstan fix ignored phpstan fix ignored phpstan * fix ignored phpstan * fix ignored phpstan * fix ignored phpstan * fix ignored phpstan * fix ignored phpstan * fix ignored phpstan fix ignored phpstan fix ignored phpstan fix ignored phpstan fix ignored phpstan fix ignored phpstan * fix ignored phpstan * fix ignored phpstan * fix ignored phpstan * fix ignored phpstan * fix ignored phpstan * fix ignored phpstan * fix ignored phpstan * fix ignored phpstan * fix ignored phpstan * fix ignored phpstan * more ignore * more ignore * more ignore * more ignore * more ignore * more ignore * more ignore * more ignore * more ignore * more ignore * more ignore * more ignore * more ignore * more ignore * more ignore * more ignore * more ignore * fix phpstan * fix phpstan * fix phpstan * fix phpstan * fix phpstan * fix phpstan * fix phpstan * fix phpstan * fix phpstan * fix phpstan * fix phpstan * fix phpstan * fix phpstan * fix phpstan * fix phpstan * fix phpstan * fix phpstan * fix phpstan * fix phpstan * fix phpstan * fix phpstan * fix phpstan * fix phpstan * fix phpstan * fix phpstan * fix phpstan * fix phpstan * fix phpstan
2024-09-05 16:05:37 +02:00
$value = (string) $value;
// Check parameters
2020-12-04 20:28:05 +01:00
if (empty($name)) {
2024-03-26 12:51:02 +01:00
dol_print_error($db, "Error: Call to function dolibarr_set_const with wrong parameters");
exit;
}
if (! is_object($hookmanager)) {
require_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php';
$hookmanager = new HookManager($db);
}
$value = (string) $value; // We force type string (may be int)
$parameters = array(
'name' => $name,
'value' => $value,
'type' => $type,
'visible' => $visible,
'note' => $note,
'entity' => $entity,
);
$reshook = $hookmanager->executeHooks('dolibarrSetConst', $parameters); // Note that $action and $object may have been modified by some hooks
if ($reshook != 0) {
return $reshook;
}
//dol_syslog("dolibarr_set_const name=$name, value=$value type=$type, visible=$visible, note=$note entity=$entity");
2010-01-21 23:44:57 +01:00
$db->begin();
$sql = "DELETE FROM ".MAIN_DB_PREFIX."const";
2021-09-02 13:25:00 +02:00
$sql .= " WHERE name = ".$db->encrypt($name);
2020-12-04 20:28:05 +01:00
if ($entity >= 0) {
2021-04-10 12:44:41 +02:00
$sql .= " AND entity = ".((int) $entity);
2020-12-04 20:28:05 +01:00
}
dol_syslog("admin.lib::dolibarr_set_const", LOG_DEBUG);
$resql = $db->query($sql);
2020-12-04 20:28:05 +01:00
if (strcmp($value, '')) { // true if different. Must work for $value='0' or $value=0
if (!preg_match('/^(MAIN_LOGEVENTS|MAIN_AGENDA_ACTIONAUTO)/', $name) && (preg_match('/(_KEY|_EXPORTKEY|_SECUREKEY|_SERVERKEY|_PASS|_PASSWORD|_PW|_PW_TICKET|_PW_EMAILING|_SECRET|_SECURITY_TOKEN|_WEB_TOKEN)$/', $name))) {
// This seems a sensitive constant, we encrypt its value
// To list all sensitive constant, you can make a
// WHERE name like '%\_KEY' or name like '%\_EXPORTKEY' or name like '%\_SECUREKEY' or name like '%\_SERVERKEY' or name like '%\_PASS' or name like '%\_PASSWORD' or name like '%\_SECRET'
// or name like '%\_SECURITY_TOKEN' or name like '%\WEB_TOKEN'
include_once DOL_DOCUMENT_ROOT.'/core/lib/security.lib.php';
$newvalue = dolEncrypt($value);
} else {
$newvalue = $value;
}
$sql = "INSERT INTO ".MAIN_DB_PREFIX."const(name, value, type, visible, note, entity)";
$sql .= " VALUES (";
2021-09-02 13:25:00 +02:00
$sql .= $db->encrypt($name);
$sql .= ", ".$db->encrypt($newvalue);
$sql .= ", '".$db->escape($type)."', ".((int) $visible).", '".$db->escape($note)."', ".((int) $entity).")";
//print "sql".$value."-".pg_escape_string($value)."-".$sql;exit;
//print "xx".$db->escape($value);
dol_syslog("admin.lib::dolibarr_set_const", LOG_DEBUG);
$resql = $db->query($sql);
}
2011-09-21 17:53:54 +02:00
2020-12-04 20:28:05 +01:00
if ($resql) {
$db->commit();
$conf->global->$name = $value;
return 1;
} else {
$db->rollback();
return -1;
}
}
/**
* Prepare array with list of tabs
*
* @param int $nbofactivatedmodules Number if activated modules
* @param int $nboftotalmodules Nb of total modules
* @param int $nbmodulesnotautoenabled Nb of modules not auto enabled that are activated
* @return array<array{0:string,1:string,2:string}> Array of tabs to show
*/
function modules_prepare_head($nbofactivatedmodules, $nboftotalmodules, $nbmodulesnotautoenabled)
{
2024-06-19 18:21:19 +02:00
global $langs, $form;
2021-03-27 13:59:50 +01:00
$desc = $langs->trans("ModulesDesc", '{picto}');
$desc = str_replace('{picto}', img_picto('', 'switch_off'), $desc);
$h = 0;
$head = array();
$mode = getDolGlobalString('MAIN_MODULE_SETUP_ON_LIST_BY_DEFAULT', 'commonkanban');
2020-12-04 20:28:05 +01:00
$head[$h][0] = DOL_URL_ROOT."/admin/modules.php?mode=".$mode;
if ($nbmodulesnotautoenabled <= getDolGlobalInt('MAIN_MIN_NB_ENABLED_MODULE_FOR_WARNING', 1)) { // If only minimal initial modules enabled)
2021-11-25 09:40:54 +01:00
//$head[$h][1] = $form->textwithpicto($langs->trans("AvailableModules"), $desc);
$head[$h][1] = $langs->trans("AvailableModules");
2022-01-12 16:09:31 +01:00
$head[$h][1] .= $form->textwithpicto('', $langs->trans("YouMustEnableOneModule").'.<br><br><span class="opacitymedium">'.$desc.'</span>', 1, 'warning');
2021-03-27 13:59:50 +01:00
} else {
//$head[$h][1] = $langs->trans("AvailableModules").$form->textwithpicto('<span class="badge marginleftonly">'.$nbofactivatedmodules.' / '.$nboftotalmodules.'</span>', $desc, 1, 'help', '', 1, 3);
$head[$h][1] = $langs->trans("AvailableModules").'<span class="badge marginleftonly">'.$nbofactivatedmodules.' / '.$nboftotalmodules.'</span>';
}
2020-12-04 20:28:05 +01:00
$head[$h][2] = 'modules';
$h++;
$head[$h][0] = DOL_URL_ROOT."/admin/modules.php?mode=marketplace";
$head[$h][1] = $langs->trans("ModulesMarketPlaces");
$head[$h][2] = 'marketplace';
$h++;
$head[$h][0] = DOL_URL_ROOT."/admin/modules.php?mode=deploy";
$head[$h][1] = $langs->trans("AddExtensionThemeModuleOrOther");
$head[$h][2] = 'deploy';
$h++;
$head[$h][0] = DOL_URL_ROOT."/admin/modules.php?mode=develop";
$head[$h][1] = $langs->trans("ModulesDevelopYourModule");
$head[$h][2] = 'develop';
$h++;
return $head;
}
2021-08-17 21:29:15 +02:00
/**
* Prepare array with list of tabs
*
* @return array<array{0:string,1:string,2:string}> Array of tabs to show
2021-08-17 21:29:15 +02:00
*/
function ihm_prepare_head()
{
global $langs, $conf, $user;
$h = 0;
$head = array();
2021-09-10 10:18:46 +02:00
$head[$h][0] = DOL_URL_ROOT."/admin/ihm.php?mode=other";
$head[$h][1] = $langs->trans("LanguageAndPresentation");
$head[$h][2] = 'other';
2021-08-17 21:29:15 +02:00
$h++;
$head[$h][0] = DOL_URL_ROOT."/admin/ihm.php?mode=template";
2021-09-10 10:18:46 +02:00
$head[$h][1] = $langs->trans("SkinAndColors");
2021-08-17 21:29:15 +02:00
$head[$h][2] = 'template';
$h++;
$head[$h][0] = DOL_URL_ROOT."/admin/ihm.php?mode=dashboard";
$head[$h][1] = $langs->trans("Dashboard");
$head[$h][2] = 'dashboard';
$h++;
2021-08-17 21:29:15 +02:00
$head[$h][0] = DOL_URL_ROOT."/admin/ihm.php?mode=login";
$head[$h][1] = $langs->trans("LoginPage");
$head[$h][2] = 'login';
$h++;
$head[$h][0] = DOL_URL_ROOT."/admin/ihm.php?mode=css";
$head[$h][1] = $langs->trans("CSSPage");
$head[$h][2] = 'css';
$h++;
2021-08-17 21:29:15 +02:00
complete_head_from_modules($conf, $langs, null, $head, $h, 'ihm_admin');
complete_head_from_modules($conf, $langs, null, $head, $h, 'ihm_admin', 'remove');
return $head;
}
/**
2012-02-04 10:48:47 +01:00
* Prepare array with list of tabs
2011-09-16 20:25:10 +02:00
*
* @return array<array{0:string,1:string,2:string}> Array of tabs to show
2008-11-26 20:37:25 +01:00
*/
function security_prepare_head()
{
global $db, $langs, $conf, $user;
$h = 0;
$head = array();
$head[$h][0] = DOL_URL_ROOT."/admin/security_other.php";
$head[$h][1] = $langs->trans("Miscellaneous");
$head[$h][2] = 'misc';
$h++;
2024-09-27 18:55:19 +02:00
$head[$h][0] = DOL_URL_ROOT."/admin/security_captcha.php";
$head[$h][1] = $langs->trans("Captcha");
$head[$h][2] = 'captcha';
$h++;
$head[$h][0] = DOL_URL_ROOT."/admin/security.php";
$head[$h][1] = $langs->trans("Passwords");
$head[$h][2] = 'passwords';
$h++;
$head[$h][0] = DOL_URL_ROOT."/admin/security_file.php";
$head[$h][1] = $langs->trans("Files").' ('.$langs->trans("Upload").')';
$head[$h][2] = 'file';
$h++;
/*
2020-12-04 20:28:05 +01:00
$head[$h][0] = DOL_URL_ROOT."/admin/security_file_download.php";
$head[$h][1] = $langs->trans("Files").' ('.$langs->trans("Download").')';
$head[$h][2] = 'filedownload';
$h++;
2017-08-18 16:10:21 +02:00
*/
$head[$h][0] = DOL_URL_ROOT."/admin/proxy.php";
$head[$h][1] = $langs->trans("ExternalAccess");
$head[$h][2] = 'proxy';
$h++;
$head[$h][0] = DOL_URL_ROOT."/admin/events.php";
$head[$h][1] = $langs->trans("Audit");
$head[$h][2] = 'audit';
$h++;
2009-01-21 15:09:42 +01:00
2018-01-25 12:06:22 +01:00
// Show permissions lines
$nbPerms = 0;
$sql = "SELECT COUNT(r.id) as nb";
$sql .= " FROM ".MAIN_DB_PREFIX."rights_def as r";
$sql .= " WHERE r.libelle NOT LIKE 'tou%'"; // On ignore droits "tous"
2021-09-02 13:25:00 +02:00
$sql .= " AND entity = ".((int) $conf->entity);
$sql .= " AND bydefault = 1";
2023-11-27 11:39:32 +01:00
if (!getDolGlobalString('MAIN_USE_ADVANCED_PERMS')) {
2020-12-04 20:28:05 +01:00
$sql .= " AND r.perms NOT LIKE '%_advance'"; // Hide advanced perms if option is not enabled
}
$resql = $db->query($sql);
2020-12-04 20:28:05 +01:00
if ($resql) {
$obj = $db->fetch_object($resql);
2020-12-04 20:28:05 +01:00
if ($obj) {
$nbPerms = $obj->nb;
}
} else {
dol_print_error($db);
}
2024-04-26 23:45:39 +02:00
if (getDolGlobalString('MAIN_SECURITY_USE_DEFAULT_PERMISSIONS')) {
$head[$h][0] = DOL_URL_ROOT."/admin/perms.php";
$head[$h][1] = $langs->trans("DefaultRights");
if ($nbPerms > 0) {
$head[$h][1] .= (!getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER') ? '<span class="badge marginleftonlyshort">'.$nbPerms.'</span>' : '');
}
$head[$h][2] = 'default';
$h++;
2020-12-04 20:28:05 +01:00
}
return $head;
}
/**
* Prepare array with list of tabs
2023-12-03 20:32:08 +01:00
*
Qual: Fix PhanPluginUnknownObjectMethodCall ("part 1") (#30563) * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add typing hint to fix phan notice. * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add typing hint in phan config to fix phan notice. * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint to fix phan notice. * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for linkedObjectBlock * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for linkedObjectBlock * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for linkedObjects * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Fix: MemberNumRefNumbers getExample does not take any arguments Found thanks to adding the typing for phan! * Qual: Correct forced type for $module * Qual: Ignore phan false positive * Qual: phan/Correct module type and ignore false positive * Qual: phan/Ignore false positive * Qual: phan/Ignore false positive, replace depr.prop with method * Qual: Fix typing for count by adding is_array check * Qual: replace depr.prop `nom` with method * Qual: phan/Correct module type and ignore false positive * Qual: phan/Correct module type and ignore false positive * Qual: phan/Correct module type and ignore false positive * Qual: phan/Fix depr.prop with getter and ignore false positive * Qual: phan/Correct module type and ignore false positive * Qual: phan/Correct module type and ignore false positive * Qual: phan/Correct module type and ignore false positive * Qual: Improve typing for mymodule template * Make info method arguments match calls * Make PrintingDriver abstract class because we added abstract methods * Add phpdoc typing for phan * Update getExample function signature for compatibility * Update getExample function signature for compatibility * Update getExample function signature for compatibility * Update header wit correct information * Update getExample method signature * Update getExample method signature * Correct reference to class in comment * Force php phan typing for numbering modules * Correct $_GLOBALS to $GLOBALS * Add phpdoc to indicat type of properties * Correct default to null * Improve getNextValue typehint * Improve getNextValue typehint * Qual: Improve ModeleNumRefTakepos typing * Qual: Improve ModeleNumRefRecruitmentJobPosition typing * Fix default for $langs * Do not use non-existing ModeleNumRefTakepos::nom * Allow getNextValue argument to be null * Correct $_GLOBAL into $GLOBALS * Improve typing for ldap functions * Allow null for outputlangs argument * Improve typing for printOriginLine * Improve typing for linkedObject access * Fix PhanTypeMismatchArgumentNullableInternal and optimize * Fix PhanPossiblyUndeclaredVariable by setting default value * Ignore PhanPluginDuplicateExpressionAssignmentOperation - needs PHP7.4 * getToolTip does not accept null, changed to '' * Improve getNextValue typing * Change PrintingDriver back to normal class (instantiated) And add errors for functions that should be overloaded * Adjust pringOriginLine typing to match parent * Fix phpdoc for getNextValue * Fix phan typing * Add/Improve phpdoc typing hints * Qual: Adjustments to match typing * Update typing for unit, use GETPOSTINT * ModeleNumRefTask needs Project * Fix several notices appearing after update from develop * Index for choices is int, use GETPOSTINT * Qual: Ignore empty foreach * Force BOMLine on object line * phan typing to indicate that linked objects are BOM * Type the correct variable name (phan) * Add typing for $langs * Type to CommonNumRefGenerator (no class for availabilities) * Resolve several phan notices after update from dev branch * Extra typing fixes * Move common attributes to parent class (phan) * Add typing to Calendar class * Improve typing hints * Add typing to pdf_eagle_proforma * Qual: Add typing for token in generic_oauthcallback.php * Add typing for objMod * Correct getNextValue function signature (phpstan) * Fix typing (phpstan) * Update version declarations (fix phpstan) * Fix phpstan typing issues * Adjust typing (phpstan) * Qual: Update baseline & conf to detect 25% of PhanPluginUnknownObjectMethodCall
2024-08-17 19:32:52 +02:00
* @param DolibarrModules $object Descriptor class
* @return array<array{0:string,1:string,2:string}> Array of tabs to show
*/
function modulehelp_prepare_head($object)
{
2023-12-03 20:32:08 +01:00
global $langs, $conf;
$h = 0;
$head = array();
2019-10-29 11:16:49 +01:00
// FIX for compatibility habitual tabs
$object->id = $object->numero;
$head[$h][0] = DOL_URL_ROOT."/admin/modulehelp.php?id=".$object->id.'&mode=desc';
$head[$h][1] = $langs->trans("Description");
$head[$h][2] = 'desc';
$h++;
$head[$h][0] = DOL_URL_ROOT."/admin/modulehelp.php?id=".$object->id.'&mode=feature';
$head[$h][1] = $langs->trans("TechnicalServicesProvided");
$head[$h][2] = 'feature';
$h++;
2020-12-04 20:28:05 +01:00
if ($object->isCoreOrExternalModule() == 'external') {
$head[$h][0] = DOL_URL_ROOT."/admin/modulehelp.php?id=".$object->id.'&mode=changelog';
$head[$h][1] = $langs->trans("ChangeLog");
$head[$h][2] = 'changelog';
$h++;
}
complete_head_from_modules($conf, $langs, $object, $head, $h, 'modulehelp_admin');
complete_head_from_modules($conf, $langs, $object, $head, $h, 'modulehelp_admin', 'remove');
return $head;
}
/**
* Prepare array with list of tabs
*
* @return array<array{0:string,1:string,2:string}> Array of tabs to show
*/
function translation_prepare_head()
{
2023-12-03 20:32:08 +01:00
global $langs, $conf;
$h = 0;
$head = array();
$head[$h][0] = DOL_URL_ROOT."/admin/translation.php?mode=searchkey";
$head[$h][1] = $langs->trans("TranslationKeySearch");
$head[$h][2] = 'searchkey';
$h++;
$head[$h][0] = DOL_URL_ROOT."/admin/translation.php?mode=overwrite";
2021-10-18 16:22:19 +02:00
$head[$h][1] = '<span class="valignmiddle">'.$langs->trans("TranslationOverwriteKey").'</span><span class="fa fa-plus-circle valignmiddle paddingleft"></span>';
$head[$h][2] = 'overwrite';
$h++;
2020-07-24 01:50:57 +02:00
complete_head_from_modules($conf, $langs, null, $head, $h, 'translation_admin');
complete_head_from_modules($conf, $langs, null, $head, $h, 'translation_admin', 'remove');
return $head;
}
/**
* Prepare array with list of tabs
*
* @return array<array{0:string,1:string,2:string}> Array of tabs to show
*/
function defaultvalues_prepare_head()
{
global $langs, $conf, $user;
$h = 0;
$head = array();
$head[$h][0] = DOL_URL_ROOT."/admin/defaultvalues.php?mode=createform";
$head[$h][1] = $langs->trans("DefaultCreateForm");
$head[$h][2] = 'createform';
$h++;
2017-04-10 12:51:52 +02:00
$head[$h][0] = DOL_URL_ROOT."/admin/defaultvalues.php?mode=filters";
$head[$h][1] = $langs->trans("DefaultSearchFilters");
$head[$h][2] = 'filters';
$h++;
2017-04-10 12:51:52 +02:00
$head[$h][0] = DOL_URL_ROOT."/admin/defaultvalues.php?mode=sortorder";
$head[$h][1] = $langs->trans("DefaultSortOrder");
$head[$h][2] = 'sortorder';
$h++;
2020-12-04 20:28:05 +01:00
if (!empty($conf->use_javascript_ajax)) {
$head[$h][0] = DOL_URL_ROOT."/admin/defaultvalues.php?mode=focus";
$head[$h][1] = $langs->trans("DefaultFocus");
$head[$h][2] = 'focus';
$h++;
$head[$h][0] = DOL_URL_ROOT."/admin/defaultvalues.php?mode=mandatory";
$head[$h][1] = $langs->trans("DefaultMandatory");
$head[$h][2] = 'mandatory';
$h++;
}
2018-09-27 16:38:18 +02:00
/*$head[$h][0] = DOL_URL_ROOT."/admin/translation.php?mode=searchkey";
2020-12-04 20:28:05 +01:00
$head[$h][1] = $langs->trans("TranslationKeySearch");
$head[$h][2] = 'searchkey';
$h++;*/
complete_head_from_modules($conf, $langs, null, $head, $h, 'defaultvalues_admin');
complete_head_from_modules($conf, $langs, null, $head, $h, 'defaultvalues_admin', 'remove');
return $head;
}
/**
* Return list of session
2011-09-16 20:25:10 +02:00
*
2024-03-23 19:52:06 +01:00
* @return array<string,array{login:string,age:int,creation:int,modification:int,raw:string}> Array list of sessions
*/
function listOfSessions()
{
global $conf;
$arrayofSessions = array();
// session.save_path can be returned empty so we set a default location and work from there
$sessPath = '/tmp';
$iniPath = ini_get("session.save_path");
if ($iniPath) {
$sessPath = $iniPath;
}
$sessPath .= '/'; // We need the trailing slash
dol_syslog('admin.lib:listOfSessions sessPath='.$sessPath);
2011-09-21 17:53:54 +02:00
$dh = @opendir(dol_osencode($sessPath));
2020-12-04 20:28:05 +01:00
if ($dh) {
while (($file = @readdir($dh)) !== false) {
if (preg_match('/^sess_/i', $file) && $file != "." && $file != "..") {
$fullpath = $sessPath.$file;
2020-12-04 20:28:05 +01:00
if (!@is_dir($fullpath) && is_readable($fullpath)) {
$sessValues = file_get_contents($fullpath); // get raw session data
// Example of possible value
2018-05-27 15:04:12 +02:00
//$sessValues = 'newtoken|s:32:"1239f7a0c4b899200fe9ca5ea394f307";dol_loginmesg|s:0:"";newtoken|s:32:"1236457104f7ae0f328c2928973f3cb5";dol_loginmesg|s:0:"";token|s:32:"123615ad8d650c5cc4199b9a1a76783f";
// dol_login|s:5:"admin";dol_authmode|s:8:"dolibarr";dol_tz|s:1:"1";dol_tz_string|s:13:"Europe/Berlin";dol_dst|i:0;dol_dst_observed|s:1:"1";dol_dst_first|s:0:"";dol_dst_second|s:0:"";dol_screenwidth|s:4:"1920";
// dol_screenheight|s:3:"971";dol_company|s:12:"MyBigCompany";dol_entity|i:1;mainmenu|s:4:"home";leftmenuopened|s:10:"admintools";idmenu|s:0:"";leftmenu|s:10:"admintools";';
if (preg_match('/dol_login/i', $sessValues) && // limit to dolibarr session
(preg_match('/dol_entity\|i:'.$conf->entity.';/i', $sessValues) || preg_match('/dol_entity\|s:([0-9]+):"'.$conf->entity.'"/i', $sessValues)) && // limit to current entity
2021-04-23 18:01:11 +02:00
preg_match('/dol_company\|s:([0-9]+):"('.getDolGlobalString('MAIN_INFO_SOCIETE_NOM').')"/i', $sessValues)) { // limit to company name
$tmp = explode('_', $file);
$idsess = $tmp[1];
$regs = array();
$loginfound = preg_match('/dol_login\|s:[0-9]+:"([A-Za-z0-9]+)"/i', $sessValues, $regs);
2020-12-04 20:28:05 +01:00
if ($loginfound) {
$arrayofSessions[$idsess]["login"] = $regs[1];
}
$arrayofSessions[$idsess]["age"] = time() - filectime($fullpath);
$arrayofSessions[$idsess]["creation"] = filectime($fullpath);
$arrayofSessions[$idsess]["modification"] = filemtime($fullpath);
$arrayofSessions[$idsess]["raw"] = $sessValues;
}
}
}
}
@closedir($dh);
}
2011-09-21 17:53:54 +02:00
return $arrayofSessions;
}
/**
* Purge existing sessions
2011-09-16 20:25:10 +02:00
*
2024-07-06 14:30:13 +02:00
* @param string $mysessionid To avoid to try to delete my own session
2011-09-16 20:25:10 +02:00
* @return int >0 if OK, <0 if KO
*/
function purgeSessions($mysessionid)
{
global $conf;
2011-09-21 17:53:54 +02:00
$sessPath = ini_get("session.save_path")."/";
dol_syslog('admin.lib:purgeSessions mysessionid='.$mysessionid.' sessPath='.$sessPath);
2011-09-21 17:53:54 +02:00
$error = 0;
2020-12-07 15:51:22 +01:00
$dh = @opendir(dol_osencode($sessPath));
2020-12-07 15:51:22 +01:00
if ($dh) {
while (($file = @readdir($dh)) !== false) {
if ($file != "." && $file != "..") {
$fullpath = $sessPath.$file;
if (!@is_dir($fullpath)) {
$sessValues = file_get_contents($fullpath); // get raw session data
if (preg_match('/dol_login/i', $sessValues) && // limit to dolibarr session
(preg_match('/dol_entity\|i:('.$conf->entity.')/', $sessValues) || preg_match('/dol_entity\|s:([0-9]+):"('.$conf->entity.')"/i', $sessValues)) && // limit to current entity
2023-10-15 15:32:35 +02:00
preg_match('/dol_company\|s:([0-9]+):"(' . getDolGlobalString('MAIN_INFO_SOCIETE_NOM').')"/i', $sessValues)) { // limit to company name
2020-12-07 15:51:22 +01:00
$tmp = explode('_', $file);
$idsess = $tmp[1];
// We remove session if it's not ourself
if ($idsess != $mysessionid) {
$res = @unlink($fullpath);
if (!$res) {
$error++;
}
2020-12-04 20:28:05 +01:00
}
}
}
}
}
2020-12-07 15:51:22 +01:00
@closedir($dh);
}
2020-12-04 20:28:05 +01:00
if (!$error) {
return 1;
} else {
return -$error;
}
}
2010-11-13 19:57:10 +01:00
/**
* Enable a module
2011-09-16 20:25:10 +02:00
*
* @param string $value Name of module to activate
* @param int $withdeps Activate/Disable also all dependencies
* @param int $noconfverification Remove verification of $conf variable for module
2024-03-23 19:52:06 +01:00
* @return array{nbmodules?:int,errors:string[],nbperms?:int} array('nbmodules'=>nb modules activated with success, 'errors=>array of error messages, 'nbperms'=>Nb permission added);
2010-11-13 19:57:10 +01:00
*/
function activateModule($value, $withdeps = 1, $noconfverification = 0)
2010-11-13 19:57:10 +01:00
{
global $db, $langs, $conf, $mysoc;
2019-04-23 10:24:16 +02:00
$ret = array();
2010-11-13 19:57:10 +01:00
// Check parameters
if (empty($value)) {
2024-03-23 19:52:06 +01:00
$ret['errors'] = array('ErrorBadParameter');
return $ret;
}
2010-11-13 19:57:10 +01:00
2024-03-13 00:29:40 +01:00
$ret = array('nbmodules' => 0, 'errors' => array(), 'nbperms' => 0);
$modName = $value;
$modFile = $modName.".class.php";
2010-11-13 19:57:10 +01:00
// Loop on each directory to fill $modulesdir
$modulesdir = dolGetModulesDirs();
2010-11-13 19:57:10 +01:00
// Loop on each modulesdir directories
$found = false;
2020-12-04 20:28:05 +01:00
foreach ($modulesdir as $dir) {
if (file_exists($dir.$modFile)) {
$found = @include_once $dir.$modFile;
2020-12-04 20:28:05 +01:00
if ($found) {
break;
}
}
}
2010-11-13 19:57:10 +01:00
$objMod = new $modName($db);
Qual: Fix PhanPluginUnknownObjectMethodCall ("part 1") (#30563) * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add typing hint to fix phan notice. * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add typing hint in phan config to fix phan notice. * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint to fix phan notice. * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for linkedObjectBlock * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for linkedObjectBlock * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for linkedObjects * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Fix: MemberNumRefNumbers getExample does not take any arguments Found thanks to adding the typing for phan! * Qual: Correct forced type for $module * Qual: Ignore phan false positive * Qual: phan/Correct module type and ignore false positive * Qual: phan/Ignore false positive * Qual: phan/Ignore false positive, replace depr.prop with method * Qual: Fix typing for count by adding is_array check * Qual: replace depr.prop `nom` with method * Qual: phan/Correct module type and ignore false positive * Qual: phan/Correct module type and ignore false positive * Qual: phan/Correct module type and ignore false positive * Qual: phan/Fix depr.prop with getter and ignore false positive * Qual: phan/Correct module type and ignore false positive * Qual: phan/Correct module type and ignore false positive * Qual: phan/Correct module type and ignore false positive * Qual: Improve typing for mymodule template * Make info method arguments match calls * Make PrintingDriver abstract class because we added abstract methods * Add phpdoc typing for phan * Update getExample function signature for compatibility * Update getExample function signature for compatibility * Update getExample function signature for compatibility * Update header wit correct information * Update getExample method signature * Update getExample method signature * Correct reference to class in comment * Force php phan typing for numbering modules * Correct $_GLOBALS to $GLOBALS * Add phpdoc to indicat type of properties * Correct default to null * Improve getNextValue typehint * Improve getNextValue typehint * Qual: Improve ModeleNumRefTakepos typing * Qual: Improve ModeleNumRefRecruitmentJobPosition typing * Fix default for $langs * Do not use non-existing ModeleNumRefTakepos::nom * Allow getNextValue argument to be null * Correct $_GLOBAL into $GLOBALS * Improve typing for ldap functions * Allow null for outputlangs argument * Improve typing for printOriginLine * Improve typing for linkedObject access * Fix PhanTypeMismatchArgumentNullableInternal and optimize * Fix PhanPossiblyUndeclaredVariable by setting default value * Ignore PhanPluginDuplicateExpressionAssignmentOperation - needs PHP7.4 * getToolTip does not accept null, changed to '' * Improve getNextValue typing * Change PrintingDriver back to normal class (instantiated) And add errors for functions that should be overloaded * Adjust pringOriginLine typing to match parent * Fix phpdoc for getNextValue * Fix phan typing * Add/Improve phpdoc typing hints * Qual: Adjustments to match typing * Update typing for unit, use GETPOSTINT * ModeleNumRefTask needs Project * Fix several notices appearing after update from develop * Index for choices is int, use GETPOSTINT * Qual: Ignore empty foreach * Force BOMLine on object line * phan typing to indicate that linked objects are BOM * Type the correct variable name (phan) * Add typing for $langs * Type to CommonNumRefGenerator (no class for availabilities) * Resolve several phan notices after update from dev branch * Extra typing fixes * Move common attributes to parent class (phan) * Add typing to Calendar class * Improve typing hints * Add typing to pdf_eagle_proforma * Qual: Add typing for token in generic_oauthcallback.php * Add typing for objMod * Correct getNextValue function signature (phpstan) * Fix typing (phpstan) * Update version declarations (fix phpstan) * Fix phpstan typing issues * Adjust typing (phpstan) * Qual: Update baseline & conf to detect 25% of PhanPluginUnknownObjectMethodCall
2024-08-17 19:32:52 +02:00
'@phan-var-force DolibarrModules $objMod';
2010-11-13 19:57:10 +01:00
// Test if PHP version ok
$verphp = versionphparray();
$vermin = isset($objMod->phpmin) ? $objMod->phpmin : 0;
if (is_array($vermin) && versioncompare($verphp, $vermin) < 0) {
$ret['errors'][] = $langs->trans("ErrorModuleRequirePHPVersion", versiontostring($vermin));
return $ret;
}
2010-11-13 19:57:10 +01:00
// Test if Dolibarr version ok
$verdol = versiondolibarrarray();
$vermin = isset($objMod->need_dolibarr_version) ? $objMod->need_dolibarr_version : 0;
//print 'version: '.versioncompare($verdol,$vermin).' - '.join(',',$verdol).' - '.join(',',$vermin);exit;
if (is_array($vermin) && versioncompare($verdol, $vermin) < 0) {
$ret['errors'][] = $langs->trans("ErrorModuleRequireDolibarrVersion", versiontostring($vermin));
return $ret;
}
// Test if javascript requirement ok
if (!empty($objMod->need_javascript_ajax) && empty($conf->use_javascript_ajax)) {
$ret['errors'][] = $langs->trans("ErrorModuleRequireJavascript");
return $ret;
}
2010-11-13 19:57:10 +01:00
$const_name = $objMod->const_name;
if ($noconfverification == 0) {
2023-10-16 21:15:03 +02:00
if (getDolGlobalString($const_name)) {
return $ret;
}
}
$result = $objMod->init(); // Enable module
2018-03-15 21:48:51 +01:00
2020-12-04 20:28:05 +01:00
if ($result <= 0) {
$ret['errors'][] = $objMod->error;
} else {
2020-12-04 20:28:05 +01:00
if ($withdeps) {
if (isset($objMod->depends) && is_array($objMod->depends) && !empty($objMod->depends)) {
// Activation of modules this module depends on
2023-04-21 13:27:50 +02:00
// this->depends may be array('modModule1', 'mmodModule2') or array('always'=>array('modModule1'), 'FR'=>array('modModule2"))
foreach ($objMod->depends as $key => $modulestringorarray) {
//var_dump((! is_numeric($key)) && ! preg_match('/^always/', $key) && $mysoc->country_code && ! preg_match('/^'.$mysoc->country_code.'/', $key));exit;
2020-12-04 20:28:05 +01:00
if ((!is_numeric($key)) && !preg_match('/^always/', $key) && $mysoc->country_code && !preg_match('/^'.$mysoc->country_code.'/', $key)) {
dol_syslog("We are not concerned by dependency with key=".$key." because our country is ".$mysoc->country_code);
continue;
}
2023-04-21 13:27:50 +02:00
if (!is_array($modulestringorarray)) {
$modulestringorarray = array($modulestringorarray);
}
2023-04-21 16:02:30 +02:00
foreach ($modulestringorarray as $modulestring) {
2023-04-21 13:27:50 +02:00
$activate = false;
$activateerr = '';
foreach ($modulesdir as $dir) {
if (file_exists($dir.$modulestring.".class.php")) {
$resarray = activateModule($modulestring);
if (empty($resarray['errors'])) {
$activate = true;
} else {
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
$activateerr = implode(', ', $resarray['errors']);
2023-04-21 13:27:50 +02:00
foreach ($resarray['errors'] as $errorMessage) {
dol_syslog($errorMessage, LOG_ERR);
}
}
2023-04-21 13:27:50 +02:00
break;
}
}
2023-04-21 13:27:50 +02:00
if ($activate) {
$ret['nbmodules'] += $resarray['nbmodules'];
$ret['nbperms'] += $resarray['nbperms'];
} else {
if ($activateerr) {
$ret['errors'][] = $activateerr;
}
$ret['errors'][] = $langs->trans('activateModuleDependNotSatisfied', $objMod->name, $modulestring, $objMod->name).'<br>'.$langs->trans('activateModuleDependNotSatisfied2', $modulestring, $objMod->name);
2023-04-21 13:27:50 +02:00
}
}
}
}
2010-11-13 19:57:10 +01:00
2020-12-04 20:28:05 +01:00
if (isset($objMod->conflictwith) && is_array($objMod->conflictwith) && !empty($objMod->conflictwith)) {
// Deactivation des modules qui entrent en conflict
$num = count($objMod->conflictwith);
2020-12-04 20:28:05 +01:00
for ($i = 0; $i < $num; $i++) {
foreach ($modulesdir as $dir) {
if (file_exists($dir.$objMod->conflictwith[$i].".class.php")) {
unActivateModule($objMod->conflictwith[$i], 0);
}
}
}
}
}
}
2020-12-04 20:28:05 +01:00
if (!count($ret['errors'])) {
$ret['nbmodules']++;
2023-12-04 12:05:28 +01:00
$ret['nbperms'] += (is_array($objMod->rights) ? count($objMod->rights) : 0);
}
return $ret;
2010-11-13 19:57:10 +01:00
}
/**
* Disable a module
2011-09-16 20:25:10 +02:00
*
* @param string $value Nom du module a desactiver
* @param int $requiredby 1=Desactive aussi modules dependants
* @return string Error message or '';
2010-11-13 19:57:10 +01:00
*/
function unActivateModule($value, $requiredby = 1)
2010-11-13 19:57:10 +01:00
{
global $db, $modules, $conf;
2010-11-13 19:57:10 +01:00
// Check parameters
2020-12-04 20:28:05 +01:00
if (empty($value)) {
return 'ErrorBadParameter';
}
2010-11-13 19:57:10 +01:00
$ret = '';
$modName = $value;
$modFile = $modName.".class.php";
2011-01-16 02:14:48 +01:00
// Loop on each directory to fill $modulesdir
$modulesdir = dolGetModulesDirs();
2011-01-16 02:14:48 +01:00
// Loop on each modulesdir directories
$found = false;
2020-12-04 20:28:05 +01:00
foreach ($modulesdir as $dir) {
if (file_exists($dir.$modFile)) {
$found = @include_once $dir.$modFile;
2020-12-04 20:28:05 +01:00
if ($found) {
break;
}
}
}
2010-11-13 19:57:10 +01:00
2020-12-04 20:28:05 +01:00
if ($found) {
$objMod = new $modName($db);
Qual: Fix PhanPluginUnknownObjectMethodCall ("part 1") (#30563) * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add typing hint to fix phan notice. * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add typing hint in phan config to fix phan notice. * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint to fix phan notice. * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for linkedObjectBlock * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for linkedObjectBlock * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for linkedObjects * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Fix: MemberNumRefNumbers getExample does not take any arguments Found thanks to adding the typing for phan! * Qual: Correct forced type for $module * Qual: Ignore phan false positive * Qual: phan/Correct module type and ignore false positive * Qual: phan/Ignore false positive * Qual: phan/Ignore false positive, replace depr.prop with method * Qual: Fix typing for count by adding is_array check * Qual: replace depr.prop `nom` with method * Qual: phan/Correct module type and ignore false positive * Qual: phan/Correct module type and ignore false positive * Qual: phan/Correct module type and ignore false positive * Qual: phan/Fix depr.prop with getter and ignore false positive * Qual: phan/Correct module type and ignore false positive * Qual: phan/Correct module type and ignore false positive * Qual: phan/Correct module type and ignore false positive * Qual: Improve typing for mymodule template * Make info method arguments match calls * Make PrintingDriver abstract class because we added abstract methods * Add phpdoc typing for phan * Update getExample function signature for compatibility * Update getExample function signature for compatibility * Update getExample function signature for compatibility * Update header wit correct information * Update getExample method signature * Update getExample method signature * Correct reference to class in comment * Force php phan typing for numbering modules * Correct $_GLOBALS to $GLOBALS * Add phpdoc to indicat type of properties * Correct default to null * Improve getNextValue typehint * Improve getNextValue typehint * Qual: Improve ModeleNumRefTakepos typing * Qual: Improve ModeleNumRefRecruitmentJobPosition typing * Fix default for $langs * Do not use non-existing ModeleNumRefTakepos::nom * Allow getNextValue argument to be null * Correct $_GLOBAL into $GLOBALS * Improve typing for ldap functions * Allow null for outputlangs argument * Improve typing for printOriginLine * Improve typing for linkedObject access * Fix PhanTypeMismatchArgumentNullableInternal and optimize * Fix PhanPossiblyUndeclaredVariable by setting default value * Ignore PhanPluginDuplicateExpressionAssignmentOperation - needs PHP7.4 * getToolTip does not accept null, changed to '' * Improve getNextValue typing * Change PrintingDriver back to normal class (instantiated) And add errors for functions that should be overloaded * Adjust pringOriginLine typing to match parent * Fix phpdoc for getNextValue * Fix phan typing * Add/Improve phpdoc typing hints * Qual: Adjustments to match typing * Update typing for unit, use GETPOSTINT * ModeleNumRefTask needs Project * Fix several notices appearing after update from develop * Index for choices is int, use GETPOSTINT * Qual: Ignore empty foreach * Force BOMLine on object line * phan typing to indicate that linked objects are BOM * Type the correct variable name (phan) * Add typing for $langs * Type to CommonNumRefGenerator (no class for availabilities) * Resolve several phan notices after update from dev branch * Extra typing fixes * Move common attributes to parent class (phan) * Add typing to Calendar class * Improve typing hints * Add typing to pdf_eagle_proforma * Qual: Add typing for token in generic_oauthcallback.php * Add typing for objMod * Correct getNextValue function signature (phpstan) * Fix typing (phpstan) * Update version declarations (fix phpstan) * Fix phpstan typing issues * Adjust typing (phpstan) * Qual: Update baseline & conf to detect 25% of PhanPluginUnknownObjectMethodCall
2024-08-17 19:32:52 +02:00
'@phan-var-force DolibarrModules $objMod';
$result = $objMod->remove();
2020-12-04 20:28:05 +01:00
if ($result <= 0) {
$ret = $objMod->error;
}
2023-12-04 12:05:28 +01:00
} else { // We come here when we try to unactivate a module when module does not exists anymore in sources
//print $dir.$modFile;exit;
// TODO Replace this after DolibarrModules is moved as abstract class with a try catch to show module we try to disable has not been found or could not be loaded
include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php';
$genericMod = new DolibarrModules($db);
$genericMod->name = preg_replace('/^mod/i', '', $modName);
$genericMod->rights_class = strtolower(preg_replace('/^mod/i', '', $modName));
$genericMod->const_name = 'MAIN_MODULE_'.strtoupper(preg_replace('/^mod/i', '', $modName));
dol_syslog("modules::unActivateModule Failed to find module file, we use generic function with name ".$modName);
$genericMod->remove('');
}
2010-11-13 19:57:10 +01:00
// Disable modules that depends on module we disable
2024-10-03 15:39:32 +02:00
if (!$ret && $requiredby && isset($objMod) && is_object($objMod) && is_array($objMod->requiredby)) {
$countrb = count($objMod->requiredby);
2020-12-04 20:28:05 +01:00
for ($i = 0; $i < $countrb; $i++) {
//var_dump($objMod->requiredby[$i]);
unActivateModule($objMod->requiredby[$i]);
}
}
2010-11-13 19:57:10 +01:00
return $ret;
2010-11-13 19:57:10 +01:00
}
/**
2018-03-13 12:13:47 +01:00
* Add external modules to list of dictionaries.
* Addition is done into var $taborder, $tabname, etc... that are passed with pointers.
2011-09-16 20:25:10 +02:00
*
* @param int[] $taborder Taborder
* @param string[] $tabname Tabname
* @param string[] $tablib Tablib
* @param string[] $tabsql Tabsql
* @param string[] $tabsqlsort Tabsqlsort
* @param string[] $tabfield Tabfield
* @param string[] $tabfieldvalue Tabfieldvalue
* @param string[] $tabfieldinsert Tabfieldinsert
* @param string[] $tabrowid Tabrowid
* @param bool[] $tabcond Tabcond
* @param array<array<string,string>> $tabhelp Tabhelp
* @param array<string,array<string,array<string,string>>> $tabcomplete Tab complete (will replace all other in future). Key is table name.
2011-09-16 20:25:10 +02:00
* @return int 1
*/
function complete_dictionary_with_modules(&$taborder, &$tabname, &$tablib, &$tabsql, &$tabsqlsort, &$tabfield, &$tabfieldvalue, &$tabfieldinsert, &$tabrowid, &$tabcond, &$tabhelp, &$tabcomplete)
{
global $db, $langs;
dol_syslog("complete_dictionary_with_modules Search external modules to complete the list of dictionary tables", LOG_DEBUG, 1);
// Search modules
$modulesdir = dolGetModulesDirs();
$i = 0; // is a sequencer of modules found
$j = 0; // j is module number. Automatically affected if module number not defined.
2020-12-04 20:28:05 +01:00
foreach ($modulesdir as $dir) {
// Load modules attributes in arrays (name, numero, orders) from dir directory
//print $dir."\n<br>";
dol_syslog("Scan directory ".$dir." for modules");
$handle = @opendir(dol_osencode($dir));
2020-12-04 20:28:05 +01:00
if (is_resource($handle)) {
while (($file = readdir($handle)) !== false) {
//print "$i ".$file."\n<br>";
2020-12-04 20:28:05 +01:00
if (is_readable($dir.$file) && substr($file, 0, 3) == 'mod' && substr($file, dol_strlen($file) - 10) == '.class.php') {
$modName = substr($file, 0, dol_strlen($file) - 10);
2020-12-04 20:28:05 +01:00
if ($modName) {
include_once $dir.$file;
$objMod = new $modName($db);
Qual: Fix PhanPluginUnknownObjectMethodCall ("part 1") (#30563) * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add typing hint to fix phan notice. * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add typing hint in phan config to fix phan notice. * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint to fix phan notice. * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for linkedObjectBlock * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for linkedObjectBlock * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for linkedObjects * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Fix: MemberNumRefNumbers getExample does not take any arguments Found thanks to adding the typing for phan! * Qual: Correct forced type for $module * Qual: Ignore phan false positive * Qual: phan/Correct module type and ignore false positive * Qual: phan/Ignore false positive * Qual: phan/Ignore false positive, replace depr.prop with method * Qual: Fix typing for count by adding is_array check * Qual: replace depr.prop `nom` with method * Qual: phan/Correct module type and ignore false positive * Qual: phan/Correct module type and ignore false positive * Qual: phan/Correct module type and ignore false positive * Qual: phan/Fix depr.prop with getter and ignore false positive * Qual: phan/Correct module type and ignore false positive * Qual: phan/Correct module type and ignore false positive * Qual: phan/Correct module type and ignore false positive * Qual: Improve typing for mymodule template * Make info method arguments match calls * Make PrintingDriver abstract class because we added abstract methods * Add phpdoc typing for phan * Update getExample function signature for compatibility * Update getExample function signature for compatibility * Update getExample function signature for compatibility * Update header wit correct information * Update getExample method signature * Update getExample method signature * Correct reference to class in comment * Force php phan typing for numbering modules * Correct $_GLOBALS to $GLOBALS * Add phpdoc to indicat type of properties * Correct default to null * Improve getNextValue typehint * Improve getNextValue typehint * Qual: Improve ModeleNumRefTakepos typing * Qual: Improve ModeleNumRefRecruitmentJobPosition typing * Fix default for $langs * Do not use non-existing ModeleNumRefTakepos::nom * Allow getNextValue argument to be null * Correct $_GLOBAL into $GLOBALS * Improve typing for ldap functions * Allow null for outputlangs argument * Improve typing for printOriginLine * Improve typing for linkedObject access * Fix PhanTypeMismatchArgumentNullableInternal and optimize * Fix PhanPossiblyUndeclaredVariable by setting default value * Ignore PhanPluginDuplicateExpressionAssignmentOperation - needs PHP7.4 * getToolTip does not accept null, changed to '' * Improve getNextValue typing * Change PrintingDriver back to normal class (instantiated) And add errors for functions that should be overloaded * Adjust pringOriginLine typing to match parent * Fix phpdoc for getNextValue * Fix phan typing * Add/Improve phpdoc typing hints * Qual: Adjustments to match typing * Update typing for unit, use GETPOSTINT * ModeleNumRefTask needs Project * Fix several notices appearing after update from develop * Index for choices is int, use GETPOSTINT * Qual: Ignore empty foreach * Force BOMLine on object line * phan typing to indicate that linked objects are BOM * Type the correct variable name (phan) * Add typing for $langs * Type to CommonNumRefGenerator (no class for availabilities) * Resolve several phan notices after update from dev branch * Extra typing fixes * Move common attributes to parent class (phan) * Add typing to Calendar class * Improve typing hints * Add typing to pdf_eagle_proforma * Qual: Add typing for token in generic_oauthcallback.php * Add typing for objMod * Correct getNextValue function signature (phpstan) * Fix typing (phpstan) * Update version declarations (fix phpstan) * Fix phpstan typing issues * Adjust typing (phpstan) * Qual: Update baseline & conf to detect 25% of PhanPluginUnknownObjectMethodCall
2024-08-17 19:32:52 +02:00
'@phan-var-force DolibarrModules $objMod';
2020-12-04 20:28:05 +01:00
if ($objMod->numero > 0) {
$j = $objMod->numero;
} else {
$j = 1000 + $i;
}
$modulequalified = 1;
// We discard modules according to features level (PS: if module is activated we always show it)
$const_name = 'MAIN_MODULE_'.strtoupper(preg_replace('/^mod/i', '', get_class($objMod)));
2023-08-27 15:55:44 +02:00
if ($objMod->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2 && !getDolGlobalString($const_name)) {
2020-12-04 20:28:05 +01:00
$modulequalified = 0;
}
2023-08-27 15:55:44 +02:00
if ($objMod->version == 'experimental' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1 && !getDolGlobalString($const_name)) {
2020-12-04 20:28:05 +01:00
$modulequalified = 0;
}
2023-08-27 15:55:44 +02:00
// If module is not activated disqualified
if (!getDolGlobalString($const_name)) {
2020-12-04 20:28:05 +01:00
$modulequalified = 0;
}
2020-12-04 20:28:05 +01:00
if ($modulequalified) {
// Load languages files of module
2018-03-13 12:13:47 +01:00
if (isset($objMod->langfiles) && is_array($objMod->langfiles)) {
foreach ($objMod->langfiles as $langfile) {
$langs->load($langfile);
}
}
// phpcs:disable
// Complete the arrays &$tabname,&$tablib,&$tabsql,&$tabsqlsort,&$tabfield,&$tabfieldvalue,&$tabfieldinsert,&$tabrowid,&$tabcond
Qual: Fix PhanPluginUnknownObjectMethodCall ("part 1") (#30563) * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add typing hint to fix phan notice. * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add typing hint in phan config to fix phan notice. * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint to fix phan notice. * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for linkedObjectBlock * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for linkedObjectBlock * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for linkedObjects * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Fix: MemberNumRefNumbers getExample does not take any arguments Found thanks to adding the typing for phan! * Qual: Correct forced type for $module * Qual: Ignore phan false positive * Qual: phan/Correct module type and ignore false positive * Qual: phan/Ignore false positive * Qual: phan/Ignore false positive, replace depr.prop with method * Qual: Fix typing for count by adding is_array check * Qual: replace depr.prop `nom` with method * Qual: phan/Correct module type and ignore false positive * Qual: phan/Correct module type and ignore false positive * Qual: phan/Correct module type and ignore false positive * Qual: phan/Fix depr.prop with getter and ignore false positive * Qual: phan/Correct module type and ignore false positive * Qual: phan/Correct module type and ignore false positive * Qual: phan/Correct module type and ignore false positive * Qual: Improve typing for mymodule template * Make info method arguments match calls * Make PrintingDriver abstract class because we added abstract methods * Add phpdoc typing for phan * Update getExample function signature for compatibility * Update getExample function signature for compatibility * Update getExample function signature for compatibility * Update header wit correct information * Update getExample method signature * Update getExample method signature * Correct reference to class in comment * Force php phan typing for numbering modules * Correct $_GLOBALS to $GLOBALS * Add phpdoc to indicat type of properties * Correct default to null * Improve getNextValue typehint * Improve getNextValue typehint * Qual: Improve ModeleNumRefTakepos typing * Qual: Improve ModeleNumRefRecruitmentJobPosition typing * Fix default for $langs * Do not use non-existing ModeleNumRefTakepos::nom * Allow getNextValue argument to be null * Correct $_GLOBAL into $GLOBALS * Improve typing for ldap functions * Allow null for outputlangs argument * Improve typing for printOriginLine * Improve typing for linkedObject access * Fix PhanTypeMismatchArgumentNullableInternal and optimize * Fix PhanPossiblyUndeclaredVariable by setting default value * Ignore PhanPluginDuplicateExpressionAssignmentOperation - needs PHP7.4 * getToolTip does not accept null, changed to '' * Improve getNextValue typing * Change PrintingDriver back to normal class (instantiated) And add errors for functions that should be overloaded * Adjust pringOriginLine typing to match parent * Fix phpdoc for getNextValue * Fix phan typing * Add/Improve phpdoc typing hints * Qual: Adjustments to match typing * Update typing for unit, use GETPOSTINT * ModeleNumRefTask needs Project * Fix several notices appearing after update from develop * Index for choices is int, use GETPOSTINT * Qual: Ignore empty foreach * Force BOMLine on object line * phan typing to indicate that linked objects are BOM * Type the correct variable name (phan) * Add typing for $langs * Type to CommonNumRefGenerator (no class for availabilities) * Resolve several phan notices after update from dev branch * Extra typing fixes * Move common attributes to parent class (phan) * Add typing to Calendar class * Improve typing hints * Add typing to pdf_eagle_proforma * Qual: Add typing for token in generic_oauthcallback.php * Add typing for objMod * Correct getNextValue function signature (phpstan) * Fix typing (phpstan) * Update version declarations (fix phpstan) * Fix phpstan typing issues * Adjust typing (phpstan) * Qual: Update baseline & conf to detect 25% of PhanPluginUnknownObjectMethodCall
2024-08-17 19:32:52 +02:00
// @phan-suppress-next-line PhanUndeclaredProperty
if (empty($objMod->dictionaries) && !empty($objMod->{"dictionnaries"})) {
Qual: Fix PhanPluginUnknownObjectMethodCall ("part 1") (#30563) * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add typing hint to fix phan notice. * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add typing hint in phan config to fix phan notice. * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint to fix phan notice. * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for linkedObjectBlock * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for linkedObjectBlock * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for linkedObjects * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Fix: MemberNumRefNumbers getExample does not take any arguments Found thanks to adding the typing for phan! * Qual: Correct forced type for $module * Qual: Ignore phan false positive * Qual: phan/Correct module type and ignore false positive * Qual: phan/Ignore false positive * Qual: phan/Ignore false positive, replace depr.prop with method * Qual: Fix typing for count by adding is_array check * Qual: replace depr.prop `nom` with method * Qual: phan/Correct module type and ignore false positive * Qual: phan/Correct module type and ignore false positive * Qual: phan/Correct module type and ignore false positive * Qual: phan/Fix depr.prop with getter and ignore false positive * Qual: phan/Correct module type and ignore false positive * Qual: phan/Correct module type and ignore false positive * Qual: phan/Correct module type and ignore false positive * Qual: Improve typing for mymodule template * Make info method arguments match calls * Make PrintingDriver abstract class because we added abstract methods * Add phpdoc typing for phan * Update getExample function signature for compatibility * Update getExample function signature for compatibility * Update getExample function signature for compatibility * Update header wit correct information * Update getExample method signature * Update getExample method signature * Correct reference to class in comment * Force php phan typing for numbering modules * Correct $_GLOBALS to $GLOBALS * Add phpdoc to indicat type of properties * Correct default to null * Improve getNextValue typehint * Improve getNextValue typehint * Qual: Improve ModeleNumRefTakepos typing * Qual: Improve ModeleNumRefRecruitmentJobPosition typing * Fix default for $langs * Do not use non-existing ModeleNumRefTakepos::nom * Allow getNextValue argument to be null * Correct $_GLOBAL into $GLOBALS * Improve typing for ldap functions * Allow null for outputlangs argument * Improve typing for printOriginLine * Improve typing for linkedObject access * Fix PhanTypeMismatchArgumentNullableInternal and optimize * Fix PhanPossiblyUndeclaredVariable by setting default value * Ignore PhanPluginDuplicateExpressionAssignmentOperation - needs PHP7.4 * getToolTip does not accept null, changed to '' * Improve getNextValue typing * Change PrintingDriver back to normal class (instantiated) And add errors for functions that should be overloaded * Adjust pringOriginLine typing to match parent * Fix phpdoc for getNextValue * Fix phan typing * Add/Improve phpdoc typing hints * Qual: Adjustments to match typing * Update typing for unit, use GETPOSTINT * ModeleNumRefTask needs Project * Fix several notices appearing after update from develop * Index for choices is int, use GETPOSTINT * Qual: Ignore empty foreach * Force BOMLine on object line * phan typing to indicate that linked objects are BOM * Type the correct variable name (phan) * Add typing for $langs * Type to CommonNumRefGenerator (no class for availabilities) * Resolve several phan notices after update from dev branch * Extra typing fixes * Move common attributes to parent class (phan) * Add typing to Calendar class * Improve typing hints * Add typing to pdf_eagle_proforma * Qual: Add typing for token in generic_oauthcallback.php * Add typing for objMod * Correct getNextValue function signature (phpstan) * Fix typing (phpstan) * Update version declarations (fix phpstan) * Fix phpstan typing issues * Adjust typing (phpstan) * Qual: Update baseline & conf to detect 25% of PhanPluginUnknownObjectMethodCall
2024-08-17 19:32:52 +02:00
// @phan-suppress-next-line PhanUndeclaredProperty
$objMod->dictionaries = $objMod->{"dictionnaries"}; // For backward compatibility
2020-12-04 20:28:05 +01:00
}
// phpcs:enable
2020-12-04 20:28:05 +01:00
if (!empty($objMod->dictionaries)) {
//var_dump($objMod->dictionaries['tabname']);
$nbtabname = $nbtablib = $nbtabsql = $nbtabsqlsort = $nbtabfield = $nbtabfieldvalue = $nbtabfieldinsert = $nbtabrowid = $nbtabcond = $nbtabfieldcheck = $nbtabhelp = 0;
2021-05-06 18:06:19 +02:00
$tabnamerelwithkey = array();
foreach ($objMod->dictionaries['tabname'] as $key => $val) {
$tmptablename = preg_replace('/'.MAIN_DB_PREFIX.'/', '', $val);
2021-03-01 20:37:16 +01:00
$nbtabname++;
$taborder[] = max($taborder) + 1;
$tabname[] = $val;
2021-05-06 18:06:19 +02:00
$tabnamerelwithkey[$key] = $val;
$tabcomplete[$tmptablename]['picto'] = $objMod->picto;
2020-12-04 20:28:05 +01:00
} // Position
2021-05-06 18:06:19 +02:00
foreach ($objMod->dictionaries['tablib'] as $key => $val) {
$tmptablename = preg_replace('/'.MAIN_DB_PREFIX.'/', '', $tabnamerelwithkey[$key]);
2021-03-01 20:37:16 +01:00
$nbtablib++;
$tablib[] = $val;
2021-05-06 18:06:19 +02:00
$tabcomplete[$tmptablename]['lib'] = $val;
2020-12-04 20:28:05 +01:00
}
2021-05-06 18:06:19 +02:00
foreach ($objMod->dictionaries['tabsql'] as $key => $val) {
$tmptablename = preg_replace('/'.MAIN_DB_PREFIX.'/', '', $tabnamerelwithkey[$key]);
2021-03-01 20:37:16 +01:00
$nbtabsql++;
$tabsql[] = $val;
2021-05-06 18:06:19 +02:00
$tabcomplete[$tmptablename]['sql'] = $val;
2020-12-04 20:28:05 +01:00
}
2021-05-06 18:06:19 +02:00
foreach ($objMod->dictionaries['tabsqlsort'] as $key => $val) {
$tmptablename = preg_replace('/'.MAIN_DB_PREFIX.'/', '', $tabnamerelwithkey[$key]);
2021-03-01 20:37:16 +01:00
$nbtabsqlsort++;
$tabsqlsort[] = $val;
2021-05-06 18:06:19 +02:00
$tabcomplete[$tmptablename]['sqlsort'] = $val;
2020-12-04 20:28:05 +01:00
}
2021-05-06 18:06:19 +02:00
foreach ($objMod->dictionaries['tabfield'] as $key => $val) {
$tmptablename = preg_replace('/'.MAIN_DB_PREFIX.'/', '', $tabnamerelwithkey[$key]);
2021-03-01 20:37:16 +01:00
$nbtabfield++;
$tabfield[] = $val;
2021-05-06 18:06:19 +02:00
$tabcomplete[$tmptablename]['field'] = $val;
2020-12-04 20:28:05 +01:00
}
2021-05-06 18:06:19 +02:00
foreach ($objMod->dictionaries['tabfieldvalue'] as $key => $val) {
$tmptablename = preg_replace('/'.MAIN_DB_PREFIX.'/', '', $tabnamerelwithkey[$key]);
2021-03-01 20:37:16 +01:00
$nbtabfieldvalue++;
$tabfieldvalue[] = $val;
2021-05-06 18:06:19 +02:00
$tabcomplete[$tmptablename]['value'] = $val;
2020-12-04 20:28:05 +01:00
}
2021-05-06 18:06:19 +02:00
foreach ($objMod->dictionaries['tabfieldinsert'] as $key => $val) {
$tmptablename = preg_replace('/'.MAIN_DB_PREFIX.'/', '', $tabnamerelwithkey[$key]);
2021-03-01 20:37:16 +01:00
$nbtabfieldinsert++;
$tabfieldinsert[] = $val;
2021-05-06 18:06:19 +02:00
$tabcomplete[$tmptablename]['fieldinsert'] = $val;
2020-12-04 20:28:05 +01:00
}
2021-05-06 18:06:19 +02:00
foreach ($objMod->dictionaries['tabrowid'] as $key => $val) {
$tmptablename = preg_replace('/'.MAIN_DB_PREFIX.'/', '', $tabnamerelwithkey[$key]);
2021-03-01 20:37:16 +01:00
$nbtabrowid++;
$tabrowid[] = $val;
2021-05-06 18:06:19 +02:00
$tabcomplete[$tmptablename]['rowid'] = $val;
2020-12-04 20:28:05 +01:00
}
2021-05-06 18:06:19 +02:00
foreach ($objMod->dictionaries['tabcond'] as $key => $val) {
$tmptablename = preg_replace('/'.MAIN_DB_PREFIX.'/', '', $tabnamerelwithkey[$key]);
2021-03-01 20:37:16 +01:00
$nbtabcond++;
$tabcond[] = $val;
$tabcomplete[$tmptablename]['cond'] = $val;
2020-12-04 20:28:05 +01:00
}
if (!empty($objMod->dictionaries['tabhelp'])) {
2021-05-06 18:06:19 +02:00
foreach ($objMod->dictionaries['tabhelp'] as $key => $val) {
$tmptablename = preg_replace('/'.MAIN_DB_PREFIX.'/', '', $tabnamerelwithkey[$key]);
2021-03-01 20:37:16 +01:00
$nbtabhelp++;
$tabhelp[] = $val;
2021-05-06 18:06:19 +02:00
$tabcomplete[$tmptablename]['help'] = $val;
2020-12-04 20:28:05 +01:00
}
}
if (!empty($objMod->dictionaries['tabfieldcheck'])) {
2021-05-06 18:06:19 +02:00
foreach ($objMod->dictionaries['tabfieldcheck'] as $key => $val) {
$tmptablename = preg_replace('/'.MAIN_DB_PREFIX.'/', '', $tabnamerelwithkey[$key]);
2021-03-01 20:37:16 +01:00
$nbtabfieldcheck++;
2021-05-06 18:06:19 +02:00
$tabcomplete[$tmptablename]['fieldcheck'] = $val;
2020-12-04 20:28:05 +01:00
}
}
if ($nbtabname != $nbtablib || $nbtablib != $nbtabsql || $nbtabsql != $nbtabsqlsort) {
print 'Error in descriptor of module '.$const_name.'. Array ->dictionaries has not same number of record for key "tabname", "tablib", "tabsql" and "tabsqlsort"';
//print "$const_name: $nbtabname=$nbtablib=$nbtabsql=$nbtabsqlsort=$nbtabfield=$nbtabfieldvalue=$nbtabfieldinsert=$nbtabrowid=$nbtabcond=$nbtabfieldcheck=$nbtabhelp\n";
} else {
$taborder[] = 0; // Add an empty line
}
}
$j++;
$i++;
2020-12-04 20:28:05 +01:00
} else {
dol_syslog("Module ".get_class($objMod)." not qualified");
}
}
}
}
closedir($handle);
} else {
dol_syslog("htdocs/admin/modules.php: Failed to open directory ".$dir.". See permission and open_basedir option.", LOG_WARNING);
}
}
dol_syslog("", LOG_DEBUG, -1);
return 1;
}
/**
* Activate external modules mandatory when country is country_code
*
* @param string $country_code CountryCode
* @return int 1
*/
function activateModulesRequiredByCountry($country_code)
{
global $db, $conf, $langs;
$modulesdir = dolGetModulesDirs();
2020-12-04 20:28:05 +01:00
foreach ($modulesdir as $dir) {
// Load modules attributes in arrays (name, numero, orders) from dir directory
dol_syslog("Scan directory ".$dir." for modules");
$handle = @opendir(dol_osencode($dir));
2020-12-04 20:28:05 +01:00
if (is_resource($handle)) {
while (($file = readdir($handle)) !== false) {
if (is_readable($dir.$file) && substr($file, 0, 3) == 'mod' && substr($file, dol_strlen($file) - 10) == '.class.php') {
$modName = substr($file, 0, dol_strlen($file) - 10);
2020-12-04 20:28:05 +01:00
if ($modName) {
include_once $dir.$file;
$objMod = new $modName($db);
Qual: Fix PhanPluginUnknownObjectMethodCall ("part 1") (#30563) * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add typing hint to fix phan notice. * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add typing hint in phan config to fix phan notice. * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint to fix phan notice. * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for linkedObjectBlock * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for linkedObjectBlock * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for linkedObjects * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Fix: MemberNumRefNumbers getExample does not take any arguments Found thanks to adding the typing for phan! * Qual: Correct forced type for $module * Qual: Ignore phan false positive * Qual: phan/Correct module type and ignore false positive * Qual: phan/Ignore false positive * Qual: phan/Ignore false positive, replace depr.prop with method * Qual: Fix typing for count by adding is_array check * Qual: replace depr.prop `nom` with method * Qual: phan/Correct module type and ignore false positive * Qual: phan/Correct module type and ignore false positive * Qual: phan/Correct module type and ignore false positive * Qual: phan/Fix depr.prop with getter and ignore false positive * Qual: phan/Correct module type and ignore false positive * Qual: phan/Correct module type and ignore false positive * Qual: phan/Correct module type and ignore false positive * Qual: Improve typing for mymodule template * Make info method arguments match calls * Make PrintingDriver abstract class because we added abstract methods * Add phpdoc typing for phan * Update getExample function signature for compatibility * Update getExample function signature for compatibility * Update getExample function signature for compatibility * Update header wit correct information * Update getExample method signature * Update getExample method signature * Correct reference to class in comment * Force php phan typing for numbering modules * Correct $_GLOBALS to $GLOBALS * Add phpdoc to indicat type of properties * Correct default to null * Improve getNextValue typehint * Improve getNextValue typehint * Qual: Improve ModeleNumRefTakepos typing * Qual: Improve ModeleNumRefRecruitmentJobPosition typing * Fix default for $langs * Do not use non-existing ModeleNumRefTakepos::nom * Allow getNextValue argument to be null * Correct $_GLOBAL into $GLOBALS * Improve typing for ldap functions * Allow null for outputlangs argument * Improve typing for printOriginLine * Improve typing for linkedObject access * Fix PhanTypeMismatchArgumentNullableInternal and optimize * Fix PhanPossiblyUndeclaredVariable by setting default value * Ignore PhanPluginDuplicateExpressionAssignmentOperation - needs PHP7.4 * getToolTip does not accept null, changed to '' * Improve getNextValue typing * Change PrintingDriver back to normal class (instantiated) And add errors for functions that should be overloaded * Adjust pringOriginLine typing to match parent * Fix phpdoc for getNextValue * Fix phan typing * Add/Improve phpdoc typing hints * Qual: Adjustments to match typing * Update typing for unit, use GETPOSTINT * ModeleNumRefTask needs Project * Fix several notices appearing after update from develop * Index for choices is int, use GETPOSTINT * Qual: Ignore empty foreach * Force BOMLine on object line * phan typing to indicate that linked objects are BOM * Type the correct variable name (phan) * Add typing for $langs * Type to CommonNumRefGenerator (no class for availabilities) * Resolve several phan notices after update from dev branch * Extra typing fixes * Move common attributes to parent class (phan) * Add typing to Calendar class * Improve typing hints * Add typing to pdf_eagle_proforma * Qual: Add typing for token in generic_oauthcallback.php * Add typing for objMod * Correct getNextValue function signature (phpstan) * Fix typing (phpstan) * Update version declarations (fix phpstan) * Fix phpstan typing issues * Adjust typing (phpstan) * Qual: Update baseline & conf to detect 25% of PhanPluginUnknownObjectMethodCall
2024-08-17 19:32:52 +02:00
'@phan-var-force DolibarrModules $objMod';
$modulequalified = 1;
// We discard modules according to features level (PS: if module is activated we always show it)
$const_name = 'MAIN_MODULE_'.strtoupper(preg_replace('/^mod/i', '', get_class($objMod)));
2023-10-16 21:15:03 +02:00
if ($objMod->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) {
2020-12-04 20:28:05 +01:00
$modulequalified = 0;
}
2023-10-16 21:15:03 +02:00
if ($objMod->version == 'experimental' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1) {
2020-12-04 20:28:05 +01:00
$modulequalified = 0;
}
2023-10-16 21:15:03 +02:00
if (getDolGlobalString($const_name)) {
2020-12-04 20:28:05 +01:00
$modulequalified = 0; // already activated
}
2020-12-04 20:28:05 +01:00
if ($modulequalified) {
// Load languages files of module
Qual: Fix PhanPluginUnknownObjectMethodCall ("part 1") (#30563) * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add typing hint to fix phan notice. * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add typing hint in phan config to fix phan notice. * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint to fix phan notice. * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for linkedObjectBlock * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for linkedObjectBlock * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for linkedObjects * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) # Qual: Fix PhanPluginUnknownObjectMethodCall (add typing hints) Add/improve typing hint for PhanPluginUnknownObjectMethodCall * Fix: MemberNumRefNumbers getExample does not take any arguments Found thanks to adding the typing for phan! * Qual: Correct forced type for $module * Qual: Ignore phan false positive * Qual: phan/Correct module type and ignore false positive * Qual: phan/Ignore false positive * Qual: phan/Ignore false positive, replace depr.prop with method * Qual: Fix typing for count by adding is_array check * Qual: replace depr.prop `nom` with method * Qual: phan/Correct module type and ignore false positive * Qual: phan/Correct module type and ignore false positive * Qual: phan/Correct module type and ignore false positive * Qual: phan/Fix depr.prop with getter and ignore false positive * Qual: phan/Correct module type and ignore false positive * Qual: phan/Correct module type and ignore false positive * Qual: phan/Correct module type and ignore false positive * Qual: Improve typing for mymodule template * Make info method arguments match calls * Make PrintingDriver abstract class because we added abstract methods * Add phpdoc typing for phan * Update getExample function signature for compatibility * Update getExample function signature for compatibility * Update getExample function signature for compatibility * Update header wit correct information * Update getExample method signature * Update getExample method signature * Correct reference to class in comment * Force php phan typing for numbering modules * Correct $_GLOBALS to $GLOBALS * Add phpdoc to indicat type of properties * Correct default to null * Improve getNextValue typehint * Improve getNextValue typehint * Qual: Improve ModeleNumRefTakepos typing * Qual: Improve ModeleNumRefRecruitmentJobPosition typing * Fix default for $langs * Do not use non-existing ModeleNumRefTakepos::nom * Allow getNextValue argument to be null * Correct $_GLOBAL into $GLOBALS * Improve typing for ldap functions * Allow null for outputlangs argument * Improve typing for printOriginLine * Improve typing for linkedObject access * Fix PhanTypeMismatchArgumentNullableInternal and optimize * Fix PhanPossiblyUndeclaredVariable by setting default value * Ignore PhanPluginDuplicateExpressionAssignmentOperation - needs PHP7.4 * getToolTip does not accept null, changed to '' * Improve getNextValue typing * Change PrintingDriver back to normal class (instantiated) And add errors for functions that should be overloaded * Adjust pringOriginLine typing to match parent * Fix phpdoc for getNextValue * Fix phan typing * Add/Improve phpdoc typing hints * Qual: Adjustments to match typing * Update typing for unit, use GETPOSTINT * ModeleNumRefTask needs Project * Fix several notices appearing after update from develop * Index for choices is int, use GETPOSTINT * Qual: Ignore empty foreach * Force BOMLine on object line * phan typing to indicate that linked objects are BOM * Type the correct variable name (phan) * Add typing for $langs * Type to CommonNumRefGenerator (no class for availabilities) * Resolve several phan notices after update from dev branch * Extra typing fixes * Move common attributes to parent class (phan) * Add typing to Calendar class * Improve typing hints * Add typing to pdf_eagle_proforma * Qual: Add typing for token in generic_oauthcallback.php * Add typing for objMod * Correct getNextValue function signature (phpstan) * Fix typing (phpstan) * Update version declarations (fix phpstan) * Fix phpstan typing issues * Adjust typing (phpstan) * Qual: Update baseline & conf to detect 25% of PhanPluginUnknownObjectMethodCall
2024-08-17 19:32:52 +02:00
if (property_exists($objMod, 'automatic_activation') && isset($objMod->automatic_activation) && is_array($objMod->automatic_activation) && isset($objMod->automatic_activation[$country_code])) {
activateModule($modName);
2018-07-25 15:25:23 +02:00
setEventMessages($objMod->automatic_activation[$country_code], null, 'warnings');
}
2020-12-04 20:28:05 +01:00
} else {
dol_syslog("Module ".get_class($objMod)." not qualified");
}
}
}
}
closedir($handle);
2020-05-21 15:05:19 +02:00
} else {
dol_syslog("htdocs/admin/modules.php: Failed to open directory ".$dir.". See permission and open_basedir option.", LOG_WARNING);
}
}
return 1;
}
/**
* Search external modules to complete the list of contact element
*
2024-03-23 19:52:06 +01:00
* @param array<string,string> $elementList elementList
* @return int 1
*/
function complete_elementList_with_modules(&$elementList)
{
global $db, $modules, $conf, $langs;
// Search modules
$filename = array();
$modules = array();
$orders = array();
$categ = array();
$dirmod = array();
2015-10-21 05:06:19 +02:00
$i = 0; // is a sequencer of modules found
$j = 0; // j is module number. Automatically affected if module number not defined.
dol_syslog("complete_elementList_with_modules Search external modules to complete the list of contact element", LOG_DEBUG, 1);
$modulesdir = dolGetModulesDirs();
2020-12-04 20:28:05 +01:00
foreach ($modulesdir as $dir) {
// Load modules attributes in arrays (name, numero, orders) from dir directory
//print $dir."\n<br>";
dol_syslog("Scan directory ".$dir." for modules");
$handle = @opendir(dol_osencode($dir));
2020-12-04 20:28:05 +01:00
if (is_resource($handle)) {
while (($file = readdir($handle)) !== false) {
//print "$i ".$file."\n<br>";
2020-12-04 20:28:05 +01:00
if (is_readable($dir.$file) && substr($file, 0, 3) == 'mod' && substr($file, dol_strlen($file) - 10) == '.class.php') {
$modName = substr($file, 0, dol_strlen($file) - 10);
2020-12-04 20:28:05 +01:00
if ($modName) {
include_once $dir.$file;
$objMod = new $modName($db);
2020-12-04 20:28:05 +01:00
if ($objMod->numero > 0) {
$j = $objMod->numero;
} else {
$j = 1000 + $i;
}
$modulequalified = 1;
// We discard modules according to features level (PS: if module is activated we always show it)
$const_name = 'MAIN_MODULE_'.strtoupper(preg_replace('/^mod/i', '', get_class($objMod)));
2023-10-16 21:15:03 +02:00
if ($objMod->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2 && getDolGlobalString($const_name)) {
2020-12-04 20:28:05 +01:00
$modulequalified = 0;
}
2023-10-16 21:15:03 +02:00
if ($objMod->version == 'experimental' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1 && getDolGlobalString($const_name)) {
2020-12-04 20:28:05 +01:00
$modulequalified = 0;
}
2023-10-16 21:15:03 +02:00
// If module is not activated disqualified
if (!getDolGlobalString($const_name)) {
2020-12-04 20:28:05 +01:00
$modulequalified = 0;
}
2020-12-04 20:28:05 +01:00
if ($modulequalified) {
// Load languages files of module
2020-12-04 20:28:05 +01:00
if (isset($objMod->langfiles) && is_array($objMod->langfiles)) {
foreach ($objMod->langfiles as $langfile) {
$langs->load($langfile);
}
}
$modules[$i] = $objMod;
$filename[$i] = $modName;
$orders[$i] = $objMod->family."_".$j; // Sort on family then module number
$dirmod[$i] = $dir;
//print "x".$modName." ".$orders[$i]."\n<br>";
2021-02-23 22:03:23 +01:00
if (!empty($objMod->module_parts['contactelement'])) {
if (is_array($objMod->module_parts['contactelement'])) {
2021-01-03 16:05:04 +01:00
foreach ($objMod->module_parts['contactelement'] as $elem => $title) {
$elementList[$elem] = $langs->trans($title);
}
2021-01-04 12:02:41 +01:00
} else {
2021-01-03 16:05:04 +01:00
$elementList[$objMod->name] = $langs->trans($objMod->name);
}
2021-02-23 22:03:23 +01:00
}
$j++;
$i++;
2020-12-04 20:28:05 +01:00
} else {
dol_syslog("Module ".get_class($objMod)." not qualified");
}
}
}
}
closedir($handle);
} else {
dol_syslog("htdocs/admin/modules.php: Failed to open directory ".$dir.". See permission and open_basedir option.", LOG_WARNING);
}
}
dol_syslog("", LOG_DEBUG, -1);
return 1;
}
/**
* Show array with constants to edit
*
* @param array<string,array{type:string,label:string}>|array<int,string> $tableau Array of constants array('key'=>array('type'=>type, 'label'=>label)
* where type can be 'string', 'text', 'textarea', 'html', 'yesno', 'emailtemplate:xxx', ...
2024-05-29 21:00:58 +02:00
* @param int<2,3> $strictw3c 0=Include form into table (deprecated), 1=Form is outside table to respect W3C (deprecated), 2=No form nor button at all, 3=No form nor button at all and each field has a unique name (form is output by caller, recommended) (typed as int<2,3> to highlight the deprecated values)
* @param string $helptext Tooltip help to use for the column name of values
* @param string $text Text to use for the column name of values
* @return void
*/
2024-03-23 19:52:06 +01:00
function form_constantes($tableau, $strictw3c = 2, $helptext = '', $text = 'Value')
{
global $db, $langs, $conf, $user;
global $_Avery_Labels;
$form = new Form($db);
if (empty($strictw3c)) {
dol_syslog("Warning: Function 'form_constantes' was called with parameter strictw3c = 0, this is deprecated. Value must be 2 now.", LOG_WARNING);
}
2020-12-04 20:28:05 +01:00
if (!empty($strictw3c) && $strictw3c == 1) {
print "\n".'<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="action" value="updateall">';
}
2021-05-24 19:05:25 +02:00
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre">';
2021-04-29 10:01:10 +02:00
print '<td class="">'.$langs->trans("Description").'</td>';
print '<td>';
2021-08-17 03:20:57 +02:00
$text = $langs->trans($text);
print $form->textwithpicto($text, $helptext, 1, 'help', '', 0, 2, 'idhelptext');
print '</td>';
2020-12-04 20:28:05 +01:00
if (empty($strictw3c)) {
print '<td class="center" width="80">'.$langs->trans("Action").'</td>';
}
print "</tr>\n";
$label = '';
2020-12-04 20:28:05 +01:00
foreach ($tableau as $key => $const) { // Loop on each param
$label = '';
// $const is a const key like 'MYMODULE_ABC'
if (is_numeric($key)) { // Very old behaviour
$type = 'string';
} else {
2020-12-04 20:28:05 +01:00
if (is_array($const)) {
$type = $const['type'];
2018-11-03 12:37:52 +01:00
$label = $const['label'];
$const = $key;
} else {
$type = $const;
$const = $key;
}
}
$sql = "SELECT ";
$sql .= "rowid";
$sql .= ", ".$db->decrypt('name')." as name";
$sql .= ", ".$db->decrypt('value')." as value";
$sql .= ", type";
$sql .= ", note";
$sql .= " FROM ".MAIN_DB_PREFIX."const";
$sql .= " WHERE ".$db->decrypt('name')." = '".$db->escape($const)."'";
$sql .= " AND entity IN (0, ".$conf->entity.")";
$sql .= " ORDER BY name ASC, entity DESC";
$result = $db->query($sql);
dol_syslog("List params", LOG_DEBUG);
2020-12-04 20:28:05 +01:00
if ($result) {
$obj = $db->fetch_object($result); // Take first result of select
2020-12-04 20:28:05 +01:00
if (empty($obj)) { // If not yet into table
2024-03-13 00:29:40 +01:00
$obj = (object) array('rowid' => '', 'name' => $const, 'value' => '', 'type' => $type, 'note' => '');
}
2012-09-13 11:52:50 +02:00
if (empty($strictw3c)) { // deprecated. must be always true.
print "\n".'<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="page_y" value="'.newToken().'">';
print '<input type="hidden" name="action" value="update">';
}
print '<tr class="oddeven">';
2023-03-25 12:40:23 +01:00
// Show label of parameter
print '<td>';
print '<input type="hidden" name="rowid'.(empty($strictw3c) ? '' : '[]').'" value="'.$obj->rowid.'">';
print '<input type="hidden" name="constname'.(empty($strictw3c) ? '' : '[]').'" value="'.$const.'">';
print '<input type="hidden" name="constnote_'.$obj->name.'" value="'.nl2br(dol_escape_htmltag($obj->note)).'">';
print '<input type="hidden" name="consttype_'.$obj->name.'" value="'.($obj->type ? $obj->type : 'string').'">';
$picto = 'generic';
$tmparray = explode(':', $obj->type);
if (!empty($tmparray[1])) {
$picto = preg_replace('/_send$/', '', $tmparray[1]);
}
print img_picto('', $picto, 'class="pictofixedwidth"');
2023-03-25 12:40:23 +01:00
if (!empty($tableau[$key]['tooltip'])) {
print $form->textwithpicto($label ? $label : $langs->trans('Desc'.$const), $tableau[$key]['tooltip']);
} else {
2023-12-04 12:05:28 +01:00
print($label ? $label : $langs->trans('Desc'.$const));
2023-03-25 12:40:23 +01:00
}
2020-12-04 20:28:05 +01:00
if ($const == 'ADHERENT_MAILMAN_URL') {
print '. '.$langs->trans("Example").': <a href="#" id="exampleclick1">'.img_down().'</a><br>';
Fix #28071 - New branch to fix bad merge (#28083) * Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop * Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop * Qual: Introduce getDataToShowPhoto to prepare generic code * Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop * Fix missing trans * Fix langs * Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop * Remove useless files in web templates * Clean code * Fix duplicate translation key * Fix duplicate translation key * Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop * Fix duplicate key * Fix $object * Debug v19 * WIP SMSing * Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop * WIP EMAILINGS_SUPPORT_ALSO_SMS * Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop * Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop * WIP SMSing * Debug the "validate" feature * Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop * Clean code * Move rights->x->y into hasRight('x', 'y') * Move rights->x->y into hasRight('x', 'y') * Move rights->x->y into hasRight('x', 'y') * Move rights->x->y into hasRight('x', 'y') * Move rights->x->y into hasRight('x', 'y') * Move rights->x->y into hasRight('x', 'y') * Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop * Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop * Enhance rector to fix empty($user->rights->modulex->perm1) * Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop * Fix template to use v19 dev rules * Fix use v19 dev rules * Fix phpunit * Debug v19 * Clean code * Use rector to convert user->rights into user->hasRight * Clean code * Use rector to convert user->rights into user->hasRight * Use rector to convert user->rights into user->hasRight * Clean code * Fix phpcs * add editorconfig for sql files (#27999) Co-authored-by: Laurent Destailleur <eldy@destailleur.fr> * add model_pdf field in llx_ticket-ticket.sql (#27996) * add model_pdf field in llx_ticket-ticket.sql * Update 19.0.0-20.0.0.sql * Update 19.0.0-20.0.0.sql * Improve wording in README (#27994) * fix phpstan (#27989) * fix phpstan * Update UserRightsToFunction.php --------- Co-authored-by: Laurent Destailleur <eldy@destailleur.fr> * Qual: Fix spelling/working in datapolicy translations (#28006) # Qual: Fix spelling/wording in datapolicy translations Fixed some spelling and wording in datapolicy translations. * qual: phpstan for htdocs/ticket/class/ticketstats.class.php (#27986) htdocs/ticket/class/ticketstats.class.php 98 Parameter #1 $year (string) of method TicketStats::getNbByMonth() should be compatible with parameter $year (int) of method Stats::getNbByMonth() * Merge branch '19.0' of git@github.com:Dolibarr/dolibarr.git into develop * Fix user with readonly perm on email template must be able to read. * Fix doc * Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop * Better message * Add missing fields in merge of thirdparty * Debug v19 selection of ticket printer per terminal * Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop * Use constant * NEW: Adding a recipient on emails sent, change status to sent partialy. * fix travis (#28052) * fix travis * Update partnership.class.php * fix php doc (#28047) * fix undefined array key (#28048) * Add region and departament for Cuba (#28046) * Update llx_10_c_regions.sql Add Cuba Regions (id_country=77) * Update llx_20_c_departements.sql Add Provinces Cuba (id country=77) * Find the typo (#28050) * Find the typo * clean code * add last_main_doc field to product (#28045) * add las_main_doc field to product * add field fetch * NEW Add Categorie filter for ActionComm (#28041) * New Add Categorie filter for ActionComm New Add Categorie filter for ActionComm * Fix space errors Fix space errors * Fix space errors 2 Fix space errors 2 * Update cunits.class.php (#28056) FIX: error SQL when creating a Cunit * Update codespell-lines-ignore.txt to avoid PR merge conflict --------- Co-authored-by: Laurent Destailleur <eldy@destailleur.fr> Co-authored-by: Frédéric FRANCE <frederic34@users.noreply.github.com> Co-authored-by: thibdrev <thibault.drevet@gmail.com> Co-authored-by: sonikf <93765174+sonikf@users.noreply.github.com> Co-authored-by: Ikarus <44511582+LeKarSol@users.noreply.github.com> Co-authored-by: Anthony Damhet <73399671+EchoLoGeek@users.noreply.github.com> Co-authored-by: Quentin-Seekness <72733832+Quentin-Seekness@users.noreply.github.com>
2024-02-09 15:58:49 +01:00
//print 'http://lists.example.com/cgi-bin/mailman/admin/%LISTE%/members?adminpw=%MAILMAN_ADMINPW%&subscribees=%EMAIL%&send_welcome_msg_to_this_batch=1';
print '<div id="example1" class="hidden">';
print 'http://lists.example.com/cgi-bin/mailman/admin/%LISTE%/members/add?subscribees_upload=%EMAIL%&amp;adminpw=%MAILMAN_ADMINPW%&amp;subscribe_or_invite=0&amp;send_welcome_msg_to_this_batch=0&amp;notification_to_list_owner=0';
print '</div>';
2022-10-24 19:40:51 +02:00
} elseif ($const == 'ADHERENT_MAILMAN_UNSUB_URL') {
print '. '.$langs->trans("Example").': <a href="#" id="exampleclick2">'.img_down().'</a><br>';
print '<div id="example2" class="hidden">';
print 'http://lists.example.com/cgi-bin/mailman/admin/%LISTE%/members/remove?unsubscribees_upload=%EMAIL%&amp;adminpw=%MAILMAN_ADMINPW%&amp;send_unsub_ack_to_this_batch=0&amp;send_unsub_notifications_to_list_owner=0';
print '</div>';
//print 'http://lists.example.com/cgi-bin/mailman/admin/%LISTE%/members/remove?adminpw=%MAILMAN_ADMINPW%&unsubscribees=%EMAIL%';
2022-10-24 19:40:51 +02:00
} elseif ($const == 'ADHERENT_MAILMAN_LISTS') {
print '. '.$langs->trans("Example").': <a href="#" id="exampleclick3">'.img_down().'</a><br>';
print '<div id="example3" class="hidden">';
print 'mymailmanlist<br>';
print 'mymailmanlist1,mymailmanlist2<br>';
print 'TYPE:Type1:mymailmanlist1,TYPE:Type2:mymailmanlist2<br>';
Fix: Replace deprecated modulename with new in isModEnabled (#28452) * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan.
2024-02-27 15:30:37 +01:00
if (isModEnabled('category')) {
2020-12-04 20:28:05 +01:00
print 'CATEG:Categ1:mymailmanlist1,CATEG:Categ2:mymailmanlist2<br>';
}
print '</div>';
//print 'http://lists.example.com/cgi-bin/mailman/admin/%LISTE%/members/remove?adminpw=%MAILMAN_ADMINPW%&unsubscribees=%EMAIL%';
} elseif (in_array($const, ['ADHERENT_MAIL_FROM', 'ADHERENT_CC_MAIL_FROM'])) {
print ' '.img_help(1, $langs->trans("EMailHelpMsgSPFDKIM"));
}
print "</td>\n";
// Value
2020-12-04 20:28:05 +01:00
if ($const == 'ADHERENT_CARD_TYPE' || $const == 'ADHERENT_ETIQUETTE_TYPE') {
print '<td>';
// List of possible labels (defined into $_Avery_Labels variable set into format_cards.lib.php)
require_once DOL_DOCUMENT_ROOT.'/core/lib/format_cards.lib.php';
$arrayoflabels = array();
2020-12-04 20:28:05 +01:00
foreach (array_keys($_Avery_Labels) as $codecards) {
$arrayoflabels[$codecards] = $_Avery_Labels[$codecards]['name'];
}
2021-03-20 21:29:36 +01:00
print $form->selectarray('constvalue'.(empty($strictw3c) ? '' : ($strictw3c == 3 ? '_'.$const : '[]')), $arrayoflabels, ($obj->value ? $obj->value : 'CARD'), 1, 0, 0);
print '<input type="hidden" name="consttype" value="yesno">';
print '<input type="hidden" name="constnote'.(empty($strictw3c) ? '' : '[]').'" value="'.nl2br(dol_escape_htmltag($obj->note)).'">';
print '</td>';
} else {
print '<td>';
2021-03-20 21:29:36 +01:00
print '<input type="hidden" name="consttype'.(empty($strictw3c) ? '' : ($strictw3c == 3 ? '_'.$const : '[]')).'" value="'.($obj->type ? $obj->type : 'string').'">';
print '<input type="hidden" name="constnote'.(empty($strictw3c) ? '' : ($strictw3c == 3 ? '_'.$const : '[]')).'" value="'.nl2br(dol_escape_htmltag($obj->note)).'">';
2020-12-04 20:28:05 +01:00
if ($obj->type == 'textarea' || in_array($const, array('ADHERENT_CARD_TEXT', 'ADHERENT_CARD_TEXT_RIGHT', 'ADHERENT_ETIQUETTE_TEXT'))) {
2021-03-20 21:29:36 +01:00
print '<textarea class="flat" name="constvalue'.(empty($strictw3c) ? '' : ($strictw3c == 3 ? '_'.$const : '[]')).'" cols="50" rows="5" wrap="soft">'."\n";
print $obj->value;
print "</textarea>\n";
2020-12-04 20:28:05 +01:00
} elseif ($obj->type == 'html') {
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
2022-06-09 22:10:51 +02:00
$doleditor = new DolEditor('constvalue'.(empty($strictw3c) ? '' : ($strictw3c == 3 ? '_'.$const : '[]')), $obj->value, '', 160, 'dolibarr_notes', '', false, false, isModEnabled('fckeditor'), ROWS_5, '90%');
$doleditor->Create();
2020-12-04 20:28:05 +01:00
} elseif ($obj->type == 'yesno') {
2024-05-29 21:00:58 +02:00
print $form->selectyesno('constvalue'.(empty($strictw3c) ? '' : ($strictw3c == 3 ? '_'.$const : '[]')), $obj->value, 1, false, 0, 1);
2020-12-04 20:28:05 +01:00
} elseif (preg_match('/emailtemplate/', $obj->type)) {
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
$formmail = new FormMail($db);
2019-01-31 20:53:59 +01:00
$tmp = explode(':', $obj->type);
$nboftemplates = $formmail->fetchAllEMailTemplate($tmp[1], $user, null, -1); // We set lang=null to get in priority record with no lang
//$arraydefaultmessage = $formmail->getEMailTemplate($db, $tmp[1], $user, null, 0, 1, '');
$arrayofmessagename = array();
2020-12-04 20:28:05 +01:00
if (is_array($formmail->lines_model)) {
foreach ($formmail->lines_model as $modelmail) {
//var_dump($modelmail);
$moreonlabel = '';
2020-12-04 20:28:05 +01:00
if (!empty($arrayofmessagename[$modelmail->label])) {
$moreonlabel = ' <span class="opacitymedium">('.$langs->trans("SeveralLangugeVariatFound").')</span>';
}
// The 'label' is the key that is unique if we exclude the language
$arrayofmessagename[$modelmail->label.':'.$tmp[1]] = $langs->trans(preg_replace('/\(|\)/', '', $modelmail->label)).$moreonlabel;
}
}
//var_dump($arraydefaultmessage);
//var_dump($arrayofmessagename);
2021-03-20 21:29:36 +01:00
print $form->selectarray('constvalue'.(empty($strictw3c) ? '' : ($strictw3c == 3 ? '_'.$const : '[]')), $arrayofmessagename, $obj->value.':'.$tmp[1], 'None', 0, 0, '', 0, 0, 0, '', '', 1);
2021-04-29 10:01:10 +02:00
} elseif (preg_match('/MAIL_FROM$/i', $const)) {
print img_picto('', 'email', 'class="pictofixedwidth"').'<input type="text" class="flat minwidth300" name="constvalue'.(empty($strictw3c) ? '' : ($strictw3c == 3 ? '_'.$const : '[]')).'" value="'.dol_escape_htmltag($obj->value).'">';
2021-03-20 21:29:36 +01:00
} else { // type = 'string' ou 'chaine'
print '<input type="text" class="flat minwidth300" name="constvalue'.(empty($strictw3c) ? '' : ($strictw3c == 3 ? '_'.$const : '[]')).'" value="'.dol_escape_htmltag($obj->value).'">';
}
print '</td>';
}
2021-04-29 10:01:10 +02:00
// Submit button
if (empty($strictw3c)) { // deprecated. must be always true.
print '<td class="center">';
print '<input type="submit" class="button small reposition" value="'.$langs->trans("Update").'" name="update">';
print "</td>";
}
2021-04-29 10:01:10 +02:00
print "</tr>\n";
2020-12-04 20:28:05 +01:00
if (empty($strictw3c)) {
print "</form>\n";
}
}
}
print '</table>';
2021-05-24 19:05:25 +02:00
print '</div>';
2020-12-04 20:28:05 +01:00
if (!empty($strictw3c) && $strictw3c == 1) {
print '<div align="center"><input type="submit" class="button small reposition" value="'.$langs->trans("Update").'" name="update"></div>';
print "</form>\n";
}
}
/**
* Show array with constants to edit
*
2024-03-23 19:52:06 +01:00
* @param DolibarrModules[] $modules Array of all modules
* @return string HTML string with warning
*/
function showModulesExludedForExternal($modules)
{
2025-02-11 15:27:37 +01:00
global $langs;
2025-02-11 15:27:37 +01:00
$text = $langs->transnoentitiesnoconv("OnlyFollowingModulesAreOpenedToExternalUsers");
2023-12-13 15:20:53 +01:00
$listofmodules = explode(',', getDolGlobalString('MAIN_MODULES_FOR_EXTERNAL')); // List of modules qualified for external user management
2022-12-12 10:25:03 +01:00
$i = 0;
2013-03-05 19:05:12 +01:00
if (!empty($modules)) {
2022-12-12 10:25:03 +01:00
$tmpmodules = dol_sort_array($modules, 'module_position');
foreach ($tmpmodules as $module) { // Loop on array of modules
$moduleconst = $module->const_name;
$modulename = strtolower($module->name);
2013-03-05 19:05:12 +01:00
//print 'modulename='.$modulename;
2013-03-05 19:05:12 +01:00
//if (empty($conf->global->$moduleconst)) continue;
2020-12-04 20:28:05 +01:00
if (!in_array($modulename, $listofmodules)) {
continue;
}
2018-02-26 15:03:09 +01:00
//var_dump($modulename.' - '.$langs->trans('Module'.$module->numero.'Name'));
2020-12-04 20:28:05 +01:00
if ($i > 0) {
$text .= ', ';
} else {
$text .= ' ';
}
2013-03-05 19:05:12 +01:00
$i++;
2022-12-12 10:25:03 +01:00
2025-02-11 15:27:37 +01:00
$tmptext = $langs->transnoentitiesnoconv('Module'.$module->numero.'Name');
2022-12-12 10:25:03 +01:00
if ($tmptext != 'Module'.$module->numero.'Name') {
2025-02-11 15:27:37 +01:00
$text .= $langs->transnoentitiesnoconv('Module'.$module->numero.'Name');
2022-12-12 10:25:03 +01:00
} else {
2025-02-11 15:27:37 +01:00
$text .= $langs->transnoentitiesnoconv($module->name);
2022-12-12 10:25:03 +01:00
}
2013-03-05 19:05:12 +01:00
}
}
2022-12-12 10:25:03 +01:00
return $text;
}
2012-07-02 19:30:37 +02:00
/**
* Add document model used by doc generator
*
2012-04-03 11:01:07 +02:00
* @param string $name Model name
2012-07-02 19:30:37 +02:00
* @param string $type Model type
* @param string $label Model label
* @param string $description Model description
2023-12-01 19:51:32 +01:00
* @return int Return integer <0 if KO, >0 if OK
2012-07-02 19:30:37 +02:00
*/
function addDocumentModel($name, $type, $label = '', $description = '')
2012-04-03 11:01:07 +02:00
{
global $db, $conf;
2012-04-03 11:01:07 +02:00
$db->begin();
$sql = "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity, libelle, description)";
2021-08-27 22:42:04 +02:00
$sql .= " VALUES ('".$db->escape($name)."','".$db->escape($type)."',".((int) $conf->entity).", ";
$sql .= ($label ? "'".$db->escape($label)."'" : 'null').", ";
$sql .= (!empty($description) ? "'".$db->escape($description)."'" : "null");
$sql .= ")";
dol_syslog("admin.lib::addDocumentModel", LOG_DEBUG);
$resql = $db->query($sql);
2020-12-04 20:28:05 +01:00
if ($resql) {
2012-04-03 11:01:07 +02:00
$db->commit();
2012-07-02 19:30:37 +02:00
return 1;
2020-05-21 15:05:19 +02:00
} else {
2012-04-03 11:01:07 +02:00
dol_print_error($db);
2012-07-02 19:30:37 +02:00
$db->rollback();
return -1;
}
2012-04-03 11:01:07 +02:00
}
2012-07-02 19:30:37 +02:00
/**
* Delete document model used by doc generator
*
* @param string $name Model name
* @param string $type Model type
2023-12-01 19:51:32 +01:00
* @return int Return integer <0 if KO, >0 if OK
2012-07-02 19:30:37 +02:00
*/
function delDocumentModel($name, $type)
{
2012-04-03 11:01:07 +02:00
global $db, $conf;
2012-04-03 11:01:07 +02:00
$db->begin();
2012-07-02 19:30:37 +02:00
2012-04-03 11:01:07 +02:00
$sql = "DELETE FROM ".MAIN_DB_PREFIX."document_model";
$sql .= " WHERE nom = '".$db->escape($name)."'";
2020-09-19 21:19:04 +02:00
$sql .= " AND type = '".$db->escape($type)."'";
2021-09-02 13:25:00 +02:00
$sql .= " AND entity = ".((int) $conf->entity);
2012-07-02 19:30:37 +02:00
2014-06-12 11:31:53 +02:00
dol_syslog("admin.lib::delDocumentModel", LOG_DEBUG);
$resql = $db->query($sql);
2020-12-04 20:28:05 +01:00
if ($resql) {
2012-04-03 11:01:07 +02:00
$db->commit();
2012-07-02 19:30:37 +02:00
return 1;
2020-05-21 15:05:19 +02:00
} else {
2012-04-03 11:01:07 +02:00
dol_print_error($db);
2012-07-02 19:30:37 +02:00
$db->rollback();
return -1;
}
2012-04-03 11:01:07 +02:00
}
2012-09-21 00:13:20 +02:00
2012-09-22 09:18:36 +02:00
/**
* Return the php_info into an array
*
* @return array<string,array<string,string|array{local:string,master:string}>> Array with PHP info
2012-09-22 09:18:36 +02:00
*/
function phpinfo_array()
{
ob_start();
phpinfo();
2020-10-02 19:10:30 +02:00
$phpinfostring = ob_get_contents();
ob_end_clean();
2012-09-22 09:18:36 +02:00
$info_arr = array();
2020-10-02 19:10:30 +02:00
$info_lines = explode("\n", strip_tags($phpinfostring, "<tr><td><h2>"));
2012-09-22 09:18:36 +02:00
$cat = "General";
2020-12-04 20:28:05 +01:00
foreach ($info_lines as $line) {
2012-09-22 09:18:36 +02:00
// new cat?
2019-04-23 10:24:16 +02:00
$title = array();
2012-09-22 09:18:36 +02:00
preg_match("~<h2>(.*)</h2>~", $line, $title) ? $cat = $title[1] : null;
2019-04-23 10:24:16 +02:00
$val = array();
2020-12-04 20:28:05 +01:00
if (preg_match("~<tr><td[^>]+>([^<]*)</td><td[^>]+>([^<]*)</td></tr>~", $line, $val)) {
2012-09-22 09:18:36 +02:00
$info_arr[trim($cat)][trim($val[1])] = $val[2];
2020-12-04 20:28:05 +01:00
} elseif (preg_match("~<tr><td[^>]+>([^<]*)</td><td[^>]+>([^<]*)</td><td[^>]+>([^<]*)</td></tr>~", $line, $val)) {
2012-09-22 09:18:36 +02:00
$info_arr[trim($cat)][trim($val[1])] = array("local" => $val[2], "master" => $val[3]);
}
2012-09-21 00:13:20 +02:00
}
2012-09-22 09:18:36 +02:00
return $info_arr;
2012-09-21 00:13:20 +02:00
}
/**
* Return array head with list of tabs to view object information.
*
* @return array<array{0:string,1:string,2:string}> Array of tabs to show
*/
function company_admin_prepare_head()
{
2019-04-23 10:24:16 +02:00
global $langs, $conf;
$h = 0;
$head = array();
$head[$h][0] = DOL_URL_ROOT."/admin/company.php";
$head[$h][1] = $langs->trans("Company");
$head[$h][2] = 'company';
$h++;
2024-09-30 14:12:51 +02:00
$head[$h][0] = DOL_URL_ROOT."/admin/company_socialnetworks.php";
$head[$h][1] = $langs->trans("SocialNetworksInformation");
$head[$h][2] = 'socialnetworks';
$h++;
2020-12-04 20:28:05 +01:00
$head[$h][0] = DOL_URL_ROOT."/admin/openinghours.php";
$head[$h][1] = $langs->trans("OpeningHours");
$head[$h][2] = 'openinghours';
$h++;
2019-01-16 12:42:54 +01:00
$head[$h][0] = DOL_URL_ROOT."/admin/accountant.php";
$head[$h][1] = $langs->trans("Accountant");
$head[$h][2] = 'accountant';
$h++;
2020-03-30 19:23:25 +02:00
complete_head_from_modules($conf, $langs, null, $head, $h, 'mycompany_admin', 'add');
complete_head_from_modules($conf, $langs, null, $head, $h, 'mycompany_admin', 'remove');
2020-03-31 00:11:31 +02:00
return $head;
}
2017-10-13 12:02:26 +02:00
/**
* Return array head with list of tabs to view object information.
2017-10-13 12:02:26 +02:00
*
* @return array<array{0:string,1:string,2:string}> Array of tabs to show
2017-10-13 12:02:26 +02:00
*/
function email_admin_prepare_head()
{
global $langs, $conf, $user;
$h = 0;
$head = array();
2020-12-04 20:28:05 +01:00
if (!empty($user->admin) && (empty($_SESSION['leftmenu']) || $_SESSION['leftmenu'] != 'email_templates')) {
2017-10-13 12:02:26 +02:00
$head[$h][0] = DOL_URL_ROOT."/admin/mails.php";
$head[$h][1] = $langs->trans("OutGoingEmailSetup");
$head[$h][2] = 'common';
$h++;
2022-06-09 22:10:51 +02:00
if (isModEnabled('mailing')) {
2017-10-13 12:02:26 +02:00
$head[$h][0] = DOL_URL_ROOT."/admin/mails_emailing.php";
2020-04-05 15:42:39 +02:00
$head[$h][1] = $langs->trans("OutGoingEmailSetupForEmailing", $langs->transnoentitiesnoconv("EMailing"));
2017-10-13 12:02:26 +02:00
$head[$h][2] = 'common_emailing';
$h++;
}
2020-09-02 15:33:18 +02:00
2022-06-09 22:10:51 +02:00
if (isModEnabled('ticket')) {
2020-09-02 15:33:18 +02:00
$head[$h][0] = DOL_URL_ROOT."/admin/mails_ticket.php";
$head[$h][1] = $langs->trans("OutGoingEmailSetupForEmailing", $langs->transnoentitiesnoconv("Ticket"));
$head[$h][2] = 'common_ticket';
$h++;
}
2024-11-28 19:56:10 +01:00
if (!getDolGlobalString('MAIN_MAIL_HIDE_CUSTOM_SENDING_METHOD_FOR_PASSWORD_RESET')) {
$head[$h][0] = DOL_URL_ROOT."/admin/mails_passwordreset.php";
$head[$h][1] = $langs->trans("OutGoingEmailSetupForEmailing", $langs->transnoentitiesnoconv("PasswordReset"));
$head[$h][2] = 'common_passwordreset';
$h++;
}
2017-10-13 12:02:26 +02:00
}
// Admin and non admin can view this menu entry, but it is not shown yet when we on user menu "Email templates"
2021-03-19 13:37:43 +01:00
if (empty($_SESSION['leftmenu']) || $_SESSION['leftmenu'] != 'email_templates') {
2017-10-13 12:02:26 +02:00
$head[$h][0] = DOL_URL_ROOT."/admin/mails_senderprofile_list.php";
$head[$h][1] = $langs->trans("EmailSenderProfiles");
$head[$h][2] = 'senderprofiles';
$h++;
}
2021-01-26 11:19:13 +01:00
$head[$h][0] = DOL_URL_ROOT."/admin/mails_templates.php";
$head[$h][1] = $langs->trans("EMailTemplates");
$head[$h][2] = 'templates';
$h++;
$head[$h][0] = DOL_URL_ROOT."/admin/mails_ingoing.php";
$head[$h][1] = $langs->trans("InGoingEmailSetup", $langs->transnoentitiesnoconv("EMailing"));
$head[$h][2] = 'common_ingoing';
$h++;
complete_head_from_modules($conf, $langs, null, $head, $h, 'email_admin', 'remove');
2017-10-13 12:02:26 +02:00
return $head;
}