1
0
mirror of https://github.com/devcode-it/openstamanager.git synced 2025-02-16 19:40:44 +01:00
This commit is contained in:
MatteoPistorello 2023-01-13 12:03:48 +01:00
commit ba71a957b7
8 changed files with 50 additions and 8 deletions

View File

@ -376,6 +376,10 @@ switch ($resource) {
$where[] = 'idanagrafica='.prepare($superselect['idanagrafica']);
}
if (isset($superselect['idsede_destinazione'])) {
$where[] = 'idsede='.prepare($superselect['idsede_destinazione']);
}
if (!empty($search)) {
$search_fields[] = 'an_referenti.nome LIKE '.prepare('%'.$search.'%');
}

View File

@ -79,7 +79,7 @@ if (strtotime($record['data_conclusione']) < strtotime($record['data_accettazion
<div class="col-md-3">
'.Plugins::link('Referenti', $record['idanagrafica'], null, null, 'class="pull-right"').'
{[ "type": "select", "label": "'.tr('Referente').'", "name": "idreferente", "value": "$idreferente$", "ajax-source": "referenti", "select-options": {"idanagrafica": '.$record['idanagrafica'].'} ]}
{[ "type": "select", "label": "'.tr('Referente').'", "name": "idreferente", "value": "$idreferente$", "ajax-source": "referenti", "select-options": {"idanagrafica": '.$record['idanagrafica'].',"idsede_destinazione": '.$record['idsede'].'} ]}
</div>
<div class="col-md-3">';
@ -530,5 +530,10 @@ $(document).ready(function() {
data_accettazione.data("DateTimePicker").date(e.date);
}
});
$("#idsede").change(function(){
updateSelectOption("idsede_destinazione", $(this).val());
$("#idreferente").selectReset();
});
});
</script>';

View File

@ -147,7 +147,7 @@ echo '
echo Plugins::link('Referenti', $record['idanagrafica'], null, null, 'class="pull-right"');
}
echo '
{[ "type": "select", "label": "'.tr('Referente').'", "name": "idreferente", "value": "$idreferente$", "ajax-source": "referenti", "select-options": {"idanagrafica": '.$record['idanagrafica'].'} ]}
{[ "type": "select", "label": "'.tr('Referente').'", "name": "idreferente", "value": "$idreferente$", "ajax-source": "referenti", "select-options": {"idanagrafica": '.$record['idanagrafica'].', "idsede_destinazione": '.$record['idsede_destinazione'].'} ]}
</div>';
// Conteggio numero articoli ddt in uscita
@ -574,3 +574,13 @@ if (in_array($record[$field_name], $user->sedi)) {
</a>
<?php
}
echo '
<script>
$("#idsede_destinazione").change(function(){
updateSelectOption("idsede_destinazione", $(this).val());
$("#idreferente").selectReset();
});
</script>';

View File

@ -362,7 +362,7 @@ echo '
echo Plugins::link('Referenti', $record['idanagrafica'], null, null, 'class="pull-right"');
}
echo '
{[ "type": "select", "label": "'.tr('Referente').'", "name": "idreferente", "value": "$idreferente$", "ajax-source": "referenti", "select-options": {"idanagrafica": '.$record['idanagrafica'].'}, "icon-after": "add|'.Modules::get('Anagrafiche')['id'].'|id_plugin='.Plugins::get('Referenti')['id'].'&id_parent='.$record['idanagrafica'].'||'.(intval($block_edit) ? 'disabled' : '').'" ]}
{[ "type": "select", "label": "'.tr('Referente').'", "name": "idreferente", "value": "$idreferente$", "ajax-source": "referenti", "select-options": {"idanagrafica": '.$record['idanagrafica'].', "idsede_destinazione": '.$record['idsede_destinazione'].'}, "icon-after": "add|'.Modules::get('Anagrafiche')['id'].'|id_plugin='.Plugins::get('Referenti')['id'].'&id_parent='.$record['idanagrafica'].'||'.(intval($block_edit) ? 'disabled' : '').'" ]}
</div>';
echo '
@ -1069,6 +1069,11 @@ $(document).ready(function () {
data_competenza.data("DateTimePicker").date(e.date);
}
});
$("#idsede_destinazione").change(function(){
updateSelectOption("idsede_destinazione", $(this).val());
$("#idreferente").selectReset();
});
});
function cambiaStato() {

View File

@ -76,7 +76,7 @@ echo '
</div>
<div class="col-md-6">
{[ "type": "select", "label": "'.tr('Referente').'", "name": "idreferente", "value": "$idreferente$", "ajax-source": "referenti", "select-options": '.json_encode(['idanagrafica' => $record['idanagrafica'], 'idclientefinale' => $record['idclientefinale']]).', "readonly": "'.intval($record['flag_completato']).'" ]}
{[ "type": "select", "label": "'.tr('Referente').'", "name": "idreferente", "value": "$idreferente$", "ajax-source": "referenti", "select-options": '.json_encode(['idanagrafica' => $record['idanagrafica'], 'idclientefinale' => $record['idclientefinale'], 'idsede_destinazione' => $record['idsede_destinazione']]).', "readonly": "'.intval($record['flag_completato']).'" ]}
</div>
</div>
@ -690,7 +690,8 @@ $(document).ready(function() {
updateSelectOption("idsede_destinazione", $(this).val());
session_set("superselect,idsede_destinazione", $(this).val(), 0);
input("idimpianti").getElement().selectReset();
input("idreferente").getElement().selectReset();
let data = sede.getData();
if (data) {
input("idzona").set(data.idzona ? data.idzona : "");

View File

@ -111,7 +111,7 @@ echo '
echo Plugins::link('Referenti', $record['idanagrafica'], null, null, 'class="pull-right"');
}
echo '
{[ "type": "select", "label": "'.tr('Referente').'", "name": "idreferente", "value": "$idreferente$", "ajax-source": "referenti", "select-options": {"idanagrafica": '.$record['idanagrafica'].'} ]}
{[ "type": "select", "label": "'.tr('Referente').'", "name": "idreferente", "value": "$idreferente$", "ajax-source": "referenti", "select-options": {"idanagrafica": '.$record['idanagrafica'].', "idsede_destinazione": '.$record['idsede'].'} ]}
</div>
<div class="col-md-3">
@ -333,6 +333,11 @@ $(document).ready(function() {
caricaRighe();
});
$("#idsede").change(function(){
updateSelectOption("idsede_destinazione", $(this).val());
$("#idreferente").selectReset();
});
$("#idanagrafica").change(function() {
updateSelectOption("idanagrafica", $(this).val());
session_set("superselect,idanagrafica", $(this).val(), 0);

View File

@ -86,7 +86,7 @@ echo '
echo Plugins::link('Referenti', $record['idanagrafica'], null, null, 'class="pull-right"');
}
echo '
{[ "type": "select", "label": "'.tr('Referente').'", "name": "idreferente", "value": "$idreferente$", "ajax-source": "referenti", "select-options": {"idanagrafica": '.$record['idanagrafica'].'} ]}
{[ "type": "select", "label": "'.tr('Referente').'", "name": "idreferente", "value": "$idreferente$", "ajax-source": "referenti", "select-options": {"idanagrafica": '.$record['idanagrafica'].',"idsede_destinazione": '.$record['idsede'].'} ]}
</div>
<div class="col-md-3">';
@ -437,3 +437,12 @@ if (!empty($elementi)) {
<a class="btn btn-danger ask" data-backto="record-list">
<i class="fa fa-trash"></i> <?php echo tr('Elimina'); ?>
</a>
<script>
$("#idsede").change(function(){
updateSelectOption("idsede_destinazione", $(this).val());
$("#idreferente").selectReset();
});
</script>

View File

@ -87,4 +87,7 @@ ORDER BY
INSERT INTO `zz_settings` (`id`, `nome`, `valore`, `tipo`, `editable`, `sezione`, `order`, `help`) VALUES (NULL, 'Visualizza promemoria', '1', 'boolean', '1', 'Applicazione', '5', '');
-- Aggiunta del riferimento utente nei movimenti
ALTER TABLE `mg_movimenti` ADD `idutente` INT NULL DEFAULT NULL;
ALTER TABLE `mg_movimenti` ADD `idutente` INT NULL DEFAULT NULL;
-- Aggiunta valori buffer Datatables
UPDATE `zz_settings` SET `tipo` = 'list[5,10,15,20,25,30,35,40,45,50,55,60,65,70,75,80,85,90,95,100,250,500,1000]' WHERE `zz_settings`.`nome` = 'Lunghezza in pagine del buffer Datatables';