2026-10-20 06:45:30 -04:00
$ ( function (){
const id = $ ( '#summary_user_serial' ). val (), application = $ ( '#APPLICATION_MNEMONIC' ). val ();
function summaryReturn ( action , extra = {}){
const state = { action : action , user_serial : id , userSummary : 'Users.setupUsers' , addNote : 'Users.userSummary' , editNote : 'Users.userSummary' , deleteNote : 'Users.userSummary' , editUser : 'Users.userSummary' , deleteUser : 'Users.setupUsers' ,... extra };
sessionStorage . setItem ( application , JSON . stringify ( state )); formSubmit ( state );
}
$ ( '.summary-edit' ). on ( 'click' ,()=> summaryReturn ( 'Users.editUser' ));
$ ( '.summary-back' ). on ( 'click' ,()=> formSubmit ({ action : 'Users.setupUsers' }));
$ ( '.summary-add-note' ). on ( 'click' ,()=> summaryReturn ( 'Notes.addNote' ,{ note_type : 'User' , note_reference : id }));
$ ( '.summary-edit-note' ). on ( 'click' , function (){ summaryReturn ( 'Notes.editNote' ,{ note_serial : $ ( this ). data ( 'note' )});});
$ ( '.summary-invite' ). on ( 'click' , async function (){
const button = $ ( this ); button . prop ( 'disabled' , true );
try { const result = await formPost ({ action : 'Users.resetPassword' , user_serial : id }); showRequestMessage ( result . message || 'Password setup link sent.' );} catch ( error ){} finally { button . prop ( 'disabled' , false );}
});
});