License class. More...

List of all members.

Public Member Functions

 pre_updateInDB ()
 Actions done before the UPDATE of the item in the database.
 prepareInputForAdd ($input)
 Prepare input datas for adding the item.
 cleanDBonPurge ()
 post_addItem ()
 Actions done after the ADD of the item in the database.
 getPreAdditionalInfosForName ()
 defineTabs ($options=array())
 Define tabs to display.
 showForm ($ID, $options=array())
 Print the Software / license form.
 maybeRecursive ()
 Is the license may be recursive.
 getSpecificMassiveActions ($checkitem=NULL)
 getSearchOptions ()
 Get the Search options for the given Type.
 showDebug ()
 Display debug information for current object.
 getUnicityFieldsToDisplayInErrorMessage ()
 Get fields to display in the unicity error message.
 getTabNameForItem (CommonGLPI $item, $withtemplate=0)
 Get Tab Name used for itemtype.

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 cronInfo ($name)
 Give cron information.
static cronSoftware ($task=NULL)
 Cron action on softwares : alert on expired licences.
static countForVersion ($softwareversions_id, $entity='')
 Get number of bought licenses of a version.
static countForSoftware ($softwares_id)
 Get number of licensesof a software.
static showForSoftware (Software $software)
 Show Licenses of a software.
static displayTabContentForItem (CommonGLPI $item, $tabnum=1, $withtemplate=0)
 show Tab content

Public Attributes

 $dohistory = true
 Make an history of the changes.

Static Protected Attributes

static $forward_entity_to = array('Infocom')
 Forward entity datas to linked items.

Detailed Description

License class.

Definition at line 39 of file softwarelicense.class.php.


Member Function Documentation

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 52 of file softwarelicense.class.php.

References haveRight().

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 57 of file softwarelicense.class.php.

References haveRight().

Since:
version 0.84

Reimplemented from CommonDBTM.

Definition at line 88 of file softwarelicense.class.php.

References $csl, and CommonGLPI\getType().

static countForSoftware ( softwares_id) [static]

Get number of licensesof a software.

Parameters:
$softwares_idsoftware ID
Returns:
number of licenses

Definition at line 488 of file softwarelicense.class.php.

References $DB, $nb, $query, $result, and getEntitiesRestrictRequest().

Referenced by getTabNameForItem().

static countForVersion ( softwareversions_id,
entity = '' 
) [static]

Get number of bought licenses of a version.

Parameters:
$softwareversions_idversion ID
$entityto search for licenses in (default = all active entities) (default '')
Returns:
number of installations

Definition at line 464 of file softwarelicense.class.php.

References $DB, $entity, $query, $result, and getEntitiesRestrictRequest().

Referenced by SoftwareVersion\showForm().

static cronInfo ( name) [static]

Give cron information.

Parameters:
$name: task's name
Returns:
arrray of information

Definition at line 357 of file softwarelicense.class.php.

References __().

static cronSoftware ( task = NULL) [static]

Cron action on softwares : alert on expired licences.

Parameters:
$taskto log, if NULL display (default NULL)
Returns:
0 : nothing to do 1 : done with success

Definition at line 369 of file softwarelicense.class.php.

References $CFG_GLPI, $DB, $entity, $input, $items, $license, $name, $options, $query, $task, __(), Session\addMessageAfterRedirect(), Html\convDate(), Alert\END, Dropdown\getDropdownName(), Entity\getEntitiesToNotify(), Entity\getUsedConfig(), and NotificationEvent\raiseEvent().

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 127 of file softwarelicense.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 789 of file softwarelicense.class.php.

References CommonGLPI\getType(), and showForSoftware().

Since:
version 0.84
See also:
CommonDBTM::getPreAdditionalInfosForName

Reimplemented from CommonDBTM.

Definition at line 118 of file softwarelicense.class.php.

References $soft.

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 289 of file softwarelicense.class.php.

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

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 772 of file softwarelicense.class.php.

References $_SESSION, countForSoftware(), 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 47 of file softwarelicense.class.php.

References $nb, and _n().

Referenced by Computer_SoftwareLicense\getTabNameForItem(), and getTabNameForItem().

Get fields to display in the unicity error message.

Returns:
an array which contains field => label

Reimplemented from CommonDBTM.

Definition at line 763 of file softwarelicense.class.php.

References __(), and _n().

Is the license may be recursive.

Returns:
boolean

Reimplemented from CommonDBTM.

Definition at line 261 of file softwarelicense.class.php.

References $soft.

Actions done after the ADD of the item in the database.

Returns:
nothing

Reimplemented from CommonDBTM.

Definition at line 98 of file softwarelicense.class.php.

References $CFG_GLPI, $itemtype, Infocom\cloneItem(), and CommonGLPI\getType().

Actions done before the UPDATE of the item in the database.

Returns:
nothing

Reimplemented from CommonDBTM.

Definition at line 62 of file softwarelicense.class.php.

References Alert\END, and CommonGLPI\getType().

prepareInputForAdd ( input)

Prepare input datas for adding the item.

Parameters:
$inputdatas used to add the item
Returns:
the modified $input array

Reimplemented from CommonDBTM.

Definition at line 74 of file softwarelicense.class.php.

References $input.

showDebug ( )

Display debug information for current object.

Definition at line 745 of file softwarelicense.class.php.

References $license, $options, NotificationEvent\debugEvent(), and CommonDBTM\getEntityID().

showForm ( ID,
options = array() 
)

Print the Software / license form.

Parameters:
$IDinteger Id of the version or the template to print
$optionsarray of possible options:
  • target form target
  • softwares_id ID of the software for add process
Returns:
true if displayed false if item not found or not right to display

Definition at line 149 of file softwarelicense.class.php.

References $_SESSION, $CFG_GLPI, $options, $soft, __(), CommonGLPI\addDivForTabs(), Html\autocompletionTextField(), Html\convDateTime(), Alert\displayLastAlert(), CommonDBTM\dropdown(), getAncestorsOf(), Dropdown\getDropdownName(), Session\haveRight(), CommonDBTM\initForm(), Html\showDateFormItem(), CommonDBTM\showFormButtons(), CommonDBTM\showFormHeader(), Dropdown\showInteger(), and CommonGLPI\showTabs().


Member Data Documentation

$dohistory = true

Make an history of the changes.

Reimplemented from CommonDBTM.

Definition at line 42 of file softwarelicense.class.php.

$forward_entity_to = array('Infocom') [static, protected]

Forward entity datas to linked items.

Reimplemented from CommonDBTM.

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


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