Merge remote-tracking branch 'refs/remotes/origin/support/3.1' into support/3.2

# Conflicts:
#	.make/composer/rmDeniedTestDir.php
#	application/utils.inc.php
This commit is contained in:
jf-cbd
2024-05-17 11:16:56 +02:00
4 changed files with 56 additions and 54 deletions

View File

@@ -27,7 +27,7 @@ $iTopFolder = __DIR__."/../../../";
require_once("$iTopFolder/approot.inc.php");
require_once(APPROOT."/application/utils.inc.php");
if (php_sapi_name() !== 'cli')
if (PHP_SAPI !== 'cli')
{
throw new \Exception('This script can only run from CLI');
}

View File

@@ -244,13 +244,8 @@ class utils
public static function IsModeCLI()
{
$sSAPIName = php_sapi_name();
$sCleanName = strtolower(trim($sSAPIName));
if ($sCleanName == 'cli') {
return true;
} else {
return false;
}
$sCleanName = strtolower(trim(PHP_SAPI));
return ($sCleanName === 'cli');
}
/**
@@ -2226,8 +2221,8 @@ SQL;
$fScale = min($iMaxImageWidth / $iWidth, $iMaxImageHeight / $iHeight);
$iNewWidth = floor($iWidth * $fScale);
$iNewHeight = floor($iHeight * $fScale);
$iNewWidth = $iWidth * $fScale;
$iNewHeight = $iHeight * $fScale;
$new = imagecreatetruecolor($iNewWidth, $iNewHeight);

View File

@@ -68,7 +68,7 @@ if (file_exists(MAINTENANCE_MODE_FILE) && !$bBypassMaintenance)
http_response_code(503);
// Display message depending on the request
include(APPROOT.'application/maintenancemsg.php');
$sSAPIName = strtoupper(trim(php_sapi_name()));
$sSAPIName = strtoupper(trim(PHP_SAPI));
switch (true)
{

View File

@@ -4,6 +4,7 @@
{# SET WIDGET #}
{% set oDataProvider = oUIBlock.GetDataProvider() %}
let optionsBeforeFilter;
let oWidget{{ oUIBlock.GetId() }} = $('#{{ oUIBlock.GetId() }}').selectize({
{# Global options #}
@@ -117,6 +118,7 @@ let oWidget{{ oUIBlock.GetId() }} = $('#{{ oUIBlock.GetId() }}').selectize({
// Filter old options data to keep selected values
// (options with force flag will be kept event if they doesn't be part of the current value)
let options = Object.values(me.options);
optionsBeforeFilter = options;
options = options.filter(item => (typeof(item.force) !== "undefined" && item.force === true) || aSelectedItems.includes(item['{{ oDataProvider.GetDataValueField() }}']));
// Merge kept and new values
options = $.merge(options, res.data.search_data);
@@ -235,6 +237,11 @@ let oWidget{{ oUIBlock.GetId() }} = $('#{{ oUIBlock.GetId() }}').selectize({
{% endif %}
},
onBlur: function(){
this.clearOptionGroups()
this.addOption(optionsBeforeFilter)
},
{# plugin combodo_add_button #}
{% if oUIBlock.HasAddOptionButton() and oUIBlock.HasAddOptionButtonJsOnClick() %}
onAdd: function(){