1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/noalyss_ynh.git synced 2024-09-03 19:46:20 +02:00
noalyss_ynh/sources/include/template/security_list_action.php
dudjima 3a905a4a87 Update sources 7.01
Update files from sources with last update on noalyss.eu
2018-04-13 18:58:28 +02:00

74 lines
No EOL
2.1 KiB
PHP

<?php
//This file is part of NOALYSS and is under GPL
//see licence.txt
?>
<div id="security_action_tbl">
<?php
function display_security_fieldset($p_legend,$p_array,$sec_User) {
$gDossier=dossier::id();
?>
<fieldset><legend><?php echo $p_legend;?></legend>
<TABLE >
<?php
foreach ( $p_array as $l_line){
?>
<tr>
<td align="right">
<?php echo $l_line['ac_description'];?>
</td>
<?php
$right=$sec_User->check_action($l_line['ac_id']);
$is_switch=new Inplace_Switch(sprintf('action%d',$l_line['ac_id']),$right);
$is_switch->set_callback("ajax_misc.php");
$is_switch->add_json_param("op", "action_access");
$is_switch->add_json_param("gDossier",$gDossier);
$is_switch->add_json_param("ac_id",$l_line['ac_id']);
$is_switch->add_json_param("user_id",$sec_User->id);
?>
<td >
<?php echo $is_switch->input(); ?>
</td>
</tr>
<?php
} // end loop
?>
</table>
</fieldset>
<?php
}// end function
?>
<?php
// Security Card
$array=$cn->get_array("select ac_id, ac_description from action where ac_id >=$1 and ac_id <=$2 order by ac_id ",
array(800,1000));
display_security_fieldset(_('Fiche'),$array,$sec_User); ?>
<?php
// Security follow-up
$array=$cn->get_array("select ac_id, ac_description from action where ac_id >=$1 and ac_id <=$2 order by ac_id ",
array(1001,1100));
display_security_fieldset(_('Suivi'),$array,$sec_User); ?>
<?php
// Security Accountancy
$array=$cn->get_array("select ac_id, ac_description from action where ac_id >=$1 and ac_id <=$2 order by ac_id ",
array(1101,1200));
display_security_fieldset(_('Comptabilité'),$array,$sec_User); ?>
<?php
// Note Sharing
$array=$cn->get_array("select ac_id, ac_description from action where ac_id >=$1 and ac_id <=$2 order by ac_id ",
array(1200,1300));
display_security_fieldset(_('Note'),$array,$sec_User);
?>
</div>