PHP Class Document, glpi

Inheritance: extends CommonDBTM
Afficher le fichier Open project: glpi-project/glpi Class Usage Examples

Méthodes publiques

Свойство Type Description
$dohistory From CommonDBTM
$rightname
$tag_prefix

Protected Properties

Свойство Type Description
$forward_entity_to
$usenotepad

Méthodes publiques

Méthode Description
canApplyOn ( $item ) : true Check if given object can have Document
canCreate ( )
canCreateItem ( )
canViewFile ( $options ) : boolean Check is the curent user is allowed to see the file
cleanDBonPurge ( )
defineTabs ( $options = [] )
dropdown ( $options = [] ) : nothing Make a select box for link document
getDownloadLink ( $params = '', $len = 20 ) Get download link for a document
getFromDBbyContent ( $entity, $path ) : boolean find a document with a file attached
getImageTag ( $string ) : string
getItemtypesThatCanHave ( ) : array Get all the types that can have a document
getMassiveActionsForItemtype ( array &$actions, $itemtype, $is_deleted, CommonDBTM $checkitem = NULL )
getMaxUploadSize ( ) Get max upload size from php config
getMenuShorcut ( )
getSearchOptions ( )
getSearchOptionsToAdd ( )
getSpecificMassiveActions ( $checkitem = NULL )
getTypeName ( $nb )
getUploadFileValidLocationName ( $dir, $sha1sum ) : nothing Find a valid path for the new file
isValidDoc ( $filename ) Is this file a valid file ? check based on file extension
moveDocument ( array &$input, $filename ) : boolean Move a document (files in GLPI_DOC_DIR."/_tmp" dir)
moveUploadedDocument ( array &$input, $filename ) : boolean Move an uploadd document (files in GLPI_DOC_DIR."/_uploads" dir)
post_addItem ( )
prepareInputForAdd ( $input )
prepareInputForUpdate ( $input )
renameForce ( $srce, $dest ) : boolean Move a file to a new location Work even if dest file already exists
send ( ) Send a document to navigator
showForm ( $ID, $options = [] ) : Nothing Print the document form
showUploadedFilesDropdown ( $myname ) Show dropdown of uploaded files
uploadDocument ( array &$input, $FILEDESC ) : true Upload a new file

Method Details

canApplyOn() static public méthode

Check if given object can have Document
static public canApplyOn ( $item ) : true
$item an object or a string
Résultat true if $object is an object that can have InfoCom

canCreate() static public méthode

static public canCreate ( )

canCreateItem() public méthode

public canCreateItem ( )

canViewFile() public méthode

Check is the curent user is allowed to see the file
public canViewFile ( $options ) : boolean
$options array of options (only 'tickets_id' used)
Résultat boolean

cleanDBonPurge() public méthode

public cleanDBonPurge ( )

defineTabs() public méthode

public defineTabs ( $options = [] )

dropdown() static public méthode

Parameters which could be used in options array : - name : string / name of the select (default is documents_id) - entity : integer or array / restrict to a defined entity or array of entities (default -1 : no restriction) - used : array / Already used items ID: not to display in dropdown (default empty)
static public dropdown ( $options = [] ) : nothing
$options array of possible options
Résultat nothing (print out an HTML select box)

getFromDBbyContent() public méthode

find a document with a file attached
public getFromDBbyContent ( $entity, $path ) : boolean
$entity of the document
$path of the searched file
Résultat boolean

getImageTag() static public méthode

static public getImageTag ( $string ) : string
$string
Résultat string

getItemtypesThatCanHave() static public méthode

Get all the types that can have a document
static public getItemtypesThatCanHave ( ) : array
Résultat array of the itemtypes

getMassiveActionsForItemtype() static public méthode

See also: CommonDBTM::getMassiveActionsForItemtype()
static public getMassiveActionsForItemtype ( array &$actions, $itemtype, $is_deleted, CommonDBTM $checkitem = NULL )
$actions array
$checkitem CommonDBTM

getMaxUploadSize() static public méthode

Get max upload size from php config
static public getMaxUploadSize ( )

getMenuShorcut() static public méthode

See also: CommonGLPI::getMenuShorcut()
static public getMenuShorcut ( )

getSearchOptions() public méthode

public getSearchOptions ( )

getSearchOptionsToAdd() static public méthode

static public getSearchOptionsToAdd ( )

getSpecificMassiveActions() public méthode

See also: CommonDBTM::getSpecificMassiveActions()
public getSpecificMassiveActions ( $checkitem = NULL )

getTypeName() static public méthode

static public getTypeName ( $nb )

getUploadFileValidLocationName() static public méthode

Find a valid path for the new file
static public getUploadFileValidLocationName ( $dir, $sha1sum ) : nothing
$dir dir to search a free path for the file
$sha1sum SHA1 of the file
Résultat nothing

isValidDoc() static public méthode

Is this file a valid file ? check based on file extension
static public isValidDoc ( $filename )
$filename filename to clean

moveDocument() static public méthode

Move a document (files in GLPI_DOC_DIR."/_tmp" dir)
static public moveDocument ( array &$input, $filename ) : boolean
$input array array of datas used in adding process (need current_filepath)
$filename filename to move
Résultat boolean for success / $input array is updated

moveUploadedDocument() static public méthode

Move an uploadd document (files in GLPI_DOC_DIR."/_uploads" dir)
static public moveUploadedDocument ( array &$input, $filename ) : boolean
$input array array of datas used in adding process (need current_filepath)
$filename filename to move
Résultat boolean for success / $input array is updated

post_addItem() public méthode

public post_addItem ( )

prepareInputForAdd() public méthode

See also: CommonDBTM::prepareInputForAdd()
public prepareInputForAdd ( $input )

prepareInputForUpdate() public méthode

See also: CommonDBTM::prepareInputForUpdate()
public prepareInputForUpdate ( $input )

renameForce() static public méthode

Move a file to a new location Work even if dest file already exists
static public renameForce ( $srce, $dest ) : boolean
$srce source file path
$dest destination file path
Résultat boolean : success

send() public méthode

Send a document to navigator
public send ( )

showForm() public méthode

Print the document form
public showForm ( $ID, $options = [] ) : Nothing
$ID integer ID of the item
$options array - target filename : where to go when done. - withtemplate boolean : template or basic item
Résultat Nothing (display)

showUploadedFilesDropdown() static public méthode

Show dropdown of uploaded files
static public showUploadedFilesDropdown ( $myname )
$myname dropdown name

uploadDocument() static public méthode

Upload a new file
static public uploadDocument ( array &$input, $FILEDESC ) : true
$input array
$FILEDESC FILE descriptor
Résultat true on success

Property Details

$dohistory public_oe property

From CommonDBTM
public $dohistory

$forward_entity_to protected_oe static_oe property

protected static $forward_entity_to

$rightname static_oe public_oe property

static public $rightname

$tag_prefix static_oe public_oe property

static public $tag_prefix

$usenotepad protected_oe property

protected $usenotepad