mirror of
https://github.com/devcode-it/openstamanager.git
synced 2025-02-16 11:30:55 +01:00
Fix per PHP 8.1
This commit is contained in:
parent
235446c06c
commit
4c9f512945
10
actions.php
10
actions.php
@ -349,10 +349,12 @@ HTMLBuilder\HTMLBuilder::setRecord($record);
|
||||
|
||||
if ($structure->permission == 'rw') {
|
||||
// Esecuzione delle operazioni di gruppo
|
||||
$id_records = post('id_records');
|
||||
$id_records = is_array($id_records) ? $id_records : explode(';', $id_records);
|
||||
$id_records = array_clean($id_records);
|
||||
$id_records = array_unique($id_records);
|
||||
if (!empty(post('id_records'))){
|
||||
$id_records = post('id_records');
|
||||
$id_records = is_array($id_records) ? $id_records : explode(';', $id_records);
|
||||
$id_records = array_clean($id_records);
|
||||
$id_records = array_unique($id_records);
|
||||
}
|
||||
|
||||
$bulk = $structure->filepath('bulk.php');
|
||||
$bulk = empty($bulk) ? [] : include $bulk;
|
||||
|
@ -80,7 +80,9 @@ if (!empty($query)) {
|
||||
$align = [];
|
||||
$row = isset($rows[0]) ? $rows[0] : [];
|
||||
foreach ($row as $field => $value) {
|
||||
$value = trim($value);
|
||||
if (!empty($value)){
|
||||
$value = trim($value);
|
||||
}
|
||||
|
||||
// Allineamento a destra se il valore della prima riga risulta numerica
|
||||
if (is_numeric($value) && formatter()->isStandardNumber($value)) {
|
||||
@ -119,7 +121,9 @@ if (!empty($query)) {
|
||||
$column['class'] = $align[$field];
|
||||
}
|
||||
|
||||
$value = trim($r[$field]);
|
||||
if (!empty($r[$field])){
|
||||
$value = trim($r[$field]);
|
||||
}
|
||||
|
||||
// Formattazione HTML
|
||||
if (empty($total['html_format'][$pos]) && !empty($value)) {
|
||||
|
@ -15,7 +15,7 @@
|
||||
}],
|
||||
"type": "project",
|
||||
"require": {
|
||||
"php": ">=7.2",
|
||||
"php": "^7.3|^8.0",
|
||||
"ext-curl": "*",
|
||||
"ext-dom": "*",
|
||||
"ext-fileinfo": "*",
|
||||
@ -34,9 +34,9 @@
|
||||
"dragonmantank/cron-expression": "^1.0",
|
||||
"ezyang/htmlpurifier": "^4.8",
|
||||
"filp/whoops": "^2.1",
|
||||
"guzzlehttp/guzzle": "^6.3",
|
||||
"guzzlehttp/guzzle": "^7.0.1",
|
||||
"ifsnop/mysqldump-php": "^2.3",
|
||||
"illuminate/database": "^6.0",
|
||||
"illuminate/database": "^8.0",
|
||||
"intervention/image": "^2.3",
|
||||
"league/csv": "9.5.0",
|
||||
"league/oauth2-client": "^2.6",
|
||||
@ -63,7 +63,7 @@
|
||||
"wdog/sdd_ita": "dev-master"
|
||||
},
|
||||
"require-dev": {
|
||||
"codeception/codeception": "^3.0",
|
||||
"codeception/codeception": "^4.0",
|
||||
"friendsofphp/php-cs-fixer": "^2.10"
|
||||
},
|
||||
"autoload": {
|
||||
@ -137,10 +137,11 @@
|
||||
"sort-packages": true,
|
||||
"optimize-autoloader": false,
|
||||
"apcu-autoloader": true,
|
||||
"minimum-stability": "dev",
|
||||
"prefer-stable": true,
|
||||
"platform-check": false,
|
||||
"platform": {
|
||||
"php": "7.4"
|
||||
"php": "8.0.17"
|
||||
},
|
||||
"allow-plugins": {
|
||||
"kylekatarnls/update-helper": true
|
||||
|
@ -386,7 +386,10 @@ class Database extends Util\Singleton
|
||||
*/
|
||||
public function prepare($parameter)
|
||||
{
|
||||
return $this->getPDO()->quote($parameter);
|
||||
if (!empty($parameter))
|
||||
return $this->getPDO()->quote($parameter);
|
||||
else
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -421,14 +421,18 @@ class Formatter
|
||||
*/
|
||||
public function formatDate($value)
|
||||
{
|
||||
$object = DateTime::createFromFormat(static::$standards['date'], $value);
|
||||
if (!empty($value)){
|
||||
$object = DateTime::createFromFormat(static::$standards['date'], $value);
|
||||
|
||||
// Fallback per la gestione dei timestamp
|
||||
$object = !is_object($object) ? DateTime::createFromFormat(static::$standards['timestamp'], $value) : $object;
|
||||
// Fallback per la gestione dei timestamp
|
||||
$object = !is_object($object) ? DateTime::createFromFormat(static::$standards['timestamp'], $value) : $object;
|
||||
|
||||
$result = is_object($object) ? $object->format($this->getDatePattern()) : false;
|
||||
$result = is_object($object) ? $object->format($this->getDatePattern()) : false;
|
||||
|
||||
return $result;
|
||||
return $result;
|
||||
}else{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -376,9 +376,15 @@ class Query
|
||||
$select[] = $view['query'].(!empty($view['name']) ? " AS '".$view['name']."'" : '');
|
||||
|
||||
if (!empty($view['visible'])) {
|
||||
$view['name'] = trim($view['name']);
|
||||
$view['search_inside'] = trim($view['search_inside']);
|
||||
$view['order_by'] = trim($view['order_by']);
|
||||
if (!empty($view['name'])){
|
||||
$view['name'] = trim($view['name']);
|
||||
}
|
||||
if (!empty($view['search_inside'])){
|
||||
$view['search_inside'] = trim($view['search_inside']);
|
||||
}
|
||||
if (!empty($view['order_by'])){
|
||||
$view['order_by'] = trim($view['order_by']);
|
||||
}
|
||||
|
||||
$fields[] = trim($view['name']);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user