This commit is contained in:
MatteoPistorello 2020-10-30 11:19:45 +01:00
commit 815a741de8
51 changed files with 133 additions and 90 deletions

View File

@ -348,7 +348,7 @@ if ($structure->permission == 'rw') {
$query = 'SELECT `id`, `html_name` AS `name` FROM `zz_fields` WHERE '.$custom_where; $query = 'SELECT `id`, `html_name` AS `name` FROM `zz_fields` WHERE '.$custom_where;
$customs = $dbo->fetchArray($query); $customs = $dbo->fetchArray($query);
if (!starts_with(post('op'), 'delete')) { if (!string_starts_with(post('op'), 'delete')) {
$values = []; $values = [];
foreach ($customs as $custom) { foreach ($customs as $custom) {
if (post($custom['name']) !== null) { if (post($custom['name']) !== null) {
@ -357,7 +357,7 @@ if ($structure->permission == 'rw') {
} }
// Inserimento iniziale // Inserimento iniziale
if (starts_with(post('op'), 'add')) { if (string_starts_with(post('op'), 'add')) {
// Informazioni di log // Informazioni di log
Filter::set('get', 'id_record', $id_record); Filter::set('get', 'id_record', $id_record);
@ -371,7 +371,7 @@ if ($structure->permission == 'rw') {
} }
// Aggiornamento // Aggiornamento
elseif (starts_with(post('op'), 'update')) { elseif (string_starts_with(post('op'), 'update')) {
$query = 'SELECT `zz_field_record`.`id_field` FROM `zz_field_record` JOIN `zz_fields` ON `zz_fields`.`id` = `zz_field_record`.`id_field` WHERE id_record = '.prepare($id_record).' AND '.$custom_where; $query = 'SELECT `zz_field_record`.`id_field` FROM `zz_field_record` JOIN `zz_fields` ON `zz_fields`.`id` = `zz_field_record`.`id_field` WHERE id_record = '.prepare($id_record).' AND '.$custom_where;
$customs_present = $dbo->fetchArray($query); $customs_present = $dbo->fetchArray($query);
$customs_present = array_column($customs_present, 'id_field'); $customs_present = array_column($customs_present, 'id_field');

View File

@ -1028,7 +1028,7 @@ div.tip {
} }
.control-sidebar-toggle { .control-sidebar-toggle {
display: none !important; /*display: none !important;*/
} }
} }

View File

@ -10,7 +10,7 @@
], ],
"homepage": "https://www.openstamanager.com/", "homepage": "https://www.openstamanager.com/",
"authors": [{ "authors": [{
"name": "DevCode s.n.c", "name": "DevCode s.n.c.",
"email": "info@openstamanager.com" "email": "info@openstamanager.com"
}], }],
"type": "project", "type": "project",

View File

@ -96,7 +96,7 @@ echo '
redirectOperation($id_module, isset($id_parent) ? $id_parent : $id_record); redirectOperation($id_module, isset($id_parent) ? $id_parent : $id_record);
// Interfaccia per la modifica dell'ordine e della visibilità delle colonne (Amministratore) // Interfaccia per la modifica dell'ordine e della visibilità delle colonne (Amministratore)
if ($user->is_admin && str_contains($module['option'], '|select|')) { if ($user->is_admin && string_contains($module['option'], '|select|')) {
echo ' echo '
<button type="button" class="btn btn-xs btn-primary pull-right" onclick="modificaColonne(this)"> <button type="button" class="btn btn-xs btn-primary pull-right" onclick="modificaColonne(this)">
<i class="fa fa-th-list"></i> '.tr('Modifica colonne').' <i class="fa fa-th-list"></i> '.tr('Modifica colonne').'

View File

@ -40,7 +40,7 @@ if (!empty($id_record)) {
Util\Query::setSegments(true); Util\Query::setSegments(true);
} }
// Replace automatico del campo deleted_at se non specifico a una tabella // Replace automatico del campo deleted_at se non specifico a una tabella
if (!str_contains($query, '.`deleted_at`') && !str_contains($query, '.deleted_at')) { if (!string_contains($query, '.`deleted_at`') && !string_contains($query, '.deleted_at')) {
$query = str_replace(['AND `deleted_at` IS NULL', '`deleted_at` IS NULL AND', '`deleted_at` IS NULL', 'AND deleted_at IS NULL', 'deleted_at IS NULL AND', 'deleted_at IS NULL'], '', $query); $query = str_replace(['AND `deleted_at` IS NULL', '`deleted_at` IS NULL AND', '`deleted_at` IS NULL', 'AND deleted_at IS NULL', 'deleted_at IS NULL AND', 'deleted_at IS NULL'], '', $query);
} }
@ -105,11 +105,32 @@ if (empty($record) || !$has_access) {
echo ' echo '
</a> </a>
</li> </li>';
$hide_left_sidebar = Auth::check() && (setting('Nascondere la barra dei plugin di default'));
echo '
<li class="control-sidebar-toggle"> <li class="control-sidebar-toggle">
<a data-toggle="control-sidebar" style="cursor: pointer">'.tr('Plugin').'</a> <a data-toggle="control-sidebar" style="cursor: pointer">'.tr('Plugin').'</a>
</li> </li>
<script>
$( document ).ready(function() {';
if (!empty($hide_left_sidebar)){
echo ' $(".control-sidebar").removeClass("control-sidebar-shown"); $("aside.content-wrapper, .main-footer").toggleClass("with-control-sidebar");';
}
echo '
$(".control-sidebar-toggle").bind("click", function() {
$("aside.content-wrapper, .main-footer").toggleClass("with-control-sidebar");
$(".control-sidebar").toggleClass("control-sidebar-shown");
});
});
</script>
</ul> </ul>
<div class="tab-content"> <div class="tab-content">

View File

@ -26,7 +26,7 @@ if (Auth::check()) {
</section><!-- /.content --> </section><!-- /.content -->
</aside><!-- /.content-wrapper --> </aside><!-- /.content-wrapper -->
<footer class="main-footer '.(str_contains($_SERVER['SCRIPT_FILENAME'], 'editor.php') ? 'with-control-sidebar' : '').'"> <footer class="main-footer '.(string_contains($_SERVER['SCRIPT_FILENAME'], 'editor.php') ? 'with-control-sidebar' : '').'">
<a class="hidden-xs" href="'.tr('https://www.openstamanager.com').'" title="'.tr("Il gestionale open source per l'assistenza tecnica e la fatturazione").'." target="_blank"><strong>'.tr('OpenSTAManager').'</strong></a> <a class="hidden-xs" href="'.tr('https://www.openstamanager.com').'" title="'.tr("Il gestionale open source per l'assistenza tecnica e la fatturazione").'." target="_blank"><strong>'.tr('OpenSTAManager').'</strong></a>
<span class="pull-right hidden-xs"> <span class="pull-right hidden-xs">
<strong>'.tr('Versione').'</strong> '.$version.' <strong>'.tr('Versione').'</strong> '.$version.'

View File

@ -73,8 +73,8 @@ if (post('db_host') !== null) {
$privileges = current($result); $privileges = current($result);
if ( if (
str_contains($privileges, ' ON `'.$db_name.'`.*') || string_contains($privileges, ' ON `'.$db_name.'`.*') ||
str_contains($privileges, ' ON *.*') string_contains($privileges, ' ON *.*')
) { ) {
$pieces = explode(', ', explode(' ON ', str_replace('GRANT ', '', $privileges))[0]); $pieces = explode(', ', explode(' ON ', str_replace('GRANT ', '', $privileges))[0]);

View File

@ -110,9 +110,9 @@ foreach ($settings as $name => $values) {
$ini = str_replace(['k', 'M'], ['000', '000000'], ini_get($name)); $ini = str_replace(['k', 'M'], ['000', '000000'], ini_get($name));
$real = str_replace(['k', 'M'], ['000', '000000'], $description); $real = str_replace(['k', 'M'], ['000', '000000'], $description);
if (starts_with($real, '>')) { if (string_starts_with($real, '>')) {
$status = $ini >= substr($real, 1); $status = $ini >= substr($real, 1);
} elseif (starts_with($real, '<')) { } elseif (string_starts_with($real, '<')) {
$status = $ini <= substr($real, 1); $status = $ini <= substr($real, 1);
} else { } else {
$status = ($real == $ini); $status = ($real == $ini);

View File

@ -63,7 +63,7 @@ if (Auth::check()) {
$array = $_SESSION['module_'.$id_module]; $array = $_SESSION['module_'.$id_module];
if (!empty($array)) { if (!empty($array)) {
foreach ($array as $field => $value) { foreach ($array as $field => $value) {
if (!empty($value) && starts_with($field, 'search_')) { if (!empty($value) && string_starts_with($field, 'search_')) {
$field_name = str_replace('search_', '', $field); $field_name = str_replace('search_', '', $field);
echo ' echo '
@ -433,7 +433,7 @@ if (Auth::check()) {
<!-- /.sidebar --> <!-- /.sidebar -->
</aside>'; </aside>';
if (str_contains($_SERVER['SCRIPT_FILENAME'], 'editor.php')) { if (string_contains($_SERVER['SCRIPT_FILENAME'], 'editor.php')) {
// Menu laterale per la visualizzazione dei plugin // Menu laterale per la visualizzazione dei plugin
echo ' echo '
<aside class="control-sidebar control-sidebar-light control-sidebar-shown"> <aside class="control-sidebar control-sidebar-light control-sidebar-shown">
@ -496,15 +496,15 @@ if (Auth::check()) {
echo ' echo '
<!-- Right side column. Contains the navbar and content of the page --> <!-- Right side column. Contains the navbar and content of the page -->
<aside class="content-wrapper '.(str_contains($_SERVER['SCRIPT_FILENAME'], 'editor.php') ? 'with-control-sidebar' : '').'"> <aside class="content-wrapper '.(string_contains($_SERVER['SCRIPT_FILENAME'], 'editor.php') ? 'with-control-sidebar' : '').'">
<!-- Main content --> <!-- Main content -->
<section class="content"> <section class="content">
<div class="row">'; <div class="row">';
if (str_contains($_SERVER['SCRIPT_FILENAME'], 'editor.php')) { if (string_contains($_SERVER['SCRIPT_FILENAME'], 'editor.php')) {
$location = 'editor_right'; $location = 'editor_right';
} elseif (str_contains($_SERVER['SCRIPT_FILENAME'], 'controller.php')) { } elseif (string_contains($_SERVER['SCRIPT_FILENAME'], 'controller.php')) {
$location = 'controller_right'; $location = 'controller_right';
} }

View File

@ -308,7 +308,7 @@ function redirectOperation($id_module, $id_record)
// Scelta del redirect dopo un submit // Scelta del redirect dopo un submit
if (!empty($backto)) { if (!empty($backto)) {
$hash = filter('hash'); $hash = filter('hash');
$hash = !starts_with($hash, '#') ? '#'.$hash : $hash; $hash = !string_starts_with($hash, '#') ? '#'.$hash : $hash;
$hash = $hash == '#tab_0' ? '' : $hash; $hash = $hash == '#tab_0' ? '' : $hash;
if ($backto == 'record-edit') { if ($backto == 'record-edit') {

View File

@ -98,7 +98,7 @@ if (!function_exists('array_deep_clean')) {
} }
} }
if (!function_exists('starts_with')) { if (!function_exists('string_starts_with')) {
/** /**
* Check if a string starts with the given string. * Check if a string starts with the given string.
* *
@ -107,14 +107,14 @@ if (!function_exists('starts_with')) {
* *
* @return bool * @return bool
*/ */
function starts_with($string, $starts_with) function string_starts_with($string, $starts_with)
{ {
//return strpos($string, $starts_with) === 0; //return strpos($string, $string_starts_with) === 0;
return S::create($string)->startsWith($starts_with); return S::create($string)->startsWith($starts_with);
} }
} }
if (!function_exists('ends_with')) { if (!function_exists('string_ends_with')) {
/** /**
* Check if a string ends with the given string. * Check if a string ends with the given string.
* *
@ -123,14 +123,14 @@ if (!function_exists('ends_with')) {
* *
* @return bool * @return bool
*/ */
function ends_with($string, $ends_with) function string_ends_with($string, $ends_with)
{ {
//return substr($string, -strlen($ends_with)) === $ends_with; //return substr($string, -strlen($string_ends_with)) === $string_ends_with;
return S::create($string)->endsWith($ends_with); return S::create($string)->endsWith($ends_with);
} }
} }
if (!function_exists('str_contains')) { if (!function_exists('string_contains')) {
/** /**
* Check if a string contains the given string. * Check if a string contains the given string.
* *
@ -139,14 +139,14 @@ if (!function_exists('str_contains')) {
* *
* @return bool * @return bool
*/ */
function str_contains($string, $contains) function string_contains($string, $contains)
{ {
//return strpos($string, $contains) !== false; //return strpos($string, $contains) !== false;
return S::create($string)->contains($contains); return S::create($string)->contains($contains);
} }
} }
if (!function_exists('str_to_lower')) { if (!function_exists('string_lowercase')) {
/** /**
* Converts a string in the lower-case version. * Converts a string in the lower-case version.
* *
@ -154,13 +154,13 @@ if (!function_exists('str_to_lower')) {
* *
* @return string * @return string
*/ */
function str_to_lower($string) function string_lowercase($string)
{ {
return S::create($string)->toLowerCase()->__toString(); return S::create($string)->toLowerCase()->__toString();
} }
} }
if (!function_exists('str_to_upper')) { if (!function_exists('string_uppercase')) {
/** /**
* Converts a string in the upper-case version. * Converts a string in the upper-case version.
* *
@ -168,7 +168,7 @@ if (!function_exists('str_to_upper')) {
* *
* @return string * @return string
*/ */
function str_to_upper($string) function string_uppercase($string)
{ {
return S::create($string)->toUpperCase()->__toString(); return S::create($string)->toUpperCase()->__toString();
} }

View File

@ -75,7 +75,7 @@ foreach ($rs as $r) {
// Campi da evidenziare // Campi da evidenziare
$result['labels'] = []; $result['labels'] = [];
foreach ($fields as $name => $value) { foreach ($fields as $name => $value) {
if (str_contains($r[$name], $term)) { if (string_contains($r[$name], $term)) {
$text = str_replace($term, "<span class='highlight'>".$term.'</span>', $r[$name]); $text = str_replace($term, "<span class='highlight'>".$term.'</span>', $r[$name]);
$result['labels'][] = $name.': '.$text.'<br/>'; $result['labels'][] = $name.': '.$text.'<br/>';
@ -121,7 +121,7 @@ foreach ($rs as $r) {
// Campi da evidenziare // Campi da evidenziare
$result['labels'] = []; $result['labels'] = [];
foreach ($fields as $name => $value) { foreach ($fields as $name => $value) {
if (str_contains($r[$name], $term)) { if (string_contains($r[$name], $term)) {
$text = str_replace($term, "<span class='highlight'>".$term.'</span>', $r[$name]); $text = str_replace($term, "<span class='highlight'>".$term.'</span>', $r[$name]);
$result['labels'][] = $name.': '.$text.'<br/>'; $result['labels'][] = $name.': '.$text.'<br/>';

View File

@ -56,7 +56,7 @@ foreach ($rs as $r) {
// Campi da evidenziare // Campi da evidenziare
$result['labels'] = []; $result['labels'] = [];
foreach ($fields as $name => $value) { foreach ($fields as $name => $value) {
if (str_contains($r[$name], $term)) { if (string_contains($r[$name], $term)) {
$text = str_replace($term, "<span class='highlight'>".$term.'</span>', $r[$name]); $text = str_replace($term, "<span class='highlight'>".$term.'</span>', $r[$name]);
$result['labels'][] = $name.': '.$text.'<br/>'; $result['labels'][] = $name.': '.$text.'<br/>';

View File

@ -50,7 +50,7 @@ if (!is_writable($backup_dir) || !is_readable($backup_dir)) {
echo '<p>'.tr('Il backup è molto importante perché permette di creare una copia della propria installazione e relativi dati per poterla poi ripristinare in seguito a errori, cancellazioni accidentali o guasti hardware').'.</p>'; echo '<p>'.tr('Il backup è molto importante perché permette di creare una copia della propria installazione e relativi dati per poterla poi ripristinare in seguito a errori, cancellazioni accidentali o guasti hardware').'.</p>';
if (starts_with($backup_dir, base_dir())) { if (string_starts_with($backup_dir, base_dir())) {
echo ' echo '
<div class="alert alert-warning"> <div class="alert alert-warning">
<i class="fa fa-warning"></i> '.tr('Per motivi di sicurezza si consiglia di modificare il percorso della cartella di backup al di fuori della cartella di OSM, possibilmente in una unità esterna').'. <i class="fa fa-warning"></i> '.tr('Per motivi di sicurezza si consiglia di modificare il percorso della cartella di backup al di fuori della cartella di OSM, possibilmente in una unità esterna').'.
@ -170,7 +170,7 @@ if (file_exists($backup_dir)) {
$backups_file = []; $backups_file = [];
foreach ($backups as $key => $backup) { foreach ($backups as $key => $backup) {
if (ends_with($backup, '.zip')) { if (string_ends_with($backup, '.zip')) {
$backups_zip[$key] = $backup; $backups_zip[$key] = $backup;
} else { } else {
$backups_file[$key] = $backup; $backups_file[$key] = $backup;

View File

@ -32,7 +32,7 @@ $notes = collect();
$moduli = Module::getAll()->where('permission', '<>', '-'); $moduli = Module::getAll()->where('permission', '<>', '-');
foreach ($moduli as $modulo) { foreach ($moduli as $modulo) {
$note = $modulo->notes()->where('notification_date', '>=', date('Y-m-d'))->get(); $note = $modulo->notes()->whereNotNull('notification_date')->orderBy('notification_date', 'asc')->get();
$notes = $notes->merge($note); $notes = $notes->merge($note);
} }
@ -42,7 +42,7 @@ if (!empty($is_number_request)) {
return; return;
} }
if (empty($notes)) { if ($notes->count() < 1) {
echo ' echo '
<p>'.tr('Non ci sono note da notificare').'.</p>'; <p>'.tr('Non ci sono note da notificare').'.</p>';

View File

@ -58,7 +58,7 @@ foreach ($rs as $r) {
// Campi da evidenziare // Campi da evidenziare
$result['labels'] = []; $result['labels'] = [];
foreach ($fields as $name => $value) { foreach ($fields as $name => $value) {
if (str_contains($r[$name], $term)) { if (string_contains($r[$name], $term)) {
if ($name == 'Righe') { if ($name == 'Righe') {
$result['labels'][] = tr('Termine presente nelle righe del documento').'<br/>'; $result['labels'][] = tr('Termine presente nelle righe del documento').'<br/>';
} else { } else {

View File

@ -60,7 +60,7 @@ foreach ($rs as $r) {
// Campi da evidenziare // Campi da evidenziare
$result['labels'] = []; $result['labels'] = [];
foreach ($fields as $name => $value) { foreach ($fields as $name => $value) {
if (str_contains($r[$name], $term)) { if (string_contains($r[$name], $term)) {
if ($name == 'Righe') { if ($name == 'Righe') {
$result['labels'][] = tr('Termine presente nelle righe del documento').'<br/>'; $result['labels'][] = tr('Termine presente nelle righe del documento').'<br/>';
} else { } else {

View File

@ -80,7 +80,8 @@ foreach ($righe as $riga) {
'_RIVALSA_' => $riga->rivalsa_inps ? '<br>Rivalsa: '.moneyFormat(abs($riga->rivalsa_inps)) : null, '_RIVALSA_' => $riga->rivalsa_inps ? '<br>Rivalsa: '.moneyFormat(abs($riga->rivalsa_inps)) : null,
'_RITENUTA_ACCONTO_' => $riga->ritenuta_acconto ? '<br>Ritenuta acconto: '.moneyFormat(abs($riga->ritenuta_acconto)) : null, '_RITENUTA_ACCONTO_' => $riga->ritenuta_acconto ? '<br>Ritenuta acconto: '.moneyFormat(abs($riga->ritenuta_acconto)) : null,
'_RITENUTA_CONTRIBUTI_' => $riga->ritenuta_contributi ? '<br>Ritenuta contributi: '.moneyFormat(abs($riga->ritenuta_contributi)) : null, '_RITENUTA_CONTRIBUTI_' => $riga->ritenuta_contributi ? '<br>Ritenuta contributi: '.moneyFormat(abs($riga->ritenuta_contributi)) : null,
'_DESCRIZIONE_CONTO_' => $descrizione_conto ?: null, '_DESCRIZIONE_CONTO_' => $descrizione_conto ?: '<span class="label label-danger" ><i class="fa fa-exclamation-triangle"></i>
'.tr("Conto mancante").'</span>',
'_ID_DOCUMENTO_' => $id_documento_fe ? ' - DOC: '.$id_documento_fe : null, '_ID_DOCUMENTO_' => $id_documento_fe ? ' - DOC: '.$id_documento_fe : null,
'_NUMERO_RIGA_' => $num_item ? ', NRI: '.$num_item : null, '_NUMERO_RIGA_' => $num_item ? ', NRI: '.$num_item : null,
'_CODICE_CIG_' => $codice_cig ? ', CIG: '.$codice_cig : null, '_CODICE_CIG_' => $codice_cig ? ', CIG: '.$codice_cig : null,

View File

@ -56,7 +56,7 @@ foreach ($rs as $r) {
// Campi da evidenziare // Campi da evidenziare
$result['labels'] = []; $result['labels'] = [];
foreach ($fields as $name => $value) { foreach ($fields as $name => $value) {
if (str_contains($r[$name], $term)) { if (string_contains($r[$name], $term)) {
$text = str_replace($term, "<span class='highlight'>".$term.'</span>', $r[$name]); $text = str_replace($term, "<span class='highlight'>".$term.'</span>', $r[$name]);
$result['labels'][] = $name.': '.$text.'<br/>'; $result['labels'][] = $name.': '.$text.'<br/>';

View File

@ -72,7 +72,7 @@ if (empty($id_record)) {
$nomi_disponibili[$key] = []; $nomi_disponibili[$key] = [];
$names = isset($value['names']) ? $value['names'] : [$value['label']]; $names = isset($value['names']) ? $value['names'] : [$value['label']];
foreach ($names as $name) { foreach ($names as $name) {
$nomi_disponibili[$key][] = trim(str_to_lower($name)); $nomi_disponibili[$key][] = trim(string_lowercase($name));
} }
} }
@ -95,7 +95,7 @@ if (empty($id_record)) {
$selezionato = null; $selezionato = null;
foreach ($fields as $key => $value) { foreach ($fields as $key => $value) {
// Confronto per l'individuazione della relativa colonna // Confronto per l'individuazione della relativa colonna
$nome = trim(str_to_lower($prima_riga[$column])); $nome = trim(string_lowercase($prima_riga[$column]));
if (in_array($nome, $nomi_disponibili[$key])) { if (in_array($nome, $nomi_disponibili[$key])) {
$escludi_prima_riga = 1; $escludi_prima_riga = 1;
$selezionato = $key; $selezionato = $key;

View File

@ -31,9 +31,27 @@ foreach ($impostazioni as $impostazione) {
'.Settings::input($impostazione['id']).' '.Settings::input($impostazione['id']).'
</div> </div>
<script> <script>';
if ($impostazione->tipo == 'time'){
echo '
input("setting['.$impostazione->id.']");
$(document).on("blur", "#setting'.$impostazione->id.'", function (e) {
salvaImpostazione('.$impostazione->id.', $("#setting'.$impostazione->id.'").val());
});
';
}
else{
echo '
input("setting['.$impostazione->id.']").change(function (){ input("setting['.$impostazione->id.']").change(function (){
salvaImpostazione('.$impostazione->id.', input(this).get()); salvaImpostazione('.$impostazione->id.', input(this).get());
}); });';
}
echo '
</script>'; </script>';
} }

View File

@ -60,7 +60,7 @@ foreach ($rs as $r) {
// Campi da evidenziare // Campi da evidenziare
$result['labels'] = []; $result['labels'] = [];
foreach ($fields as $name => $value) { foreach ($fields as $name => $value) {
if (str_contains($r[$name], $term)) { if (string_contains($r[$name], $term)) {
$text = str_replace($term, "<span class='highlight'>".$term.'</span>', $r[$name]); $text = str_replace($term, "<span class='highlight'>".$term.'</span>', $r[$name]);
$result['labels'][] = $name.': '.$text.'<br/>'; $result['labels'][] = $name.': '.$text.'<br/>';

View File

@ -75,10 +75,10 @@ foreach ($tecnici as $id_tecnico => $ore) {
// Conflitti ristretti per orario // Conflitti ristretti per orario
foreach ($ore as $orario) { foreach ($ore as $orario) {
$query_conflitto = $query.' AND (orario_inizio > '.prepare($orario['inizio']).' AND orario_inizio < '.prepare($orario['fine']).') OR $query_conflitto = $query.' AND ((orario_inizio > '.prepare($orario['inizio']).' AND orario_inizio < '.prepare($orario['fine']).') OR
(orario_fine > '.prepare($orario['inizio']).' AND orario_fine < '.prepare($orario['fine']).') OR (orario_fine > '.prepare($orario['inizio']).' AND orario_fine < '.prepare($orario['fine']).') OR
(orario_inizio < '.prepare($orario['inizio']).' AND orario_fine > '.prepare($orario['inizio']).') OR (orario_inizio < '.prepare($orario['inizio']).' AND orario_fine > '.prepare($orario['inizio']).') OR
(orario_inizio < '.prepare($orario['fine']).' AND orario_fine > '.prepare($orario['fine']).')'; (orario_inizio < '.prepare($orario['fine']).' AND orario_fine > '.prepare($orario['fine']).'))';
$conflitto = $database->fetchArray($query_conflitto); $conflitto = $database->fetchArray($query_conflitto);
if (!empty($conflitto)) { if (!empty($conflitto)) {

View File

@ -106,7 +106,7 @@ class Sync extends Resource implements RetrieveInterface, UpdateInterface
$description = $event['DESCRIPTION']; $description = $event['DESCRIPTION'];
// Individuazione idriga di in_interventi_tecnici // Individuazione idriga di in_interventi_tecnici
if (str_contains($event['UID'], '-')) { if (string_contains($event['UID'], '-')) {
$idriga = 'NEW'; $idriga = 'NEW';
} else { } else {
$idriga = $event['UID']; $idriga = $event['UID'];

View File

@ -58,7 +58,7 @@ foreach ($rs as $r) {
// Campi da evidenziare // Campi da evidenziare
$result['labels'] = []; $result['labels'] = [];
foreach ($fields as $name => $value) { foreach ($fields as $name => $value) {
if (str_contains($r[$name], $term)) { if (string_contains($r[$name], $term)) {
$text = str_replace($term, "<span class='highlight'>".$term.'</span>', $r[$name]); $text = str_replace($term, "<span class='highlight'>".$term.'</span>', $r[$name]);
$result['labels'][] = $name.': '.$text.'<br/>'; $result['labels'][] = $name.': '.$text.'<br/>';

View File

@ -21,7 +21,7 @@ include_once __DIR__.'/../../core.php';
switch (post('op')) { switch (post('op')) {
case 'update': case 'update':
$pattern = str_contains(post('pattern'), '#') ? post('pattern') : '####'; $pattern = string_contains(post('pattern'), '#') ? post('pattern') : '####';
$predefined = post('predefined'); $predefined = post('predefined');
$module = post('module'); $module = post('module');
@ -61,7 +61,7 @@ switch (post('op')) {
break; break;
case 'add': case 'add':
$pattern = str_contains(post('pattern'), '#') ? post('pattern') : '####'; $pattern = string_contains(post('pattern'), '#') ? post('pattern') : '####';
$predefined = post('predefined'); $predefined = post('predefined');
$module = post('module'); $module = post('module');

View File

@ -87,7 +87,7 @@ $_SESSION['module_'.$record['id_module']]['id_segment'] = $previous_module;
<?php <?php
if (str_contains($current_module['option'], '|segment')) { if (string_contains($current_module['option'], '|segment')) {
?> ?>
<!-- Campi extra --> <!-- Campi extra -->
<div class="panel panel-primary"> <div class="panel panel-primary">

View File

@ -37,7 +37,7 @@ switch (filter('op')) {
$temp_name = $_FILES['blob']['tmp_name']; $temp_name = $_FILES['blob']['tmp_name'];
$name = $_FILES['blob']['name']; $name = $_FILES['blob']['name'];
if (ends_with($name, '.zip')) { if (string_ends_with($name, '.zip')) {
$directory = FatturaElettronica::getImportDirectory(); $directory = FatturaElettronica::getImportDirectory();
Util\Zip::extract($temp_name, $directory); Util\Zip::extract($temp_name, $directory);

View File

@ -52,7 +52,7 @@ class FatturaElettronica
{ {
$this->file = static::getImportDirectory().'/'.$name; $this->file = static::getImportDirectory().'/'.$name;
if (ends_with($name, '.p7m')) { if (string_ends_with($name, '.p7m')) {
$file = XML::decodeP7M($this->file); $file = XML::decodeP7M($this->file);
if (!empty($file)) { if (!empty($file)) {

View File

@ -49,7 +49,7 @@ class Ricevuta
$file = static::getImportDirectory().'/'.$name; $file = static::getImportDirectory().'/'.$name;
// Estrazione implicita per il formato ZIP // Estrazione implicita per il formato ZIP
if (ends_with($name, '.zip')) { if (string_ends_with($name, '.zip')) {
$original_file = $file; $original_file = $file;
$extraction_dir = static::getImportDirectory().'/tmp'; $extraction_dir = static::getImportDirectory().'/tmp';

View File

@ -94,7 +94,7 @@ class AJAX
*/ */
public static function selectResults($query, $where, $filter = [], $search = [], $limit = [], $custom = []) public static function selectResults($query, $where, $filter = [], $search = [], $limit = [], $custom = [])
{ {
if (str_contains($query, '|filter|')) { if (string_contains($query, '|filter|')) {
$query = str_replace('|filter|', !empty($filter) ? 'WHERE '.implode(' OR ', $filter) : '', $query); $query = str_replace('|filter|', !empty($filter) ? 'WHERE '.implode(' OR ', $filter) : '', $query);
} elseif (!empty($filter)) { } elseif (!empty($filter)) {
$where[] = '('.implode(' OR ', $filter).')'; $where[] = '('.implode(' OR ', $filter).')';

View File

@ -86,7 +86,7 @@ class Manager
$value = substr($value, 1, -1); $value = substr($value, 1, -1);
// Individuazione della tipologia (array o string) // Individuazione della tipologia (array o string)
$where[$key] = str_contains($value, ',') ? explode(',', $value) : $value; $where[$key] = string_contains($value, ',') ? explode(',', $value) : $value;
} }
// Ordinamento personalizzato // Ordinamento personalizzato

View File

@ -301,7 +301,7 @@ class App
*/ */
public static function filepath($path, $file = null) public static function filepath($path, $file = null)
{ {
$path = str_contains($path, base_dir()) ? $path : base_dir().'/'.ltrim($path, '/'); $path = string_contains($path, base_dir()) ? $path : base_dir().'/'.ltrim($path, '/');
$path = empty($file) ? $path : rtrim($path, '/').'/'.$file; $path = empty($file) ? $path : rtrim($path, '/').'/'.$file;
$original_file = str_replace('|custom|', '', $path); $original_file = str_replace('|custom|', '', $path);

View File

@ -169,7 +169,7 @@ class Backup
], ],
]; ];
if (starts_with($backup_dir, slashes(base_dir()))) { if (string_starts_with($backup_dir, slashes(base_dir()))) {
$ignores['dirs'][] = basename($backup_dir); $ignores['dirs'][] = basename($backup_dir);
} }

View File

@ -303,7 +303,7 @@ class Database extends Util\Singleton
*/ */
public function fetchOne($query, $parameters = []) public function fetchOne($query, $parameters = [])
{ {
if (!str_contains($query, 'LIMIT')) { if (!string_contains($query, 'LIMIT')) {
$query .= ' LIMIT 1'; $query .= ' LIMIT 1';
} }

View File

@ -486,7 +486,7 @@ class HTMLBuilder
foreach ($values as $key => $value) { foreach ($values as $key => $value) {
// Fix per la presenza di apici doppi // Fix per la presenza di apici doppi
$value = prepareToField(is_array($value) ? implode(' ', $value) : $value); $value = prepareToField(is_array($value) ? implode(' ', $value) : $value);
if (str_contains($result, '|'.$key.'|')) { if (string_contains($result, '|'.$key.'|')) {
$result = str_replace('|'.$key.'|', $value, $result); $result = str_replace('|'.$key.'|', $value, $result);
} elseif (!empty($value) || is_numeric($value)) { } elseif (!empty($value) || is_numeric($value)) {
$attributes[] = $key.'="'.$value.'"'; $attributes[] = $key.'="'.$value.'"';

View File

@ -246,7 +246,7 @@ class DefaultHandler implements HandlerInterface
if (isset($values['decimals'])) { if (isset($values['decimals'])) {
if (is_numeric($values['decimals'])) { if (is_numeric($values['decimals'])) {
$decimals = $values['decimals']; $decimals = $values['decimals'];
} elseif (starts_with($values['decimals'], 'qta')) { } elseif (string_starts_with($values['decimals'], 'qta')) {
$decimals = setting('Cifre decimali per quantità'); $decimals = setting('Cifre decimali per quantità');
$values['decimals'] = $decimals; $values['decimals'] = $decimals;

View File

@ -84,14 +84,14 @@ class SelectHandler implements HandlerInterface
} }
// Gestione del select da query specifica (se il campo "values" è impostato a "query=SQL") // Gestione del select da query specifica (se il campo "values" è impostato a "query=SQL")
elseif (starts_with($values['values'], 'query=')) { elseif (string_starts_with($values['values'], 'query=')) {
$query = substr($values['values'], strlen('query=')); $query = substr($values['values'], strlen('query='));
$result .= $this->selectQuery($query, $values['value']); $result .= $this->selectQuery($query, $values['value']);
} }
// Gestione del select dal formato JSON parziale (valori singoli) // Gestione del select dal formato JSON parziale (valori singoli)
elseif (starts_with($values['values'], 'list=')) { elseif (string_starts_with($values['values'], 'list=')) {
$list = substr($values['values'], strlen('list=')); $list = substr($values['values'], strlen('list='));
$result .= $this->selectList(json_decode('{'.$list.'}', true), $values); $result .= $this->selectList(json_decode('{'.$list.'}', true), $values);

View File

@ -177,15 +177,15 @@ class HTMLWrapper implements WrapperInterface
{ {
$result = $string; $result = $string;
if (starts_with($string, 'add|')) { if (string_starts_with($string, 'add|')) {
$result = $this->add($values, $extras, $string); $result = $this->add($values, $extras, $string);
$values['icon-custom'] = 'no-padding'; $values['icon-custom'] = 'no-padding';
} elseif (starts_with($string, 'choice|')) { } elseif (string_starts_with($string, 'choice|')) {
$result = $this->choice($values, $extras, $string); $result = $this->choice($values, $extras, $string);
$values['icon-custom'] = 'no-padding'; $values['icon-custom'] = 'no-padding';
} }
if (str_contains($string, '<button')) { if (string_contains($string, '<button')) {
$values['icon-custom'] = 'no-padding'; $values['icon-custom'] = 'no-padding';
} }

View File

@ -301,7 +301,7 @@ class Formatter
$values = str_split(strrev($integer), 4); $values = str_split(strrev($integer), 4);
foreach ($values as $key => $value) { foreach ($values as $key => $value) {
if (strlen($value) == 4 && ends_with($value, $current['thousands'])) { if (strlen($value) == 4 && string_ends_with($value, $current['thousands'])) {
$values[$key] = substr($value, 0, -1); $values[$key] = substr($value, 0, -1);
} }
} }

View File

@ -282,7 +282,7 @@ class Modules
$alternativo = is_bool($alternativo) && $alternativo ? $testo : $alternativo; $alternativo = is_bool($alternativo) && $alternativo ? $testo : $alternativo;
// Aggiunta automatica dell'icona di riferimento // Aggiunta automatica dell'icona di riferimento
if (!str_contains($testo, '<i ')) { if (!string_contains($testo, '<i ')) {
$testo = $testo.' <i class="fa fa-external-link"></i>'; $testo = $testo.' <i class="fa fa-external-link"></i>';
} }

View File

@ -379,7 +379,7 @@ class Prints
$report = str_replace('$table$', $table, $report); $report = str_replace('$table$', $table, $report);
// Footer di default // Footer di default
if (!str_contains($report, '<page_footer>')) { if (!string_contains($report, '<page_footer>')) {
$report .= '<page_footer>$default_footer$</page_footer>'; $report .= '<page_footer>$default_footer$</page_footer>';
} }

View File

@ -175,7 +175,7 @@ class Update
{ {
$version = self::getVersion(); $version = self::getVersion();
return str_contains($version, 'beta'); return string_contains($version, 'beta');
} }
/** /**
@ -517,7 +517,7 @@ class Update
{ {
$version = str_replace('.', '_', $update['version']); $version = str_replace('.', '_', $update['version']);
$old_standard = str_contains($update['version'], '_'); $old_standard = string_contains($update['version'], '_');
if (empty($update['directory']) && !$old_standard) { if (empty($update['directory']) && !$old_standard) {
return 'update/'.$version; return 'update/'.$version;
} }
@ -544,7 +544,7 @@ class Update
*/ */
protected static function getFile($file) protected static function getFile($file)
{ {
$file = (str_contains($file, base_dir().DIRECTORY_SEPARATOR)) ? $file : base_dir().DIRECTORY_SEPARATOR.$file; $file = (string_contains($file, base_dir().DIRECTORY_SEPARATOR)) ? $file : base_dir().DIRECTORY_SEPARATOR.$file;
$result = ''; $result = '';

View File

@ -158,7 +158,7 @@ class Ini
$tipo = ($array[$sezione]['tipo'] == 'input') ? 'text' : $array[$sezione]['tipo']; $tipo = ($array[$sezione]['tipo'] == 'input') ? 'text' : $array[$sezione]['tipo'];
$valore = $array[$sezione]['valore']; $valore = $array[$sezione]['valore'];
$opzioni = str_contains($array[$sezione]['opzioni'] ?: '', ',') ? explode(',', $array[$sezione]['opzioni']) : []; $opzioni = string_contains($array[$sezione]['opzioni'] ?: '', ',') ? explode(',', $array[$sezione]['opzioni']) : [];
$values = []; $values = [];
foreach ($opzioni as $o) { foreach ($opzioni as $o) {
$values[] = '\"'.addslashes(addslashes($o)).'\": \"'.addslashes(addslashes($o)).'\"'; $values[] = '\"'.addslashes(addslashes($o)).'\": \"'.addslashes(addslashes($o)).'\"';

View File

@ -53,7 +53,7 @@ class Query
*/ */
public static function readQuery($element) public static function readQuery($element)
{ {
if (str_contains($element['option'], '|select|')) { if (string_contains($element['option'], '|select|')) {
$result = self::readNewQuery($element); $result = self::readNewQuery($element);
} else { } else {
$result = self::readOldQuery($element); $result = self::readOldQuery($element);
@ -173,7 +173,7 @@ class Query
$search_query = $total['search_inside'][$pos]; $search_query = $total['search_inside'][$pos];
// Campo con ricerca personalizzata // Campo con ricerca personalizzata
if (str_contains($search_query, '|search|')) { if (string_contains($search_query, '|search|')) {
$pieces = explode(',', $value); $pieces = explode(',', $value);
foreach ($pieces as $piece) { foreach ($pieces as $piece) {
$piece = trim($piece); $piece = trim($piece);
@ -195,12 +195,12 @@ class Query
// Gestione confronti // Gestione confronti
$real_value = trim(str_replace(['&lt;', '&gt;'], ['<', '>'], $value)); $real_value = trim(str_replace(['&lt;', '&gt;'], ['<', '>'], $value));
$more = starts_with($real_value, '>=') || starts_with($real_value, '> =') || starts_with($real_value, '>'); $more = string_starts_with($real_value, '>=') || string_starts_with($real_value, '> =') || string_starts_with($real_value, '>');
$minus = starts_with($real_value, '<=') || starts_with($real_value, '< =') || starts_with($real_value, '<'); $minus = string_starts_with($real_value, '<=') || string_starts_with($real_value, '< =') || string_starts_with($real_value, '<');
$equal = starts_with($real_value, '='); $equal = string_starts_with($real_value, '=');
if ($minus || $more || $equal) { if ($minus || $more || $equal) {
$sign = str_contains($real_value, '=') ? '=' : ''; $sign = string_contains($real_value, '=') ? '=' : '';
if ($more) { if ($more) {
$sign = '>'.$sign; $sign = '>'.$sign;
} elseif ($minus) { } elseif ($minus) {
@ -314,7 +314,7 @@ class Query
$results = []; $results = [];
if (!empty($sums)) { if (!empty($sums)) {
foreach ($sums as $key => $sum) { foreach ($sums as $key => $sum) {
if (str_contains($key, 'sum_')) { if (string_contains($key, 'sum_')) {
$results[str_replace('sum_', '', $key)] = Translator::numberToLocale($sum); $results[str_replace('sum_', '', $key)] = Translator::numberToLocale($sum);
} }
} }

View File

@ -78,7 +78,7 @@ class Validate
} }
// Controllo sulla sintassi // Controllo sulla sintassi
if (starts_with($vat_number, 'IT') && !static::vatCheckIT($vat_number)) { if (string_starts_with($vat_number, 'IT') && !static::vatCheckIT($vat_number)) {
$result['valid-format'] = false; $result['valid-format'] = false;
return $result; return $result;

View File

@ -50,7 +50,7 @@ foreach ($prefixes as $prefix) {
$replaces[$prefix.'pec'] = !empty($replaces[$prefix.'pec']) ? 'PEC: '.$replaces[$prefix.'pec'] : ''; $replaces[$prefix.'pec'] = !empty($replaces[$prefix.'pec']) ? 'PEC: '.$replaces[$prefix.'pec'] : '';
foreach ($replaces as $key => $value) { foreach ($replaces as $key => $value) {
if (starts_with($key, $prefix)) { if (string_starts_with($key, $prefix)) {
$replaces[$key] = empty($value) ? $value : $value.'<br/>'; $replaces[$key] = empty($value) ? $value : $value.'<br/>';
} }
} }

View File

@ -34,7 +34,7 @@ $search_filters = [];
if (is_array($_SESSION['module_'.$id_module])) { if (is_array($_SESSION['module_'.$id_module])) {
foreach ($_SESSION['module_'.$id_module] as $field => $value) { foreach ($_SESSION['module_'.$id_module] as $field => $value) {
if (!empty($value) && starts_with($field, 'search_')) { if (!empty($value) && string_starts_with($field, 'search_')) {
$field_name = str_replace('search_', '', $field); $field_name = str_replace('search_', '', $field);
$field_name = str_replace('__', ' ', $field_name); $field_name = str_replace('__', ' ', $field_name);
$field_name = str_replace('-', ' ', $field_name); $field_name = str_replace('-', ' ', $field_name);

View File

@ -34,7 +34,7 @@ $search_filters = [];
if (is_array($_SESSION['module_'.$id_module])) { if (is_array($_SESSION['module_'.$id_module])) {
foreach ($_SESSION['module_'.$id_module] as $field => $value) { foreach ($_SESSION['module_'.$id_module] as $field => $value) {
if (!empty($value) && starts_with($field, 'search_')) { if (!empty($value) && string_starts_with($field, 'search_')) {
$field_name = str_replace('search_', '', $field); $field_name = str_replace('search_', '', $field);
$field_name = str_replace('__', ' ', $field_name); $field_name = str_replace('__', ' ', $field_name);
$field_name = str_replace('-', ' ', $field_name); $field_name = str_replace('-', ' ', $field_name);

View File

@ -329,4 +329,7 @@ UPDATE `zz_modules` SET `options` = 'SELECT |select| FROM `co_scadenziario`\r\n
DELETE FROM `zz_tokens` WHERE `zz_tokens`.`enabled` = 0; DELETE FROM `zz_tokens` WHERE `zz_tokens`.`enabled` = 0;
-- Aggiunto colonna sconto per le coppie anagrafica articolo -- Aggiunto colonna sconto per le coppie anagrafica articolo
ALTER TABLE `mg_prezzi_articoli` ADD `sconto` DECIMAL(15,6) NOT NULL AFTER `massimo`; ALTER TABLE `mg_prezzi_articoli` ADD `sconto` DECIMAL(15,6) NOT NULL AFTER `massimo`;
-- Aggiunta impostazione per mostrare o nascondere barra plugin
INSERT INTO `zz_settings` (`id`, `nome`, `valore`, `tipo`, `editable`, `sezione`, `order`, `help`) VALUES (NULL, 'Nascondere la barra dei plugin di default', '0', 'boolean', '1', 'Generali', '2', NULL);

View File

@ -39,7 +39,7 @@ if (empty($file)) {
$backup = $backups[$i]; $backup = $backups[$i];
// Individuazione del database nel backup // Individuazione del database nel backup
if (ends_with($backup, '.zip')) { if (string_ends_with($backup, '.zip')) {
$zip = new ZipArchive(); $zip = new ZipArchive();
$zip->open($backup); $zip->open($backup);
@ -85,7 +85,7 @@ $count = count($queries);
// Individuazione del dump di co_movimenti // Individuazione del dump di co_movimenti
$query = null; $query = null;
for ($i = 0; $i < $count; ++$i) { for ($i = 0; $i < $count; ++$i) {
if (starts_with($queries[$i], 'INSERT INTO `co_movimenti`')) { if (string_starts_with($queries[$i], 'INSERT INTO `co_movimenti`')) {
$query = $queries[$i]; $query = $queries[$i];
} }
} }