Fix: Removed warnings
This commit is contained in:
parent
2772d1dfa2
commit
6d8c1bf7c6
@ -53,7 +53,7 @@ class Conf
|
|||||||
|
|
||||||
public $modules = array(); // List of activated modules
|
public $modules = array(); // List of activated modules
|
||||||
public $modules_parts = array(); // List of modules parts
|
public $modules_parts = array(); // List of modules parts
|
||||||
|
|
||||||
// TODO Remove all thoose tabs with one generic
|
// TODO Remove all thoose tabs with one generic
|
||||||
public $sms_engine_modules = array();
|
public $sms_engine_modules = array();
|
||||||
public $css_modules = array();
|
public $css_modules = array();
|
||||||
@ -163,8 +163,8 @@ class Conf
|
|||||||
$modulename = strtolower($reg[1]);
|
$modulename = strtolower($reg[1]);
|
||||||
$partname = strtolower($reg[2]);
|
$partname = strtolower($reg[2]);
|
||||||
$varname = $partname.'_modules'; // TODO deprecated
|
$varname = $partname.'_modules'; // TODO deprecated
|
||||||
if (! is_array($this->$varname)) { $this->$varname = array(); } // TODO deprecated
|
if (! isset($this->$varname) || ! is_array($this->$varname)) { $this->$varname = array(); } // TODO deprecated
|
||||||
if (! is_array($this->modules_parts[$partname])) { $this->modules_parts[$partname] = array(); }
|
if (! isset($this->modules_parts[$partname]) || ! is_array($this->modules_parts[$partname])) { $this->modules_parts[$partname] = array(); }
|
||||||
$arrValue = dol_json_decode($value,true);
|
$arrValue = dol_json_decode($value,true);
|
||||||
if (is_array($arrValue) && ! empty($arrValue)) $value = $arrValue;
|
if (is_array($arrValue) && ! empty($arrValue)) $value = $arrValue;
|
||||||
else if (in_array($partname,array('login','menus','triggers'))) $value = '/'.$modulename.'/core/'.$partname.'/';
|
else if (in_array($partname,array('login','menus','triggers'))) $value = '/'.$modulename.'/core/'.$partname.'/';
|
||||||
|
|||||||
@ -147,7 +147,7 @@ if (! function_exists('json_decode'))
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Function that encodes data in json format
|
* Function that encodes data in json format
|
||||||
*
|
*
|
||||||
* @param mixed $elements PHP object to json encode
|
* @param mixed $elements PHP object to json encode
|
||||||
* @return string Json encoded string
|
* @return string Json encoded string
|
||||||
*/
|
*/
|
||||||
@ -166,7 +166,7 @@ function dol_json_encode($elements)
|
|||||||
function dol_json_decode($json, $assoc=false)
|
function dol_json_decode($json, $assoc=false)
|
||||||
{
|
{
|
||||||
$out='';
|
$out='';
|
||||||
$out = unserialize($json); // For compatibility, test if serialized
|
$out = @unserialize($json); // For compatibility, test if serialized
|
||||||
if (empty($out)) $out = json_decode($json, $assoc);
|
if (empty($out)) $out = json_decode($json, $assoc);
|
||||||
return $out;
|
return $out;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -309,7 +309,7 @@ if (! GETPOST("action") || preg_match('/upgrade/i',GETPOST('action')))
|
|||||||
if (versioncompare($versiontoarray,$afterversionarray) >= 0 && versioncompare($versiontoarray,$beforeversionarray) <= 0)
|
if (versioncompare($versiontoarray,$afterversionarray) >= 0 && versioncompare($versiontoarray,$beforeversionarray) <= 0)
|
||||||
{
|
{
|
||||||
migrate_mode_reglement($db,$langs,$conf);
|
migrate_mode_reglement($db,$langs,$conf);
|
||||||
|
|
||||||
// Reload modules
|
// Reload modules
|
||||||
migrate_reload_modules($db,$langs,$conf);
|
migrate_reload_modules($db,$langs,$conf);
|
||||||
|
|
||||||
@ -1193,7 +1193,7 @@ function migrate_paiementfourn_facturefourn($db,$langs,$conf)
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Mise a jour des totaux lignes de facture
|
* Mise a jour des totaux lignes de facture
|
||||||
*
|
*
|
||||||
* @param DoliDB $db Database handler
|
* @param DoliDB $db Database handler
|
||||||
* @param Translate $langs Object langs
|
* @param Translate $langs Object langs
|
||||||
* @param Conf $conf Object conf
|
* @param Conf $conf Object conf
|
||||||
@ -3209,10 +3209,10 @@ function migrate_shipping_delivery2($db,$langs,$conf)
|
|||||||
function migrate_actioncomm_element($db,$langs,$conf)
|
function migrate_actioncomm_element($db,$langs,$conf)
|
||||||
{
|
{
|
||||||
print '<tr><td colspan="4">';
|
print '<tr><td colspan="4">';
|
||||||
|
|
||||||
print '<br>';
|
print '<br>';
|
||||||
print '<b>'.$langs->trans('MigrationActioncommElement')."</b><br>\n";
|
print '<b>'.$langs->trans('MigrationActioncommElement')."</b><br>\n";
|
||||||
|
|
||||||
$elements = array(
|
$elements = array(
|
||||||
'propal' => 'propalrowid',
|
'propal' => 'propalrowid',
|
||||||
'order' => 'fk_commande',
|
'order' => 'fk_commande',
|
||||||
@ -3221,7 +3221,7 @@ function migrate_actioncomm_element($db,$langs,$conf)
|
|||||||
'order_supplier' => 'fk_supplier_order',
|
'order_supplier' => 'fk_supplier_order',
|
||||||
'invoice_supplier' => 'fk_supplier_invoice'
|
'invoice_supplier' => 'fk_supplier_invoice'
|
||||||
);
|
);
|
||||||
|
|
||||||
foreach($elements as $type => $field)
|
foreach($elements as $type => $field)
|
||||||
{
|
{
|
||||||
$result = $db->DDLDescTable(MAIN_DB_PREFIX."actioncomm",$field);
|
$result = $db->DDLDescTable(MAIN_DB_PREFIX."actioncomm",$field);
|
||||||
@ -3229,20 +3229,20 @@ function migrate_actioncomm_element($db,$langs,$conf)
|
|||||||
if ($obj)
|
if ($obj)
|
||||||
{
|
{
|
||||||
dolibarr_install_syslog("upgrade2::migrate_actioncomm_element field=".$field);
|
dolibarr_install_syslog("upgrade2::migrate_actioncomm_element field=".$field);
|
||||||
|
|
||||||
$db->begin();
|
$db->begin();
|
||||||
|
|
||||||
$sql = "UPDATE ".MAIN_DB_PREFIX."actioncomm SET ";
|
$sql = "UPDATE ".MAIN_DB_PREFIX."actioncomm SET ";
|
||||||
$sql.= "fk_element = ".$field.", elementtype = '".$type."'";
|
$sql.= "fk_element = ".$field.", elementtype = '".$type."'";
|
||||||
$sql.= " WHERE ".$field." IS NOT NULL";
|
$sql.= " WHERE ".$field." IS NOT NULL";
|
||||||
$sql.= " AND fk_element IS NULL";
|
$sql.= " AND fk_element IS NULL";
|
||||||
$sql.= " AND elementtype IS NULL";
|
$sql.= " AND elementtype IS NULL";
|
||||||
|
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
{
|
{
|
||||||
$db->commit();
|
$db->commit();
|
||||||
|
|
||||||
// DDL commands must not be inside a transaction
|
// DDL commands must not be inside a transaction
|
||||||
// We will drop at next version because a migrate should be runnable several times if it fails.
|
// We will drop at next version because a migrate should be runnable several times if it fails.
|
||||||
//$sqlDrop = "ALTER TABLE ".MAIN_DB_PREFIX."actioncomm DROP COLUMN ".$field;
|
//$sqlDrop = "ALTER TABLE ".MAIN_DB_PREFIX."actioncomm DROP COLUMN ".$field;
|
||||||
@ -3260,7 +3260,7 @@ function migrate_actioncomm_element($db,$langs,$conf)
|
|||||||
print $langs->trans('AlreadyDone')."<br>\n";
|
print $langs->trans('AlreadyDone')."<br>\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3275,10 +3275,10 @@ function migrate_actioncomm_element($db,$langs,$conf)
|
|||||||
function migrate_mode_reglement($db,$langs,$conf)
|
function migrate_mode_reglement($db,$langs,$conf)
|
||||||
{
|
{
|
||||||
print '<tr><td colspan="4">';
|
print '<tr><td colspan="4">';
|
||||||
|
|
||||||
print '<br>';
|
print '<br>';
|
||||||
print '<b>'.$langs->trans('MigrationPaymentMode')."</b><br>\n";
|
print '<b>'.$langs->trans('MigrationPaymentMode')."</b><br>\n";
|
||||||
|
|
||||||
$elements = array(
|
$elements = array(
|
||||||
'old_id' => array(5,8,9,10,11),
|
'old_id' => array(5,8,9,10,11),
|
||||||
'new_id' => array(50,51,52,53,54),
|
'new_id' => array(50,51,52,53,54),
|
||||||
@ -3286,13 +3286,13 @@ function migrate_mode_reglement($db,$langs,$conf)
|
|||||||
'tables' => array('commande_fournisseur','commande','facture_rec','facture','propal')
|
'tables' => array('commande_fournisseur','commande','facture_rec','facture','propal')
|
||||||
);
|
);
|
||||||
$count=0;
|
$count=0;
|
||||||
|
|
||||||
foreach($elements['old_id'] as $key => $old_id)
|
foreach($elements['old_id'] as $key => $old_id)
|
||||||
{
|
{
|
||||||
$error=0;
|
$error=0;
|
||||||
|
|
||||||
dolibarr_install_syslog("upgrade2::migrate_mode_reglement code=".$elements['code'][$key]);
|
dolibarr_install_syslog("upgrade2::migrate_mode_reglement code=".$elements['code'][$key]);
|
||||||
|
|
||||||
$sqlSelect = "SELECT id";
|
$sqlSelect = "SELECT id";
|
||||||
$sqlSelect.= " FROM ".MAIN_DB_PREFIX."c_paiement";
|
$sqlSelect.= " FROM ".MAIN_DB_PREFIX."c_paiement";
|
||||||
$sqlSelect.= " WHERE id = ".$old_id;
|
$sqlSelect.= " WHERE id = ".$old_id;
|
||||||
@ -3305,9 +3305,9 @@ function migrate_mode_reglement($db,$langs,$conf)
|
|||||||
if ($num)
|
if ($num)
|
||||||
{
|
{
|
||||||
$count++;
|
$count++;
|
||||||
|
|
||||||
$db->begin();
|
$db->begin();
|
||||||
|
|
||||||
$sql = "UPDATE ".MAIN_DB_PREFIX."c_paiement SET ";
|
$sql = "UPDATE ".MAIN_DB_PREFIX."c_paiement SET ";
|
||||||
$sql.= "id = ".$elements['new_id'][$key];
|
$sql.= "id = ".$elements['new_id'][$key];
|
||||||
$sql.= " WHERE id = ".$old_id;
|
$sql.= " WHERE id = ".$old_id;
|
||||||
@ -3330,7 +3330,7 @@ function migrate_mode_reglement($db,$langs,$conf)
|
|||||||
}
|
}
|
||||||
print ". ";
|
print ". ";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
$db->commit();
|
$db->commit();
|
||||||
@ -3349,10 +3349,10 @@ function migrate_mode_reglement($db,$langs,$conf)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($count == 0) print $langs->trans('AlreadyDone')."<br>\n";
|
if ($count == 0) print $langs->trans('AlreadyDone')."<br>\n";
|
||||||
|
|
||||||
|
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3501,36 +3501,6 @@ function migrate_reload_modules($db,$langs,$conf)
|
|||||||
$mod->init('noboxes');
|
$mod->init('noboxes');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (! empty($conf->global->MAIN_MODULE_PHENIX))
|
|
||||||
{
|
|
||||||
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate module Phenix");
|
|
||||||
$res=@include_once(DOL_DOCUMENT_ROOT.'/core/modules/modPhenix.class.php');
|
|
||||||
if ($res) {
|
|
||||||
$mod=new modPhenix($db);
|
|
||||||
$mod->remove('noboxes');
|
|
||||||
$mod->init();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (! empty($conf->global->MAIN_MODULE_WEBCALENDAR))
|
|
||||||
{
|
|
||||||
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate module Webcalendar");
|
|
||||||
$res=@include_once(DOL_DOCUMENT_ROOT.'/core/modules/modWebcalendar.class.php');
|
|
||||||
if ($res) {
|
|
||||||
$mod=new modWebcalendar($db);
|
|
||||||
$mod->remove('noboxes');
|
|
||||||
$mod->init();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (! empty($conf->global->MAIN_MODULE_MANTIS))
|
|
||||||
{
|
|
||||||
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate module Mantis");
|
|
||||||
$res=@include_once(DOL_DOCUMENT_ROOT.'/core/modules/modMantis.class.php');
|
|
||||||
if ($res) {
|
|
||||||
$mod=new modMantis($db);
|
|
||||||
$mod->remove('noboxes');
|
|
||||||
$mod->init();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (! empty($conf->global->MAIN_MODULE_SOCIETE))
|
if (! empty($conf->global->MAIN_MODULE_SOCIETE))
|
||||||
{
|
{
|
||||||
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate module Societe");
|
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate module Societe");
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user