PHP 클래스 DropdownTranslation, glpi

상속: extends CommonDBChild
파일 보기 프로젝트 열기: glpi-project/glpi 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$dohistory
$items_id
$itemtype
$rightname

공개 메소드들

메소드 설명
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

메소드 상세

canBeTranslated() 정적인 공개 메소드

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
static public canBeTranslated ( CommonGLPI $item ) : true
$item CommonGLPI the item to check
리턴 true if item can be translated, false otherwise

checkBeforeAddorUpdate() 공개 메소드

Check if a field's translation can be added or updated
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)
리턴 true if translation can be added/update, false otherwise

displayTabContentForItem() 정적인 공개 메소드

static public displayTabContentForItem ( CommonGLPI $item, $tabnum = 1, $withtemplate )
$item CommonGLPI CommonGLPI object
$tabnum (default 1)
$withtemplate (default 0)

dropdownFields() 정적인 공개 메소드

Display a dropdown with fields that can be translated for an itemtype
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 '')
리턴 the dropdown's random identifier

generateCompletename() 공개 메소드

Generate completename associated with a tree dropdown
public generateCompletename ( $input, $add = true ) : nothing
$input array of user values
$add boolean true if translation is added, false if update (tgrue by default)
리턴 nothing

getAvailableTranslations() 정적인 공개 메소드

Get available translations for a language
static public getAvailableTranslations ( $language ) : array
$language language
리턴 array of table / field translated item

getForbiddenStandardMassiveAction() 공개 메소드

Forbidden massives actions

getNumberOfTranslations() 정적인 공개 메소드

Return the number of translations for a field in a language
static public getNumberOfTranslations ( $itemtype, $items_id, $field, $language ) : the
리턴 the number of translations for this field

getNumberOfTranslationsForItem() 정적인 공개 메소드

Return the number of translations for an item
static public getNumberOfTranslationsForItem ( $item ) : the
리턴 the number of translations for this item

getTabNameForItem() 공개 메소드

또한 보기: CommonGLPI::getTabNameForItem()
public getTabNameForItem ( CommonGLPI $item, $withtemplate )
$item CommonGLPI

getTranslatedValue() 정적인 공개 메소드

Get translated value for a field in a particular language
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 '')
리턴 the translated value of the value in the default language

getTranslationByName() 정적인 공개 메소드

Get a translation for a value
static public getTranslationByName ( $itemtype, $field, $value ) : the
$itemtype itemtype
$field field to query
$value value to translate
리턴 the value translated if a translation is available, or the same value if not

getTranslationID() 정적인 공개 메소드

Get the id of a translated string
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
리턴 the row id or 0 if not translation found

getTranslationsForAnItem() 정적인 공개 메소드

Get translations for an item
static public getTranslationsForAnItem ( $itemtype, $items_id, $field ) : the
$itemtype itemtype
$items_id item ID
$field the field for which the translation is needed
리턴 the value translated if a translation is available, or the same value if not

getTypeName() 정적인 공개 메소드

static public getTypeName ( $nb )

hasItemtypeATranslation() 정적인 공개 메소드

Check if there's at least one translation for this itemtype
static public hasItemtypeATranslation ( $itemtype ) : true
$itemtype itemtype to check
리턴 true if there's at least one translation, otherwise false

isDropdownTranslationActive() 정적인 공개 메소드

Is dropdown item translation functionnality active
static public isDropdownTranslationActive ( ) : true
리턴 true if active, false if not

post_addItem() 공개 메소드

public post_addItem ( )

post_purgeItem() 공개 메소드

public post_purgeItem ( )

post_updateItem() 공개 메소드

public post_updateItem ( $history = 1 )

prepareInputForAdd() 공개 메소드

public prepareInputForAdd ( $input )

prepareInputForUpdate() 공개 메소드

public prepareInputForUpdate ( $input )

regenerateAllCompletenameTranslationsFor() 정적인 공개 메소드

Regenerate all completename translations for an item
static public regenerateAllCompletenameTranslationsFor ( $itemtype, $items_id ) : the
$itemtype itemtype
$items_id item ID
리턴 the value translated if a translation is available, or the same value if not

showForm() 공개 메소드

Display translation form
public showForm ( $ID, $options = [] )
$ID field (default -1)
$options array

showTranslations() 정적인 공개 메소드

Display all translated field for a dropdown
static public showTranslations ( CommonDropdown $item ) : true;
$item CommonDropdown a Dropdown item
리턴 true;

프로퍼티 상세

$dohistory 공개적으로 프로퍼티

public $dohistory

$items_id 공개적으로 정적으로 프로퍼티

public static $items_id

$itemtype 공개적으로 정적으로 프로퍼티

public static $itemtype

$rightname 정적으로 공개적으로 프로퍼티

static public $rightname