12 include_once
'./Services/Payment/classes/class.ilPaymentTrustees.php';
13 include_once
'./Services/Form/classes/class.ilPropertyFormGUI.php';
14 include_once
'./Services/Utilities/classes/class.ilConfirmationGUI.php';
15 include_once
'./Services/Payment/classes/class.ilShopTableGUI.php';
29 $this->lng->loadLanguageModule(
'crs');
31 $this->ctrl->saveParameter($this,
'baseClass');
42 $ilTabs->setTabActive(
'paya_header');
43 $ilTabs->setSubTabActive(
'paya_trustees');
50 $cmd = $this->ctrl->getCmd();
51 switch ($this->ctrl->getNextClass($this))
54 if(!
$cmd = $this->ctrl->getCmd())
56 $cmd =
'showTrustees';
79 $actions = array(0 => $this->lng->txt(
"paya_disabled"),
80 1 => $this->lng->txt(
"paya_enabled"));
82 include_once(
"./Services/Form/classes/class.ilUserLoginAutoCompleteInputGUI.php");
85 $ilToolbar->addInputItem($ul,
true);
86 $ilToolbar->addFormButton($this->lng->txt(
"add"),
"performSearch");
87 $ilToolbar->setFormAction($this->ctrl->getFormAction($this));
89 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.main_view.html',
'Services/Payment');
96 $oConfirmationGUI->setFormAction($this->ctrl->getFormAction($this,
"performDeleteTrustee"));
97 $oConfirmationGUI->setHeaderText($this->lng->txt(
"paya_sure_delete_selected_trustees"));
98 $oConfirmationGUI->setCancel($this->lng->txt(
"cancel"),
"cancelDelete");
99 $oConfirmationGUI->setConfirm($this->lng->txt(
"confirm"),
"performDeleteTrustee");
101 foreach($this->trustee_obj->getTrustees() as $trustee)
104 if(in_array($trustee[
'trustee_id'],
$_POST[
'trustee']))
108 $delete_row = $tmp_obj->getLogin().
' -> '.$tmp_obj->getFirstname().
' '.$tmp_obj->getLastname();
112 $oConfirmationGUI->addItem(
'',$delete_row, $delete_row);
115 $this->tpl->setVariable(
"CONFIRMATION",$oConfirmationGUI->getHTML());
119 if(!count($this->trustee_obj->getTrustees()))
128 $img_mail =
"<img src=\"".ilUtil::getImagePath(
"icon_pencil_b.gif").
"\" alt=\"".
129 $this->lng->txt(
"crs_mem_send_mail").
130 "\" title=\"".$this->lng->txt(
"crs_mem_send_mail").
"\" border=\"0\" vspace=\"0\"/>";
132 require_once
'Services/Mail/classes/class.ilMailFormCall.php';
133 foreach($this->trustee_obj->getTrustees() as $trustee)
140 $trustee[
'trustee_id']);
141 $f_result[$counter][
'login'] = $tmp_obj->getLogin();
142 $f_result[$counter][
'firstname'] = $tmp_obj->getFirstname();
143 $f_result[$counter][
'lastname'] = $tmp_obj->getLastname();
146 'perm_stat['.$trustee[
'trustee_id'].
']',
152 'perm_obj['.$trustee[
'trustee_id'].
']',
157 $f_result[$counter][
'perm_coupons'] =
ilUtil::formSelect((
int) $trustee[
'perm_coupons'],
158 'perm_coupons['.$trustee[
'trustee_id'].
']',
163 # $link_mail = "<a target=\"_blank\" href=\"./ilias.php?baseClass=ilMailGUI&type=new&rcp_to=".
164 # $tmp_obj->getLogin()."\"".$img_mail."</a>";
166 $link_mail =
"<div class=\"il_ContainerItemCommands\"><a class=\"il_ContainerItemCommand\" href=\"".
167 $url_mail.
"\">".$this->lng->txt(
"mail").
"</a></div>";
169 $f_result[$counter][
'options'] = $link_mail;
180 if(!is_array(
$_POST[
'trustee']))
195 if(is_array(
$_SESSION[
'paya_delete_trustee']))
197 foreach(
$_SESSION[
'paya_delete_trustee'] as $id)
199 $this->trustee_obj->setTrusteeId($id);
200 $this->trustee_obj->delete();
212 foreach($this->trustee_obj->getTrustees() as $trustee)
214 $this->trustee_obj->setTrusteeId($trustee[
'trustee_id']);
215 $this->trustee_obj->toggleStatisticPermission(
$_POST[
'perm_stat'][
"$trustee[trustee_id]"]);
216 $this->trustee_obj->toggleObjectPermission(
$_POST[
'perm_obj'][
"$trustee[trustee_id]"]);
217 $this->trustee_obj->toggleCouponsPermission(
$_POST[
'perm_coupons'][
"$trustee[trustee_id]"]);
218 $this->trustee_obj->modify();
243 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.main_view.html",
'Services/Payment');
246 foreach($result as $user)
253 $f_result[$counter][
'login'] = $tmp_obj->getLogin();
254 $f_result[$counter][
'firstname'] = $tmp_obj->getFirstname();
255 $f_result[$counter][
'lastname'] = $tmp_obj->getLastname();
265 if(!is_array(
$_POST[
"user"]))
272 if(in_array($this->user_obj->getId(),
$_POST[
'user']))
282 foreach(
$_POST[
'user'] as $user_id)
284 if($this->trustee_obj->isTrustee($user_id))
288 $this->trustee_obj->setTrusteeId($user_id);
289 $this->trustee_obj->toggleStatisticPermission(
false);
290 $this->trustee_obj->toggleObjectPermission(
true);
291 $this->trustee_obj->toggleCouponsPermission(
true);
292 $this->trustee_obj->add();
314 if(!
$_POST[
'trustee_login'])
328 if($this->trustee_obj->isTrustee($user_id))
335 if($user_id == $this->user_obj->getId())
344 $this->trustee_obj->setTrusteeId($user_id);
345 $this->trustee_obj->toggleObjectPermission(
true);
346 $this->trustee_obj->toggleStatisticPermission(
true);
347 $this->trustee_obj->toggleCouponsPermission(
true);
348 $this->trustee_obj->add();
360 include_once(
"./classes/class.ilSearch.php");
362 $this->lng->loadLanguageModule(
"content");
364 $search =
new ilSearch($this->user_obj->getId());
367 $search->setCombination(
"and");
368 $search->setSearchFor(array(0 =>
'usr'));
369 $search->setSearchType(
'new');
371 if($search->validate($message))
373 $search->performSearch();
378 $this->ctrl->redirect($this,
"searchUser");
380 return $search->getResultByType(
'usr');
386 $tbl->setTitle($this->lng->txt(
"paya_trustee_table"));
387 $tbl->setId(
'tbl_search_user_trustee');
388 $tbl->setRowTemplate(
"tpl.shop_users_row.html",
"Services/Payment");
390 $tbl->addColumn(
' ',
'trustee_id',
'1%',
true);
391 $tbl->addColumn($this->lng->txt(
'login'),
'login',
'10%');
392 $tbl->addColumn($this->lng->txt(
'firstname'),
'firstname',
'20%');
393 $tbl->addColumn($this->lng->txt(
'lastname'),
'lastname',
'20%');
395 $tbl->setSelectAllCheckbox(
'user');
396 $tbl->addMultiCommand(
"addTrustee", $this->lng->txt(
"add"));
397 $tbl->addCommandButton(
'showTrustees',$this->lng->txt(
'cancel'));
400 $tbl->setData($a_result_set);
401 $this->tpl->setVariable(
'TABLE', $tbl->getHTML());
410 $tbl->setTitle($this->lng->txt(
"paya_trustee_table"));
411 $tbl->setId(
'tbl_show_trustee');
412 $tbl->setRowTemplate(
"tpl.shop_users_row.html",
"Services/Payment");
414 $tbl->addColumn(
' ',
'trustee_id',
'1%',
true);
415 $tbl->addColumn($this->lng->txt(
'login'),
'login',
'10%');
416 $tbl->addColumn($this->lng->txt(
'firstname'),
'firstname',
'20%');
417 $tbl->addColumn($this->lng->txt(
'lastname'),
'lastname',
'20%');
418 $tbl->addColumn($this->lng->txt(
'paya_perm_stat'),
'perm_stat',
'15%');
419 $tbl->addColumn($this->lng->txt(
'paya_perm_obj'),
'perm_obj',
'15%');
420 $tbl->addColumn($this->lng->txt(
'paya_perm_coupons'),
'perm_coupons',
'15%');
421 $tbl->addColumn(
'',
'options',
'5%');
423 $tbl->setSelectAllCheckbox(
'trustee_id');
424 $tbl->addMultiCommand(
"deleteTrustee", $this->lng->txt(
"delete"));
426 $tbl->addCommandButton(
'update',$this->lng->txt(
'apply'));
427 $tbl->setData($a_result_set);
428 $this->tpl->setVariable(
'TABLE', $tbl->getHTML());