52 $this->PERM_STATISTIC = 1;
53 $this->PERM_OBJECT = 2;
60 return $this->trustees ? $this->trustees : array();
64 return isset($this->trustees[$a_usr_id]) ? $this->trustees[$a_usr_id] : array();
68 return isset($this->trustees[$a_usr_id]);
75 $this->perm_stat = (bool) $a_on;
79 $this->perm_obj = (bool) $a_on;
83 $this->perm_coupons = (bool) $a_on;
87 $this->trustee_id = $a_id;
92 $query =
"INSERT INTO payment_trustees ".
93 "SET vendor_id = '".$this->user_obj->getId().
"', ".
94 "trustee_id = '".$this->__getTrusteeId().
"', ".
95 "perm_stat = '".$this->__getStatisticPermissionStatus().
"', ".
96 "perm_coupons = '".$this->__getCouponsPermissisonStatus().
"', ".
97 "perm_obj = '".$this->__getObjectPermissisonStatus().
"'";
99 $this->db->query($query);
108 die(
"ilPaymentTrustees::modify() no id given");
111 $query =
"UPDATE payment_trustees SET ".
112 "trustee_id = '".$this->__getTrusteeId().
"', ".
113 "perm_stat = '".$this->__getStatisticPermissionStatus().
"', ".
114 "perm_obj = '".$this->__getObjectPermissisonStatus().
"', ".
115 "perm_coupons = '".$this->__getCouponsPermissisonStatus().
"' ".
116 "WHERE vendor_id = '".$this->user_obj->getId().
"' ".
117 "AND trustee_id = '".$this->__getTrusteeId().
"'";
119 $this->db->query($query);
128 die(
"ilPaymentTrustees::delete() no id given");
130 $query =
"DELETE FROM payment_trustees ".
131 "WHERE vendor_id = '".$this->user_obj->getId().
"' ".
132 "AND trustee_id = '".$this->__getTrusteeId().
"'";
134 $this->db->query($query);
142 $query =
"DELETE FROM payment_trustees ".
143 "WHERE vendor_id = '".$this->user_obj->getId().
"'";
145 $this->db->query($query);
155 return $this->trustee_id;
159 return (
int) $this->perm_stat;
163 return (
int) $this->perm_obj;
167 return (
int) $this->perm_coupons;
171 $this->trustees = array();
173 $query =
"SELECT * FROM payment_trustees ".
174 "WHERE vendor_id = '".$this->user_obj->getId().
"'";
176 $res = $this->db->query($query);
179 $this->trustees[$row->trustee_id][
'trustee_id'] = $row->trustee_id;
180 $this->trustees[$row->trustee_id][
'perm_stat'] = $row->perm_stat;
181 $this->trustees[$row->trustee_id][
'perm_obj'] = $row->perm_obj;
182 $this->trustees[$row->trustee_id][
'perm_coupons'] = $row->perm_coupons;
191 $query =
"DELETE FROM payment_trustees ".
192 "WHERE vendor_id = '".$a_vendor_id.
"'";
194 $ilDB->query($query);
203 $query =
"SELECT * FROM payment_trustees ".
204 "WHERE trustee_id = '".$a_trustee.
"'";
206 $res = $ilDB->query($query);
209 if((
bool) $row->perm_stat)
220 $query =
"SELECT * FROM payment_trustees ".
221 "WHERE trustee_id = '".$a_trustee.
"'";
223 $res = $ilDB->query($query);
226 if((
bool) $row->perm_obj)
237 $query =
"SELECT * FROM payment_trustees ".
238 "WHERE trustee_id = '".$a_trustee.
"'";
240 $res = $ilDB->query($query);
243 if((
bool) $row->perm_coupons)
254 $query =
"SELECT * FROM payment_trustees ".
255 "WHERE trustee_id = '".$a_trustee.
"' ".
256 "AND vendor_id = '".$a_vendor.
"' ".
257 "AND perm_stat = '1'";
259 $res = $ilDB->query($query);
261 return $res->numRows() ?
true :
false;
268 $query =
"SELECT * FROM payment_trustees ".
269 "WHERE trustee_id = '".$a_trustee.
"' ".
270 "AND vendor_id = '".$a_vendor.
"' ".
271 "AND perm_obj = '1'";
273 $res = $ilDB->query($query);
275 return $res->numRows() ?
true :
false;
282 $query =
"SELECT * FROM payment_trustees ".
283 "WHERE trustee_id = '".$a_trustee.
"' ".
284 "AND vendor_id = '".$a_vendor.
"' ".
285 "AND perm_coupons = '1'";
287 $res = $ilDB->query($query);
289 return $res->numRows() ?
true :
false;
303 $query =
"SELECT vendor_id FROM payment_trustees ".
304 "WHERE perm_obj = '1' ".
305 "AND trustee_id = '".$a_usr_id.
"'";
307 $res = $ilDB->query($query);
310 $vendors[] = $row->vendor_id;
313 return $vendors ? $vendors : array();
320 $query =
"SELECT vendor_id FROM payment_trustees ".
321 "WHERE perm_coupons = '1' ".
322 "AND trustee_id = '".$a_usr_id.
"'";
324 $res = $ilDB->query($query);
327 $vendors[] = $row->vendor_id;
330 return $vendors ? $vendors : array();
337 $query =
"SELECT trustee_id FROM payment_trustees ".
338 "WHERE perm_coupons = '1' ".
339 "AND vendor_id = '".$a_usr_id.
"'";
341 $res = $ilDB->query($query);