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-124 Make references to operational tools configurable #412

Open
wants to merge 9 commits into
base: dev
Choose a base branch
from
8 changes: 8 additions & 0 deletions config/local_info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,14 @@
<email_from>no-reply@localhost</email_from>
<email_to>gocdb-admins@localhost</email_to>

<!-- Operational tool references to be configured depending on the instance. -->
<helpdesk>
<link></link>
<support_unit></support_unit>
</helpdesk>
<request_tracker></request_tracker>
<community_docs></community_docs>

<!-- Specify the URL and description of the Acceptable Use Policy -->
<aup>AUP location</aup>
<aup_title>AUP title</aup_title>
Expand Down
4 changes: 2 additions & 2 deletions config/web_portal/menu.xml
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,11 @@
</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>
<link>index.php?Page_Type=Help_And_Contact</link>
</HelpAndContact>

<spacer>
Expand Down
47 changes: 47 additions & 0 deletions htdocs/web_portal/controllers/help_and_contact.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<?php
/*______________________________________________________
*======================================================
* License information
*
* Copyright 2023 UK Research and Innovation
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
/*====================================================== */

/*
* Declares varibales to be used in /../views/help_and_contact.php
*/

function help_and_contact() {
require_once __DIR__.'/../../../lib/Gocdb_Services/Factory.php';

$params = array();

$configService = \Factory::getConfigService();

$communityDocs = $configService->getCommunityDocs();
if (!empty($communityDocs)) {
$params['communityDocs'] = $communityDocs;
}

$helpdeskLink = $configService->getHelpdeskLink();
if (!empty($helpdeskLink)) {
$params['helpdeskLink'] = $helpdeskLink;
}

$requestTracker = $configService->getRequestTracker();
if (!empty($requestTracker)) {
$params['requestTracker'] = $requestTracker;
}

$title = "Doc, Help and Support";
show_view('help_and_contact.php', $params, $title);
}
4 changes: 2 additions & 2 deletions htdocs/web_portal/controllers/service_group/search_ses.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ function search_ses() {

} catch(Exception $ex){
show_view( 'error.php', $ex->getMessage() . "<br /><br />Please contact the "
. "<a href=\"index.php?Page_Type=Static_HTML&Page=Help_And_Contact\">"
. "<a href=\"index.php?Page_Type=Help_And_Contact\">"
. "GOCDB support team</a> if you need help with this issue.");
}
$params = array('ses' => $ses);

show_view('service_group/se_search.php', $params, null, true);
}
}
8 changes: 7 additions & 1 deletion htdocs/web_portal/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,11 @@ function Draw_Page($Page_Type) {
require_once __DIR__.'/controllers/my_sites.php';
my_sites();
break;
case "Help_And_Contact";
//rejectIfNotAuthenticated();
require_once __DIR__.'/controllers/help_and_contact.php';
help_and_contact();
break;
case "Edit_NGI":
rejectIfNotAuthenticated();
require_once __DIR__.'/controllers/ngi/edit_ngi.php';
Expand Down Expand Up @@ -654,13 +659,15 @@ function Draw_Page($Page_Type) {
}
}


/* Draws a static HTML page */
function Draw_Static_HTML() {
$Page_Name = Get_Static_Page_Name();
$Page_Content = Get_Static_Page_Contents($Page_Name);
Draw_Standard_Page($Page_Content);
}


/* Finds out if a static page has been requested. If it has, return
* the page name, otherwise return a blank string. */
function Get_Static_Page_Name() {
Expand Down Expand Up @@ -711,7 +718,6 @@ function Draw_Standard_Page($Page_Content, $title=null) {
}



/* Given the name of a file in the view directory, include it
* as the body of a standard GOCDB page */
function show_view($view, $params=null, $title=null, $rawOutput=null) {
Expand Down
57 changes: 0 additions & 57 deletions htdocs/web_portal/static_html/Help_And_Contact.html

This file was deleted.

67 changes: 67 additions & 0 deletions htdocs/web_portal/views/help_and_contact.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
<html>
<div class="rightPageContainer">
<h1>Documentation, Help and Support</h1>
<br />
<div class="Help_And_Documentation">

<h2>GOCDB</h2>
<p><a href="index.php">What is GOCDB?</a></p>
<p>
See <a href="https://github.com/GOCDB/gocdb/releases">Release notes</a>
<br/>
<a href="https://github.com/GOCDB/gocdb/blob/dev/INSTALL.md">Download, Install</a>
</p>

<h2>Need information?</h2>
<p>
Please browse your
<a href="<?php echo $params['communityDocs'] ?>">
community documentation</a>.
<br/><br/>
</p>

<h2>Found a bug?</h2>
<p>
First, check our
<a href="https://github.com/GOCDB/gocdb/issues?q=is%3Aissue+is%3Aopen+label%3Abug" target="_blank">
known bugs</a> to see if this has not already been reported.<br/>
If not, please open a request in your
<a href="<?php echo $params['helpdeskLink'] ?>">
community support desk</a>
or our
<a href="https://github.com/GOCDB/gocdb/issues" target="_blank">
GitHub issues</a>
page, if the former is not appropriate.
<br/><br/>
</p>

<h2>Want to suggest something?</h2>
<p>
Before you make any request, check this is not already integrated to our development plans, see
<a href="https://github.com/GOCDB/gocdb/milestones" target="_blank">GOCDB Development Plans.</a><br/>
Any suggestion, new feature or improvement request should
be submitted to your
<a href="<?php echo $params['requestTracker'] ?>">
community request tracker</a>
or our
<a href="https://github.com/GOCDB/gocdb/issues" target="_blank">
GitHub issues</a>
page, if the former is not appropriate.<br/>
Suggestions will be discussed by the GOCDB developers and
any relevant project body before inclusion into development plans.
These bodies reserve the right to decline unsuitable requests.
<br/><br/>
</p>

<h2>Need some support?</h2>

<p>
For all other enquiries including general questions, temporary
problem reports or support requests please open a
request in your
<a href="<?php echo $params['helpdeskLink'] ?>">
community support desk</a>.
</p>
</div>
</div>
</html>
28 changes: 28 additions & 0 deletions lib/Gocdb_Services/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -556,4 +556,32 @@ public function getEmailTo()

return $emailTo;
}

public function getHelpdeskLink()
{
$link = $this->GetLocalInfoXML()->helpdesk->link;

return $link;
}

public function getHelpdeskSupportUnit()
{
$supportUnit = $this->GetLocalInfoXML()->helpdesk->support_unit;

return $supportUnit;
}

public function getRequestTracker()
{
$requestTracker = $this->GetLocalInfoXML()->request_tracker;

return $requestTracker;
}

public function getCommunityDocs()
{
$communityDocs = $this->GetLocalInfoXML()->community_docs;

return $communityDocs;
}
}