Stile del codice

This commit is contained in:
Thomas Zilio 2018-09-19 09:57:30 +02:00
parent d8609a9ead
commit 0480497128
19 changed files with 46 additions and 67 deletions

View File

@ -75,10 +75,10 @@ if (setting('Attiva aggiornamenti')) {
},
success: function(data){
if (data == "none") {
$("#update-search").html("'.tr("Nessun aggiornamento presente").'.");
$("#update-search").html("'.tr('Nessun aggiornamento presente').'.");
} else {
$("#update-search").html("'.tr("E' stato individuato un nuovo aggiornamento").': " + data + ".<br>'.tr('Scaricalo ora: _LINK_', [
'_LINK_' => "<a href='https://github.com/devcode-it/openstamanager/releases'>https://github.com/devcode-it/openstamanager/releases</a>"
'_LINK_' => "<a href='https://github.com/devcode-it/openstamanager/releases'>https://github.com/devcode-it/openstamanager/releases</a>",
]).'");
}
}

View File

@ -52,7 +52,7 @@ foreach ($rs as $r) {
$result['link'] = ROOTDIR.'/editor.php?id_module='.$id_module.'&id_record='.$r['id'];
$result['title'] = $r['ragione_sociale'];
$result['title'] .= !empty($r['deleted_at']) ? ' <small class="text-danger"><em>('.tr('Eliminato').')</em></small>': '';
$result['title'] .= !empty($r['deleted_at']) ? ' <small class="text-danger"><em>('.tr('Eliminato').')</em></small>' : '';
$result['category'] = 'Anagrafiche';
// Campi da evidenziare

View File

@ -255,7 +255,7 @@ if (!$cliente) {
<div class="col-md-3">
{[ "type": "text", "label": "<?php echo tr('Codice R.E.A.').'<small>('.tr('provincia/C.C.I.A.A.').')</small>'; ?>", "name": "codicerea", "value": "$codicerea$", "help": "<?php echo tr('Formato: _PATTERN_', [
'_PATTERN_' => 'RM-123456'
'_PATTERN_' => 'RM-123456',
]); ?>" ]}
</div>
@ -464,7 +464,7 @@ if (!empty($elementi)) {
<div class="box box-warning collapsable collapsed-box">
<div class="box-header with-border">
<h3 class="box-title"><i class="fa fa-warning"></i> '.tr('Documenti collegati: _NUM_', [
'_NUM_' => count($elementi)
'_NUM_' => count($elementi),
]).'</h3>
<div class="box-tools pull-right">
<button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-plus"></i></button>

View File

@ -365,7 +365,7 @@ if (!empty($elementi)) {
<div class="box box-warning collapsable collapsed-box">
<div class="box-header with-border">
<h3 class="box-title"><i class="fa fa-warning"></i> '.tr('Documenti collegati: _NUM_', [
'_NUM_' => count($elementi)
'_NUM_' => count($elementi),
]).'</h3>
<div class="box-tools pull-right">
<button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-plus"></i></button>

View File

@ -394,7 +394,7 @@ if (!empty($elementi)) {
<div class="box box-warning collapsable collapsed-box">
<div class="box-header with-border">
<h3 class="box-title"><i class="fa fa-warning"></i> '.tr('Documenti collegati: _NUM_', [
'_NUM_' => count($elementi)
'_NUM_' => count($elementi),
]).'</h3>
<div class="box-tools pull-right">
<button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-plus"></i></button>

View File

@ -6,5 +6,4 @@ if (isset($id_record)) {
$records = $dbo->fetchArray('SELECT * FROM zz_fields WHERE id='.prepare($id_record));
}
// TODO: prevedere un utilizzo pratico del campo options

View File

@ -238,7 +238,7 @@ if (!empty($elementi)) {
<div class="box box-warning collapsable collapsed-box">
<div class="box-header with-border">
<h3 class="box-title"><i class="fa fa-warning"></i> '.tr('Documenti collegati: _NUM_', [
'_NUM_' => count($elementi)
'_NUM_' => count($elementi),
]).'</h3>
<div class="box-tools pull-right">
<button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-plus"></i></button>

View File

@ -441,56 +441,42 @@ if (!empty($operations)) {
echo '
<script>
$( ".btn-sm[data-toggle=\"tooltip\"]" ).each(function() {
$(".btn-sm[data-toggle=\"tooltip\"]").each(function() {
$(this).on("click", function(){
form = $("#edit-form");
btn = $(this);
prev_html = btn.html();
prev_class = btn.attr("class");
btn.html("<i class=\"fa fa-spinner fa-pulse fa-fw\"></i> Attendere...");
btn.addClass("btn-warning");
btn.prop("disabled", true);
function restore_btn(btn, prev_html, prev_class){
btn.attr("class", "");
btn.addClass(prev_class);
btn.html(prev_html);
btn.prop("disabled", false);
}
var restore = buttonLoading(btn);
// Procedo al salvataggio solo se tutti i campi obbligatori sono compilati, altimenti mostro avviso
if (form.parsley().isValid()){
if (form.parsley().isValid()) {
content_was_modified = false;
content_was_modified = false;
form.find("input:disabled, select:disabled").removeAttr("disabled");
form.find("input:disabled, select:disabled").removeAttr("disabled");
$.ajax({
url: globals.rootdir + "/modules/fatture/actions.php?id_module=" + globals.id_module ,
cache: false,
type: "POST",
processData: false,
dataType : "html",
data: form.serialize(),
success: function(data) {
$("#main_loading").fadeOut();
$.ajax({
url: "'.ROOTDIR.'/modules/fatture/actions.php?id_module=" + globals.id_module ,
cache: false,
type: "POST",
processData: false,
dataType : "html",
data: form.serialize(),
success: function(data) {
$("#main_loading").fadeOut();
buttonRestore(btn, restore);
},
error: function(data) {
$("#main_loading").fadeOut();
restore_btn(btn, prev_html, prev_class);
},
error: function(data) {
$("#main_loading").fadeOut();
swal("'.tr('Errore').'", "'.tr('Errore durante il salvataggio').'", "error");
swal("'.tr('Errore').'", "'.tr('Errore durante il salvataggio').'", "error");
session_set ("errors,0", 0, 1);
buttonRestore(btn, restore);
}
});
restore_btn(btn, prev_html, prev_class);
}
});
} else {
} else {
swal({
type: "error",
text: "'.tr('Alcuni campi obbligatori non sono stati compilati correttamente.').'",
@ -501,11 +487,10 @@ $( ".btn-sm[data-toggle=\"tooltip\"]" ).each(function() {
function hide_popup(){
$("#bs-popup").modal("hide");
session_set ("errors,0", 0, 1);
form.parsley().validate();
}
restore_btn(btn, prev_html, prev_class);
buttonRestore(btn, restore);
}
});

View File

@ -335,7 +335,7 @@ if (!empty($elementi)) {
<div class="box box-warning collapsable collapsed-box">
<div class="box-header with-border">
<h3 class="box-title"><i class="fa fa-warning"></i> '.tr('Documenti collegati: _NUM_', [
'_NUM_' => count($elementi)
'_NUM_' => count($elementi),
]).'</h3>
<div class="box-tools pull-right">
<button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-plus"></i></button>

View File

@ -150,7 +150,7 @@ if (!empty($elementi)) {
<div class="box box-warning collapsable collapsed-box">
<div class="box-header with-border">
<h3 class="box-title"><i class="fa fa-warning"></i> '.tr('Documenti collegati: _NUM_', [
'_NUM_' => count($elementi)
'_NUM_' => count($elementi),
]).'</h3>
<div class="box-tools pull-right">
<button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-plus"></i></button>

View File

@ -171,7 +171,7 @@ if (!empty($elementi)) {
<div class="box box-warning collapsable collapsed-box">
<div class="box-header with-border">
<h3 class="box-title"><i class="fa fa-warning"></i> '.tr('Documenti collegati: _NUM_', [
'_NUM_' => count($elementi)
'_NUM_' => count($elementi),
]).'</h3>
<div class="box-tools pull-right">
<button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-plus"></i></button>

View File

@ -83,7 +83,7 @@ if (!empty($elementi)) {
<div class="box box-warning collapsable collapsed-box">
<div class="box-header with-border">
<h3 class="box-title"><i class="fa fa-warning"></i> '.tr('Template email collegati: _NUM_', [
'_NUM_' => count($elementi)
'_NUM_' => count($elementi),
]).'</h3>
<div class="box-tools pull-right">
<button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-plus"></i></button>

View File

@ -463,7 +463,6 @@ function testQuery(){
$("#main_loading").fadeOut();
swal("'.tr('Errore').'", "'.tr('Errore durante il test della query!').'", "error");
session_set ("errors,0", 0, 1);
}
})
}

View File

@ -206,9 +206,7 @@ echo '
}
}).then(
function (result) {
prev_html = $("#add_promemoria").html();
$("#add_promemoria").html("<i class=\'fa fa-spinner fa-pulse fa-fw\'></i> '.tr('Attendere...').'");
$("#add_promemoria").prop("disabled", true);
var restore = buttonLoading("#add_promemoria");
$.post(globals.rootdir + "/actions.php?id_plugin='.$plugin['id'].'&id_parent='.$id_record.'", {
op: "add-promemoria",
@ -217,8 +215,7 @@ echo '
}).done(function(data) {
launch_modal("Nuovo promemoria", globals.rootdir + "/plugins/'.$plugin['directory'].'/pianficazione.php?id_plugin='.$plugin['id'].'&id_parent='.$id_record.'&id_record=" + data + "&add=1");
$("#add_promemoria").html(prev_html);
$("#add_promemoria").prop("disabled", false);
buttonRestore("#add_promemoria", restore);
});
},
function (dismiss) {}

View File

@ -43,7 +43,6 @@ class App
],
];
/**
* Restituisce la configurazione di default del progetto.
*

View File

@ -25,4 +25,3 @@ class CKEditorHandler implements HandlerInterface
</script>';
}
}

View File

@ -126,7 +126,8 @@ class Settings
* Genera l'input HTML per la modifica dell'impostazione.
*
* @param string|int $setting
* @param boolean $required
* @param bool $required
*
* @return string
*/
public static function input($setting, $required = false)

View File

@ -12,7 +12,7 @@ class Update
/** @var array Percorsi da controllare per gli aggiornamenti */
protected static $directories = [
'modules',
'plugins'
'plugins',
];
/**

View File

@ -630,18 +630,18 @@ foreach ($movimenti as $movimento) {
$documento = null;
if (!empty($movimento['idintervento'])) {
$documento = $dbo->fetchOne("SELECT IFNULL(MAX(orario_fine), data_richiesta) AS data FROM in_interventi LEFT JOIN in_interventi_tecnici ON in_interventi.id=in_interventi_tecnici.idintervento WHERE in_interventi.id=".prepare($movimento['idintervento']));
$documento = $dbo->fetchOne('SELECT IFNULL(MAX(orario_fine), data_richiesta) AS data FROM in_interventi LEFT JOIN in_interventi_tecnici ON in_interventi.id=in_interventi_tecnici.idintervento WHERE in_interventi.id='.prepare($movimento['idintervento']));
} elseif (!empty($movimento['idddt'])) {
$documento = $dbo->fetchOne("SELECT data FROM dt_ddt WHERE id=".prepare($movimento['idddt']));
$documento = $dbo->fetchOne('SELECT data FROM dt_ddt WHERE id='.prepare($movimento['idddt']));
} elseif (!empty($movimento['iddocumento'])) {
$documento = $dbo->fetchOne("SELECT data FROM co_documenti WHERE id=".prepare($movimento['iddocumento']));
$documento = $dbo->fetchOne('SELECT data FROM co_documenti WHERE id='.prepare($movimento['iddocumento']));
}
if (!empty($documento['data'])) {
$dbo->update('mg_movimenti', [
'data' => $documento['data'],
], [
'id' => $movimento['id']
'id' => $movimento['id'],
]);
}
}
@ -651,7 +651,7 @@ $dbo->query("UPDATE mg_movimenti SET data = created_at WHERE data = '0000-00-00'
// File e cartelle deprecate
$files = [
'docs',
'couscous.yml'
'couscous.yml',
];
foreach ($files as $key => $value) {