19 require_once
'./classes/class.ilObjectGUI.php';
20 include_once
'Services/Payment/classes/class.ilShopVatsList.php';
21 include_once
'./payment/classes/class.ilPaymentPrices.php';
40 $this->user_obj =& $ilias->account;
42 include_once
'./payment/classes/class.ilPaymentObject.php';
48 $this->
ilObjectGUI($a_data,$a_id,$a_call_by_reference,$a_prepare_output);
50 $this->SECTION_GENERAL = 1;
51 $this->SECTION_PAYPAL = 2;
52 $this->SECTION_EPAY = 12;
57 $this->PAY_METHODS = 6;
59 $this->SECTION_BMF = 8;
62 $this->SECTION_VATS = 11;
63 $this->SECTION_ERP = 13;
65 $this->lng->loadLanguageModule(
'payment');
70 $next_class = $this->ctrl->getNextClass($this);
71 $cmd = $this->ctrl->getCmd();
76 case 'ilpermissiongui':
77 include_once(
'Services/AccessControl/classes/class.ilPermissionGUI.php');
79 $ret =& $this->ctrl->forwardCommand($perm_gui);
82 case 'ilpageobjectgui':
87 $this->tpl->setContent(
$ret);
91 case 'ilshoptopicsgui':
92 include_once
'Services/Payment/classes/class.ilShopTopicsGUI.php';
94 $ret = $this->ctrl->forwardCommand($topics_gui);
100 $cmd =
'generalSettings';
108 case 'performSearch' :
110 case 'exportVendors' :
111 case 'performDeleteVendors' :
112 case 'cancelDeleteVendors' :
113 case 'performEditVendor' : $this->
__setSection($this->OTHERS);
115 $this->tabs_gui->setTabActive(
'vendors');
118 case 'editStatistic' :
119 case 'updateStatistic' :
120 case 'deleteStatistic' :
121 case 'performDelete' :
123 case 'exportVendors' :
125 case 'saveCustomer' :
126 case 'showObjectSelector' :
127 case 'searchUserSP' :
128 case 'performSearchSP' : $this->
__setSection($this->OTHERS);
131 $this->tabs_gui->setTabActive(
'bookings');
133 case 'updateObjectDetails' :
134 case 'deleteObject' :
135 case 'performObjectDelete' :
140 case 'resetObjectFilter' :
141 include_once
'./payment/classes/class.ilPaymentObject.php';
142 include_once
'./payment/classes/class.ilPaymentBookings.php';
145 $this->tabs_gui->setTabActive(
'objects');
147 case 'saveGeneralSettings' :
148 case 'generalSettings' : $this->
__setSection($this->SECTION_GENERAL);
150 $this->tabs_gui->setTabActive(
'settings');
152 case 'saveBmfSettings' :
153 case 'bmfSettings' : $this->
__setSection($this->SECTION_BMF);
155 $this->tabs_gui->setTabActive(
'settings');
157 case 'savePaypalSettings' :
158 case 'paypalSettings' : $this->
__setSection($this->SECTION_PAYPAL);
160 $this->tabs_gui->setTabActive(
'settings');
162 case 'saveEPaySettings' :
163 case 'epaySettings' : $this->
__setSection($this->SECTION_EPAY);
165 $this->tabs_gui->setTabActive(
'settings');
167 case 'savePayMethods' : $this->
__setSection($this->OTHERS);
169 $this->tabs_gui->setTabActive(
'pay_methods');
171 case 'gateway' :
if (
$_POST[
'action'] ==
'editVendorObject' ||
172 $_POST[
'action'] ==
'deleteVendorsObject')
176 $this->tabs_gui->setTabActive(
'vendors');
186 case 'performDeleteVat':
187 case 'confirmDeleteVat':
194 $this->tabs_gui->setTabActive(
'vats');
196 case 'saveERPsettings' :
197 case 'delERPpreview':
198 case 'testERPsettings' :
199 case 'erpSettings' : $this->
__setSection($this->SECTION_ERP);
201 $this->tabs_gui->setTabActive(
'settings');
223 if(!(
int)
$_GET[
'pobject_id'])
226 return $this->showObjects();
228 $this->ctrl->setParameter($this,
'pobject_id', (
int)$_GET[
'pobject_id']);
231 $this->lng->loadLanguageModule(
'content');
233 $ilTabs->clearTargets();
234 $ilTabs->clearSubTabs();
235 $ilTabs->setBackTarget($this->lng->txt(
'back'), $this->ctrl->getLinkTarget($this,
'editObject'));
238 include_once
'Services/COPage/classes/class.ilPageObject.php';
239 include_once
'Services/COPage/classes/class.ilPageObjectGUI.php';
240 include_once(
'./Services/Style/classes/class.ilObjStyleSheet.php');
248 $new_page_object->setParentId(0);
249 $new_page_object->setId($this->pobject->getPobjectId());
250 $new_page_object->createFromXML();
253 $this->ctrl->setReturnByClass(
'ilpageobjectgui',
'edit');
255 $page_gui =
new ilPageObjectGUI(
'shop', $this->pobject->getPobjectId());
256 $this->ctrl->setParameter($page_gui,
'pobject_id', (
int)$_GET[
'pobject_id']);
258 $page_gui->setTemplateTargetVar(
'ADM_CONTENT');
259 $page_gui->setLinkXML(
'');
260 $page_gui->setFileDownloadLink($this->ctrl->getLinkTargetByClass(array(
'ilpageobjectgui'),
'downloadFile'));
261 $page_gui->setFullscreenLink($this->ctrl->getLinkTargetByClass(array(
'ilpageobjectgui'),
'displayMediaFullscreen'));
262 $page_gui->setSourcecodeDownloadScript($this->ctrl->getLinkTargetByClass(array(
'ilpageobjectgui'),
'download_paragraph'));
263 $page_gui->setPresentationTitle(
'');
264 $page_gui->setTemplateOutput(
false);
265 $page_gui->setHeader(
'');
266 $page_gui->setEnabledRepositoryObjects(
false);
267 $page_gui->setEnabledFileLists(
true);
268 $page_gui->setEnabledMaps(
true);
269 $page_gui->setEnabledPCTabs(
true);
271 return $this->ctrl->forwardCommand($page_gui);
279 if(!$rbacsystem->checkAccess(
'read', $this->object->getRefId()))
281 $this->ilias->raiseError($this->lng->txt(
'msg_no_perm_read'),$this->ilias->error_obj->MESSAGE);
284 include_once
'./payment/classes/class.ilBMFSettings.php';
301 if (
$_POST[
'mandantNr'] ==
'' ||
302 $_POST[
'bewirtschafterNr'] ==
'' ||
303 $_POST[
'haushaltsstelle'] ==
'' ||
304 $_POST[
'objektNr'] ==
'' ||
305 $_POST[
'kennzeichenMahnverfahren'] ==
'' ||
306 $_POST[
'waehrungskennzeichen'] ==
'' ||
307 $_POST[
'ePaymentServer'] ==
'' ||
308 $_POST[
'clientCertificate'] ==
'' ||
309 $_POST[
'caCertificate'] ==
'' ||
312 $this->error = $this->lng->txt(
'pays_bmf_settings_not_valid');
332 if(!$rbacsystem->checkAccess(
'read', $this->object->getRefId()))
334 $this->ilias->raiseError($this->lng->txt(
'msg_no_perm_read'),$this->ilias->error_obj->MESSAGE);
336 include_once
'./payment/classes/class.ilBMFSettings.php';
337 include_once(
'./Services/Form/classes/class.ilPropertyFormGUI.php');
339 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.pays_bmf_settings.html',
'payment');
344 $form->setFormAction($this->ctrl->getFormAction($this,
'saveBmfSettings'));
345 $form->setTitle($this->lng->txt(
'pays_bmf_settings'));
347 $form->addCommandButton(
'saveBmfSettings',$this->lng->txt(
'save'));
349 $formItem =
new ilTextInputGUI($this->lng->txt(
'pays_bmf_client_id'),
'mandantNr');
350 $formItem->
setValue($bmfSetObj->getClientId());
351 $form->addItem($formItem);
353 $formItem =
new ilTextInputGUI($this->lng->txt(
'pays_bmf_bewirtschafter_nr'),
'bewirtschafterNr');
354 $formItem->
setValue($bmfSetObj->getBewirtschafterNr());
355 $form->addItem($formItem);
357 $formItem =
new ilTextInputGUI($this->lng->txt(
'pays_bmf_haushaltsstelle'),
'haushaltsstelle');
358 $formItem->
setValue($bmfSetObj->getHaushaltsstelle());
359 $form->addItem($formItem);
361 $formItem =
new ilTextInputGUI($this->lng->txt(
'pays_bmf_object_id'),
'objektNr');
362 $formItem->
setValue($bmfSetObj->getObjectId());
363 $form->addItem($formItem);
365 $formItem =
new ilTextInputGUI($this->lng->txt(
'pays_bmf_kennzeichen_mahnverfahren'),
'kennzeichenMahnverfahren');
366 $formItem->
setValue($bmfSetObj->getKennzeichenMahnverfahren());
367 $form->addItem($formItem);
369 $formItem =
new ilTextInputGUI($this->lng->txt(
'pays_bmf_waehrungskennzeichen'),
'waehrungskennzeichen');
370 $formItem->
setValue($bmfSetObj->getWaehrungsKennzeichen());
371 $form->addItem($formItem);
373 $formItem =
new ilTextInputGUI($this->lng->txt(
'pays_bmf_epayment_server'),
'ePaymentServer');
374 $formItem->
setValue($bmfSetObj->getEpaymentServer());
375 $form->addItem($formItem);
377 $formItem =
new ilTextInputGUI($this->lng->txt(
'pays_bmf_client_certificate'),
'clientCertificate');
378 $formItem->
setValue($bmfSetObj->getClientCertificate());
379 $form->addItem($formItem);
381 $formItem =
new ilTextInputGUI($this->lng->txt(
'pays_bmf_ca_certificate'),
'caCertificate');
382 $formItem->
setValue($bmfSetObj->getCaCertificate());
383 $form->addItem($formItem);
385 $formItem =
new ilTextInputGUI($this->lng->txt(
'pays_bmf_timeout'),
'timeOut');
386 $formItem->
setValue($bmfSetObj->getTimeOut());
387 $form->addItem($formItem);
389 $this->tpl->setVariable(
'BMF_SETTINGS',$form->getHTML());
394 if(!
$_GET[
'pobject_id'])
398 $this->objectObjects();
403 $this->ctrl->setParameter($this,
'pobject_id',(
int) $_GET[
'pobject_id']);
406 $old_pay_method = $this->pobject->getPayMethod();
407 $old_status = $this->pobject->getStatus();
408 $old_vat_id = $this->pobject->getVatId();
411 if($old_status == $this->pobject->STATUS_NOT_BUYABLE and
412 (
int)
$_POST[
'status'] != $old_status)
415 switch((
int)
$_POST[
'pay_method'])
417 case $this->pobject->PAY_METHOD_NOT_SPECIFIED:
423 case $this->pobject->PAY_METHOD_BILL:
424 include_once
'./payment/classes/class.ilPaymentBillVendor.php';
427 if(!$bill_vendor->validate())
440 include_once
'./payment/classes/class.ilPaymentPrices.php';
443 if(!count($prices_obj->getPrices()))
453 $this->pobject->setStatus((
int)
$_POST[
'status']);
454 $this->pobject->setVendorId((
int) $_POST[
'vendor']);
455 $this->pobject->setPayMethod((
int) $_POST[
'pay_method']);
456 $this->pobject->setTopicId((
int) $_POST[
'topic_id']);
457 $this->pobject->setVatId((
int) $_POST[
'vat_id']);
459 $this->pobject->update();
469 if($a_show_delete ==
false) unset(
$_SESSION[
'price_ids']);
471 include_once
'./payment/classes/class.ilPaymentPrices.php';
472 include_once
'./payment/classes/class.ilPaymentCurrency.php';
473 include_once
'./Services/Table/classes/class.ilTableGUI.php';
474 include_once
'./payment/classes/class.ilGeneralSettings.php';
480 if(!
$_GET[
'pobject_id'])
487 $this->ctrl->setParameter($this,
'pobject_id',(
int)
$_GET[
'pobject_id']);
491 $this->
__showButton(
'editObject',$this->lng->txt(
'paya_edit_details'));
492 $this->
__showButton(
'editPrices',$this->lng->txt(
'paya_edit_prices'));
496 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.paya_adm_edit_prices.html',
'payment');
499 $prices = $price_obj->getPrices();
506 $this->tpl->setCurrentBlock(
'price_info');
507 $this->tpl->setVariable(
'CONFIRM_FORMACTION',$this->ctrl->getFormAction($this));
508 $this->tpl->setVariable(
'CONFIRM_CMD',
'addPrice');
509 $this->tpl->setVariable(
'TXT_CONFIRM',$this->lng->txt(
'paya_add_price'));
510 $this->tpl->parseCurrentBlock();
519 $this->tpl->setCurrentBlock(
'cancel');
520 $this->tpl->setVariable(
'CANCEL_CMD',
'editPrices');
521 $this->tpl->setVariable(
'TXT_CANCEL',$this->lng->txt(
'cancel'));
522 $this->tpl->parseCurrentBlock();
524 $this->tpl->setCurrentBlock(
'price_info');
525 $this->tpl->setVariable(
'CONFIRM_FORMACTION',$this->ctrl->getFormAction($this));
526 $this->tpl->setVariable(
'CONFIRM_CMD',
'performDeletePrice');
527 $this->tpl->setVariable(
'TXT_CONFIRM',$this->lng->txt(
'paya_delete_price'));
528 $this->tpl->parseCurrentBlock();
536 $tpl->setCurrentBlock(
'tbl_form_header');
538 $tpl->setVariable(
'FORMACTION',$this->ctrl->getFormAction($this));
539 $tpl->parseCurrentBlock();
542 foreach($prices as $price)
545 if($a_show_delete ==
true )
547 $this->ctrl->setParameter($this,
'show_delete',
'true');
549 if(in_array($price[
'price_id'],
$_SESSION[
'price_ids']))
552 $data[$counter][
'price_id'] =
'';
553 $data[$counter][
'duration'] =$price[
'duration'] ;
554 $data[$counter][
'month'] = $this->lng->txt(
'paya_months');
556 $data[$counter][
'unlimited_duration'] = ilUtil::formCheckBox($price[
'unlimited_duration'] ? 1 : 0,
557 'duration_ids[]', (
int)$price[
'price_id']);
560 $data[$counter][
'currency_unit'] = $genSet->get(
'currency_unit');
565 $data[$counter][
'price_id'] = ilUtil::formCheckBox(in_array($price[
'price_id'],
$_SESSION[
'price_ids']) ? 1 : 0,
566 'price_ids[]', $price[
'price_id']);
568 $data[$counter][
'duration'] =
ilUtil::formInput(
'prices['.$price[
'price_id'].
'][duration]',$price[
'duration']);
569 $data[$counter][
'month'] = $this->lng->txt(
'paya_months');
571 $data[$counter][
'unlimited_duration'] = ilUtil::formCheckBox($price[
'unlimited_duration'] ? 1 : 0,
572 'duration_ids[]', (
int)$price[
'price_id']);
575 $data[$counter][
'currency_unit'] = $genSet->get(
'currency_unit');
588 $parmeter = $this->ctrl->getParameterArray($this,
'show_delete');
590 if(!$parmeter[
'show_delete'])
593 $tpl->setCurrentBlock(
"tbl_action_btn");
594 $tpl->setVariable(
"BTN_NAME",
"deletePrice");
595 $tpl->setVariable(
"BTN_VALUE",$this->lng->txt(
"paya_delete_price"));
596 $tpl->parseCurrentBlock();
598 $tpl->setCurrentBlock(
"plain_buttons");
599 $tpl->setVariable(
"PBTN_NAME",
"addPrice");
600 $tpl->setVariable(
"PBTN_VALUE",$this->lng->txt(
"paya_add_price"));
601 $tpl->parseCurrentBlock();
603 $tpl->setCurrentBlock(
"plain_buttons");
604 $tpl->setVariable(
"PBTN_NAME",
"updatePrice");
605 $tpl->setVariable(
"PBTN_VALUE",$this->lng->txt(
"paya_update_price"));
606 $tpl->parseCurrentBlock();
608 $tpl->setCurrentBlock(
"tbl_action_row");
609 $tpl->setVariable(
"TPLPATH",$this->tpl->tplPath);
610 $tpl->setVariable(
"COLUMN_COUNTS",6);
612 $tpl->parseCurrentBlock();
615 $tbl->setTemplate(
$tpl);
618 $tpl->setCurrentBlock(
"tbl_form_header");
619 $this->ctrl->setParameter($this,
'cmd',
'editprices');
621 $tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
622 $tpl->parseCurrentBlock();
625 if(is_object($tmp_obj))
627 $tbl->setTitle($tmp_obj->getTitle(),
628 'icon_'.$tmp_obj->getType().
'_b.gif',
629 $this->lng->txt(
'objs_'.$tmp_obj->getType()));
633 $tbl->setTitle($this->lng->txt(
'object_not_found'));
635 $tbl->setHeaderNames(array(
'',
636 $this->lng->txt(
"duration"),
638 $this->lng->txt(
"unlimited_duration"),
639 $this->lng->txt(
"price_a"),
642 $header_params = $this->ctrl->getParameterArray($this,
'');
643 $tbl->setHeaderVars(array(
"price_id",
646 "unlimited_duration",
649 "options"),$header_params);
650 $tbl->setColumnWidth(array(
'5%',
"10%",
"10%",
"15%",
"15%",
"50%"));
652 $offset =
$_GET[
"offset"];
653 if(
$_GET[
"sort_by"] == NULL) $order =
'duration';
654 else $order =
$_GET[
"sort_by"];
655 $direction =
$_GET[
"sort_order"];
657 $tbl->setOrderColumn($order);
658 $tbl->setOrderDirection($direction);
659 $tbl->setOffset($offset);
660 $tbl->setLimit(
$_GET[
"limit"]);
661 $tbl->setMaxCount(count($a_result_set));
662 $tbl->setFooter(
"tblfooter",$this->lng->txt(
"previous"),$this->lng->txt(
"next"));
663 $tbl->setData($a_result_set);
667 $this->tpl->setVariable(
"PRICES_TABLE",$tbl->tpl->get());
675 if(!
$_GET[
'pobject_id'])
679 $this->showObjects();
683 include_once
'./payment/classes/class.ilGeneralSettings.php';
687 $this->ctrl->setParameter($this,
'pobject_id',(
int)
$_GET[
'pobject_id']);
691 $this->
__showButton(
'editObject',$this->lng->txt(
'paya_edit_details'));
692 $this->
__showButton(
'editPrices',$this->lng->txt(
'paya_edit_prices'));
694 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.paya_adm_add_price.html',
'payment');
696 $this->tpl->setVariable(
'ADD_FORMACTION',$this->ctrl->getFormAction($this));
699 if(is_object($tmp_obj))
701 $tmp_object[
'title'] = $tmp_obj->getTitle();
702 $tmp_object[
'type'] = $tmp_obj->getType();
704 $this->tpl->setVariable(
'ALT_IMG',$this->lng->txt(
'obj_'.$tmp_object[
'type']));
708 $tmp_object[
'title'] = $this->lng->txt(
'object_not_found');
709 $tmp_object[
'type'] =
'';
713 $this->tpl->setVariable(
'TITLE', $tmp_object[
'title']);
714 $this->tpl->setVariable(
'DESCRIPTION',$this->lng->txt(
'paya_add_price_title'));
717 # $this->tpl->setVariable('TXT_PRICE_A',$this->lng->txt('currency_euro'));
718 # $this->tpl->setVariable('TXT_PRICE_B',$this->lng->txt('currency_cent'));
719 $this->tpl->setVariable(
'TXT_PRICE_A',$genSet->get(
'currency_unit'));
721 $this->tpl->setVariable(
'MONTH',$this->lng->txt(
'paya_months'));
722 $this->tpl->setVariable(
'TXT_DURATION',$this->lng->txt(
'duration'));
723 $this->tpl->setVariable(
'TXT_UNLIMITED_DURATION',$this->lng->txt(
'unlimited_duration'));
724 $this->tpl->setVariable(
'TXT_PRICE',$this->lng->txt(
'price_a'));
725 $this->tpl->setVariable(
'CANCEL',$this->lng->txt(
'cancel'));
726 $this->tpl->setVariable(
'ADD',$this->lng->txt(
'paya_add_price'));
728 $this->tpl->setVariable(
'DURATION',
$_POST[
'duration']);
729 $this->tpl->setVariable(
'UNLIMITED_DURATION',
$_POST[
'unlimited_duration']);
731 $this->tpl->setVariable(
'PRICE',
$_POST[
'price']);
738 if(!
$_GET[
'pobject_id'])
746 include_once
'./payment/classes/class.ilPaymentPrices.php';
747 include_once
'./payment/classes/class.ilPaymentCurrency.php';
753 $prices->setUnlimitedDuration((
int)
$_POST[
'unlimited_duration']);
755 if($_POST[
'unlimited_duration'] ==
'1')
757 $prices->setUnlimitedDuration(1);
760 $prices->setDuration($_POST[
'duration']);
761 $prices->setPrice($_POST[
'price']);
762 $prices->setCurrency($currency[1][
'currency_id']);
764 if(!$prices->validate())
781 if(!
$_GET[
'pobject_id'])
796 include_once
'./payment/classes/class.ilPaymentPrices.php';
800 foreach(
$_SESSION[
'price_ids'] as $price_id)
802 if($prices->delete($price_id))
808 if(!count($prices->getPrices()))
812 $this->pobject->setStatus($this->pobject->STATUS_NOT_BUYABLE);
813 $this->pobject->update();
825 if(!
$_GET[
'pobject_id'])
833 if(!count(
$_POST[
'price_ids']))
848 include_once
'./payment/classes/class.ilPaymentPrices.php';
850 if(!
$_GET[
'pobject_id'])
859 $this->ctrl->setParameter($this,
'pobject_id',(
int) $_GET[
'pobject_id']);
862 foreach(
$_POST[
'prices'] as $price_id => $price)
865 $old_price = $po->getPrice($price_id);
867 $po->setDuration($price[
'duration']);
869 $po->setPrice($price[
'price']);
871 $po->setCurrency($old_price[
'currency']);
887 foreach(
$_POST[
'prices'] as $price_id => $price)
889 $old_price = $po->getPrice($price_id);
891 if(isset(
$_POST[
'duration_ids']))
894 $search = in_array((
string)$price_id,
$_POST[
'duration_ids']);
897 if(
$_POST[
'duration_ids'] == NULL)
899 $po->setUnlimitedDuration(0);
900 $po->setDuration($price[
'duration']);
904 else if( $search = in_array((
string)$price_id,
$_POST[
'duration_ids']))
906 $po->setUnlimitedDuration(1);
911 $po->setUnlimitedDuration(0);
915 $po->setDuration($price[
'duration']);
916 $po->setPrice($price[
'price']);
917 $po->setCurrency($old_price[
'currency']);
919 $po->update($price_id);
930 if(!isset(
$_GET[
'pobject_id']))
938 $this->ctrl->setParameter($this,
'pobject_id',(
int)
$_GET[
'pobject_id']);
941 $this->
__showButton(
'editObject',$this->lng->txt(
'paya_edit_details'));
942 $this->
__showButton(
'editPrices',$this->lng->txt(
'paya_edit_prices'));
943 $this->tpl->setCurrentBlock(
'btn_cell');
944 $this->tpl->setVariable(
'BTN_LINK', $this->ctrl->getLinkTargetByClass(array(
'ilpageobjectgui'),
'edit'));
945 $this->tpl->setVariable(
'BTN_TXT', $this->lng->txt(
'pay_edit_abstract'));
946 $this->tpl->parseCurrentBlock();
948 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.paya_adm_edit_objects.html',
'payment');
954 $this->tpl->setCurrentBlock(
'confirm_delete');
955 $this->tpl->setVariable(
'CONFIRM_FORMACTION',$this->ctrl->getFormAction($this));
956 $this->tpl->setVariable(
'TXT_CANCEL',$this->lng->txt(
'cancel'));
957 $this->tpl->setVariable(
'CONFIRM_CMD',
'performObjectDelete');
958 $this->tpl->setVariable(
'TXT_CONFIRM',$this->lng->txt(
'confirm'));
959 $this->tpl->parseCurrentBlock();
962 $this->tpl->setVariable(
"DETAILS_FORMACTION",$this->ctrl->getFormAction($this));
967 if(is_object($tmp_obj))
969 $tmp_object[
'type'] = $tmp_obj->getType();
970 $tmp_object[
'title'] = $tmp_obj->getTitle();
971 $tmp_object[
'description'] = $tmp_obj->getDescription();
973 $this->tpl->setVariable(
'ALT_IMG',$this->lng->txt(
'obj_'.$tmp_object[
'type']));
977 $tmp_object[
'type'] =
'';
978 $tmp_object[
'title'] = $this->lng->txt(
'object_not_found');
979 $tmp_object[
'description'] = $this->lng->txt(
'object_not_found');
983 $this->tpl->setVariable(
'TITLE',$tmp_object[
'title']);
984 $this->tpl->setVariable(
'DESCRIPTION',$tmp_object[
'description']);
985 $this->tpl->setVariable(
'TXT_PATH',$this->lng->txt(
'path'));
986 $this->tpl->setVariable(
'PATH',$this->
__getHTMLPath($this->pobject->getRefId()));
987 $this->tpl->setVariable(
'TXT_VENDOR',$this->lng->txt(
'paya_vendor'));
989 $this->tpl->setVariable(
'TXT_COUNT_PURCHASER',$this->lng->txt(
'paya_count_purchaser'));
991 $this->tpl->setVariable(
'TXT_STATUS',$this->lng->txt(
'status'));
993 $this->tpl->setVariable(
'TXT_PAY_METHOD',$this->lng->txt(
'paya_pay_method'));
997 include_once
'Services/Payment/classes/class.ilShopTopics.php';
1001 $selectable_topics = array();
1002 $selectable_topics[
''] = $this->lng->txt(
'please_choose');
1003 foreach ($topics as $topic)
1005 $selectable_topics[$topic->getId()] = $topic->getTitle();
1008 $this->tpl->setVariable(
'TXT_TOPIC', $this->lng->txt(
'topic'));
1009 $this->tpl->setVariable(
'TOPICS',
ilUtil::formSelect(array($this->pobject->getTopicId()),
'topic_id', $selectable_topics,
false,
true));
1014 $oShopVatsList->read();
1016 $selectable_vats = array();
1017 $selectable_vats[-1] =
'----';
1018 if($oShopVatsList->hasItems())
1020 foreach($oShopVatsList as $oVAT)
1028 $oVAT =
new ilShopVats((
int)$this->pobject->getVatId());
1029 $this->tpl->setVariable(
'VAT',
ilUtil::formSelect($oVAT->getId(),
'vat_id', $selectable_vats,
false,
true));
1033 $this->tpl->setVariable(
'VAT',
ilUtil::formSelect(-1,
'vat_id', $selectable_vats,
false,
true));
1035 $this->tpl->setVariable(
'TXT_VAT', $this->lng->txt(
'vats'));
1037 $this->tpl->setVariable(
'INPUT_CMD',
'updateObjectDetails');
1038 $this->tpl->setVariable(
'INPUT_VALUE',$this->lng->txt(
'save'));
1040 $this->tpl->setVariable(
'DELETE_CMD',
'deleteObject');
1041 $this->tpl->setVariable(
'DELETE_VALUE',$this->lng->txt(
'delete'));
1047 include_once
'./payment/classes/class.ilPaymentBookings.php';
1049 if(!
$_GET[
'pobject_id'])
1074 include_once
'./payment/classes/class.ilPaymentPrices.php';
1075 include_once
'./payment/classes/class.ilPaymentBillVendor.php';
1077 if(!
$_GET[
'pobject_id'])
1087 $this->pobject->delete();
1091 $price_obj->deleteAllPrices();
1110 $path = $tree->getPathFull($a_ref_id);
1115 foreach($path as
$data)
1117 $html .= $data[
'title'].
' > ';
1119 return substr($html,0,-2);
1124 return $lng->txt(
'object_not_found');
1130 include_once
'./payment/classes/class.ilPaymentVendors.php';
1135 $all_vendors = $vendor_obj->getVendors();
1136 if (is_array($all_vendors))
1138 foreach ($all_vendors as
$vendor)
1140 $vendors[] = $vendor[
'vendor_id'];
1148 $action[
$vendor] = $tmp_obj->getFullname().
' ['.$tmp_obj->getLogin().
']';
1157 $action[$this->pobject->STATUS_NOT_BUYABLE] = $this->lng->txt(
'paya_not_buyable');
1158 $action[$this->pobject->STATUS_BUYABLE] = $this->lng->txt(
'paya_buyable');
1159 $action[$this->pobject->STATUS_EXPIRES] = $this->lng->txt(
'paya_expires');
1166 include_once
'./payment/classes/class.ilPayMethods.php';
1170 $action[$this->pobject->PAY_METHOD_NOT_SPECIFIED] = $this->lng->txt(
'paya_pay_method_not_specified');
1173 $action[$this->pobject->PAY_METHOD_BILL] = $this->lng->txt(
'pays_bill');
1177 $action[$this->pobject->PAY_METHOD_BMF] = $this->lng->txt(
'pays_bmf');
1181 $action[$this->pobject->PAY_METHOD_PAYPAL] = $this->lng->txt(
'pays_paypal');
1185 $action[$this->pobject->PAY_METHOD_EPAY] = $this->lng->txt(
'pays_epay');
1188 return ilUtil::formSelect($this->pobject->getPayMethod(),
'pay_method',$action,
false,
true);
1194 unset(
$_POST[
'title_type']);
1195 unset(
$_POST[
'title_value']);
1197 unset(
$_POST[
'pay_method']);
1209 if(!$rbacsystem->checkAccess(
'read', $this->object->getRefId()))
1211 $this->ilias->raiseError($this->lng->txt(
'msg_no_perm_read'),$this->ilias->error_obj->MESSAGE);
1214 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.paya_adm_objects.html',
'payment');
1216 if (
$_POST[
'updateView'] == 1)
1225 $this->lng->loadLanguageModule(
'search');
1226 $this->tpl->setVariable(
'TXT_FILTER',$this->lng->txt(
'pay_filter'));
1227 $this->tpl->setVariable(
'FORM_ACTION',$this->ctrl->getFormAction($this));
1228 $this->tpl->setVariable(
'TXT_TITLE',$this->lng->txt(
'title'));
1229 $this->tpl->setVariable(
'TXT_AND',$this->lng->txt(
'search_all_words'));
1230 $this->tpl->setVariable(
'TXT_OR',$this->lng->txt(
'search_any_word'));
1231 $this->tpl->setVariable(
'TXT_BILL',$this->lng->txt(
'pays_bill'));
1232 $this->tpl->setVariable(
'TXT_BMF',$this->lng->txt(
'pays_bmf'));
1233 $this->tpl->setVariable(
'TXT_PAYPAL',$this->lng->txt(
'pays_paypal'));
1234 $this->tpl->setVariable(
'TXT_VENDOR',$this->lng->txt(
'paya_vendor'));
1235 $this->tpl->setVariable(
'TXT_PAYMENT',$this->lng->txt(
'payment_system'));
1236 $this->tpl->setVariable(
'TXT_UPDATE_VIEW',$this->lng->txt(
'pay_update_view'));
1237 $this->tpl->setVariable(
'TXT_RESET_FILTER',$this->lng->txt(
'pay_reset_filter'));
1239 $this->tpl->setVariable((
$_SESSION[
'pay_objects'][
'title_type'] !=
'' ? strtoupper(
$_SESSION[
'pay_objects'][
'title_type']) :
'OR') .
'_CHECKED',
' checked');
1241 $this->tpl->setVariable(
'PAYMENT_' .
$_SESSION[
'pay_objects'][
'pay_method'],
' selected');
1252 foreach($objects as
$data)
1257 $f_result[$counter][] = $tmp_obj->getTitle();
1261 $f_result[$counter][] = $this->lng->txt(
'object_not_found');
1264 switch($data[
'status'])
1266 case $this->pobject->STATUS_BUYABLE:
1267 $f_result[$counter][] = $this->lng->txt(
'paya_buyable');
1270 case $this->pobject->STATUS_NOT_BUYABLE:
1271 $f_result[$counter][] = $this->lng->txt(
'paya_not_buyable');
1274 case $this->pobject->STATUS_EXPIRES:
1275 $f_result[$counter][] = $this->lng->txt(
'paya_expires');
1278 switch($data[
'pay_method'])
1280 case $this->pobject->PAY_METHOD_NOT_SPECIFIED:
1281 $f_result[$counter][] = $this->lng->txt(
'paya_pay_method_not_specified');
1284 case $this->pobject->PAY_METHOD_BILL:
1285 $f_result[$counter][] = $this->lng->txt(
'pays_bill');
1288 case $this->pobject->PAY_METHOD_BMF:
1289 $f_result[$counter][] = $this->lng->txt(
'pays_bmf');
1292 case $this->pobject->PAY_METHOD_PAYPAL:
1293 $f_result[$counter][] = $this->lng->txt(
'pays_paypal');
1297 if($data[
'vat_id'] <= 0)
1300 $vat_rate = $this->lng->txt(
'payment_vat_has_to_be_defined_by_administration_short');
1306 $oVAT =
new ilShopVats((
int)$data[
'vat_id']);
1311 $vat_rate = $this->lng->txt(
'payment_vat_has_to_be_defined_by_administration_short');
1315 $f_result[$counter][] = $vat_rate;
1319 if($data[
'vendor_id'] == 0)
1321 $f_result[$counter][] = $this->lng->txt(
'no_vendor_selected');
1326 if(is_object($tmp_user))
1328 $f_result[$counter][] = $tmp_user->getFullname().
' ['.$tmp_user->getLogin().
']';
1332 $f_result[$counter][] = $this->lng->txt(
'no_vendor_selected');
1342 $this->ctrl->setParameter($this,
'pobject_id',$data[
'pobject_id']);
1343 $link_change =
"<div class=\"il_ContainerItemCommands\"><a class=\"il_ContainerItemCommand\" href=\"".$this->ctrl->getLinkTarget($this,
"editObject").
"\">".$this->lng->txt(
"edit").
"</a></div>";
1345 $f_result[$counter][] = $link_change;
1360 $tpl =& $tbl->getTemplateObject();
1363 $tpl->setCurrentBlock(
'tbl_form_header');
1365 $this->ctrl->setParameter($this,
'cmd',
'objects');
1367 $tpl->setVariable(
'FORMACTION', $this->ctrl->getFormAction($this));
1368 $tpl->parseCurrentBlock();
1372 $tbl->setTitle($this->lng->txt(
'objects'),
'icon_pays.gif',$this->lng->txt(
'objects'));
1373 $tbl->setHeaderNames(array($this->lng->txt(
'title'),
1374 $this->lng->txt(
'status'),
1375 $this->lng->txt(
'paya_pay_method'),
1376 $this->lng->txt(
"vat_rate"),
1377 $this->lng->txt(
'paya_vendor'),
1378 $this->lng->txt(
'paya_count_purchaser'),
1380 $header_params = $this->ctrl->getParameterArray($this,
'');
1383 $tbl->setHeaderVars(array(
'title',
1389 'options'),$header_params);
1395 $tbl->setColumnWidth(array(
"15%",
"15%",
"15%",
"20%",
"20%"));
1397 # $this->setTableGUIBasicData($tbl,$a_result_set);
1399 $offset =
$_GET[
'offset'];
1400 $order =
$_GET[
'sort_by'];
1401 $direction =
$_GET[
'sort_order'] ?
$_GET[
'sort_order'] :
'desc';
1403 $tbl->setOrderColumn($order,
'order_date');
1404 $tbl->setOrderDirection($direction);
1405 $tbl->setOffset($offset);
1406 $tbl->setLimit(
$_GET[
'limit']);
1407 $tbl->setMaxCount(count($a_result_set));
1408 $tbl->setFooter(
'tblfooter',$this->lng->txt(
'previous'),$this->lng->txt(
'next'));
1409 $tbl->setData($a_result_set);
1413 $this->tpl->setVariable(
'OBJECTS_TABLE',$tbl->tpl->get());
1421 include_once
'./payment/classes/class.ilPaymentObject.php';
1432 case 'deleteVendorsObject':
1436 case 'editVendorObject':
1440 case 'performEditVendorObject':
1454 unset(
$_POST[
'transaction_type']);
1455 unset(
$_POST[
'transaction_value']);
1456 unset(
$_POST[
'from'][
'day']);
1457 unset(
$_POST[
'from'][
'month']);
1458 unset(
$_POST[
'from'][
'year']);
1459 unset(
$_POST[
'til'][
'day']);
1460 unset(
$_POST[
'til'][
'month']);
1461 unset(
$_POST[
'til'][
'year']);
1464 unset(
$_POST[
'customer']);
1465 unset(
$_POST[
'pay_method']);
1466 unset(
$_POST[
'updateView']);
1477 if(!$rbacsystem->checkAccess(
'read', $this->object->getRefId()))
1479 $this->ilias->raiseError($this->lng->txt(
'msg_no_perm_read'),$this->ilias->error_obj->MESSAGE);
1482 $this->
__showButton(
'showObjectSelector',$this->lng->txt(
'paya_add_customer'));
1484 if (
$_POST[
'updateView'] == 1)
1486 $_SESSION[
'pay_statistics'][
'updateView'] =
true;
1487 $_SESSION[
'pay_statistics'][
'transaction_type'] =
$_POST[
'transaction_type'];
1488 $_SESSION[
'pay_statistics'][
'transaction_value'] =
$_POST[
'transaction_value'];
1490 $_SESSION[
'pay_statistics'][
'from'][
'month'] =
$_POST[
'from'][
'month'];
1502 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.paya_adm_statistic.html',
'payment');
1504 $this->tpl->setVariable(
'TXT_FILTER',$this->lng->txt(
'pay_filter'));
1505 $this->tpl->setVariable(
'FORM_ACTION',$this->ctrl->getFormAction($this));
1506 $this->tpl->setVariable(
'TXT_TRANSACTION',$this->lng->txt(
'paya_transaction'));
1507 $this->tpl->setVariable(
'TXT_STARTING',$this->lng->txt(
'pay_starting'));
1508 $this->tpl->setVariable(
'TXT_ENDING',$this->lng->txt(
'pay_ending'));
1509 $this->tpl->setVariable(
'TXT_PAYED',$this->lng->txt(
'paya_payed'));
1510 $this->tpl->setVariable(
'TXT_ALL',$this->lng->txt(
'pay_all'));
1511 $this->tpl->setVariable(
'TXT_YES',$this->lng->txt(
'yes'));
1512 $this->tpl->setVariable(
'TXT_NO',$this->lng->txt(
'no'));
1513 $this->tpl->setVariable(
'TXT_BILL',$this->lng->txt(
'pays_bill'));
1514 $this->tpl->setVariable(
'TXT_BMF',$this->lng->txt(
'pays_bmf'));
1515 $this->tpl->setVariable(
'TXT_PAYPAL',$this->lng->txt(
'pays_paypal'));
1516 $this->tpl->setVariable(
'TXT_EPAY',$this->lng->txt(
'pays_epay'));
1517 $this->tpl->setVariable(
'TXT_PAYMENT',$this->lng->txt(
'payment_system'));
1518 $this->tpl->setVariable(
'TXT_CUSTOMER',$this->lng->txt(
'paya_customer'));
1519 $this->tpl->setVariable(
'TXT_VENDOR',$this->lng->txt(
'paya_vendor'));
1520 $this->tpl->setVariable(
'TXT_ACCESS',$this->lng->txt(
'paya_access'));
1521 $this->tpl->setVariable(
'TXT_ORDER_DATE_FROM',$this->lng->txt(
'pay_order_date_from'));
1522 $this->tpl->setVariable(
'TXT_ORDER_DATE_TIL',$this->lng->txt(
'pay_order_date_til'));
1523 $this->tpl->setVariable(
'TXT_UPDATE_VIEW',$this->lng->txt(
'pay_update_view'));
1524 $this->tpl->setVariable(
'TXT_RESET_FILTER',$this->lng->txt(
'pay_reset_filter'));
1526 $this->tpl->setVariable(
'TRANSACTION_TYPE_' .
$_SESSION[
'pay_statistics'][
'transaction_type'],
' selected');
1528 $this->tpl->setVariable(
'PAYED_' .
$_SESSION[
'pay_statistics'][
'payed'],
' selected');
1529 $this->tpl->setVariable(
'ACCESS_' .
$_SESSION[
'pay_statistics'][
'access'],
' selected');
1530 $this->tpl->setVariable(
'PAYMENT_' .
$_SESSION[
'pay_statistics'][
'pay_method'],
' selected');
1534 for ($i = 1; $i <= 31; $i++)
1536 $this->tpl->setCurrentBlock(
'loop_from_day');
1537 $this->tpl->setVariable(
'LOOP_FROM_DAY', $i < 10 ?
'0' . $i : $i);
1538 if (
$_SESSION[
'pay_statistics'][
'from'][
'day'] == $i)
1540 $this->tpl->setVariable(
'LOOP_FROM_DAY_SELECTED',
' selected');
1542 $this->tpl->parseCurrentBlock(
'loop_from_day');
1543 $this->tpl->setCurrentBlock(
'loop_til_day');
1544 $this->tpl->setVariable(
'LOOP_TIL_DAY', $i < 10 ?
'0' . $i : $i);
1545 if (
$_SESSION[
'pay_statistics'][
'til'][
'day'] == $i)
1547 $this->tpl->setVariable(
'LOOP_TIL_DAY_SELECTED',
' selected');
1549 $this->tpl->parseCurrentBlock(
'loop_til_day');
1551 for ($i = 1; $i <= 12; $i++)
1553 $this->tpl->setCurrentBlock(
'loop_from_month');
1554 $this->tpl->setVariable(
'LOOP_FROM_MONTH', $i < 10 ?
'0' . $i : $i);
1555 if (
$_SESSION[
'pay_statistics'][
'from'][
'month'] == $i)
1557 $this->tpl->setVariable(
'LOOP_FROM_MONTH_SELECTED',
' selected');
1559 $this->tpl->parseCurrentBlock(
'loop_from_month');
1560 $this->tpl->setCurrentBlock(
'loop_til_month');
1561 $this->tpl->setVariable(
'LOOP_TIL_MONTH', $i < 10 ?
'0' . $i : $i);
1562 if (
$_SESSION[
'pay_statistics'][
'til'][
'month'] == $i)
1564 $this->tpl->setVariable(
'LOOP_TIL_MONTH_SELECTED',
' selected');
1566 $this->tpl->parseCurrentBlock(
'loop_til_month');
1568 for ($i = 2004; $i <= date(
'Y'); $i++)
1570 $this->tpl->setCurrentBlock(
'loop_from_year');
1571 $this->tpl->setVariable(
'LOOP_FROM_YEAR', $i);
1572 if (
$_SESSION[
'pay_statistics'][
'from'][
'year'] == $i)
1574 $this->tpl->setVariable(
'LOOP_FROM_YEAR_SELECTED',
' selected');
1576 $this->tpl->parseCurrentBlock(
'loop_from_year');
1577 $this->tpl->setCurrentBlock(
'loop_til_year');
1578 $this->tpl->setVariable(
'LOOP_TIL_YEAR', $i);
1579 if (
$_SESSION[
'pay_statistics'][
'til'][
'year'] == $i)
1581 $this->tpl->setVariable(
'LOOP_TIL_YEAR_SELECTED',
' selected');
1583 $this->tpl->parseCurrentBlock(
'loop_til_year');
1586 if(!
$_SESSION[
'pay_statistics'][
'updateView'])
1588 $this->tpl->setVariable(
'FILTER_MESSAGE', $this->lng->txt(
'statistics_filter_advice'));
1594 if(!count($bookings = $this->booking_obj->getBookings()))
1602 # $this->__showButton('exportVendors',$this->lng->txt('excel_export'));
1604 $img_change =
"<img src=\"".ilUtil::getImagePath(
"edit.gif").
"\" alt=\"".
1605 $this->lng->txt(
"edit").
"\" title=\"".$this->lng->txt(
"edit").
1606 "\" border=\"0\" vspace=\"0\"/>";
1608 include_once
'Services/User/classes/class.ilObjUser.php';
1609 $object_title_cache = array();
1610 $user_title_cache = array();
1613 foreach($bookings as $booking)
1615 if(array_key_exists($booking[
'ref_id'], $object_title_cache))
1617 $tmp_obj = $object_title_cache[$booking[
'ref_id']];
1622 $object_title_cache[$booking[
'ref_id']] = $tmp_obj;
1624 if(array_key_exists($booking[
'b_vendor_id'], $user_title_cache))
1626 $tmp_vendor = $user_title_cache[$booking[
'b_vendor_id']];
1631 $user_title_cache[$booking[
'b_vendor_id']] = $tmp_vendor;
1633 if(array_key_exists($booking[
'customer_id'], $user_title_cache))
1635 $tmp_purchaser = $user_title_cache[$booking[
'customer_id']];
1642 $user_title_cache[$booking[
'customer_id']] = $tmp_purchaser;
1645 $transaction = $booking[
'transaction_extern'];
1646 switch ($booking[
'b_pay_method'])
1648 case $this->pobject->PAY_METHOD_BILL :
1649 $transaction .= $booking[
'transaction'].
"<br> (" . $this->lng->txt(
"pays_bill") .
")";
1651 case $this->pobject->PAY_METHOD_BMF :
1652 $transaction .= $booking[
'transaction'].
" (" . $this->lng->txt(
"pays_bmf") .
")";
1654 case $this->pobject->PAY_METHOD_PAYPAL :
1655 $transaction .= $booking[
'transaction'].
" (" . $this->lng->txt(
"pays_paypal") .
")";
1658 $f_result[$counter][] = $transaction;
1659 $f_result[$counter][] = ($tmp_obj !=
'' ? $tmp_obj : $this->lng->txt(
'object_deleted'));
1660 $f_result[$counter][] = ($tmp_vendor !=
'' ?
'['.$tmp_vendor.
']' : $this->lng->txt(
'user_deleted'));
1661 $f_result[$counter][] = ($tmp_purchaser !=
'' ?
1662 $tmp_purchaser_name[
'firstname'].
' '.$tmp_purchaser_name[
'lastname'].
' ['.$tmp_purchaser.
']<br>'
1663 .$tmp_purchaser_email
1664 : $this->lng->txt(
'user_deleted'));
1665 $f_result[$counter][] = date(
"Y-m-d H:i:s", $booking[
'order_date']);
1668 if($booking[
'duration'] != 0)
1670 $f_result[$counter][] = $booking[
'duration'].
' '.$this->lng->txt(
'paya_months');
1676 $f_result[$counter][] = $this->lng->txt(
"unlimited_duration");
1680 $f_result[$counter][] = $booking[
'price'];
1681 $f_result[$counter][] = ($booking[
'discount'] !=
'' ? $booking[
'discount'] :
' ');
1683 $payed_access = $booking[
'payed'] ?
1684 $this->lng->txt(
'yes') :
1685 $this->lng->txt(
'no');
1687 $payed_access .=
'/';
1688 $payed_access .= $booking[
'access'] ?
1689 $this->lng->txt(
'yes') :
1690 $this->lng->txt(
'no');
1692 $f_result[$counter][] = $payed_access;
1694 $this->ctrl->setParameter($this,
"booking_id",$booking[
'booking_id']);
1695 # $link_change = "<a href=\"".$this->ctrl->getLinkTarget($this,"editStatistic")."\"> ".
1696 # $img_change."</a>";
1697 $link_change =
"<div class=\"il_ContainerItemCommands\"><a class=\"il_ContainerItemCommand\" href=\"".$this->ctrl->getLinkTarget($this,
"editStatistic").
"\">".$this->lng->txt(
"edit").
"</a></div>";
1699 $f_result[$counter][] = $link_change;
1703 unset($tmp_purchaser);
1712 if(!isset(
$_GET[
'booking_id']))
1715 $this->showStatistics();
1721 $this->
__showButton(
'statistic',$this->lng->txt(
'back'));
1723 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.paya_adm_edit_statistic.html',
'payment');
1724 $this->ctrl->setParameter($this,
'booking_id',(
int)
$_GET[
'booking_id']);
1727 if($a_show_confirm_delete)
1729 $this->tpl->setCurrentBlock(
'confirm_delete');
1730 $this->tpl->setVariable(
'CONFIRM_FORMACTION',$this->ctrl->getFormAction($this));
1731 $this->tpl->setVariable(
'TXT_CANCEL',$this->lng->txt(
'cancel'));
1732 $this->tpl->setVariable(
'CONFIRM_CMD',
'performDelete');
1733 $this->tpl->setVariable(
'TXT_CONFIRM',$this->lng->txt(
'confirm'));
1734 $this->tpl->parseCurrentBlock();
1739 $bookings = $this->booking_obj->getBookings();
1740 $booking = $bookings[(int) $_GET[
'booking_id']];
1745 $this->tpl->setVariable(
'STAT_FORMACTION',$this->ctrl->getFormAction($this));
1747 $this->tpl->setVariable(
'ALT_IMG',$this->lng->txt(
'obj_usr'));
1748 if(is_object($tmp_user))
1750 $this->tpl->setVariable(
'TITLE', $tmp_user->getFullname().
' ['.$tmp_user->getLogin().
']');
1754 $this->tpl->setVariable(
'TITLE', $this->lng->txt(
'user_deleted'));
1761 $this->tpl->setVariable(
'TXT_OBJECT',$this->lng->txt(
'title'));
1762 $this->tpl->setVariable(
'OBJECT', ($tmp_obj !=
'' ? $tmp_obj : $this->lng->txt(
'object_deleted')));
1764 $this->tpl->setVariable(
'TXT_TRANSACTION',$this->lng->txt(
'paya_transaction'));
1765 $this->tpl->setVariable(
'TXT_VENDOR',$this->lng->txt(
'paya_vendor'));
1766 $this->tpl->setVariable(
'TXT_PAY_METHOD',$this->lng->txt(
'paya_pay_method'));
1767 $this->tpl->setVariable(
'TXT_ORDER_DATE',$this->lng->txt(
'paya_order_date'));
1768 $this->tpl->setVariable(
'TXT_DURATION',$this->lng->txt(
'duration'));
1769 $this->tpl->setVariable(
'TXT_PRICE',$this->lng->txt(
'price_a'));
1770 $this->tpl->setVariable(
'TXT_PAYED',$this->lng->txt(
'paya_payed'));
1771 $this->tpl->setVariable(
'TXT_ACCESS',$this->lng->txt(
'paya_access'));
1773 $this->tpl->setVariable(
"TRANSACTION",$booking[
'transaction']);
1776 if(is_object($tmp_vendor))
1778 $this->tpl->setVariable(
'VENDOR', $tmp_vendor->getFullname().
' ['.$tmp_vendor->getLogin().
']');
1782 $this->tpl->setVariable(
'VENDOR', $this->lng->txt(
'user_deleted'));
1785 switch($booking[
'b_pay_method'])
1787 case $this->pobject->PAY_METHOD_BILL:
1788 $this->tpl->setVariable(
'PAY_METHOD',$this->lng->txt(
'pays_bill'));
1791 case $this->pobject->PAY_METHOD_BMF:
1792 $this->tpl->setVariable(
'PAY_METHOD',$this->lng->txt(
'pays_bmf'));
1795 case $this->pobject->PAY_METHOD_PAYPAL:
1796 $this->tpl->setVariable(
'PAY_METHOD',$this->lng->txt(
'pays_paypal'));
1800 $this->tpl->setVariable(
'PAY_METHOD',$this->lng->txt(
'paya_pay_method_not_specified'));
1803 $this->tpl->setVariable(
'ORDER_DATE',date(
'Y m d H:i:s',$booking[
'order_date']));
1805 if($booking[
'duration'] != 0)
1807 $this->tpl->setVariable(
"DURATION",$booking[
'duration'].
' '.$this->lng->txt(
'paya_months'));
1811 $this->tpl->setVariable(
"DURATION",$this->lng->txt(
"unlimited_duration"));
1815 $this->tpl->setVariable(
'PRICE',$booking[
'price']);
1817 $yes_no = array(0 => $this->lng->txt(
'no'),1 => $this->lng->txt(
'yes'));
1819 $this->tpl->setVariable(
'PAYED',
ilUtil::formSelect((
int) $booking[
'payed'],
'payed',$yes_no,
false,
true));
1820 $this->tpl->setVariable(
'ACCESS',
ilUtil::formSelect((
int) $booking[
'access'],
'access',$yes_no,
false,
true));
1823 $this->tpl->setVariable(
'INPUT_CMD',
'updateStatistic');
1824 $this->tpl->setVariable(
'INPUT_VALUE',$this->lng->txt(
'save'));
1826 $this->tpl->setVariable(
'DELETE_CMD',
'deleteStatistic');
1827 $this->tpl->setVariable(
'DELETE_VALUE',$this->lng->txt(
'delete'));
1828 $this->tpl->parseCurrentBlock();
1831 include_once
'./payment/classes/class.ilPayMethods.php';
1833 switch($booking[
'b_pay_method'])
1835 case $this->pobject->PAY_METHOD_BILL:
1839 case $this->pobject->PAY_METHOD_BMF:
1843 case $this->pobject->PAY_METHOD_PAYPAL:
1847 case $this->pobject->PAY_METHOD_EPAY:
1857 if(!isset(
$_GET[
'booking_id']))
1866 $this->booking_obj->setBookingId((
int)
$_GET[
'booking_id']);
1867 $this->booking_obj->setAccess((
int)
$_POST[
'access']);
1868 $this->booking_obj->setPayed((
int) $_POST[
'payed']);
1870 if($this->booking_obj->update())
1889 if(!isset(
$_GET[
'booking_id']))
1904 if(!isset(
$_GET[
'booking_id']))
1913 $this->booking_obj->setBookingId((
int)
$_GET[
'booking_id']);
1914 if(!$this->booking_obj->delete())
1916 die(
'Error deleting booking');
1939 if ($rbacsystem->checkAccess(
'visible,read',$this->object->getRefId()))
1941 $tabs_gui->addTarget(
'settings',
1942 $this->ctrl->getLinkTarget($this,
'generalSettings'), array(
'generalSettings',
'',
'view'),
'',
'');
1944 $tabs_gui->addTarget(
'bookings',
1945 $this->ctrl->getLinkTarget($this,
'statistic'),
'statistic',
'',
'');
1947 $tabs_gui->addTarget(
'objects',
1948 $this->ctrl->getLinkTarget($this,
'objects'),
'objects',
'',
'');
1950 $tabs_gui->addTarget(
'vendors',
1951 $this->ctrl->getLinkTarget($this,
'vendors'),
'vendors',
'',
'');
1953 $tabs_gui->addTarget(
'pay_methods',
1954 $this->ctrl->getLinkTarget($this,
'payMethods'),
'payMethods',
'',
'');
1956 $tabs_gui->addTarget(
'topics',
1957 $this->ctrl->getLinkTargetByClass(
'ilshoptopicsgui',
''),
'payment_topics',
'',
'');
1959 $tabs_gui->addTarget(
'vats',
1960 $this->ctrl->getLinkTarget($this,
'vats'),
'vats',
'',
'');
1963 if ($rbacsystem->checkAccess(
'edit_permission',$this->object->getRefId()))
1965 $tabs_gui->addTarget(
'perm_settings',
1966 $this->ctrl->getLinkTargetByClass(array(get_class($this),
'ilpermissiongui'),
'perm'), array(
'perm',
'info',
'owner'),
'ilpermissiongui');
1975 if(!$rbacsystem->checkAccess(
'read', $this->object->getRefId()))
1977 $this->ilias->raiseError($this->lng->txt(
'msg_no_perm_read'),$this->ilias->error_obj->MESSAGE);
1980 include_once
'./payment/classes/class.ilGeneralSettings.php';
1982 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.pays_general_settings.html',
'payment');
1985 $genSetData = $genSet->getAll();
1987 include_once(
'./Services/Form/classes/class.ilPropertyFormGUI.php');
1990 $form->setFormAction($this->ctrl->getFormAction($this,
'saveGeneralSettings'));
1991 $form->setTitle($this->lng->txt(
'pays_general_settings'));
1993 $form->addCommandButton(
'saveGeneralSettings',$this->lng->txt(
'save'));
1996 $formItem =
new ilCheckboxInputGUI($this->lng->txt(
'pay_enable_shop'),
'shop_enabled');
1997 $formItem->
setChecked((
int)$genSetData[
'shop_enabled']);
1998 $formItem->setInfo($this->lng->txt(
'pay_enable_shop_info'));
1999 $form->addItem($formItem);
2001 $formItem =
new ilTextInputGUI($this->lng->txt(
'pays_currency_unit'),
'currency_unit');
2003 $formItem->setValue($this->error !=
'' && isset(
$_POST[
'currency_unit'])
2006 $formItem->setRequired(
true);
2007 $form->addItem($formItem);
2009 $formItem =
new ilTextInputGUI($this->lng->txt(
'pays_currency_subunit'),
'currency_subunit');
2011 $formItem->setRequired(
true);
2012 $formItem->setValue($this->error !=
'' && isset(
$_POST[
'currency_subunit'])
2015 $form->addItem($formItem);
2019 $formItem->setCols(35);
2020 $formItem->setRequired(
true);
2021 $formItem->setValue($this->error !=
'' && isset(
$_POST[
'address'])
2024 $form->addItem($formItem);
2028 $formItem->setCols(35);
2029 $formItem->setRequired(
true);
2030 $formItem->setValue($this->error !=
'' && isset(
$_POST[
'bank_data'])
2033 $form->addItem($formItem);
2037 $formItem->setCols(35);
2038 $formItem->setValue($this->error !=
'' && isset(
$_POST[
'add_info'])
2041 $form->addItem($formItem);
2050 $formItem =
new ilTextInputGUI($this->lng->txt(
'pays_pdf_path'),
'pdf_path');
2051 $formItem->
setValue($this->error !=
"" && isset(
$_POST[
'pdf_path'])
2054 $formItem->setRequired(
true);
2055 $form->addItem($formItem);
2059 $formItem =
new ilSelectInputGUI($this->lng->txt(
'pay_topics_default_sorting_type'),
'topics_sorting_type');
2060 $formItem->
setValue($genSetData[
'topics_sorting_type']);
2062 1 => $this->lng->txt(
'pay_topics_sort_by_title'),
2063 2 => $this->lng->txt(
'pay_topics_sort_by_date'),
2064 3 => $this->lng->txt(
'pay_topics_sort_manually')
2066 $formItem->setOptions($options);
2067 $form->addItem($formItem);
2070 $formItem =
new ilSelectInputGUI($this->lng->txt(
'pay_topics_default_sorting_direction'),
'topics_sorting_direction');
2071 $formItem->
setValue($genSetData[
'topics_sorting_direction']);
2073 'asc' => $this->lng->txt(
'sort_asc'),
2074 'desc' => $this->lng->txt(
'sort_desc'),
2076 $formItem->setOptions($options);
2077 $form->addItem($formItem);
2080 $formItem =
new ilCheckboxInputGUI($this->lng->txt(
'pay_topics_allow_custom_sorting'),
'topics_allow_custom_sorting');
2081 $formItem->
setChecked((
int)$genSetData[
'topics_allow_custom_sorting']);
2082 $formItem->setInfo($this->lng->txt(
'pay_topics_allow_custom_sorting_info'));
2083 $form->addItem($formItem);
2086 $formItem =
new ilSelectInputGUI($this->lng->txt(
'pay_max_hits'),
'max_hits');
2087 $formItem->
setValue($genSetData[
'max_hits']);
2089 for($i = 10; $i <= 100; $i += 10)
2093 $formItem->setOptions($options);
2094 $formItem->setInfo($this->lng->txt(
'pay_max_hits_info'));
2095 $form->addItem($formItem);
2098 $formItem =
new ilCheckboxInputGUI($this->lng->txt(
'pay_hide_advanced_search'),
'hide_advanced_search');
2099 $formItem->
setChecked((
int)$genSetData[
'hide_advanced_search']);
2100 $formItem->setInfo($this->lng->txt(
'pay_hide_advanced_search_info'));
2101 $form->addItem($formItem);
2105 $formItem->
setChecked((
int)$genSetData[
'hide_news']);
2106 $formItem->setInfo($this->lng->txt(
'pay_hide_news_info'));
2107 $form->addItem($formItem);
2112 $formItem =
new ilCheckboxInputGUI($this->lng->txt(
'pay_hide_filtering'),
'hide_filtering');
2113 $formItem->
setChecked((
int)$genSetData[
'hide_filtering']);
2114 $formItem->setInfo($this->lng->txt(
'pay_hide_filtering_info'));
2115 $form->addItem($formItem);
2118 $formItem =
new ilCheckboxInputGUI($this->lng->txt(
'pay_hide_coupons'),
'hide_coupons');
2119 $formItem->
setChecked((
int)$genSetData[
'hide_coupons']);
2120 $formItem->setInfo($this->lng->txt(
'pay_hide_coupons'));
2121 $form->addItem($formItem);
2126 $this->tpl->setVariable(
'GENERAL_SETTINGS',$form->getHTML());
2134 if(!$rbacsystem->checkAccess(
'read', $this->object->getRefId()))
2136 $this->ilias->raiseError($this->lng->txt(
'msg_no_perm_read'),$this->ilias->error_obj->MESSAGE);
2139 include_once
'./payment/classes/class.ilGeneralSettings.php';
2143 if (
$_POST[
'currency_unit'] ==
'' ||
2144 $_POST[
'currency_subunit'] ==
'' ||
2145 $_POST[
'address'] ==
'' ||
2146 $_POST[
'bank_data'] ==
'' ||
2147 $_POST[
'pdf_path'] ==
'')
2149 $this->error = $this->lng->txt(
'pays_general_settings_not_valid');
2155 $genSet->clearAll();
2182 'topics_allow_custom_sorting',
2183 'topics_sorting_type',
2184 'topics_sorting_direction',
2187 'hide_advanced_search',
2196 $genSet->setAll($values);
2213 if(!$rbacsystem->checkAccess(
'read', $this->object->getRefId()))
2215 $this->ilias->raiseError($this->lng->txt(
'msg_no_perm_read'),$this->ilias->error_obj->MESSAGE);
2218 include_once(
'./Services/Form/classes/class.ilPropertyFormGUI.php');
2219 include_once
'./payment/classes/class.ilEPaySettings.php';
2221 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.pays_epay_settings.html',
'payment');
2225 $ep = $ePayObj->getAll();
2228 $form->setFormAction($this->ctrl->getFormAction($this,
'saveEPaySettings'));
2229 $form->setTitle($this->lng->txt(
'pays_epay_settings'));
2231 $form->addCommandButton(
'saveEPaySettings',$this->lng->txt(
'save'));
2234 array(
'pays_epay_server_host',
'server_host',
true, null),
2235 array(
'pays_epay_server_path',
'server_path',
true, null),
2236 array(
'pays_epay_merchant_number',
'merchant_number',
true, null),
2237 array(
'pays_epay_auth_token',
'auth_token',
true,
'pays_epay_auth_token_info'),
2238 array(
'pays_epay_auth_email',
'auth_email',
true,
'pays_epay_auth_email_info')
2241 foreach ($fields as
$f)
2245 $fi->setRequired($f[2]);
2246 if ($f[3] != null ) $fi->setInfo($this->lng->txt($f[3]));
2247 if ($f[1] ==
'auth_token') $fi->setInputType(
'password');
2248 $form->addItem($fi);
2251 $formItem =
new ilCheckboxInputGUI($this->lng->txt(
'pays_epay_instant_capture'),
'instant_capture');
2252 $formItem->
setChecked($ep[
'instant_capture'] == 1);
2253 $formItem->setInfo($this->lng->txt(
'pays_epay_instant_capture_info'));
2254 $form->addItem($formItem);
2256 $this->tpl->setVariable(
'EPAY_INFO', $this->lng->txt(
'pays_epay_info'));
2257 $this->tpl->setVariable(
'EPAY_SETTINGS',$form->getHTML());
2262 include_once
'./payment/classes/class.ilEPaySettings.php';
2264 if(!$rbacsystem->checkAccess(
'read', $this->object->getRefId()))
2266 $this->ilias->raiseError($this->lng->txt(
'msg_no_perm_read'),$this->ilias->error_obj->MESSAGE);
2273 $arr[
'instant_capture'] = isset(
$_POST[
'instant_capture']) ? 1 : 0;
2275 $epSet->setAll($arr);
2277 if (!$epSet->valid())
2279 $this->error = $this->lng->txt(
'pays_epay_settings_not_valid');
2301 $erp->loadSettings($erps_id);
2302 $set = $erp->getSettings(0);
2305 array(
"pays_eco_agreement",
"agreement", 10),
2306 array(
"username",
"username", 16),
2307 array(
"password",
"password", 16),
2308 array(
"pays_eco_product_number",
"product", 6),
2309 array(
"pays_eco_payment_terms",
"terms", 6),
2310 array(
"pays_eco_layout",
"layout", 6),
2311 array(
"pays_eco_cur_handle_code",
"code", 3)
2314 foreach ($fields as
$f)
2318 $txt->setValue($set[$f[1]]);
2319 if ($f[0] ==
'password') $txt->setInputType(
'password');
2320 $op->addSubItem($txt);
2337 include_once
'./Services/Form/classes/class.ilPropertyFormGUI.php';
2338 require_once
'./Services/Payment/classes/class.ilERP_eco.php';
2349 $frm->setFormAction($this->ctrl->getFormAction($this,
'saveEEPsettings'));
2350 $frm->setTitle($this->lng->txt(
'pays_erp_settings'));
2354 $preview_link =
"<br/><a href='".
ilERP::getPreviewUrl() .
"' target='_blank'>" . $this->lng->txt(
'pays_erp_invoice_preview') .
"</a>";
2355 $frm->addCommandButton(
'delERPpreview', $this->lng->txt(
'pays_erp_invoice_delpreview') );
2358 $frm->addCommandButton(
'saveERPsettings',$this->lng->txt(
'save'));
2359 $frm->addCommandButton(
'testERPsettings',$this->lng->txt(
'test'));
2361 $savepdf =
new ilCheckboxInputGUI($this->lng->txt(
'pays_erp_invoice_copies'),
'save_copy');
2368 $rdo->
setInfo(
"The ERP is currently in development");
2370 $rdo->setValue($active[
'erp_id']);
2372 foreach ($systems as $system)
2374 $desc = $system[
'description'];
2375 $desc .= empty($system[
'url']) ?
'' :
' <a href="'.$system[
'url'].
'" target="_blank">' . $this->lng->txt(
"additional_info") .
"</a>";
2379 $function =
"getERPform_" . $system[
'erp_short'];
2380 $this->$function(&$op, $active[
'erps_id']);
2384 $rdo->addOption($op);
2386 $frm->addItem($rdo);
2388 $savepdf->setChecked( $active[
'save_copy'] );
2391 $save_msg = $this->lng->txt(
'pays_erp_invoice_copies_info') .
' ' .ilERP::getSaveDirectory();
2393 if (!is_writable(
ilERP::getSaveDirectory() )) $save_msg .=
"<br/><b>" . $this->lng->txt(
'pays_erp_invoice_nowrite') .
"</b>";
2394 $save_msg .= $preview_link;
2396 $savepdf->setInfo($save_msg);
2398 $frm->addItem($savepdf);
2402 $chk->
setInfo($this->lng->txt(
'enable_ean_info'));
2403 $frm->addItem($chk);
2417 require_once
'./Services/Payment/classes/class.ilERP.php';
2421 require_once
'./Services/Payment/classes/class.ilERP_none.php';
2425 require_once
'./Services/Payment/classes/class.ilERP_eco.php';
2441 $a[
'use_ean'] = (isset(
$_POST[
'use_ean'])) ? 1 : 0;
2442 $a[
'save_copy'] = (isset(
$_POST[
'save_copy'])) ? 1 : 0;
2448 require_once
'./Services/Payment/classes/class.ilERP.php';
2458 if(!$rbacsystem->checkAccess(
'read', $this->object->getRefId()))
2460 $this->ilias->raiseError($this->lng->txt(
'msg_no_perm_write'),$this->ilias->error_obj->MESSAGE);
2466 assert ($active[
'erp_id'] == (
int)
$_POST[
'erp_id']);
2468 $cls =
"ilERPDebtor_" . $active[
'erp_short'] ;
2469 require_once
'./Services/Payment/classes/class.' . $cls .
".php";
2476 $nr = rand(1030,1040);
2477 if ($deb->getDebtorByNumber($nr))
2479 $good .= $this->lng->txt(
'pays_erp_tst_existing');
2483 $deb->setTestValues();
2484 $deb->createDebtor($nr);
2486 $good = $this->lng->txt(
'pays_erp_tst_new');
2489 $good .=
" " . $nr .
", " . $deb->getName() .
" ";
2491 $amount = rand(10,1000);
2493 $good .= $this->lng->txt(
'pays_erp_tst_billed') .
" " . $pcs .
" x " . $amount .
2494 "<br/>" . $this->lng->txt(
'total') .
" " . number_format( $pcs*$amount, 2,
',',
'.');
2496 $deb->createInvoice();
2497 $deb->createInvoiceLine( 0, $this->lng->txt(
'pays_erp_tst_product'), $pcs, $amount);
2498 $deb->createInvoiceLine( 0,
"www.ilias.dk", 1, 1);
2499 $v = $deb->bookInvoice();
2500 $good .=
", # " . $deb->getInvoiceNumber();
2502 $attach = $deb->getInvoicePDF($v);
2504 $deb->saveInvoice($attach,
true);
2505 $deb->sendInvoice($this->lng->txt(
'pay_order_paid_subject'), $deb->getName() .
",\n" . $this->lng->txt(
'pays_erp_invoice_attached'), $ilUser->getEmail(), $attach,
"faktura");
2507 $good .=
"<br/>" . $ilUser->getEmail() .
" => " . $this->lng->txt(
'mail_sent');
2530 if (!$instance->looksValid()) $message = str_replace(
'%s', $instance->getName, $this->lng->txt(
'pays_erp_bad_settings'));
2535 $instance->connect();
2536 ilUtil::sendInfo(str_replace(
'%s', $instance->getName(), $this->lng->txt(
"pays_erp_connection_established")));
2553 if(!$rbacsystem->checkAccess(
'write', $this->object->getRefId()))
2555 $this->ilias->raiseError($this->lng->txt(
'msg_no_perm_write'),$this->ilias->error_obj->MESSAGE);
2559 $system = (int)
$_POST[
'erp_id'];
2561 $instance->setSettings($settings);
2572 $instance->setActive($system);
2573 $instance->saveSettings($settings);
2574 ilUtil::sendSuccess(str_replace(
'%s', $instance->getName(), $this->lng->txt(
'pays_erp_updated_settings')));
2587 if(!$rbacsystem->checkAccess(
'read', $this->object->getRefId()))
2589 $this->ilias->raiseError($this->lng->txt(
'msg_no_perm_read'),$this->ilias->error_obj->MESSAGE);
2591 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.pays_erp_settings.html',
'payment');
2595 $this->tpl->setVariable(
'ERP_INFO', $this->lng->txt(
'pays_erp_info'));
2596 $this->tpl->setVariable(
'ERP_SETTINGS',$form->getHTML());
2609 if(!$rbacsystem->checkAccess(
'read', $this->object->getRefId()))
2611 $this->ilias->raiseError($this->lng->txt(
'msg_no_perm_read'),$this->ilias->error_obj->MESSAGE);
2614 include_once(
'./Services/Form/classes/class.ilPropertyFormGUI.php');
2615 include_once
'./payment/classes/class.ilPaypalSettings.php';
2617 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.pays_paypal_settings.html',
'payment');
2622 $form->setFormAction($this->ctrl->getFormAction($this,
'savePaypalSettings'));
2623 $form->setTitle($this->lng->txt(
'pays_paypal_settings'));
2625 $form->addCommandButton(
'savePaypalSettings',$this->lng->txt(
'save'));
2627 $formItem =
new ilTextInputGUI($this->lng->txt(
'pays_server_host'),
'server_host');
2628 $formItem->
setValue($ppSet->getServerHost());
2629 $form->addItem($formItem);
2631 $formItem =
new ilTextInputGUI($this->lng->txt(
'pays_server_path'),
'server_path');
2632 $formItem->
setValue($ppSet->getServerPath());
2633 $form->addItem($formItem);
2635 $formItem =
new ilTextInputGUI($this->lng->txt(
'pays_email_vendor'),
'vendor');
2636 $formItem->
setValue($ppSet->getVendor());
2637 $form->addItem($formItem);
2639 $formItem =
new ilTextInputGUI($this->lng->txt(
'pays_auth_token'),
'auth_token');
2640 $formItem->
setValue($ppSet->getAuthToken());
2641 $form->addItem($formItem);
2643 $formItem =
new ilTextInputGUI($this->lng->txt(
'pays_page_style'),
'page_style');
2644 $formItem->
setValue($ppSet->getPageStyle());
2645 $form->addItem($formItem);
2647 $this->tpl->setVariable(
'PAYPAL_SETTINGS',$form->getHTML());
2652 include_once
'./payment/classes/class.ilPaypalSettings.php';
2657 if(!$rbacsystem->checkAccess(
'read', $this->object->getRefId()))
2659 $this->ilias->raiseError($this->lng->txt(
'msg_no_perm_read'),$this->ilias->error_obj->MESSAGE);
2671 if (
$_POST[
'server_host'] ==
'' ||
2672 $_POST[
'server_path'] ==
'' ||
2673 $_POST[
'vendor'] ==
'' ||
2674 $_POST[
'auth_token'] ==
'')
2676 $this->error = $this->lng->txt(
'pays_paypal_settings_not_valid');
2693 include_once
'./payment/classes/class.ilPaymentBookings.php';
2698 if(!$rbacsystem->checkAccess(
'read', $this->object->getRefId()))
2700 $this->ilias->raiseError($this->lng->txt(
'msg_no_perm_read'),$this->ilias->error_obj->MESSAGE);
2706 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.pays_vendors.html',
'payment');
2708 $this->
__showButton(
'searchUser',$this->lng->txt(
'search_user'));
2710 $this->
object->initPaymentVendorsObject();
2711 if(!count($vendors = $this->object->payment_vendors_obj->getVendors()))
2717 # $this->__showButton('exportVendors',$this->lng->txt('excel_export'));
2724 $this->tpl->setCurrentBlock(
'confirm_delete');
2725 $this->tpl->setVariable(
'CONFIRM_FORMACTION',$this->ctrl->getFormAction($this));
2726 $this->tpl->setVariable(
'TXT_CANCEL',$this->lng->txt(
'cancel'));
2727 $this->tpl->setVariable(
'CONFIRM_CMD',
'performDeleteVendors');
2728 $this->tpl->setVariable(
'TXT_CONFIRM',$this->lng->txt(
'delete'));
2729 $this->tpl->parseCurrentBlock();
2733 $f_result = array();
2741 $vendor[
'vendor_id']);
2742 $f_result[$counter][] = $tmp_obj->getLogin();
2743 $f_result[$counter][] = $vendor[
'cost_center'];
2757 include_once
'./payment/classes/class.ilPaymentExcelWriterAdapter.php';
2768 $workbook =& $pewa->getWorkbook();
2769 @$workbook->close();
2774 include_once
'./Services/Excel/classes/class.ilExcelUtils.php';
2775 include_once
'./payment/classes/class.ilPaymentVendors.php';
2779 $workbook =& $pewa->getWorkbook();
2780 $worksheet =& $workbook->addWorksheet(utf8_decode($this->lng->txt(
'bookings')));
2782 $worksheet->mergeCells(0,0,0,3);
2783 $worksheet->setColumn(0,0,16);
2784 $worksheet->setColumn(0,1,32);
2785 $worksheet->setColumn(0,2,32);
2786 $worksheet->setColumn(0,3,16);
2787 $worksheet->setColumn(0,4,16);
2788 $worksheet->setColumn(0,5,16);
2789 $worksheet->setColumn(0,6,24);
2790 $worksheet->setColumn(0,7,8);
2791 $worksheet->setColumn(0,8,12);
2792 $worksheet->setColumn(0,9,16);
2795 $title = $this->lng->txt(
'bookings');
2796 $title .=
' '.$this->lng->txt(
'as_of').
' ';
2797 $title .= strftime(
'%Y-%m-%d %R',time());
2799 $worksheet->writeString(0,0,
$title,$pewa->getFormatTitle());
2819 if(!count($bookings = $this->booking_obj->getBookings()))
2824 include_once
'Services/User/classes/class.ilObjUser.php';
2825 $object_title_cache = array();
2826 $user_title_cache = array();
2829 foreach($bookings as $booking)
2831 if(array_key_exists($booking[
'ref_id'], $object_title_cache))
2833 $tmp_obj = $object_title_cache[$booking[
'ref_id']];
2838 $object_title_cache[$booking[
'ref_id']] = $tmp_obj;
2840 if(array_key_exists($booking[
'b_vendor_id'], $user_title_cache))
2842 $tmp_vendor = $user_title_cache[$booking[
'b_vendor_id']];
2847 $user_title_cache[$booking[
'b_vendor_id']] = $tmp_vendor;
2849 if(array_key_exists($booking[
'customer_id'], $user_title_cache))
2851 $tmp_purchaser = $user_title_cache[$booking[
'customer_id']];
2858 $tmp_purchaser =
''.$tmp_purchaser_name[
'firstname'].
' '.$tmp_purchaser_name[
'lastname'].
' ['.$tmp_purchaser_login.
']';
2859 $user_title_cache[$booking[
'customer_id']] = $tmp_purchaser;
2862 switch ($booking[
'b_pay_method'])
2864 case $this->pobject->PAY_METHOD_BILL :
2867 case $this->pobject->PAY_METHOD_BMF :
2870 case $this->pobject->PAY_METHOD_PAYPAL :
2877 $worksheet->writeString($counter,3,
ilExcelUtils::_convert_text(($tmp_vendor !=
'' ? $tmp_vendor : $this->lng->txt(
'user_deleted'))));
2879 $worksheet->writeString($counter,5,
ilExcelUtils::_convert_text(($tmp_purchaser !=
'' ? $tmp_purchaser : $this->lng->txt(
'user_deleted'))));
2881 $worksheet->writeString($counter,7,strftime(
'%Y-%m-%d %R',$booking[
'order_date']));
2882 $worksheet->writeString($counter,8,$booking[
'duration']);
2885 $payed_access = $booking[
'payed'] ?
2886 $this->lng->txt(
'yes') :
2887 $this->lng->txt(
'no');
2889 $payed_access .=
'/';
2890 $payed_access .= $booking[
'access'] ?
2891 $this->lng->txt(
'yes') :
2892 $this->lng->txt(
'no');
2894 $worksheet->writeString($counter,10,$payed_access);
2904 unset($tmp_purchaser);
2912 include_once
'./Services/Excel/classes/class.ilExcelUtils.php';
2914 $this->
object->initPaymentVendorsObject();
2916 $workbook =& $pewa->getWorkbook();
2920 $worksheet->mergeCells(0,0,0,2);
2921 $worksheet->setColumn(1,0,32);
2922 $worksheet->setColumn(1,1,32);
2923 $worksheet->setColumn(1,2,32);
2925 $title = $this->lng->txt(
'bookings');
2926 $title .=
' '.$this->lng->txt(
'as_of').
' ';
2927 $title .= strftime(
'%Y-%m-%d %R',time());
2929 $worksheet->writeString(0,0,
$title,$pewa->getFormatTitle());
2935 if(!count($vendors = $this->object->payment_vendors_obj->getVendors()))
2958 include_once
'./payment/classes/class.ilPayMethods.php';
2959 include_once
'Services/Table/classes/class.ilTable2GUI.php';
2960 include_once(
"Services/Utilities/classes/class.ilConfirmationGUI.php");
2964 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.pays_pay_methods.html',
'payment');
2967 if(!$rbacsystem->checkAccess(
'read', $this->object->getRefId()))
2969 $this->ilias->raiseError($this->lng->txt(
'msg_no_perm_read'),$this->ilias->error_obj->MESSAGE);
2972 if(count($askForDeletingAddresses))
2978 $oConfirmationGUI->setFormAction($ilCtrl->getFormAction($this,
"deleteAddressesForPaymethods"));
2979 $oConfirmationGUI->setHeaderText($this->lng->txt(
"info_delete_sure"));
2980 $oConfirmationGUI->setCancel($this->lng->txt(
"cancel"),
"paymethods");
2981 $oConfirmationGUI->setConfirm($this->lng->txt(
"confirm"),
"deleteAddressesForPaymethods");
2983 foreach($askForDeletingAddresses as $pm)
2985 $oConfirmationGUI->addHiddenItem(
'pm[]',$pm);
2987 if($pm ==
'bill') $oConfirmationGUI->additem(
'paymethod',
'bill', $this->lng->txt(
'delete_addresses_bill'));
2988 if($pm ==
'bmf') $oConfirmationGUI->additem(
'paymethod',
'bmf', $this->lng->txt(
'delete_addresses_bmf'));
2989 if($pm ==
'paypal')$oConfirmationGUI->additem(
'paymethod',
'paypal', $this->lng->txt(
'delete_addresses_paypal'));
2990 if($pm ==
'epay')$oConfirmationGUI->additem(
'paymethod',
'epay', $this->lng->txt(
'delete_addresses_epay'));
2993 $this->tpl->setVariable(
'CONFIRMATION', $oConfirmationGUI->getHtml());
2998 $tbl->setId(
'pay_methods_tbl');
2999 $tbl->setFormAction($this->ctrl->getFormAction($this),
'savePayMethods');
3004 $result[$counter][] = $this->lng->txt(
'pays_online');
3005 $result[$counter][] = $this->lng->txt(
'pays_bill');
3008 $this->ctrl->clearParameters($this);
3011 $result[$counter][] = $this->lng->txt(
'pays_online');
3012 $result[$counter][] = $this->lng->txt(
'pays_bmf');
3015 $this->ctrl->clearParameters($this);
3018 $result[$counter][]= $this->lng->txt(
'pays_online');
3019 $result[$counter][] = $this->lng->txt(
'pays_paypal');
3022 $this->ctrl->clearParameters($this);
3025 $result[$counter][] = $this->lng->txt(
'pays_online');
3026 $result[$counter][] = $this->lng->txt(
'pays_epay');
3029 $this->ctrl->clearParameters($this);
3032 $tpl =& $tbl->getTemplateObject();
3035 $tpl->setCurrentBlock(
'tbl_form_header');
3037 $tpl->setVariable(
'FORMACTION',$this->ctrl->getFormAction($this),
'savePayMethods');
3039 $tpl->parseCurrentBlock();
3041 $tbl->setTitle($this->lng->txt(
'pays_pay_methods'),
'icon_pays.gif',$this->lng->txt(
'bookings'));
3042 $tbl->setHeaderNames(array($this->lng->txt(
'pays_online'),
3043 $this->lng->txt(
'paya_pay_method'),
3044 $this->lng->txt(
'enabled'),
3045 $this->lng->txt(
'save_customer_address')));
3047 $tbl->setHeaderVars(array(
'online',
3051 $this->ctrl->getParameterArray($this,
'paymethods',
false));
3054 $offset =
$_GET[
'offset'];
3056 $tbl->disable(
'sort');
3057 $tbl->disable(
'linkbar');
3058 $tbl->setOffset($offset);
3059 $tbl->setLimit(
$_GET[
'limit']);
3060 $tbl->setMaxCount(count(
$result));
3061 $tbl->setFooter(
'tblfooter',$this->lng->txt(
'previous'),$this->lng->txt(
'next'));
3064 $tpl->setVariable(
'COLUMN_COUNTS',5);
3065 $tpl->setCurrentBlock(
'plain_buttons');
3066 $tpl->setVariable(
'PBTN_NAME',
'savePayMethods');
3067 $tpl->setVariable(
'PBTN_VALUE',$this->lng->txt(
'save'));
3068 $tpl->parseCurrentBlock();
3071 $this->tpl->setVariable(
'PAYMETHODS',$tbl->tpl->get());
3079 include_once
'./payment/classes/class.ilPayMethods.php';
3080 include_once
'./payment/classes/class.ilPaymentObject.php';
3085 if(!$rbacsystem->checkAccess(
'read', $this->object->getRefId()))
3087 $this->ilias->raiseError($this->lng->txt(
'msg_no_perm_read'),$this->ilias->error_obj->MESSAGE);
3136 if(isset(
$_POST[
'pm_bill']))
3140 if(isset(
$_POST[
'pm_bmf']))
3144 if(isset(
$_POST[
'pm_paypal']))
3148 if(isset(
$_POST[
'pm_epay']))
3162 $askForDeletingAddresses = array();
3164 if(isset(
$_POST[
'save_user_adr_bill']))
3168 else if($save_user_adr_bill ==
true &&
$_POST[
'save_user_adr_bill'] ==
false)
3171 $askForDeletingAddresses[] =
'bill';
3174 if(isset(
$_POST[
'save_user_adr_bmf']))
3178 else if($save_user_adr_bmf ==
true &&
$_POST[
'save_user_adr_bmf'] ==
false)
3181 $askForDeletingAddresses[] =
'bmf';
3184 if(isset(
$_POST[
'save_user_adr_paypal']))
3188 else if($save_user_adr_paypal ==
true &&
$_POST[
'save_user_adr_paypal'] ==
false)
3191 $askForDeletingAddresses[] =
'paypal';
3193 if(isset(
$_POST[
'save_user_adr_epay']))
3197 else if($save_user_adr_epay ==
true &&
$_POST[
'save_user_adr_epay'] ==
false)
3200 $askForDeletingAddresses[] =
'epay';
3220 include_once
'./payment/classes/class.ilPaymentBookings.php';
3222 if(!count(
$_POST[
'vendor']))
3249 include_once
'./payment/classes/class.ilPaymentTrustees.php';
3254 if(!$rbacsystem->checkAccess(
'write', $this->object->getRefId()))
3256 $this->ilias->raiseError($this->lng->txt(
'msg_no_perm_write'),$this->ilias->error_obj->MESSAGE);
3259 $this->
object->initPaymentVendorsObject();
3263 $this->
object->payment_vendors_obj->delete($vendor);
3280 if(!$rbacsystem->checkAccess(
"write", $this->object->getRefId()))
3282 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_write"),$this->ilias->error_obj->MESSAGE);
3285 if(!count(
$_POST[
'vendor']))
3292 if(count(
$_POST[
'vendor']) > 1)
3302 $this->
object->initPaymentVendorsObject();
3304 if (!is_array($this->object->payment_vendors_obj->vendors[
$_SESSION[
'pays_vendor']]))
3311 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.pays_vendor.html',
'payment');
3313 $this->tpl->setVariable(
'VENDOR_FORMACTION',$this->ctrl->getFormAction($this));
3317 $this->tpl->setVariable(
'ALT_IMG',$this->lng->txt(
'obj_usr'));
3318 $this->tpl->setVariable(
'TITLE',$this->lng->txt(
'pays_vendor'));
3321 $this->tpl->setVariable(
'TXT_VENDOR',$this->lng->txt(
'pays_vendor'));
3322 $this->tpl->setVariable(
'TXT_COST_CENTER',$this->lng->txt(
'pays_cost_center'));
3324 $this->tpl->setVariable(
'INPUT_VALUE',ucfirst($this->lng->txt(
'save')));
3328 $this->tpl->setVariable(
'VENDOR',
3330 $this->tpl->setVariable(
'COST_CENTER',
3331 $this->error !=
'' && isset(
$_POST[
'cost_center'])
3336 $this->tpl->addBlockfile(
'BUTTONS',
'buttons',
'tpl.buttons.html');
3337 $this->tpl->setCurrentBlock(
'btn_cell');
3338 $this->tpl->setVariable(
'BTN_LINK', $this->ctrl->getLinkTarget($this,
'vendors'));
3339 $this->tpl->setVariable(
'BTN_TXT', $this->lng->txt(
'pay_bmf_back'));
3340 $this->tpl->parseCurrentBlock(
'btn_cell');
3348 if(!$rbacsystem->checkAccess(
'write', $this->object->getRefId()))
3350 $this->ilias->raiseError($this->lng->txt(
'msg_no_perm_write'),$this->ilias->error_obj->MESSAGE);
3368 $this->
object->initPaymentVendorsObject();
3370 if (!is_array($this->object->payment_vendors_obj->vendors[
$_SESSION[
'pays_vendor']]))
3377 if (
$_POST[
'cost_center'] ==
'')
3379 $this->error = $this->lng->txt(
'pays_cost_center_not_valid');
3386 $this->
object->initPaymentVendorsObject();
3387 $this->
object->payment_vendors_obj->update(
$_SESSION[
'pays_vendor'],
$_POST[
'cost_center']);
3398 global $rbacsystem,
$tree;
3401 if(!$rbacsystem->checkAccess(
'read', $this->object->getRefId()))
3403 $this->ilias->raiseError($this->lng->txt(
'msg_no_perm_read'),$this->ilias->error_obj->MESSAGE);
3406 include_once
'./payment/classes/class.ilPaymentObjectSelector.php';
3408 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.paya_object_selector.html',
'payment');
3410 $this->
__showButton(
'statistic',$this->lng->txt(
'back'));
3415 $exp =
new ilPaymentObjectSelector($this->ctrl->getLinkTarget($this,
'showObjectSelector'), strtolower(get_class($this)));
3416 $exp->
setExpand(
$_GET[
'paya_link_expand'] ?
$_GET[
'paya_link_expand'] : $tree->readRootId());
3417 $exp->setExpandTarget($this->ctrl->getLinkTarget($this,
'showObjectSelector'));
3421 $this->tpl->setVariable(
'EXPLORER',$exp->getOutput());
3431 if(!$rbacsystem->checkAccess(
'read', $this->object->getRefId()))
3433 $this->ilias->raiseError($this->lng->txt(
'msg_no_perm_read'),$this->ilias->error_obj->MESSAGE);
3436 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.pays_user_search.html',
'payment');
3437 $this->
__showButton(
'vendors',$this->lng->txt(
'back'));
3439 $this->lng->loadLanguageModule(
'search');
3441 $this->tpl->setVariable(
'F_ACTION',$this->ctrl->getFormAction($this));
3442 $this->tpl->setVariable(
'SEARCH_ASSIGN_USR',$this->lng->txt(
'crs_search_members'));
3443 $this->tpl->setVariable(
'SEARCH_SEARCH_TERM',$this->lng->txt(
'search_search_term'));
3444 $this->tpl->setVariable(
'SEARCH_VALUE',
$_SESSION[
'pays_search_str'] ?
$_SESSION[
'pays_search_str'] :
'');
3445 $this->tpl->setVariable(
'BTN2_VALUE',$this->lng->txt(
'cancel'));
3446 $this->tpl->setVariable(
'BTN1_VALUE',$this->lng->txt(
'search'));
3453 global $rbacsystem,
$tree;
3455 if(!$rbacsystem->checkAccess(
'read', $this->object->getRefId()))
3457 $this->ilias->raiseError($this->lng->txt(
'msg_no_perm_read'),$this->ilias->error_obj->MESSAGE);
3462 if(!isset(
$_POST[
'search_str']))
3477 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.pays_usr_selection.html',
'payment');
3478 $this->
__showButton(
'searchUser',$this->lng->txt(
'crs_new_search'));
3481 $f_result = array();
3489 $f_result[$counter][] = $tmp_obj->getLogin();
3490 $f_result[$counter][] = $tmp_obj->getLastname();
3491 $f_result[$counter][] = $tmp_obj->getFirstname();
3505 if(!$rbacsystem->checkAccess(
'write', $this->object->getRefId()))
3507 $this->ilias->raiseError($this->lng->txt(
'msg_no_perm_write'),$this->ilias->error_obj->MESSAGE);
3509 if(!
$_POST[
'vendor_login'])
3524 $this->
object->initPaymentVendorsObject();
3526 if($this->object->payment_vendors_obj->isAssigned(
$usr_id))
3533 $this->
object->payment_vendors_obj->add(
$usr_id);
3546 if(!$rbacsystem->checkAccess(
'write', $this->object->getRefId()))
3548 $this->ilias->raiseError($this->lng->txt(
'msg_no_perm_write'),$this->ilias->error_obj->MESSAGE);
3551 $this->lng->loadLanguageModule(
'crs');
3552 if(!is_array(
$_POST[
'user']))
3560 $this->
object->initPaymentVendorsObject();
3562 $already_assigned = $assigned = 0;
3565 if($this->object->payment_vendors_obj->isAssigned($usr_id))
3567 ++$already_assigned;
3571 $this->
object->payment_vendors_obj->add($usr_id);
3579 $message .= $this->lng->txt(
'pays_assigned_vendors').
' '.$assigned;
3581 if($already_assigned)
3583 $message .=
'<br />'.$this->lng->txt(
'pays_already_assigned_vendors').
' '.$already_assigned;
3595 if(!isset(
$_GET[
'sell_id']))
3597 ilUtil::sendFailiure($this->lng->txt(
'paya_no_booking_id_given'));
3603 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.paya_user_search.html',
'payment');
3604 $this->
__showButton(
'showObjectSelector',$this->lng->txt(
'back'));
3606 $this->lng->loadLanguageModule(
'search');
3608 $this->ctrl->setParameter($this,
'sell_id',
$_GET[
'sell_id']);
3609 $this->tpl->setVariable(
'F_ACTION',$this->ctrl->getFormAction($this));
3610 $this->tpl->setVariable(
'SEARCH_ASSIGN_USR',$this->lng->txt(
'search_user'));
3611 $this->tpl->setVariable(
'SEARCH_SEARCH_TERM',$this->lng->txt(
'search_search_term'));
3612 $this->tpl->setVariable(
'SEARCH_VALUE',
$_SESSION[
'paya_search_str_user_sp'] ?
$_SESSION[
'paya_search_str_user_sp'] :
'');
3613 $this->tpl->setVariable(
'BTN2_VALUE',$this->lng->txt(
'cancel'));
3614 $this->tpl->setVariable(
'BTN1_VALUE',$this->lng->txt(
'search'));
3615 $this->tpl->setVariable(
'SEARCH',
'performSearchSP');
3617 $this->tpl->setVariable(
'CANCEL',
'bookings');
3627 if(!trim(
$_POST[
'search_str']))
3630 $this->statistics();
3642 if(!isset(
$_GET[
'sell_id']))
3650 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.paya_usr_selection.html',
'payment');
3651 $this->ctrl->setParameter($this,
'sell_id',
$_GET[
'sell_id']);
3652 $this->
__showButton(
'searchUserSP',$this->lng->txt(
'back'));
3655 $f_result = array();
3662 $f_result[$counter][] = ilUtil::formRadiobutton(0,
'user_id',$user[
'id']);
3663 $f_result[$counter][] = $tmp_obj->getLogin();
3664 $f_result[$counter][] = $tmp_obj->getFirstname();
3665 $f_result[$counter][] = $tmp_obj->getLastname();
3678 if(!isset(
$_GET[
'sell_id']))
3686 if(!isset(
$_POST[
'user_id']))
3694 $this->ctrl->setParameter($this,
'sell_id',
$_GET[
'sell_id']);
3695 $this->
__showButton(
'searchUserSP',$this->lng->txt(
'back'));
3697 $this->ctrl->setParameter($this,
'user_id',
$_POST[
'user_id']);
3706 $tmp_object[
'title'] = $tmp_obj->getTitle();
3710 $tmp_object[
'title'] = $this->lng->txt(
'object_not_found');
3717 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.paya_add_customer.html',
'payment');
3719 $this->tpl->setVariable(
'FORMACTION',$this->ctrl->getFormAction($this));
3722 $this->tpl->setVariable(
'ALT_IMG',$this->lng->txt(
'obj_usr'));
3723 $this->tpl->setVariable(
'TITLE',$tmp_user->getFullname().
' ['.$tmp_user->getLogin().
']');
3726 $this->tpl->setVariable(
'TXT_TRANSACTION',$this->lng->txt(
'paya_transaction'));
3729 $this->tpl->setVariable(
'TXT_OB JECT',$this->lng->txt(
'title'));
3730 $this->tpl->setVariable(
'OBJECT', $tmp_object[
'title']);
3732 $this->tpl->setVariable(
'TXT_VENDOR',$this->lng->txt(
'paya_vendor'));
3733 $this->tpl->setVariable(
'VENDOR',$tmp_vendor->getFullname().
' ['.$tmp_vendor->getLogin().
']');
3735 $this->tpl->setVariable(
'TXT_PAY_METHOD',$this->lng->txt(
'paya_pay_method'));
3736 $this->tpl->setVariable(
'TXT_PAY_METHOD_BILL',$this->lng->txt(
'pays_bill'));
3737 $this->tpl->setVariable(
'TXT_PAY_METHOD_BMF',$this->lng->txt(
'pays_bmf'));
3738 $this->tpl->setVariable(
'TXT_PAY_METHOD_PAYPAL',$this->lng->txt(
'pays_paypal'));
3739 $this->tpl->setVariable(
'PAY_METHOD_'.
$_POST[
'pay_method'],
' selected');
3741 $this->tpl->setVariable(
'TXT_ORDER_DATE',$this->lng->txt(
'paya_order_date'));
3744 $this->tpl->setVariable(
'TXT_DURATION',$this->lng->txt(
'duration'));
3745 include_once
'./payment/classes/class.ilPaymentPrices.php';
3747 if (is_array($prices = $prices_obj->getPrices()))
3749 foreach($prices as $price)
3751 $this->tpl->setCurrentBlock(
'duration_loop');
3752 if (
$_POST[
'duration'] == $price[
'price_id']) $this->tpl->setVariable(
'DURATION_LOOP_SELECTED',
' selected');
3753 $this->tpl->setVariable(
'DURATION_LOOP_ID', $price[
'price_id']);
3754 $this->tpl->setVariable(
'DURATION_LOOP_NAME', $price[
'duration'].
' '.$this->lng->txt(
'paya_months').
', '.
ilPaymentPrices::_getPriceString($price[
'price_id']));
3755 $this->tpl->parseCurrentBlock();
3759 $this->tpl->setVariable(
'TXT_PAYED',$this->lng->txt(
'paya_payed'));
3760 if (
$_POST[
'payed'] == 1) $this->tpl->setVariable(
'PAYED_1',
' selected');
3761 $this->tpl->setVariable(
'TXT_ACCESS',$this->lng->txt(
'paya_access'));
3762 if (
$_POST[
'access'] == 1) $this->tpl->setVariable(
'ACCESS_1',
' selected');
3764 $this->tpl->setVariable(
'TXT_NO',$this->lng->txt(
'no'));
3765 $this->tpl->setVariable(
'TXT_YES',$this->lng->txt(
'yes'));
3766 $this->tpl->setVariable(
'TXT_SAVE',$this->lng->txt(
'save'));
3767 $this->tpl->setVariable(
'TXT_CANCEL',$this->lng->txt(
'cancel'));
3769 $this->tpl->setVariable(
'STATISTICS',
'bookings');
3775 global
$ilias, $ilUser,$ilObjDataCache;
3777 if(!isset(
$_GET[
'sell_id']))
3785 if(!isset(
$_GET[
'user_id']))
3793 if (
$_POST[
'pay_method'] ==
'' ||
3794 $_POST[
'duration'] ==
'')
3807 $inst_id_time = $ilias->getSetting(
'inst_id').
'_'.$this->user_obj->getId().
'_'.substr((
string) time(),-3);
3808 $transaction = $inst_id_time.substr(md5(uniqid(rand(),
true)), 0, 4);
3809 $this->booking_obj->setTransaction($transaction);
3810 $this->booking_obj->setTransactionExtern(
$_POST[
'transaction']);
3811 $this->booking_obj->setPobjectId($pObjectId);
3812 $this->booking_obj->setCustomerId(
$_GET[
'user_id']);
3813 $this->booking_obj->setVendorId($obj->getVendorId());
3814 $this->booking_obj->setPayMethod((
int)
$_POST[
'pay_method']);
3815 $this->booking_obj->setOrderDate(time());
3816 include_once
'./payment/classes/class.ilPaymentPrices.php';
3818 $this->booking_obj->setDuration($price[
'duration']);
3820 $this->booking_obj->setAccess((
int) $_POST[
'access']);
3821 $this->booking_obj->setPayed((
int) $_POST[
'payed']);
3822 $this->booking_obj->setVoucher(
'');
3823 $obj_id = $ilObjDataCache->lookupObjId($obj->getRefId());
3824 $obj_type = $ilObjDataCache->lookupType(
$obj_id);
3825 $obj_title = $ilObjDataCache->lookupTitle(
$obj_id);
3827 include_once
'Services/Payment/classes/class.ilShopVatsList.php';
3828 $oVAT =
new ilShopVats((
int)$obj->getVatId());
3829 $obj_vat_rate = $oVAT->
getRate();
3830 $obj_vat_unit = $obj->getVat($this->booking_obj->getPrice());
3832 $this->booking_obj->setObjectTitle($obj_title);
3833 $this->booking_obj->setVatRate($obj_vat_rate);
3834 $this->booking_obj->setVatUnit($obj_vat_unit);
3836 include_once
'./payment/classes/class.ilPayMethods.php';
3842 if($save_user_adr_bill == 1 || $save_user_adr_bmf == 1
3843 || $save_user_adr_paypal == 1 || $save_user_adr_epay == 1)
3846 $user_id[] =
$_GET[
"user_id"];
3850 $this->booking_obj->setStreet($cust_obj[
$_GET[
"user_id"]][
'street'],
'');
3852 $this->booking_obj->setZipcode($cust_obj[$_GET[
"user_id"]][
'zipcode']);
3853 $this->booking_obj->setCity($cust_obj[$_GET[
"user_id"]][
'city']);
3854 $this->booking_obj->setCountry($cust_obj[$_GET[
"user_id"]][
'country']);
3857 if($this->booking_obj->add())
3874 $this->section = $a_section;
3882 $this->mainSection = $a_section;
3893 $this->tabs_gui->addSubTabTarget(
'pays_general',
3894 $this->ctrl->getLinkTargetByClass(
'ilobjpaymentsettingsgui',
'generalSettings'),
3898 $this->
__getSection() == $this->SECTION_GENERAL ?
true :
false);
3899 $this->tabs_gui->addSubTabTarget(
'pays_bmf',
3900 $this->ctrl->getLinkTargetByClass(
'ilobjpaymentsettingsgui',
'bmfSettings'),
3904 $this->
__getSection() == $this->SECTION_BMF ?
true :
false);
3905 $this->tabs_gui->addSubTabTarget(
'pays_paypal',
3906 $this->ctrl->getLinkTargetByClass(
'ilobjpaymentsettingsgui',
'paypalSettings'),
3910 $this->
__getSection() == $this->SECTION_PAYPAL ?
true :
false);
3912 $this->tabs_gui->addSubTabTarget(
'pays_epay',
3913 $this->ctrl->getLinkTargetByClass(
'ilobjpaymentsettingsgui',
'epaySettings'),
3917 $this->
__getSection() == $this->SECTION_EPAY ?
true :
false);
3918 $this->tabs_gui->addSubTabTarget(
'pays_erp',
3919 $this->ctrl->getLinkTargetByClass(
'ilobjpaymentsettingsgui',
'erpSettings'),
3923 $this->
__getSection() == $this->SECTION_ERP ?
true :
false);
3929 if(!isset(
$_GET[
'booking_id']))
3932 $this->showStatistics();
3937 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.paya_adm_edit_statistic.html',
'payment');
3938 $this->ctrl->setParameter($this,
'booking_id',(
int)
$_GET[
'booking_id']);
3939 $this->tpl->setCurrentBlock(
'CUSTOMER_DATA');
3942 $bookings = $this->booking_obj->getBookings();
3944 $booking = $bookings[(int) $_GET[
'booking_id']];
3950 $this->tpl->setVariable(
'ALT_IMG_2',$this->lng->txt(
'obj_usr'));
3951 if(is_object($tmp_user))
3953 $this->tpl->setVariable(
'TITLE_2', $tmp_user->getFullname().
' ['.$tmp_user->getLogin().
']');
3957 $this->tpl->setVariable(
'TITLE_2', $this->lng->txt(
'user_deleted'));
3965 $this->tpl->setVariable(
'TXT_OBJECT',$this->lng->txt(
'title'));
3966 $this->tpl->setVariable(
'OBJECT', ($tmp_obj !=
'' ? $tmp_obj : $this->lng->txt(
'object_deleted')));
3968 $this->tpl->setVariable(
'TXT_EMAIL',$this->lng->txt(
'email'));
3969 $this->tpl->setVariable(
'TXT_STREET',$this->lng->txt(
'street'));
3970 $this->tpl->setVariable(
'TXT_PO_BOX',$this->lng->txt(
'pay_bmf_po_box'));
3971 $this->tpl->setVariable(
'TXT_ZIPCODE',$this->lng->txt(
'zipcode'));
3972 $this->tpl->setVariable(
'TXT_CITY',$this->lng->txt(
'city'));
3973 $this->tpl->setVariable(
'TXT_COUNTRY',$this->lng->txt(
'country'));
3975 $email = (!isset($tmp_user)) ? $this->lng->txt(
'user_deleted') : $tmp_user->getEmail();
3976 $this->tpl->setVariable(
'EMAIL',$email);
3977 $this->tpl->setVariable(
'STREET',$booking[
'street']);
3978 $this->tpl->setVariable(
'PO_BOX',$booking[
'po_box']);
3979 $this->tpl->setVariable(
'ZIPCODE',$booking[
'zipcode']);
3980 $this->tpl->setVariable(
'CITY',$booking[
'city']);
3981 $this->tpl->setVariable(
'COUNTRY',$booking[
'country']);
3983 $this->tpl->parseCurrentBlock();
3989 $tpl =& $tbl->getTemplateObject();
3992 $tpl->setCurrentBlock(
'tbl_form_header');
3994 $tpl->setVariable(
'FORMACTION',$this->ctrl->getFormAction($this));
3995 $tpl->parseCurrentBlock();
3999 $tbl->setTitle($this->lng->txt(
'bookings'),
'icon_pays.gif',$this->lng->txt(
'bookings'));
4000 $tbl->setHeaderNames(array($this->lng->txt(
'paya_transaction'),
4001 $this->lng->txt(
'title'),
4002 $this->lng->txt(
'paya_vendor'),
4003 $this->lng->txt(
'paya_customer'),
4004 $this->lng->txt(
'paya_order_date'),
4005 $this->lng->txt(
'duration'),
4006 $this->lng->txt(
'price_a'),
4007 $this->lng->txt(
'paya_coupons_coupons'),
4008 $this->lng->txt(
'paya_payed_access'),
4011 $tbl->setHeaderVars(array(
'transaction',
4021 $this->ctrl->getParameterArray($this,
'statistic',
false));
4024 $offset =
$_GET[
'offset'];
4025 $order =
$_GET[
'sort_by'];
4026 $direction =
$_GET[
'sort_order'] ?
$_GET[
'sort_order'] :
'desc';
4028 $tbl->setOrderColumn($order,
'order_date');
4029 $tbl->setOrderDirection($direction);
4030 $tbl->setOffset($offset);
4031 $tbl->setLimit(
$_GET[
'limit']);
4032 $tbl->setMaxCount(count($a_result_set));
4033 $tbl->setFooter(
'tblfooter',$this->lng->txt(
'previous'),$this->lng->txt(
'next'));
4034 $tbl->setData($a_result_set);
4036 $tpl->setVariable(
'COLUMN_COUNTS',10);
4037 $tpl->setCurrentBlock(
'plain_buttons');
4038 $tpl->setVariable(
'PBTN_NAME',
'exportVendors');
4039 $tpl->setVariable(
'PBTN_VALUE',$this->lng->txt(
'excel_export'));
4040 $tpl->parseCurrentBlock();
4043 $this->tpl->setVariable(
'STATISTIC_TABLE',$tbl->tpl->get());
4050 include_once
'./payment/classes/class.ilPaymentBookings.php';
4058 'editVendorObject' => $this->lng->txt(
'pays_edit_vendor'),
4059 'deleteVendorsObject' => $this->lng->txt(
'pays_delete_vendor')
4063 $tpl =& $tbl->getTemplateObject();
4066 $tpl->setCurrentBlock(
'tbl_form_header');
4068 $tpl->setVariable(
'FORMACTION',$this->ctrl->getFormAction($this));
4069 $tpl->parseCurrentBlock();
4071 $tpl->setCurrentBlock(
'tbl_action_row');
4073 $tpl->setCurrentBlock(
'input_text');
4074 $tpl->setVariable(
'PB_TXT_NAME',
'vendor_login');
4075 $tpl->parseCurrentBlock();
4077 $tpl->setCurrentBlock(
'plain_button');
4078 $tpl->setVariable(
'PBTN_NAME',
'addVendor');
4079 $tpl->setVariable(
'PBTN_VALUE',$this->lng->txt(
'pays_add_vendor'));
4080 $tpl->parseCurrentBlock();
4081 $tpl->setCurrentBlock(
'plain_buttons');
4082 $tpl->parseCurrentBlock();
4084 $tpl->setVariable(
'COLUMN_COUNTS',4);
4088 $tpl->setCurrentBlock(
'tbl_action_select');
4090 $tpl->setVariable(
'BTN_NAME',
'gateway');
4091 $tpl->setVariable(
'BTN_VALUE',$this->lng->txt(
'execute'));
4092 $tpl->parseCurrentBlock();
4093 $tpl->setCurrentBlock(
'tbl_action_row');
4094 $tpl->setVariable(
'TPLPATH',$this->tpl->tplPath);
4095 $tpl->parseCurrentBlock();
4097 $tbl->setTitle($this->lng->txt(
'vendors'),
'icon_usr.gif',$this->lng->txt(
'vendors'));
4098 $tbl->setHeaderNames(array(
'',
4099 $this->lng->txt(
'pays_vendor'),
4100 $this->lng->txt(
'pays_cost_center'),
4101 $this->lng->txt(
'pays_number_bookings')));
4102 $tbl->setHeaderVars(array(
'',
4106 array(
'ref_id' => $this->object->getRefId(),
4108 'update_members' => 1,
4109 'baseClass' =>
'ilAdministrationGUI',
4110 'cmdClass' =>
'ilobjpaymentsettingsgui',
4111 'cmdNode' =>
$_GET[
'cmdNode']));
4112 # $tbl->setColumnWidth(array('4%','48%','25%','24%'));
4114 $tpl->setVariable(
'COLUMN_COUNTS',9);
4115 $tpl->setCurrentBlock(
'plain_buttons');
4116 $tpl->setVariable(
'PBTN_NAME',
'exportVendors');
4117 $tpl->setVariable(
'PBTN_VALUE',$this->lng->txt(
'excel_export'));
4118 $tpl->parseCurrentBlock();
4123 $this->tpl->setVariable(
'VENDOR_TABLE',$tbl->tpl->get());
4132 $tpl =& $tbl->getTemplateObject();
4136 $tpl->setCurrentBlock(
'tbl_form_header');
4137 $tpl->setVariable(
'FORMACTION',$this->ctrl->getFormAction($this));
4138 $tpl->parseCurrentBlock();
4140 $tpl->setCurrentBlock(
'tbl_action_btn');
4141 $tpl->setVariable(
'BTN_NAME',
'addUser');
4142 $tpl->setVariable(
'BTN_VALUE',$this->lng->txt(
'add'));
4143 $tpl->parseCurrentBlock();
4145 $tpl->setCurrentBlock(
'tbl_action_btn');
4146 $tpl->setVariable(
'BTN_NAME',
'vendors');
4147 $tpl->setVariable(
'BTN_VALUE',$this->lng->txt(
'cancel'));
4148 $tpl->parseCurrentBlock();
4150 $tpl->setCurrentBlock(
'tbl_action_row');
4151 $tpl->setVariable(
'COLUMN_COUNTS',5);
4153 $tpl->parseCurrentBlock();
4155 $tbl->setTitle($this->lng->txt(
'pays_header_select_vendor'),
'icon_usr.gif',$this->lng->txt(
'pays_header_select_vendor'));
4156 $tbl->setHeaderNames(array(
'',
4157 $this->lng->txt(
'login'),
4158 $this->lng->txt(
'firstname'),
4159 $this->lng->txt(
'lastname')));
4160 $tbl->setHeaderVars(array(
'',
4164 array(
'ref_id' => $this->object->getRefId(),
4166 'cmdClass' =>
'ilobjpaymentsettingsgui',
4167 'cmdNode' =>
$_GET[
'cmdNode']));
4169 $tbl->setColumnWidth(array(
'3%',
'32%',
'32%',
'32%'));
4174 $this->tpl->setVariable(
'SEARCH_RESULT_TABLE',$tbl->tpl->get());
4181 $this->tpl->addBlockfile(
'BUTTONS',
'buttons',
'tpl.buttons.html');
4184 $this->tpl->setCurrentBlock(
'btn_cell');
4185 $this->tpl->setVariable(
'BTN_LINK',$this->ctrl->getLinkTarget($this,$a_cmd));
4186 $this->tpl->setVariable(
'BTN_TXT',$a_text);
4189 $this->tpl->setVariable(
'BTN_TARGET',$a_target);
4192 $this->tpl->parseCurrentBlock();
4197 include_once
'./Services/Table/classes/class.ilTableGUI.php';
4204 $offset =
$_GET[
'offset'];
4205 $order =
$_GET[
'sort_by'];
4206 $direction =
$_GET[
'sort_order'];
4208 $tbl->setOrderColumn($order);
4209 $tbl->setOrderDirection($direction);
4210 $tbl->setOffset($offset);
4211 $tbl->setLimit(
$_GET[
'limit']);
4212 $tbl->setMaxCount(count($result_set));
4213 $tbl->setFooter(
'tblfooter',$this->lng->txt(
'previous'),$this->lng->txt(
'next'));
4214 $tbl->setData($result_set);
4219 include_once(
'./classes/class.ilSearch.php');
4221 $this->lng->loadLanguageModule(
'content');
4224 $search->setPerformUpdate(
false);
4226 $search->setCombination(
'and');
4227 $search->setSearchFor(array(0 =>
'usr'));
4228 $search->setSearchType(
'new');
4230 if($search->validate($message))
4232 $search->performSearch();
4237 $this->ctrl->redirect($this,
'searchUser');
4239 return $search->getResultByType(
'usr');
4244 include_once(
'./classes/class.ilSearch.php');
4246 $this->lng->loadLanguageModule(
'content');
4248 $search =&
new ilSearch($this->user_obj->getId());
4251 $search->setCombination(
'and');
4252 $search->setSearchFor(array(0 =>
'usr'));
4253 $search->setSearchType(
'new');
4255 if($search->validate($message))
4257 $search->performSearchSPObject();
4262 $this->ctrl->redirect($this,
'searchUserSP');
4264 return $search->getResultByType(
'usr');
4269 $tpl =& $tbl->getTemplateObject();
4273 $tpl->setCurrentBlock(
'tbl_form_header');
4274 $this->ctrl->setParameter($this,
'sell_id',
$_GET[
'sell_id']);
4275 $tpl->setVariable(
'FORMACTION',$this->ctrl->getFormAction($this));
4276 $tpl->parseCurrentBlock();
4278 $tpl->setCurrentBlock(
'tbl_action_btn');
4279 $tpl->setVariable(
'BTN_NAME',
'addCustomer');
4280 $tpl->setVariable(
'BTN_VALUE',$this->lng->txt(
'add'));
4281 $tpl->parseCurrentBlock();
4283 $tpl->setCurrentBlock(
'tbl_action_btn');
4284 $tpl->setVariable(
'BTN_NAME',
'statistic');
4285 $tpl->setVariable(
'BTN_VALUE',$this->lng->txt(
'cancel'));
4286 $tpl->parseCurrentBlock();
4288 $tpl->setCurrentBlock(
'tbl_action_row');
4289 $tpl->setVariable(
'COLUMN_COUNTS',5);
4291 $tpl->parseCurrentBlock();
4293 $tbl->setTitle($this->lng->txt(
'users'),
'icon_usr.gif',$this->lng->txt(
'crs_header_edit_members'));
4294 $tbl->setHeaderNames(array(
'',
4295 $this->lng->txt(
'login'),
4296 $this->lng->txt(
'firstname'),
4297 $this->lng->txt(
'lastname')));
4298 $this->ctrl->setParameter($this,
'cmd',
'addCustomer');
4299 $header_params = $this->ctrl->getParameterArray($this,
'');
4300 $tbl->setHeaderVars(array(
'',
4303 'lastname'), $header_params);
4310 $tbl->setColumnWidth(array(
'3%',
'32%',
'32%',
'32%'));
4315 $this->tpl->setVariable(
'SEARCH_RESULT_TABLE',$tbl->tpl->get());
4322 include_once
'./Services/Table/classes/class.ilTableGUI.php';
4329 $offset =
$_GET[
'offset'];
4330 $order =
$_GET[
'sort_by'];
4331 $direction =
$_GET[
'sort_order'];
4333 $tbl->setOrderColumn($order,$a_default_order_column);
4334 $tbl->setOrderDirection($direction);
4335 $tbl->setOffset($offset);
4336 $tbl->setLimit(
$_GET[
'limit']);
4337 $tbl->setMaxCount(count($result_set));
4338 $tbl->setFooter(
'tblfooter',$this->lng->txt(
'previous'),$this->lng->txt(
'next'));
4339 $tbl->setData($result_set);
4346 if(!$ilAccess->checkAccess(
'read',
'', $this->object->getRefId()))
4348 $this->ilias->raiseError($this->lng->txt(
'msg_no_perm_read'), $this->ilias->error_obj->MESSAGE);
4351 include_once
'Services/Table/classes/class.ilTable2GUI.php';
4353 $tbl->setId(
'pay_vats_tbl');
4354 $tbl->setFormAction($this->ctrl->getFormAction($this),
'createVat');
4355 $tbl->setTitle($this->lng->txt(
'payment_tax_rates'));
4356 $tbl->setRowTemplate(
'tpl.shop_vats_list_row.html',
'Services/Payment');
4358 $tbl->setDefaultOrderField(
'title');
4362 $tbl->addColumn(
'',
'check',
'1%');
4363 $tbl->addColumn($this->lng->txt(
'vat_title'),
'vat_title',
'33%');
4364 $tbl->addColumn($this->lng->txt(
'vat_rate'),
'vat_rate',
'33%');
4365 $tbl->addColumn(
'',
'commands',
'33%');
4368 $oShopVatsList->read();
4372 if($oShopVatsList->hasItems())
4374 $tbl->enable(
'select_all');
4375 $tbl->setSelectAllCheckbox(
'vat_id');
4378 foreach($oShopVatsList as $oVAT)
4381 $result[$counter][
'vat_title'] = $oVAT->getTitle();
4383 $this->ctrl->setParameter($this,
'vat_id', $oVAT->getId());
4384 $result[$counter][
'edit_text'] = $this->lng->txt(
'edit');
4385 $result[$counter][
'edit_url'] = $this->ctrl->getLinkTarget($this,
'editVat');
4386 $result[$counter][
'delete_text'] = $this->lng->txt(
'delete');
4387 $result[$counter][
'delete_url'] = $this->ctrl->getLinkTarget($this,
'confirmDeleteVat');
4388 $this->ctrl->clearParameters($this);
4392 $tbl->addMultiCommand(
'confirmDeleteVat', $this->lng->txt(
'delete'));
4396 $tbl->disable(
'header');
4397 $tbl->disable(
'footer');
4399 $tbl->setNoEntriesText($this->lng->txt(
'paya_no_vats_assigned'));
4404 $tbl->addCommandButton(
'createVat', $this->lng->txt(
'paya_insert_vats'));
4406 $this->tpl->setContent($tbl->getHTML());
4413 if((
int)
$_GET[
'vat_id'] && !isset(
$_POST[
'vat_id']))
4418 include_once
'Services/Utilities/classes/class.ilConfirmationGUI.php';
4420 $c_gui->setFormAction($this->ctrl->getFormAction($this,
'performDeleteVat'));
4421 $c_gui->setHeaderText($this->lng->txt(
'paya_sure_delete_vats'));
4422 $c_gui->setCancel($this->lng->txt(
'cancel'),
'vats');
4423 $c_gui->setConfirm($this->lng->txt(
'confirm'),
'performDeleteVat');
4426 foreach((array)
$_POST[
'vat_id'] as $vat_id)
4431 $c_gui->addItem(
'vat_id[]', $oVAT->getId(), $oVAT->getTitle());
4443 return $this->tpl->setContent($c_gui->getHTML());
4453 if(!is_array(
$_POST[
'vat_id']))
4458 foreach(
$_POST[
'vat_id'] as $vat_id)
4479 $this->tpl->setContent($this->form->getHtml());
4486 $this->tpl->setContent($this->form->getHtml());
4491 include_once
'Services/Form/classes/class.ilPropertyFormGUI.php';
4494 if($a_type ==
'edit')
4496 $this->ctrl->setParameter($this,
'vat_id',
$_GET[
'vat_id']);
4497 $this->form->setFormAction($this->ctrl->getFormAction($this,
'updateVat'));
4498 $this->form->setTitle($this->lng->txt(
'payment_edit_vat'));
4502 $this->form->setFormAction($this->ctrl->getFormAction($this,
'saveVat'));
4503 $this->form->setTitle($this->lng->txt(
'payment_add_vat'));
4506 $oTitle =
new ilTextInputGUI($this->lng->txt(
'title'),
'vat_title');
4508 $oTitle->setSize(40);
4509 $oTitle->setRequired(
true);
4510 $oTitle->setInfo($this->lng->txt(
'payment_vat_title_info'));
4511 $this->form->addItem($oTitle);
4513 $oRate =
new ilTextInputGUI($this->lng->txt(
'vat_rate'),
'vat_rate');
4516 $oRate->setRequired(
true);
4517 $oRate->setInfo($this->lng->txt(
'payment_vat_rate_info'));
4518 $this->form->addItem($oRate);
4520 if($a_type ==
'edit')
4522 $this->form->addCommandButton(
'updateVat', $this->lng->txt(
'save'));
4526 $this->form->addCommandButton(
'saveVat', $this->lng->txt(
'save'));
4529 $this->form->addCommandButton(
'vats', $this->lng->txt(
'cancel'));
4537 $this->form->setValuesByArray(array(
4538 'vat_title' => $oVAT->getTitle(),
4539 'vat_rate' => $oVAT->getRate()
4546 if(!$this->form->checkInput())
4548 $this->form->setValuesByPost();
4549 return $this->tpl->setContent($this->form->getHtml());
4554 $this->form->getItemByPostVar(
'vat_rate')->setAlert($this->lng->txt(
'payment_vat_input_invalid'));
4555 $this->form->setValuesByPost();
4556 return $this->tpl->setContent($this->form->getHtml());
4562 $oVAT->setTitle($this->form->getInput(
'vat_title'));
4563 $oVAT->setRate((
float)str_replace(
',',
'.', $this->form->getInput(
'vat_rate')));
4569 $this->form->setValuesByPost();
4570 return $this->tpl->setContent($this->form->getHtml());
4580 if(!$this->form->checkInput())
4582 $this->form->setValuesByPost();
4583 return $this->tpl->setContent($this->form->getHtml());
4588 $this->form->getItemByPostVar(
'vat_rate')->setAlert($this->lng->txt(
'payment_vat_input_invalid'));
4589 $this->form->setValuesByPost();
4590 return $this->tpl->setContent($this->form->getHtml());
4596 $oVAT->setTitle($this->form->getInput(
'vat_title'));
4597 $oVAT->setRate((
float)str_replace(
',',
'.', $this->form->getInput(
'vat_rate')));
4603 $this->form->setValuesByPost();
4604 return $this->tpl->setContent($this->form->getHtml());
4617 include_once
'./payment/classes/class.ilPaymentBookings.php';
4618 include_once
'./payment/classes/class.ilPayMethods.php';
4622 foreach(
$_POST[
'pm'] as $pm)
4653 $del_bookings = $this->booking_obj->deleteAddressesByPaymethod((
int)
$pay_method);