From 4400cfde62ed06c477ae7c29ec36a7b0b4c90882 Mon Sep 17 00:00:00 2001 From: Molkobain Date: Tue, 14 Jan 2020 20:35:07 +0100 Subject: [PATCH] =?UTF-8?q?N=C2=B02313=20-=20Markup=20extensibility:=20Upd?= =?UTF-8?q?ate=20usages=20of=20admin.=20console=20tabs=20to=20have=20codes?= =?UTF-8?q?=20and=20titles?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../userrightsprofile.class.inc.php | 37 +++++++--------- .../userrightsprofile.db.class.inc.php | 37 +++++++--------- .../userrightsprojection.class.inc.php | 37 +++++++--------- application/cmdbabstract.class.inc.php | 20 ++++----- application/template.class.inc.php | 37 +++++++--------- core/event.class.inc.php | 39 +++++++---------- core/tagsetfield.class.inc.php | 35 ++++++++-------- core/userrights.class.inc.php | 38 +++++++---------- datamodels/2.x/combodo-db-tools/dbtools.php | 38 ++++++++--------- .../main.itop-attachments.php | 35 ++++++++-------- .../datamodel.itop-config-mgmt.xml | 6 +-- .../datamodel.itop-incident-mgmt-itil.xml | 6 +-- .../datamodel.itop-request-mgmt-itil.xml | 6 +-- .../datamodel.itop-request-mgmt.xml | 6 +-- pages/UI.php | 10 ++--- pages/notifications.php | 6 +-- pages/schema.php | 12 +++--- synchro/synchrodatasource.class.inc.php | 42 ++++++++----------- 18 files changed, 199 insertions(+), 248 deletions(-) diff --git a/addons/userrights/userrightsprofile.class.inc.php b/addons/userrights/userrightsprofile.class.inc.php index 3650f6f17..294164d20 100644 --- a/addons/userrights/userrightsprofile.class.inc.php +++ b/addons/userrights/userrightsprofile.class.inc.php @@ -1,27 +1,20 @@ - /** - * UserRightsProfile - * User management Module, basing the right on profiles and a matrix (similar to UserRightsMatrix, but profiles and other decorations have been added) + * Copyright (C) 2013-2020 Combodo SARL * - * @copyright Copyright (C) 2010-2012 Combodo SARL - * @license http://opensource.org/licenses/AGPL-3.0 + * This file is part of iTop. + * + * iTop is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * iTop is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License */ define('ADMIN_PROFILE_NAME', 'Administrator'); @@ -179,7 +172,7 @@ class URP_Profiles extends UserRightsBaseClassGUI parent::DisplayBareRelations($oPage, $bEditMode); if (!$bEditMode) { - $oPage->SetCurrentTab(Dict::S('UI:UserManagement:GrantMatrix')); + $oPage->SetCurrentTab('UI:UserManagement:GrantMatrix'); $this->DoShowGrantSumary($oPage); } } diff --git a/addons/userrights/userrightsprofile.db.class.inc.php b/addons/userrights/userrightsprofile.db.class.inc.php index 2fe22791d..2115f1b8d 100644 --- a/addons/userrights/userrightsprofile.db.class.inc.php +++ b/addons/userrights/userrightsprofile.db.class.inc.php @@ -1,27 +1,20 @@ - /** - * UserRightsProfile - * User management Module, basing the right on profiles and a matrix (similar to UserRightsMatrix, but profiles and other decorations have been added) + * Copyright (C) 2013-2020 Combodo SARL * - * @copyright Copyright (C) 2010-2012 Combodo SARL - * @license http://opensource.org/licenses/AGPL-3.0 + * This file is part of iTop. + * + * iTop is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * iTop is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License */ define('ADMIN_PROFILE_NAME', 'Administrator'); @@ -321,7 +314,7 @@ class URP_Profiles extends UserRightsBaseClassGUI parent::DisplayBareRelations($oPage, $bEditMode); if (!$bEditMode) { - $oPage->SetCurrentTab(Dict::S('UI:UserManagement:GrantMatrix')); + $oPage->SetCurrentTab('UI:UserManagement:GrantMatrix'); $this->DoShowGrantSumary($oPage); } } diff --git a/addons/userrights/userrightsprojection.class.inc.php b/addons/userrights/userrightsprojection.class.inc.php index bf5e86944..081149398 100644 --- a/addons/userrights/userrightsprojection.class.inc.php +++ b/addons/userrights/userrightsprojection.class.inc.php @@ -1,27 +1,20 @@ - /** - * UserRightsProjection - * User management Module, basing the right on profiles and a matrix (similar to UserRightsProfile, but enhanced with dimensions and projection of classes and profile over the dimensions) + * Copyright (C) 2013-2020 Combodo SARL * - * @copyright Copyright (C) 2010-2012 Combodo SARL - * @license http://opensource.org/licenses/AGPL-3.0 + * This file is part of iTop. + * + * iTop is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * iTop is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License */ define('ADMIN_PROFILE_ID', 1); @@ -153,7 +146,7 @@ class URP_Profiles extends UserRightsBaseClass parent::DisplayBareRelations($oPage, $bEditMode); if (!$bEditMode) { - $oPage->SetCurrentTab(Dict::S('UI:UserManagement:GrantMatrix')); + $oPage->SetCurrentTab('UI:UserManagement:GrantMatrix'); $this->DoShowGrantSumary($oPage); } } diff --git a/application/cmdbabstract.class.inc.php b/application/cmdbabstract.class.inc.php index b92eb80ed..948a83e56 100644 --- a/application/cmdbabstract.class.inc.php +++ b/application/cmdbabstract.class.inc.php @@ -1,6 +1,6 @@ AddAjaxTab($oAttDef->GetLabel(), utils::GetAbsoluteUrlAppRoot().'pages/ajax.render.php?operation=dashboard&class='.get_class($this).'&id='.$this->GetKey().'&attcode='.$oAttDef->GetCode()); + $oPage->AddAjaxTab($oAttDef->GetLabel(), utils::GetAbsoluteUrlAppRoot().'pages/ajax.render.php?operation=dashboard&class='.get_class($this).'&id='.$this->GetKey().'&attcode='.$oAttDef->GetCode(), true, 'Class:'.$sClass.'/Attribute:'.$sAttCode); continue; } @@ -556,7 +556,7 @@ EOF { $sCount = " ($iCount)"; } - $oPage->SetCurrentTab($oAttDef->GetLabel().$sCount); + $oPage->SetCurrentTab('Class:'.$sClass.'/Attribute:'.$sAttCode, $oAttDef->GetLabel().$sCount); if ($this->IsNew()) { $iFlags = $this->GetInitialStateAttributeFlags($sAttCode); @@ -735,9 +735,9 @@ EOF $oNotifSet = new DBObjectSet($aNotifSearches[$sNotifClass], array()); $iNotifsCount += $oNotifSet->Count(); } - // Display notifications regarding the object: on block per subclass to have the intersting columns + // Display notifications regarding the object: on block per subclass to have the interesting columns $sCount = ($iNotifsCount > 0) ? ' ('.$iNotifsCount.')' : ''; - $oPage->SetCurrentTab(Dict::S('UI:NotificationsTab').$sCount); + $oPage->SetCurrentTab('UI:NotificationsTab', Dict::S('UI:NotificationsTab').$sCount); foreach($aNotificationClasses as $sNotifClass) { @@ -801,7 +801,7 @@ EOF $aTableClasses[] = 'one-col-details'; } - $oPage->SetCurrentTab(Dict::S($sTab)); + $oPage->SetCurrentTab($sTab); $oPage->add(''); foreach($aCols as $sColIndex => $aFieldsets) @@ -1027,10 +1027,10 @@ HTML /** @var \iTopWebPage $oPage */ $oPage->AddTabContainer(OBJECT_PROPERTIES_TAB); $oPage->SetCurrentTabContainer(OBJECT_PROPERTIES_TAB); - $oPage->SetCurrentTab(Dict::S('UI:PropertiesTab')); + $oPage->SetCurrentTab('UI:PropertiesTab'); $this->DisplayBareProperties($oPage, $bEditMode); $this->DisplayBareRelations($oPage, $bEditMode); - //$oPage->SetCurrentTab(Dict::S('UI:HistoryTab')); + //$oPage->SetCurrentTab('UI:HistoryTab'); //$this->DisplayBareHistory($oPage, $bEditMode); $oPage->AddAjaxTab(Dict::S('UI:HistoryTab'), utils::GetAbsoluteUrlAppRoot().'pages/ajax.render.php?operation=history&class='.$sClass.'&id='.$iKey); @@ -2659,7 +2659,7 @@ EOF $oPage->AddTabContainer(OBJECT_PROPERTIES_TAB, $sPrefix); $oPage->SetCurrentTabContainer(OBJECT_PROPERTIES_TAB); - $oPage->SetCurrentTab(Dict::S('UI:PropertiesTab')); + $oPage->SetCurrentTab('UI:PropertiesTab'); $aFieldsMap = $this->DisplayBareProperties($oPage, true, $sPrefix, $aExtraParams); if (!is_array($aFieldsMap)) @@ -4197,7 +4197,7 @@ EOF */ public function DisplayCaseLog(WebPage $oPage, $sAttCode, $sComment = '', $sPrefix = '', $bEditMode = false) { - $oPage->SetCurrentTab(Dict::S('UI:PropertiesTab')); + $oPage->SetCurrentTab('UI:PropertiesTab'); $sClass = get_class($this); if ($this->IsNew()) { diff --git a/application/template.class.inc.php b/application/template.class.inc.php index e5fd7e1bd..5c7fa9315 100644 --- a/application/template.class.inc.php +++ b/application/template.class.inc.php @@ -1,27 +1,20 @@ - - /** - * Class DisplayTemplate + * Copyright (C) 2013-2020 Combodo SARL * - * @copyright Copyright (C) 2010-2017 Combodo SARL - * @license http://opensource.org/licenses/AGPL-3.0 + * This file is part of iTop. + * + * iTop is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * iTop is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License */ require_once(APPROOT.'/application/displayblock.class.inc.php'); @@ -191,7 +184,7 @@ class DisplayTemplate break; case 'itoptab': - $oPage->SetCurrentTab(Dict::S(str_replace('_', ' ', $aAttributes['name']))); + $oPage->SetCurrentTab($aAttributes['name'], str_replace('_', ' ', $aAttributes['name'])); $oTemplate = new DisplayTemplate($sContent); $oTemplate->Render($oPage, array()); // no params to apply, they have already been applied //$oPage->p('iTop Tab Content:
'.htmlentities($sContent, ENT_QUOTES, 'UTF-8').'
'); diff --git a/core/event.class.inc.php b/core/event.class.inc.php index fba748ca4..8e5cfd814 100644 --- a/core/event.class.inc.php +++ b/core/event.class.inc.php @@ -1,29 +1,20 @@ - - /** - * Persistent class Event and derived - * Application internal events - * There is also a file log + * Copyright (C) 2013-2020 Combodo SARL * - * @copyright Copyright (C) 2010-2012 Combodo SARL - * @license http://opensource.org/licenses/AGPL-3.0 + * This file is part of iTop. + * + * iTop is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * iTop is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License */ class Event extends DBObject implements iDisplay @@ -101,7 +92,7 @@ class Event extends DBObject implements iDisplay //$this->DisplayBareHeader($oPage, $bEditMode); $oPage->AddTabContainer(OBJECT_PROPERTIES_TAB); $oPage->SetCurrentTabContainer(OBJECT_PROPERTIES_TAB); - $oPage->SetCurrentTab(Dict::S('UI:PropertiesTab')); + $oPage->SetCurrentTab('UI:PropertiesTab'); $this->DisplayBareProperties($oPage, $bEditMode); } diff --git a/core/tagsetfield.class.inc.php b/core/tagsetfield.class.inc.php index 26d9c353a..2e82b5002 100644 --- a/core/tagsetfield.class.inc.php +++ b/core/tagsetfield.class.inc.php @@ -1,20 +1,21 @@ +/** + * Copyright (C) 2013-2020 Combodo SARL + * + * This file is part of iTop. + * + * iTop is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * iTop is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + */ /** @@ -318,7 +319,7 @@ abstract class TagSetFieldData extends cmdbAbstractObject $oFilter = DBSearch::FromOQL("SELECT $sClass WHERE $sAttCode MATCHES '$sTagCode'"); $oSet = new DBObjectSet($oFilter); $iCount = $oSet->Count(); - $oPage->SetCurrentTab(Dict::Format('Core:TagSetFieldData:WhereIsThisTagTab', $iCount)); + $oPage->SetCurrentTab('Core:TagSetFieldData:WhereIsThisTagTab', Dict::Format('Core:TagSetFieldData:WhereIsThisTagTab', $iCount)); if ($iCount === 0) { diff --git a/core/userrights.class.inc.php b/core/userrights.class.inc.php index 309565a43..68f48bb99 100644 --- a/core/userrights.class.inc.php +++ b/core/userrights.class.inc.php @@ -1,30 +1,22 @@ - - /** - * User rights management API + * Copyright (C) 2013-2020 Combodo SARL * - * @copyright Copyright (C) 2010-2017 Combodo SARL - * @license http://opensource.org/licenses/AGPL-3.0 + * This file is part of iTop. + * + * iTop is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * iTop is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License */ - class UserRightException extends CoreException { } @@ -419,7 +411,7 @@ abstract class User extends cmdbAbstractObject parent::DisplayBareRelations($oPage, $bEditMode); if (!$bEditMode) { - $oPage->SetCurrentTab(Dict::S('UI:UserManagement:GrantMatrix')); + $oPage->SetCurrentTab('UI:UserManagement:GrantMatrix'); $this->DoShowGrantSumary($oPage, 'bizmodel,grant_by_profile'); // debug diff --git a/datamodels/2.x/combodo-db-tools/dbtools.php b/datamodels/2.x/combodo-db-tools/dbtools.php index 75744aced..72eaad23e 100644 --- a/datamodels/2.x/combodo-db-tools/dbtools.php +++ b/datamodels/2.x/combodo-db-tools/dbtools.php @@ -1,21 +1,21 @@ -// +/** + * Copyright (C) 2013-2020 Combodo SARL + * + * This file is part of iTop. + * + * iTop is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * iTop is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + */ @include_once('../../approot.inc.php'); require_once(APPROOT.'application/startup.inc.php'); @@ -48,7 +48,7 @@ function DisplayDBInconsistencies(iTopWebPage &$oP, ApplicationContext &$oAppCon } $sClassSelection = utils::ReadParam('class_selection', ''); - $oP->SetCurrentTab(Dict::S('DBTools:Inconsistencies')); + $oP->SetCurrentTab('DBTools:Inconsistencies'); $bRunAnalysis = intval(utils::ReadParam('run_analysis', '0')); if ($bRunAnalysis) @@ -293,7 +293,7 @@ function DisplayLostAttachments(iTopWebPage &$oP, ApplicationContext &$oAppConte $bDoRestore = in_array($sStepName, array('restore')); // Build HTML - $oP->SetCurrentTab(Dict::S('DBTools:LostAttachments')); + $oP->SetCurrentTab('DBTools:LostAttachments'); $oP->add('
'); $oP->add('
'); diff --git a/datamodels/2.x/itop-attachments/main.itop-attachments.php b/datamodels/2.x/itop-attachments/main.itop-attachments.php index a3a8e7c16..21d680a30 100644 --- a/datamodels/2.x/itop-attachments/main.itop-attachments.php +++ b/datamodels/2.x/itop-attachments/main.itop-attachments.php @@ -1,20 +1,21 @@ +/** + * Copyright (C) 2013-2020 Combodo SARL + * + * This file is part of iTop. + * + * iTop is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * iTop is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + */ class AttachmentPlugIn implements iApplicationUIExtension, iApplicationObjectExtension { @@ -258,7 +259,7 @@ class AttachmentPlugIn implements iApplicationUIExtension, iApplicationObjectExt { $iCount = $oAttachmentsRenderer->GetAttachmentsSet()->Count() + $oAttachmentsRenderer->GetTempAttachmentsSet()->Count(); $sTitle = ($iCount > 0) ? Dict::Format('Attachments:TabTitle_Count', $iCount) : Dict::S('Attachments:EmptyTabTitle'); - $oPage->SetCurrentTab($sTitle); + $oPage->SetCurrentTab('Attachments:Tab', $sTitle); } $oPage->add('
'); diff --git a/datamodels/2.x/itop-config-mgmt/datamodel.itop-config-mgmt.xml b/datamodels/2.x/itop-config-mgmt/datamodel.itop-config-mgmt.xml index 3ebdc21c6..df0926ff0 100755 --- a/datamodels/2.x/itop-config-mgmt/datamodel.itop-config-mgmt.xml +++ b/datamodels/2.x/itop-config-mgmt/datamodel.itop-config-mgmt.xml @@ -1735,7 +1735,7 @@ } $sCount = ($iTotal > 0) ? ' ('.$iTotal.')' : ''; - $oPage->SetCurrentTab(Dict::S('Class:FunctionalCI/Tab:OpenedTickets').$sCount); + $oPage->SetCurrentTab('Class:FunctionalCI/Tab:OpenedTickets', Dict::S('Class:FunctionalCI/Tab:OpenedTickets').$sCount); foreach ($aSearches as $sSubClass => $oSearch) { @@ -6722,7 +6722,7 @@ if (!$bEditMode) { - $oPage->SetCurrentTab(Dict::S('Class:Subnet/Tab:IPUsage')); + $oPage->SetCurrentTab('Class:Subnet/Tab:IPUsage'); $bit_ip = ip2long($this->Get('ip')); $bit_mask = ip2long($this->Get('ip_mask')); @@ -6744,7 +6744,7 @@ $iCountRange = $iIPMax - $iIPMin; // On 32-bit systems the substraction will be computed using floats for values greater than PHP_MAX_INT; $iFreeCount = $iCountRange - $iCountUsed; - $oPage->SetCurrentTab(Dict::S('Class:Subnet/Tab:FreeIPs')); + $oPage->SetCurrentTab('Class:Subnet/Tab:FreeIPs'); $oPage->p(Dict::Format('Class:Subnet/Tab:FreeIPs-count', $iFreeCount)); $oPage->p(Dict::S('Class:Subnet/Tab:FreeIPs-explain')); diff --git a/datamodels/2.x/itop-incident-mgmt-itil/datamodel.itop-incident-mgmt-itil.xml b/datamodels/2.x/itop-incident-mgmt-itil/datamodel.itop-incident-mgmt-itil.xml index 59ff38980..170c60245 100755 --- a/datamodels/2.x/itop-incident-mgmt-itil/datamodel.itop-incident-mgmt-itil.xml +++ b/datamodels/2.x/itop-incident-mgmt-itil/datamodel.itop-incident-mgmt-itil.xml @@ -1084,17 +1084,17 @@ if (MetaModel::IsValidClass('KnownError')) { //Search for known errors - $oPage->SetCurrentTab(Dict::S('Class:UserRequest:KnownErrorList')); + $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(Dict::S('Class:UserRequest:KnownErrorList')." ($iNumberKE)"); + $oPage->SetCurrentTab('Class:UserRequest:KnownErrorList', Dict::S('Class:UserRequest:KnownErrorList')." ($iNumberKE)"); } else { - $oPage->SetCurrentTab(Dict::S('Class:UserRequest:KnownErrorList')); + $oPage->SetCurrentTab('Class:UserRequest:KnownErrorList'); } self::DisplaySet($oPage, $oKnownErrorSet, array ('menu' => false)); } diff --git a/datamodels/2.x/itop-request-mgmt-itil/datamodel.itop-request-mgmt-itil.xml b/datamodels/2.x/itop-request-mgmt-itil/datamodel.itop-request-mgmt-itil.xml index 516e4327c..780221659 100755 --- a/datamodels/2.x/itop-request-mgmt-itil/datamodel.itop-request-mgmt-itil.xml +++ b/datamodels/2.x/itop-request-mgmt-itil/datamodel.itop-request-mgmt-itil.xml @@ -1226,17 +1226,17 @@ if (MetaModel::IsValidClass('KnownError')) { //Search for known errors - $oPage->SetCurrentTab(Dict::S('Class:UserRequest:KnownErrorList')); + $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(Dict::S('Class:UserRequest:KnownErrorList')." ($iNumberKE)"); + $oPage->SetCurrentTab('Class:UserRequest:KnownErrorList', Dict::S('Class:UserRequest:KnownErrorList')." ($iNumberKE)"); } else { - $oPage->SetCurrentTab(Dict::S('Class:UserRequest:KnownErrorList')); + $oPage->SetCurrentTab('Class:UserRequest:KnownErrorList'); } self::DisplaySet($oPage, $oKnownErrorSet, array ('menu' => false)); } diff --git a/datamodels/2.x/itop-request-mgmt/datamodel.itop-request-mgmt.xml b/datamodels/2.x/itop-request-mgmt/datamodel.itop-request-mgmt.xml index ae911c9ff..c6fa37e45 100755 --- a/datamodels/2.x/itop-request-mgmt/datamodel.itop-request-mgmt.xml +++ b/datamodels/2.x/itop-request-mgmt/datamodel.itop-request-mgmt.xml @@ -1243,17 +1243,17 @@ if (MetaModel::IsValidClass('KnownError')) { //Search for known errors - $oPage->SetCurrentTab(Dict::S('Class:UserRequest:KnownErrorList')); + $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(Dict::S('Class:UserRequest:KnownErrorList')." ($iNumberKE)"); + $oPage->SetCurrentTab('Class:UserRequest:KnownErrorList', Dict::S('Class:UserRequest:KnownErrorList')." ($iNumberKE)"); } else { - $oPage->SetCurrentTab(Dict::S('Class:UserRequest:KnownErrorList')); + $oPage->SetCurrentTab('Class:UserRequest:KnownErrorList'); } self::DisplaySet($oPage, $oKnownErrorSet, array ('menu' => false)); } diff --git a/pages/UI.php b/pages/UI.php index cea417a66..ef827d492 100644 --- a/pages/UI.php +++ b/pages/UI.php @@ -1,6 +1,6 @@ SetCurrentTab(Dict::S('UI:RelationshipList')); + $oP->SetCurrentTab('UI:RelationshipList'); $oP->add("
"); $sOldRelation = $sRelation; if (($sRelation == 'impacts') && ($sDirection == 'up')) @@ -317,7 +317,7 @@ function DisplayNavigatorListTab($oP, $aResults, $sRelation, $sDirection, $oObj) function DisplayNavigatorGroupTab($oP) { - $oP->SetCurrentTab(Dict::S('UI:RelationGroups')); + $oP->SetCurrentTab('UI:RelationGroups'); $oP->add("
"); $oP->add(''); /* @@ -1746,13 +1746,13 @@ EOF if ($sFirstTab == 'list') { DisplayNavigatorListTab($oP, $aResults, $sRelation, $sDirection, $oObj); - $oP->SetCurrentTab(Dict::S('UI:RelationshipGraph')); + $oP->SetCurrentTab('UI:RelationshipGraph'); $oDisplayGraph->Display($oP, $aResults, $sRelation, $oAppContext, array(), $sClassForAttachment, $iIdForAttachment, $sContextKey, array('this' => $oObj)); DisplayNavigatorGroupTab($oP); } else { - $oP->SetCurrentTab(Dict::S('UI:RelationshipGraph')); + $oP->SetCurrentTab('UI:RelationshipGraph'); $oDisplayGraph->Display($oP, $aResults, $sRelation, $oAppContext, array(), $sClassForAttachment, $iIdForAttachment, $sContextKey, array('this' => $oObj)); DisplayNavigatorListTab($oP, $aResults, $sRelation, $sDirection, $oObj); DisplayNavigatorGroupTab($oP); diff --git a/pages/notifications.php b/pages/notifications.php index 1629e93b6..a41a66d4d 100644 --- a/pages/notifications.php +++ b/pages/notifications.php @@ -1,6 +1,6 @@ add('

 

'); $oP->AddTabContainer('Tabs_0'); $oP->SetCurrentTabContainer('Tabs_0'); -$oP->SetCurrentTab(Dict::S('UI:NotificationsMenu:Triggers')); +$oP->SetCurrentTab('UI:NotificationsMenu:Triggers'); $oP->add('

'.Dict::S('UI:NotificationsMenu:AvailableTriggers').'

'); $oFilter = new DBObjectSearch('Trigger'); $aParams = array(); @@ -69,7 +69,7 @@ foreach(MetaModel::EnumChildClasses('Action', ENUM_CHILD_CLASSES_EXCLUDETOP) as } } -$oP->SetCurrentTab(Dict::S('UI:NotificationsMenu:Actions')); +$oP->SetCurrentTab('UI:NotificationsMenu:Actions'); if (count($aActionClasses) == 1) { diff --git a/pages/schema.php b/pages/schema.php index ef628795a..780f058ca 100644 --- a/pages/schema.php +++ b/pages/schema.php @@ -1,6 +1,6 @@ SetCurrentTab(Dict::S('UI:Schema:Attributes')); + $oPage->SetCurrentTab('UI:Schema:Attributes'); $aConfig = array( 'origincolor' => array('label' => "", 'description' => ""), 'code' => array('label' => Dict::S('UI:Schema:AttributeCode'), 'description' => Dict::S('UI:Schema:AttributeCode+')), 'type' => array('label' => Dict::S('UI:Schema:Type'), 'description' => Dict::S('UI:Schema:Type+')), @@ -961,16 +961,16 @@ EOF EOF ); - $oPage->SetCurrentTab(Dict::S('UI:Schema:RelatedClasses')); + $oPage->SetCurrentTab('UI:Schema:RelatedClasses'); DisplayRelatedClassesGraph($oPage, $sClass); - $oPage->SetCurrentTab(Dict::S('UI:Schema:ChildClasses')); + $oPage->SetCurrentTab('UI:Schema:ChildClasses'); DisplaySubclasses($oPage, $sClass, $sContext); - $oPage->SetCurrentTab(Dict::S('UI:Schema:LifeCycle')); + $oPage->SetCurrentTab('UI:Schema:LifeCycle'); DisplayLifecycle($oPage, $sClass); - $oPage->SetCurrentTab(Dict::S('UI:Schema:Triggers')); + $oPage->SetCurrentTab('UI:Schema:Triggers'); DisplayTriggers($oPage, $sClass); $oPage->SetCurrentTab(); diff --git a/synchro/synchrodatasource.class.inc.php b/synchro/synchrodatasource.class.inc.php index 8a1826a1f..72e5f7769 100644 --- a/synchro/synchrodatasource.class.inc.php +++ b/synchro/synchrodatasource.class.inc.php @@ -1,28 +1,22 @@ - - /** - * Data Exchange - synchronization with external applications (incoming data) + * Copyright (C) 2013-2020 Combodo SARL * - * @copyright Copyright (C) 2010-2018 Combodo SARL - * @license http://opensource.org/licenses/AGPL-3.0 + * This file is part of iTop. + * + * iTop is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * iTop is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License */ + class SynchroExceptionNotStarted extends CoreException { } @@ -266,7 +260,7 @@ class SynchroDataSource extends cmdbAbstractObject { if (!$this->IsNew()) { - $oPage->SetCurrentTab(Dict::S('Core:SynchroAttributes')); + $oPage->SetCurrentTab('Core:SynchroAttributes'); $oAttributeSet = $this->Get('attribute_list'); $aAttributes = array(); @@ -404,7 +398,7 @@ class SynchroDataSource extends cmdbAbstractObject */ protected function DisplayStatusTab(WebPage $oPage) { - $oPage->SetCurrentTab(Dict::S('Core:SynchroStatus')); + $oPage->SetCurrentTab('Core:SynchroStatus'); $sSelectSynchroLog = 'SELECT SynchroLog WHERE sync_source_id = :source_id'; $oSetSynchroLog = new CMDBObjectSet(DBObjectSearch::FromOQL($sSelectSynchroLog), array('start_date' => false) /* order by*/, @@ -2834,7 +2828,7 @@ class SynchroReplica extends DBObject implements iDisplay //$this->DisplayBareHeader($oPage, $bEditMode); $oPage->AddTabContainer(OBJECT_PROPERTIES_TAB); $oPage->SetCurrentTabContainer(OBJECT_PROPERTIES_TAB); - $oPage->SetCurrentTab(Dict::S('UI:PropertiesTab')); + $oPage->SetCurrentTab('UI:PropertiesTab'); $this->DisplayBareProperties($oPage, $bEditMode); }