N°5908 - add a description on "known error" tab on UserRequest and Incident

This commit is contained in:
vdumas
2023-02-08 19:00:57 +01:00
parent d358c9e8fa
commit ce162f05da
5 changed files with 25 additions and 29 deletions

View File

@@ -1209,24 +1209,22 @@
parent::DisplayBareRelations($oPage, $bEditMode);
$sKnownErrorClass = 'KnownError';
$sTabCode = 'Class:UserRequest:KnownErrorList';
if (MetaModel::IsValidClass($sKnownErrorClass)) {
//Search for known errors
$oPage->SetCurrentTab('Class:UserRequest:KnownErrorList');
$iTicketID = $this->GetKey();;
$oKnownErrorSet = new CMDBObjectSet(DBObjectSearch::FromOQL("SELECT KnownError AS ke JOIN lnkErrorToFunctionalCI AS l1 ON l1.error_id=ke.id JOIN FunctionalCI AS ci ON l1.functionalci_id=ci.id JOIN lnkFunctionalCIToTicket AS l2 ON l2.functionalci_id=ci.id WHERE l2.ticket_id=$iTicketID"));
$iNumberKE=$oKnownErrorSet->count();
if ($iNumberKE > 0)
{
$oPage->SetCurrentTab('Class:UserRequest:KnownErrorList', Dict::S('Class:UserRequest:KnownErrorList')." ($iNumberKE)");
}
else
{
$oPage->SetCurrentTab('Class:UserRequest:KnownErrorList');
}
if ($iNumberKE > 0) {
$oPage->SetCurrentTab($sTabCode, Dict::S($sTabCode)." ($iNumberKE)", Dict::S($sTabCode."+"));
} else {
$oPage->SetCurrentTab($sTabCode, Dict::S($sTabCode), Dict::S($sTabCode."+"));
}
self::DisplaySet($oPage, $oKnownErrorSet, [
'menu' => false,
'panel_title' => Dict::S('Class:UserRequest:KnownErrorList'),
'panel_title' => Dict::S($sTabCode),
'panel_icon' => MetaModel::GetClassIcon($sKnownErrorClass, false),
'panel_title_tooltip' => Dict::S($sTabCode."+"),
]);
}
}]]></code>

View File

@@ -1366,24 +1366,22 @@
parent::DisplayBareRelations($oPage, $bEditMode);
$sKnownErrorClass = 'KnownError';
$sTabCode = 'Class:UserRequest:KnownErrorList';
if (MetaModel::IsValidClass($sKnownErrorClass)) {
//Search for known errors
$oPage->SetCurrentTab('Class:UserRequest:KnownErrorList');
$iTicketID = $this->GetKey();;
$oKnownErrorSet = new CMDBObjectSet(DBObjectSearch::FromOQL("SELECT $sKnownErrorClass AS ke JOIN lnkErrorToFunctionalCI AS l1 ON l1.error_id=ke.id JOIN FunctionalCI AS ci ON l1.functionalci_id=ci.id JOIN lnkFunctionalCIToTicket AS l2 ON l2.functionalci_id=ci.id WHERE l2.ticket_id=$iTicketID"));
$iNumberKE = $oKnownErrorSet->count();
if ($iNumberKE > 0)
{
$oPage->SetCurrentTab('Class:UserRequest:KnownErrorList', Dict::S('Class:UserRequest:KnownErrorList')." ($iNumberKE)");
}
else
{
$oPage->SetCurrentTab('Class:UserRequest:KnownErrorList');
}
if ($iNumberKE > 0) {
$oPage->SetCurrentTab($sTabCode, Dict::S($sTabCode)." ($iNumberKE)", Dict::S($sTabCode."+"));
} else {
$oPage->SetCurrentTab($sTabCode, Dict::S($sTabCode), Dict::S($sTabCode."+"));
}
self::DisplaySet($oPage, $oKnownErrorSet, [
'menu' => false,
'panel_title' => Dict::S('Class:UserRequest:KnownErrorList'),
'panel_title' => Dict::S($sTabCode),
'panel_icon' => MetaModel::GetClassIcon($sKnownErrorClass, false),
'panel_title_tooltip' => Dict::S($sTabCode."+"),
]);
}
}]]></code>

View File

@@ -35,6 +35,7 @@ Dict::Add('EN US', 'English', 'English', array(
'UI-RequestManagementOverview-OpenRequestByType' => 'Open requests by type',
'UI-RequestManagementOverview-OpenRequestByCustomer' => 'Open requests by customer',
'Class:UserRequest:KnownErrorList' => 'Known Errors',
'Class:UserRequest:KnownErrorList+' => 'Known Errors related to Functional CI linked to the current ticket',
));
// Dictionnay conventions

View File

@@ -1409,24 +1409,22 @@
parent::DisplayBareRelations($oPage, $bEditMode);
$sKnownErrorClass = 'KnownError';
$sTabCode = 'Class:UserRequest:KnownErrorList';
if (MetaModel::IsValidClass($sKnownErrorClass)) {
//Search for known errors
$oPage->SetCurrentTab('Class:UserRequest:KnownErrorList');
$iTicketID = $this->GetKey();;
$oKnownErrorSet = new CMDBObjectSet(DBObjectSearch::FromOQL("SELECT $sKnownErrorClass AS ke JOIN lnkErrorToFunctionalCI AS l1 ON l1.error_id=ke.id JOIN FunctionalCI AS ci ON l1.functionalci_id=ci.id JOIN lnkFunctionalCIToTicket AS l2 ON l2.functionalci_id=ci.id WHERE l2.ticket_id=$iTicketID"));
$iNumberKE = $oKnownErrorSet->count();
if ($iNumberKE > 0)
{
$oPage->SetCurrentTab('Class:UserRequest:KnownErrorList', Dict::S('Class:UserRequest:KnownErrorList')." ($iNumberKE)");
}
else
{
$oPage->SetCurrentTab('Class:UserRequest:KnownErrorList');
if ($iNumberKE > 0) {
$oPage->SetCurrentTab($sTabCode, Dict::S($sTabCode)." ($iNumberKE)", Dict::S($sTabCode."+"));
} else {
$oPage->SetCurrentTab($sTabCode, Dict::S($sTabCode), Dict::S($sTabCode."+"));
}
self::DisplaySet($oPage, $oKnownErrorSet, [
'menu' => false,
'panel_title' => Dict::S('Class:UserRequest:KnownErrorList'),
'panel_title' => Dict::S($sTabCode),
'panel_icon' => MetaModel::GetClassIcon($sKnownErrorClass, false),
'panel_title_tooltip' => Dict::S($sTabCode."+"),
]);
}
}]]></code>

View File

@@ -35,6 +35,7 @@ Dict::Add('EN US', 'English', 'English', array(
'UI-RequestManagementOverview-OpenRequestByType' => 'Open requests by type',
'UI-RequestManagementOverview-OpenRequestByCustomer' => 'Open requests by organization',
'Class:UserRequest:KnownErrorList' => 'Known Errors',
'Class:UserRequest:KnownErrorList+' => 'Known Errors related to Functional CI linked to the current ticket',
'Menu:UserRequest:MyWorkOrders' => 'Work orders assigned to me',
'Menu:UserRequest:MyWorkOrders+' => 'All work orders assigned to me',
'Class:Problem:KnownProblemList' => 'Known problems',