2019-07-18 18:33:56 +02:00
< ? php
2020-09-07 15:04:06 +02:00
/*
* OpenSTAManager : il software gestionale open source per l ' assistenza tecnica e la fatturazione
2021-01-20 15:08:51 +01:00
* Copyright ( C ) DevCode s . r . l .
2020-09-07 15:04:06 +02:00
*
* This program is free software : you can redistribute it and / or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation , either version 3 of the License , or
* ( at your option ) any later version .
*
* This program is distributed in the hope that it will be useful ,
* but WITHOUT ANY WARRANTY ; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the
* GNU General Public License for more details .
*
* You should have received a copy of the GNU General Public License
* along with this program . If not , see < https :// www . gnu . org / licenses />.
*/
2019-07-18 18:33:56 +02:00
include_once __DIR__ . '/../../core.php' ;
2024-03-12 16:39:34 +01:00
use Models\Group ;
2024-03-22 15:52:24 +01:00
use Models\Module ;
2019-07-18 18:33:56 +02:00
2020-02-05 14:51:39 +01:00
if ( ! empty ( filter ( 'idanagrafica' ))) {
2023-08-04 14:54:28 +02:00
$utente [ 'id_anagrafica' ] = filter ( 'idanagrafica' );
} else {
2024-03-12 16:39:34 +01:00
$current_idgruppo = Group :: find ( $id_record ) -> id ;
2020-02-05 14:51:39 +01:00
}
2020-01-20 20:06:53 +01:00
2023-03-07 19:15:02 +01:00
echo '
< div class = " row " >
< div class = " col-md-12 " >
2024-06-11 16:58:27 +02:00
{[ " type " : " select " , " label " : " '.tr('Gruppo di appartenenza').' " , " name " : " idgruppo " , " required " : 1 , " ajax-source " : " gruppi " , " value " : " '.(!empty( $utente['idgruppo'] ) ? $utente['idgruppo'] : $current_idgruppo ).' " , " icon-after " : " add|'.Module::where('name', 'Utenti e permessi')->first()->id.' " , " readonly " : " '.(( $utente['id'] == '1') ? 1 : 0).' " ]}
2023-03-07 19:15:02 +01:00
</ div >
</ div > ' ;
2019-07-18 18:33:56 +02:00
echo '
< div class = " row " >
< div class = " col-md-12 " >
2022-11-24 12:47:34 +01:00
{[ " type " : " text " , " label " : " '.tr('Username').' " , " name " : " username " , " required " : 1 , " value " : " '. $utente['username'] .' " , " validation " : " username|'. $id_module .'|'.( $utente['id'] ?: 0).' " ]}
2019-07-18 18:33:56 +02:00
</ div >
</ div > ' ;
echo '
< div class = " row " >
< div class = " col-md-12 " >
2024-02-25 16:08:22 +01:00
{[ " type " : " email " , " label " : " '.tr('Email').' " , " name " : " email " , " required " : 0 , " value " : " '. $utente['email'] .' " , " validation " : " email " ]}
2019-07-18 18:33:56 +02:00
</ div >
</ div > ' ;
2024-01-15 15:30:45 +01:00
echo '
2019-07-18 18:33:56 +02:00
< div class = " row " >
< div class = " col-md-12 " >
2024-06-11 16:58:27 +02:00
{[ " type " : " select " , " label " : " '.tr('Collega ad una anagrafica').' " , " name " : " idanag " , " required " : 1 , " ajax-source " : " anagrafiche_utenti " , " value " : " '. $utente['id_anagrafica'] .' " , " icon-after " : " add|'.Module::where('name', 'Anagrafiche')->first()->id.(isset( $gruppo ) ? '|tipoanagrafica='. $gruppo : '').' " ]}
2019-07-18 18:33:56 +02:00
</ div >
</ div >
2020-07-31 14:25:50 +02:00
2019-07-18 18:33:56 +02:00
< div class = " row " >
< div class = " col-md-12 " >
2024-07-31 10:05:09 +02:00
{[ " type " : " select " , " label " : " '.tr('Sede').' " , " name " : " idsede[] " , " ajax-source " : " sedi_azienda " , " multiple " : " 1 " , " value " : " '. $sedi .' " , " help " : " '.tr('Sede Azienda abilitata per la movimentazione degli articoli. L \ 'impostazione non viene considerata per gli utenti del gruppo \ 'Amministratori \ '.').' " ]}
2019-07-18 18:33:56 +02:00
</ div >
</ div > ' ;
echo '
< script type = " text/javascript " >
2020-07-31 14:25:50 +02:00
$ ( document ) . ready ( function () {
$ ( " #idanag " ) . change ( function () {
2019-07-18 18:33:56 +02:00
session_set ( " superselect,idanagrafica " , $ ( this ) . val (), 0 );
2020-07-31 14:25:50 +02:00
2019-07-18 18:33:56 +02:00
$ ( " #idsede " ) . selectReset ();
})
});
</ script > ' ;