21                $this->obj_id = (int) $a_obj_id;
 
   30                $this->licenses = (int) $a_licenses;
 
   34                return $this->licenses;
 
   38                $this->remarks = $a_remarks;
 
   42                return $this->remarks;
 
   46                return $this->accesses;
 
   50                return max(0, $this->licenses - $this->accesses);
 
   68                $query = 
'SELECT DISTINCT pa.rol_id' 
   70                                . 
' INNER JOIN object_reference ob ON ob.ref_id = pa.ref_id' 
   71                                . 
' WHERE '.$ilDB->like(
'pa.ops_id', 
'text', 
'%%i:'.$ops_ids[0].
';%%')
 
   72                                . 
' AND ob.obj_id = ' . 
$ilDB->quote($this->obj_id, 
'integer');
 
   77                $role_ids[] = 
$row->rol_id;
 
   80                if (!count($role_ids))
 
   86                $query = 
'SELECT COUNT(DISTINCT(usr_id)) accesses ' 
   88                                . 
' WHERE '. 
$ilDB->in(
'rol_id', $role_ids, 
false, 
'integer')
 
   89                                . 
' AND usr_id NOT IN' 
   90                                . 
' (SELECT usr_id FROM read_event' 
   91                                . 
'  WHERE obj_id = ' . 
$ilDB->quote($this->obj_id, 
'integer') . 
')';
 
   95                return $row->accesses;
 
  111                $query = 
'SELECT * FROM license_data WHERE obj_id = %s';
 
  116                        $this->licenses = 
$row->licenses;
 
  117                        $this->accesses = 
$row->used;
 
  118                        $this->remarks = 
$row->remarks;
 
  137                $query = 
'SELECT * FROM license_data WHERE obj_id = %s';
 
  142                        $ilDB->update(
'license_data',
 
  144                                        'licenses'      => array(
'integer', $this->licenses),
 
  145                                        'used'          => array(
'integer', $this->accesses),
 
  146                                        'remarks'       => array(
'clob', $this->remarks)
 
  149                                        'obj_id'        => array(
'integer', $this->obj_id),
 
  155                        $ilDB->insert(
'license_data', array(
 
  156                                'obj_id'        => array(
'integer', $this->obj_id),
 
  157                                'licenses'      => array(
'integer', $this->licenses),
 
  158                                'used'          => array(
'integer', $this->accesses),
 
  159                                'remarks'       => array(
'clob', $this->remarks)
 
  173                $query = 
'DELETE FROM license_data WHERE obj_id = %s';
 
  174                $ilDB->manipulateF(
$query, array(
'integer'), array($this->obj_id));
 
  196                require_once(
"Services/License/classes/class.ilLicenseAccess.php");
 
  215                require_once(
"Services/License/classes/class.ilLicenseAccess.php");
 
  222                $query = 
'SELECT read_count FROM read_event ' 
  223                                .
'WHERE usr_id = %s AND obj_id = %s';
 
  225                                                array(
'integer',
'integer'),
 
  226                                                array(
$ilUser->getId(), $a_obj_id));
 
  236                        require_once(
'Services/Tracking/classes/class.ilChangeEvent.php');
 
  239                        if (self::_isLicensed($a_obj_id))
 
  242                                $query = 
"UPDATE license_data SET used = used + 1 " 
  243                                        .
"WHERE obj_id = %s";
 
  244                                $ilDB->manipulateF(
$query, array(
'integer'), array($a_obj_id));
 
  264                $query = 
'SELECT od.obj_id, od.type, od.title, od.description, re.ref_id ' 
  265                       . 
'FROM license_data ld ' 
  266                           . 
'INNER JOIN object_data od ON od.obj_id = ld.obj_id ' 
  267                           . 
'INNER JOIN object_reference re ON re.obj_id = od.obj_id ' 
  268                           . 
'WHERE ld.licenses > 0 ' 
  269                           . 
'ORDER BY od.title, od.obj_id';
 
  275                        if (
$row[
'obj_id'] != $obj_id)
 
  278                                $obj_id = 
$row[
'obj_id'];
 
  296                $childs = $tree->getChilds($a_ref_id, 
'title');
 
  297                foreach ($childs as 
$data)
 
  299                        if (in_array(
$data[
'type'], array(
'sahs',
'htlm'))
 
  300                        and self::_isLicensed(
$data[
'obj_id']))
 
  319                $query = 
"SELECT licenses FROM license_data ".
 
  320                                 "WHERE obj_id = %s ".
 
_recordReadEvent($a_type, $a_ref_id, $obj_id, $usr_id, $isCatchupWriteEvents=true, $a_ext_rc=false, $a_ext_time=false)
Records a read event and catches up with write events.
static _isEnabled()
Check, if licencing is enabled This check is called from the ilAccessHandler class.
static _checkAccess($a_usr_id, $a_obj_id)
Check, if a user can access an object by license.
_isLicensed($a_obj_id)
Check if an object has licensing activated.
setLicenses($a_licenses=0)
getPotentialAccesses()
Get the number of users who may access the object but don't have yet a license.
_getLicensedObjects()
Get a list of all objects with activated licensing.
_noteAccess($a_obj_id, $a_type, $a_ref_id)
Note the access of the current usr to an object.
_getLicensedChildObjects($a_ref_id)
Get a list of all sub objects with activated licensing.
update()
Update the license data in the database.
_checkAccess($a_usr_id, $a_obj_id)
Check, if a user can access an object by license.
ilLicense($a_obj_id)
Constructor @access public.
read()
Read the license data from the database.
setRemarks($a_remarks='')
static _getOperationIdsByName($operations)
get ops_id's by name.