PHP Класс Profile, glpi

Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$common_fields Common fields used for all profiles type
$dohistory
$helpdesk_rights Helpdesk fields of helpdesk profiles
$rightname

Открытые методы

Метод Описание
cleanDBonPurge ( )
cleanProfile ( ) Unset unused rights for helpdesk
currentUserHaveMoreRightThan ( $IDs = [] ) : boolean Is the current user have more right than all profiles in parameters
defineTabs ( $options = [] )
displayLifeCycleMatrix ( $title, $html_field, $db_field, $statuses, $canedit ) : nothing Display the matrix of the elements lifecycle of the elements
displayLifeCycleMatrixTicketHelpdesk ( $title, $html_field, $db_field, $canedit ) : nothing Display the matrix of the elements lifecycle of the elements
displayRightsChoiceMatrix ( array $rights, array $options = [] ) : random Display rights choice matrix
displayTabContentForItem ( CommonGLPI $item, $tabnum = 1, $withtemplate )
dropdownHelpdeskItemtypes ( $options ) Dropdown profiles which have rights under the active one
dropdownNoneReadWrite ( $name, $value, $none = 1, $read = 1, $write = 1 ) : nothing Make a select box for a None Read Write choice
dropdownRight ( $name, $options = [] ) : nothing Make a select box for a None Read Write choice
dropdownRights ( array $values, $name, $current, $options = [] ) Make a select box for rights
dropdownUnder ( $options = [] ) Dropdown profiles which have rights under the active one
getDefault ( ) : integer Get the default Profile for new user
getForbiddenStandardMassiveAction ( )
getHelpdeskHardwareTypeName ( $value )
getHelpdeskHardwareTypes ( $rights = false )
getHelpdeskItemtypes ( )
getInterfaceName ( $value )
getInterfaces ( )
getLinearRightChoice ( array $elements, array $options = [] ) : content Get right linear right choice.
getRightsFor ( $itemtype, $interface = 'central' ) : rights Get rights for an itemtype
getSearchOptions ( )
getSpecificValueToDisplay ( $field, $values, array $options = [] )
getSpecificValueToSelect ( $field, $name = '', $values = '', array $options = [] )
getTabNameForItem ( CommonGLPI $item, $withtemplate )
getTypeName ( $nb )
getUnderActiveProfileRestrictRequest ( $separator = "AND" ) : SQL Get SQL restrict request to determine profiles with less rights than the active one
haveUserRight ( $user, $right, $valright, $entity ) : boolean function to check one right of a user
post_addItem ( )
post_getEmpty ( )
post_getFromDB ( )
post_updateItem ( $history = 1 )
pre_deleteItem ( ) : boolean check right before delete
prepareInputForAdd ( $input )
prepareInputForUpdate ( $input )
showForm ( $ID, $options = [] ) : boolean Print the profile form headers
showFormAdmin ( $openform = true, $closeform = true ) Print the central form for a profile
showFormAsset ( $openform = true, $closeform = true ) Print the Asset rights form for the current profile
showFormLifeCycle ( $openform = true, $closeform = true ) Print the Life Cycles form for the current profile
showFormLifeCycleHelpdesk ( $openform = true, $closeform = true ) Print the Life Cycles form for the current profile
showFormManagement ( $openform = true, $closeform = true ) Print the Management rights form for the current profile
showFormSetup ( $openform = true, $closeform = true ) Print the central form for a profile
showFormTools ( $openform = true, $closeform = true ) Print the Tools rights form for the current profile
showFormToolsHelpdesk ( ) Print the helpdesk right form for the current profile
showFormTracking ( $openform = true, $closeform = true ) Print the Tracking right form for the current profile
showFormTrackingHelpdesk ( ) Print the helpdesk right form for the current profile
showLegend ( )

Описание методов

cleanDBonPurge() публичный Метод

public cleanDBonPurge ( )

cleanProfile() публичный Метод

Unset unused rights for helpdesk
public cleanProfile ( )

currentUserHaveMoreRightThan() статический публичный Метод

Is the current user have more right than all profiles in parameters
static public currentUserHaveMoreRightThan ( $IDs = [] ) : boolean
$IDs array of profile ID to test
Результат boolean true if have more right

defineTabs() публичный Метод

public defineTabs ( $options = [] )

displayLifeCycleMatrix() публичный Метод

Display the matrix of the elements lifecycle of the elements
public displayLifeCycleMatrix ( $title, $html_field, $db_field, $statuses, $canedit ) : nothing
$title the kind of lifecycle
$html_field field that is sent to _POST
$db_field field inside the DB (to get current state)
$statuses all available statuses for the given cycle (obj::getAllStatusArray())
$canedit can we edit the elements ?
Результат nothing

displayLifeCycleMatrixTicketHelpdesk() публичный Метод

Display the matrix of the elements lifecycle of the elements
public displayLifeCycleMatrixTicketHelpdesk ( $title, $html_field, $db_field, $canedit ) : nothing
$title the kind of lifecycle
$html_field field that is sent to _POST
$db_field field inside the DB (to get current state)
$canedit can we edit the elements ?
Результат nothing

displayRightsChoiceMatrix() публичный Метод

Display rights choice matrix
public displayRightsChoiceMatrix ( array $rights, array $options = [] ) : random
$rights array array possible: 'itemtype' => the type of the item to check (as passed to self::getRightsFor()) 'rights' => when use of self::getRightsFor() is impossible 'label' => the label for the right 'field' => the name of the field inside the DB and HTML form (prefixed by '_') 'html_field' => when $html_field != '_'.$field
$options array array possible: 'title' the title of the matrix 'canedit' 'default_class' the default CSS class used for the row
Результат random value used to generate the ids

displayTabContentForItem() статический публичный Метод

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

dropdownHelpdeskItemtypes() статический публичный Метод

Dropdown profiles which have rights under the active one
static public dropdownHelpdeskItemtypes ( $options )
$options array of possible options: - name : string / name of the select (default is profiles_id) - values : array of values

dropdownNoneReadWrite() статический публичный Метод

Make a select box for a None Read Write choice
static public dropdownNoneReadWrite ( $name, $value, $none = 1, $read = 1, $write = 1 ) : nothing
$name select name
$value preselected value.
$none display none choice ? (default 1)
$read display read choice ? (default 1)
$write display write choice ? (default 1)
Результат nothing (print out an HTML select box) \deprecated since version 0.84 use dropdownRight instead

dropdownRight() статический публичный Метод

Make a select box for a None Read Write choice
static public dropdownRight ( $name, $options = [] ) : nothing
$name select name
$options array of possible options: - value : preselected value. - nonone : hide none choice ? (default false) - noread : hide read choice ? (default false) - nowrite : hide write choice ? (default false) - display : display or get string (default true) - rand : specific rand (default is generated one)
Результат nothing (print out an HTML select box)

dropdownRights() статический публичный Метод

Make a select box for rights
static public dropdownRights ( array $values, $name, $current, $options = [] )
$values array array of values to display
$name integer name of the dropdown
$current integer value in database (sum of rights)
$options array

dropdownUnder() статический публичный Метод

Dropdown profiles which have rights under the active one
static public dropdownUnder ( $options = [] )
$options array of possible options: - name : string / name of the select (default is profiles_id) - value : integer / preselected value (default 0)

getDefault() статический публичный Метод

Get the default Profile for new user
static public getDefault ( ) : integer
Результат integer profiles_id

getForbiddenStandardMassiveAction() публичный Метод

getHelpdeskHardwareTypeName() статический публичный Метод

static public getHelpdeskHardwareTypeName ( $value )
$value

getHelpdeskHardwareTypes() статический публичный Метод

static public getHelpdeskHardwareTypes ( $rights = false )
$rights boolean (false by default)

getHelpdeskItemtypes() статический публичный Метод

static public getHelpdeskItemtypes ( )

getInterfaceName() статический публичный Метод

static public getInterfaceName ( $value )
$value

getInterfaces() статический публичный Метод

static public getInterfaces ( )

getLinearRightChoice() статический публичный Метод

Get right linear right choice.
static public getLinearRightChoice ( array $elements, array $options = [] ) : content
$elements array array all pair identifier => label
$options array array possible: 'canedit' 'field' name of the HTML field 'value' the value inside the database 'max_per_line' maximum number of elements per line 'check_all' add a checkbox to check or uncheck every checkbox 'rand' random value used to generate the ids 'zero_on_empty' do we send 0 when checkbox is not checked ? 'display' 'check_method' method used to check the right
Результат content if !display

getRightsFor() статический публичный Метод

Get rights for an itemtype
static public getRightsFor ( $itemtype, $interface = 'central' ) : rights
$itemtype string itemtype
$interface string (default 'central')
Результат rights

getSearchOptions() публичный Метод

public getSearchOptions ( )

getSpecificValueToDisplay() статический публичный Метод

static public getSpecificValueToDisplay ( $field, $values, array $options = [] )
$field
$values
$options array array

getSpecificValueToSelect() статический публичный Метод

static public getSpecificValueToSelect ( $field, $name = '', $values = '', array $options = [] )
$field
$name (default '')
$values (default '')
$options array array

getTabNameForItem() публичный Метод

public getTabNameForItem ( CommonGLPI $item, $withtemplate )
$item CommonGLPI

getTypeName() статический публичный Метод

static public getTypeName ( $nb )

getUnderActiveProfileRestrictRequest() статический публичный Метод

Get SQL restrict request to determine profiles with less rights than the active one
static public getUnderActiveProfileRestrictRequest ( $separator = "AND" ) : SQL
$separator string Separator used at the beginning of the request (default 'AND')
Результат SQL restrict string

haveUserRight() статический публичный Метод

function to check one right of a user
static public haveUserRight ( $user, $right, $valright, $entity ) : boolean
$user integer id of the user to check rights
$right string right to check
$valright integer/string/array value of the rights searched
$entity integer id of the entity
Результат boolean

post_addItem() публичный Метод

public post_addItem ( )

post_getEmpty() публичный Метод

public post_getEmpty ( )

post_getFromDB() публичный Метод

public post_getFromDB ( )

post_updateItem() публичный Метод

public post_updateItem ( $history = 1 )

pre_deleteItem() публичный Метод

check right before delete
public pre_deleteItem ( ) : boolean
Результат boolean

prepareInputForAdd() публичный Метод

public prepareInputForAdd ( $input )

prepareInputForUpdate() публичный Метод

public prepareInputForUpdate ( $input )

showForm() публичный Метод

Print the profile form headers
public showForm ( $ID, $options = [] ) : boolean
$ID integer : Id of the item to print
$options array of possible options - target filename : where to go when done. - withtemplate boolean : template or basic item
Результат boolean item found

showFormAdmin() публичный Метод

Print the central form for a profile
public showFormAdmin ( $openform = true, $closeform = true )
$openform boolean open the form (true by default)
$closeform boolean close the form (true by default)

showFormAsset() публичный Метод

Print the Asset rights form for the current profile
public showFormAsset ( $openform = true, $closeform = true )
$openform boolean open the form (true by default)
$closeform boolean close the form (true by default)

showFormLifeCycle() публичный Метод

Print the Life Cycles form for the current profile
public showFormLifeCycle ( $openform = true, $closeform = true )
$openform boolean open the form (true by default)
$closeform boolean close the form (true by default)

showFormLifeCycleHelpdesk() публичный Метод

@since version 0.85
public showFormLifeCycleHelpdesk ( $openform = true, $closeform = true )
$openform boolean open the form (true by default)
$closeform boolean close the form (true by default)

showFormManagement() публичный Метод

Print the Management rights form for the current profile
public showFormManagement ( $openform = true, $closeform = true )
$openform boolean open the form (true by default)
$closeform boolean close the form (true by default)

showFormSetup() публичный Метод

Print the central form for a profile
public showFormSetup ( $openform = true, $closeform = true )
$openform boolean open the form (true by default)
$closeform boolean close the form (true by default)

showFormTools() публичный Метод

Print the Tools rights form for the current profile
public showFormTools ( $openform = true, $closeform = true )
$openform boolean open the form (true by default)
$closeform boolean close the form (true by default)

showFormToolsHelpdesk() публичный Метод

Print the helpdesk right form for the current profile

showFormTracking() публичный Метод

Print the Tracking right form for the current profile
public showFormTracking ( $openform = true, $closeform = true )
$openform boolean open the form (true by default)
$closeform boolean close the form (true by default)

showFormTrackingHelpdesk() публичный Метод

Print the helpdesk right form for the current profile

showLegend() публичный Метод

public showLegend ( )

Описание свойств

$common_fields публичное статическое свойство

Common fields used for all profiles type
public static $common_fields

$dohistory публичное свойство

public $dohistory

$helpdesk_rights публичное статическое свойство

Helpdesk fields of helpdesk profiles
public static $helpdesk_rights

$rightname статическое публичное свойство

static public $rightname