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');
48 $cmd = $this->ctrl->getCmd();
49 switch ($this->ctrl->getNextClass($this))
52 if(!
$cmd = $this->ctrl->getCmd())
54 $cmd =
'showTrustees';
77 $actions = array(0 => $this->lng->txt(
"paya_disabled"),
78 1 => $this->lng->txt(
"paya_enabled"));
80 include_once(
"./Services/Form/classes/class.ilTextInputGUI.php");
82 $ul->
setDataSource($this->ctrl->getLinkTarget($this,
"performSearch",
"",
true));
84 $ilToolbar->addInputItem($ul,
true);
85 $ilToolbar->addFormButton($this->lng->txt(
"add"),
"performSearch");
86 $ilToolbar->setFormAction($this->ctrl->getFormAction($this));
88 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.main_view.html',
'Services/Payment');
95 $oConfirmationGUI->setFormAction($this->ctrl->getFormAction($this,
"performDeleteTrustee"));
96 $oConfirmationGUI->setHeaderText($this->lng->txt(
"paya_sure_delete_selected_trustees"));
97 $oConfirmationGUI->setCancel($this->lng->txt(
"cancel"),
"cancelDelete");
98 $oConfirmationGUI->setConfirm($this->lng->txt(
"confirm"),
"performDeleteTrustee");
100 foreach($this->trustee_obj->getTrustees() as $trustee)
103 if(in_array($trustee[
'trustee_id'],
$_POST[
'trustee']))
107 $delete_row = $tmp_obj->getLogin().
' -> '.$tmp_obj->getFirstname().
' '.$tmp_obj->getLastname();
111 $oConfirmationGUI->addItem(
'',$delete_row, $delete_row);
114 $this->tpl->setVariable(
"CONFIRMATION",$oConfirmationGUI->getHTML());
118 if(!count($this->trustee_obj->getTrustees()))
127 require_once
'Services/Mail/classes/class.ilMailFormCall.php';
128 foreach($this->trustee_obj->getTrustees() as $trustee)
135 $trustee[
'trustee_id']);
136 $f_result[$counter][
'login'] = $tmp_obj->getLogin();
137 $f_result[$counter][
'firstname'] = $tmp_obj->getFirstname();
138 $f_result[$counter][
'lastname'] = $tmp_obj->getLastname();
141 'perm_stat['.$trustee[
'trustee_id'].
']',
147 'perm_obj['.$trustee[
'trustee_id'].
']',
152 $f_result[$counter][
'perm_coupons'] =
ilUtil::formSelect((
int) $trustee[
'perm_coupons'],
153 'perm_coupons['.$trustee[
'trustee_id'].
']',
158 # $link_mail = "<a target=\"_blank\" href=\"./ilias.php?baseClass=ilMailGUI&type=new&rcp_to=".
159 # $tmp_obj->getLogin()."\"".$img_mail."</a>";
161 $link_mail =
"<div class=\"il_ContainerItemCommands\"><a class=\"il_ContainerItemCommand\" href=\"".
162 $url_mail.
"\">".$this->lng->txt(
"mail").
"</a></div>";
164 $f_result[$counter][
'options'] = $link_mail;
175 if(!is_array(
$_POST[
'trustee']))
190 if(is_array(
$_SESSION[
'paya_delete_trustee']))
192 foreach(
$_SESSION[
'paya_delete_trustee'] as $id)
194 $this->trustee_obj->setTrusteeId($id);
195 $this->trustee_obj->delete();
207 foreach($this->trustee_obj->getTrustees() as $trustee)
209 $this->trustee_obj->setTrusteeId($trustee[
'trustee_id']);
210 $this->trustee_obj->toggleStatisticPermission(
$_POST[
'perm_stat'][
"$trustee[trustee_id]"]);
211 $this->trustee_obj->toggleObjectPermission(
$_POST[
'perm_obj'][
"$trustee[trustee_id]"]);
212 $this->trustee_obj->toggleCouponsPermission(
$_POST[
'perm_coupons'][
"$trustee[trustee_id]"]);
213 $this->trustee_obj->modify();
238 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.main_view.html",
'Services/Payment');
248 $f_result[$counter][
'login'] = $tmp_obj->getLogin();
249 $f_result[$counter][
'firstname'] = $tmp_obj->getFirstname();
250 $f_result[$counter][
'lastname'] = $tmp_obj->getLastname();
261 if(!is_array(
$_POST[
"user"]))
268 if(in_array($this->user_obj->getId(),
$_POST[
'user']))
278 foreach(
$_POST[
'user'] as $user_id)
280 if($this->trustee_obj->isTrustee($user_id))
284 $this->trustee_obj->setTrusteeId($user_id);
285 $this->trustee_obj->toggleStatisticPermission(
false);
286 $this->trustee_obj->toggleObjectPermission(
true);
287 $this->trustee_obj->toggleCouponsPermission(
true);
288 $this->trustee_obj->add();
310 if(!
$_POST[
'trustee_login'])
324 if($this->trustee_obj->isTrustee($user_id))
331 if($user_id == $this->user_obj->getId())
340 $this->trustee_obj->setTrusteeId($user_id);
341 $this->trustee_obj->toggleObjectPermission(
true);
342 $this->trustee_obj->toggleStatisticPermission(
true);
343 $this->trustee_obj->toggleCouponsPermission(
true);
344 $this->trustee_obj->add();
356 include_once(
"./Services/Search/classes/class.ilSearch.php");
358 $this->lng->loadLanguageModule(
"content");
360 $search =
new ilSearch($this->user_obj->getId());
363 $search->setCombination(
"and");
364 $search->setSearchFor(array(0 =>
'usr'));
365 $search->setSearchType(
'new');
367 if($search->validate($message))
369 $search->performSearch();
374 $this->ctrl->redirect($this,
"searchUser");
376 return $search->getResultByType(
'usr');
382 $tbl->setTitle($this->lng->txt(
"paya_trustee_table"));
383 $tbl->setId(
'tbl_search_user_trustee');
384 $tbl->setRowTemplate(
"tpl.shop_users_row.html",
"Services/Payment");
386 $tbl->addColumn(
' ',
'trustee_id',
'1%',
true);
387 $tbl->addColumn($this->lng->txt(
'login'),
'login',
'10%');
388 $tbl->addColumn($this->lng->txt(
'firstname'),
'firstname',
'20%');
389 $tbl->addColumn($this->lng->txt(
'lastname'),
'lastname',
'20%');
391 $tbl->setSelectAllCheckbox(
'user');
392 $tbl->addMultiCommand(
"addTrustee", $this->lng->txt(
"add"));
393 $tbl->addCommandButton(
'showTrustees',$this->lng->txt(
'cancel'));
396 $tbl->setData($a_result_set);
397 $this->tpl->setVariable(
'TABLE', $tbl->getHTML());
406 $tbl->setTitle($this->lng->txt(
"paya_trustee_table"));
407 $tbl->setId(
'tbl_show_trustee');
408 $tbl->setRowTemplate(
"tpl.shop_users_row.html",
"Services/Payment");
410 $tbl->addColumn(
' ',
'trustee_id',
'1%',
true);
411 $tbl->addColumn($this->lng->txt(
'login'),
'login',
'10%');
412 $tbl->addColumn($this->lng->txt(
'firstname'),
'firstname',
'20%');
413 $tbl->addColumn($this->lng->txt(
'lastname'),
'lastname',
'20%');
414 $tbl->addColumn($this->lng->txt(
'paya_perm_stat'),
'perm_stat',
'15%');
415 $tbl->addColumn($this->lng->txt(
'paya_perm_obj'),
'perm_obj',
'15%');
416 $tbl->addColumn($this->lng->txt(
'paya_perm_coupons'),
'perm_coupons',
'15%');
417 $tbl->addColumn(
'',
'options',
'5%');
419 $tbl->setSelectAllCheckbox(
'trustee_id');
420 $tbl->addMultiCommand(
"deleteTrustee", $this->lng->txt(
"delete"));
422 $tbl->addCommandButton(
'update',$this->lng->txt(
'apply'));
423 $tbl->setData($a_result_set);
424 $this->tpl->setVariable(
'TABLE', $tbl->getHTML());