Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[GT-183] Apply code styles for the files #461 #483

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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>
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';
Comment on lines +24 to +25
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to use parentheses around __DIR__ . '/../../../web_portal/components/Get_User_Principle.php' to make it clear this is the same argument to require_once.

(Note, I am not a PHP expert! I don't know if that is a good idea or not!)


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