PHP 클래스 Search, glpi

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

공개 프로퍼티들

프로퍼티 타입 설명
$output_type

공개 메소드들

메소드 설명
addDefaultJoin ( $itemtype, $ref_table, array &$already_link_tables ) : Left Generic Function to add Default left join to a request
addDefaultSelect ( $itemtype ) : select Generic Function to add default select to a request
addDefaultToView ( $itemtype ) : select Generic Function to add default columns to view
addDefaultWhere ( $itemtype ) : select Generic Function to add default where to a request
addHaving ( $LINK, $NOT, $itemtype, $ID, $searchtype, $val, $meta, $num ) : select Generic Function to add GROUP BY to a request
addLeftJoin ( $itemtype, $ref_table, array &$already_link_tables, $new_table, $linkfield, $meta, $meta_type, $joinparams = [], $field = '' ) : Left Generic Function to add left join to a request
addMetaLeftJoin ( $from_type, $to_type, array &$already_link_tables2, $nullornott, $joinparams = [] ) : Meta Generic Function to add left join for meta items
addOrderBy ( $itemtype, $ID, $order, $key ) : select Generic Function to add ORDER BY to a request
addSelect ( $itemtype, $ID, $num, $meta, $meta_type ) : select Generic Function to add select to a request
addWhere ( $link, $nott, $itemtype, $ID, $searchtype, $val, $meta ) : select Generic Function to add where to a request
computeComplexJoinID ( array $joinparams )
computeTitle ( $data ) : string Compute title (use case of PDF OUTPUT)
constructDatas ( array &$data ) : nothing Retrieve datas from DB : construct data array containing columns definitions and rows datas
constructSQL ( array &$data ) : nothing Construct SQL request depending of search parameters
csv_clean ( $value ) : clean Clean display value for csv export
displayConfigItem ( $itemtype, $ID, $data = [], $num ) : string Generic Function to display Items
displayDatas ( array &$data ) : nothing Display datas extracted from DB
explodeWithID ( $pattern, $subject )
getActionsFor ( $itemtype, $field_num )
getCleanedOptions ( $itemtype, $action = READ, $withplugins = true ) : clean Clean search options depending of user active profile
getDatas ( $itemtype, $params, array $forcedisplay = [] ) : data Get datas based on search parameters
getLogicalOperators ( )
getMetaItemtypeAvailable ( $itemtype ) : Array Get meta types available for search engine
getMetaReferenceItemtype ( $itemtype )
getOptionNumber ( $itemtype, $field ) : integer Get an option number in the SEARCH_OPTION array
getOptions ( $itemtype, $withplugins = true ) : the Get the SEARCH_OPTION array
giveItem ( $itemtype, $ID, array $data, $num, $meta, array $addobjectparams = [] ) : string Generic Function to display Items
isDeletedSwitch ( $is_deleted ) : string
isInfocomOption ( $itemtype, $searchID ) : boolean Is the search item related to infocoms
makeTextCriteria ( $field, $val, $not = false, $link = 'AND' ) : search Create SQL search condition
makeTextSearch ( $val, $not = false ) : search Create SQL search condition
manageParams ( $itemtype, $params = [], $usesession = true, $forcebookmark = false ) : parsed Completion of the URL $_GET values with the $_SESSION values or define default values
prepareDatasForSearch ( $itemtype, array $params, array $forcedisplay = [] ) : array Prepare search criteria to be used for a search
resetSaveSearch ( ) : nothing Reset save searches
show ( $itemtype ) : nothing Display search engine for an type
showBeginHeader ( $type ) : string Print begin of header part
showEndHeader ( $type ) : string Print end of header part
showEndLine ( $type ) : string Print generic end line
showError ( $type ) : string Print generic error
showFooter ( $type, $title = "" ) : string Print generic footer
showGenericSearch ( $itemtype, array $params ) : nothing Print generic search form
showHeader ( $type, $rows, $cols, $fixed ) : string Print generic footer
showHeaderItem ( $type, $value, &$num, $linkto = "", $issort, $order = "", $options = "" ) : string Print generic Header Column
showItem ( $type, $value, &$num, $row, $extraparam = '' ) : string Print generic normal Item Cell
showList ( $itemtype, $params ) : nothing Display result table for search engine for an type
showNewLine ( $type, $odd = false, $is_deleted = false ) : string Print generic new line
sylk_clean ( $value ) : clean Clean display value for sylk export

메소드 상세

addDefaultJoin() 정적인 공개 메소드

Generic Function to add Default left join to a request
static public addDefaultJoin ( $itemtype, $ref_table, array &$already_link_tables ) : Left
$itemtype reference ID
$ref_table reference table
$already_link_tables array
리턴 Left join string

addDefaultSelect() 정적인 공개 메소드

Generic Function to add default select to a request
static public addDefaultSelect ( $itemtype ) : select
$itemtype device type
리턴 select string

addDefaultToView() 정적인 공개 메소드

Generic Function to add default columns to view
static public addDefaultToView ( $itemtype ) : select
$itemtype device type
리턴 select string

addDefaultWhere() 정적인 공개 메소드

Generic Function to add default where to a request
static public addDefaultWhere ( $itemtype ) : select
$itemtype device type
리턴 select string

addHaving() 정적인 공개 메소드

Generic Function to add GROUP BY to a request
static public addHaving ( $LINK, $NOT, $itemtype, $ID, $searchtype, $val, $meta, $num ) : select
$LINK link to use
$NOT is is a negative search ?
$itemtype item type
$ID ID of the item to search
$searchtype search type ('contains' or 'equals')
$val value search
$meta is it a meta item ?
$num item number
리턴 select string

addLeftJoin() 정적인 공개 메소드

Generic Function to add left join to a request
static public addLeftJoin ( $itemtype, $ref_table, array &$already_link_tables, $new_table, $linkfield, $meta, $meta_type, $joinparams = [], $field = '' ) : Left
$itemtype item type
$ref_table reference table
$already_link_tables array array of tables already joined
$new_table new table to join
$linkfield linkfield for LeftJoin
$meta is it a meta item ? (default 0)
$meta_type meta type table (default 0)
$joinparams array join parameters (condition / joinbefore...)
$field string field to display (needed for translation join) (default '')
리턴 Left join string

addMetaLeftJoin() 정적인 공개 메소드

Generic Function to add left join for meta items
static public addMetaLeftJoin ( $from_type, $to_type, array &$already_link_tables2, $nullornott, $joinparams = [] ) : Meta
$from_type reference item type ID
$to_type item type to add
$already_link_tables2 array array of tables already joined
$nullornott Used LEFT JOIN (null generation) or INNER JOIN for strict join
리턴 Meta Left join string

addOrderBy() 정적인 공개 메소드

Generic Function to add ORDER BY to a request
static public addOrderBy ( $itemtype, $ID, $order, $key ) : select
$itemtype ID of the device type
$ID field to add
$order order define
$key item number (default 0)
리턴 select string

addSelect() 정적인 공개 메소드

Generic Function to add select to a request
static public addSelect ( $itemtype, $ID, $num, $meta, $meta_type ) : select
$itemtype item type
$ID ID of the item to add
$num item num in the reque (default 0)
$meta boolean is a meta
$meta_type meta type table ID (default 0)
리턴 select string

addWhere() 정적인 공개 메소드

Generic Function to add where to a request
static public addWhere ( $link, $nott, $itemtype, $ID, $searchtype, $val, $meta ) : select
$link link string
$nott is it a negative search ?
$itemtype item type
$ID ID of the item to search
$searchtype searchtype used (equals or contains)
$val item num in the request
$meta is a meta search (meta=2 in search.class.php) (default 0)
리턴 select string

computeComplexJoinID() 정적인 공개 메소드

static public computeComplexJoinID ( array $joinparams )
$joinparams array array

computeTitle() 정적인 공개 메소드

Compute title (use case of PDF OUTPUT)
static public computeTitle ( $data ) : string
$data array data of search
리턴 string title

constructDatas() 정적인 공개 메소드

add to data array a field data containing : cols : columns definition rows : rows data
static public constructDatas ( array &$data ) : nothing
$data array array of search datas prepared to get datas
리턴 nothing

constructSQL() 정적인 공개 메소드

add to data array a field sql containing an array of requests : search : request to get items limited to wanted ones count : to count all items based on search criterias may be an array a request : need to add counts maybe empty : use search one to count
static public constructSQL ( array &$data ) : nothing
$data array array of search datas prepared to generate SQL
리턴 nothing

csv_clean() 정적인 공개 메소드

Clean display value for csv export
static public csv_clean ( $value ) : clean
$value string value
리턴 clean value

displayConfigItem() 정적인 공개 메소드

Generic Function to display Items
static public displayConfigItem ( $itemtype, $ID, $data = [], $num ) : string
$itemtype item type
$ID ID of the SEARCH_OPTION item
$data array retrieved data array
$num number of the displayed item (default 0)
리턴 string to print

displayDatas() 정적인 공개 메소드

Display datas extracted from DB
static public displayDatas ( array &$data ) : nothing
$data array array of search datas prepared to get datas
리턴 nothing

explodeWithID() 정적인 공개 메소드

static public explodeWithID ( $pattern, $subject )
$pattern
$subject

getActionsFor() 정적인 공개 메소드

static public getActionsFor ( $itemtype, $field_num )
$itemtype
$field_num

getCleanedOptions() 정적인 공개 메소드

Clean search options depending of user active profile
static public getCleanedOptions ( $itemtype, $action = READ, $withplugins = true ) : clean
$itemtype item type to manage
$action action which is used to manupulate searchoption (default READ)
$withplugins boolean get plugins options (true by default)
리턴 clean $SEARCH_OPTION array

getDatas() 정적인 공개 메소드

Get datas based on search parameters
static public getDatas ( $itemtype, $params, array $forcedisplay = [] ) : data
$itemtype item type to manage
$params search params passed to prepareDatasForSearch function
$forcedisplay array array of columns to display (default empty = empty use display pref and search criterias)
리턴 data array

getLogicalOperators() 정적인 공개 메소드

static public getLogicalOperators ( )

getMetaItemtypeAvailable() 정적인 공개 메소드

Get meta types available for search engine
static public getMetaItemtypeAvailable ( $itemtype ) : Array
$itemtype type to display the form
리턴 Array of available itemtype

getMetaReferenceItemtype() 정적인 공개 메소드

static public getMetaReferenceItemtype ( $itemtype )
$itemtype

getOptionNumber() 정적인 공개 메소드

Get an option number in the SEARCH_OPTION array
static public getOptionNumber ( $itemtype, $field ) : integer
$itemtype
$field name
리턴 integer

getOptions() 정적인 공개 메소드

Get the SEARCH_OPTION array
static public getOptions ( $itemtype, $withplugins = true ) : the
$itemtype
$withplugins boolean get search options from plugins (true by default)
리턴 the reference to array of search options for the given item type

giveItem() 정적인 공개 메소드

Generic Function to display Items
static public giveItem ( $itemtype, $ID, array $data, $num, $meta, array $addobjectparams = [] ) : string
$itemtype item type
$ID ID of the SEARCH_OPTION item
$data array array containing data results
$num item num in the request
$meta is a meta item ? (default 0)
$addobjectparams array array added parameters for union search
리턴 string to print

isDeletedSwitch() 정적인 공개 메소드

static public isDeletedSwitch ( $is_deleted ) : string
$is_deleted
리턴 string

isInfocomOption() 정적인 공개 메소드

Is the search item related to infocoms
static public isInfocomOption ( $itemtype, $searchID ) : boolean
$itemtype item type
$searchID ID of the element in $SEARCHOPTION
리턴 boolean

makeTextCriteria() 정적인 공개 메소드

Create SQL search condition
static public makeTextCriteria ( $field, $val, $not = false, $link = 'AND' ) : search
$field name (should be ` protected)
$val string value to search
$not boolean is a negative search ? (false by default)
$link with previous criteria (default 'AND')
리턴 search SQL string

makeTextSearch() 정적인 공개 메소드

Create SQL search condition
static public makeTextSearch ( $val, $not = false ) : search
$val string value to search
$not boolean is a negative search ? (false by default)
리턴 search string

manageParams() 정적인 공개 메소드

Completion of the URL $_GET values with the $_SESSION values or define default values
static public manageParams ( $itemtype, $params = [], $usesession = true, $forcebookmark = false ) : parsed
$itemtype item type to manage
$params array params to parse
$usesession Use datas save in session (true by default)
$forcebookmark force trying to load parameters from default bookmark: used for global search (false by default)
리턴 parsed params array

prepareDatasForSearch() 정적인 공개 메소드

Prepare search criteria to be used for a search
static public prepareDatasForSearch ( $itemtype, array $params, array $forcedisplay = [] ) : array
$itemtype item type
$params array array of parameters may include sort, order, start, list_limit, deleted, criteria, metacriteria
$forcedisplay array array of columns to display (default empty = empty use display pref and search criterias)
리턴 array prepare to be used for a search (include criterias and others needed informations)

resetSaveSearch() 정적인 공개 메소드

Reset save searches
static public resetSaveSearch ( ) : nothing
리턴 nothing

show() 정적인 공개 메소드

Display search engine for an type
static public show ( $itemtype ) : nothing
$itemtype item type to manage
리턴 nothing

showBeginHeader() 정적인 공개 메소드

Print begin of header part
static public showBeginHeader ( $type ) : string
$type display type (0=HTML, 1=Sylk,2=PDF,3=CSV)
리턴 string to display

showEndHeader() 정적인 공개 메소드

Print end of header part
static public showEndHeader ( $type ) : string
$type display type (0=HTML, 1=Sylk,2=PDF,3=CSV)
리턴 string to display

showEndLine() 정적인 공개 메소드

Print generic end line
static public showEndLine ( $type ) : string
$type display type (0=HTML, 1=Sylk,2=PDF,3=CSV)
리턴 string to display

showError() 정적인 공개 메소드

Print generic error
static public showError ( $type ) : string
$type display type (0=HTML, 1=Sylk,2=PDF,3=CSV)
리턴 string to display

showFooter() 정적인 공개 메소드

Print generic footer
static public showFooter ( $type, $title = "" ) : string
$type display type (0=HTML, 1=Sylk,2=PDF,3=CSV)
$title title of file : used for PDF (default '')
리턴 string to display

showGenericSearch() 정적인 공개 메소드

Params need to parsed before using Search::manageParams function
static public showGenericSearch ( $itemtype, array $params ) : nothing
$itemtype type to display the form
$params array array of parameters may include sort, is_deleted, criteria, metacriteria
리턴 nothing (displays)

showHeader() 정적인 공개 메소드

Print generic footer
static public showHeader ( $type, $rows, $cols, $fixed ) : string
$type display type (0=HTML, 1=Sylk,2=PDF,3=CSV)
$rows number of rows
$cols number of columns
$fixed used tab_cadre_fixe table for HTML export ? (default 0)
리턴 string to display

showHeaderItem() 정적인 공개 메소드

Print generic Header Column
static public showHeaderItem ( $type, $value, &$num, $linkto = "", $issort, $order = "", $options = "" ) : string
$type display type (0=HTML, 1=Sylk,2=PDF,3=CSV)
$value value to display
$linkto link display element (HTML specific) (default '')
$issort is the sort column ? (default 0)
$order order type ASC or DESC (defaut '')
$options string options to add (default '')
리턴 string to display

showItem() 정적인 공개 메소드

Print generic normal Item Cell
static public showItem ( $type, $value, &$num, $row, $extraparam = '' ) : string
$type display type (0=HTML, 1=Sylk,2=PDF,3=CSV)
$value value to display
$row row number
$extraparam extra parameters for display (default '')
리턴 string to display

showList() 정적인 공개 메소드

Display result table for search engine for an type
static public showList ( $itemtype, $params ) : nothing
$itemtype item type to manage
$params search params passed to prepareDatasForSearch function
리턴 nothing

showNewLine() 정적인 공개 메소드

Print generic new line
static public showNewLine ( $type, $odd = false, $is_deleted = false ) : string
$type display type (0=HTML, 1=Sylk,2=PDF,3=CSV)
$odd is it a new odd line ? (false by default)
$is_deleted is it a deleted search ? (false by default)
리턴 string to display

sylk_clean() 정적인 공개 메소드

Clean display value for sylk export
static public sylk_clean ( $value ) : clean
$value string value
리턴 clean value

프로퍼티 상세

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

static public $output_type