Property | Type | Description | |
---|---|---|---|
$dohistory | |||
$items_id | |||
$itemtype | |||
$rightname |
Method | Description | |
---|---|---|
canBeTranslated ( CommonGLPI $item ) : true | Check if an item can be translated It be translated if translation if globally on and item is an instance of CommonDropdown or CommonTreeDropdown and if translation is enabled for this class | |
checkBeforeAddorUpdate ( $input, $add = true ) : true | Check if a field's translation can be added or updated | |
displayTabContentForItem ( CommonGLPI $item, $tabnum = 1, $withtemplate ) | ||
dropdownFields ( CommonDBTM $item, $language = '', $value = '' ) : the | Display a dropdown with fields that can be translated for an itemtype | |
generateCompletename ( $input, $add = true ) : nothing | Generate completename associated with a tree dropdown | |
getAvailableTranslations ( $language ) : array | Get available translations for a language | |
getForbiddenStandardMassiveAction ( ) | Forbidden massives actions | |
getNumberOfTranslations ( $itemtype, $items_id, $field, $language ) : the | Return the number of translations for a field in a language | |
getNumberOfTranslationsForItem ( $item ) : the | Return the number of translations for an item | |
getTabNameForItem ( CommonGLPI $item, $withtemplate ) | ||
getTranslatedValue ( $ID, $itemtype, $field = 'name', $language, $value = '' ) : the | Get translated value for a field in a particular language | |
getTranslationByName ( $itemtype, $field, $value ) : the | Get a translation for a value | |
getTranslationID ( $ID, $itemtype, $field, $language ) : the | Get the id of a translated string | |
getTranslationsForAnItem ( $itemtype, $items_id, $field ) : the | Get translations for an item | |
getTypeName ( $nb ) | ||
hasItemtypeATranslation ( $itemtype ) : true | Check if there's at least one translation for this itemtype | |
isDropdownTranslationActive ( ) : true | Is dropdown item translation functionnality active | |
post_addItem ( ) | ||
post_purgeItem ( ) | ||
post_updateItem ( $history = 1 ) | ||
prepareInputForAdd ( $input ) | ||
prepareInputForUpdate ( $input ) | ||
regenerateAllCompletenameTranslationsFor ( $itemtype, $items_id ) : the | Regenerate all completename translations for an item | |
showForm ( $ID, $options = [] ) | Display translation form | |
showTranslations ( CommonDropdown $item ) : true; | Display all translated field for a dropdown |
static public canBeTranslated ( CommonGLPI $item ) : true | ||
$item | CommonGLPI | the item to check |
return | true | if item can be translated, false otherwise |
public checkBeforeAddorUpdate ( $input, $add = true ) : true | ||
$input | translation's fields | |
$add | boolean true if a transaltion must be added, false if updated (true by default) | |
return | true | if translation can be added/update, false otherwise |
static public displayTabContentForItem ( CommonGLPI $item, $tabnum = 1, $withtemplate ) | ||
$item | CommonGLPI | CommonGLPI object |
$tabnum | (default 1) | |
$withtemplate | (default 0) |
static public dropdownFields ( CommonDBTM $item, $language = '', $value = '' ) : the | ||
$item | CommonDBTM | a Dropdown item |
$language | language to look for translations (default '') | |
$value | field which must be selected by default (default '') | |
return | the | dropdown's random identifier |
public generateCompletename ( $input, $add = true ) : nothing | ||
$input | array of user values | |
$add | boolean true if translation is added, false if update (tgrue by default) | |
return | nothing |
static public getAvailableTranslations ( $language ) : array | ||
$language | language | |
return | array | of table / field translated item |
public getForbiddenStandardMassiveAction ( ) |
static public getNumberOfTranslations ( $itemtype, $items_id, $field, $language ) : the | ||
return | the | number of translations for this field |
static public getNumberOfTranslationsForItem ( $item ) : the | ||
return | the | number of translations for this item |
public getTabNameForItem ( CommonGLPI $item, $withtemplate ) | ||
$item | CommonGLPI |
static public getTranslatedValue ( $ID, $itemtype, $field = 'name', $language, $value = '' ) : the | ||
$ID | dropdown item's id | |
$itemtype | dropdown itemtype | |
$field | the field to look for (default 'name') | |
$language | get translation for this language | |
$value | default value for the field (default '') | |
return | the | translated value of the value in the default language |
static public getTranslationByName ( $itemtype, $field, $value ) : the | ||
$itemtype | itemtype | |
$field | field to query | |
$value | value to translate | |
return | the | value translated if a translation is available, or the same value if not |
static public getTranslationID ( $ID, $itemtype, $field, $language ) : the | ||
$ID | item id | |
$itemtype | item type | |
$field | the field for which the translation is needed | |
$language | the target language | |
return | the | row id or 0 if not translation found |
static public getTranslationsForAnItem ( $itemtype, $items_id, $field ) : the | ||
$itemtype | itemtype | |
$items_id | item ID | |
$field | the field for which the translation is needed | |
return | the | value translated if a translation is available, or the same value if not |
static public hasItemtypeATranslation ( $itemtype ) : true | ||
$itemtype | itemtype to check | |
return | true | if there's at least one translation, otherwise false |
static public isDropdownTranslationActive ( ) : true | ||
return | true | if active, false if not |
static public regenerateAllCompletenameTranslationsFor ( $itemtype, $items_id ) : the | ||
$itemtype | itemtype | |
$items_id | item ID | |
return | the | value translated if a translation is available, or the same value if not |
public showForm ( $ID, $options = [] ) | ||
$ID | field (default -1) | |
$options | array |
static public showTranslations ( CommonDropdown $item ) : true; | ||
$item | CommonDropdown | a Dropdown item |
return | true; |