38 require_once
"./classes/class.ilObjectGUI.php";
56 $this->user_obj =& $ilias->account;
58 include_once
"./payment/classes/class.ilPaymentObject.php";
64 $this->
ilObjectGUI($a_data,$a_id,$a_call_by_reference,$a_prepare_output);
66 $this->SECTION_GENERAL = 1;
67 $this->SECTION_PAYPAL = 2;
72 $this->PAY_METHODS = 6;
74 $this->SECTION_BMF = 8;
77 $this->lng->loadLanguageModule(
'payment');
82 $next_class = $this->ctrl->getNextClass($this);
83 $cmd = $this->ctrl->getCmd();
88 case 'ilpermissiongui':
89 include_once(
"./classes/class.ilPermissionGUI.php");
91 $ret =& $this->ctrl->forwardCommand($perm_gui);
94 case 'ilpageobjectgui':
99 $this->tpl->setContent(
$ret);
103 case 'ilshoptopicsgui':
104 include_once
'Services/Payment/classes/class.ilShopTopicsGUI.php';
106 $ret = $this->ctrl->forwardCommand($topics_gui);
112 $cmd =
"generalSettings";
119 case "performSearch" :
121 case "exportVendors" :
122 case "performDeleteVendors" :
123 case "cancelDeleteVendors" :
124 case "performEditVendor" : $this->
__setSection($this->OTHERS);
126 $this->tabs_gui->setTabActive(
"vendors");
129 case "editStatistic" :
130 case "updateStatistic" :
131 case "deleteStatistic" :
132 case "performDelete" :
134 case "exportVendors" :
136 case "saveCustomer" :
137 case "showObjectSelector" :
138 case "searchUserSP" :
139 case "performSearchSP" : $this->
__setSection($this->OTHERS);
141 $this->tabs_gui->setTabActive(
"statistic");
143 case "updateObjectDetails" :
144 case "deleteObject" :
145 case "performObjectDelete" :
150 case "resetObjectFilter" :
151 include_once
"./payment/classes/class.ilPaymentObject.php";
152 include_once
"./payment/classes/class.ilPaymentBookings.php";
155 $this->tabs_gui->setTabActive(
"objects");
157 case "saveGeneralSettings" :
158 case "generalSettings" : $this->
__setSection($this->SECTION_GENERAL);
160 $this->tabs_gui->setTabActive(
"settings");
162 case "saveBmfSettings" :
163 case "bmfSettings" : $this->
__setSection($this->SECTION_BMF);
165 $this->tabs_gui->setTabActive(
"settings");
167 case "savePaypalSettings" :
168 case "paypalSettings" : $this->
__setSection($this->SECTION_PAYPAL);
170 $this->tabs_gui->setTabActive(
"settings");
172 case "savePayMethods" : $this->
__setSection($this->OTHERS);
174 $this->tabs_gui->setTabActive(
"pay_methods");
176 case "gateway" :
if ($_POST[
"action"] ==
"editVendorObject" ||
177 $_POST[
"action"] ==
"deleteVendorsObject")
181 $this->tabs_gui->setTabActive(
"vendors");
203 if(!(
int)
$_GET[
'pobject_id'])
206 return $this->showObjects();
208 $this->ctrl->setParameter($this,
'pobject_id', (
int)$_GET[
'pobject_id']);
211 $this->lng->loadLanguageModule(
'content');
213 $ilTabs->clearTargets();
214 $ilTabs->clearSubTabs();
215 $ilTabs->setBackTarget($this->lng->txt(
'back'), $this->ctrl->getLinkTarget($this,
'editObject'));
218 include_once
'Services/COPage/classes/class.ilPageObject.php';
219 include_once
'Services/COPage/classes/class.ilPageObjectGUI.php';
220 include_once(
'./Services/Style/classes/class.ilObjStyleSheet.php');
228 $new_page_object->setParentId(0);
229 $new_page_object->setId($this->pobject->getPobjectId());
230 $new_page_object->createFromXML();
233 $this->ctrl->setReturnByClass(
'ilpageobjectgui',
'edit');
235 $page_gui =
new ilPageObjectGUI(
'shop', $this->pobject->getPobjectId());
236 $this->ctrl->setParameter($page_gui,
'pobject_id', (
int)$_GET[
'pobject_id']);
238 $page_gui->setTemplateTargetVar(
'ADM_CONTENT');
239 $page_gui->setLinkXML(
'');
240 $page_gui->setFileDownloadLink($this->ctrl->getLinkTargetByClass(array(
'ilpageobjectgui'),
'downloadFile'));
241 $page_gui->setFullscreenLink($this->ctrl->getLinkTargetByClass(array(
'ilpageobjectgui'),
'displayMediaFullscreen'));
242 $page_gui->setSourcecodeDownloadScript($this->ctrl->getLinkTargetByClass(array(
'ilpageobjectgui'),
'download_paragraph'));
243 $page_gui->setPresentationTitle(
'');
244 $page_gui->setTemplateOutput(
false);
245 $page_gui->setHeader(
'');
246 $page_gui->setEnabledRepositoryObjects(
false);
247 $page_gui->setEnabledFileLists(
true);
248 $page_gui->setEnabledMaps(
true);
249 $page_gui->setEnabledPCTabs(
true);
251 return $this->ctrl->forwardCommand($page_gui);
259 if(!$rbacsystem->checkAccess(
"read", $this->object->getRefId()))
261 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_read"),$this->ilias->error_obj->MESSAGE);
264 include_once
'./payment/classes/class.ilBMFSettings.php';
274 $bmfSetObj->setKennzeichenMahnverfahren(
ilUtil::stripSlashes($_POST[
"kennzeichenMahnverfahren"]));
281 if ($_POST[
"mandantNr"] ==
"" ||
282 $_POST[
"bewirtschafterNr"] ==
"" ||
283 $_POST[
"haushaltsstelle"] ==
"" ||
284 $_POST[
"objektNr"] ==
"" ||
285 $_POST[
"kennzeichenMahnverfahren"] ==
"" ||
286 $_POST[
"waehrungskennzeichen"] ==
"" ||
287 $_POST[
"ePaymentServer"] ==
"" ||
288 $_POST[
"clientCertificate"] ==
"" ||
289 $_POST[
"caCertificate"] ==
"" ||
290 $_POST[
"timeOut"] ==
"")
292 $this->error = $this->lng->txt(
'pays_bmf_settings_not_valid');
312 if(!$rbacsystem->checkAccess(
"read", $this->object->getRefId()))
314 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_read"),$this->ilias->error_obj->MESSAGE);
316 include_once
'./payment/classes/class.ilBMFSettings.php';
317 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
319 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.pays_bmf_settings.html",
'payment');
324 $form->setFormAction($this->ctrl->getFormAction($this,
"saveBmfSettings"));
325 $form->setTitle($this->lng->txt(
'pays_bmf_settings'));
327 $form->addCommandButton(
'saveBmfSettings',$this->lng->txt(
'save'));
329 $formItem =
new ilTextInputGUI($this->lng->txt(
"pays_bmf_client_id"),
"mandantNr");
330 $formItem->
setValue($bmfSetObj->getClientId());
331 $form->addItem($formItem);
333 $formItem =
new ilTextInputGUI($this->lng->txt(
"pays_bmf_bewirtschafter_nr"),
"bewirtschafterNr");
334 $formItem->
setValue($bmfSetObj->getBewirtschafterNr());
335 $form->addItem($formItem);
337 $formItem =
new ilTextInputGUI($this->lng->txt(
"pays_bmf_haushaltsstelle"),
"haushaltsstelle");
338 $formItem->
setValue($bmfSetObj->getHaushaltsstelle());
339 $form->addItem($formItem);
341 $formItem =
new ilTextInputGUI($this->lng->txt(
"pays_bmf_object_id"),
"objektNr");
342 $formItem->
setValue($bmfSetObj->getObjectId());
343 $form->addItem($formItem);
345 $formItem =
new ilTextInputGUI($this->lng->txt(
"pays_bmf_kennzeichen_mahnverfahren"),
"kennzeichenMahnverfahren");
346 $formItem->
setValue($bmfSetObj->getKennzeichenMahnverfahren());
347 $form->addItem($formItem);
349 $formItem =
new ilTextInputGUI($this->lng->txt(
"pays_bmf_waehrungskennzeichen"),
"waehrungskennzeichen");
350 $formItem->
setValue($bmfSetObj->getWaehrungsKennzeichen());
351 $form->addItem($formItem);
353 $formItem =
new ilTextInputGUI($this->lng->txt(
"pays_bmf_epayment_server"),
"ePaymentServer");
354 $formItem->
setValue($bmfSetObj->getEpaymentServer());
355 $form->addItem($formItem);
357 $formItem =
new ilTextInputGUI($this->lng->txt(
"pays_bmf_client_certificate"),
"clientCertificate");
358 $formItem->
setValue($bmfSetObj->getClientCertificate());
359 $form->addItem($formItem);
361 $formItem =
new ilTextInputGUI($this->lng->txt(
"pays_bmf_ca_certificate"),
"caCertificate");
362 $formItem->
setValue($bmfSetObj->getCaCertificate());
363 $form->addItem($formItem);
365 $formItem =
new ilTextInputGUI($this->lng->txt(
"pays_bmf_timeout"),
"timeOut");
366 $formItem->
setValue($bmfSetObj->getTimeOut());
367 $form->addItem($formItem);
369 $this->tpl->setVariable(
'BMF_SETTINGS',$form->getHTML());
374 if(!
$_GET[
'pobject_id'])
378 $this->objectObjects();
382 $this->ctrl->setParameter($this,
'pobject_id',(
int) $_GET[
'pobject_id']);
385 $old_pay_method = $this->pobject->getPayMethod();
386 $old_status = $this->pobject->getStatus();
389 if($old_status == $this->pobject->STATUS_NOT_BUYABLE and
390 (
int) $_POST[
'status'] != $old_status)
393 switch((
int) $_POST[
'pay_method'])
395 case $this->pobject->PAY_METHOD_NOT_SPECIFIED:
401 case $this->pobject->PAY_METHOD_BILL:
402 include_once
'./payment/classes/class.ilPaymentBillVendor.php';
405 if(!$bill_vendor->validate())
418 include_once
'./payment/classes/class.ilPaymentPrices.php';
421 if(!count($prices_obj->getPrices()))
431 $this->pobject->setStatus((
int) $_POST[
'status']);
432 $this->pobject->setVendorId((
int) $_POST[
'vendor']);
433 $this->pobject->setPayMethod((
int) $_POST[
'pay_method']);
434 $this->pobject->setTopicId((
int) $_POST[
'topic_id']);
436 $this->pobject->update();
446 include_once
'./payment/classes/class.ilPaymentPrices.php';
447 include_once
'./payment/classes/class.ilPaymentCurrency.php';
448 include_once
"./Services/Table/classes/class.ilTableGUI.php";
449 include_once
'./payment/classes/class.ilGeneralSettings.php';
455 if(!
$_GET[
'pobject_id'])
462 $this->ctrl->setParameter($this,
'pobject_id',(
int)
$_GET[
'pobject_id']);
465 $this->
__showButton(
'editObject',$this->lng->txt(
'paya_edit_details'));
466 $this->
__showButton(
'editPrices',$this->lng->txt(
'paya_edit_prices'));
470 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.paya_adm_edit_prices.html',
'payment');
473 $prices = $price_obj->getPrices();
480 $this->tpl->setCurrentBlock(
"price_info");
481 $this->tpl->setVariable(
"CONFIRM_FORMACTION",$this->ctrl->getFormAction($this));
482 $this->tpl->setVariable(
"CONFIRM_CMD",
'addPrice');
483 $this->tpl->setVariable(
"TXT_CONFIRM",$this->lng->txt(
'paya_add_price'));
484 $this->tpl->parseCurrentBlock();
493 $this->tpl->setCurrentBlock(
"cancel");
494 $this->tpl->setVariable(
"CANCEL_CMD",
'editPrices');
495 $this->tpl->setVariable(
"TXT_CANCEL",$this->lng->txt(
'cancel'));
496 $this->tpl->parseCurrentBlock();
498 $this->tpl->setCurrentBlock(
"price_info");
499 $this->tpl->setVariable(
"CONFIRM_FORMACTION",$this->ctrl->getFormAction($this));
500 $this->tpl->setVariable(
"CONFIRM_CMD",
'performDeletePrice');
501 $this->tpl->setVariable(
"TXT_CONFIRM",$this->lng->txt(
'paya_delete_price'));
502 $this->tpl->parseCurrentBlock();
509 $tpl->setCurrentBlock(
"tbl_form_header");
511 $tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
512 $tpl->parseCurrentBlock();
514 $tpl->addBlockfile(
"TBL_CONTENT",
"tbl_content",
'tpl.paya_adm_edit_prices_row.html',
'payment');
517 foreach($prices as $price)
521 $tpl->setCurrentBlock(
"tbl_content");
524 $tpl->setVariable(
"CHECKBOX",ilUtil::formCheckBox(in_array($price[
'price_id'],
$_SESSION[
'price_ids']) ? 1 : 0,
526 $price[
'price_id']));
527 $tpl->setVariable(
"DURATION_NAME",
'prices['.$price[
'price_id'].
'][duration]');
528 $tpl->setVariable(
"DURATION",$price[
'duration']);
529 $tpl->setVariable(
"MONTH",$this->lng->txt(
'paya_months'));
530 $tpl->setVariable(
"UNIT_NAME",
'prices['.$price[
'price_id'].
'][unit_value]');
531 $tpl->setVariable(
"UNIT",$price[
'unit_value']);
532 # $tpl->setVariable("SHORTFORM",$this->lng->txt('currency_'.$currency['unit']));
533 $tpl->setVariable(
"SHORTFORM",$genSet->get(
"currency_unit"));
535 $tpl->setVariable(
"SUB_UNIT_NAME",
'prices['.$price[
'price_id'].
'][sub_unit_value]');
536 $tpl->setVariable(
"SUB_UNIT",$price[
'sub_unit_value']);
537 # $tpl->setVariable("SUB_UNIT_TXT",$this->lng->txt('currency_'.$currency['sub_unit']));
538 $tpl->setVariable(
"SUB_UNIT_TXT",$genSet->get(
"currency_subunit"));
539 $tpl->parseCurrentBlock();
545 $tpl->setCurrentBlock(
"tbl_action_button");
546 $tpl->setVariable(
"BTN_NAME",
"deletePrice");
547 $tpl->setVariable(
"BTN_VALUE",$this->lng->txt(
"paya_delete_price"));
548 $tpl->parseCurrentBlock();
550 $tpl->setCurrentBlock(
"plain_buttons");
551 $tpl->setVariable(
"PBTN_NAME",
"updatePrice");
552 $tpl->setVariable(
"PBTN_VALUE",$this->lng->txt(
"paya_update_price"));
553 $tpl->parseCurrentBlock();
555 $tpl->setCurrentBlock(
"plain_buttons");
556 $tpl->setVariable(
"PBTN_NAME",
"addPrice");
557 $tpl->setVariable(
"PBTN_VALUE",$this->lng->txt(
"paya_add_price"));
558 $tpl->parseCurrentBlock();
561 $tpl->setCurrentBlock(
"tbl_action_row");
562 $tpl->setVariable(
"TPLPATH",$this->tpl->tplPath);
563 $tpl->setVariable(
"COLUMN_COUNTS",4);
565 $tpl->parseCurrentBlock();
569 $tbl->setTemplate(
$tpl);
572 $tbl->setStyle(
'table',
'std');
576 $tbl->setTitle($tmp_obj->getTitle(),
577 "icon_".$tmp_obj->getType().
"_b.gif",
578 $this->lng->txt(
"objs_".$tmp_obj->getType()));
579 $tbl->setHeaderNames(array(
'',
580 $this->lng->txt(
'duration'),
581 $this->lng->txt(
'price_a'),
583 $tbl->setHeaderVars(array(
"",
587 array(
"ref_id" => $this->cur_ref_id));
590 $tbl->setLimit($_GET[
"limit"]);
591 $tbl->setOffset($_GET[
"offset"]);
592 $tbl->setMaxCount(count($price_obj->getPrices()));
594 $tbl->disable(
"sort");
599 $this->tpl->setVariable(
"PRICES_TABLE",
$tpl->get());
606 if(!
$_GET[
'pobject_id'])
610 $this->showObjects();
614 include_once
'./payment/classes/class.ilGeneralSettings.php';
618 $this->ctrl->setParameter($this,
'pobject_id',(
int)
$_GET[
'pobject_id']);
622 $this->
__showButton(
'editObject',$this->lng->txt(
'paya_edit_details'));
623 $this->
__showButton(
'editPrices',$this->lng->txt(
'paya_edit_prices'));
625 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.paya_adm_add_price.html',
'payment');
627 $this->tpl->setVariable(
"ADD_FORMACTION",$this->ctrl->getFormAction($this));
631 $this->tpl->setVariable(
"ALT_IMG",$this->lng->txt(
'obj_'.$tmp_obj->getType()));
632 $this->tpl->setVariable(
"TITLE",$tmp_obj->getTitle());
633 $this->tpl->setVariable(
"DESCRIPTION",$this->lng->txt(
'paya_add_price_title'));
636 # $this->tpl->setVariable("TXT_PRICE_A",$this->lng->txt('currency_euro'));
637 # $this->tpl->setVariable("TXT_PRICE_B",$this->lng->txt('currency_cent'));
638 $this->tpl->setVariable(
"TXT_PRICE_A",$genSet->get(
"currency_unit"));
639 $this->tpl->setVariable(
"TXT_PRICE_B",$genSet->get(
"currency_subunit"));
641 $this->tpl->setVariable(
"MONTH",$this->lng->txt(
'paya_months'));
642 $this->tpl->setVariable(
"TXT_DURATION",$this->lng->txt(
'duration'));
643 $this->tpl->setVariable(
"TXT_PRICE",$this->lng->txt(
'price_a'));
644 $this->tpl->setVariable(
"CANCEL",$this->lng->txt(
'cancel'));
645 $this->tpl->setVariable(
"ADD",$this->lng->txt(
'paya_add_price'));
647 $this->tpl->setVariable(
"DURATION",$_POST[
'duration']);
648 $this->tpl->setVariable(
"UNIT_VALUE",$_POST[
'unit']);
649 $this->tpl->setVariable(
"SUB_UNIT",$_POST[
'SUB_UNIT']);
656 if(!
$_GET[
'pobject_id'])
664 include_once
'./payment/classes/class.ilPaymentPrices.php';
665 include_once
'./payment/classes/class.ilPaymentCurrency.php';
671 $prices->setDuration($_POST[
'duration']);
672 $prices->setUnitValue($_POST[
'unit']);
673 $prices->setSubUnitValue($_POST[
'sub_unit']);
674 $prices->setCurrency($currency[1][
'currency_id']);
676 if(!$prices->validate())
693 if(!
$_GET[
'pobject_id'])
708 include_once
'./payment/classes/class.ilPaymentPrices.php';
712 foreach(
$_SESSION[
'price_ids'] as $price_id)
714 $prices->delete($price_id);
718 if(!count($prices->getPrices()))
722 $this->pobject->setStatus($this->pobject->STATUS_NOT_BUYABLE);
723 $this->pobject->update();
735 if(!
$_GET[
'pobject_id'])
743 if(!count($_POST[
'price_ids']))
750 $_SESSION[
'price_ids'] = $_POST[
'price_ids'];
758 include_once
'./payment/classes/class.ilPaymentPrices.php';
760 if(!
$_GET[
'pobject_id'])
769 $this->ctrl->setParameter($this,
'pobject_id',(
int) $_GET[
'pobject_id']);
772 foreach($_POST[
'prices'] as $price_id => $price)
774 $old_price = $po->getPrice($price_id);
776 $po->setDuration($price[
'duration']);
777 $po->setUnitValue($price[
'unit_value']);
778 $po->setSubUnitValue($price[
'sub_unit_value']);
779 $po->setCurrency($old_price[
'currency']);
793 foreach($_POST[
'prices'] as $price_id => $price)
795 $old_price = $po->getPrice($price_id);
797 $po->setDuration($price[
'duration']);
798 $po->setUnitValue($price[
'unit_value']);
799 $po->setSubUnitValue($price[
'sub_unit_value']);
800 $po->setCurrency($old_price[
'currency']);
802 $po->update($price_id);
812 if(!isset(
$_GET[
'pobject_id']))
820 $this->ctrl->setParameter($this,
'pobject_id',(
int)
$_GET[
'pobject_id']);
823 $this->
__showButton(
'editObject',$this->lng->txt(
'paya_edit_details'));
824 $this->
__showButton(
'editPrices',$this->lng->txt(
'paya_edit_prices'));
825 $this->tpl->setCurrentBlock(
'btn_cell');
826 $this->tpl->setVariable(
'BTN_LINK', $this->ctrl->getLinkTargetByClass(array(
'ilpageobjectgui'),
'edit'));
827 $this->tpl->setVariable(
'BTN_TXT', $this->lng->txt(
'pay_edit_abstract'));
828 $this->tpl->parseCurrentBlock();
830 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.paya_adm_edit_objects.html',
'payment');
836 $this->tpl->setCurrentBlock(
"confirm_delete");
837 $this->tpl->setVariable(
"CONFIRM_FORMACTION",$this->ctrl->getFormAction($this));
838 $this->tpl->setVariable(
"TXT_CANCEL",$this->lng->txt(
'cancel'));
839 $this->tpl->setVariable(
"CONFIRM_CMD",
'performObjectDelete');
840 $this->tpl->setVariable(
"TXT_CONFIRM",$this->lng->txt(
'confirm'));
841 $this->tpl->parseCurrentBlock();
844 $this->tpl->setVariable(
"DETAILS_FORMACTION",$this->ctrl->getFormAction($this));
850 $this->tpl->setVariable(
"ALT_IMG",$this->lng->txt(
'obj_'.$tmp_obj->getType()));
851 $this->tpl->setVariable(
"TITLE",$tmp_obj->getTitle());
852 $this->tpl->setVariable(
"DESCRIPTION",$tmp_obj->getDescription());
853 $this->tpl->setVariable(
"TXT_PATH",$this->lng->txt(
'path'));
854 $this->tpl->setVariable(
"PATH",$this->
__getHTMLPath($this->pobject->getRefId()));
855 $this->tpl->setVariable(
"TXT_VENDOR",$this->lng->txt(
'paya_vendor'));
857 $this->tpl->setVariable(
"TXT_COUNT_PURCHASER",$this->lng->txt(
'paya_count_purchaser'));
859 $this->tpl->setVariable(
"TXT_STATUS",$this->lng->txt(
'status'));
861 $this->tpl->setVariable(
"TXT_PAY_METHOD",$this->lng->txt(
'paya_pay_method'));
865 include_once
'Services/Payment/classes/class.ilShopTopics.php';
869 $selectable_topics = array();
870 $selectable_topics[
''] = $this->lng->txt(
'please_choose');
871 foreach ($topics as $topic)
873 $selectable_topics[$topic->getId()] = $topic->getTitle();
876 $this->tpl->setVariable(
'TXT_TOPIC', $this->lng->txt(
'topic'));
877 $this->tpl->setVariable(
'TOPICS',
ilUtil::formSelect(array($this->pobject->getTopicId()),
'topic_id', $selectable_topics,
false,
true));
880 $this->tpl->setVariable(
"INPUT_CMD",
'updateObjectDetails');
881 $this->tpl->setVariable(
"INPUT_VALUE",$this->lng->txt(
'save'));
883 $this->tpl->setVariable(
"DELETE_CMD",
'deleteObject');
884 $this->tpl->setVariable(
"DELETE_VALUE",$this->lng->txt(
'delete'));
891 include_once
'./payment/classes/class.ilPaymentBookings.php';
893 if(!
$_GET[
'pobject_id'])
918 include_once
'./payment/classes/class.ilPaymentPrices.php';
919 include_once
'./payment/classes/class.ilPaymentBillVendor.php';
921 if(!
$_GET[
'pobject_id'])
931 $this->pobject->delete();
935 $price_obj->deleteAllPrices();
954 $path = $tree->getPathFull($a_ref_id);
957 foreach($path as
$data)
959 $html .= $data[
'title'].
' > ';
961 return substr($html,0,-2);
966 include_once
'./payment/classes/class.ilPaymentVendors.php';
971 $all_vendors = $vendor_obj->getVendors();
972 if (is_array($all_vendors))
974 foreach ($all_vendors as
$vendor)
976 $vendors[] = $vendor[
"vendor_id"];
984 $action[
$vendor] = $tmp_obj->getFullname().
' ['.$tmp_obj->getLogin().
']';
993 $action[$this->pobject->STATUS_NOT_BUYABLE] = $this->lng->txt(
'paya_not_buyable');
994 $action[$this->pobject->STATUS_BUYABLE] = $this->lng->txt(
'paya_buyable');
995 $action[$this->pobject->STATUS_EXPIRES] = $this->lng->txt(
'paya_expires');
1002 include_once
'./payment/classes/class.ilPayMethods.php';
1006 $action[$this->pobject->PAY_METHOD_NOT_SPECIFIED] = $this->lng->txt(
'paya_pay_method_not_specified');
1009 $action[$this->pobject->PAY_METHOD_BILL] = $this->lng->txt(
'pays_bill');
1013 $action[$this->pobject->PAY_METHOD_BMF] = $this->lng->txt(
'pays_bmf');
1017 $action[$this->pobject->PAY_METHOD_PAYPAL] = $this->lng->txt(
'pays_paypal');
1021 return ilUtil::formSelect($this->pobject->getPayMethod(),
'pay_method',$action,
false,
true);
1027 unset($_POST[
"title_type"]);
1028 unset($_POST[
"title_value"]);
1029 unset($_POST[
"vendor"]);
1030 unset($_POST[
"pay_method"]);
1042 if(!$rbacsystem->checkAccess(
"read", $this->object->getRefId()))
1044 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_read"),$this->ilias->error_obj->MESSAGE);
1047 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.paya_adm_objects.html',
'payment');
1049 if ($_POST[
"updateView"] == 1)
1051 $_SESSION[
"pay_objects"][
"title_type"] = $_POST[
"title_type"];
1052 $_SESSION[
"pay_objects"][
"title_value"] = $_POST[
"title_value"];
1053 $_SESSION[
"pay_objects"][
"pay_method"] = $_POST[
"pay_method"];
1054 $_SESSION[
"pay_objects"][
"vendor"] = $_POST[
"vendor"];
1058 $this->lng->loadLanguageModule(
'search');
1059 $this->tpl->setVariable(
"TXT_FILTER",$this->lng->txt(
'pay_filter'));
1060 $this->tpl->setVariable(
"FORM_ACTION",$this->ctrl->getFormAction($this));
1061 $this->tpl->setVariable(
"TXT_TITLE",$this->lng->txt(
"title"));
1062 $this->tpl->setVariable(
"TXT_AND",$this->lng->txt(
'search_all_words'));
1063 $this->tpl->setVariable(
"TXT_OR",$this->lng->txt(
'search_any_word'));
1064 $this->tpl->setVariable(
"TXT_BILL",$this->lng->txt(
'pays_bill'));
1065 $this->tpl->setVariable(
"TXT_BMF",$this->lng->txt(
'pays_bmf'));
1066 $this->tpl->setVariable(
"TXT_PAYPAL",$this->lng->txt(
'pays_paypal'));
1067 $this->tpl->setVariable(
"TXT_VENDOR",$this->lng->txt(
'paya_vendor'));
1068 $this->tpl->setVariable(
"TXT_PAYMENT",$this->lng->txt(
'payment_system'));
1069 $this->tpl->setVariable(
"TXT_UPDATE_VIEW",$this->lng->txt(
'pay_update_view'));
1070 $this->tpl->setVariable(
"TXT_RESET_FILTER",$this->lng->txt(
'pay_reset_filter'));
1072 $this->tpl->setVariable((
$_SESSION[
"pay_objects"][
"title_type"] !=
"" ? strtoupper(
$_SESSION[
"pay_objects"][
"title_type"]) :
"OR") .
"_CHECKED",
" checked");
1074 $this->tpl->setVariable(
"PAYMENT_" .
$_SESSION[
"pay_objects"][
"pay_method"],
" selected");
1085 foreach($objects as
$data)
1088 $f_result[$counter][] = $tmp_obj->getTitle();
1091 switch($data[
'status'])
1093 case $this->pobject->STATUS_BUYABLE:
1094 $f_result[$counter][] = $this->lng->txt(
'paya_buyable');
1097 case $this->pobject->STATUS_NOT_BUYABLE:
1098 $f_result[$counter][] = $this->lng->txt(
'paya_not_buyable');
1101 case $this->pobject->STATUS_EXPIRES:
1102 $f_result[$counter][] = $this->lng->txt(
'paya_expires');
1105 switch($data[
'pay_method'])
1107 case $this->pobject->PAY_METHOD_NOT_SPECIFIED:
1108 $f_result[$counter][] = $this->lng->txt(
'paya_pay_method_not_specified');
1111 case $this->pobject->PAY_METHOD_BILL:
1112 $f_result[$counter][] = $this->lng->txt(
'pays_bill');
1115 case $this->pobject->PAY_METHOD_BMF:
1116 $f_result[$counter][] = $this->lng->txt(
'pays_bmf');
1119 case $this->pobject->PAY_METHOD_PAYPAL:
1120 $f_result[$counter][] = $this->lng->txt(
'pays_paypal');
1124 $f_result[$counter][] = $tmp_user->getFullname().
' ['.$tmp_user->getLogin().
']';
1132 $this->ctrl->setParameter($this,
"pobject_id",$data[
'pobject_id']);
1133 $link_change =
"<div class=\"il_ContainerItemCommands\"><a class=\"il_ContainerItemCommand\" href=\"".$this->ctrl->getLinkTarget($this,
"editObject").
"\">".$this->lng->txt(
"edit").
"</a></div>";
1135 $f_result[$counter][] = $link_change;
1150 $tpl =& $tbl->getTemplateObject();
1153 $tpl->setCurrentBlock(
"tbl_form_header");
1155 $tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
1156 $tpl->parseCurrentBlock();
1175 $tbl->setTitle($this->lng->txt(
"objects"),
"icon_pays.gif",$this->lng->txt(
"objects"));
1176 $tbl->setHeaderNames(array($this->lng->txt(
"title"),
1177 $this->lng->txt(
"status"),
1178 $this->lng->txt(
"paya_pay_method"),
1179 $this->lng->txt(
"paya_vendor"),
1180 $this->lng->txt(
"paya_count_purchaser"),
1182 $header_params = $this->ctrl->getParameterArray($this,
'objects');
1183 $tbl->setHeaderVars(array(
"title",
1188 "options"),$header_params);
1194 $tbl->setColumnWidth(array(
"15%",
"15%",
"15%",
"20%",
"20%"));
1196 # $this->setTableGUIBasicData($tbl,$a_result_set);
1198 $offset =
$_GET[
"offset"];
1199 $order =
$_GET[
"sort_by"];
1200 $direction =
$_GET[
"sort_order"] ?
$_GET[
'sort_order'] :
'desc';
1202 $tbl->setOrderColumn($order,
'order_date');
1203 $tbl->setOrderDirection($direction);
1204 $tbl->setOffset($offset);
1205 $tbl->setLimit(
$_GET[
"limit"]);
1206 $tbl->setMaxCount(count($a_result_set));
1207 $tbl->setFooter(
"tblfooter",$this->lng->txt(
"previous"),$this->lng->txt(
"next"));
1208 $tbl->setData($a_result_set);
1212 $this->tpl->setVariable(
"OBJECTS_TABLE",$tbl->tpl->get());
1219 include_once
'./payment/classes/class.ilPaymentObject.php';
1228 switch($_POST[
"action"])
1230 case "deleteVendorsObject":
1234 case "editVendorObject":
1238 case "performEditVendorObject":
1252 unset($_POST[
"transaction_type"]);
1253 unset($_POST[
"transaction_value"]);
1254 unset($_POST[
"from"][
"day"]);
1255 unset($_POST[
"from"][
"month"]);
1256 unset($_POST[
"from"][
"year"]);
1257 unset($_POST[
"til"][
"day"]);
1258 unset($_POST[
"til"][
"month"]);
1259 unset($_POST[
"til"][
"year"]);
1260 unset($_POST[
"payed"]);
1261 unset($_POST[
"access"]);
1262 unset($_POST[
"customer"]);
1263 unset($_POST[
"pay_method"]);
1264 unset($_POST[
"updateView"]);
1275 if(!$rbacsystem->checkAccess(
"read", $this->object->getRefId()))
1277 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_read"),$this->ilias->error_obj->MESSAGE);
1280 $this->
__showButton(
'showObjectSelector',$this->lng->txt(
'paya_add_customer'));
1282 if ($_POST[
"updateView"] == 1)
1284 $_SESSION[
"pay_statistics"][
"updateView"] =
true;
1285 $_SESSION[
"pay_statistics"][
"transaction_type"] = $_POST[
"transaction_type"];
1286 $_SESSION[
"pay_statistics"][
"transaction_value"] = $_POST[
"transaction_value"];
1287 $_SESSION[
"pay_statistics"][
"from"][
"day"] = $_POST[
"from"][
"day"];
1288 $_SESSION[
"pay_statistics"][
"from"][
"month"] = $_POST[
"from"][
"month"];
1289 $_SESSION[
"pay_statistics"][
"from"][
"year"] = $_POST[
"from"][
"year"];
1290 $_SESSION[
"pay_statistics"][
"til"][
"day"] = $_POST[
"til"][
"day"];
1291 $_SESSION[
"pay_statistics"][
"til"][
"month"] = $_POST[
"til"][
"month"];
1292 $_SESSION[
"pay_statistics"][
"til"][
"year"] = $_POST[
"til"][
"year"];
1293 $_SESSION[
"pay_statistics"][
"payed"] = $_POST[
"payed"];
1294 $_SESSION[
"pay_statistics"][
"access"] = $_POST[
"access"];
1295 $_SESSION[
"pay_statistics"][
"pay_method"] = $_POST[
"pay_method"];
1296 $_SESSION[
"pay_statistics"][
"customer"] = $_POST[
"customer"];
1297 $_SESSION[
"pay_statistics"][
"vendor"] = $_POST[
"vendor"];
1300 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.paya_adm_statistic.html',
'payment');
1302 $this->tpl->setVariable(
"TXT_FILTER",$this->lng->txt(
'pay_filter'));
1303 $this->tpl->setVariable(
"FORM_ACTION",$this->ctrl->getFormAction($this));
1304 $this->tpl->setVariable(
"TXT_TRANSACTION",$this->lng->txt(
'paya_transaction'));
1305 $this->tpl->setVariable(
"TXT_STARTING",$this->lng->txt(
'pay_starting'));
1306 $this->tpl->setVariable(
"TXT_ENDING",$this->lng->txt(
'pay_ending'));
1307 $this->tpl->setVariable(
"TXT_PAYED",$this->lng->txt(
'paya_payed'));
1308 $this->tpl->setVariable(
"TXT_ALL",$this->lng->txt(
'pay_all'));
1309 $this->tpl->setVariable(
"TXT_YES",$this->lng->txt(
'yes'));
1310 $this->tpl->setVariable(
"TXT_NO",$this->lng->txt(
'no'));
1311 $this->tpl->setVariable(
"TXT_BILL",$this->lng->txt(
'pays_bill'));
1312 $this->tpl->setVariable(
"TXT_BMF",$this->lng->txt(
'pays_bmf'));
1313 $this->tpl->setVariable(
"TXT_PAYPAL",$this->lng->txt(
'pays_paypal'));
1314 $this->tpl->setVariable(
"TXT_PAYMENT",$this->lng->txt(
'payment_system'));
1315 $this->tpl->setVariable(
"TXT_CUSTOMER",$this->lng->txt(
'paya_customer'));
1316 $this->tpl->setVariable(
"TXT_VENDOR",$this->lng->txt(
'paya_vendor'));
1317 $this->tpl->setVariable(
"TXT_ACCESS",$this->lng->txt(
'paya_access'));
1318 $this->tpl->setVariable(
"TXT_ORDER_DATE_FROM",$this->lng->txt(
'pay_order_date_from'));
1319 $this->tpl->setVariable(
"TXT_ORDER_DATE_TIL",$this->lng->txt(
'pay_order_date_til'));
1320 $this->tpl->setVariable(
"TXT_UPDATE_VIEW",$this->lng->txt(
'pay_update_view'));
1321 $this->tpl->setVariable(
"TXT_RESET_FILTER",$this->lng->txt(
'pay_reset_filter'));
1323 $this->tpl->setVariable(
"TRANSACTION_TYPE_" .
$_SESSION[
"pay_statistics"][
"transaction_type"],
" selected");
1325 $this->tpl->setVariable(
"PAYED_" .
$_SESSION[
"pay_statistics"][
"payed"],
" selected");
1326 $this->tpl->setVariable(
"ACCESS_" .
$_SESSION[
"pay_statistics"][
"access"],
" selected");
1327 $this->tpl->setVariable(
"PAYMENT_" .
$_SESSION[
"pay_statistics"][
"pay_method"],
" selected");
1331 for ($i = 1; $i <= 31; $i++)
1333 $this->tpl->setCurrentBlock(
"loop_from_day");
1334 $this->tpl->setVariable(
"LOOP_FROM_DAY", $i < 10 ?
"0" . $i : $i);
1335 if (
$_SESSION[
"pay_statistics"][
"from"][
"day"] == $i)
1337 $this->tpl->setVariable(
"LOOP_FROM_DAY_SELECTED",
" selected");
1339 $this->tpl->parseCurrentBlock(
"loop_from_day");
1340 $this->tpl->setCurrentBlock(
"loop_til_day");
1341 $this->tpl->setVariable(
"LOOP_TIL_DAY", $i < 10 ?
"0" . $i : $i);
1342 if (
$_SESSION[
"pay_statistics"][
"til"][
"day"] == $i)
1344 $this->tpl->setVariable(
"LOOP_TIL_DAY_SELECTED",
" selected");
1346 $this->tpl->parseCurrentBlock(
"loop_til_day");
1348 for ($i = 1; $i <= 12; $i++)
1350 $this->tpl->setCurrentBlock(
"loop_from_month");
1351 $this->tpl->setVariable(
"LOOP_FROM_MONTH", $i < 10 ?
"0" . $i : $i);
1352 if (
$_SESSION[
"pay_statistics"][
"from"][
"month"] == $i)
1354 $this->tpl->setVariable(
"LOOP_FROM_MONTH_SELECTED",
" selected");
1356 $this->tpl->parseCurrentBlock(
"loop_from_month");
1357 $this->tpl->setCurrentBlock(
"loop_til_month");
1358 $this->tpl->setVariable(
"LOOP_TIL_MONTH", $i < 10 ?
"0" . $i : $i);
1359 if (
$_SESSION[
"pay_statistics"][
"til"][
"month"] == $i)
1361 $this->tpl->setVariable(
"LOOP_TIL_MONTH_SELECTED",
" selected");
1363 $this->tpl->parseCurrentBlock(
"loop_til_month");
1365 for ($i = 2004; $i <= date(
"Y"); $i++)
1367 $this->tpl->setCurrentBlock(
"loop_from_year");
1368 $this->tpl->setVariable(
"LOOP_FROM_YEAR", $i);
1369 if (
$_SESSION[
"pay_statistics"][
"from"][
"year"] == $i)
1371 $this->tpl->setVariable(
"LOOP_FROM_YEAR_SELECTED",
" selected");
1373 $this->tpl->parseCurrentBlock(
"loop_from_year");
1374 $this->tpl->setCurrentBlock(
"loop_til_year");
1375 $this->tpl->setVariable(
"LOOP_TIL_YEAR", $i);
1376 if (
$_SESSION[
"pay_statistics"][
"til"][
"year"] == $i)
1378 $this->tpl->setVariable(
"LOOP_TIL_YEAR_SELECTED",
" selected");
1380 $this->tpl->parseCurrentBlock(
"loop_til_year");
1383 if(!
$_SESSION[
'pay_statistics'][
'updateView'])
1385 $this->tpl->setVariable(
'FILTER_MESSAGE', $this->lng->txt(
'statistics_filter_advice'));
1391 if(!count($bookings = $this->booking_obj->getBookings()))
1399 # $this->__showButton('exportVendors',$this->lng->txt('excel_export'));
1401 $img_change =
"<img src=\"".ilUtil::getImagePath(
"edit.gif").
"\" alt=\"".
1402 $this->lng->txt(
"edit").
"\" title=\"".$this->lng->txt(
"edit").
1403 "\" border=\"0\" vspace=\"0\"/>";
1405 include_once
'Services/User/classes/class.ilObjUser.php';
1406 $object_title_cache = array();
1407 $user_title_cache = array();
1410 foreach($bookings as $booking)
1412 if(array_key_exists($booking[
'ref_id'], $object_title_cache))
1414 $tmp_obj = $object_title_cache[$booking[
'ref_id']];
1419 $object_title_cache[$booking[
'ref_id']] = $tmp_obj;
1421 if(array_key_exists($booking[
'b_vendor_id'], $user_title_cache))
1423 $tmp_vendor = $user_title_cache[$booking[
'b_vendor_id']];
1428 $user_title_cache[$booking[
'b_vendor_id']] = $tmp_vendor;
1430 if(array_key_exists($booking[
'customer_id'], $user_title_cache))
1432 $tmp_purchaser = $user_title_cache[$booking[
'customer_id']];
1437 $user_title_cache[$booking[
'customer_id']] = $tmp_purchaser;
1440 $transaction = $booking[
'transaction_extern'];
1441 switch ($booking[
'b_pay_method'])
1443 case $this->pobject->PAY_METHOD_BILL :
1444 $transaction .=
" (" . $this->lng->txt(
"pays_bill") .
")";
1446 case $this->pobject->PAY_METHOD_BMF :
1447 $transaction .=
" (" . $this->lng->txt(
"pays_bmf") .
")";
1449 case $this->pobject->PAY_METHOD_PAYPAL :
1450 $transaction .=
" (" . $this->lng->txt(
"pays_paypal") .
")";
1453 $f_result[$counter][] = $transaction;
1454 $f_result[$counter][] = ($tmp_obj !=
'' ? $tmp_obj : $this->lng->txt(
'object_deleted'));
1455 $f_result[$counter][] = ($tmp_vendor !=
'' ?
'['.$tmp_vendor.
']' : $this->lng->txt(
'user_deleted'));
1456 $f_result[$counter][] = ($tmp_purchaser !=
'' ?
'['.$tmp_purchaser.
']' : $this->lng->txt(
'user_deleted'));
1457 $f_result[$counter][] = date(
"Y-m-d H:i:s", $booking[
'order_date']);
1458 $f_result[$counter][] = $booking[
'duration'];
1459 $f_result[$counter][] = $booking[
'price'];
1460 $f_result[$counter][] = ($booking[
'discount'] !=
'' ? $booking[
'discount'] :
' ');
1462 $payed_access = $booking[
'payed'] ?
1463 $this->lng->txt(
'yes') :
1464 $this->lng->txt(
'no');
1466 $payed_access .=
'/';
1467 $payed_access .= $booking[
'access'] ?
1468 $this->lng->txt(
'yes') :
1469 $this->lng->txt(
'no');
1471 $f_result[$counter][] = $payed_access;
1473 $this->ctrl->setParameter($this,
"booking_id",$booking[
'booking_id']);
1474 # $link_change = "<a href=\"".$this->ctrl->getLinkTarget($this,"editStatistic")."\"> ".
1475 # $img_change."</a>";
1476 $link_change =
"<div class=\"il_ContainerItemCommands\"><a class=\"il_ContainerItemCommand\" href=\"".$this->ctrl->getLinkTarget($this,
"editStatistic").
"\">".$this->lng->txt(
"edit").
"</a></div>";
1478 $f_result[$counter][] = $link_change;
1482 unset($tmp_purchaser);
1491 if(!isset(
$_GET[
'booking_id']))
1494 $this->showStatistics();
1499 $this->
__showButton(
'statistic',$this->lng->txt(
'back'));
1501 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.paya_adm_edit_statistic.html',
'payment');
1502 $this->ctrl->setParameter($this,
'booking_id',(
int)
$_GET[
'booking_id']);
1505 if($a_show_confirm_delete)
1507 $this->tpl->setCurrentBlock(
"confirm_delete");
1508 $this->tpl->setVariable(
"CONFIRM_FORMACTION",$this->ctrl->getFormAction($this));
1509 $this->tpl->setVariable(
"TXT_CANCEL",$this->lng->txt(
'cancel'));
1510 $this->tpl->setVariable(
"CONFIRM_CMD",
'performDelete');
1511 $this->tpl->setVariable(
"TXT_CONFIRM",$this->lng->txt(
'confirm'));
1512 $this->tpl->parseCurrentBlock();
1517 $bookings = $this->booking_obj->getBookings();
1518 $booking = $bookings[(int) $_GET[
'booking_id']];
1523 $this->tpl->setVariable(
"STAT_FORMACTION",$this->ctrl->getFormAction($this));
1525 $this->tpl->setVariable(
"ALT_IMG",$this->lng->txt(
'obj_usr'));
1526 if(is_object($tmp_user))
1528 $this->tpl->setVariable(
'TITLE', $tmp_user->getFullname().
' ['.$tmp_user->getLogin().
']');
1532 $this->tpl->setVariable(
'TITLE', $this->lng->txt(
'user_deleted'));
1539 $this->tpl->setVariable(
"TXT_OBJECT",$this->lng->txt(
'title'));
1540 $this->tpl->setVariable(
"OBJECT", ($tmp_obj !=
'' ? $tmp_obj : $this->lng->txt(
'object_deleted')));
1542 $this->tpl->setVariable(
"TXT_TRANSACTION",$this->lng->txt(
'paya_transaction'));
1543 $this->tpl->setVariable(
"TXT_VENDOR",$this->lng->txt(
'paya_vendor'));
1544 $this->tpl->setVariable(
"TXT_PAY_METHOD",$this->lng->txt(
'paya_pay_method'));
1545 $this->tpl->setVariable(
"TXT_ORDER_DATE",$this->lng->txt(
'paya_order_date'));
1546 $this->tpl->setVariable(
"TXT_DURATION",$this->lng->txt(
'duration'));
1547 $this->tpl->setVariable(
"TXT_PRICE",$this->lng->txt(
'price_a'));
1548 $this->tpl->setVariable(
"TXT_PAYED",$this->lng->txt(
'paya_payed'));
1549 $this->tpl->setVariable(
"TXT_ACCESS",$this->lng->txt(
'paya_access'));
1551 $this->tpl->setVariable(
"TRANSACTION",$booking[
'transaction']);
1554 if(is_object($tmp_vendor))
1556 $this->tpl->setVariable(
'VENDOR', $tmp_vendor->getFullname().
' ['.$tmp_vendor->getLogin().
']');
1560 $this->tpl->setVariable(
'VENDOR', $this->lng->txt(
'user_deleted'));
1563 switch($booking[
'b_pay_method'])
1565 case $this->pobject->PAY_METHOD_BILL:
1566 $this->tpl->setVariable(
"PAY_METHOD",$this->lng->txt(
'pays_bill'));
1569 case $this->pobject->PAY_METHOD_BMF:
1570 $this->tpl->setVariable(
"PAY_METHOD",$this->lng->txt(
'pays_bmf'));
1573 case $this->pobject->PAY_METHOD_PAYPAL:
1574 $this->tpl->setVariable(
"PAY_METHOD",$this->lng->txt(
'pays_paypal'));
1578 $this->tpl->setVariable(
"PAY_METHOD",$this->lng->txt(
'paya_pay_method_not_specified'));
1581 $this->tpl->setVariable(
"ORDER_DATE",date(
'Y m d H:i:s',$booking[
'order_date']));
1582 $this->tpl->setVariable(
"DURATION",$booking[
'duration'].
' '.$this->lng->txt(
'paya_months'));
1583 $this->tpl->setVariable(
"PRICE",$booking[
'price']);
1585 $yes_no = array(0 => $this->lng->txt(
'no'),1 => $this->lng->txt(
'yes'));
1587 $this->tpl->setVariable(
"PAYED",
ilUtil::formSelect((
int) $booking[
'payed'],
'payed',$yes_no,
false,
true));
1588 $this->tpl->setVariable(
"ACCESS",
ilUtil::formSelect((
int) $booking[
'access'],
'access',$yes_no,
false,
true));
1591 $this->tpl->setVariable(
"INPUT_CMD",
'updateStatistic');
1592 $this->tpl->setVariable(
"INPUT_VALUE",$this->lng->txt(
'save'));
1594 $this->tpl->setVariable(
"DELETE_CMD",
'deleteStatistic');
1595 $this->tpl->setVariable(
"DELETE_VALUE",$this->lng->txt(
'delete'));
1599 if(!isset(
$_GET[
'booking_id']))
1608 $this->booking_obj->setBookingId((
int)
$_GET[
'booking_id']);
1609 $this->booking_obj->setAccess((
int) $_POST[
'access']);
1610 $this->booking_obj->setPayed((
int) $_POST[
'payed']);
1612 if($this->booking_obj->update())
1631 if(!isset(
$_GET[
'booking_id']))
1646 if(!isset(
$_GET[
'booking_id']))
1655 $this->booking_obj->setBookingId((
int)
$_GET[
'booking_id']);
1656 if(!$this->booking_obj->delete())
1658 die(
'Error deleting booking');
1681 if ($rbacsystem->checkAccess(
"visible,read",$this->object->getRefId()))
1683 $tabs_gui->addTarget(
"settings",
1684 $this->ctrl->getLinkTarget($this,
"generalSettings"), array(
"generalSettings",
"",
"view"),
"",
"");
1686 $tabs_gui->addTarget(
"statistic",
1687 $this->ctrl->getLinkTarget($this,
"statistic"),
"statistic",
"",
"");
1689 $tabs_gui->addTarget(
"objects",
1690 $this->ctrl->getLinkTarget($this,
"objects"),
"objects",
"",
"");
1692 $tabs_gui->addTarget(
"vendors",
1693 $this->ctrl->getLinkTarget($this,
"vendors"),
"vendors",
"",
"");
1695 $tabs_gui->addTarget(
"pay_methods",
1696 $this->ctrl->getLinkTarget($this,
"payMethods"),
"payMethods",
"",
"");
1698 $tabs_gui->addTarget(
'topics',
1699 $this->ctrl->getLinkTargetByClass(
'ilshoptopicsgui',
''),
'payment_topics',
'',
'');
1702 if ($rbacsystem->checkAccess(
'edit_permission',$this->object->getRefId()))
1704 $tabs_gui->addTarget(
"perm_settings",
1705 $this->ctrl->getLinkTargetByClass(array(get_class($this),
'ilpermissiongui'),
"perm"), array(
"perm",
"info",
"owner"),
'ilpermissiongui');
1714 if(!$rbacsystem->checkAccess(
"read", $this->object->getRefId()))
1716 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_read"),$this->ilias->error_obj->MESSAGE);
1719 include_once
'./payment/classes/class.ilGeneralSettings.php';
1721 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.pays_general_settings.html",
'payment');
1724 $genSetData = $genSet->getAll();
1726 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
1729 $form->setFormAction($this->ctrl->getFormAction($this,
"saveGeneralSettings"));
1730 $form->setTitle($this->lng->txt(
'pays_general_settings'));
1732 $form->addCommandButton(
'saveGeneralSettings',$this->lng->txt(
'save'));
1735 $formItem =
new ilCheckboxInputGUI($this->lng->txt(
'pay_enable_shop'),
'shop_enabled');
1736 $formItem->
setChecked((
int)$genSetData[
'shop_enabled']);
1737 $formItem->setInfo($this->lng->txt(
'pay_enable_shop_info'));
1738 $form->addItem($formItem);
1740 $formItem =
new ilTextInputGUI($this->lng->txt(
"pays_currency_unit"),
"currency_unit");
1742 $formItem->setValue($this->error !=
"" && isset($_POST[
'currency_unit'])
1745 $form->addItem($formItem);
1747 $formItem =
new ilTextInputGUI($this->lng->txt(
"pays_currency_subunit"),
"currency_subunit");
1749 $formItem->setValue($this->error !=
"" && isset($_POST[
'currency_subunit'])
1752 $form->addItem($formItem);
1756 $formItem->setCols(35);
1757 $formItem->setValue($this->error !=
"" && isset($_POST[
'address'])
1760 $form->addItem($formItem);
1764 $formItem->setCols(35);
1765 $formItem->setValue($this->error !=
"" && isset($_POST[
'bank_data'])
1768 $form->addItem($formItem);
1772 $formItem->setCols(35);
1773 $formItem->setValue($this->error !=
"" && isset($_POST[
'add_info'])
1776 $form->addItem($formItem);
1778 $formItem =
new ilTextInputGUI($this->lng->txt(
"pays_vat_rate"),
"vat_rate");
1780 $formItem->setValue($this->error !=
"" && isset($_POST[
'vat_rate'])
1783 $form->addItem($formItem);
1785 $formItem =
new ilTextInputGUI($this->lng->txt(
"pays_pdf_path"),
"pdf_path");
1786 $formItem->
setValue($this->error !=
"" && isset($_POST[
'pdf_path'])
1789 $form->addItem($formItem);
1792 $formItem =
new ilSelectInputGUI($this->lng->txt(
'pay_topics_default_sorting_type'),
'topics_sorting_type');
1793 $formItem->
setValue($genSetData[
'topics_sorting_type']);
1795 1 => $this->lng->txt(
'pay_topics_sort_by_title'),
1796 2 => $this->lng->txt(
'pay_topics_sort_by_date'),
1797 3 => $this->lng->txt(
'pay_topics_sort_manually')
1799 $formItem->setOptions($options);
1800 $form->addItem($formItem);
1803 $formItem =
new ilSelectInputGUI($this->lng->txt(
'pay_topics_default_sorting_direction'),
'topics_sorting_direction');
1804 $formItem->
setValue($genSetData[
'topics_sorting_direction']);
1806 'asc' => $this->lng->txt(
'sort_asc'),
1807 'desc' => $this->lng->txt(
'sort_desc'),
1809 $formItem->setOptions($options);
1810 $form->addItem($formItem);
1813 $formItem =
new ilCheckboxInputGUI($this->lng->txt(
'pay_topics_allow_custom_sorting'),
'topics_allow_custom_sorting');
1814 $formItem->
setChecked((
int)$genSetData[
'topics_allow_custom_sorting']);
1815 $formItem->setInfo($this->lng->txt(
'pay_topics_allow_custom_sorting_info'));
1816 $form->addItem($formItem);
1819 $formItem =
new ilSelectInputGUI($this->lng->txt(
'pay_max_hits'),
'max_hits');
1820 $formItem->
setValue($genSetData[
'max_hits']);
1822 for($i = 10; $i <= 100; $i += 10)
1826 $formItem->setOptions($options);
1827 $formItem->setInfo($this->lng->txt(
'pay_max_hits_info'));
1828 $form->addItem($formItem);
1830 $this->tpl->setVariable(
'GENERAL_SETTINGS',$form->getHTML());
1838 if(!$rbacsystem->checkAccess(
"read", $this->object->getRefId()))
1840 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_read"),$this->ilias->error_obj->MESSAGE);
1843 include_once
'./payment/classes/class.ilGeneralSettings.php';
1847 if ($_POST[
"currency_unit"] ==
"" ||
1848 $_POST[
"currency_subunit"] ==
"" ||
1849 $_POST[
"address"] ==
"" ||
1850 $_POST[
"bank_data"] ==
"" ||
1851 $_POST[
"pdf_path"] ==
"")
1853 $this->error = $this->lng->txt(
'pays_general_settings_not_valid');
1859 $genSet->clearAll();
1874 $genSet->setAll($values);
1887 if(!$rbacsystem->checkAccess(
"read", $this->object->getRefId()))
1889 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_read"),$this->ilias->error_obj->MESSAGE);
1892 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
1893 include_once
'./payment/classes/class.ilPaypalSettings.php';
1895 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.pays_paypal_settings.html",
'payment');
1900 $form->setFormAction($this->ctrl->getFormAction($this,
"savePaypalSettings"));
1901 $form->setTitle($this->lng->txt(
'pays_paypal_settings'));
1903 $form->addCommandButton(
'savePaypalSettings',$this->lng->txt(
'save'));
1905 $formItem =
new ilTextInputGUI($this->lng->txt(
"pays_server_host"),
"server_host");
1906 $formItem->
setValue($ppSet->getServerHost());
1907 $form->addItem($formItem);
1909 $formItem =
new ilTextInputGUI($this->lng->txt(
"pays_server_path"),
"server_path");
1910 $formItem->
setValue($ppSet->getServerPath());
1911 $form->addItem($formItem);
1913 $formItem =
new ilTextInputGUI($this->lng->txt(
"pays_email_vendor"),
"vendor");
1914 $formItem->
setValue($ppSet->getVendor());
1915 $form->addItem($formItem);
1917 $formItem =
new ilTextInputGUI($this->lng->txt(
"pays_auth_token"),
"auth_token");
1918 $formItem->
setValue($ppSet->getAuthToken());
1919 $form->addItem($formItem);
1921 $formItem =
new ilTextInputGUI($this->lng->txt(
"pays_page_style"),
"page_style");
1922 $formItem->
setValue($ppSet->getPageStyle());
1923 $form->addItem($formItem);
1925 $this->tpl->setVariable(
'PAYPAL_SETTINGS',$form->getHTML());
1930 include_once
'./payment/classes/class.ilPaypalSettings.php';
1935 if(!$rbacsystem->checkAccess(
"read", $this->object->getRefId()))
1937 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_read"),$this->ilias->error_obj->MESSAGE);
1949 if ($_POST[
"server_host"] ==
"" ||
1950 $_POST[
"server_path"] ==
"" ||
1951 $_POST[
"vendor"] ==
"" ||
1952 $_POST[
"auth_token"] ==
"")
1954 $this->error = $this->lng->txt(
'pays_paypal_settings_not_valid');
1971 include_once
'./payment/classes/class.ilPaymentBookings.php';
1976 if(!$rbacsystem->checkAccess(
"read", $this->object->getRefId()))
1978 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_read"),$this->ilias->error_obj->MESSAGE);
1984 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.pays_vendors.html",
'payment');
1986 $this->
__showButton(
'searchUser',$this->lng->txt(
'search_user'));
1988 $this->
object->initPaymentVendorsObject();
1989 if(!count($vendors = $this->object->payment_vendors_obj->getVendors()))
1995 # $this->__showButton('exportVendors',$this->lng->txt('excel_export'));
2002 $this->tpl->setCurrentBlock(
"confirm_delete");
2003 $this->tpl->setVariable(
"CONFIRM_FORMACTION",$this->ctrl->getFormAction($this));
2004 $this->tpl->setVariable(
"TXT_CANCEL",$this->lng->txt(
'cancel'));
2005 $this->tpl->setVariable(
"CONFIRM_CMD",
'performDeleteVendors');
2006 $this->tpl->setVariable(
"TXT_CONFIRM",$this->lng->txt(
'delete'));
2007 $this->tpl->parseCurrentBlock();
2011 $f_result = array();
2019 $vendor[
'vendor_id']);
2020 $f_result[$counter][] = $tmp_obj->getLogin();
2021 $f_result[$counter][] = $vendor[
'cost_center'];
2035 include_once
'./payment/classes/class.ilPaymentExcelWriterAdapter.php';
2045 $workbook =& $pewa->getWorkbook();
2051 include_once
'./classes/class.ilExcelUtils.php';
2052 include_once
'./payment/classes/class.ilPaymentVendors.php';
2056 if(!count($bookings = $this->booking_obj->getBookings()))
2061 $workbook =& $pewa->getWorkbook();
2062 $worksheet =& $workbook->addWorksheet(utf8_decode($this->lng->txt(
'paya_statistic')));
2064 $worksheet->mergeCells(0,0,0,8);
2065 $worksheet->setColumn(0,0,16);
2066 $worksheet->setColumn(0,1,32);
2067 $worksheet->setColumn(0,2,32);
2068 $worksheet->setColumn(0,3,16);
2069 $worksheet->setColumn(0,4,16);
2070 $worksheet->setColumn(0,5,16);
2071 $worksheet->setColumn(0,6,24);
2072 $worksheet->setColumn(0,7,8);
2073 $worksheet->setColumn(0,8,12);
2074 $worksheet->setColumn(0,9,16);
2076 $title = $this->lng->txt(
'paya_statistic');
2077 $title .=
' '.$this->lng->txt(
'as_of');
2078 $title .= strftime(
'%Y-%m-%d %R',time());
2080 $worksheet->writeString(0,0,
$title,$pewa->getFormatTitle());
2093 include_once
'Services/User/classes/class.ilObjUser.php';
2094 $object_title_cache = array();
2095 $user_title_cache = array();
2098 foreach($bookings as $booking)
2100 if(array_key_exists($booking[
'ref_id'], $object_title_cache))
2102 $tmp_obj = $object_title_cache[$booking[
'ref_id']];
2107 $object_title_cache[$booking[
'ref_id']] = $tmp_obj;
2109 if(array_key_exists($booking[
'b_vendor_id'], $user_title_cache))
2111 $tmp_vendor = $user_title_cache[$booking[
'b_vendor_id']];
2116 $user_title_cache[$booking[
'b_vendor_id']] = $tmp_vendor;
2118 if(array_key_exists($booking[
'customer_id'], $user_title_cache))
2120 $tmp_purchaser = $user_title_cache[$booking[
'customer_id']];
2125 $user_title_cache[$booking[
'customer_id']] = $tmp_purchaser;
2128 switch ($booking[
'b_pay_method'])
2130 case $this->pobject->PAY_METHOD_BILL :
2131 $pay_method = $this->lng->txt(
"pays_bill");
2133 case $this->pobject->PAY_METHOD_BMF :
2134 $pay_method = $this->lng->txt(
"pays_bmf");
2136 case $this->pobject->PAY_METHOD_PAYPAL :
2137 $pay_method = $this->lng->txt(
"pays_paypal");
2143 $worksheet->writeString($counter,3,
ilExcelUtils::_convert_text(($tmp_vendor !=
'' ? $tmp_vendor : $this->lng->txt(
'user_deleted'))));
2145 $worksheet->writeString($counter,5,
ilExcelUtils::_convert_text(($tmp_purchaser !=
'' ? $tmp_purchaser : $this->lng->txt(
'user_deleted'))));
2146 $worksheet->writeString($counter,6,strftime(
'%Y-%m-%d %R',$booking[
'order_date']));
2155 $worksheet->writeString($counter,7,$booking[
'duration']);
2158 $payed_access = $booking[
'payed'] ?
2159 $this->lng->txt(
'yes') :
2160 $this->lng->txt(
'no');
2162 $payed_access .=
'/';
2163 $payed_access .= $booking[
'access'] ?
2164 $this->lng->txt(
'yes') :
2165 $this->lng->txt(
'no');
2167 $worksheet->writeString($counter,9,$payed_access);
2171 unset($tmp_purchaser);
2179 include_once
'./classes/class.ilExcelUtils.php';
2181 $this->
object->initPaymentVendorsObject();
2182 if(!count($vendors = $this->object->payment_vendors_obj->getVendors()))
2187 $workbook =& $pewa->getWorkbook();
2191 $worksheet->mergeCells(0,0,0,2);
2192 $worksheet->setColumn(1,0,32);
2193 $worksheet->setColumn(1,1,32);
2194 $worksheet->setColumn(1,2,32);
2196 $title = $this->lng->txt(
'paya_vendor_list');
2197 $title .=
' '.$this->lng->txt(
'as_of');
2198 $title .= strftime(
'%Y-%m-%d %R',time());
2200 $worksheet->writeString(0,0,
$title,$pewa->getFormatTitle());
2223 include_once
'./payment/classes/class.ilPayMethods.php';
2228 if(!$rbacsystem->checkAccess(
"read", $this->object->getRefId()))
2230 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_read"),$this->ilias->error_obj->MESSAGE);
2233 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.pays_pay_methods.html",
'payment');
2235 $this->tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
2237 $this->tpl->setVariable(
"ALT_IMG",$this->lng->txt(
'obj_pays'));
2238 $this->tpl->setVariable(
"TITLE",$this->lng->txt(
'pays_pay_methods'));
2239 $this->tpl->setVariable(
"TXT_OFFLINE",$this->lng->txt(
'pays_offline'));
2240 $this->tpl->setVariable(
"TXT_BILL",$this->lng->txt(
'pays_bill'));
2244 $this->tpl->setVariable(
"TXT_ENABLED",$this->lng->txt(
'enabled'));
2245 $this->tpl->setVariable(
"TXT_ONLINE",$this->lng->txt(
'pays_online'));
2246 $this->tpl->setVariable(
"TXT_BMF",$this->lng->txt(
'pays_bmf'));
2249 $this->tpl->setVariable(
"TXT_ENABLED",$this->lng->txt(
'enabled'));
2250 $this->tpl->setVariable(
"TXT_ONLINE",$this->lng->txt(
'pays_online'));
2251 $this->tpl->setVariable(
"TXT_PAYPAL",$this->lng->txt(
'pays_paypal'));
2255 $this->tpl->setVariable(
"COLUMN_COUNT",3);
2256 $this->tpl->setVariable(
"PBTN_NAME",
'savePayMethods');
2257 $this->tpl->setVariable(
"PBTN_VALUE",$this->lng->txt(
'save'));
2263 include_once
'./payment/classes/class.ilPayMethods.php';
2264 include_once
'./payment/classes/class.ilPaymentObject.php';
2270 if(!$rbacsystem->checkAccess(
"read", $this->object->getRefId()))
2272 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_read"),$this->ilias->error_obj->MESSAGE);
2311 if(isset($_POST[
'pm_bill']))
2315 if(isset($_POST[
'pm_bmf']))
2319 if(isset($_POST[
'pm_paypal']))
2340 include_once
'./payment/classes/class.ilPaymentBookings.php';
2342 if(!count($_POST[
'vendor']))
2350 foreach($_POST[
'vendor'] as
$vendor)
2361 $_SESSION[
"pays_vendor"] = $_POST[
"vendor"];
2369 include_once
'./payment/classes/class.ilPaymentTrustees.php';
2374 if(!$rbacsystem->checkAccess(
"write", $this->object->getRefId()))
2376 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_write"),$this->ilias->error_obj->MESSAGE);
2379 $this->
object->initPaymentVendorsObject();
2383 $this->
object->payment_vendors_obj->delete($vendor);
2400 if(!$rbacsystem->checkAccess(
"write", $this->object->getRefId()))
2402 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_write"),$this->ilias->error_obj->MESSAGE);
2405 if(!count($_POST[
'vendor']))
2412 if(count($_POST[
'vendor']) > 1)
2420 $_SESSION[
"pays_vendor"] = $_POST[
"vendor"][0];
2422 $this->
object->initPaymentVendorsObject();
2424 if (!is_array($this->object->payment_vendors_obj->vendors[
$_SESSION[
"pays_vendor"]]))
2431 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.pays_vendor.html',
'payment');
2433 $this->tpl->setVariable(
"VENDOR_FORMACTION",$this->ctrl->getFormAction($this));
2437 $this->tpl->setVariable(
"ALT_IMG",$this->lng->txt(
'obj_usr'));
2438 $this->tpl->setVariable(
"TITLE",$this->lng->txt(
'pays_vendor'));
2441 $this->tpl->setVariable(
"TXT_VENDOR",$this->lng->txt(
'pays_vendor'));
2442 $this->tpl->setVariable(
"TXT_COST_CENTER",$this->lng->txt(
'pays_cost_center'));
2444 $this->tpl->setVariable(
"INPUT_VALUE",ucfirst($this->lng->txt(
'save')));
2448 $this->tpl->setVariable(
"VENDOR",
2450 $this->tpl->setVariable(
"COST_CENTER",
2451 $this->error !=
"" && isset($_POST[
'cost_center'])
2456 $this->tpl->addBlockfile(
"BUTTONS",
"buttons",
"tpl.buttons.html");
2457 $this->tpl->setCurrentBlock(
"btn_cell");
2458 $this->tpl->setVariable(
"BTN_LINK", $this->ctrl->getLinkTarget($this,
"vendors"));
2459 $this->tpl->setVariable(
"BTN_TXT", $this->lng->txt(
'pay_bmf_back'));
2460 $this->tpl->parseCurrentBlock(
"btn_cell");
2468 if(!$rbacsystem->checkAccess(
"write", $this->object->getRefId()))
2470 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_write"),$this->ilias->error_obj->MESSAGE);
2488 $this->
object->initPaymentVendorsObject();
2490 if (!is_array($this->object->payment_vendors_obj->vendors[
$_SESSION[
"pays_vendor"]]))
2497 if ($_POST[
"cost_center"] ==
"")
2499 $this->error = $this->lng->txt(
'pays_cost_center_not_valid');
2501 $_POST[
"vendor"] = array(
$_SESSION[
"pays_vendor"]);
2506 $this->
object->initPaymentVendorsObject();
2507 $this->
object->payment_vendors_obj->update(
$_SESSION[
"pays_vendor"], $_POST[
"cost_center"]);
2518 global $rbacsystem,
$tree;
2521 if(!$rbacsystem->checkAccess(
"read", $this->object->getRefId()))
2523 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_read"),$this->ilias->error_obj->MESSAGE);
2526 include_once
'./payment/classes/class.ilPaymentObjectSelector.php';
2528 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.paya_object_selector.html",
'payment');
2529 $this->
__showButton(
'statistic',$this->lng->txt(
'back'));
2534 $exp =
new ilPaymentObjectSelector($this->ctrl->getLinkTarget($this,
'showObjectSelector'), strtolower(get_class($this)));
2535 $exp->
setExpand(
$_GET[
"paya_link_expand"] ?
$_GET[
"paya_link_expand"] : $tree->readRootId());
2536 $exp->setExpandTarget($this->ctrl->getLinkTarget($this,
'showObjectSelector'));
2540 $this->tpl->setVariable(
"EXPLORER",$exp->getOutput());
2550 if(!$rbacsystem->checkAccess(
"read", $this->object->getRefId()))
2552 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_read"),$this->ilias->error_obj->MESSAGE);
2555 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.pays_user_search.html",
'payment');
2556 $this->
__showButton(
'vendors',$this->lng->txt(
'back'));
2558 $this->lng->loadLanguageModule(
'search');
2560 $this->tpl->setVariable(
"F_ACTION",$this->ctrl->getFormAction($this));
2561 $this->tpl->setVariable(
"SEARCH_ASSIGN_USR",$this->lng->txt(
"crs_search_members"));
2562 $this->tpl->setVariable(
"SEARCH_SEARCH_TERM",$this->lng->txt(
"search_search_term"));
2563 $this->tpl->setVariable(
"SEARCH_VALUE",
$_SESSION[
"pays_search_str"] ?
$_SESSION[
"pays_search_str"] :
"");
2564 $this->tpl->setVariable(
"BTN2_VALUE",$this->lng->txt(
"cancel"));
2565 $this->tpl->setVariable(
"BTN1_VALUE",$this->lng->txt(
"search"));
2572 global $rbacsystem,
$tree;
2574 if(!$rbacsystem->checkAccess(
"read", $this->object->getRefId()))
2576 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_read"),$this->ilias->error_obj->MESSAGE);
2579 $_SESSION[
"pays_search_str"] = $_POST[
"search_str"] = $_POST[
"search_str"] ? $_POST[
"search_str"] :
$_SESSION[
"pays_search_str"];
2581 if(!isset($_POST[
"search_str"]))
2596 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.pays_usr_selection.html",
'payment');
2597 $this->
__showButton(
"searchUser",$this->lng->txt(
"crs_new_search"));
2600 $f_result = array();
2608 $f_result[$counter][] = $tmp_obj->getLogin();
2609 $f_result[$counter][] = $tmp_obj->getLastname();
2610 $f_result[$counter][] = $tmp_obj->getFirstname();
2624 if(!$rbacsystem->checkAccess(
"write", $this->object->getRefId()))
2626 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_write"),$this->ilias->error_obj->MESSAGE);
2628 if(!$_POST[
'vendor_login'])
2643 $this->
object->initPaymentVendorsObject();
2645 if($this->object->payment_vendors_obj->isAssigned($usr_id))
2652 $this->
object->payment_vendors_obj->add($usr_id);
2665 if(!$rbacsystem->checkAccess(
"write", $this->object->getRefId()))
2667 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_write"),$this->ilias->error_obj->MESSAGE);
2670 $this->lng->loadLanguageModule(
'crs');
2671 if(!is_array($_POST[
"user"]))
2679 $this->
object->initPaymentVendorsObject();
2681 $already_assigned = $assigned = 0;
2682 foreach($_POST[
'user'] as $usr_id)
2684 if($this->object->payment_vendors_obj->isAssigned($usr_id))
2686 ++$already_assigned;
2690 $this->
object->payment_vendors_obj->add($usr_id);
2698 $message .= $this->lng->txt(
'pays_assigned_vendors').
' '.$assigned;
2700 if($already_assigned)
2702 $message .=
'<br />'.$this->lng->txt(
'pays_already_assigned_vendors').
' '.$already_assigned;
2714 if(!isset(
$_GET[
'sell_id']))
2722 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.paya_user_search.html",
'payment');
2723 $this->
__showButton(
'showObjectSelector',$this->lng->txt(
'back'));
2725 $this->lng->loadLanguageModule(
'search');
2727 $this->ctrl->setParameter($this,
"sell_id",
$_GET[
"sell_id"]);
2728 $this->tpl->setVariable(
"F_ACTION",$this->ctrl->getFormAction($this));
2729 $this->tpl->setVariable(
"SEARCH_ASSIGN_USR",$this->lng->txt(
"search_user"));
2730 $this->tpl->setVariable(
"SEARCH_SEARCH_TERM",$this->lng->txt(
"search_search_term"));
2731 $this->tpl->setVariable(
"SEARCH_VALUE",
$_SESSION[
"paya_search_str_user_sp"] ?
$_SESSION[
"paya_search_str_user_sp"] :
"");
2732 $this->tpl->setVariable(
"BTN2_VALUE",$this->lng->txt(
"cancel"));
2733 $this->tpl->setVariable(
"BTN1_VALUE",$this->lng->txt(
"search"));
2734 $this->tpl->setVariable(
"SEARCH",
"performSearchSP");
2735 $this->tpl->setVariable(
"CANCEL",
"statistic");
2743 $_SESSION[
"paya_search_str_user_sp"] = $_POST[
"search_str"] = $_POST[
"search_str"] ? $_POST[
"search_str"] :
$_SESSION[
"paya_search_str_user_sp"];
2745 if(!trim($_POST[
"search_str"]))
2748 $this->statistics();
2760 if(!isset(
$_GET[
'sell_id']))
2768 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.paya_usr_selection.html",
'payment');
2769 $this->ctrl->setParameter($this,
"sell_id",
$_GET[
"sell_id"]);
2770 $this->
__showButton(
"searchUserSP",$this->lng->txt(
"back"));
2773 $f_result = array();
2780 $f_result[$counter][] = ilUtil::formRadiobutton(0,
"user_id",$user[
"id"]);
2781 $f_result[$counter][] = $tmp_obj->getLogin();
2782 $f_result[$counter][] = $tmp_obj->getFirstname();
2783 $f_result[$counter][] = $tmp_obj->getLastname();
2793 if ($_POST[
"sell_id"] !=
"")
$_GET[
"sell_id"] = $_POST[
"sell_id"];
2794 if (
$_GET[
"user_id"] !=
"") $_POST[
"user_id"] =
$_GET[
"user_id"];
2796 if(!isset(
$_GET[
'sell_id']))
2804 if(!isset($_POST[
'user_id']))
2812 $this->ctrl->setParameter($this,
"sell_id",
$_GET[
"sell_id"]);
2813 $this->
__showButton(
'searchUserSP',$this->lng->txt(
'back'));
2815 $this->ctrl->setParameter($this,
"user_id", $_POST[
"user_id"]);
2827 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.paya_add_customer.html',
'payment');
2829 $this->tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
2832 $this->tpl->setVariable(
"ALT_IMG",$this->lng->txt(
'obj_usr'));
2833 $this->tpl->setVariable(
"TITLE",$tmp_user->getFullname().
' ['.$tmp_user->getLogin().
']');
2836 $this->tpl->setVariable(
"TXT_TRANSACTION",$this->lng->txt(
'paya_transaction'));
2839 $this->tpl->setVariable(
"TXT_OB JECT",$this->lng->txt(
'title'));
2840 $this->tpl->setVariable(
"OBJECT",$tmp_obj->getTitle());
2842 $this->tpl->setVariable(
"TXT_VENDOR",$this->lng->txt(
'paya_vendor'));
2843 $this->tpl->setVariable(
"VENDOR",$tmp_vendor->getFullname().
' ['.$tmp_vendor->getLogin().
']');
2845 $this->tpl->setVariable(
"TXT_PAY_METHOD",$this->lng->txt(
'paya_pay_method'));
2846 $this->tpl->setVariable(
"TXT_PAY_METHOD_BILL",$this->lng->txt(
'pays_bill'));
2847 $this->tpl->setVariable(
"TXT_PAY_METHOD_BMF",$this->lng->txt(
'pays_bmf'));
2848 $this->tpl->setVariable(
"TXT_PAY_METHOD_PAYPAL",$this->lng->txt(
'pays_paypal'));
2849 $this->tpl->setVariable(
"PAY_METHOD_".$_POST[
"pay_method"],
" selected");
2851 $this->tpl->setVariable(
"TXT_ORDER_DATE",$this->lng->txt(
'paya_order_date'));
2854 $this->tpl->setVariable(
"TXT_DURATION",$this->lng->txt(
'duration'));
2855 include_once
'./payment/classes/class.ilPaymentPrices.php';
2857 if (is_array($prices = $prices_obj->getPrices()))
2859 foreach($prices as $price)
2861 $this->tpl->setCurrentBlock(
"duration_loop");
2862 if ($_POST[
"duration"] == $price[
"price_id"]) $this->tpl->setVariable(
"DURATION_LOOP_SELECTED",
" selected");
2863 $this->tpl->setVariable(
"DURATION_LOOP_ID", $price[
"price_id"]);
2864 $this->tpl->setVariable(
"DURATION_LOOP_NAME", $price[
"duration"].
" ".$this->lng->txt(
"paya_months").
", ".
ilPaymentPrices::_getPriceString($price[
"price_id"]));
2865 $this->tpl->parseCurrentBlock();
2869 $this->tpl->setVariable(
"TXT_PAYED",$this->lng->txt(
'paya_payed'));
2870 if ($_POST[
"payed"] == 1) $this->tpl->setVariable(
"PAYED_1",
" selected");
2871 $this->tpl->setVariable(
"TXT_ACCESS",$this->lng->txt(
'paya_access'));
2872 if ($_POST[
"access"] == 1) $this->tpl->setVariable(
"ACCESS_1",
" selected");
2874 $this->tpl->setVariable(
"TXT_NO",$this->lng->txt(
'no'));
2875 $this->tpl->setVariable(
"TXT_YES",$this->lng->txt(
'yes'));
2876 $this->tpl->setVariable(
"TXT_SAVE",$this->lng->txt(
'save'));
2877 $this->tpl->setVariable(
"TXT_CANCEL",$this->lng->txt(
'cancel'));
2878 $this->tpl->setVariable(
"STATISTICS",
"statistic");
2886 if(!isset(
$_GET[
'sell_id']))
2894 if(!isset(
$_GET[
'user_id']))
2902 if ($_POST[
"pay_method"] ==
"" ||
2903 $_POST[
"duration"] ==
"")
2916 $inst_id_time = $ilias->getSetting(
'inst_id').
'_'.$this->user_obj->getId().
'_'.substr((
string) time(),-3);
2917 $transaction = $inst_id_time.substr(md5(uniqid(rand(),
true)), 0, 4);
2918 $this->booking_obj->setTransaction($transaction);
2919 $this->booking_obj->setTransactionExtern($_POST[
"transaction"]);
2920 $this->booking_obj->setPobjectId($pObjectId);
2921 $this->booking_obj->setCustomerId(
$_GET[
"user_id"]);
2922 $this->booking_obj->setVendorId($obj->getVendorId());
2923 $this->booking_obj->setPayMethod((
int) $_POST[
"pay_method"]);
2924 $this->booking_obj->setOrderDate(time());
2925 include_once
'./payment/classes/class.ilPaymentPrices.php';
2927 $this->booking_obj->setDuration($price[
"duration"]);
2929 $this->booking_obj->setAccess((
int) $_POST[
'access']);
2930 $this->booking_obj->setPayed((
int) $_POST[
'payed']);
2931 $this->booking_obj->setVoucher(
'');
2933 if($this->booking_obj->add())
2950 $this->section = $a_section;
2958 $this->mainSection = $a_section;
2969 $this->tabs_gui->addSubTabTarget(
'pays_general',
2970 $this->ctrl->getLinkTargetByClass(
'ilobjpaymentsettingsgui',
'generalSettings'),
2974 $this->
__getSection() == $this->SECTION_GENERAL ?
true :
false);
2975 $this->tabs_gui->addSubTabTarget(
'pays_bmf',
2976 $this->ctrl->getLinkTargetByClass(
'ilobjpaymentsettingsgui',
'bmfSettings'),
2980 $this->
__getSection() == $this->SECTION_BMF ?
true :
false);
2981 $this->tabs_gui->addSubTabTarget(
'pays_paypal',
2982 $this->ctrl->getLinkTargetByClass(
'ilobjpaymentsettingsgui',
'paypalSettings'),
2986 $this->
__getSection() == $this->SECTION_PAYPAL ?
true :
false);
2993 $tpl =& $tbl->getTemplateObject();
2996 $tpl->setCurrentBlock(
"tbl_form_header");
2998 $tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
2999 $tpl->parseCurrentBlock();
3002 $tbl->setTitle($this->lng->txt(
"paya_statistic"),
"icon_pays.gif",$this->lng->txt(
"paya_statistic"));
3003 $tbl->setHeaderNames(array($this->lng->txt(
"paya_transaction"),
3004 $this->lng->txt(
"title"),
3005 $this->lng->txt(
"paya_vendor"),
3006 $this->lng->txt(
"paya_customer"),
3007 $this->lng->txt(
"paya_order_date"),
3008 $this->lng->txt(
"duration"),
3009 $this->lng->txt(
"price_a"),
3010 $this->lng->txt(
"paya_coupons_coupons"),
3011 $this->lng->txt(
"paya_payed_access"),
3014 $tbl->setHeaderVars(array(
"transaction",
3024 $this->ctrl->getParameterArray($this,
"statistic",
false));
3026 $offset =
$_GET[
"offset"];
3027 $order =
$_GET[
"sort_by"];
3028 $direction =
$_GET[
"sort_order"] ?
$_GET[
'sort_order'] :
'desc';
3030 $tbl->setOrderColumn($order,
'order_date');
3031 $tbl->setOrderDirection($direction);
3032 $tbl->setOffset($offset);
3033 $tbl->setLimit(
$_GET[
"limit"]);
3034 $tbl->setMaxCount(count($a_result_set));
3035 $tbl->setFooter(
"tblfooter",$this->lng->txt(
"previous"),$this->lng->txt(
"next"));
3036 $tbl->setData($a_result_set);
3038 $tpl->setVariable(
"COLUMN_COUNTS",10);
3039 $tpl->setCurrentBlock(
"plain_buttons");
3040 $tpl->setVariable(
"PBTN_NAME",
"exportVendors");
3041 $tpl->setVariable(
"PBTN_VALUE",$this->lng->txt(
"excel_export"));
3042 $tpl->parseCurrentBlock();
3045 $this->tpl->setVariable(
"STATISTIC_TABLE",$tbl->tpl->get());
3052 include_once
'./payment/classes/class.ilPaymentBookings.php';
3060 "editVendorObject" => $this->lng->txt(
"pays_edit_vendor"),
3061 "deleteVendorsObject" => $this->lng->txt(
"pays_delete_vendor")
3065 $tpl =& $tbl->getTemplateObject();
3068 $tpl->setCurrentBlock(
"tbl_form_header");
3070 $tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
3071 $tpl->parseCurrentBlock();
3073 $tpl->setCurrentBlock(
"tbl_action_row");
3075 $tpl->setCurrentBlock(
"input_text");
3076 $tpl->setVariable(
"PB_TXT_NAME",
'vendor_login');
3077 $tpl->parseCurrentBlock();
3079 $tpl->setCurrentBlock(
"plain_button");
3080 $tpl->setVariable(
"PBTN_NAME",
"addVendor");
3081 $tpl->setVariable(
"PBTN_VALUE",$this->lng->txt(
"pays_add_vendor"));
3082 $tpl->parseCurrentBlock();
3083 $tpl->setCurrentBlock(
"plain_buttons");
3084 $tpl->parseCurrentBlock();
3086 $tpl->setVariable(
"COLUMN_COUNTS",4);
3090 $tpl->setCurrentBlock(
"tbl_action_select");
3092 $tpl->setVariable(
"BTN_NAME",
"gateway");
3093 $tpl->setVariable(
"BTN_VALUE",$this->lng->txt(
"execute"));
3094 $tpl->parseCurrentBlock();
3095 $tpl->setCurrentBlock(
"tbl_action_row");
3096 $tpl->setVariable(
"TPLPATH",$this->tpl->tplPath);
3097 $tpl->parseCurrentBlock();
3099 $tbl->setTitle($this->lng->txt(
"vendors"),
"icon_usr.gif",$this->lng->txt(
"vendors"));
3100 $tbl->setHeaderNames(array(
'',
3101 $this->lng->txt(
"pays_vendor"),
3102 $this->lng->txt(
"pays_cost_center"),
3103 $this->lng->txt(
"pays_number_bookings")));
3104 $tbl->setHeaderVars(array(
"",
3108 array(
"ref_id" => $this->object->getRefId(),
3110 "update_members" => 1,
3111 "baseClass" =>
"ilAdministrationGUI",
3112 "cmdClass" =>
"ilobjpaymentsettingsgui",
3113 "cmdNode" =>
$_GET[
"cmdNode"]));
3114 # $tbl->setColumnWidth(array("4%","48%","25%","24%"));
3116 $tpl->setVariable(
"COLUMN_COUNTS",9);
3117 $tpl->setCurrentBlock(
"plain_buttons");
3118 $tpl->setVariable(
"PBTN_NAME",
"exportVendors");
3119 $tpl->setVariable(
"PBTN_VALUE",$this->lng->txt(
"excel_export"));
3120 $tpl->parseCurrentBlock();
3125 $this->tpl->setVariable(
"VENDOR_TABLE",$tbl->tpl->get());
3134 $tpl =& $tbl->getTemplateObject();
3138 $tpl->setCurrentBlock(
"tbl_form_header");
3139 $tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
3140 $tpl->parseCurrentBlock();
3142 $tpl->setCurrentBlock(
"tbl_action_btn");
3143 $tpl->setVariable(
"BTN_NAME",
"addUser");
3144 $tpl->setVariable(
"BTN_VALUE",$this->lng->txt(
"add"));
3145 $tpl->parseCurrentBlock();
3147 $tpl->setCurrentBlock(
"tbl_action_btn");
3148 $tpl->setVariable(
"BTN_NAME",
"vendors");
3149 $tpl->setVariable(
"BTN_VALUE",$this->lng->txt(
"cancel"));
3150 $tpl->parseCurrentBlock();
3152 $tpl->setCurrentBlock(
"tbl_action_row");
3153 $tpl->setVariable(
"COLUMN_COUNTS",5);
3155 $tpl->parseCurrentBlock();
3157 $tbl->setTitle($this->lng->txt(
"pays_header_select_vendor"),
"icon_usr.gif",$this->lng->txt(
"pays_header_select_vendor"));
3158 $tbl->setHeaderNames(array(
"",
3159 $this->lng->txt(
"login"),
3160 $this->lng->txt(
"firstname"),
3161 $this->lng->txt(
"lastname")));
3162 $tbl->setHeaderVars(array(
"",
3166 array(
"ref_id" => $this->object->getRefId(),
3168 "cmdClass" =>
"ilobjpaymentsettingsgui",
3169 "cmdNode" =>
$_GET[
"cmdNode"]));
3171 $tbl->setColumnWidth(array(
"3%",
"32%",
"32%",
"32%"));
3176 $this->tpl->setVariable(
"SEARCH_RESULT_TABLE",$tbl->tpl->get());
3183 $this->tpl->addBlockfile(
"BUTTONS",
"buttons",
"tpl.buttons.html");
3186 $this->tpl->setCurrentBlock(
"btn_cell");
3187 $this->tpl->setVariable(
"BTN_LINK",$this->ctrl->getLinkTarget($this,$a_cmd));
3188 $this->tpl->setVariable(
"BTN_TXT",$a_text);
3191 $this->tpl->setVariable(
"BTN_TARGET",$a_target);
3194 $this->tpl->parseCurrentBlock();
3199 include_once
"./Services/Table/classes/class.ilTableGUI.php";
3206 $offset =
$_GET[
"offset"];
3207 $order =
$_GET[
"sort_by"];
3208 $direction =
$_GET[
"sort_order"];
3210 $tbl->setOrderColumn($order);
3211 $tbl->setOrderDirection($direction);
3212 $tbl->setOffset($offset);
3213 $tbl->setLimit(
$_GET[
"limit"]);
3214 $tbl->setMaxCount(count($result_set));
3215 $tbl->setFooter(
"tblfooter",$this->lng->txt(
"previous"),$this->lng->txt(
"next"));
3216 $tbl->setData($result_set);
3221 include_once(
"./classes/class.ilSearch.php");
3223 $this->lng->loadLanguageModule(
"content");
3226 $search->setPerformUpdate(
false);
3228 $search->setCombination(
"and");
3229 $search->setSearchFor(array(0 =>
'usr'));
3230 $search->setSearchType(
'new');
3232 if($search->validate($message))
3234 $search->performSearch();
3239 $this->ctrl->redirect($this,
"searchUser");
3241 return $search->getResultByType(
'usr');
3246 include_once(
"./classes/class.ilSearch.php");
3248 $this->lng->loadLanguageModule(
"content");
3250 $search =&
new ilSearch($this->user_obj->getId());
3253 $search->setCombination(
"and");
3254 $search->setSearchFor(array(0 =>
'usr'));
3255 $search->setSearchType(
'new');
3257 if($search->validate($message))
3259 $search->performSearchSPObject();
3264 $this->ctrl->redirect($this,
"searchUserSP");
3266 return $search->getResultByType(
'usr');
3271 $tpl =& $tbl->getTemplateObject();
3275 $tpl->setCurrentBlock(
"tbl_form_header");
3276 $this->ctrl->setParameter($this,
"sell_id",
$_GET[
"sell_id"]);
3277 $tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
3278 $tpl->parseCurrentBlock();
3280 $tpl->setCurrentBlock(
"tbl_action_btn");
3281 $tpl->setVariable(
"BTN_NAME",
"addCustomer");
3282 $tpl->setVariable(
"BTN_VALUE",$this->lng->txt(
"add"));
3283 $tpl->parseCurrentBlock();
3285 $tpl->setCurrentBlock(
"tbl_action_btn");
3286 $tpl->setVariable(
"BTN_NAME",
"statistic");
3287 $tpl->setVariable(
"BTN_VALUE",$this->lng->txt(
"cancel"));
3288 $tpl->parseCurrentBlock();
3290 $tpl->setCurrentBlock(
"tbl_action_row");
3291 $tpl->setVariable(
"COLUMN_COUNTS",5);
3293 $tpl->parseCurrentBlock();
3295 $tbl->setTitle($this->lng->txt(
"users"),
"icon_usr.gif",$this->lng->txt(
"crs_header_edit_members"));
3296 $tbl->setHeaderNames(array(
"",
3297 $this->lng->txt(
"login"),
3298 $this->lng->txt(
"firstname"),
3299 $this->lng->txt(
"lastname")));
3300 $this->ctrl->setParameter($this,
"cmd",
"addCustomer");
3301 $header_params = $this->ctrl->getParameterArray($this,
'');
3302 $tbl->setHeaderVars(array(
"",
3305 "lastname"), $header_params);
3312 $tbl->setColumnWidth(array(
"3%",
"32%",
"32%",
"32%"));
3317 $this->tpl->setVariable(
"SEARCH_RESULT_TABLE",$tbl->tpl->get());
3324 include_once
"./Services/Table/classes/class.ilTableGUI.php";
3330 $offset =
$_GET[
"offset"];
3331 $order =
$_GET[
"sort_by"];
3332 $direction =
$_GET[
"sort_order"];
3334 $tbl->setOrderColumn($order,$a_default_order_column);
3335 $tbl->setOrderDirection($direction);
3336 $tbl->setOffset($offset);
3337 $tbl->setLimit(
$_GET[
"limit"]);
3338 $tbl->setMaxCount(count($result_set));
3339 $tbl->setFooter(
"tblfooter",$this->lng->txt(
"previous"),$this->lng->txt(
"next"));
3340 $tbl->setData($result_set);