Aggiunto blocco fatture Emesse

This commit is contained in:
Thomas Zilio 2018-07-09 16:12:27 +02:00
parent c9c69cc2d5
commit 6c0cd2a8cf
3 changed files with 19 additions and 13 deletions

View File

@ -239,17 +239,23 @@ echo '
<script>';
// Se l'utente ha i permessi in sola lettura per il modulo, converto tutti i campi di testo in span
if (Modules::getPermission($id_module) == 'r' || !empty($block_edit)) {
$not = (Modules::getPermission($id_module) == 'r') ? '' : '.not(".unblockable")';
$read_only = Modules::getPermission($id_module) == 'r';
if ($read_only || !empty($block_edit)) {
$not = $read_only ? '' : '.not(".unblockable")';
echo '
$(document).ready(function(){
$("input, textarea, select", "section.content")'.$not.'.attr("readonly", "true");
$("select, input[type=checkbox]")'.$not.'.prop("disabled", true);
$("a.btn, button, input[type=button], input[type=submit]", "section.content")'.$not.'.hide();
$("a.btn-info, a.btn-warning, button.btn-info, button.btn-warning, input[type=button].btn-info", "section.content")'.$not.'.show();
});';
$("select, input[type=checkbox]", "section.content")'.$not.'.prop("disabled", true);';
if ($read_only) {
echo '
$("a.btn, button, input[type=button], input[type=submit]", "section.content").hide();
$("a.btn-info, a.btn-warning, button.btn-info, button.btn-warning, input[type=button].btn-info", "section.content").show();';
}
echo '
});';
}
?>
@ -298,7 +304,7 @@ if ($advanced_sessions) {
setInterval(getActiveUsers, <?php echo get_var('Timeout notifica di presenza (minuti)') * 1000; ?>);
<?php
}
}
?>
</script>
<?php

View File

@ -2,7 +2,7 @@
include_once __DIR__.'/../../core.php';
$block_edit = !empty($note_accredito);
$block_edit = !empty($note_accredito) || $records[0]['stato'] == 'Emessa';
$rs = $dbo->fetchArray('SELECT co_tipidocumento.descrizione, dir FROM co_tipidocumento INNER JOIN co_documenti ON co_tipidocumento.id=co_documenti.idtipodocumento WHERE co_documenti.id='.prepare($id_record));
$dir = $rs[0]['dir'];
@ -84,7 +84,7 @@ if ($dir == 'entrata') {
</div>
<div class="col-md-3">
{[ "type": "select", "label": "<?php echo tr('Stato'); ?>", "name": "idstatodocumento", "required": 1, "values": "query=SELECT * FROM co_statidocumento", "value": "$idstatodocumento$", "extra": " onchange = \"if ($('#idstatodocumento option:selected').text()=='Pagato'){if( confirm('Sicuri di voler impostare manualmente la fattura come pagata senza aggiungerla in prima nota?') ){ return true; }else{ $('#idstatodocumento').selectSet(<?php echo $records[0]['idstatodocumento']; ?>); }}\" " ]}
{[ "type": "select", "label": "<?php echo tr('Stato'); ?>", "name": "idstatodocumento", "required": 1, "values": "query=SELECT * FROM co_statidocumento", "value": "$idstatodocumento$", "class": "unblockable", "extra": " onchange = \"if ($('#idstatodocumento option:selected').text()=='Pagato'){if( confirm('Sicuri di voler impostare manualmente la fattura come pagata senza aggiungerla in prima nota?') ){ return true; }else{ $('#idstatodocumento').selectSet(<?php echo $records[0]['idstatodocumento']; ?>); }}\" " ]}
</div>
</div>

View File

@ -147,15 +147,15 @@ class FileManager implements ManagerInterface
<b>'.$options['label'].'</b>
<div id="upload-form" class="row">
<div class="col-md-4">
{[ "type": "text", "placeholder": "'.tr('Nome').'", "name": "nome_allegato" ]}
{[ "type": "text", "placeholder": "'.tr('Nome').'", "name": "nome_allegato", "class": "unblockable" ]}
</div>
<div class="col-md-3">
{[ "type": "text", "placeholder": "'.tr('Categoria').'", "name": "categoria" ]}
{[ "type": "text", "placeholder": "'.tr('Categoria').'", "name": "categoria", "class": "unblockable" ]}
</div>
<div class="col-md-3">
{[ "type": "file", "placeholder": "'.tr('File').'", "name": "blob" ]}
{[ "type": "file", "placeholder": "'.tr('File').'", "name": "blob", "class": "unblockable" ]}
</div>
<div class="col-md-2 text-right">