Property | Type | Description | |
---|---|---|---|
$additional_fields_for_dictionnary | Additional fiedls for dictionnary processing | ||
$auto_message_on_action | Set false to desactivate automatic message on action | ||
$dohistory | Make an history of the changes | ||
$fields | Data of the Item | ||
$get_item_to_display_tab | Need to get item to show tab | ||
$history_blacklist | Black list fields for history log or date mod update | ||
$mailqueueonaction | FLush mail queue for | ||
$no_form_page | Set true to desactivate link generation because form page do not permit show/edit item | ||
$rightname | Profile name | ||
$taborientation | Tab orientation : horizontal or vertical |
Property | Type | Description | |
---|---|---|---|
$fkfield | Foreign key field cache : set dynamically calling getForeignKeyField | ||
$forward_entity_to | Forward entity datas to linked items | ||
$notable | Set true to desactivate auto compute table name | ||
$plugins_forward_entity | Forward entity to plugins itemtypes | ||
$searchopt | Search options of the item : to avoid multiple load | ||
$usenotepad | Is this item use notepad ? |
Method | Description | |
---|---|---|
__construct ( ) | Constructor | |
add ( array $input, $options = [], $history = true ) : integer | Add an item in the database with all it's items. | |
addForwardEntity ( $for_itemtype, $to_itemtype ) : nothing | Specificy a plugin itemtype for which entities_id and is_recursive should be forwarded | |
addMessageOnAddAction ( ) | Add a message on add action | |
addMessageOnDeleteAction ( ) | Add a message on delete action | |
addMessageOnPurgeAction ( ) | Add a message on purge action | |
addMessageOnRestoreAction ( ) | Add a message on restore action | |
addMessageOnUpdateAction ( ) | Add a message on update action | |
addNeededInfoToInput ( $input ) : the | Add needed information to $input (example entities_id) | |
addToDB ( ) : new | Add an item to the database | |
can ( $ID, $right, array &$input = NULL ) : boolean | Check right on an item | |
canAddItem ( $type ) : rights | Have I the global right to add an item for the Object May be overloaded if needed (ex Ticket) | |
canCreate ( ) : booleen | Have I the global right to "create" the Object May be overloaded if needed (ex KnowbaseItem) | |
canCreateItem ( ) : booleen | Have I the right to "create" the Object | |
canDelete ( ) : booleen | Have I the global right to "delete" the Object | |
canDeleteItem ( ) : booleen | Have I the right to "delete" the Object | |
canEdit ( $ID ) : booleen | Have i right to see action button | |
canGlobal ( $right ) : nothing | Get global right on an object | |
canMassiveAction ( $action, $field, $value ) | check if this action can be done on this field of this item by massive actions | |
canPurge ( ) : booleen | Have I the global right to "purge" the Object | |
canPurgeItem ( ) : booleen | Have I the right to "purge" the Object | |
canUnrecurs ( ) : booleen | Can I change recursive flag to false check if there is "linked" object in another entity | |
canUpdate ( ) : booleen | Have I the global right to "update" the Object | |
canUpdateItem ( ) : booleen | Have I the right to "update" the Object | |
canView ( ) : booleen | Have I the global right to "view" the Object | |
canViewItem ( ) : booleen | Have I the right to "view" the Object May be overloaded if needed | |
check ( $ID, $right, array &$input = NULL ) : nothing | Check right on an item with block | |
checkEntity ( $recursive = false ) : booleen | Check if have right on this entity | |
checkGlobal ( $right ) : nothing | Check global right on an object | |
checkSpecificValues ( $datatype, &$value ) : true | Add more check for values | |
checkUnicity ( $add = false, $options = [] ) : true | Check field unicity before insert or update | |
cleanDBonMarkDeleted ( ) : nothing | Actions done when item flag deleted is set to an item | |
cleanDBonPurge ( ) : nothing | Actions done when item is deleted from the database | |
cleanHistory ( ) : nothing | Clean data in the tables which have linked the deleted item | |
cleanRelationData ( ) : nothing | Clean data in the tables which have linked the deleted item Clear 1/N Relation | |
cleanRelationTable ( ) | Clean the date in the relation tables for the deleted item Clear N/N Relation | |
cleanTranslations ( ) | Clean translations associated to a dropdown | |
delete ( array $input, $force, $history = 1 ) : boolean | Delete an item in the database. | |
deleteByCriteria ( $crit = [], $force, $history = 1 ) | Clean all infos which match some criteria | |
deleteFromDB ( $force ) : true | Mark deleted or purge an item in the database | |
dropdown ( $options = [] ) : nothing | Print out an HTML " | |
filterValues ( $display = true ) : input | Check float and decimal values | |
find ( $condition = "", $order = "", $limit = "" ) : all | Retrieve all items from the database | |
forceTable ( $table ) : nothing | force table value (used for config management for old versions) | |
generateLinkContents ( $link, CommonDBTM $item ) : array | Generate link | |
getComments ( ) : String: | Get comments of the Object | |
getCompleteNameField ( ) | ||
getEmpty ( ) : true | Get an empty item | |
getEntityID ( ) : ID | Get the ID of entity assigned to the object | |
getField ( $field ) : value | Return a field Value if exists | |
getForbiddenStandardMassiveAction ( ) : an | Get the standard massive actions which are forbidden | |
getForeignKeyField ( ) | ||
getFromDB ( $ID ) : true | Retrieve an item from the database | |
getFromDBByQuery ( $query ) : true | Retrieve an item from the database by query. The query must include the WHERE keyword. Thus, we can replace "WHERE" to make complex SQL JOINED queries (for instance, see User::getFromDBbyEmail()). | |
getID ( ) : ID | Get the identifier of the current item | |
getIndexName ( ) : name | Get the name of the index field | |
getItemEntity ( $itemtype, $items_id ) : integer | get the Entity of an Item | |
getLink ( $options = [] ) : string | Get the link to an item | |
getLinkURL ( ) : string | Get the link url to an item | |
getLinkedItems ( ) : an | Return the linked items (in computers_items) | |
getLinkedItemsCount ( ) : number | Return the count of linked items (in computers_items) | |
getLogTypeID ( ) : array | Get type to register log on | |
getMassiveActionsForItemtype ( array &$actions, $itemtype, $is_deleted, CommonDBTM $checkitem = NULL ) : nothing | Get all the massive actions available for the current class regarding given itemtype | |
getName ( $options = [] ) : String: | Get the name of the object | |
getNameField ( ) | ||
getNameID ( $options = [] ) : String: | Get the name of the object with the ID if the config is set Should Not be overloaded (overload getName() instead) | |
getOptions ( ) : then | Get search options | |
getPostAdditionalInfosForName ( ) : String: | Get additionals information to add after name | |
getPreAdditionalInfosForName ( ) : String: | Get additionals information to add before name | |
getRawCompleteName ( ) | Get raw completename of the object Maybe overloaded | |
getRawName ( ) | Get raw name of the object Maybe overloaded | |
getRights ( $interface = 'central' ) : array | Get rights for an item _ may be overload by object | |
getSearchOptionByField ( $field, $value, $table = '' ) : then | Return a search option by looking for a value of a specific field and maybe a specific table | |
getSearchOptionIDByField ( $field, $value, $table = '' ) : then | Return a search option ID by looking for a value of a specific field and maybe a specific table | |
getSearchOptions ( ) : an | Get the Search options for the given Type | |
getSpecificMassiveActions ( $checkitem = NULL ) : an | Get the specific massive actions | |
getSpecificValueToDisplay ( $field, $values, array $options = [] ) : return | display a specific field value | |
getSpecificValueToSelect ( $field, $name = '', $values = '', array $options = [] ) : return | display a specific field selection system | |
getTable ( ) : string | Return the table used to stor this object | |
getUnallowedFieldsForUnicity ( ) | ||
getUnicityErrorMessage ( $msgs, $unicity, $doubles ) | Build an unicity error message | |
getUnicityFieldsToDisplayInErrorMessage ( ) : an | Get fields to display in the unicity error message | |
getValueToDisplay ( $field_id_or_search_options, $values, $options = [] ) : return | display a field using standard system | |
getValueToSelect ( $field_id_or_search_options, $name = '', $values = '', $options = [] ) : return | Select a field using standard system | |
initForm ( $ID, array $options = [] ) : value | Initialize item and check right before managing the edit form | |
isDeleted ( ) : boolean | Is the object deleted | |
isDynamic ( ) : boolean | Is an object dynamic or not | |
isEntityAssign ( ) : boolean | Is the object assigned to an entity | |
isEntityForwardTo ( $itemtype ) : boolean | Is entity informations forward To ? | |
isField ( $field ) : boolean | Determine if a field exists | |
isNewID ( $ID ) : boolean | is the parameter ID must be considered as new one ? Default is empty of <0 may be overriden (for entity for example) | |
isNewItem ( ) : boolean | is the current object a new one | |
isPrivate ( ) : boolean | Is the object private | |
isRecursive ( ) : boolean | Is the object recursive | |
isTemplate ( ) : boolean | Is the object a template | |
listTemplates ( $itemtype, $target, $add ) | ||
maybeDeleted ( ) : boolean | Is the object may be deleted | |
maybeDynamic ( ) : boolean | Can the object be dynamic | |
maybePrivate ( ) : boolean | Is the object may be private | |
maybeRecursive ( ) : boolean | Is the object may be recursive | |
maybeTemplate ( ) : boolean | Is the object may be a template | |
post_addItem ( ) : nothing | Actions done after the ADD of the item in the database | |
post_deleteFromDB ( ) : nothing | Actions done after the DELETE of the item in the database | |
post_deleteItem ( ) : nothing | Actions done after the DELETE (mark as deleted) of the item in the database | |
post_getEmpty ( ) : nothing | Actions done at the end of the getEmpty function | |
post_getFromDB ( ) : nothing | Actions done at the end of the getFromDB function | |
post_purgeItem ( ) : nothing | Actions done after the PURGE of the item in the database | |
post_restoreItem ( ) : nothing | Actions done after the restore of the item | |
post_updateItem ( $history = 1 ) : nothing | Actions done after the UPDATE of the item in the database | |
pre_deleteItem ( ) : boolean | Actions done before the DELETE of the item in the database / Maybe used to add another check for deletion | |
pre_updateInDB ( ) : nothing | Actions done before the UPDATE of the item in the database | |
prepareInputForAdd ( $input ) : the | Prepare input datas for adding the item | |
prepareInputForUpdate ( $input ) : the | Prepare input datas for updating the item | |
processMassiveActionsForOneItemtype ( MassiveAction $ma, CommonDBTM $item, array $ids ) : nothing | Class specific execution of the massive action (new system) by itemtypes | |
reset ( ) | Reset fields of the item | |
restore ( array $input, $history = 1 ) : boolean | Restore an item put in the dustbin in the database. | |
restoreInDB ( ) : true | Restore item = set deleted flag to 0 | |
showDates ( $options = [] ) : boolean | ||
showFormButtons ( $options = [] ) | Display a 2 columns Footer for Form buttons Close the form is user can edit | |
showFormHeader ( $options = [] ) | Display a 2 columns Header 1 for ID, 1 for recursivity menu Open the form is user can edit | |
showMassiveActionsSubForm ( MassiveAction $ma ) : false | Class-specific method used to show the fields to specify the massive action | |
unsetUndisclosedFields ( array &$fields ) | Actions done to not show some fields when geting a single item from API calls | |
update ( array $input, $history = 1, $options = [] ) : boolean | Update some elements of an item in the database. | |
updateInDB ( $updates, $oldvalues = [] ) : nothing | Update the item in the database | |
useDeletedToLockIfDynamic ( ) : boolean | Use deleted field in case of dynamic management to lock ? |
Method | Description | |
---|---|---|
clearSavedInput ( ) | Clear the saved data stored in the session | |
forwardEntityInformations ( ) | Forward entity information to linked items | |
restoreInput ( array $default = [] ) : Array | Get the data saved in the session | |
saveInput ( ) | Save the input data in the Session |
static public addForwardEntity ( $for_itemtype, $to_itemtype ) : nothing | ||
$for_itemtype | change of entity for this itemtype will be forwarder | |
$to_itemtype | change of entity will affect this itemtype | |
return | nothing |
public addMessageOnDeleteAction ( ) |
public addMessageOnPurgeAction ( ) |
public addMessageOnRestoreAction ( ) |
public addMessageOnUpdateAction ( ) |
public addNeededInfoToInput ( $input ) : the | ||
$input | datas used to add the item | |
return | the | modified $input array |
public addToDB ( ) : new | ||
return | new | ID of the item is insert successfull else false |
public canAddItem ( $type ) : rights | ||
$type | itemtype of object to add | |
return | rights |
static public canCreate ( ) : booleen | ||
return | booleen |
public canCreateItem ( ) : booleen | ||
return | booleen |
static public canDelete ( ) : booleen | ||
return | booleen |
public canDeleteItem ( ) : booleen | ||
return | booleen |
public canEdit ( $ID ) : booleen | ||
$ID | integer ID to check | |
return | booleen |
public canGlobal ( $right ) : nothing | ||
$right | Right to check : c / r / w / d / READ / UPDATE / CREATE / DELETE | |
return | nothing |
public canMassiveAction ( $action, $field, $value ) | ||
$action | string name of the action | |
$field | integer id of the field | |
$value | string value of the field |
static public canPurge ( ) : booleen | ||
return | booleen |
public canPurgeItem ( ) : booleen | ||
return | booleen |
public canUnrecurs ( ) : booleen | ||
return | booleen |
static public canUpdate ( ) : booleen | ||
return | booleen |
public canUpdateItem ( ) : booleen | ||
return | booleen |
static public canView ( ) : booleen | ||
return | booleen |
public canViewItem ( ) : booleen | ||
return | booleen |
public checkEntity ( $recursive = false ) : booleen | ||
$recursive | boolean set true to accept recursive items of ancestors of active entities (View case for example) (default false) | |
return | booleen |
public checkGlobal ( $right ) : nothing | ||
$right | Right to check : c / r / w / d | |
return | nothing |
public checkSpecificValues ( $datatype, &$value ) : true | ||
$datatype | datatype of the value | |
return | true | if value is ok, false if not |
public checkUnicity ( $add = false, $options = [] ) : true | ||
$options | array | |
return | true | if item can be written in DB, false if not |
public cleanDBonMarkDeleted ( ) : nothing | ||
return | nothing |
public cleanDBonPurge ( ) : nothing | ||
return | nothing |
public cleanHistory ( ) : nothing | ||
return | nothing |
public cleanRelationData ( ) : nothing | ||
return | nothing |
public cleanRelationTable ( ) |
public cleanTranslations ( ) |
protected clearSavedInput ( ) |
public deleteByCriteria ( $crit = [], $force, $history = 1 ) | ||
$crit | array of criteria (ex array('is_active'=>'1')) | |
$force | boolean force purge not on put in dustbin (default 0) | |
$history | boolean do history log ? (true by default) |
public deleteFromDB ( $force ) : true | ||
$force | force the purge of the item (not used if the table do not have a deleted field) (default 0) | |
return | true | if succeed else false |
static public dropdown ( $options = [] ) : nothing | ||
$options | array of possible options: Parameters which could be used in options array : - name : string / name of the select (default is depending itemtype) - value : integer / preselected value (default 0) - comments : boolean / is the comments displayed near the dropdown (default true) - entity : integer or array / restrict to a defined entity or array of entities (default -1 : no restriction) - toupdate : array / Update a specific item on select change on dropdown (need value_fieldname, to_update, url (see Ajax::updateItemOnSelectEvent for information) and may have moreparams) - used : array / Already used items ID: not to display in dropdown (default empty) | |
return | nothing | display the dropdown |
public filterValues ( $display = true ) : input | ||
$display | display or not messages in and addAfterRedirect (true by default) | |
return | input | the data checked |
public find ( $condition = "", $order = "", $limit = "" ) : all | ||
$condition | condition used to search if needed (empty get all) (default '') | |
$order | order field if needed (default '') | |
$limit | limit retrieved datas if needed (default '') | |
return | all | retrieved data in a associative array by id |
static public forceTable ( $table ) : nothing | ||
$table | name of the table to be forced | |
return | nothing |
protected forwardEntityInformations ( ) |
static public generateLinkContents ( $link, CommonDBTM $item ) : array | ||
$link | string original string content | |
$item | CommonDBTM | CommonDBTM object: item used to make replacements |
return | array | of link contents (may have several when item have several IP / MAC cases) |
public getComments ( ) : String: | ||
return | String: |
public getEmpty ( ) : true | ||
return | true | if succeed else false |
public getEntityID ( ) : ID | ||
return | ID | of the entity |
public getField ( $field ) : value | ||
$field | field name | |
return | value | of the field / false if not exists |
public getForbiddenStandardMassiveAction ( ) : an | ||
return | an | array of massive actions |
public getFromDB ( $ID ) : true | ||
$ID | ID of the item to get | |
return | true | if succeed else false |
public getFromDBByQuery ( $query ) : true | ||
$query | the "WHERE" or "JOIN" part of the SQL query | |
return | true | if succeed else false |
static public getIndexName ( ) : name | ||
return | name | of the index field |
static public getItemEntity ( $itemtype, $items_id ) : integer | ||
$itemtype | string item type | |
$items_id | integer id of the item | |
return | integer | ID of the entity or -1 |
public getLink ( $options = [] ) : string | ||
$options | array of options - comments : boolean / display comments - complete : boolean / display completename instead of name - additional : boolean / display additionals information - linkoption : string / additional options to add to | |
return | string | : HTML link |
public getLinkURL ( ) : string | ||
return | string | : HTML link |
public getLinkedItems ( ) : an | ||
return | an | array of linked items like array('Computer' => array(1,2), 'Printer' => array(5,6)) |
public getLinkedItemsCount ( ) : number | ||
return | number | of linked items |
public getLogTypeID ( ) : array | ||
return | array | of type + ID |
static public getMassiveActionsForItemtype ( array &$actions, $itemtype, $is_deleted, CommonDBTM $checkitem = NULL ) : nothing | ||
$actions | array | array of the actions to update |
$itemtype | the type of the item for which we want the actions | |
$is_deleted | (default 0) | |
$checkitem | CommonDBTM | (default NULL) |
return | nothing | (update is set inside $actions) |
public getName ( $options = [] ) : String: | ||
$options | array of options - comments : boolean / display comments - complete : boolean / display completename instead of name - additional : boolean / display aditionals information | |
return | String: |
public getNameID ( $options = [] ) : String: | ||
$options | array of options - comments : boolean / display comments - complete : boolean / display completename instead of name - additional : boolean / display aditionals information - forceid : boolean override config and display item's ID (false by default) | |
return | String: |
public getOptions ( ) : then | ||
return | then | search option array |
public getPostAdditionalInfosForName ( ) : String: | ||
return | String: |
public getPreAdditionalInfosForName ( ) : String: | ||
return | String: |
public getRawCompleteName ( ) |
public getSearchOptionByField ( $field, $value, $table = '' ) : then | ||
$field | the field in which looking for the value (for example : table, name, etc) | |
$value | the value to look for in the field | |
$table | the table (default '') | |
return | then | search option array, or an empty array if not found |
public getSearchOptionIDByField ( $field, $value, $table = '' ) : then | ||
$field | the field in which looking for the value (for example : table, name, etc) | |
$value | the value to look for in the field | |
$table | the table (default '') | |
return | then | search option id, or -1 if not found |
public getSearchOptions ( ) : an | ||
return | an | array of search options More information on https://forge.indepnet.net/wiki/glpi/SearchEngine |
public getSpecificMassiveActions ( $checkitem = NULL ) : an | ||
$checkitem | link item to check right (default NULL) | |
return | an | array of massive actions |
static public getSpecificValueToDisplay ( $field, $values, array $options = [] ) : return | ||
$field | String name of the field | |
$values | String/Array with the value to display or a Single value | |
$options | array | Array of options |
return | return | the string to display |
static public getSpecificValueToSelect ( $field, $name = '', $values = '', array $options = [] ) : return | ||
$field | String name of the field | |
$name | string name of the select (if empty use linkfield) (default '') | |
$values | String/Array with the value to select or a Single value (default '') | |
$options | array | Array of options |
return | return | the string to display |
public getUnicityErrorMessage ( $msgs, $unicity, $doubles ) | ||
$msgs | the string not transleted to be display on the screen, or to be sent in a notification | |
$unicity | the unicity criterion that failed to match | |
$doubles | the items that are already present in DB |
public getUnicityFieldsToDisplayInErrorMessage ( ) : an | ||
return | an | array which contains field => label |
public getValueToDisplay ( $field_id_or_search_options, $values, $options = [] ) : return | ||
$field_id_or_search_options | integer/string/array id of the search option field or field name or search option array | |
$values | mixed value to display | |
$options | array of possible options: Parameters which could be used in options array : - comments : boolean / is the comments displayed near the value (default false) - any others options passed to specific display method | |
return | return | the string to display |
public getValueToSelect ( $field_id_or_search_options, $name = '', $values = '', $options = [] ) : return | ||
$field_id_or_search_options | integer/string/array id of the search option field or field name or search option array | |
$name | string name of the select (if empty use linkfield) (default '') | |
$values | mixed default value to display (default '') | |
$options | array of possible options: Parameters which could be used in options array : - comments : boolean / is the comments displayed near the value (default false) - any others options passed to specific display method | |
return | return | the string to display |
public isEntityAssign ( ) : boolean | ||
return | boolean |
static public isEntityForwardTo ( $itemtype ) : boolean | ||
$itemtype | itemtype to check | |
return | boolean |
public isRecursive ( ) : boolean | ||
return | boolean |
static public listTemplates ( $itemtype, $target, $add ) | ||
$itemtype | ||
$target | ||
$add | (default 0) |
public maybeDeleted ( ) : boolean | ||
return | boolean |
public maybeDynamic ( ) : boolean | ||
return | boolean |
public maybePrivate ( ) : boolean | ||
return | boolean |
public maybeRecursive ( ) : boolean | ||
return | boolean |
public maybeTemplate ( ) : boolean | ||
return | boolean |
public post_addItem ( ) : nothing | ||
return | nothing |
public post_deleteFromDB ( ) : nothing | ||
return | nothing |
public post_deleteItem ( ) : nothing | ||
return | nothing |
public post_getEmpty ( ) : nothing | ||
return | nothing |
public post_getFromDB ( ) : nothing | ||
return | nothing |
public post_purgeItem ( ) : nothing | ||
return | nothing |
public post_restoreItem ( ) : nothing | ||
return | nothing |
public post_updateItem ( $history = 1 ) : nothing | ||
$history | store changes history ? (default 1) | |
return | nothing |
public pre_deleteItem ( ) : boolean | ||
return | boolean | : true if item need to be deleted else false |
public pre_updateInDB ( ) : nothing | ||
return | nothing |
public prepareInputForAdd ( $input ) : the | ||
$input | datas used to add the item | |
return | the | modified $input array |
public prepareInputForUpdate ( $input ) : the | ||
$input | datas used to update the item | |
return | the | modified $input array |
static public processMassiveActionsForOneItemtype ( MassiveAction $ma, CommonDBTM $item, array $ids ) : nothing | ||
$ma | MassiveAction | the current massive action object |
$item | CommonDBTM | the item on which apply the massive action |
$ids | array | an array of the ids of the item on which apply the action |
return | nothing | (direct submit to $ma object) |
public restoreInDB ( ) : true | ||
return | true | if succeed else false |
protected restoreInput ( array $default = [] ) : Array | ||
$default | array | Array of value used if session is empty |
return | Array | of value |
public showFormButtons ( $options = [] ) | ||
$options | array of possible options: - withtemplate : 1 for newtemplate, 2 for newobject from template - colspan for each column (default 2) - candel : set to false to hide "delete" button - canedit : set to false to hide all buttons - addbuttons : array of buttons to add |
public showFormHeader ( $options = [] ) | ||
$options | array of possible options: - target for the Form - withtemplate : 1 for newtemplate, 2 for newobject from template - colspan for each column (default 2) - formoptions string (javascript p.e.) - canedit boolean edit mode of form ? |
static public showMassiveActionsSubForm ( MassiveAction $ma ) : false | ||
$ma | MassiveAction | the current massive action object |
return | false | if parameters displayed ? |
public static unsetUndisclosedFields ( array &$fields ) | ||
$fields | array | Fields to unset undiscloseds |
public updateInDB ( $updates, $oldvalues = [] ) : nothing | ||
$updates | fields to update | |
$oldvalues | array of old values of the updated fields | |
return | nothing |
public useDeletedToLockIfDynamic ( ) : boolean | ||
return | boolean |
public $additional_fields_for_dictionnary |
public $auto_message_on_action |
protected $fkfield |
protected static $forward_entity_to |
public $get_item_to_display_tab |
public $history_blacklist |
public $no_form_page |
protected static $notable |
protected static $plugins_forward_entity |
protected $searchopt |