Merge branch 'develop' into patch-11
This commit is contained in:
commit
e336c4e275
11 changed files with 28 additions and 31 deletions
|
|
@ -1630,9 +1630,9 @@ class Invoices extends DolibarrApi
|
|||
if ($is_multicurrency) {
|
||||
$amounts[$id] = null;
|
||||
// Multicurrency
|
||||
$multicurrency_amounts[$id] = $amount;
|
||||
$multicurrency_amounts[$id] = (float) $amount;
|
||||
} else {
|
||||
$amounts[$id] = $amount;
|
||||
$amounts[$id] = (float) $amount;
|
||||
// Multicurrency
|
||||
$multicurrency_amounts[$id] = null;
|
||||
}
|
||||
|
|
@ -1644,7 +1644,7 @@ class Invoices extends DolibarrApi
|
|||
$paymentobj->amounts = $amounts; // Array with all payments dispatching with invoice id
|
||||
$paymentobj->multicurrency_amounts = $multicurrency_amounts; // Array with all payments dispatching
|
||||
$paymentobj->paiementid = $paymentid;
|
||||
$paymentobj->paiementcode = dol_getIdFromCode($this->db, $paymentid, 'c_paiement', 'id', 'code', 1);
|
||||
$paymentobj->paiementcode = (string) dol_getIdFromCode($this->db, $paymentid, 'c_paiement', 'id', 'code', 1);
|
||||
$paymentobj->num_payment = $num_payment;
|
||||
$paymentobj->note_private = $comment;
|
||||
$paymentobj->ref_ext = $ref_ext;
|
||||
|
|
|
|||
|
|
@ -4323,7 +4323,7 @@ class Form
|
|||
* 0 : use default deposit percentage from entry
|
||||
* > 0 : force deposit percentage (for example, from company object)
|
||||
* @param int $noprint if set to one we return the html to print, if 0 (default) we print it
|
||||
* @return void
|
||||
* @return void|string
|
||||
* @deprecated
|
||||
*/
|
||||
public function select_conditions_paiements($selected = 0, $htmlname = 'condid', $filtertype = -1, $addempty = 0, $noinfoadmin = 0, $morecss = '', $deposit_percent = -1, $noprint = 0)
|
||||
|
|
|
|||
|
|
@ -136,7 +136,7 @@ class FormCategory extends Form
|
|||
return $num_rows;
|
||||
} else {
|
||||
dol_print_error($this->db);
|
||||
return;
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -143,7 +143,7 @@ class FormCompany extends Form
|
|||
* @param int $empty Add empty value in list
|
||||
* @return void
|
||||
*/
|
||||
public function form_prospect_level($page, $selected = '', $htmlname = 'prospect_level_id', $empty = 0)
|
||||
public function form_prospect_level($page, $selected = 0, $htmlname = 'prospect_level_id', $empty = 0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $user, $langs;
|
||||
|
|
@ -195,7 +195,7 @@ class FormCompany extends Form
|
|||
* @param int $empty Add empty value in list
|
||||
* @return void
|
||||
*/
|
||||
public function formProspectContactLevel($page, $selected = '', $htmlname = 'prospect_contact_level_id', $empty = 0)
|
||||
public function formProspectContactLevel($page, $selected = 0, $htmlname = 'prospect_contact_level_id', $empty = 0)
|
||||
{
|
||||
global $user, $langs;
|
||||
|
||||
|
|
@ -643,7 +643,7 @@ class FormCompany extends Form
|
|||
* @param string $morecss More CSS on select component
|
||||
* @return int The selected third party ID
|
||||
*/
|
||||
public function selectCompaniesForNewContact($object, $var_id, $selected = '', $htmlname = 'newcompany', $limitto = '', $forceid = 0, $moreparam = '', $morecss = '')
|
||||
public function selectCompaniesForNewContact($object, $var_id, $selected = 0, $htmlname = 'newcompany', $limitto = '', $forceid = 0, $moreparam = '', $morecss = '')
|
||||
{
|
||||
global $conf, $hookmanager;
|
||||
|
||||
|
|
|
|||
|
|
@ -332,7 +332,7 @@ class FormFile
|
|||
* @param int $hideifempty Hide section of generated files if there is no file
|
||||
* @param string $removeaction (optional) The action to remove a file
|
||||
* @param string $tooltipontemplatecombo Text to show on a tooltip after the combo list of templates
|
||||
* @return string Output string with HTML array of documents (might be empty string)
|
||||
* @return string|int Output string with HTML array of documents (might be empty string)
|
||||
*/
|
||||
public function showdocuments($modulepart, $modulesubdir, $filedir, $urlsource, $genallowed, $delallowed = 0, $modelselected = '', $allowgenifempty = 1, $forcenomultilang = 0, $iconPDF = 0, $notused = 0, $noform = 0, $param = '', $title = '', $buttonlabel = '', $codelang = '', $morepicto = '', $object = null, $hideifempty = 0, $removeaction = 'remove_file', $tooltipontemplatecombo = '')
|
||||
{
|
||||
|
|
|
|||
|
|
@ -683,7 +683,7 @@ class FormSetupItem
|
|||
$this->fieldValue = getDolGlobalString($this->confKey);
|
||||
return true;
|
||||
} else {
|
||||
$this->fieldValue = null;
|
||||
$this->fieldValue = '';
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
@ -1103,7 +1103,7 @@ class FormSetupItem
|
|||
} elseif (!empty($errors)) {
|
||||
$this->errors[] = $errors;
|
||||
}
|
||||
return;
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -2281,7 +2281,7 @@ class Lessc
|
|||
*
|
||||
* @param mixed $in Input
|
||||
* @param bool $force Force rebuild?
|
||||
* @return array lessphp cache structure
|
||||
* @return array|null lessphp cache structure
|
||||
*/
|
||||
public function cachedCompile($in, $force = false)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -126,12 +126,6 @@ class Menubase
|
|||
*/
|
||||
public $langs;
|
||||
|
||||
/**
|
||||
* @var string Not used
|
||||
* @deprecated
|
||||
*/
|
||||
public $level;
|
||||
|
||||
/**
|
||||
* @var string Name family/module for left menu (setup, info, ...)
|
||||
*/
|
||||
|
|
@ -183,7 +177,7 @@ class Menubase
|
|||
*/
|
||||
public function create($user = null)
|
||||
{
|
||||
global $conf, $langs;
|
||||
global $conf;
|
||||
|
||||
// Clean parameters
|
||||
if (!isset($this->enabled)) {
|
||||
|
|
@ -209,9 +203,6 @@ class Menubase
|
|||
if (empty($this->position)) {
|
||||
$this->position = 0;
|
||||
}
|
||||
if (!$this->level) {
|
||||
$this->level = 0;
|
||||
}
|
||||
|
||||
// Check parameters
|
||||
if (empty($this->menu_handler)) {
|
||||
|
|
|
|||
|
|
@ -1332,7 +1332,7 @@ class DoliDBPgsql extends DoliDB
|
|||
/**
|
||||
* Return list of available charset that can be used to store data in database
|
||||
*
|
||||
* @return array List of Charset
|
||||
* @return array|null List of Charset
|
||||
*/
|
||||
public function getListOfCharacterSet()
|
||||
{
|
||||
|
|
@ -1371,7 +1371,7 @@ class DoliDBPgsql extends DoliDB
|
|||
/**
|
||||
* Return list of available collation that can be used for database
|
||||
*
|
||||
* @return array Liste of Collation
|
||||
* @return array|null Liste of Collation
|
||||
*/
|
||||
public function getListOfCollation()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -219,7 +219,7 @@ define(
|
|||
'entrepot' => 'stock',
|
||||
'expedition' => 'delivery_note',
|
||||
'facture' => 'invoice',
|
||||
'fichinter' => 'intervention',
|
||||
'ficheinter' => 'intervention',
|
||||
'product_fournisseur_price' => 'productsupplierprice',
|
||||
'product_price' => 'productprice',
|
||||
'projet' => 'project',
|
||||
|
|
@ -240,6 +240,7 @@ function isModEnabled($module)
|
|||
|
||||
// Fix old names (map to new names)
|
||||
$arrayconv = DEPRECATED_MODULE_MAPPING;
|
||||
$arrayconvbis = array_flip(DEPRECATED_MODULE_MAPPING);
|
||||
|
||||
if (!getDolGlobalString('MAIN_USE_NEW_SUPPLIERMOD')) {
|
||||
// Special cases: both use the same module.
|
||||
|
|
@ -251,8 +252,12 @@ function isModEnabled($module)
|
|||
if (!empty($arrayconv[$module])) {
|
||||
$module_alt = $arrayconv[$module];
|
||||
}
|
||||
$module_bis = $module;
|
||||
if (!empty($arrayconvbis[$module])) {
|
||||
$module_bis = $arrayconvbis[$module];
|
||||
}
|
||||
|
||||
return !empty($conf->modules[$module]) || !empty($conf->modules[$module_alt]);
|
||||
return !empty($conf->modules[$module]) || !empty($conf->modules[$module_alt]) || !empty($conf->modules[$module_bis]);
|
||||
//return !empty($conf->$module->enabled);
|
||||
}
|
||||
|
||||
|
|
@ -2800,7 +2805,7 @@ function dol_bc($var, $moreclass = '')
|
|||
*/
|
||||
function dol_format_address($object, $withcountry = 0, $sep = "\n", $outputlangs = null, $mode = 0, $extralangcode = '')
|
||||
{
|
||||
global $conf, $langs, $hookmanager;
|
||||
global $langs, $hookmanager;
|
||||
|
||||
$ret = '';
|
||||
$countriesusingstate = array('AU', 'CA', 'US', 'IN', 'GB', 'ES', 'UK', 'TR', 'CN'); // See also MAIN_FORCE_STATE_INTO_ADDRESS
|
||||
|
|
@ -2889,6 +2894,7 @@ function dol_format_address($object, $withcountry = 0, $sep = "\n", $outputlangs
|
|||
* @param int $ts Timestamp (If is_gmt is true, timestamp is already includes timezone and daylight saving offset, if is_gmt is false, timestamp is a GMT timestamp and we must compensate with server PHP TZ)
|
||||
* @param bool $is_gmt See comment of timestamp parameter
|
||||
* @return string A formatted string
|
||||
* @see dol_stringtotime()
|
||||
*/
|
||||
function dol_strftime($fmt, $ts = false, $is_gmt = false)
|
||||
{
|
||||
|
|
@ -3552,7 +3558,7 @@ function getArrayOfSocialNetworks()
|
|||
*/
|
||||
function dol_print_socialnetworks($value, $cid, $socid, $type, $dictsocialnetworks = array())
|
||||
{
|
||||
global $conf, $user, $langs;
|
||||
global $user, $langs;
|
||||
|
||||
$htmllink = $value;
|
||||
|
||||
|
|
|
|||
|
|
@ -209,13 +209,13 @@ if ($action == 'create') {
|
|||
if ($backtopage) {
|
||||
print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
|
||||
}
|
||||
if ($backtopageforcancel) {
|
||||
if (!empty($backtopageforcancel)) {
|
||||
print '<input type="hidden" name="backtopageforcancel" value="'.$backtopageforcancel.'">';
|
||||
}
|
||||
if ($backtopagejsfields) {
|
||||
if (!empty($backtopagejsfields)) {
|
||||
print '<input type="hidden" name="backtopagejsfields" value="'.$backtopagejsfields.'">';
|
||||
}
|
||||
if ($dol_openinpopup) {
|
||||
if (!empty($dol_openinpopup)) {
|
||||
print '<input type="hidden" name="dol_openinpopup" value="'.$dol_openinpopup.'">';
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue