2008-08-20 Evi Vanoost <vanooste@rcbi.rochester.edu>

* godmode/profiles/profile_list.php: Update from yesterday. Fixes HTML generation.

git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1017 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
guruevi 2008-08-21 18:45:23 +00:00
parent 79f24e4daf
commit 84a0a1f22f
1 changed files with 42 additions and 84 deletions

View File

@ -200,91 +200,49 @@ if (isset ($id_perfil)){ // There are values defined, let's show form with data
} }
echo '</td></tr></table>'; echo '</td></tr></table>';
} else { // View list data } else { // View list data
echo '<table cellpadding="4" cellspacing="4" class="databox" width="750px">';
$result = get_db_all_rows_in_table ("tperfil"); $result = get_db_all_rows_in_table ("tperfil");
echo '<tr><th width="180px"><font size="1">'.__('Profiles').'</th><th width="40px">IR'; $table->cellpadding = 4;
print_help_tip (__('Read Incidents')); $table->cellspacing = 4;
echo '</th><th width="40px">IW'; $table->class = "databox";
print_help_tip (__('Create Incidents')); $table->width = 750;
echo '</th><th width="40px">IM'; $table->size = array (180,40,40,40,40,40,40,40,40,40,40);
print_help_tip (__('Manage Incidents')); $table->head = array (
echo '</th><th width="40px">AR'; __('Profiles'),
print_help_tip (__('Read Agent Information')); 'IR'.print_help_tip (__('Read Incidents'),true),
echo '</th><th width="40px">AW'; 'IW'.print_help_tip (__('Create Incidents'),true),
print_help_tip (__('Manage Agents')); 'IM'.print_help_tip (__('Manage Incidents'),true),
echo '</th><th width="40px">LW'; 'AR'.print_help_tip (__('Read Agent Information'),true),
print_help_tip (__('Edit Alerts')); 'AW'.print_help_tip (__('Manage Agents'),true),
echo '</th><th width="40px">UM'; 'LW'.print_help_tip (__('Edit Alerts'),true),
print_help_tip (__('Manage User Rights')); 'UM'.print_help_tip (__('Manage User Rights'),true),
echo '</th><th width="40px">DM'; 'DM'.print_help_tip (__('Database Management'),true),
print_help_tip (__('Database Management')); 'LM'.print_help_tip (__('Alerts Management'),true),
echo '</th><th width="40px">LM'; 'PM'.print_help_tip (__('Pandora System Management'),true),
print_help_tip (__('Alerts Management')); __('Delete')
echo '</th><th width="40px">PM'; );
print_help_tip (__('Pandora System Management')); $table->align = array ('',"center","center","center","center","center","center","center","center","center","center","center");
echo '</th><th width="40px">'.__('Delete').'</th></tr>'; foreach ($result as $row) {
$table->data[] = array (
$color = 1; '<a href="index.php?sec=gperfiles&amp;sec2=godmode/profiles/profile_list&amp;edit_profile='.$row["id_perfil"].'"><b>'.$row["name"].'</b></a>',
foreach ($result as $profile) { (($row["incident_view"] == 1) ? '<img src="images/ok.png" border="0">' : ''),
$id_perfil = $profile["id_perfil"]; (($row["incident_edit"] == 1) ? '<img src="images/ok.png" border="0">' : ''),
$nombre = $profile["name"]; (($row["incident_management"] == 1) ? '<img src="images/ok.png" border="0">' : ''),
$incident_view = $profile["incident_view"]; (($row["agent_view"] == 1) ? '<img src="images/ok.png" border="0">' : ''),
$incident_edit = $profile["incident_edit"]; (($row["agent_edit"] == 1) ? '<img src="images/ok.png" border="0">' : ''),
$incident_management = $profile["incident_management"]; (($row["alert_edit"] == 1) ? '<img src="images/ok.png" border="0">' : ''),
$agent_view = $profile["agent_view"]; (($row["user_management"] == 1) ? '<img src="images/ok.png" border="0">' : ''),
$agent_edit = $profile["agent_edit"]; (($row["db_management"] == 1) ? '<img src="images/ok.png" border="0">' : ''),
$alert_edit = $profile["alert_edit"]; (($row["alert_management"] == 1) ? '<img src="images/ok.png" border="0">' : ''),
$user_management = $profile["user_management"]; (($row["pandora_management"] == 1) ? '<img src="images/ok.png" border="0">' : ''),
$db_management = $profile["db_management"]; '<a href="index.php?sec=gagente&sec2=godmode/profiles/profile_list&delete_profile='.$row["id_perfil"].'" onClick="if (!confirm(\' '.__('Are you sure?').'\')) return false;"><img border="0" src="images/cross.png"></a>'
$alert_management = $profile["alert_management"]; );
$pandora_management = $profile["pandora_management"];
if ($color == 1) {
$tdcolor = "datos";
$color = 0;
} else {
$tdcolor = "datos2";
$color = 1;
}
echo '<tr>
<td class="'.$tdcolor.'">
<a href="index.php?sec=gperfiles&amp;sec2=godmode/profiles/profile_list&amp;edit_profile='.$id_perfil.'"><b>'.$nombre.'</b></a>
</td>
<td class="'.$tdcolor.'">
'.(($incident_view == 1) ? '<img src="images/ok.png" border="0">' : '').'
</td>
<td class="'.$tdcolor.'">
'.(($incident_edit == 1) ? '<img src="images/ok.png" border="0">' : '').'
</td>
<td class="'.$tdcolor.'">
'.(($incident_management == 1) ? '<img src="images/ok.png" border="0">' : '').'
</td><td class="'.$tdcolor.'">
'.(($agent_view == 1) ? '<img src="images/ok.png" border="0">' : '').'
</td><td class="'.$tdcolor.'">
'.(($agent_edit == 1) ? '<img src="images/ok.png" border="0">' : '').'
</td><td class="'.$tdcolor.'">
'.(($alert_edit == 1) ? '<img src="images/ok.png" border="0">' : '').'
</td><td class="'.$tdcolor.'">
'.(($user_management == 1) ? '<img src="images/ok.png" border="0">' : '').'
</td><td class="'.$tdcolor.'">
'.(($db_management == 1) ? '<img src="images/ok.png" border="0">' : '').'
<td class="'.$tdcolor.'">
'.(($alert_management == 1) ? '<img src="images/ok.png" border="0">' : '').'
</td><td class="'.$tdcolor.'">
'.(($pandora_management == 1) ? '<img src="images/ok.png" border="0">' : '').'
<td class="'.$tdcolor.'" align="center">
<a href="index.php?sec=gagente&sec2=godmode/profiles/profile_list&delete_profile='.$id_perfil.'" onClick="if (!confirm(\' '.__('Are you sure?').'\')) return false;">
<img border="0" src="images/cross.png"></a>
</td>
</tr>';
} }
echo '</table></tr></table> print_table ($table);
<table width="750"><tr><td align="right"> unset ($table);
<form method="POST" action="index.php?sec=gperfiles&sec2=godmode/profiles/profile_list&new_profile=1"> $table->width = 750;
<input type="submit" class="sub next" name="crt" value="'.__('Create profile').'"> $table->align = array ("right");
</form> $table->data[] = array ('<form method="POST" action="index.php?sec=gperfiles&sec2=godmode/profiles/profile_list&new_profile=1">'.print_submit_button(__('Create profile'),"crt",false,'class="sub next"',true).'</form>' );
</td></tr></table>'; print_table ($table);
unset ($table);
} }
?> ?>