diff --git a/application/cmdbabstract.class.inc.php b/application/cmdbabstract.class.inc.php index af8b75fb4..ee42bf9dc 100644 --- a/application/cmdbabstract.class.inc.php +++ b/application/cmdbabstract.class.inc.php @@ -35,7 +35,7 @@ abstract class cmdbAbstractObject extends CMDBObject protected static function MakeHyperLink($sObjClass, $sObjKey, $aAvailableFields) { - if ($sObjKey <= 0) return 'undefined'; // Objects built in memory have negative IDs + if ($sObjKey <= 0) return ''.Dict::S('UI:UndefinedObject').''; // Objects built in memory have negative IDs $oAppContext = new ApplicationContext(); $sExtClassNameAtt = MetaModel::GetNameAttributeCode($sObjClass); @@ -195,8 +195,7 @@ abstract class cmdbAbstractObject extends CMDBObject $oDoc = $this->Get($sAttCode); if (is_object($oDoc) && !$oDoc->IsEmpty()) { - $sHtml .= "

Open in New Window: ".$oDoc->GetDisplayLink($sClass, $this->GetKey(), $sAttCode).", \n"; - $sHtml .= "Download: ".$oDoc->GetDownloadLink($sClass, $this->GetKey(), $sAttCode)."

\n"; + $sHtml .= "

".Dict::Format('UI:Document:OpenInNewWindow:Download', $oDoc->GetDisplayLink($sClass, $this->GetKey(), $sAttCode), $oDoc->GetDownloadLink($sClass, $this->GetKey(), $sAttCode))."

\n"; $sHtml .= "
".$oDoc->GetDisplayInline($sClass, $this->GetKey(), $sAttCode)."
\n"; } } @@ -258,12 +257,12 @@ abstract class cmdbAbstractObject extends CMDBObject if($iLinkedObjectId == 0) { // if 'links' mode is requested the id of the object to link to must be specified - throw new ApplicationException("Parameter object_id is mandatory when link_attr is specified. Check the definition of the display template."); + throw new ApplicationException(Dict::S('UI:Error:MandatoryTemplateParameter_object_id')); } if($sTargetAttr == '') { // if 'links' mode is requested the d of the object to link to must be specified - throw new ApplicationException("Parameter target_attr is mandatory when link_attr is specified. Check the definition of the display template."); + throw new ApplicationException(Dict::S('UI:Error:MandatoryTemplateParameter_target_attr')); } } $bDisplayMenu = isset($aExtraParams['menu']) ? $aExtraParams['menu'] == true : true; @@ -312,14 +311,14 @@ abstract class cmdbAbstractObject extends CMDBObject { if (!$bSingleSelectMode) { - $aAttribs['form::select'] = array('label' => "", 'description' => 'Select / Deselect All'); - } + $aAttribs['form::select'] = array('label' => "", 'description' => Dict::S('UI:SelectAllToggle+')); + } else { $aAttribs['form::select'] = array('label' => "", 'description' => ''); } } - $aAttribs['key'] = array('label' => '', 'description' => 'Click to display'); + $aAttribs['key'] = array('label' => '', 'description' => Dict::S('UI:ClickToDisplay+')); foreach($aList as $sAttCode) { $aAttribs[$sAttCode] = array('label' => MetaModel::GetLabel($sClassName, $sAttCode), 'description' => MetaModel::GetDescription($sClassName, $sAttCode)); @@ -377,14 +376,14 @@ abstract class cmdbAbstractObject extends CMDBObject $sFilter = $oSet->GetFilter()->serialize(); $aExtraParams['display_limit'] = false; // To expand the full list $sExtraParams = addslashes(str_replace('"', "'", json_encode($aExtraParams))); // JSON encode, change the style of the quotes and escape them - $sHtml .= ''.utils::GetConfig()->GetMinDisplayLimit().' object(s) displayed out of '.$oSet->Count().'  Display All'; + $sHtml .= ''.Dict::Format('UI:TruncatedResults', utils::GetConfig()->GetMinDisplayLimit(), $oSet->Count()).'  '.Dict::S('UI:DisplayAll').''; $oPage->add_ready_script("$('#{$divId} table.listResults').addClass('truncated');"); $oPage->add_ready_script("$('#{$divId} table.listResults tr:last td').addClass('truncated');"); } else { // Full list - $sHtml .= ' '.$oSet->Count().' object(s)'; + $sHtml .= ' '.Dict::Format('UI:CountOfResults').''; } $sHtml .= $oMenuBlock->GetRenderContent($oPage, $aMenuExtraParams); $sHtml .= ''; @@ -423,7 +422,7 @@ abstract class cmdbAbstractObject extends CMDBObject foreach($aAuthorizedClasses as $sAlias => $sClassName) // TO DO: check if the user has enough rights to view the classes of the list... { $aList[$sClassName] = MetaModel::GetZListItems($sClassName, 'list'); - $aAttribs['key_'.$sAlias] = array('label' => '', 'description' => 'Click to display'); + $aAttribs['key_'.$sAlias] = array('label' => '', 'description' => Dict::S('UI:ClickToDisplay+')); foreach($aList[$sClassName] as $sAttCode) { $aAttribs[$sAttCode.'_'.$sAlias] = array('label' => MetaModel::GetLabel($sClassName, $sAttCode), 'description' => MetaModel::GetDescription($sClassName, $sAttCode)); @@ -472,14 +471,14 @@ abstract class cmdbAbstractObject extends CMDBObject $sFilter = $oSet->GetFilter()->serialize(); $aExtraParams['display_limit'] = false; // To expand the full list $sExtraParams = addslashes(str_replace('"', "'", json_encode($aExtraParams))); // JSON encode, change the style of the quotes and escape them - $sHtml .= ''.utils::GetConfig()->GetMinDisplayLimit().' object(s) displayed out of '.$oSet->Count().'  Display All'; + $sHtml .= ''.Dict::Format('UI:TruncatedResults', utils::GetConfig()->GetMinDisplayLimit(), $oSet->Count()).'  '.Dict::S('UI:DisplayAll').''; $oPage->add_ready_script("$('#{$divId} table.listResults').addClass('truncated');"); $oPage->add_ready_script("$('#{$divId} table.listResults tr:last td').addClass('truncated');"); } else { // Full list - $sHtml .= ' '.$oSet->Count().' object(s)'; + $sHtml .= ' '.Dict::Format('UI:CountOfResults').''; } $sHtml .= $oMenuBlock->GetRenderContent($oPage, $aMenuExtraParams); $sHtml .= ''; @@ -614,12 +613,12 @@ abstract class cmdbAbstractObject extends CMDBObject $count = $oSet->Count(); if ($count > 0) { - $oPage->p("Changes log ($count):"); + $oPage->p(Dict::Format('UI:ChangesLogTitle', $count)); self::DisplaySet($oPage, $oSet); } else { - $oPage->p("Changes log is empty"); + $oPage->p(Dict::S('UI:EmptyChangesLogTitle')); } } @@ -642,13 +641,13 @@ abstract class cmdbAbstractObject extends CMDBObject // (especially when used to add a link) /* $sHtml .= "
\n"; */ // Simple search form $sHtml .= "
\n"; - $sHtml .= "

Search for ".MetaModel::GetName($sClassName)." Objects

\n"; + $sHtml .= "

".Dict::Format('UI:SearchFor_Class_Objects', $sClassName)."

\n"; $oUnlimitedFilter = new DBObjectSearch($sClassName); $sHtml .= "
\n"; $index = 0; @@ -726,7 +725,7 @@ abstract class cmdbAbstractObject extends CMDBObject $sHtml .= "\n"; } $sHtml .= "\n"; - $sHtml .= "\n"; + $sHtml .= "\n"; $sHtml .= "\n"; foreach($aExtraParams as $sName => $sValue) { @@ -741,7 +740,7 @@ abstract class cmdbAbstractObject extends CMDBObject // OQL query builder $sHtml .= "
\n"; - $sHtml .= "

OQL Query Builder

\n"; + $sHtml .= "

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

\n"; $sHtml .= "\n"; $sHtml .= "\n"; - $sHtml .= "\n"; + $sHtml .= "\n"; $sHtml .= "\n"; foreach($aExtraParams as $sName => $sValue) { @@ -936,8 +935,8 @@ abstract class cmdbAbstractObject extends CMDBObject $oPage->add("\n"); } $oPage->add($oAppContext->GetForForm()); - $oPage->add("    \n"); - $oPage->add("\n"); + $oPage->add("    \n"); + $oPage->add("\n"); $oPage->add("\n"); } @@ -997,8 +996,8 @@ abstract class cmdbAbstractObject extends CMDBObject { $oPage->add("\n"); } - $oPage->add("    \n"); - $oPage->add("\n"); + $oPage->add("    \n"); + $oPage->add("\n"); $oPage->add("\n"); } diff --git a/application/displayblock.class.inc.php b/application/displayblock.class.inc.php index 2656f5dc3..db4930591 100644 --- a/application/displayblock.class.inc.php +++ b/application/displayblock.class.inc.php @@ -128,7 +128,7 @@ class DisplayBlock if(empty($aParams['target_attr'])) { // if 'links' mode is requested the id of the object to link to must be specified - throw new ApplicationException(Dict::S('UI:Error:MandatoryTemplateParameter_link_attr')); + throw new ApplicationException(Dict::S('UI:Error:MandatoryTemplateParameter_target_attr')); } } @@ -549,7 +549,7 @@ class DisplayBlock $sHtml .= cmdbAbstractObject::GetSearchForm($oPage, $this->m_oSet, $aExtraParams); $sHtml .= "\n"; $sHtml .= "
\n"; - $sHtml .= "
Search
\n"; + $sHtml .= "
".Dict::S('UI:SearchToggle')."
\n"; break; case 'pie_chart': @@ -955,10 +955,10 @@ class MenuBlock extends DisplayBlock //$aActions[] = array ('label' => 'Bookmark...', 'url' => "../pages/ajax.render.php?operation=create&class=$sClass&filter=$sFilter", 'class' => 'jqmTrigger'); if ($bIsModifyAllowed) { $aActions[] = array ('label' => Dict::S('UI:Menu:New'), 'url' => "../pages/$sUIPage?operation=new&class=$sClass&$sContext{$sDefault}"); } //if ($bIsBulkModifyAllowed) { $aActions[] = array ('label' => 'Modify All...', 'url' => "../pages/$sUIPage?operation=modify_all&filter=$sFilter&$sContext"); } - //if ($bIsBulkDeleteAllowed) { $aActions[] = array ('label' => 'Delete All...', 'url' => "../pages/$sUIPage?operation=delete_all&filter=$sFilter&$sContext"); } + if ($bIsBulkDeleteAllowed) { $aActions[] = array ('label' => Dict::S('UI:Menu:BulkDelete'), 'url' => "../pages/$sUIPage?operation=select_for_deletion&filter=$sFilter&$sContext"); } } } - $sHtml .= "
    \n
  • Actions\n
      \n"; + $sHtml .= "
        \n
      • ".Dict::S('UI:Menu:Actions')."\n
          \n"; foreach ($aActions as $aAction) { $sClass = isset($aAction['class']) ? " class=\"{$aAction['class']}\"" : ""; diff --git a/application/itopwebpage.class.inc.php b/application/itopwebpage.class.inc.php index 78fe84e7f..2c8ef4fea 100644 --- a/application/itopwebpage.class.inc.php +++ b/application/itopwebpage.class.inc.php @@ -303,7 +303,7 @@ EOF $sLogonMessage = Dict::Format('UI:LoggedAsMessage', $sUserName); } $sLogOffBtn = Dict::S('UI:Button:Logoff'); - $sSearchBtn = Dict::S('UI:Button:Search'); + $sSearchBtn = Dict::S('UI:Button:GlobalSearch'); echo "
          {$sLogonMessage}  "; echo "
          \n"; echo "\n"; diff --git a/dictionaries/dictionary.itop.ui.php b/dictionaries/dictionary.itop.ui.php index 28e4017f3..063722b8c 100644 --- a/dictionaries/dictionary.itop.ui.php +++ b/dictionaries/dictionary.itop.ui.php @@ -310,7 +310,12 @@ Dict::Add('EN US', 'English', 'English', array( 'UI:LoggedAsMessage' => 'Logged in as %1$s', 'UI:LoggedAsMessage+Admin' => 'Logged in as %1$s (Administrator)', 'UI:Button:Logoff' => 'Log off', - 'UI:Button:Search' => 'Search', + 'UI:Button:GlobalSearch' => 'Search', + 'UI:Button:Search' => ' Search ', + 'UI:Button:Query' => ' Query ', + 'UI:Button:Cancel' => 'Cancel', + 'UI:Button:Apply' => 'Apply', + 'UI:SearchToggle' => 'Search', 'UI:ClickToCreateNew' => 'Click here to create a new %1$s', 'UI:NoObjectToDisplay' => 'No object to display.', 'UI:Error:MandatoryTemplateParameter_object_id' => 'Parameter object_id is mandatory when link_attr is specified. Check the definition of the display template.', @@ -330,6 +335,7 @@ Dict::Add('EN US', 'English', 'English', array( 'UI:History:Changes' => 'Changes', 'UI:History:Changes+' => 'Changes made to the object', 'UI:Loading' => 'Loading...', + 'UI:Menu:Actions' => 'Actions', 'UI:Menu:New' => 'New...', 'UI:Menu:Add' => 'Add...', 'UI:Menu:Manage' => 'Manage...', @@ -349,6 +355,9 @@ Dict::Add('EN US', 'English', 'English', array( 'UI:ChangesLogTitle' => 'Changes log (%1$d):', 'UI:EmptyChangesLogTitle' => 'Changes log is empty', 'UI:SearchFor_Class_Objects' => 'Search for %1$s Objects', + 'UI:OQLQueryBuilderTitle' => 'OQL Query Builder', + 'UI:OQLQueryTab' => 'OQL Query', + 'UI:SimpleSearchTab' => 'Simple Search', ));
 \n"; $sHtml .= "