From 124867f7fa02e25e16942f1e937ccce7af634366 Mon Sep 17 00:00:00 2001 From: Denis Flaven Date: Sat, 15 May 2010 07:54:59 +0000 Subject: [PATCH] - Implementation of the localization... on going... SVN:trunk[406] --- .../userrightsprofile.class.inc.php | 46 +- application/cmdbabstract.class.inc.php | 6 +- application/webpage.class.inc.php | 4 +- dictionaries/dictionary.itop.ui.php | 118 ++- dictionaries/fr.dictionary.itop.ui.php | 136 ++- pages/UI.php | 890 +++++++++--------- pages/usermanagement_classproj.php | 8 +- pages/usermanagement_profileproj.php | 8 +- 8 files changed, 698 insertions(+), 518 deletions(-) diff --git a/addons/userrights/userrightsprofile.class.inc.php b/addons/userrights/userrightsprofile.class.inc.php index 049b559a6..14c800db5 100644 --- a/addons/userrights/userrightsprofile.class.inc.php +++ b/addons/userrights/userrightsprofile.class.inc.php @@ -84,11 +84,11 @@ class URP_Users extends UserRightsBaseClass { if (UserRights::IsActionAllowed($sClass, $iAction, null, $this->GetKey())) { - return 'yes'; + return ''.Dict::S('UI:UserManagement:ActionAllowed:Yes').''; } else { - return 'no'; + return ''.Dict::S('UI:UserManagement:ActionAllowed:No').''; } } @@ -98,7 +98,7 @@ class URP_Users extends UserRightsBaseClass if (UserRights::IsAdministrator($iUserId)) { // Looks dirty, but ok that's THE ONE - $oPage->p('Has Read/Write access to any object in the database.'); + $oPage->p(Dict::S('UI:UserManagement:AdminProfile+')); return; } @@ -120,7 +120,7 @@ class URP_Users extends UserRightsBaseClass } else { - $sStimuli = 'n/a'; + $sStimuli = ''.Dict::S('UI:UserManagement:NoLifeCycleApplicable').''; } $aDisplayData[] = array( @@ -134,12 +134,12 @@ class URP_Users extends UserRightsBaseClass } $aDisplayConfig = array(); - $aDisplayConfig['class'] = array('label' => 'Class', 'description' => ''); - $aDisplayConfig['read'] = array('label' => 'Read', 'description' => ''); - $aDisplayConfig['bulkread'] = array('label' => 'Bulk read', 'description' => 'List objects or export massively'); - $aDisplayConfig['write'] = array('label' => 'Write', 'description' => 'Create and edit (modify)'); - $aDisplayConfig['bulkwrite'] = array('label' => 'Bulk write', 'description' => 'Massively create/edit (CSV import)'); - $aDisplayConfig['stimuli'] = array('label' => 'Stimuli', 'description' => 'Allowed (compound) actions'); + $aDisplayConfig['class'] = array('label' => Dict::S('UI:UserManagement:Class'), 'description' => Dict::S('UI:UserManagement:Class+')); + $aDisplayConfig['read'] = array('label' => Dict::S('UI:UserManagement:Action:Read'), 'description' => Dict::S('UI:UserManagement:Action:Read+')); + $aDisplayConfig['bulkread'] = array('label' => Dict::S('UI:UserManagement:Action:BulkRead'), 'description' => Dict::S('UI:UserManagement:Action:BulkRead+')); + $aDisplayConfig['write'] = array('label' => Dict::S('UI:UserManagement:Action:Modify'), 'description' => Dict::S('UI:UserManagement:Action:Modify+')); + $aDisplayConfig['bulkwrite'] = array('label' => Dict::S('UI:UserManagement:Action:BulkModify'), 'description' => Dict::S('UI:UserManagement:Action:BulkModify+')); + $aDisplayConfig['stimuli'] = array('label' => Dict::S('UI:UserManagement:Action:Stimuli'), 'description' => Dict::S('UI:UserManagement:Action:Stimuli+')); $oPage->table($aDisplayConfig, $aDisplayData); } @@ -207,11 +207,11 @@ class URP_Profiles extends UserRightsBaseClass $oGrant = $oUserRights->GetClassActionGrant($this->GetKey(), $sClass, $sAction); if (is_object($oGrant) && ($oGrant->Get('permission') == 'yes')) { - return 'yes'; + return ''.Dict::S('UI:UserManagement:ActionAllowed:Yes').''; } else { - return 'no'; + return ''.Dict::S('UI:UserManagement:ActionAllowed:No').''; } } @@ -220,7 +220,7 @@ class URP_Profiles extends UserRightsBaseClass if ($this->GetName() == "Administrator") { // Looks dirty, but ok that's THE ONE - $oPage->p('Has Read/Write access to any object in the database.'); + $oPage->p(Dict::S('UI:UserManagement:AdminProfile+')); return; } @@ -254,14 +254,14 @@ class URP_Profiles extends UserRightsBaseClass } $aDisplayConfig = array(); - $aDisplayConfig['class'] = array('label' => 'Class', 'description' => ''); - $aDisplayConfig['read'] = array('label' => 'Read', 'description' => ''); - $aDisplayConfig['bulkread'] = array('label' => 'Bulk read', 'description' => 'List objects or export massively'); - $aDisplayConfig['write'] = array('label' => 'Write', 'description' => 'Create and edit (modify)'); - $aDisplayConfig['bulkwrite'] = array('label' => 'Bulk write', 'description' => 'Massively create/edit (CSV import)'); - $aDisplayConfig['delete'] = array('label' => 'Write', 'description' => 'Delete'); - $aDisplayConfig['bulkdelete'] = array('label' => 'Bulk delete', 'description' => 'Massively delete'); - $aDisplayConfig['stimuli'] = array('label' => 'Stimuli', 'description' => 'Allowed (compound) actions'); + $aDisplayConfig['class'] = array('label' => Dict::S('UI:UserManagement:Class'), 'description' => Dict::S('UI:UserManagement:Class+')); + $aDisplayConfig['read'] = array('label' => Dict::S('UI:UserManagement:Action:Read'), 'description' => Dict::S('UI:UserManagement:Action:Read+')); + $aDisplayConfig['bulkread'] = array('label' => Dict::S('UI:UserManagement:Action:BulkRead'), 'description' => Dict::S('UI:UserManagement:Action:BulkRead+')); + $aDisplayConfig['write'] = array('label' => Dict::S('UI:UserManagement:Action:Modify'), 'description' => Dict::S('UI:UserManagement:Action:Modify+')); + $aDisplayConfig['bulkwrite'] = array('label' => Dict::S('UI:UserManagement:Action:BulkModify'), 'description' => Dict::S('UI:UserManagement:Action:BulkModify+')); + $aDisplayConfig['delete'] = array('label' => Dict::S('UI:UserManagement:Action:Delete'), 'description' => Dict::S('UI:UserManagement:Action:Delete+')); + $aDisplayConfig['bulkdelete'] = array('label' => Dict::S('UI:UserManagement:Action:BulkDelete'), 'description' => Dict::S('UI:UserManagement:Action:BulkDelete+')); + $aDisplayConfig['stimuli'] = array('label' => Dict::S('UI:UserManagement:Action:Stimuli'), 'description' => Dict::S('UI:UserManagement:Action:Stimuli+')); $oPage->table($aDisplayConfig, $aDisplayData); } @@ -271,7 +271,7 @@ class URP_Profiles extends UserRightsBaseClass $oPage->SetCurrentTabContainer('Related Objects'); - $oPage->SetCurrentTab('Grants matrix'); + $oPage->SetCurrentTab(Dict::S('UI:UserManagement:GrantMatrix')); $this->DoShowGrantSumary($oPage); } } @@ -428,7 +428,7 @@ class URP_UserProfile extends UserRightsBaseClass public function GetName() { - return "link between ".$this->Get('userlogin')." and ".$this->Get('profile'); + return Dict::Format('UI:USerManagement:LinkBetween_User_And_Profile'); } } diff --git a/application/cmdbabstract.class.inc.php b/application/cmdbabstract.class.inc.php index 783da3216..91abac45a 100644 --- a/application/cmdbabstract.class.inc.php +++ b/application/cmdbabstract.class.inc.php @@ -716,7 +716,7 @@ abstract class cmdbAbstractObject extends CMDBObject { if (count($aMapCriteria[$sFilterCode]) > 1) { - $sFilterValue = '* mixed *'; + $sFilterValue = Dict::S('UI:SearchValue:Mixed'); } else { @@ -734,7 +734,7 @@ abstract class cmdbAbstractObject extends CMDBObject { //Enum field or external key, display a combo $sValue = "\n"; - $sHTMLValue .= "\n"; + $sHTMLValue .= "\n"; foreach($aAllowedValues as $key => $display_value) { $sSelected = ($value == $key) ? ' selected' : ''; diff --git a/application/webpage.class.inc.php b/application/webpage.class.inc.php index 9d569f91a..0ffc9584f 100644 --- a/application/webpage.class.inc.php +++ b/application/webpage.class.inc.php @@ -132,12 +132,12 @@ class WebPage $sAlias = $aMatches[1]; $sClass = $aParams['class'][$sAlias]; $sUIPage = cmdbAbstractObject::ComputeUIPage($sClass); - $sHtml .= "GetForLink()."\">\n"; + $sHtml .= "GetForLink()."\">\n"; } else if ($sName == 'key') { $sUIPage = cmdbAbstractObject::ComputeUIPage($aParams['class']); - $sHtml .= "GetForLink()."\">\n"; + $sHtml .= "GetForLink()."\">\n"; } else { diff --git a/dictionaries/dictionary.itop.ui.php b/dictionaries/dictionary.itop.ui.php index a89039b10..d7c71c4cf 100644 --- a/dictionaries/dictionary.itop.ui.php +++ b/dictionaries/dictionary.itop.ui.php @@ -318,7 +318,7 @@ Dict::Add('EN US', 'English', 'English', array( 'UI:Button:Apply' => 'Apply', 'UI:Button:Back' => ' << Back ', 'UI:Button:Next' => ' Next >> ', - 'UI:Button:Next' => ' Finish ', + 'UI:Button:Finish' => ' Finish ', 'UI:Button:DoImport' => ' Run the Import ! ', 'UI:Button:Done' => ' Done ', 'UI:Button:SimulateImport' => ' Simulate the Import ', @@ -330,6 +330,7 @@ Dict::Add('EN US', 'English', 'English', array( 'UI:Button:AddToList' => ' << Add ', 'UI:Button:RemoveFromList' => ' Remove >> ', 'UI:Button:FilterList' => ' Filter... ', + 'UI:Button:Delete' => 'Delete ! ', 'UI:SearchToggle' => 'Search', 'UI:ClickToCreateNew' => 'Click here to create a new %1$s', @@ -349,6 +350,22 @@ Dict::Add('EN US', 'English', 'English', array( 'UI:Error:UploadStoppedByExtension_FileName' => 'Upload stopped by extension. (Original file name = "%1$s").', 'UI:Error:UploadFailedUnknownCause_Code' => 'File upload failed, unknown cause. (Error code = "%1$s").', + 'UI:Error:1ParametersMissing' => 'Error: the following parameter must be specified for this operation: %1$s.', + 'UI:Error:2ParametersMissing' => 'Error: the following parameters must be specified for this operation: %1$s and %2$s.', + 'UI:Error:3ParametersMissing' => 'Error: the following parameters must be specified for this operation: %1$s, %2$s and %3$s.', + 'UI:Error:4ParametersMissing' => 'Error: the following parameters must be specified for this operation: %1$s, %2$s, %3$s and %4$s.', + 'UI:Error:IncorrectOQLQuery_Message' => 'Error: incorrect OQL query: %1$s', + 'UI:Error:AnErrorOccuredWhileRunningTheQuery_Message' => 'An error occured while running the query: %1$s', + 'UI:Error:ObjectAlreadyUpdated' => 'Error: the object has already been updated.', + 'UI:Error:ObjectCannotBeUpdated' => 'Error: object cannot be updated.', + 'UI:Error:ObjectsAlreadyDeleted' => 'Error: objects have already been deleted!', + 'UI:Error:BulkDeleteNotAllowedOn_Class' => 'You are not allowed to perform a bulk delete of objects of class %1$s', + 'UI:Error:DeleteNotAllowedOn_Class' => 'You are not allowed to delete objects of class %1$s', + 'UI:Error:ObjectAlreadyCloned' => 'Error: the object has already been cloned!', + 'UI:Error:ObjectAlreadyCreated' => 'Error: the object has laready been created!', + 'UI:Error:Invalid_Stimulus_On_Object_In_State' => 'Error: invalid stimulus "%1$s" on object %2$s in state "%3$s".', + + 'UI:GroupBy:Count' => 'Count', 'UI:GroupBy:Count+' => 'Number of elements', 'UI:CountOfObjects' => '%1$d objects matching the criteria.', @@ -385,6 +402,9 @@ Dict::Add('EN US', 'English', 'English', array( 'UI:OQLQueryTab' => 'OQL Query', 'UI:SimpleSearchTab' => 'Simple Search', 'UI:Details+' => 'Details', + 'UI:SearchValue:Any' => '* Any *', + 'UI:SearchValue:Mixed' => '* mixed *', + 'UI:SelectOne' => '-- select one --', 'UI:Login:Welcome' => 'Welcome to iTop!', 'UI:Login:IncorrectLoginPassword' => 'Incorrect login/password, please try again.', 'UI:Login:IdentifyYourself' => 'Identify yourself before continuing', @@ -545,7 +565,101 @@ Dict::Add('EN US', 'English', 'English', array( 'UI:Message:EmptyList:UseAdd' => 'The list is empty, use the "Add..." button to add elements.', 'UI:Message:EmptyList:UseSearchForm' => 'Use the search form above to search for objects to be added.', - 'UI:Wizard:FinalStepTitle' => 'Final step: confirmation' + 'UI:Wizard:FinalStepTitle' => 'Final step: confirmation', + 'UI:Title:DeletionOf_Object' => 'Deletion of %1$s', + 'UI:Title:BulkDeletionOf_Count_ObjectsOf_Class' => 'Bulk deletion of %1$d objects of class %2$s', + 'UI:Delete:NotAllowedToDelete' => 'You are not allowed to delete this object', + 'UI:Delete:NotAllowedToUpdate_Fields' => 'You are not allowed to update the following field(s): %1$s', + 'UI:Error:NotEnoughRightsToDelete' => 'This object could not be deleted because the current user do not have sufficient rights', + 'UI:Error:CannotDeleteBecauseOfDepencies' => 'This object could not be deleted because some manual operations must be performed prior to that', + 'UI:Archive_User_OnBehalfOf_User' => '%1$s on behalf of %2$s', + 'UI:Delete:AutomaticallyDeleted' => 'automatically deleted', + 'UI:Delete:AutomaticResetOf_Fields' => 'automatic reset of field(s): %1$s', + 'UI:Delete:CleaningUpRefencesTo_Object' => 'Cleaning up all references to %1$s...', + 'UI:Delete:CleaningUpRefencesTo_Several_ObjectsOf_Class' => 'Cleaning up all references to %1$d objects of class %2$s...', + 'UI:Delete:Done+' => 'What was done...', + 'UI:Delete:_Name_Class_Deleted' => '%1$s - %2$s deleted.', + 'UI:Delete:ConfirmDeletionOf_Name' => 'Deletion of %1$s', + 'UI:Delete:ConfirmDeletionOf_Count_ObjectsOf_Class' => 'Deletion of %1$d objects of class %2$s', + 'UI:Delete:ShouldBeDeletedAtomaticallyButNotAllowed' => 'Should be automaticaly deleted, but you are not allowed to do so', + 'UI:Delete:MustBeDeletedManuallyButNotAllowed' => 'Must be deleted manually - but you are not allowed to delete this object, please contact your application admin', + 'UI:Delete:WillBeDeletedAutomatically' => 'Will be automaticaly deleted', + 'UI:Delete:MustBeDeletedManually' => 'Must be deleted manually', + 'UI:Delete:CannotUpdateBecause_Issue' => 'Should be automatically updated, but: %1$s', + 'UI:Delete:WillAutomaticallyUpdate_Fields' => 'will be automaticaly updated (reset: %1$s)', + 'UI:Delete:Count_Objects/LinksReferencing_Object' => '%1$d objects/links are referencing %2$s', + 'UI:Delete:Count_Objects/LinksReferencingTheObjects' => '%1$d objects/links are referencing some of the objects to be deleted', + 'UI:Delete:ReferencesMustBeDeletedToEnsureIntegrity' => 'To ensure Database integrity, any reference should be further eliminated', + 'UI:Delete:Consequence+' => 'What will be done', + 'UI:Delete:SorryDeletionNotAllowed' => 'Sorry, you are not allowed to delete this object, see the detailed explanations above', + 'UI:Delete:PleaseDoTheManualOperations' => 'Please perform the manual operations listed above prior to requesting the deletion of this object', + 'UI:Delect:Confirm_Object' => 'Please confirm that you want to delete %1$s.', + 'UI:Delect:Confirm_Count_ObjectsOf_Class' => 'Please confirm that you want to delete the following %1$d objects of class %2$s.', + 'UI:WelcomeToITop' => 'Welcome to iTop', + 'UI:DetailsPageTitle' => 'iTop - %1$s - %2$s details', + 'UI:ErrorPageTitle' => 'iTop - Error', + 'UI:ObjectDoesNotExist' => 'Sorry, this object does not exist (or you are not allowed to view it).', + 'UI:SearchResultsPageTitle' => 'iTop - Search Results', + 'UI:Search:NoSearch' => 'Nothing to search for', + 'UI:FullTextSearchTitle_Text' => 'Results for "%1$s":', + 'UI:Search:Count_ObjectsOf_Class_Found' => '%1$d object(s) of class %2$s found.', + 'UI:Search:NoObjectFound' => 'No object found.', + 'UI:ModificationPageTitle_Object_Class' => 'iTop - %1$s - %2$s modification', + 'UI:ModificationTitle_Class_Object' => 'Modification of %1$s: %2$s', + 'UI:ClonePageTitle_Object_Class' => 'iTop - Clone %1$s - %2$s modification', + 'UI:CloneTitle_Class_Object' => 'Clone of %1$s: %2$s', + 'UI:CreationPageTitle_Class' => 'iTop - Creation of a new %1$s ', + 'UI:CreationTitle_Class' => 'Creation of a new %1$s', + 'UI:Class_Object_NotUpdated' => 'No change detected, %1$s (%2$s) has not been modified.', + 'UI:Class_Object_Updated' => '%1$s (%2$s) updated.', + 'UI:BulkDeletePageTitle' => 'iTop - Bulk Delete', + 'UI:BulkDeleteTitle' => 'Select the objects you want to delete:', + 'UI:PageTitle:ObjectCreated' => 'iTop Object Created.', + 'UI:Title:Object_Of_Class_Created' => '%1$s - %2$s created.', + 'UI:Apply_Stimulus_On_Object_In_State_ToTarget_State' => 'Applying %1$s on object: %2$s in state %3$s to target state: %4$s.', + 'UI:PageTitle:FatalError' => 'iTop - Fatal Error', + 'UI:FatalErrorMessage' => 'Fatal error, iTop cannot continue.', + 'UI:Error_Details' => 'Error: %1$s.', + + 'UI:PageTitle:ClassProjections' => 'iTop user management - class projections', + 'UI:PageTitle:ProfileProjections' => 'iTop user management - profile projections', + 'UI:UserManagement:Class' => 'Class', + 'UI:UserManagement:Class+' => 'Class of objects', + 'UI:UserManagement:ProjectedObject' => 'Object', + 'UI:UserManagement:ProjectedObject+' => 'Projected object', + 'UI:UserManagement:AnyObject' => '* any *', + 'UI:UserManagement:User' => 'User', + 'UI:UserManagement:User+' => 'User involved in the projection', + 'UI:UserManagement:Profile' => 'Profile', + 'UI:UserManagement:Profile+' => 'Profile in which the projection is specified', + 'UI:UserManagement:Action:Read' => 'Read', + 'UI:UserManagement:Action:Read+' => 'Read/display objects', + 'UI:UserManagement:Action:Modify' => 'Modify', + 'UI:UserManagement:Action:Modify+' => 'Create and edit (modify) objects', + 'UI:UserManagement:Action:Delete' => 'Delete', + 'UI:UserManagement:Action:Delete+' => 'Delete objects', + 'UI:UserManagement:Action:BulkRead' => 'Bulk Read (Export)', + 'UI:UserManagement:Action:BulkRead+' => 'List objects or export massively', + 'UI:UserManagement:Action:BulkModify' => 'Bulk Modify', + 'UI:UserManagement:Action:BulkModify+' => 'Massively create/edit (CSV import)', + 'UI:UserManagement:Action:BulkDelete' => 'Bulk Delete', + 'UI:UserManagement:Action:BulkDelete+' => 'Massively delete objects', + 'UI:UserManagement:Action:Stimuli' => 'Stimuli', + 'UI:UserManagement:Action:Stimuli+' => 'Allowed (compound) actions', + 'UI:UserManagement:Action' => 'Action', + 'UI:UserManagement:Action+' => 'Action performed by the user', + 'UI:UserManagement:TitleActions' => 'Actions', + 'UI:UserManagement:Permission' => 'Permission', + 'UI:UserManagement:Permission+' => 'User\'s permissions', + 'UI:UserManagement:Attributes' => 'Attributes', + 'UI:UserManagement:ActionAllowed:Yes' => 'Yes', + 'UI:UserManagement:ActionAllowed:No' => 'No', + 'UI:UserManagement:AdminProfile+' => 'Administrators have full read/write access to all objects in the database.', + 'UI:UserManagement:NoLifeCycleApplicable' => 'N/A', + 'UI:UserManagement:NoLifeCycleApplicable+' => 'No lifecycle has been defined for this class', + 'UI:UserManagement:GrantMatrix' => 'Grant Matrix', + 'UI:USerManagement:LinkBetween_User_And_Profile' => 'Link between %1$s and %2$s', + )); diff --git a/dictionaries/fr.dictionary.itop.ui.php b/dictionaries/fr.dictionary.itop.ui.php index ebeef3e73..cc1b1a881 100644 --- a/dictionaries/fr.dictionary.itop.ui.php +++ b/dictionaries/fr.dictionary.itop.ui.php @@ -313,6 +313,7 @@ Dict::Add('FR FR', 'French', 'Français', array( 'UI:Button:Apply' => 'Appliquer', 'UI:Button:Back' => ' << Retour ', 'UI:Button:Next' => ' Suite >> ', + 'UI:Button:Finish' => ' Terminer ', 'UI:Button:DoImport' => ' Lancer l\'import ! ', 'UI:Button:Done' => ' Terminé ', 'UI:Button:SimulateImport' => ' Simuler l\'import ', @@ -324,10 +325,11 @@ Dict::Add('FR FR', 'French', 'Français', array( 'UI:Button:AddToList' => ' << Ajouter ', 'UI:Button:RemoveFromList' => ' Enlever >> ', 'UI:Button:FilterList' => ' Filtrer... ', + 'UI:Button:Delete' => 'Supprimer ! ', 'UI:SearchToggle' => 'Recherche', - 'UI:ClickToCreateNew' => 'Cliquez ici pour créer un nouveau %1$s', + 'UI:ClickToCreateNew' => 'Cliquez ici pour créer un nouvel objet de type %1$s', 'UI:NoObjectToDisplay' => 'Aucun objet à afficher.', 'UI:Error:MandatoryTemplateParameter_object_id' => 'Le paramètre object_id est obligatoire quand link_attr est spécifié. Vérifiez la définition du modèle.', 'UI:Error:MandatoryTemplateParameter_link_attr' => 'Le paramètre target_attr est obligatoire quand link_attr est spécifié. Vérifiez la définition du modèle.', @@ -344,6 +346,21 @@ Dict::Add('FR FR', 'French', 'Français', array( 'UI:Error:UploadStoppedByExtension_FileName' => 'Téléchargement arrêté à cause de l\'extension. (Nom du fichier original = "%1$s").', 'UI:Error:UploadFailedUnknownCause_Code' => 'Le téléchargement a échoué pour une raison inconnue. (Code d\'erreur = "%1$s").', + 'UI:Error:1ParametersMissing' => 'Erreur: Pour effectuer cette opération il manque le paramètre suivant: %1$s.', + 'UI:Error:2ParametersMissing' => 'Erreur: Pour effectuer cette opération il manque les paramètres suivants: %1$s and %2$s.', + 'UI:Error:3ParametersMissing' => 'Erreur: Pour effectuer cette opération il manque les paramètres suivants: %1$s, %2$s and %3$s.', + 'UI:Error:4ParametersMissing' => 'Erreur: Pour effectuer cette opération il manque les paramètres suivants: %1$s, %2$s, %3$s and %4$s.', + 'UI:Error:IncorrectOQLQuery_Message' => 'Erreur: requête OQL incorrecte: %1$s', + 'UI:Error:AnErrorOccuredWhileRunningTheQuery_Message' => 'Une erreur s\'est produite en exécutant la requête: %1$s', + 'UI:Error:ObjectAlreadyUpdated' => 'Erreur: l\'objet a déjà été mis à jour.', + 'UI:Error:ObjectCannotBeUpdated' => 'Erreur: l\'objet ne peut pas être mis à jour.', + 'UI:Error:ObjectsAlreadyDeleted' => 'Erreur: les objets ont déjà été supprimés !', + 'UI:Error:BulkDeleteNotAllowedOn_Class' => 'Vous n\'êtes pas autorisé à faire une suppression massive sur les objets de type %1$s', + 'UI:Error:DeleteNotAllowedOn_Class' => 'Vous n\'êtes pas autorisé supprimer des objets de type %1$s', + 'UI:Error:ObjectAlreadyCloned' => 'Erreur: l\'objet a déjà été dupliqué !', + 'UI:Error:ObjectAlreadyCreated' => 'Erreur: l\'objet a déjà été créé !', + 'UI:Error:Invalid_Stimulus_On_Object_In_State' => 'Erreur: le stimulus "%1$s" n\'est pas valide pour l\'objet %2$s dans l\'état "%3$s".', + 'UI:GroupBy:Count' => 'Nombre', 'UI:GroupBy:Count+' => 'Nombre d\'éléments', 'UI:CountOfObjects' => '%1$d objets correspondants aux critères.', @@ -360,8 +377,8 @@ Dict::Add('FR FR', 'French', 'Français', array( 'UI:Menu:New' => 'Créer...', 'UI:Menu:Add' => 'Ajouter...', 'UI:Menu:Manage' => 'Gérer...', - 'UI:Menu:EMail' => 'eMail', - 'UI:Menu:CSVExport' => 'Export CSV', + 'UI:Menu:EMail' => 'Envoyer par eMail', + 'UI:Menu:CSVExport' => 'Exporter en CSV', 'UI:Menu:Modify' => 'Modifier...', 'UI:Menu:Delete' => 'Supprimer...', 'UI:Menu:Manage' => 'Gérer...', @@ -380,6 +397,9 @@ Dict::Add('FR FR', 'French', 'Français', array( 'UI:OQLQueryTab' => 'Requête OQL', 'UI:SimpleSearchTab' => 'Recherche simple', 'UI:Details+' => 'Détails', + 'UI:SearchValue:Any' => '* Indifférent *', + 'UI:SearchValue:Mixed' => '* Plusieurs *', + 'UI:SelectOne' => '-- choisir une valeur --', 'UI:Login:Welcome' => 'Bienvenue dans iTop!', 'UI:Login:IncorrectLoginPassword' => 'Mot de passe ou identifiant incorrect.', 'UI:Login:IdentifyYourself' => 'Merci de vous identifier', @@ -465,20 +485,20 @@ Dict::Add('FR FR', 'French', 'Français', array( 'UI:RunQuery:HeaderOQLExpression' => 'Requête OQL', 'UI:RunQuery:HeaderOQLExpression+' => 'La requête en OQL', 'UI:RunQuery:ExpressionToEvaluate' => 'Requête à exécuter : ', - 'UI:RunQuery:MoreInfo' => 'Plus d\'information sur le requête: ', + 'UI:RunQuery:MoreInfo' => 'Plus d\'information sur le requête : ', 'UI:RunQuery:DevelopedQuery' => 'Requête OQL décompilée : ', 'UI:RunQuery:SerializedFilter' => 'Version sérialisée : ', - 'UI:RunQuery:Error' => 'Une erreur s\'est produite durant l\'exécution de la requête: %1$s', + 'UI:RunQuery:Error' => 'Une erreur s\'est produite durant l\'exécution de la requête : %1$s', 'UI:Schema:Title' => 'Modèle de données iTop', 'UI:Schema:CategoryMenuItem' => 'Catégorie %1$s', 'UI:Schema:Relationships' => 'Relations', - 'UI:Schema:AbstractClass' => 'Class abstraite: les objets de cette classe ne peuvent pas être instanciés.', - 'UI:Schema:NonAbstractClass' => 'Class concrète: les objets de cette classe peuvent être instanciés.', + 'UI:Schema:AbstractClass' => 'Classe abstraite : les objets de cette classe ne peuvent pas être instanciés.', + 'UI:Schema:NonAbstractClass' => 'Classe concrète : les objets de cette classe peuvent être instanciés.', 'UI:Schema:ClassHierarchyTitle' => 'Hiérachie des classes', 'UI:Schema:AllClasses' => 'Toutes les classes', 'UI:Schema:ExternalKey_To' => 'Clef externe vers %1$s', - 'UI:Schema:Columns_Description' => 'Colonnes: %1$s', + 'UI:Schema:Columns_Description' => 'Colonnes : %1$s', 'UI:Schema:Default_Description' => 'Valeur par défaut: "%1$s"', 'UI:Schema:NullAllowed' => 'Null autorisé', 'UI:Schema:NullNotAllowed' => 'Null interdit', @@ -516,8 +536,8 @@ Dict::Add('FR FR', 'French', 'Français', array( 'UI:Schema:RelationDoesNotPropagate' => '%1$s: ne se propage pas (%2$d niveaux), requête: %3$s', 'UI:Schema:Class_ReferencingClasses_From_By' => '%1$s est référencé par la classe %2$s via le champ %3$s', 'UI:Schema:Class_IsLinkedTo_Class_Via_ClassAndAttribute' => '%1$s est lié à la classe %2$s via %3$s::%4$s', - 'UI:Schema:Links:1-n' => 'Classes pointant sur %1$s (liens 1:n):', - 'UI:Schema:Links:n-n' => 'Classes liées à %1$s (liens n:n):', + 'UI:Schema:Links:1-n' => 'Classes pointant sur %1$s (liens 1:n) :', + 'UI:Schema:Links:n-n' => 'Classes liées à %1$s (liens n:n) :', 'UI:Schema:Links:All' => 'Graphe de toutes les classes liées', 'UI:Schema:NoLifeCyle' => 'Aucun cycle de vie n\'est défini pour cette classe.', 'UI:Schema:LifeCycleTransitions' => 'Transitions', @@ -542,7 +562,101 @@ Dict::Add('FR FR', 'French', 'Français', array( 'UI:Message:EmptyList:UseAdd' => 'La liste est vide, utilisez le bouton "Ajouter..." pour ajouter des objets.', 'UI:Message:EmptyList:UseSearchForm' => 'Utilisez le formulaire de recherche ci-dessus pour trouver les objets à ajouter.', - 'UI:Wizard:FinalStepTitle' => 'Dernière étape: confirmation' + 'UI:Wizard:FinalStepTitle' => 'Dernière étape: confirmation', + 'UI:Title:DeletionOf_Object' => 'Suppression de %1$s', + 'UI:Title:BulkDeletionOf_Count_ObjectsOf_Class' => 'Suppression massive de %1$d objets de type %2$s', + 'UI:Delete:NotAllowedToDelete' => 'Vous n\'êtes pas autorisé à supprimer cet objet', + 'UI:Delete:NotAllowedToUpdate_Fields' => 'Vous n\'êtes pas autorisé à mettre à jour les champs suivants : %1$s', + 'UI:Error:NotEnoughRightsToDelete' => 'Cet objet ne peut pas être supprimé car l\'utilisateur courant n\'a pas les droits nécessaires.', + 'UI:Error:CannotDeleteBecauseOfDepencies' => 'Cet objet ne peut pas être supprimé, des opérations manuelles sont nécessaire avant sa suppression.', + 'UI:Archive_User_OnBehalfOf_User' => '%1$s pour %2$s', + 'UI:Delete:AutomaticallyDeleted' => 'supprimé automatiquement', + 'UI:Delete:AutomaticResetOf_Fields' => 'mise à jour automatique des champ(s): %1$s', + 'UI:Delete:CleaningUpRefencesTo_Object' => 'Suppression de toutes les références vers %1$s...', + 'UI:Delete:CleaningUpRefencesTo_Several_ObjectsOf_Class' => 'Supression de toutes les références vers les %1$d objets de type %2$s...', + 'UI:Delete:Done+' => 'Ce qui a été effectué...', + 'UI:Delete:_Name_Class_Deleted' => ' %2$s %1$s supprimé.', + 'UI:Delete:ConfirmDeletionOf_Name' => 'Suppression de %1$s', + 'UI:Delete:ConfirmDeletionOf_Count_ObjectsOf_Class' => 'Supression de %1$d objets de type %2$s', + 'UI:Delete:ShouldBeDeletedAtomaticallyButNotAllowed' => 'Devrait être supprimé automatiquement, mais vous n\'avez pas le droit d\'effectuer cette opération.', + 'UI:Delete:MustBeDeletedManuallyButNotAllowed' => 'Doit être supprimé manuellement - mais vous n\'avez pas le droit de supprimer cet objet, contactez votre administrateur pour régler ce problème', + 'UI:Delete:WillBeDeletedAutomatically' => 'Sera supprimé automatiquement', + 'UI:Delete:MustBeDeletedManually' => 'Doit être supprimé manuellement', + 'UI:Delete:CannotUpdateBecause_Issue' => 'Devrait être mis à jour automatiquement, mais: %1$s', + 'UI:Delete:WillAutomaticallyUpdate_Fields' => 'Va être mis à jour automatiquement (champs impactés : %1$s)', + 'UI:Delete:Count_Objects/LinksReferencing_Object' => '%1$d objets ou liens font référence à %2$s', + 'UI:Delete:Count_Objects/LinksReferencingTheObjects' => '%1$d objets ou liens font référence à certain des objets à supprimer', + 'UI:Delete:ReferencesMustBeDeletedToEnsureIntegrity' => 'pour garantir l\'intégrité de la base de données, toutes les références doivent être supprimées.', + 'UI:Delete:Consequence+' => 'Ce qui va être effectué', + 'UI:Delete:SorryDeletionNotAllowed' => 'Désolé, vous n\'êtes pas autorisé à supprimer cette objet. Voir les explications détaillées ci-dessus.', + 'UI:Delete:PleaseDoTheManualOperations' => 'Vous devez effectuer les opération manuelles listées ci-dessus avant de pourvoir supprimer cet objet.', + 'UI:Delect:Confirm_Object' => 'Confirmez que vous voulez bien supprimer %1$s.', + 'UI:Delect:Confirm_Count_ObjectsOf_Class' => 'Confirmez que vous voulez bien supprimer les %1$d objets de type %2$s ci-dessous.', + 'UI:WelcomeToITop' => 'Bienvenue dans iTop', + 'UI:DetailsPageTitle' => 'iTop - %2$s - Détails de %1$s', + 'UI:ErrorPageTitle' => 'iTop - Erreur', + 'UI:ObjectDoesNotExist' => 'Désolé cet objet n\'existe pas (où vous n\'êtes pas autorisé à l\'afficher).', + 'UI:SearchResultsPageTitle' => 'iTop - Résultats de la recherche', + 'UI:Search:NoSearch' => 'Rien à rechercher', + 'UI:FullTextSearchTitle_Text' => 'Résultats pour "%1$s" :', + 'UI:Search:Count_ObjectsOf_Class_Found' => 'Trouvé %1$d objet(s) de type %2$s.', + 'UI:Search:NoObjectFound' => 'Aucun objet trouvé.', + 'UI:ModificationPageTitle_Object_Class' => 'iTop - %2$s - Modification de %1$s', + 'UI:ModificationTitle_Class_Object' => '%1$s - Modification de %2$s', + 'UI:ClonePageTitle_Object_Class' => 'iTop - %2$s - Duplication de %1$s', + 'UI:CloneTitle_Class_Object' => ' %1$s - Duplication de %2$s', + 'UI:CreationPageTitle_Class' => 'iTop - Création d\'un objet de type %1$s ', + 'UI:CreationTitle_Class' => 'Création d\'un objet de type %1$s', + 'UI:Class_Object_NotUpdated' => 'Aucun changement détecté, %2$s (type : %2$s) n\'a pas été modifié.', + 'UI:Class_Object_Updated' => '%1$s (%2$s) mise à jour.', + 'UI:BulkDeletePageTitle' => 'iTop - Supression massive', + 'UI:BulkDeleteTitle' => 'Sélectionnez les objets à supprimer:', + 'UI:PageTitle:ObjectCreated' => 'iTop objet créé.', + 'UI:Title:Object_Of_Class_Created' => '%2$s - %1$s créé(e).', + 'UI:Apply_Stimulus_On_Object_In_State_ToTarget_State' => '%1$s de %2$s de l\'état %3$s vers l\'état %4$s.', + 'UI:PageTitle:FatalError' => 'iTop - Erreur Fatale', + 'UI:FatalErrorMessage' => 'Erreur fatale, iTop ne peut pas continuer.', + 'UI:Error_Details' => 'Erreur: %1$s.', + + 'UI:PageTitle:ClassProjections' => 'iTop gestion des utilisateurs - projections des classes', + 'UI:PageTitle:ProfileProjections' => 'iTop gestion des utilisateurs - projections des profils', + 'UI:UserManagement:Class' => 'Type', + 'UI:UserManagement:Class+' => 'Type des objets', + 'UI:UserManagement:ProjectedObject' => 'Objet', + 'UI:UserManagement:ProjectedObject+' => 'L\'objet projeté', + 'UI:UserManagement:AnyObject' => '* indifférent *', + 'UI:UserManagement:User' => 'Utilisateur', + 'UI:UserManagement:User+' => 'L\'utilisateur', + 'UI:UserManagement:Profile' => 'Profil', + 'UI:UserManagement:Profile+' => 'Profil dans lequel la projection est définie', + 'UI:UserManagement:Action:Read' => 'Lecture', + 'UI:UserManagement:Action:Read+' => 'Lecture et affichage d\'un objet', + 'UI:UserManagement:Action:Modify' => 'Modification', + 'UI:UserManagement:Action:Modify+' => 'Création et modification d\'un objet', + 'UI:UserManagement:Action:Delete' => 'Suppression', + 'UI:UserManagement:Action:Delete+' => 'Supression d\'un objet', + 'UI:UserManagement:Action:BulkRead' => 'Lecture en masse (export)', + 'UI:UserManagement:Action:BulkRead+' => 'Export de liste d\'objets', + 'UI:UserManagement:Action:BulkModify' => 'Modification en masse', + 'UI:UserManagement:Action:BulkModify+' => 'Création et modification de plusieurs objets (import CSV)', + 'UI:UserManagement:Action:BulkDelete' => 'Suppression en masse', + 'UI:UserManagement:Action:BulkDelete+' => 'Suppression de plusieurs objets', + 'UI:UserManagement:Action:Stimuli' => 'Stimuli', + 'UI:UserManagement:Action:Stimuli+' => 'Actions autorisées', + 'UI:UserManagement:Action' => 'Action', + 'UI:UserManagement:Action+' => 'l\'action effectuée par l\'utilisateur', + 'UI:UserManagement:TitleActions' => 'Actions', + 'UI:UserManagement:Permission' => 'Permission', + 'UI:UserManagement:Permission+' => 'Les droits de l\'utilisateur', + 'UI:UserManagement:Attributes' => 'Champs', + 'UI:UserManagement:ActionAllowed:Yes' => 'Oui', + 'UI:UserManagement:ActionAllowed:No' => 'Non', + 'UI:UserManagement:AdminProfile+' => 'Les administrateurs ont un accès total à tous les objets de la base de données.', + 'UI:UserManagement:NoLifeCycleApplicable' => 'N/A', + 'UI:UserManagement:NoLifeCycleApplicable+' => 'Aucun cycle de vie n\'est défini pour ce type d\'objets.', + 'UI:UserManagement:GrantMatrix' => 'Matrice des droits', + 'UI:USerManagement:LinkBetween_User_And_Profile' => 'Lien entre %1$s et %2$s', + )); ?> diff --git a/pages/UI.php b/pages/UI.php index 2185c8cf8..46b7329cb 100644 --- a/pages/UI.php +++ b/pages/UI.php @@ -28,7 +28,7 @@ function DeleteObjects(WebPage $oP, $sClass, $aObjects, $bDeleteConfirmed) $aTotalDeletedObjs[$sRemoteClass][$iId]['auto_delete'] = $aData['auto_delete']; if (!$bDeleteAllowed) { - $aTotalDeletedObjs[$sRemoteClass][$iId]['issue'] = 'not allowed to delete this object'; + $aTotalDeletedObjs[$sRemoteClass][$iId]['issue'] = Dict::S('UI:Delete:NotAllowedToDelete'); $bFoundStopper = true; } else @@ -63,9 +63,10 @@ function DeleteObjects(WebPage $oP, $sClass, $aObjects, $bDeleteConfirmed) $aExtKeyLabels[] = $aRemoteAttDef->GetLabel(); } $aResetedObjs[$sRemoteClass][$iId]['attributes_list'] = implode(', ', $aExtKeyLabels); + $aTotalResetedObjs[$sRemoteClass][$iId]['attributes_list'] = $aResetedObjs[$sRemoteClass][$iId]['attributes_list']; if (count($aForbiddenKeys) > 0) { - $aTotalResetedObjs[$sRemoteClass][$iId]['issue'] = 'you are not allowed to update some fields: '.implode(', ', $aForbiddenKeys); + $aTotalResetedObjs[$sRemoteClass][$iId]['issue'] = Dict::Format('UI:Delete:NotAllowedToUpdate_Fields',implode(', ', $aForbiddenKeys)); } else { @@ -82,20 +83,20 @@ function DeleteObjects(WebPage $oP, $sClass, $aObjects, $bDeleteConfirmed) if (count($aObjects) == 1) { $oObj = $aObjects[0]; - $oP->add("

Deletion of ".$oObj->GetName()."

\n"); + $oP->add("

".Dict::Format('UI:Title:DeletionOf_Object', $oObj->GetName())."

\n"); } else { - $oP->add("

Deletion of ".count($aObjects)." objects of class $sClass.

\n"); + $oP->add("

".Dict::Format('UI:Title:BulkDeletionOf_Count_ObjectsOf_Class', count($aObjects), MetaModel::GetName($sClass))."

\n"); } // Security - do not allow the user to force a forbidden delete by the mean of page arguments... if ($bFoundStopper) { - throw new SecurityException('This object could not be deleted because the current user do not have sufficient rights'); + throw new SecurityException(Dict::S('UI:Error:NotEnoughRightsToDelete')); } if ($bFoundManual) { - throw new SecurityException('This object could not be deleted because some manual operations must be performed prior to that'); + throw new SecurityException(Dict::S('UI:Error:CannotDeleteBecauseOfDepencies')); } // Prepare the change reporting @@ -104,7 +105,7 @@ function DeleteObjects(WebPage $oP, $sClass, $aObjects, $bDeleteConfirmed) $oMyChange->Set("date", time()); if (UserRights::GetUser() != UserRights::GetRealUser()) { - $sUserString = UserRights::GetRealUser()." on behalf of ".UserRights::GetUser(); + $sUserString = Dict::Format('UI:Archive_User_OnBehalfOf_User', UserRights::GetRealUser(), UserRights::GetUser()); } else { @@ -125,7 +126,7 @@ function DeleteObjects(WebPage $oP, $sClass, $aObjects, $bDeleteConfirmed) $aDisplayData[] = array( 'class' => MetaModel::GetName(get_class($oToDelete)), 'object' => $oToDelete->GetHyperLink(), - 'consequence' => 'automatically deleted', + 'consequence' => Dict::S('UI:Delete:AutomaticallyDeleted'), ); $oToDelete->DBDeleteTracked($oMyChange); @@ -142,7 +143,7 @@ function DeleteObjects(WebPage $oP, $sClass, $aObjects, $bDeleteConfirmed) $aDisplayData[] = array( 'class' => MetaModel::GetName(get_class($oToReset)), 'object' => $oToReset->GetHyperLink(), - 'consequence' => 'automatic reset of: '.$aData['attributes_list'], + 'consequence' => Dict::Format('UI:Delete:AutomaticResetOf_Fields', $aData['attributes_list']), ); foreach ($aData['attributes'] as $sRemoteExtKey => $aRemoteAttDef) @@ -160,16 +161,16 @@ function DeleteObjects(WebPage $oP, $sClass, $aObjects, $bDeleteConfirmed) if (count($aObjects) == 1) { $oObj = $aObjects[0]; - $oP->p('Cleaning up any reference to '.$oObj->GetName().'...'); + $oP->p(Dict::Format('UI:Delete:CleaningUpRefencesTo_Object', $oObj->GetName())); } else { - $oP->p("Cleaning up any reference to the ".count($aObjects)." objects of class $sClass.\n"); + $oP->p(Dict::Format('UI:Delete:CleaningUpRefencesTo_Several_ObjectsOf_Class', count($aObjects), MetaModel::GetName($sClass))); } $aDisplayConfig = array(); $aDisplayConfig['class'] = array('label' => 'Class', 'description' => ''); $aDisplayConfig['object'] = array('label' => 'Object', 'description' => ''); - $aDisplayConfig['consequence'] = array('label' => 'Done', 'description' => 'What has been done'); + $aDisplayConfig['consequence'] = array('label' => 'Done', 'description' => Dict::S('UI:Delete:Done+')); $oP->table($aDisplayConfig, $aDisplayData); } @@ -178,7 +179,7 @@ function DeleteObjects(WebPage $oP, $sClass, $aObjects, $bDeleteConfirmed) $sName = $oObj->GetName(); $sClassLabel = MetaModel::GetName(get_class($oObj)); $oObj->DBDeleteTracked($oMyChange); - $oP->add("

".$sName." - $sClassLabel deleted

\n"); + $oP->add("

".Dict::Format('UI:Delete:_Name_Class_Deleted')."

\n"); } } else @@ -186,11 +187,11 @@ function DeleteObjects(WebPage $oP, $sClass, $aObjects, $bDeleteConfirmed) if (count($aObjects) == 1) { $oObj = $aObjects[0]; - $oP->add("

Deletion of ".$oObj->GetHyperLink()."

\n"); + $oP->add("

".Dict::Format('UI:Delete:ConfirmDeletionOf_Name', $oObj->GetName())."

\n"); } else { - $oP->add("

Deletion of ".count($aObjects)." objects of class $sClass.

\n"); + $oP->add("

".Dict::Format('UI:Delete:ConfirmDeletionOf_Count_ObjectsOf_Class', count($aObjects), MetaModel::GetName($sClass))."

\n"); } // Explain what should be done // @@ -205,22 +206,22 @@ function DeleteObjects(WebPage $oP, $sClass, $aObjects, $bDeleteConfirmed) { if ($bAutoDel) { - $sConsequence = 'Should be automaticaly deleted, but you are not allowed to do so'; + $sConsequence = Dict::S('UI:Delete:ShouldBeDeletedAtomaticallyButNotAllowed'); } else { - $sConsequence = 'Must be deleted manually - you are not allowed to delete this object, please contact your application admin'; + $sConsequence = Dict::S('UI:Delete:MustBeDeletedManuallyButNotAllowed'); } } else { if ($bAutoDel) { - $sConsequence = 'Will be automaticaly deleted'; + $sConsequence = Dict::S('UI:Delete:WillBeDeletedAutomatically'); } else { - $sConsequence = 'Must be deleted manually'; + $sConsequence = Dict::S('UI:Delete:MustBeDeletedManually'); } } $aDisplayData[] = array( @@ -237,11 +238,11 @@ function DeleteObjects(WebPage $oP, $sClass, $aObjects, $bDeleteConfirmed) $oToReset = $aData['to_reset']; if (array_key_exists('issue', $aData)) { - $sConsequence = "Should be automatically updated, but: ".$aData['issue']; + $sConsequence = Dict::Format('UI:Delete:CannotUpdateBecause_Issue', $aData['issue']); } else { - $sConsequence = "will be automaticaly updated (reset: ".$aData['attributes_list'].")"; + $sConsequence = Dict::Format('UI:Delete:WillAutomaticallyUpdate_Fields', $aData['attributes_list']); } $aDisplayData[] = array( 'class' => MetaModel::GetName(get_class($oToReset)), @@ -256,18 +257,18 @@ function DeleteObjects(WebPage $oP, $sClass, $aObjects, $bDeleteConfirmed) if (count($aObjects) == 1) { $oObj = $aObjects[0]; - $oP->p("$iTotalTargets objects/links are referencing ".$oObj->GetName()); + $oP->p(Dict::Format('UI:Delete:Count_Objects/LinksReferencing_Object', $iTotalTargets, $oObj->GetName())); } else { - $oP->p("$iTotalTargets objects/links are referencing some of the objects to be deleted"); + $oP->p(Dict::Format('UI:Delete:Count_Objects/LinksReferencingTheObjects', $iTotalTargets)); } - $oP->p('To ensure Database integrity, any reference should be further eliminated'); + $oP->p(Dict::S('UI:Delete:ReferencesMustBeDeletedToEnsureIntegrity')); $aDisplayConfig = array(); $aDisplayConfig['class'] = array('label' => 'Class', 'description' => ''); $aDisplayConfig['object'] = array('label' => 'Object', 'description' => ''); - $aDisplayConfig['consequence'] = array('label' => 'Consequence', 'description' => 'What will happen to this object'); + $aDisplayConfig['consequence'] = array('label' => 'Consequence', 'description' => Dict::S('UI:Delete:Consequence+')); $oP->table($aDisplayConfig, $aDisplayData); } @@ -275,15 +276,15 @@ function DeleteObjects(WebPage $oP, $sClass, $aObjects, $bDeleteConfirmed) { if ($bFoundStopper) { - $oP->p("Sorry, you are not allowed to delete this object, please see detailed explanations above"); + $oP->p(Dict::S('UI:Delete:SorryDeletionNotAllowed')); } elseif ($bFoundManual) { - $oP->p("Please do the manual operations requested above prior to requesting the deletion of this object"); + $oP->p(Dict::S('UI:Delete:PleaseDoTheManualOperations')); } $oP->add("
\n"); - $oP->add("\n"); - $oP->add("\n"); + $oP->add("\n"); + $oP->add("\n"); $oP->add("
\n"); } else @@ -292,18 +293,18 @@ function DeleteObjects(WebPage $oP, $sClass, $aObjects, $bDeleteConfirmed) { $oObj = $aObjects[0]; $id = $oObj->GetKey(); - $oP->p("Please confirm that you want to delete ".$oObj->GetHyperLink()); + $oP->p('

'.Dict::Format('UI:Delect:Confirm_Object', $oObj->GetHyperLink()).'

'); $oP->add("
\n"); $oP->add("\n"); $oP->add("\n"); $oP->add("\n"); - $oP->add("\n"); - $oP->add("\n"); + $oP->add("\n"); + $oP->add("\n"); $oP->add("
\n"); } else { - $oP->add("

Please confirm that you want to delete the following ".count($aObjects)." objects of class $sClass.

\n"); + $oP->p('

'.Dict::Format('UI:Delect:Confirm_Count_ObjectsOf_Class', count($aObjects), MetaModel::GetName($sClass)).'

'); $oSet = CMDBobjectSet::FromArray($sClass, $aObjects); CMDBAbstractObject::DisplaySet($oP, $oSet, array('display_limit' => false, 'menu' => false)); $oP->add("
\n"); @@ -313,8 +314,8 @@ function DeleteObjects(WebPage $oP, $sClass, $aObjects, $bDeleteConfirmed) { $oP->add("GetKey()."\">\n"); } - $oP->add("\n"); - $oP->add("\n"); + $oP->add("\n"); + $oP->add("\n"); $oP->add("
\n"); } } @@ -363,7 +364,7 @@ try LoginWebPage::DoLogin(); // Check user rights and prompt if needed - $oP = new iTopWebPage("Welcome to ITop", $currentOrganization); + $oP = new iTopWebPage(Dict::S('UI:WelcomeToITop'), $currentOrganization); // From now on the context is limited to the the selected organization ?? if ($iActiveNodeId != -1) @@ -386,21 +387,18 @@ try $oBlock->Display($oP, 0); if ( empty($sClass) || empty($id)) // TO DO: check that the class name is valid ! { - $oP->add("

'class' and 'id' parameters must be specifed for this operation.

\n"); + throw new ApplicationException(Dict::Format('UI:Error:2ParametersMissing', 'class', 'id')); + } + $oObj = $oContext->GetObject($sClass, $id); + if ($oObj != null) + { + $oP->set_title(Dict::Format('UI:DetailsPageTitle', $oObj->GetDisplayName(), $sClassLabel)); + $oObj->DisplayDetails($oP); } else { - $oObj = $oContext->GetObject($sClass, $id); - if ($oObj != null) - { - $oP->set_title("iTop - ".$oObj->GetDisplayName()." - $sClassLabel details"); - $oObj->DisplayDetails($oP); - } - else - { - $oP->set_title("iTop - Error"); - $oP->add("

Sorry this object does not exist (or you are not allowed to view it).

\n"); - } + $oP->set_title(Dict::S('UI:ErrorPageTitle')); + $oP->P(Dict::S('UI:ObjectDoesNotExist')); } break; @@ -411,100 +409,13 @@ try $bSearchForm = utils::ReadParam('search_form', true); if (empty($sOQLClass)) { - $oP->set_title("iTop - Error"); - $oP->add("

'oql_class' must be specifed for this operation.

\n"); + throw new ApplicationException(Dict::Format('UI:Error:1ParametersMissing', 'oql_class')); } - else + $oP->set_title(Dict::S('UI:SearchResultsPageTitle')); + $sOQL = "SELECT $sOQLClass $sOQLClause"; + try { - $oP->set_title("iTop - Search results"); - $sOQL = "SELECT $sOQLClass $sOQLClause"; - try - { - $oFilter = DBObjectSearch::FromOQL($sOQL); // To Do: Make sure we don't bypass security - $oSet = new DBObjectSet($oFilter); - if ($bSearchForm) - { - $oBlock = new DisplayBlock($oFilter, 'search', false); - $oBlock->Display($oP, 0); - } - if (strtolower($sFormat) == 'csv') - { - $oBlock = new DisplayBlock($oFilter, 'csv', false); - $oBlock->Display($oP, 'csv'); - $oPage->add_ready_script(" $('#csv').css('height', '95%');"); // adjust the size of the block - } - else - { - $oBlock = new DisplayBlock($oFilter, 'list', false); - $oBlock->Display($oP, 1); - } - } - catch(CoreException $e) - { - $oFilter = new DBObjectSearch($sOQLClass); // To Do: Make sure we don't bypass security - $oSet = new DBObjectSet($oFilter); - if ($bSearchForm) - { - $oBlock = new DisplayBlock($oFilter, 'search', false); - $oBlock->Display($oP, 0); - } - $oP->P("Error incorrect OQL query:"); - $oP->P($e->getHtmlDesc()); - } - catch(Exception $e) - { - $oP->p('An error occured while running the query:'); - $oP->p($e->getMessage()); - } - } - break; - case 'search_form': - $sClass = utils::ReadParam('class', ''); - $sFormat = utils::ReadParam('format', 'html'); - $bSearchForm = utils::ReadParam('search_form', true); - if (empty($sClass)) - { - $oP->set_title("iTop - Error"); - $oP->add("

'class' must be specifed for this operation.

\n"); - } - else - { - $oP->set_title("iTop - Search results"); - $oFilter = $oContext->NewFilter($sClass); - $oSet = new DBObjectSet($oFilter); - if ($bSearchForm) - { - $oBlock = new DisplayBlock($oFilter, 'search', false /* Asynchronous */, array('open' => true)); - $oBlock->Display($oP, 0); - } - if (strtolower($sFormat) == 'csv') - { - $oBlock = new DisplayBlock($oFilter, 'csv', false); - $oBlock->Display($oP, 1); - $oP->add_ready_script(" $('#csv').css('height', '95%');"); // adjust the size of the block - } - else - { - $oBlock = new DisplayBlock($oFilter, 'list', false); - $oBlock->Display($oP, 1); - } - } - break; - - case 'search': - $sFilter = utils::ReadParam('filter', ''); - $sFormat = utils::ReadParam('format', ''); - $bSearchForm = utils::ReadParam('search_form', true); - if (empty($sFilter)) - { - $oP->set_title("iTop - Error"); - $oP->add("

'filter' must be specifed for this operation.

\n"); - } - else - { - $oP->set_title("iTop - Search results"); - // TO DO: limit the search filter by the user context - $oFilter = CMDBSearchFilter::unserialize($sFilter); // TO DO : check that the filter is valid + $oFilter = DBObjectSearch::FromOQL($sOQL); // To Do: Make sure we don't bypass security $oSet = new DBObjectSet($oFilter); if ($bSearchForm) { @@ -515,7 +426,7 @@ try { $oBlock = new DisplayBlock($oFilter, 'csv', false); $oBlock->Display($oP, 'csv'); - $oP->add_ready_script(" $('#csv').css('height', '95%');"); // adjust the size of the block + $oPage->add_ready_script(" $('#csv').css('height', '95%');"); // adjust the size of the block } else { @@ -523,17 +434,92 @@ try $oBlock->Display($oP, 1); } } + catch(CoreException $e) + { + $oFilter = new DBObjectSearch($sOQLClass); // To Do: Make sure we don't bypass security + $oSet = new DBObjectSet($oFilter); + if ($bSearchForm) + { + $oBlock = new DisplayBlock($oFilter, 'search', false); + $oBlock->Display($oP, 0); + } + $oP->P(''.Dict::Format('UI:Error:IncorrectOQLQuery_Message', $e->getHtmlDesc()).''); + } + catch(Exception $e) + { + $oP->P(''.Dict::Format('UI:Error:AnErrorOccuredWhileRunningTheQuery_Message', $e->getMessage()).''); + } + break; + + case 'search_form': + $sClass = utils::ReadParam('class', ''); + $sFormat = utils::ReadParam('format', 'html'); + $bSearchForm = utils::ReadParam('search_form', true); + if (empty($sClass)) + { + throw new ApplicationException(Dict::Format('UI:Error:1ParametersMissing', 'class')); + } + $oP->set_title(Dict::S('UI:SearchResultsPageTitle')); + $oFilter = $oContext->NewFilter($sClass); + $oSet = new DBObjectSet($oFilter); + if ($bSearchForm) + { + $oBlock = new DisplayBlock($oFilter, 'search', false /* Asynchronous */, array('open' => true)); + $oBlock->Display($oP, 0); + } + if (strtolower($sFormat) == 'csv') + { + $oBlock = new DisplayBlock($oFilter, 'csv', false); + $oBlock->Display($oP, 1); + $oP->add_ready_script(" $('#csv').css('height', '95%');"); // adjust the size of the block + } + else + { + $oBlock = new DisplayBlock($oFilter, 'list', false); + $oBlock->Display($oP, 1); + } + break; + + case 'search': + $sFilter = utils::ReadParam('filter', ''); + $sFormat = utils::ReadParam('format', ''); + $bSearchForm = utils::ReadParam('search_form', true); + if (empty($sFilter)) + { + throw new ApplicationException(Dict::Format('UI:Error:1ParametersMissing', 'filter')); + } + $oP->set_title(Dict::S('UI:SearchResultsPageTitle')); + // TO DO: limit the search filter by the user context + $oFilter = CMDBSearchFilter::unserialize($sFilter); // TO DO : check that the filter is valid + $oSet = new DBObjectSet($oFilter); + if ($bSearchForm) + { + $oBlock = new DisplayBlock($oFilter, 'search', false); + $oBlock->Display($oP, 0); + } + if (strtolower($sFormat) == 'csv') + { + $oBlock = new DisplayBlock($oFilter, 'csv', false); + $oBlock->Display($oP, 'csv'); + $oP->add_ready_script(" $('#csv').css('height', '95%');"); // adjust the size of the block + } + else + { + $oBlock = new DisplayBlock($oFilter, 'list', false); + $oBlock->Display($oP, 1); + } break; case 'full_text': $sFullText = trim(utils::ReadParam('text', '')); if (empty($sFullText)) { - $oP->p('Nothing to search.'); + $oP->p(Dict::S('UI:Search:NoSearch')); } else { - $oP->p("

Results for '$sFullText':

\n"); + $oP->set_title(Dict::S('UI:SearchResultsPageTitle')); + $oP->p("

".Dict::Format('UI:FullTextSearchTitle_Text', $sFullText)."

"); $iCount = 0; $iBlock = 0; // Search in full text mode in all the classes @@ -557,7 +543,7 @@ try { $iCount += count($aLeafs); $oP->add("
\n"); - $oP->add("

".Metamodel::GetName($sClassName).": ".count($aLeafs)." object(s) found.

\n"); + $oP->add("

".Dict::Format('UI:Search:Count_ObjectsOf_Class_Found', count($aLeafs), Metamodel::GetName($sClassName))."

\n"); $oP->add("
\n"); $oLeafsFilter->AddCondition('id', $aLeafs, 'IN'); $oBlock = new DisplayBlock($oLeafsFilter, 'list', false); @@ -567,7 +553,7 @@ try } if ($iCount == 0) { - $oP->p('No object found.'); + $oP->p(Dict::S('UI:Search:NoObjectFound')); } } break; @@ -584,37 +570,34 @@ try $id = utils::ReadParam('id', ''); if ( empty($sClass) || empty($id)) // TO DO: check that the class name is valid ! { - $oP->add("

'class' and 'id' parameters must be specifed for this operation.

\n"); + throw new ApplicationException(Dict::Format('UI:Error:2ParametersMissing', 'class', 'id')); + } + // Check if the user can modify this object + $oSearch = new DBObjectSearch($sClass); + $oSearch->AddCondition('id', $id, '='); + $oSet = new CMDBObjectSet($oSearch); + if ($oSet->Count() > 0) + { + $oObj = $oSet->Fetch(); + } + + $bIsModifiedAllowed = (UserRights::IsActionAllowed($sClass, UR_ACTION_MODIFY, $oSet) == UR_ALLOWED_YES); + $bIsReadAllowed = (UserRights::IsActionAllowed($sClass, UR_ACTION_READ, $oSet) == UR_ALLOWED_YES); + if( ($oObj != null) && ($bIsModifiedAllowed) && ($bIsReadAllowed)) + { + $oP->set_title(Dict::Format('UI:ModificationPageTitle_Object_Class', $oObj->GetName(), $sClassLabel)); + $oP->add("
\n"); + $oP->add("

".Dict::Format('UI:ModificationTitle_Class_Object', $sClassLabel, $oObj->GetName())."

\n"); + $oP->add("
\n"); + + $oP->add("
\n"); + $oObj->DisplayModifyForm($oP); + $oP->add("
\n"); } else { - // Check if the user can modify this object - $oSearch = new DBObjectSearch($sClass); - $oSearch->AddCondition('id', $id, '='); - $oSet = new CMDBObjectSet($oSearch); - if ($oSet->Count() > 0) - { - $oObj = $oSet->Fetch(); - } - - $bIsModifiedAllowed = (UserRights::IsActionAllowed($sClass, UR_ACTION_MODIFY, $oSet) == UR_ALLOWED_YES); - $bIsReadAllowed = (UserRights::IsActionAllowed($sClass, UR_ACTION_READ, $oSet) == UR_ALLOWED_YES); - if( ($oObj != null) && ($bIsModifiedAllowed) && ($bIsReadAllowed)) - { - $oP->set_title("iTop - ".$oObj->GetName()." - $sClassLabel modification"); - $oP->add("
\n"); - $oP->add("

Modification of $sClassLabel: ".$oObj->GetName()."

\n"); - $oP->add("
\n"); - - $oP->add("
\n"); - $oObj->DisplayModifyForm($oP); - $oP->add("
\n"); - } - else - { - $oP->set_title("iTop - Error"); - $oP->add("

Sorry this object does not exist (or you are not allowed to view it).

\n"); - } + $oP->set_title(Dict::S('UI:ErrorPageTitle')); + $oP->P(Dict::S('UI:ObjectDoesNotExist')); } break; @@ -624,43 +607,41 @@ try $id = utils::ReadParam('id', ''); if ( empty($sClass) || empty($id)) // TO DO: check that the class name is valid ! { - $oP->add("

'class' and 'id' parameters must be specifed for this operation.

\n"); + throw new ApplicationException(Dict::Format('UI:Error:2ParametersMissing', 'class', 'id')); + } + // Check if the user can modify this object + $oSearch = new DBObjectSearch($sClass); + $oSearch->AddCondition('id', $id, '='); + $oSet = new CMDBObjectSet($oSearch); + if ($oSet->Count() > 0) + { + $oObjToClone = $oSet->Fetch(); + } + + $bIsModifiedAllowed = (UserRights::IsActionAllowed($sClass, UR_ACTION_MODIFY, $oSet) == UR_ALLOWED_YES); + $bIsReadAllowed = (UserRights::IsActionAllowed($sClass, UR_ACTION_READ, $oSet) == UR_ALLOWED_YES); + if( ($oObjToClone != null) && ($bIsModifiedAllowed) && ($bIsReadAllowed)) + { + $oP->add_linked_script("../js/json.js"); + $oP->add_linked_script("../js/forms-json-utils.js"); + $oP->add_linked_script("../js/wizardhelper.js"); + $oP->add_linked_script("../js/wizard.utils.js"); + $oP->add_linked_script("../js/linkswidget.js"); + $oP->add_linked_script("../js/jquery.blockUI.js"); + + $oP->set_title(Dict::Format('UI:ClonePageTitle_Object_Class', $oObj->GetName(), $sClassLabel)); + $oP->add("
\n"); + $oP->add("

".Dict::Format('UI:CloneTitle_Class_Object', $sClassLabel, $oObj->GetName())."

\n"); + $oP->add("
\n"); + + $oP->add("
\n"); + cmdbAbstractObject::DisplayCreationForm($oP, $sClass, $oObjToClone); + $oP->add("
\n"); } else { - // Check if the user can modify this object - $oSearch = new DBObjectSearch($sClass); - $oSearch->AddCondition('id', $id, '='); - $oSet = new CMDBObjectSet($oSearch); - if ($oSet->Count() > 0) - { - $oObjToClone = $oSet->Fetch(); - } - - $bIsModifiedAllowed = (UserRights::IsActionAllowed($sClass, UR_ACTION_MODIFY, $oSet) == UR_ALLOWED_YES); - $bIsReadAllowed = (UserRights::IsActionAllowed($sClass, UR_ACTION_READ, $oSet) == UR_ALLOWED_YES); - if( ($oObjToClone != null) && ($bIsModifiedAllowed) && ($bIsReadAllowed)) - { - $oP->add_linked_script("../js/json.js"); - $oP->add_linked_script("../js/forms-json-utils.js"); - $oP->add_linked_script("../js/wizardhelper.js"); - $oP->add_linked_script("../js/wizard.utils.js"); - $oP->add_linked_script("../js/linkswidget.js"); - $oP->add_linked_script("../js/jquery.blockUI.js"); - $oP->set_title("iTop - ".$oObjToClone->GetName()." - $sClassLabel clone"); - $oP->add("
\n"); - $oP->add("

Clone of $sClassLabel: ".$oObjToClone->GetName()."

\n"); - $oP->add("
\n"); - - $oP->add("
\n"); - cmdbAbstractObject::DisplayCreationForm($oP, $sClass, $oObjToClone); - $oP->add("
\n"); - } - else - { - $oP->set_title("iTop - Error"); - $oP->add("

Sorry this object does not exist (or you are not allowed to view it).

\n"); - } + $oP->set_title(Dict::S('UI:ErrorPageTitle')); + $oP->P(Dict::S('UI:ObjectDoesNotExist')); } break; @@ -669,79 +650,76 @@ try $sStateCode = utils::ReadParam('state', ''); if ( empty($sClass) ) { - $oP->p("The class must be specified for this operation!"); + throw new ApplicationException(Dict::Format('UI:Error:1ParametersMissing', 'class')); } - else + $oP->add_linked_script("../js/json.js"); + $oP->add_linked_script("../js/forms-json-utils.js"); + $oP->add_linked_script("../js/wizardhelper.js"); + $oP->add_linked_script("../js/wizard.utils.js"); + $oP->add_linked_script("../js/linkswidget.js"); + $oP->add_linked_script("../js/jquery.blockUI.js"); + $oWizard = new UIWizard($oP, $sClass, $sStateCode); + $oContext = new UserContext(); + $aArgs = array_merge($oAppContext->GetAsHash(), utils::ReadParam('default', array())); + $sStateCode = $oWizard->GetTargetState(); // Will computes the default state if none was supplied + $sClassLabel = MetaModel::GetName($sClass); + + $oP->set_title(Dict::Format('UI:CreationPageTitle_Class', $sClassLabel)); + $oP->add("

".Dict::Format('UI:CreationTitle_Class', $sClassLabel)."

\n"); + if (!empty($sStateCode)) { - $oP->add_linked_script("../js/json.js"); - $oP->add_linked_script("../js/forms-json-utils.js"); - $oP->add_linked_script("../js/wizardhelper.js"); - $oP->add_linked_script("../js/wizard.utils.js"); - $oP->add_linked_script("../js/linkswidget.js"); - $oP->add_linked_script("../js/jquery.blockUI.js"); - $oWizard = new UIWizard($oP, $sClass, $sStateCode); - $oContext = new UserContext(); - $aArgs = array_merge($oAppContext->GetAsHash(), utils::ReadParam('default', array())); - $sStateCode = $oWizard->GetTargetState(); // Will computes the default state if none was supplied - $sClassLabel = MetaModel::GetName($sClass); - $oP->add("

Creation of a new $sClassLabel

"); - if (!empty($sStateCode)) - { - $sStateLabel = MetaModel::GetStateLabel($sClass, $sStateCode); - } - $aWizardSteps = $oWizard->GetWizardStructure(); - - // Display the structure of the wizard - $iStepIndex = 1; - $iMaxInputId = 0; - $aFieldsMap = array(); - foreach($aWizardSteps['mandatory'] as $aSteps) - { - $oP->SetCurrentTab("Step $iStepIndex *"); - $oWizard->DisplayWizardStep($aSteps, $iStepIndex, $iMaxInputId, $aFieldsMap, false /* no finish button */, $aArgs); - //$oP->add("\n"); - $iStepIndex++; - } - foreach($aWizardSteps['optional'] as $aSteps) - { - $oP->SetCurrentTab("Step $iStepIndex *"); - $oWizard->DisplayWizardStep($aSteps, $iStepIndex, $iMaxInputId, $aFieldsMap, true, $aArgs); // true means enable the finish button - //$oP->add("\n"); - $iStepIndex++; - } - $oWizard->DisplayFinalStep($iStepIndex, $aFieldsMap); - - $oObj = null; - if (!empty($id)) - { - $oObj = $oContext->GetObject($sClass, $id); - } - if (!is_object($oObj)) - { - // new object or that can't be retrieved (corrupted id or object not allowed to this user) - $id = ''; - $oObj = MetaModel::NewObject($sClass); - } - $oP->add("\n"); + $sStateLabel = MetaModel::GetStateLabel($sClass, $sStateCode); } + $aWizardSteps = $oWizard->GetWizardStructure(); + + // Display the structure of the wizard + $iStepIndex = 1; + $iMaxInputId = 0; + $aFieldsMap = array(); + foreach($aWizardSteps['mandatory'] as $aSteps) + { + $oP->SetCurrentTab("Step $iStepIndex *"); + $oWizard->DisplayWizardStep($aSteps, $iStepIndex, $iMaxInputId, $aFieldsMap, false /* no finish button */, $aArgs); + $iStepIndex++; + } + foreach($aWizardSteps['optional'] as $aSteps) + { + $oP->SetCurrentTab("Step $iStepIndex"); + $oWizard->DisplayWizardStep($aSteps, $iStepIndex, $iMaxInputId, $aFieldsMap, true, $aArgs); // true means enable the finish button + $iStepIndex++; + } + $oWizard->DisplayFinalStep($iStepIndex, $aFieldsMap); + + $oObj = null; + if (!empty($id)) + { + $oObj = $oContext->GetObject($sClass, $id); + } + if (!is_object($oObj)) + { + // new object or that can't be retrieved (corrupted id or object not allowed to this user) + $id = ''; + $oObj = MetaModel::NewObject($sClass); + } + $oP->add("\n"); break; case 'apply_modify': @@ -751,19 +729,19 @@ try $sTransactionId = utils::ReadPostedParam('transaction_id', ''); if ( empty($sClass) || empty($id)) // TO DO: check that the class name is valid ! { - $oP->add("

'class' and 'id' parameters must be specifed for this operation.

\n"); + throw new ApplicationException(Dict::Format('UI:Error:2ParametersMissing', 'class', 'id')); } - else if (!utils::IsTransactionValid($sTransactionId)) + if (!utils::IsTransactionValid($sTransactionId)) { - $oP->p("Error: object has already be updated!\n"); + $oP->p("".Dict::S('UI:Error:ObjectAlreadyUpdated')."\n"); } else { $oObj = $oContext->GetObject($sClass, $id); if ($oObj != null) { - $oP->set_title("iTop - ".$oObj->GetName()." - $sClassLabel modification"); - $oP->add("

".$oObj->GetName()." - $sClassLabel modification

\n"); + $oP->set_title(Dict::Format('UI:ModificationPageTitle_Object_Class', $oObj->GetName(), $sClassLabel)); + $oP->add("

".Dict::Format('UI:ModificationTitle_Class_Object', $sClassLabel, $oObj->GetName())."

\n"); $bObjectModified = false; foreach(MetaModel::ListAttributeDefs(get_class($oObj)) as $sAttCode=>$oAttDef) { @@ -815,7 +793,7 @@ try } if (!$bObjectModified) { - $oP->p("No modification detected. ".MetaModel::GetName(get_class($oObj))." has not been updated.\n"); + $oP->p(Dict::Format('UI:Class_Object_NotUpdated', MetaModel::GetName(get_class($oObj)), $oObj->GetName())); } else if ($oObj->CheckToUpdate()) { @@ -823,7 +801,7 @@ try $oMyChange->Set("date", time()); if (UserRights::GetUser() != UserRights::GetRealUser()) { - $sUserString = UserRights::GetRealUser()." on behalf of ".UserRights::GetUser(); + $sUserString = Dict::Format('UI:Archive_User_OnBehalfOf_User', UserRights::GetRealUser(), UserRights::GetUser()); } else { @@ -833,18 +811,17 @@ try $iChangeId = $oMyChange->DBInsert(); $oObj->DBUpdateTracked($oMyChange); - $oP->p(MetaModel::GetName(get_class($oObj))." updated.\n"); + $oP->p(Dict::Format('UI:Class_Object_Updated', MetaModel::GetName(get_class($oObj)), $oObj->GetName())); } else { - $oP->p("Error: object can not be updated!\n"); - //$oObj->Reload(); // restore default values! + $oP->p("".Dict::S('UI:Error:ObjectCannotBeUpdated')."\n"); } } else { - $oP->set_title("iTop - Error"); - $oP->add("

Sorry this object does not exist (or you are not allowed to edit it).

\n"); + $oP->set_title(Dict::S('UI:ErrorPageTitle')); + $oP->P(Dict::S('UI:ObjectDoesNotExist')); } } $oObj->DisplayDetails($oP); @@ -856,30 +833,26 @@ try $bSearchForm = utils::ReadParam('search_form', true); if (empty($sFilter)) { - $oP->set_title("iTop - Error"); - $oP->add("

'filter' must be specifed for this operation.

\n"); + throw new ApplicationException(Dict::Format('UI:Error:1ParametersMissing', 'filter')); } - else + $oP->set_title(Dict::S('UI:BulkDeletePageTitle')); + $oP->add("

".Dict::S('UI:BulkDeleteTitle')."

\n"); + // TO DO: limit the search filter by the user context + $oFilter = CMDBSearchFilter::unserialize($sFilter); // TO DO : check that the filter is valid + $oSet = new DBObjectSet($oFilter); + if ($bSearchForm) { - $oP->set_title("iTop - mass delete"); - $oP->add("

Select the objects you want to delete

\n"); - // TO DO: limit the search filter by the user context - $oFilter = CMDBSearchFilter::unserialize($sFilter); // TO DO : check that the filter is valid - $oSet = new DBObjectSet($oFilter); - if ($bSearchForm) - { - $oBlock = new DisplayBlock($oFilter, 'search', false); - $oBlock->Display($oP, 0); - } - $oBlock = new DisplayBlock($oFilter, 'list', false); - $oP->add("
\n"); - $oP->add("\n"); - $oP->add("GetClass()."\">\n"); - $oP->add("\n"); - $oBlock->Display($oP, 1, array('selection_type' => 'multiple', 'selection_mode' => true, 'display_limit' => false)); - $oP->add("  >\">\n"); - $oP->add("
\n"); + $oBlock = new DisplayBlock($oFilter, 'search', false); + $oBlock->Display($oP, 0); } + $oBlock = new DisplayBlock($oFilter, 'list', false); + $oP->add("
\n"); + $oP->add("\n"); + $oP->add("GetClass()."\">\n"); + $oP->add("\n"); + $oBlock->Display($oP, 1, array('selection_type' => 'multiple', 'selection_mode' => true, 'display_limit' => false)); + $oP->add("  \n"); + $oP->add("
\n"); break; case 'bulk_delete': @@ -891,11 +864,11 @@ try $sTransactionId = utils::ReadPostedParam('transaction_id', ''); if ( empty($sClass) || empty($aSelectObject)) // TO DO: check that the class name is valid ! { - throw new ApplicationException('Error: \'class\' and \'selectObject[]\' parameters must be specifed for this operation.'); + throw new ApplicationException(Dict::Format('UI:Error:2ParametersMissing', 'class', 'selectObject[]')); } if (!utils::IsTransactionValid($sTransactionId)) { - throw new ApplicationException('Error: objects have already been deleted!'); + throw new ApplicationException(Dict::S('UI:Error:ObjectsAlreadyDeleted')); } foreach($aSelectObject as $iId) { @@ -903,8 +876,9 @@ try } if (!UserRights::IsActionAllowed($sClass, UR_ACTION_BULK_DELETE, DBObjectSet::FromArray($sClass, $aObjects))) { - throw new SecurityException('You are not allowed to perform a bulk delete of objects of class '.$sClass); + throw new SecurityException(Dict::S('UI:Error:BulkDeleteNotAllowedOn_Class'), $sClass); } + $oP->set_title(Dict::S('UI:BulkDeletePageTitle')); DeleteObjects($oP, $sClass, $aObjects, ($operation == 'bulk_delete_confirmed')); break; @@ -917,16 +891,11 @@ try if (!UserRights::IsActionAllowed($sClass, UR_ACTION_MODIFY, DBObjectSet::FromObject($oObj))) { - throw new SecurityException('You are not allowed to do delete objects of class '.$sClass); + throw new SecurityException(Dict::S('UI:Error:DeleteNotAllowedOn_Class'), $sClass); } DeleteObjects($oP, $sClass, array($oObj), ($operation == 'delete_confirmed')); break; - case 'apply_new': - $oP->p('Creation of the object'); - $oP->p('Obsolete, should now go through the wizard...'); - break; - case 'apply_clone': $sClass = utils::ReadPostedParam('class', ''); $sClassLabel = MetaModel::GetName($sClass); @@ -934,7 +903,7 @@ try $sTransactionId = utils::ReadPostedParam('transaction_id', ''); if (!utils::IsTransactionValid($sTransactionId)) { - $oP->p("Error: object has already be cloned!\n"); + $oP->p(Dict::S('UI:Error:ObjectAlreadyCloned')); } else { @@ -943,7 +912,7 @@ try $oMyChange->Set("date", time()); if (UserRights::GetUser() != UserRights::GetRealUser()) { - $sUserString = UserRights::GetRealUser()." on behalf of ".UserRights::GetUser(); + $sUserString = Dict::Format('UI:Archive_User_OnBehalfOf_User', UserRights::GetRealUser(), UserRights::GetUser()); } else { @@ -961,7 +930,8 @@ try } } $oObj->DBCloneTracked($oMyChange); - $oP->add("

".$oObj->GetName()." - $sClassLabel created

\n"); + $oP->set_title(Dict::S('UI:PageTitle:ObjectCreated')); + $oP->add("

".Dict::Format('UI:Title:Object_Of_Class_Created', $oObj->GetName(), $sClassLabel)."

\n"); $oObj->DisplayDetails($oP); } @@ -973,7 +943,7 @@ try $sTransactionId = utils::ReadPostedParam('transaction_id', ''); if (!utils::IsTransactionValid($sTransactionId)) { - $oP->p("Error: object has already be created!\n"); + $oP->p(Dict::S('UI:Error:ObjectAlreadyCreated')); } else { @@ -986,7 +956,7 @@ try $oMyChange->Set("date", time()); if (UserRights::GetUser() != UserRights::GetRealUser()) { - $sUserString = UserRights::GetRealUser()." on behalf of ".UserRights::GetUser(); + $sUserString = Dict::Format('UI:Archive_User_OnBehalfOf_User', UserRights::GetRealUser(), UserRights::GetUser()); } else { @@ -995,8 +965,8 @@ try $oMyChange->Set("userinfo", $sUserString); $iChangeId = $oMyChange->DBInsert(); $oObj->DBInsertTracked($oMyChange); - $oP->set_title("iTop - ".$oObj->GetName()." - $sClassLabel created"); - $oP->add("

".$oObj->GetName()." - $sClassLabel created

\n"); + $oP->set_title(Dict::S('UI:PageTitle:ObjectCreated')); + $oP->add("

".Dict::Format('UI:Title:Object_Of_Class_Created', $oObj->GetName(), $sClassLabel)."

\n"); $oObj->DisplayDetails($oP); } } @@ -1008,75 +978,67 @@ try $sStimulus = utils::ReadParam('stimulus', ''); if ( empty($sClass) || empty($id) || empty($sStimulus) ) // TO DO: check that the class name is valid ! { - $oP->add("

'class', 'id' and 'stimulus' parameters must be specifed for this operation.

\n"); + throw new ApplicationException(Dict::Format('UI:Error:3ParametersMissing', 'class', 'id', 'stimulus')); + } + $oObj = $oContext->GetObject($sClass, $id); + if ($oObj != null) + { + $aTransitions = $oObj->EnumTransitions(); + $aStimuli = MetaModel::EnumStimuli($sClass); + if (!isset($aTransitions[$sStimulus])) + { + // Invalid stimulus + throw new ApplicationException(Dict::Format('UI:Error:Invalid_Stimulus_On_Object_In_State', $sStimulus, $oObj->GetName(), $oObj->GetStateLabel())); + } + $sActionLabel = $aStimuli[$sStimulus]->GetLabel(); + $sActionDetails = $aStimuli[$sStimulus]->GetDescription(); + $aTransition = $aTransitions[$sStimulus]; + $sTargetState = $aTransition['target_state']; + $aTargetStates = MetaModel::EnumStates($sClass); + $oP->add("
\n"); + $oP->add("

$sActionLabel - {$oObj->GetName()}

\n"); + $oP->add("
\n"); + $oObj->DisplayBareDetails($oP); + $aTargetState = $aTargetStates[$sTargetState]; + $aExpectedAttributes = $aTargetState['attribute_list']; + $oP->add("
\n"); + $oP->add("

$sActionDetails

\n"); + $oP->add("
\n"); + $oP->add("
\n"); + $aDetails = array(); + foreach($aExpectedAttributes as $sAttCode => $iExpectCode) + { + // Prompt for an attribute if + // - the attribute must be changed or must be displayed to the user for confirmation + // - or the field is mandatory and currently empty + if ( ($iExpectCode & (OPT_ATT_MUSTCHANGE | OPT_ATT_MUSTPROMPT)) || + (($iExpectCode & OPT_ATT_MANDATORY) && ($oObj->Get($sAttCode) == '')) ) + { + $aAttributesDef = MetaModel::ListAttributeDefs($sClass); + $oAttDef = $aAttributesDef[$sAttCode]; + $aArgs = array('this' => $oObj); + $sHTMLValue = cmdbAbstractObject::GetFormElementForField($oP, $sClass, $sAttCode, $oAttDef, $oObj->Get($sAttCode), $oObj->GetEditValue($sAttCode), '', '', $iExpectCode, $aArgs); + $aDetails[] = array('label' => $oAttDef->GetLabel(), 'value' => $sHTMLValue); + } + } + $oP->details($aDetails); + $oP->add("\n"); + $oP->add("\n"); + $oP->add("\n"); + $oP->add("\n"); + $oP->add("\n"); + $oP->add($oAppContext->GetForForm()); + $oP->add("    \n"); + $oP->add("\n"); + $oP->add("
\n"); + $oP->add("
\n"); + $oP->add("
\n"); } else { - $oObj = $oContext->GetObject($sClass, $id); - if ($oObj != null) - { - $aTransitions = $oObj->EnumTransitions(); - $aStimuli = MetaModel::EnumStimuli($sClass); - if (!isset($aTransitions[$sStimulus])) - { - $oP->add("

Error: Invalid stimulus: '$sStimulus' on object: {$oObj->GetName()} in state {$oObj->GetStateLabel()}.

\n"); - } - else - { - $sActionLabel = $aStimuli[$sStimulus]->GetLabel(); - $sActionDetails = $aStimuli[$sStimulus]->GetDescription(); - $aTransition = $aTransitions[$sStimulus]; - $sTargetState = $aTransition['target_state']; - $aTargetStates = MetaModel::EnumStates($sClass); - $oP->add("
\n"); - $oP->add("

$sActionLabel - {$oObj->GetName()}

\n"); - //$oP->add("

Applying '$sActionLabel' on object: {$oObj->GetName()} in state {$oObj->GetStateLabel()} to target state: $sTargetState.

\n"); - $oP->add("
\n"); - $oObj->DisplayBareDetails($oP); - $aTargetState = $aTargetStates[$sTargetState]; - //print_r($aTransitions[$sStimulus]); - //print_r($aTargetState); - $aExpectedAttributes = $aTargetState['attribute_list']; - $oP->add("
\n"); - $oP->add("

$sActionDetails

\n"); - $oP->add("
\n"); - $oP->add("
\n"); - $aDetails = array(); - foreach($aExpectedAttributes as $sAttCode => $iExpectCode) - { - // Prompt for an attribute if - // - the attribute must be changed or must be displayed to the user for confirmation - // - or the field is mandatory and currently empty - if ( ($iExpectCode & (OPT_ATT_MUSTCHANGE | OPT_ATT_MUSTPROMPT)) || - (($iExpectCode & OPT_ATT_MANDATORY) && ($oObj->Get($sAttCode) == '')) ) - { - $aAttributesDef = MetaModel::ListAttributeDefs($sClass); - $oAttDef = $aAttributesDef[$sAttCode]; - $aArgs = array('this' => $oObj); - $sHTMLValue = cmdbAbstractObject::GetFormElementForField($oP, $sClass, $sAttCode, $oAttDef, $oObj->Get($sAttCode), $oObj->GetEditValue($sAttCode), '', '', $iExpectCode, $aArgs); - $aDetails[] = array('label' => $oAttDef->GetLabel(), 'value' => $sHTMLValue); - } - } - $oP->details($aDetails); - $oP->add("\n"); - $oP->add("\n"); - $oP->add("\n"); - $oP->add("\n"); - $oP->add("\n"); - $oP->add($oAppContext->GetForForm()); - $oP->add("    \n"); - $oP->add("\n"); - $oP->add("
\n"); - $oP->add("
\n"); - $oP->add("
\n"); - } - } - else - { - $oP->set_title("iTop - Error"); - $oP->add("

Sorry this object does not exist (or you are not allowed to edit it).

\n"); - } - } + $oP->set_title(Dict::S('UI:ErrorPageTitle')); + $oP->P(Dict::S('UI:ObjectDoesNotExist')); + } break; case 'apply_stimulus': @@ -1086,75 +1048,69 @@ try $sStimulus = utils::ReadPostedParam('stimulus', ''); if ( empty($sClass) || empty($id) || empty($sStimulus) ) // TO DO: check that the class name is valid ! { - $oP->add("

'class', 'id' and 'stimulus' parameters must be specifed for this operation.

\n"); + throw new ApplicationException(Dict::Format('UI:Error:3ParametersMissing', 'class', 'id', 'stimulus')); } - else + $oObj = $oContext->GetObject($sClass, $id); + if ($oObj != null) { - $oObj = $oContext->GetObject($sClass, $id); - if ($oObj != null) + $aTransitions = $oObj->EnumTransitions(); + $aStimuli = MetaModel::EnumStimuli($sClass); + if (!isset($aTransitions[$sStimulus])) { - $aTransitions = $oObj->EnumTransitions(); - $aStimuli = MetaModel::EnumStimuli($sClass); - if (!isset($aTransitions[$sStimulus])) - { - $oP->add("

Error: Invalid stimulus: '$sStimulus' on object: {$oObj->GetName()} in state {$oObj->GetStateLabel()}.

\n"); - } - else if (!utils::IsTransactionValid($sTransactionId)) - { - $oP->p("Error: object has already been updated!\n"); - } - else - { - $sActionLabel = $aStimuli[$sStimulus]->GetLabel(); - $sActionDetails = $aStimuli[$sStimulus]->GetDescription(); - $aTransition = $aTransitions[$sStimulus]; - $sTargetState = $aTransition['target_state']; - $aTargetStates = MetaModel::EnumStates($sClass); - $oP->add("
\n"); - $oP->add("

$sActionLabel - {$oObj->GetName()}

\n"); - $oP->add("

$sActionDetails

\n"); - $oP->add("

Applying '$sActionLabel' on object: {$oObj->GetName()} in state {$oObj->GetStateLabel()} to target state: $sTargetState.

\n"); - $oP->add("
\n"); - $aTargetState = $aTargetStates[$sTargetState]; - //print_r($aTransitions[$sStimulus]); - //print_r($aTargetState); - $aExpectedAttributes = $aTargetState['attribute_list']; - $aDetails = array(); - foreach($aExpectedAttributes as $sAttCode => $iExpectCode) - { - if (($iExpectCode & OPT_ATT_MUSTCHANGE) || ($oObj->Get($sAttCode) == '') ) - { - $paramValue = utils::ReadPostedParam("attr_$sAttCode", ''); - $oObj->Set($sAttCode, $paramValue); - } - } - if ($oObj->ApplyStimulus($sStimulus) && $oObj->CheckToUpdate()) - { - $oMyChange = MetaModel::NewObject("CMDBChange"); - $oMyChange->Set("date", time()); - if (UserRights::GetUser() != UserRights::GetRealUser()) - { - $sUserString = UserRights::GetRealUser()." on behalf of ".UserRights::GetUser(); - } - else - { - $sUserString = UserRights::GetUser(); - } - $oMyChange->Set("userinfo", $sUserString); - $iChangeId = $oMyChange->DBInsert(); - $oObj->DBUpdateTracked($oMyChange); - - $oP->p(MetaModel::GetName(get_class($oObj))." updated.\n"); - } - $oObj->DisplayDetails($oP); - } + throw new ApplicationException(Dict::Format('UI:Error:Invalid_Stimulus_On_Object_In_State', $sStimulus, $oObj->GetName(), $oObj->GetStateLabel())); + } + if (!utils::IsTransactionValid($sTransactionId)) + { + $oP->p(Dict::S('UI:Error:ObjectAlreadyUpdated')); } else { - $oP->set_title("iTop - Error"); - $oP->add("

Sorry this object does not exist (or you are not allowed to edit it).

\n"); - } + $sActionLabel = $aStimuli[$sStimulus]->GetLabel(); + $sActionDetails = $aStimuli[$sStimulus]->GetDescription(); + $aTransition = $aTransitions[$sStimulus]; + $sTargetState = $aTransition['target_state']; + $aTargetStates = MetaModel::EnumStates($sClass); + $oP->add("
\n"); + $oP->add("

$sActionLabel - {$oObj->GetName()}

\n"); + $oP->add("

$sActionDetails

\n"); + $oP->p(Dict::Format('UI:Apply_Stimulus_On_Object_In_State_ToTarget_State', $sACtionLabel, $oObj->GetName(), $oObj->GetStateLabel(), $sTargetState)); + $oP->add("
\n"); + $aTargetState = $aTargetStates[$sTargetState]; + $aExpectedAttributes = $aTargetState['attribute_list']; + $aDetails = array(); + foreach($aExpectedAttributes as $sAttCode => $iExpectCode) + { + if (($iExpectCode & OPT_ATT_MUSTCHANGE) || ($oObj->Get($sAttCode) == '') ) + { + $paramValue = utils::ReadPostedParam("attr_$sAttCode", ''); + $oObj->Set($sAttCode, $paramValue); + } + } + if ($oObj->ApplyStimulus($sStimulus) && $oObj->CheckToUpdate()) + { + $oMyChange = MetaModel::NewObject("CMDBChange"); + $oMyChange->Set("date", time()); + if (UserRights::GetUser() != UserRights::GetRealUser()) + { + $sUserString = Dict::Format('UI:Archive_User_OnBehalfOf_User', UserRights::GetRealUser(), UserRights::GetUser()); + } + else + { + $sUserString = UserRights::GetUser(); + } + $oMyChange->Set("userinfo", $sUserString); + $iChangeId = $oMyChange->DBInsert(); + $oObj->DBUpdateTracked($oMyChange); + $oP->p(Dict::Format('UI:Class_Object_Updated'), get_class($oObj), $oObj->GetName()); + } + $oObj->DisplayDetails($oP); + } } + else + { + $oP->set_title(Dict::S('UI:ErrorPageTitle')); + $oP->P(Dict::S('UI:ObjectDoesNotExist')); + } break; case 'modify_links': @@ -1165,15 +1121,11 @@ try $bAddObjects = utils::ReadParam('addObjects', false); if ( empty($sClass) || empty($id) || empty($sLinkAttr) || empty($sTargetClass)) // TO DO: check that the class name is valid ! { - $oP->set_title("iTop - Error"); - $oP->add("

4 parameters are mandatory for this operation: class, id, target_class and link_attr.

\n"); - } - else - { - require_once('../application/uilinkswizard.class.inc.php'); - $oWizard = new UILinksWizard($sClass, $sLinkAttr, $id, $sTargetClass); - $oWizard->Display($oP, $oContext, array('StartWithAdd' => $bAddObjects)); + throw new ApplicationException(Dict::Format('UI:Error:4ParametersMissing', 'class', 'id', 'target_class', 'link_attr')); } + require_once('../application/uilinkswizard.class.inc.php'); + $oWizard = new UILinksWizard($sClass, $sLinkAttr, $id, $sTargetClass); + $oWizard->Display($oP, $oContext, array('StartWithAdd' => $bAddObjects)); break; case 'do_modify_links': @@ -1192,7 +1144,7 @@ try $oMyChange->Set("date", time()); if (UserRights::GetUser() != UserRights::GetRealUser()) { - $sUserString = UserRights::GetRealUser()." on behalf of ".UserRights::GetUser(); + $sUserString = Dict::Format('UI:Archive_User_OnBehalfOf_User', UserRights::GetRealUser(), UserRights::GetUser()); } else { @@ -1305,9 +1257,9 @@ try catch(CoreException $e) { require_once('../setup/setuppage.class.inc.php'); - $oP = new SetupWebPage('iTop - fatal error'); - $oP->add("

Fatal Error, iTop cannot continue

\n"); - $oP->error("Error: '".$e->getHtmlDesc()."'"); + $oP = new SetupWebPage(Dict::S('UI:PageTitle:FatalError')); + $oP->add("

".Dict::S('UI:FatalErrorMessage')."

\n"); + $oP->error(Dict::Format('UI:Error_Details', $e->getHtmlDesc())); $oP->output(); if (MetaModel::IsLogEnabledIssue()) @@ -1334,9 +1286,9 @@ catch(CoreException $e) catch(Exception $e) { require_once('../setup/setuppage.class.inc.php'); - $oP = new SetupWebPage('iTop - fatal error'); - $oP->add("

Fatal Error, iTop cannot continue

\n"); - $oP->error("Error: '".$e->getMessage()."'"); + $oP = new SetupWebPage(Dict::S('UI:PageTitle:FatalError')); + $oP->add("

".Dict::S('UI:FatalErrorMessage')."

\n"); + $oP->error(Dict::Format('UI:Error_Details', $e->getMessage())); $oP->output(); if (MetaModel::IsLogEnabledIssue()) diff --git a/pages/usermanagement_classproj.php b/pages/usermanagement_classproj.php index e5ca28392..28a8e1036 100644 --- a/pages/usermanagement_classproj.php +++ b/pages/usermanagement_classproj.php @@ -32,8 +32,8 @@ function ComputeProjections($oPage, $sScope) // Setup display structure // $aDisplayConfig = array(); - $aDisplayConfig['class'] = array('label' => 'Class', 'description' => 'Class'); - $aDisplayConfig['object'] = array('label' => 'Object', 'description' => 'Projected object'); + $aDisplayConfig['class'] = array('label' => Dict::S('UI:UserManagement:Class'), 'description' => Dict::S('UI:UserManagement:Class+')); + $aDisplayConfig['object'] = array('label' => Dict::S('UI:UserManagement:ProjectedObject'), 'description' => Dict::S('UI:UserManagement:ProjectedObject+')); foreach ($aDimensions as $iDimension => $oDimension) { $aDisplayConfig['dim'.$oDimension->GetKey()] = array('label' => $oDimension->GetName(), 'description' => $oDimension->Get('description')); @@ -57,7 +57,7 @@ function ComputeProjections($oPage, $sScope) $aValues = $aClassProjs[$sClass][$iDimension]->ProjectObject($oObject); if (is_null($aValues)) { - $sValues = htmlentities(''); + $sValues = htmlentities(Dict::S('UI:UserManagement:AnyObject')); } else { @@ -88,7 +88,7 @@ $iActiveNodeId = utils::ReadParam('menu', -1); $currentOrganization = utils::ReadParam('org_id', 1); $sScope = utils::ReadParam('scope', 'SELECT bizDevice'); -$oPage = new iTopWebPage("iTop user management - class projections", $currentOrganization); +$oPage = new iTopWebPage(Dict::S('UI:PageTitle:ClassProjections'), $currentOrganization); $oPage->no_cache(); ComputeProjections($oPage, $sScope); diff --git a/pages/usermanagement_profileproj.php b/pages/usermanagement_profileproj.php index a5cfb2e94..a9475330e 100644 --- a/pages/usermanagement_profileproj.php +++ b/pages/usermanagement_profileproj.php @@ -37,8 +37,8 @@ function ComputeProjections($oPage) // Setup display structure // $aDisplayConfig = array(); - $aDisplayConfig['user'] = array('label' => 'User', 'description' => 'User concerned by the projection'); - $aDisplayConfig['profile'] = array('label' => 'Profile', 'description' => 'Profile in which the projection is specified'); + $aDisplayConfig['user'] = array('label' => Dict::S('UI:UserManagement:User'), 'description' => Dict::S('UI:UserManagement:User+')); + $aDisplayConfig['profile'] = array('label' => Dict::S('UI:UserManagement:Profile'), 'description' => Dict::S('UI:UserManagement:Profile+')); foreach ($aDimensions as $iDimension => $oDimension) { $aDisplayConfig['dim'.$oDimension->GetKey()] = array('label' => $oDimension->GetName(), 'description' => $oDimension->Get('description')); @@ -67,7 +67,7 @@ function ComputeProjections($oPage) $aValues = $aProPros[$iProfile][$iDimension]->ProjectUser($oUser); if (is_null($aValues)) { - $sValues = htmlentities(''); + $sValues = htmlentities(Dict::S('UI:UserManagement:AnyObject')); } else { @@ -98,7 +98,7 @@ $oAppContext = new ApplicationContext(); $iActiveNodeId = utils::ReadParam('menu', -1); $currentOrganization = utils::ReadParam('org_id', 1); -$oPage = new iTopWebPage("iTop user management - profile projections", $currentOrganization); +$oPage = new iTopWebPage(Dict::S('UI:PageTitle:ProfileProjections'), $currentOrganization); $oPage->no_cache(); ComputeProjections($oPage);