Go to the documentation of this file.00001 <?php
00002
00003
00004 ?><?php
00005
00006 function display_security_fieldset($p_legend,$p_array,$sec_User) {
00007 $array=array(array('value'=>0,'label'=>_("Pas d'accès")),
00008 array('value'=>1,'label'=>_('Accès')),
00009 );
00010
00011 $gDossier=dossier::id();
00012 ?>
00013 <fieldset><legend><?php echo $p_legend;?></legend>
00014 <TABLE >
00015
00016 <?php
00017 foreach ( $p_array as $l_line){
00018 ?>
00019 <tr>
00020 <td align="right">
00021 <?php echo $l_line['ac_description'];?>
00022 </td>
00023
00024 <?php
00025 $right=$sec_User->check_action($l_line['ac_id']);
00026
00027 $a=new ISelect();
00028 $a->name=sprintf('action%d',$l_line['ac_id']);
00029 $a->value=$array;
00030 $a->selected=$right;
00031 if ( $right==1) {
00032 ?>
00033 <td style="border:lightgreen 2px solid; ">
00034 <?php } else { ?>
00035 <td style="border:red 2px solid; " align="right">
00036 <?php }?>
00037
00038 <?php echo $a->input(); ?>
00039 </td>
00040 </tr>
00041 <?php
00042 }
00043
00044 ?>
00045 </table>
00046 </fieldset>
00047 <?php
00048
00049 }
00050
00051 ?>
00052 <?php $array=$cn->get_array("select ac_id, ac_description from action where ac_id >=$1 and ac_id <=$2 order by ac_id ",
00053 array(800,1000));
00054 display_security_fieldset(_('Fiche'),$array,$sec_User); ?>
00055 <?php $array=$cn->get_array("select ac_id, ac_description from action where ac_id >=$1 and ac_id <=$2 order by ac_id ",
00056 array(1001,1100));
00057 display_security_fieldset(_('Suivi'),$array,$sec_User); ?>