Private GIT

Skip to content
Snippets Groups Projects
Commit 8e119f71 authored by Loic Laurent's avatar Loic Laurent
Browse files

add service description with spaces

parent 4d9da594
Branches
Tags
No related merge requests found
......@@ -187,9 +187,9 @@ function editLinkForService($dbConnector, $objName)
{
if (is_array($objName))
{
$serviceName = str_replace(' ', '_', $objName[count($objName) - 1]);
unset($objName[count($objName) - 1]);
$hostName = substr(implode('_', $objName), 8);
$temphostName = explode(':', array_shift($objName));
$hostName = $temphostName[1];
$serviceName = join(' ', $objName);
$querySelect = "SELECT service_id "
."FROM service, host, host_service_relation "
."WHERE service.service_description = '$serviceName' "
......
<?php
use Centreon\Test\Behat\CentreonContext;
use Centreon\Test\Behat\ConfigurationPollersPage;
use Centreon\Test\Behat\HostConfigurationPage;
......@@ -22,7 +20,6 @@ class CentreonWithKnowledgeContext extends CentreonContext
$this->hostName = 'MediawikiHost';
$this->serviceHostName = 'Centreon-Server';
$this->serviceName = 'MediawikiService';
}
/**
......@@ -39,7 +36,6 @@ class CentreonWithKnowledgeContext extends CentreonContext
}
/**
* @Given a host configured
*/
......@@ -142,7 +138,7 @@ class CentreonWithKnowledgeContext extends CentreonContext
/* Add wiki page */
$checkurl = 'Service:'.$this->serviceHostName.'_'.$this->serviceName;
if( !strstr($this->getSession()->getCurrentUrl(), $checkurl)) {
if( !strstr(urldecode($this->getSession()->getCurrentUrl()), $checkurl)) {
throw new Exception(' Mauvaise url');
}
......
......@@ -205,14 +205,15 @@ $templateHostArray = array();
foreach ($serviceList as $key => $value) {
$tplStr = "";
$tplArr = $proc->getMyServiceTemplateModels($value['id']);
if ($proc->serviceHasProcedure($key, $tplArr) == true) {
$key_nospace = str_replace(" ", "_", $key);
if ($proc->serviceHasProcedure($key_nospace, $tplArr) == true) {
$diff[$key] = 1;
} else {
$diff[$key] = 0;
}
if (isset($_REQUEST['searchTemplatesWithNoProcedure'])) {
if ($diff[$key] == 1 || $proc->serviceHasProcedure($key, $tplArr, PROCEDURE_INHERITANCE_MODE) == true) {
if ($diff[$key] == 1 || $proc->serviceHasProcedure($key_nospace, $tplArr, PROCEDURE_INHERITANCE_MODE) == true) {
$rows--;
unset($diff[$key]);
unset($serviceList[$key]);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment