39 $this->PERM_STATISTIC = 1;
40 $this->PERM_OBJECT = 2;
47 return $this->trustees ? $this->trustees : array();
51 return isset($this->trustees[$a_usr_id]) ? $this->trustees[$a_usr_id] : array();
55 return isset($this->trustees[$a_usr_id]);
60 $this->perm_stat = (bool) $a_on;
64 $this->perm_obj = (bool) $a_on;
68 $this->perm_coupons = (bool) $a_on;
72 $this->trustee_id = $a_id;
77 $statement = $this->db->manipulateF(
'
78 INSERT INTO payment_trustees
85 VALUES (%s,%s,%s,%s,%s)',
86 array(
'integer',
'integer',
'integer',
'integer',
'integer'),
87 array( $this->user_obj->getId(),
88 $this->__getTrusteeId(),
89 $this->__getStatisticPermissionStatus(),
90 $this->__getCouponsPermissisonStatus(),
91 $this->__getObjectPermissisonStatus()
103 die(
"ilPaymentTrustees::modify() no id given");
106 $statement = $this->db->manipulateF(
'
107 UPDATE payment_trustees
113 AND trustee_id = %s',
114 array(
'integer',
'integer',
'integer',
'integer',
'integer',
'integer'),
119 $this->user_obj->getId(),
120 $this->__getTrusteeId()
128 public function delete()
132 die(
"ilPaymentTrustees::delete() no id given");
135 $statement = $this->db->manipulateF(
'
136 DELETE FROM payment_trustees
138 AND trustee_id = %s ',
139 array(
'integer',
'integer'),
140 array($this->user_obj->getId(), $this->__getTrusteeId()));
149 $statement = $this->db->manipulateF(
'
150 DELETE FROM payment_trustees
151 WHERE vendor_id = %s',
153 array($this->user_obj->getId()));
181 $this->trustees = array();
183 $res = $this->db->queryf(
'
184 SELECT * FROM payment_trustees
185 WHERE vendor_id = %s',
187 array($this->user_obj->getId()));
189 while(
$row = $this->db->fetchObject(
$res))
191 $this->trustees[
$row->trustee_id][
'trustee_id'] =
$row->trustee_id;
192 $this->trustees[
$row->trustee_id][
'perm_stat'] =
$row->perm_stat;
193 $this->trustees[
$row->trustee_id][
'perm_obj'] =
$row->perm_obj;
194 $this->trustees[
$row->trustee_id][
'perm_coupons'] =
$row->perm_coupons;
203 $statement =
$ilDB->manipulateF(
'
204 DELETE FROM payment_trustees
205 WHERE vendor_id = %s',
206 array(
'integer'), array($a_vendor_id));
216 SELECT * FROM payment_trustees
217 WHERE trustee_id = %s',
218 array(
'integer'), array($a_trustee));
222 if((
bool)
$row->perm_stat)
235 SELECT * FROM payment_trustees
236 WHERE trustee_id = %s',
242 if((
bool)
$row->perm_obj)
255 SELECT * FROM payment_trustees
256 WHERE trustee_id = %s',
262 if((
bool)
$row->perm_coupons)
275 SELECT * FROM payment_trustees
276 WHERE trustee_id = %s
279 array(
'integer',
'integer',
'integer' ),
280 array($a_trustee, $a_vendor,
'1'));
282 return $res->numRows() ? true :
false;
290 SELECT * FROM payment_trustees
291 WHERE trustee_id = %s
294 array(
'integer',
'integer',
'integer' ),
295 array($a_trustee, $a_vendor,
'1'));
297 return $ilDB->numRows(
$res) ? true :
false;
305 SELECT * FROM payment_trustees
306 WHERE trustee_id = %s
308 AND perm_coupons = %s',
309 array(
'integer',
'integer',
'integer' ),
310 array($a_trustee, $a_vendor,
'1'));
312 return $res->numRows() ? true :
false;
327 SELECT vendor_id FROM payment_trustees
328 WHERE trustee_id = %s
330 array(
'integer',
'integer'),
331 array($a_usr_id,
'1'));
335 $vendors[] =
$row->vendor_id;
338 return $vendors ? $vendors : array();
346 SELECT vendor_id FROM payment_trustees
347 WHERE trustee_id = %s
348 AND perm_stat = %s ',
349 array(
'integer',
'integer'),
350 array($a_trustee_id,
'1'));
354 $vendors[] =
$row->vendor_id;
357 return $vendors ? $vendors : array();
365 SELECT vendor_id FROM payment_trustees
366 WHERE trustee_id = %s
367 AND perm_coupons = %s ',
368 array(
'integer',
'integer'),
369 array($a_usr_id,
'1'));
373 $vendors[] =
$row->vendor_id;
376 return $vendors ? $vendors : array();
384 SELECT trustee_id FROM payment_trustees
386 AND perm_coupons = %s ',
387 array(
'integer',
'integer'), array($a_usr_id,
'1'));
401 SELECT vendor_id FROM payment_trustees WHERE trustee_id = %s',
402 array(
'integer'), array($a_usr_id));
405 $vendors[] =
$row->vendor_id;
407 return $vendors ? $vendors : array();
static _hasCouponsPermissionByVendor($a_trustee, $a_vendor)
static _hasStatisticPermissionByVendor($a_trustee, $a_vendor)
static _hasCouponsPermission($a_trustee)
__getObjectPermissisonStatus()
__getStatisticPermissionStatus()
static _getVendorsForCouponsByTrusteeId($a_usr_id)
toggleCouponsPermission($a_on)
static _hasAccess($a_usr_id)
static _hasObjectPermissionByVendor($a_trustee, $a_vendor)
static _hasStatisticPermission($a_trustee)
static _deleteTrusteesOfVendor($a_vendor_id)
static _getVendorIdsByTrustee($a_usr_id)
toggleStatisticPermission($a_on)
__getCouponsPermissisonStatus()
__construct($user_obj)
Constructor @access public.
static _getTrusteesForCouponsByVendorId($a_usr_id)
toggleObjectPermission($a_on)
static _hasObjectPermission($a_trustee)
static _getVendorsForObjects($a_usr_id)
static _getVendorsForStatisticsByTrusteeId($a_trustee_id)