Skip to content

Commit

Permalink
[GT-183] Apply code styles for the files in (GOCDB#461)
Browse files Browse the repository at this point in the history
  • Loading branch information
Sae126V committed Sep 20, 2023
1 parent 7bc3b3f commit 226a495
Show file tree
Hide file tree
Showing 10 changed files with 1,002 additions and 696 deletions.
326 changes: 159 additions & 167 deletions config/web_portal/menu.xml
Original file line number Diff line number Diff line change
@@ -1,171 +1,163 @@
<?xml version="1.0" encoding="UTF-8"?>
<menus>
<main_menu>
<spacer>
<show_on_instance>all</show_on_instance>
<spacer>Browse</spacer>
</spacer>

<MySites>
<show_on_instance>all</show_on_instance>
<name>My Resources</name>
<link>index.php?Page_Type=My_Sites</link>
</MySites>

<Projects>
<show_on_instance>all</show_on_instance>
<name>Projects</name>
<link>index.php?Page_Type=Projects</link>
</Projects>

<NGI> <!-- was 'roc' -->
<show_on_instance>all</show_on_instance>
<name>NGIs</name>
<link>index.php?Page_Type=NGIs</link>
</NGI>

<Sites>
<show_on_instance>all</show_on_instance>
<name>Sites</name>
<link>index.php?Page_Type=Sites</link>
</Sites>

<ServiceGroups>
<show_on_instance>all</show_on_instance>
<name>Service Groups</name>
<link>index.php?Page_Type=Service_Groups</link>
</ServiceGroups>

<Services>
<show_on_instance>all</show_on_instance>
<name>Services</name>
<link>index.php?Page_Type=Services</link>
</Services>

<ServiceTypes>
<show_on_instance>all</show_on_instance>
<name>Service Types</name>
<link>index.php?Page_Type=Service_Types</link>
</ServiceTypes>

<Scopes>
<show_on_instance>all</show_on_instance>
<name>Scopes</name>
<link>index.php?Page_Type=Scopes</link>
</Scopes>

<RoleActionMappings>
<show_on_instance>all</show_on_instance>
<name>Role Action Map</name>
<link>index.php?Page_Type=View_Role_Action_Mappings</link>
</RoleActionMappings>

<spacer>
<spacer>Add</spacer>
<show_on_instance>write_enabled</show_on_instance>
</spacer>

<AddSite>
<show_on_instance>write_enabled</show_on_instance>
<name>Add Site</name>
<link>index.php?Page_Type=Add_Site</link>
</AddSite>

<AddServiceGroup>
<show_on_instance>write_enabled</show_on_instance>
<name>Add Service Group</name>
<link>index.php?Page_Type=Add_Service_Group</link>
</AddServiceGroup>

<AddService>
<show_on_instance>write_enabled</show_on_instance>
<name>Add Service</name>
<link>index.php?Page_Type=Add_Service</link>
</AddService>

<AddDowntime>
<show_on_instance>write_enabled</show_on_instance>
<name>Add Downtime</name>
<link>index.php?Page_Type=Add_Downtime</link>
</AddDowntime>

<spacer>
<spacer>Downtimes</spacer>
<show_on_instance>all</show_on_instance>
</spacer>


<!--<current_downtimes>
<show_on_instance>all</show_on_instance>
<name>Recent &amp; Planned</name>
<link>http://operations-portal.in2p3.fr/index.php/dashboard/do</link>
</current_downtimes>-->

<CurrentDowntimes>
<show_on_instance>all</show_on_instance>
<name>Active &amp; Imminent</name>
<link>index.php?Page_Type=Downtimes_Overview</link>
</CurrentDowntimes>

<Calendar>
<show_on_instance>all</show_on_instance>
<name>Downtime Calendar</name>
<link>index.php?Page_Type=Downtimes_Calendar</link>
</Calendar>

<spacer>
<spacer>About GOCDB5</spacer>
<show_on_instance>all</show_on_instance>
</spacer>



<HelpAndContact>
<show_on_instance>all</show_on_instance>
<name>Doc, Help &amp; Support</name>
<link>index.php?Page_Type=Static_HTML&amp;Page=Help_And_Contact</link>
</HelpAndContact>

<spacer>
<spacer>GOCDB Admin</spacer>
<show_on_instance>admin</show_on_instance>
</spacer>

<AddNGI>
<show_on_instance>admin</show_on_instance>
<name>Add NGI</name>
<link>index.php?Page_Type=Admin_Add_NGI</link>
</AddNGI>

<AddProject>
<show_on_instance>admin</show_on_instance>
<name>Add Project</name>
<link>index.php?Page_Type=Admin_Add_Project</link>
</AddProject>

<AddServiceTypes>
<show_on_instance>admin</show_on_instance>
<name>Add Service Type</name>
<link>index.php?Page_Type=Admin_Add_Service_Type</link>
</AddServiceTypes>

<MoveServiceEndPoint>
<show_on_instance>admin</show_on_instance>
<name>Move Service</name>
<link>index.php?Page_Type=Admin_Move_SEP</link>
</MoveServiceEndPoint>

<MoveSite>
<show_on_instance>admin</show_on_instance>
<name>Move Site</name>
<link>index.php?Page_Type=Admin_Move_Site</link>
</MoveSite>

<Users>
<show_on_instance>admin</show_on_instance>
<name>Users</name>
<link>index.php?Page_Type=Admin_Users</link>
</Users>

<main_menu>
<spacer>
<show_on_instance>all</show_on_instance>
<spacer>Browse</spacer>
</spacer>

<MySites>
<show_on_instance>all</show_on_instance>
<name>My Resources</name>
<link>index.php?Page_Type=My_Sites</link>
</MySites>

<Projects>
<show_on_instance>all</show_on_instance>
<name>Projects</name>
<link>index.php?Page_Type=Projects</link>
</Projects>

<NGI> <!-- was 'roc' -->
<show_on_instance>all</show_on_instance>
<name>NGIs</name>
<link>index.php?Page_Type=NGIs</link>
</NGI>

<Sites>
<show_on_instance>all</show_on_instance>
<name>Sites</name>
<link>index.php?Page_Type=Sites</link>
</Sites>

<ServiceGroups>
<show_on_instance>all</show_on_instance>
<name>Service Groups</name>
<link>index.php?Page_Type=Service_Groups</link>
</ServiceGroups>

<Services>
<show_on_instance>all</show_on_instance>
<name>Services</name>
<link>index.php?Page_Type=Services</link>
</Services>

<ServiceTypes>
<show_on_instance>all</show_on_instance>
<name>Service Types</name>
<link>index.php?Page_Type=Service_Types</link>
</ServiceTypes>

<Scopes>
<show_on_instance>all</show_on_instance>
<name>Scopes</name>
<link>index.php?Page_Type=Scopes</link>
</Scopes>

<RoleActionMappings>
<show_on_instance>all</show_on_instance>
<name>Role Action Map</name>
<link>index.php?Page_Type=View_Role_Action_Mappings</link>
</RoleActionMappings>

<spacer>
<spacer>Add</spacer>
<show_on_instance>write_enabled</show_on_instance>
</spacer>

<AddSite>
<show_on_instance>write_enabled</show_on_instance>
<name>Add Site</name>
<link>index.php?Page_Type=Add_Site</link>
</AddSite>

<AddServiceGroup>
<show_on_instance>write_enabled</show_on_instance>
<name>Add Service Group</name>
<link>index.php?Page_Type=Add_Service_Group</link>
</AddServiceGroup>

<AddService>
<show_on_instance>write_enabled</show_on_instance>
<name>Add Service</name>
<link>index.php?Page_Type=Add_Service</link>
</AddService>

<AddDowntime>
<show_on_instance>write_enabled</show_on_instance>
<name>Add Downtime</name>
<link>index.php?Page_Type=Add_Downtime</link>
</AddDowntime>

<spacer>
<spacer>Downtimes</spacer>
<show_on_instance>all</show_on_instance>
</spacer>

<CurrentDowntimes>
<show_on_instance>all</show_on_instance>
<name>Active &amp; Imminent</name>
<link>index.php?Page_Type=Downtimes_Overview</link>
</CurrentDowntimes>

<Calendar>
<show_on_instance>all</show_on_instance>
<name>Downtime Calendar</name>
<link>index.php?Page_Type=Downtimes_Calendar</link>
</Calendar>

<spacer>
<spacer>About GOCDB5</spacer>
<show_on_instance>all</show_on_instance>
</spacer>

<HelpAndContact>
<show_on_instance>all</show_on_instance>
<name>Doc, Help &amp; Support</name>
<link>
index.php?Page_Type=Static_HTML&amp;Page=Help_And_Contact
</link>
</HelpAndContact>

<spacer>
<spacer>GOCDB Admin</spacer>
<show_on_instance>admin</show_on_instance>
</spacer>

<AddNGI>
<show_on_instance>admin</show_on_instance>
<name>Add NGI</name>
<link>index.php?Page_Type=Admin_Add_NGI</link>
</AddNGI>

<AddProject>
<show_on_instance>admin</show_on_instance>
<name>Add Project</name>
<link>index.php?Page_Type=Admin_Add_Project</link>
</AddProject>

<AddServiceTypes>
<show_on_instance>admin</show_on_instance>
<name>Add Service Type</name>
<link>index.php?Page_Type=Admin_Add_Service_Type</link>
</AddServiceTypes>

<MoveServiceEndPoint>
<show_on_instance>admin</show_on_instance>
<name>Move Service</name>
<link>index.php?Page_Type=Admin_Move_SEP</link>
</MoveServiceEndPoint>

<MoveSite>
<show_on_instance>admin</show_on_instance>
<name>Move Site</name>
<link>index.php?Page_Type=Admin_Move_Site</link>
</MoveSite>

<Users>
<show_on_instance>admin</show_on_instance>
<name>Users</name>
<link>index.php?Page_Type=Admin_Users</link>
</Users>
</main_menu>
</menus>
12 changes: 8 additions & 4 deletions htdocs/web_portal/controllers/service_type/view_service_type.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
*======================================================
* File: view_service_type.php
* Author: George Ryall, David Meredith
* Description: Controller for displaying a service type and associated services
* Description: Controller for displaying a service type
* and associated services
*
* License information
*
Expand All @@ -20,12 +21,14 @@
* limitations under the License.
/*======================================================*/
require_once __DIR__ . '/../utils.php';
require_once __DIR__ . '/../../../web_portal/components/Get_User_Principle.php';
require_once __DIR__
. '/../../../web_portal/components/Get_User_Principle.php';

use Exception;

function view_service_type()
{
$params = [];

$identifier = Get_User_Principle();
$user = \Factory::getUserService()->getUserByPrinciple($identifier);

Expand All @@ -45,7 +48,8 @@ function view_service_type()
$params['Name'] = $serviceType->getName();
$params['Description'] = $serviceType->getDescription();
$params['ID'] = $serviceType->getId();
$params['AllowMonitoringException'] = $serviceType->getAllowMonitoringException();
$params['AllowMonitoringException'] = $serviceType
->getAllowMonitoringException();
$params['Services'] = $serv->getServices($params['ID']);

show_view("service_type/view_service_type.php", $params, $params['Name']);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/*______________________________________________________
*======================================================
* File: view_service_types.php
Expand All @@ -20,12 +21,15 @@
*
/*====================================================== */
require_once __DIR__ . '/../utils.php';
require_once __DIR__ . '/../../../web_portal/components/Get_User_Principle.php';
require_once __DIR__
. '/../../../web_portal/components/Get_User_Principle.php';

function show_all(){
function show_all()
{
$params = [];

$serviceTypes = \Factory::getServiceTypeService()->getServiceTypes();
$params['ServiceTypes']= $serviceTypes;
$params['ServiceTypes'] = $serviceTypes;

show_view('service_type/view_service_types.php', $params, 'Service Types');
}
Loading

0 comments on commit 226a495

Please sign in to comment.