List of all members.

Public Member Functions

 canViewItem ()
 Have I the right to "view" the Object May be overloaded if needed.
 canUpdateItem ()
 Have I the right to "update" the Object.
 defineTabs ($options=array())
 Define tabs to display.
 getTabNameForItem (CommonGLPI $item, $withtemplate=0)
 Get Tab Name used for itemtype.
 post_getEmpty ()
 Actions done at the end of the getEmpty function.
 post_getFromDB ()
 cleanDBonPurge ()
 doSpecificMassiveActions ($input=array())
 countVisibilities ()
 isPubliclyVisible ()
 Check is this item if visible to everybody (anonymous users)
 haveVisibilityAccess ()
 Is the login user have access to KnowbaseItem based on visibility configuration.
 prepareInputForAdd ($input)
 prepareInputForUpdate ($input)
 showForm ($ID, $options=array())
 Print out an HTML "<form>" for knowbase item.
 addToFaq ()
 Add kb item to the public FAQ.
 showMenu ()
 Print out an HTML Menu for knowbase item.
 updateCounter ()
 Increase the view counter of the current knowbaseitem.
 showFull ($linkusers_id=true, $options=array())
 Print out (html) show item : question and answer.
 searchForm ($options)
 Print out an HTML form for Search knowbase item.
 showBrowseForm ($options)
 Print out an HTML "<form>" for Search knowbase item.
 showManageForm ($options)
 Print out an HTML form for Search knowbase item.
 getSearchOptions ()
 Get the Search options for the given Type.
 showVisibility ()
 Show visibility config for a knowbaseitem.

Static Public Member Functions

static getTypeName ($nb=0)
 Return the localized name of the current Type Should be overloaded in each new class.
static canCreate ()
 Have I the global right to "create" the Object May be overloaded if needed (ex KnowbaseItem)
static canView ()
 Have I the global right to "view" the Object.
static getSearchURL ($full=true)
 Get the search page URL for the current classe.
static displayTabContentForItem (CommonGLPI $item, $tabnum=1, $withtemplate=0)
 show Tab content
static addVisibilityJoins ($forceall=false)
 Return visibility joins to add to SQL.
static addVisibilityRestrict ()
 Return visibility SQL restriction to add.
static getListRequest (array $params, $type='search')
 Build request for showList.
static showList ($options, $type='search')
 Print out list kb item.
static showRecentPopular ($type)
 Print out list recent or popular kb/faq.

Protected Attributes

 $users = array()
 $groups = array()
 $profiles = array()
 $entities = array()

Detailed Description

Definition at line 40 of file knowbaseitem.class.php.


Member Function Documentation

addToFaq ( )

Add kb item to the public FAQ.

Returns:
nothing

Definition at line 672 of file knowbaseitem.class.php.

References $_SESSION, $DB, and CommonDBTM\getTable().

static addVisibilityJoins ( forceall = false) [static]

Return visibility joins to add to SQL.

Since:
version 0.83
Parameters:
$forceallforce all joins (false by default)
Returns:
string joins to add

Definition at line 396 of file knowbaseitem.class.php.

References $_SESSION, and Session\getLoginUserID().

Referenced by getListRequest(), and showRecentPopular().

static addVisibilityRestrict ( ) [static]

Return visibility SQL restriction to add.

Since:
version 0.83
Returns:
string restrict to add

Definition at line 441 of file knowbaseitem.class.php.

References $_SESSION, getEntitiesRestrictRequest(), and Session\getLoginUserID().

Referenced by Document\canViewFile(), getListRequest(), and KnowbaseItemCategory\showFirstLevel().

static canCreate ( ) [static]

Have I the global right to "create" the Object May be overloaded if needed (ex KnowbaseItem)

Returns:
booleen

Reimplemented from CommonDBTM.

Definition at line 54 of file knowbaseitem.class.php.

References Session\haveRight().

Referenced by Knowbase\getTabNameForItem().

Have I the right to "update" the Object.

Default is calling canCreateItem May be overloaded if needed

Returns:
booleen
See also:
canCreate

Reimplemented from CommonDBTM.

Definition at line 87 of file knowbaseitem.class.php.

References Session\getLoginUserID(), Session\haveRight(), and haveVisibilityAccess().

static canView ( ) [static]

Have I the global right to "view" the Object.

Default is true and check entity if the objet is entity assign

May be overloaded if needed

Returns:
booleen

Reimplemented from CommonDBTM.

Definition at line 59 of file knowbaseitem.class.php.

References $CFG_GLPI, Session\getLoginUserID(), and Session\haveRight().

Have I the right to "view" the Object May be overloaded if needed.

Returns:
booleen

Reimplemented from CommonDBTM.

Definition at line 68 of file knowbaseitem.class.php.

References $CFG_GLPI, Session\getLoginUserID(), Session\haveRight(), haveVisibilityAccess(), and isPubliclyVisible().

See also:
CommonDBTM::cleanDBonPurge()
Since:
version 0.83.1

Reimplemented from CommonDBTM.

Definition at line 202 of file knowbaseitem.class.php.

References CommonGLPI\getType().

Since:
version 0.83

Definition at line 258 of file knowbaseitem.class.php.

Referenced by showFull().

defineTabs ( options = array())

Define tabs to display.

NB : Only called for existing object

Parameters:
$optionsarray
  • withtemplate is a template view ?
Returns:
array containing the onglets

Reimplemented from CommonGLPI.

Definition at line 116 of file knowbaseitem.class.php.

References $options, and CommonGLPI\addStandardTab().

static displayTabContentForItem ( CommonGLPI item,
tabnum = 1,
withtemplate = 0 
) [static]

show Tab content

Since:
version 0.83
Parameters:
$itemCommonGLPI object for which the tab need to be displayed
$tabnuminteger tab number (default 1)
$withtemplateboolean is a template object ? (default 0)
Returns:
true

Reimplemented from CommonGLPI.

Definition at line 147 of file knowbaseitem.class.php.

References CommonGLPI\getType().

doSpecificMassiveActions ( input = array())
Since:
version 0.84
See also:
CommonDBTM::doSpecificMassiveActions()

Reimplemented from CommonDBTM.

Definition at line 220 of file knowbaseitem.class.php.

References $input, $item, $items, $res, CommonGLPI\$type, and $val.

static getListRequest ( array $  params,
type = 'search' 
) [static]

Build request for showList.

Since:
version 0.83
Parameters:
$paramsarray (contains, knowbaseitemcategories_id, faq)
$typestring search type : browse / search (default search)
Returns:
String : SQL request

Definition at line 1005 of file knowbaseitem.class.php.

References $DB, $query, CommonGLPI\$type, $where, addVisibilityJoins(), addVisibilityRestrict(), Session\getLoginUserID(), Session\isMultiEntitiesMode(), Search\makeTextSearch(), and Toolbox\unclean_cross_side_scripting_deep().

Referenced by showList().

Get the Search options for the given Type.

This should be overloaded in Class

Returns:
an array of search options More information on https://forge.indepnet.net/wiki/glpi/SearchEngine

Reimplemented from CommonDBTM.

Definition at line 1415 of file knowbaseitem.class.php.

References __(), _n(), and CommonDBTM\getTable().

static getSearchURL ( full = true) [static]

Get the search page URL for the current classe.

Since:
version 0.84
Parameters:
$fullpath or relative one (true by default)

Reimplemented from CommonGLPI.

Definition at line 103 of file knowbaseitem.class.php.

References $_SESSION, $CFG_GLPI, and $dir.

getTabNameForItem ( CommonGLPI item,
withtemplate = 0 
)

Get Tab Name used for itemtype.

NB : Only called for existing object Must check right on what will be displayed + template

Since:
version 0.83
Parameters:
$itemCommonDBTM object for which the tab need to be displayed
$withtemplateboolean is a template object ? (default 0)
Returns:
string tab name

Reimplemented from CommonGLPI.

Definition at line 126 of file knowbaseitem.class.php.

References $_SESSION, __(), CommonGLPI\createTabEntry(), CommonGLPI\getType(), and getTypeName().

static getTypeName ( nb = 0) [static]

Return the localized name of the current Type Should be overloaded in each new class.

Returns:
string

Reimplemented from CommonGLPI.

Definition at line 49 of file knowbaseitem.class.php.

References __().

Referenced by getTabNameForItem().

Is the login user have access to KnowbaseItem based on visibility configuration.

Since:
version 0.83
Returns:
boolean

Definition at line 299 of file knowbaseitem.class.php.

References $_SESSION, $entities, $entity, $group, $profile, Session\getLoginUserID(), getSonsOf(), Session\haveAccessToOneOfEntities(), and Session\haveRight().

Referenced by canUpdateItem(), and canViewItem().

Check is this item if visible to everybody (anonymous users)

Since:
version 0.83
Returns:
Boolean

Definition at line 274 of file knowbaseitem.class.php.

References $CFG_GLPI, and $entity.

Referenced by canViewItem().

Actions done at the end of the getEmpty function.

Returns:
nothing

Reimplemented from CommonDBTM.

Definition at line 169 of file knowbaseitem.class.php.

References Session\haveRight().

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

Reimplemented from CommonDBTM.

Definition at line 487 of file knowbaseitem.class.php.

References $_SESSION, $input, __(), and Session\haveRight().

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

Reimplemented from CommonDBTM.

Definition at line 515 of file knowbaseitem.class.php.

References $input, and __().

searchForm ( options)

Print out an HTML form for Search knowbase item.

Parameters:
$options$_GET
Returns:
nothing (display the form)

Definition at line 862 of file knowbaseitem.class.php.

References $_SERVER, $CFG_GLPI, $options, $params, $val, Html\cleanInputText(), Html\closeForm(), and Session\haveRight().

showBrowseForm ( options)

Print out an HTML "<form>" for Search knowbase item.

Since:
version 0.84
Parameters:
$options$_GET
Returns:
nothing (display the form)

Definition at line 911 of file knowbaseitem.class.php.

References $CFG_GLPI, $options, $params, $val, Html\closeForm(), CommonDBTM\dropdown(), Session\getLoginUserID(), haveRight(), and Session\haveRight().

showForm ( ID,
options = array() 
)

Print out an HTML "<form>" for knowbase item.

Parameters:
$ID
$optionsarray
  • target for the Form
Returns:
nothing (display the form)

Definition at line 534 of file knowbaseitem.class.php.

References $ic, $item, $options, __(), _n(), CommonDBTM\can(), Html\closeForm(), Html\convDateTime(), CommonDBTM\dropdown(), getItemForItemtype(), getUserName(), Dropdown\getYesNo(), Session\haveRight(), Html\initEditorSystem(), CommonDBTM\initForm(), and Dropdown\showYesNo().

showFull ( linkusers_id = true,
options = array() 
)

Print out (html) show item : question and answer.

Parameters:
$linkusers_iddisplay users_id link (true by default)
$optionsarray of options
Returns:
nothing (display item : question and answer)

Definition at line 770 of file knowbaseitem.class.php.

References $_SERVER, $CFG_GLPI, $DB, $options, __(), _n(), CommonGLPI\addDivForTabs(), CommonDBTM\can(), Html\convDateTime(), countVisibilities(), getTreeValueCompleteName(), getUserName(), Session\haveRight(), CommonDBTM\showFormButtons(), CommonDBTM\showFormHeader(), CommonGLPI\showTabs(), Toolbox\unclean_html_cross_side_scripting_deep(), and updateCounter().

showManageForm ( options)

Print out an HTML form for Search knowbase item.

Since:
version 0.84
Parameters:
$options$_GET
Returns:
nothing (display the form)

Definition at line 961 of file knowbaseitem.class.php.

References $CFG_GLPI, $options, $params, $val, $values, __(), Html\closeForm(), haveRight(), Session\haveRight(), and Dropdown\showFromArray().

showMenu ( )

Print out an HTML Menu for knowbase item.

Returns:
nothing (display the form)

Definition at line 690 of file knowbaseitem.class.php.

References $CFG_GLPI, __(), __s(), _e(), _x(), CommonDBTM\can(), Session\getLoginUserID(), haveRight(), and Html\showSimpleForm().

static showRecentPopular ( type) [static]

Print out list recent or popular kb/faq.

Parameters:
$typetype : recent / popular / not published
Returns:
nothing (display table)

Definition at line 1347 of file knowbaseitem.class.php.

References $CFG_GLPI, $DB, $query, $result, $title, CommonGLPI\$type, __(), addVisibilityJoins(), Session\getLoginUserID(), haveRight(), Session\isMultiEntitiesMode(), and Html\resume_text().

Referenced by Knowbase\showSearchView().

Increase the view counter of the current knowbaseitem.

Since:
version 0.83

Definition at line 750 of file knowbaseitem.class.php.

References $DB, and $query.

Referenced by showFull().


Member Data Documentation

$entities = array() [protected]

Definition at line 46 of file knowbaseitem.class.php.

Referenced by haveVisibilityAccess().

$groups = array() [protected]

Definition at line 44 of file knowbaseitem.class.php.

$profiles = array() [protected]

Definition at line 45 of file knowbaseitem.class.php.

$users = array() [protected]

Definition at line 43 of file knowbaseitem.class.php.


The documentation for this class was generated from the following file: