19 require_once
'./Services/Object/classes/class.ilObjectGUI.php';
20 include_once
'./Services/Payment/classes/class.ilShopVatsList.php';
21 include_once
'./Services/Payment/classes/class.ilPaymentPrices.php';
22 include_once
'./Services/Payment/classes/class.ilPaymentObject.php';
23 include_once
'./Services/Payment/classes/class.ilFileDataShop.php';
24 include_once
'./Services/Form/classes/class.ilPropertyFormGUI.php';
25 include_once
'./Services/Utilities/classes/class.ilConfirmationGUI.php';
26 include_once
'./Services/Payment/classes/class.ilPaymentBookings.php';
27 include_once
'./Services/Payment/classes/class.ilPaymentSettings.php';
28 include_once
'./Services/Payment/classes/class.ilPaymentCurrency.php';
29 include_once
'./Services/Payment/classes/class.ilShopTableGUI.php';
30 include_once
'./Services/Payment/classes/class.ilInvoiceNumberPlaceholdersPropertyGUI.php';
31 include_once
'./Services/Payment/classes/class.ilUserDefinedInvoiceNumber.php';
32 include_once
'./Services/Search/classes/class.ilRepositorySearchGUI.php';
33 include_once
'./Services/Payment/classes/class.ilPaymentObjectSelector.php';
77 public function __construct($a_data, $a_id, $a_call_by_reference, $a_prepare_output =
true)
90 $this->
ilObjectGUI($a_data,$a_id,$a_call_by_reference,$a_prepare_output);
92 $this->lng->loadLanguageModule(
'payment');
98 $check = $this->genSetData->get(
'currency_unit');
102 return $this->generalSettingsObject();
105 $check = $this->genSetData->get(
'address');
109 return $this->generalSettingsObject();
112 $check = $this->genSetData->get(
'bank_data');
116 return $this->generalSettingsObject();
119 $check = $this->genSetData->get(
'pdf_path');
123 return $this->generalSettingsObject();
127 $pm_array = ilPaymethods::_getActivePaymethods();
129 if(count($pm_array) == 0)
136 foreach($pm_array as $paymethod)
138 switch($paymethod[
'pm_title'])
141 $check = unserialize($this->genSetData->get(
'bmf'));
142 if ($check[
'mandantNr'] ==
'' ||
143 $check[
'bewirtschafterNr'] ==
'' ||
144 $check[
'haushaltsstelle'] ==
'' ||
145 $check[
'objektNr'] ==
'' ||
146 $check[
'kennzeichenMahnverfahren'] ==
'' ||
147 $check[
'waehrungskennzeichen'] ==
'' ||
148 $check[
'ePaymentServer'] ==
'' ||
149 $check[
'clientCertificate'] ==
'' ||
150 $check[
'caCertificate'] ==
'' ||
151 $check[
'timeOut'] ==
'')
154 $this->bmfSettingsObject();
160 $check = unserialize($this->genSetData->get(
'paypal'));
161 if ($check[
'server_host'] ==
'' ||
162 $check[
'server_path'] ==
'' ||
163 $check[
'vendor'] ==
'' ||
164 $check[
'auth_token'] ==
'')
167 $this->paypalSettingsObject();
177 include_once
'./Services/Payment/classes/class.ilShopVats.php';
179 if(count($check) == 0)
186 $vendors = $this->vendors_obj->getVendors();
188 if(count($vendors) == 0)
197 $this->generalSettingsObject();
204 $next_class = $this->ctrl->getNextClass($this);
205 $cmd = $this->ctrl->getCmd();
217 $ilToolbar->addButton($this->lng->txt(
'check_shop_activation'),$this->ctrl->getLinkTarget($this,
'checkShopActivation'));
219 $this->
getTabs($this->tabs_gui);
223 case 'ilrepositorysearchgui':
224 include_once(
'./Services/Search/classes/class.ilRepositorySearchGUI.php');
227 $rep_search->setCallback($this,
228 'addVendorObject', array()
231 $this->ctrl->setReturn($this,
'vendors');
232 $ret =& $this->ctrl->forwardCommand($rep_search);
235 case 'ilpermissiongui':
236 include_once(
'Services/AccessControl/classes/class.ilPermissionGUI.php');
238 $ret = $this->ctrl->forwardCommand($perm_gui);
241 case 'ilshoppagegui':
242 if(
$cmd ==
'TermsConditions')
249 $ret = $this->forwardToPageObject();
253 $this->tpl->setContent(
$ret);
257 case 'ilshoptopicsgui':
258 include_once
'./Services/Payment/classes/class.ilShopTopicsGUI.php';
261 $ret = $this->ctrl->forwardCommand($topics_gui);
268 $cmd =
'generalSettings';
273 case 'saveGeneralSettings' :
274 case 'generalSettings' :
275 $this->tabs_gui->setTabActive(
'settings');
276 $this->
getSubTabs(
'settings',
'generalSettings');
279 case 'savePayMethods':
280 $this->tabs_gui->setTabActive(
'pay_methods');
281 $this->
getSubTabs(
'payMethods',
'payMethods');
283 case 'saveBmfSettings' :
284 case 'bmfSettings' : $this->tabs_gui->setTabActive(
'pay_methods');
285 $this->
getSubTabs(
'payMethods',
'bmfSettings');
287 case 'savePaypalSettings' :
288 case 'paypalSettings' :
289 $this->tabs_gui->setTabActive(
'pay_methods');
290 $this->
getSubTabs(
'payMethods',
'paypalSettings');
297 case 'performDeleteVat':
298 case 'confirmDeleteVat':
302 case 'vats' : $this->tabs_gui->setTabActive(
'vats');
306 #TODO: CURRENCY not finished yet
309 # case 'performDeleteCurrency':
310 case 'updateCurrency':
311 # if($_POST['action'] == 'editCurrency' || $_POST['action'] == 'deleteCurrency')
312 # $cmd = $_POST['action'];
313 $this->tabs_gui->setTabActive(
'currencies');
316 case 'StatutoryRegulations':
317 case 'saveStatutoryRegulations':
318 $this->active_sub_tab =
'statutory_regulations';
319 $this->tabs_gui->setTabActive(
'documents');
320 $this->
getSubTabs(
'documents',
'statutory_regulations');
322 case 'TermsConditions':
324 $this->active_sub_tab =
'terms_conditions';
325 $this->tabs_gui->setTabActive(
'documents');
326 $this->
getSubTabs(
'documents',
'terms_conditions');
328 $cmd =
'TermsConditions';
331 case 'saveBillingMail':
332 $this->active_sub_tab =
'billing_mail';
333 $this->tabs_gui->setTabActive(
'documents');
334 $this->
getSubTabs(
'documents',
'billing_mail');
336 # $cmd = 'BillingMail';
338 case 'InvoiceNumber':
339 case 'saveInvoiceNumber':
340 $this->active_sub_tab =
'invoice_number';
341 $this->tabs_gui->setTabActive(
'documents');
342 $this->
getSubTabs(
'documents',
'invoice_number');
344 #$cmd = 'InvoiceNumber';
346 case 'checkShopActivation':
358 public function forwardToPageObject()
365 if(isset(
$_GET[
'pobject_id']) &&
$_GET[
'pobject_id'] > 0)
367 $this->ctrl->setParameter($this,
'pobject_id', (
int)
$_GET[
'pobject_id']);
369 $this->lng->loadLanguageModule(
'content');
371 $ilTabs->clearTargets();
372 $ilTabs->clearSubTabs();
373 $ilTabs->setBackTarget($this->lng->txt(
'back'), $this->ctrl->getLinkTarget($this,
'editDetails'));
375 include_once
'Services/Payment/classes/class.ilShopPage.php';
376 include_once
'Services/Payment/classes/class.ilShopPageGUI.php';
377 include_once(
'./Services/Style/classes/class.ilObjStyleSheet.php');
385 $new_page_object->setParentId(0);
386 $new_page_object->setId($this->pobject->getPobjectId());
387 $new_page_object->createFromXML();
390 $this->ctrl->setReturnByClass(
'ilshoppagegui',
'edit');
392 if(!(
int)$_GET[
'pobject_id'])
397 $this->ctrl->setParameter($this,
'pobject_id', (
int)$_GET[
'pobject_id']);
400 $page_gui =
new ilShopPageGUI((
int)$this->pobject->getPobjectId());
401 $this->ctrl->setParameter($page_gui,
'pobject_id', (
int)$_GET[
'pobject_id']);
411 $ilTabs->clearTargets();
412 $ilTabs->setBackTarget($lng->txt(
'back'), $this->ctrl->getLinkTarget($this),
'_top');
415 include_once
'Services/Payment/classes/class.ilShopPage.php';
416 include_once
'Services/Payment/classes/class.ilShopPageGUI.php';
418 $lng->loadLanguageModule(
'content');
420 include_once(
'./Services/Style/classes/class.ilObjStyleSheet.php');
427 $new_page_object->setParentId(0);
428 $new_page_object->setId(self::CONDITIONS_EDITOR_PAGE_ID);
429 $new_page_object->createFromXML();
432 $this->ctrl->setReturnByClass(
'ilshoppagegui',
'edit');
434 $page_gui =
new ilShopPageGUI(self::CONDITIONS_EDITOR_PAGE_ID);
437 return $this->ctrl->forwardCommand($page_gui);
440 public function saveBmfSettingsObject()
448 if(!$rbacsystem->checkAccess(
'read', $this->object->getRefId()))
450 $this->ilErr->raiseError($this->lng->txt(
'msg_no_perm_read'),$this->ilErr->MESSAGE);
453 include_once
'./Services/Payment/classes/class.ilBMFSettings.php';
472 if (
$_POST[
'mandantNr'] ==
'' ||
473 $_POST[
'bewirtschafterNr'] ==
'' ||
474 $_POST[
'haushaltsstelle'] ==
'' ||
475 $_POST[
'objektNr'] ==
'' ||
476 $_POST[
'kennzeichenMahnverfahren'] ==
'' ||
477 $_POST[
'waehrungskennzeichen'] ==
'' ||
478 $_POST[
'ePaymentServer'] ==
'' ||
479 $_POST[
'clientCertificate'] ==
'' ||
480 $_POST[
'caCertificate'] ==
'' ||
483 $this->error = $this->lng->txt(
'pays_bmf_settings_not_valid');
485 $this->bmfSettingsObject();
491 $this->bmfSettingsObject();
498 public function bmfSettingsObject()
506 if(!$rbacsystem->checkAccess(
'read', $this->object->getRefId()))
508 $this->ilErr->raiseError($this->lng->txt(
'msg_no_perm_read'),$this->ilErr->MESSAGE);
510 include_once
'./Services/Payment/classes/class.ilBMFSettings.php';
513 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.main_view.html',
'Services/Payment');
521 $form->setFormAction($this->ctrl->getFormAction($this,
'saveBmfSettings'));
522 $form->setTitle($this->lng->txt(
'pays_bmf_settings'));
524 $form->addCommandButton(
'saveBmfSettings',$this->lng->txt(
'save'));
526 $formItem =
new ilTextInputGUI($this->lng->txt(
'pays_bmf_client_id'),
'mandantNr');
527 $formItem->
setValue($bmfSetObj->getClientId());
528 $form->addItem($formItem);
530 $formItem =
new ilTextInputGUI($this->lng->txt(
'pays_bmf_bewirtschafter_nr'),
'bewirtschafterNr');
531 $formItem->
setValue($bmfSetObj->getBewirtschafterNr());
532 $form->addItem($formItem);
534 $formItem =
new ilTextInputGUI($this->lng->txt(
'pays_bmf_haushaltsstelle'),
'haushaltsstelle');
535 $formItem->
setValue($bmfSetObj->getHaushaltsstelle());
536 $form->addItem($formItem);
538 $formItem =
new ilTextInputGUI($this->lng->txt(
'pays_bmf_object_id'),
'objektNr');
539 $formItem->
setValue($bmfSetObj->getObjectId());
540 $form->addItem($formItem);
542 $formItem =
new ilTextInputGUI($this->lng->txt(
'pays_bmf_kennzeichen_mahnverfahren'),
'kennzeichenMahnverfahren');
543 $formItem->
setValue($bmfSetObj->getKennzeichenMahnverfahren());
544 $form->addItem($formItem);
546 $formItem =
new ilTextInputGUI($this->lng->txt(
'pays_bmf_waehrungskennzeichen'),
'waehrungskennzeichen');
547 $formItem->
setValue($bmfSetObj->getWaehrungsKennzeichen());
548 $form->addItem($formItem);
550 $formItem =
new ilTextInputGUI($this->lng->txt(
'pays_bmf_epayment_server'),
'ePaymentServer');
551 $formItem->
setValue($bmfSetObj->getEpaymentServer());
552 $form->addItem($formItem);
554 $formItem =
new ilTextInputGUI($this->lng->txt(
'pays_bmf_client_certificate'),
'clientCertificate');
555 $formItem->
setValue($bmfSetObj->getClientCertificate());
556 $form->addItem($formItem);
558 $formItem =
new ilTextInputGUI($this->lng->txt(
'pays_bmf_ca_certificate'),
'caCertificate');
559 $formItem->
setValue($bmfSetObj->getCaCertificate());
560 $form->addItem($formItem);
562 $formItem =
new ilTextInputGUI($this->lng->txt(
'pays_bmf_timeout'),
'timeOut');
563 $formItem->
setValue($bmfSetObj->getTimeOut());
564 $form->addItem($formItem);
566 $this->tpl->setVariable(
'FORM',
$form->getHTML());
573 if(!$_GET[
'pobject_id'])
577 $this->objectObjects();
582 $this->ctrl->setParameter($this,
'pobject_id',(
int) $_GET[
'pobject_id']);
585 $old_status = $this->pobject->getStatus();
588 if($old_status == $this->pobject->STATUS_NOT_BUYABLE and
589 (
int)
$_POST[
'status'] != $old_status)
592 switch((
int)
$_POST[
'pay_method'])
594 case $this->pobject->PAY_METHOD_NOT_SPECIFIED:
604 $standard_prices = array();
605 $standard_prices = $prices_obj->getPrices();
607 if(!count($standard_prices))
616 $this->pobject->setStatus((
int)
$_POST[
'status']);
617 $this->pobject->setVendorId((
int) $_POST[
'vendor']);
618 $this->pobject->setPayMethod((
int) $_POST[
'pay_method']);
619 $this->pobject->setTopicId((
int) $_POST[
'topic_id']);
620 $this->pobject->setVatId((
int) $_POST[
'vat_id']);
622 $this->pobject->update();
630 public function editPricesObject($a_show_delete =
false)
637 if($a_show_delete ==
false) unset(
$_SESSION[
'price_ids']);
641 if(!$_GET[
'pobject_id'])
648 $this->ctrl->setParameter($this,
'pobject_id',(
int) $_GET[
'pobject_id']);
650 $ilToolbar->addButton($this->lng->txt(
'back'), $this->ctrl->getLinkTarget($this,
'objects'));
651 $ilToolbar->addButton($this->lng->txt(
'paya_edit_details'), $this->ctrl->getLinkTarget($this,
'editDetails'));
652 $ilToolbar->addButton($this->lng->txt(
'paya_edit_prices'), $this->ctrl->getLinkTarget($this,
'editPrices'));
653 $ilToolbar->addButton($this->lng->txt(
'pay_edit_abstract'), $this->ctrl->getLinkTargetByClass(array(
'ilshoppagegui'),
'edit'));
657 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.main_view.html',
'Services/Payment');
660 $standard_prices = array();
661 $extension_prices = array();
662 $standard_prices = $price_obj->getPrices();
663 $extension_prices = $price_obj->getExtensionPrices();
665 $prices = array_merge($standard_prices, $extension_prices );
672 $ilToolbar->addButton($this->lng->txt(
'paya_add_price'), $this->ctrl->getLinkTarget($this,
'addPrice'));
682 $oConfirmationGUI->setFormAction($this->ctrl->getFormAction($this,
"performDeletePrice"));
683 $oConfirmationGUI->setHeaderText($this->lng->txt(
"paya_sure_delete_selected_prices"));
684 $oConfirmationGUI->setCancel($this->lng->txt(
"cancel"),
"editPrices");
685 $oConfirmationGUI->setConfirm($this->lng->txt(
"confirm"),
"performDeletePrice");
687 foreach($prices as $price)
692 if(in_array($price[
'price_id'],
$_SESSION[
'price_ids']))
694 switch($price[
'price_type'])
697 include_once
'./Services/Calendar/classes/class.ilDatePresentation.php';
703 $tmp_price = $price[
'duration'].
' '.$this->lng->txt(
'paya_months');
707 $tmp_price = $this->lng->txt(
'unlimited_duration');
711 $delete_row .=
''.$tmp_price.
' -> '.
713 $this->genSetData->get(
'currency_unit');
715 $oConfirmationGUI->addItem(
'',$delete_row, $delete_row);
719 $this->tpl->setVariable(
'CONFIRMATION', $oConfirmationGUI->getHTML());
731 $tpl->setCurrentBlock(
'tbl_form_header');
733 $tpl->setVariable(
'FORMACTION',$this->ctrl->getFormAction($this));
734 $tpl->parseCurrentBlock();
738 foreach($prices as $price)
740 $data[$counter][
'price_id'] = ilUtil::formCheckBox(in_array($price[
'price_id'],
$_SESSION[
'price_ids']) ? 1 : 0,
741 'price_ids[]', $price[
'price_id']);
743 switch($price[
'price_type'])
746 $data[$counter][
'duration'] = $price[
'duration'].
' '.$this->lng->txt(
'paya_months');
754 $data[$counter][
'duration'] = $this->lng->txt(
'unlimited_duration');
758 $data[$counter][
'currency_unit'] = $this->genSetData->get(
'currency_unit');
759 $data[$counter][
'extension'] = ilUtil::formCheckBox($price[
'extension'] ? 1 : 0,
760 'extension_ids[]', (
int)$price[
'price_id'],
true);
762 $this->ctrl->setParameter($this,
"price_id",$price[
'price_id']);
763 $data[$counter][
'edit'] =
764 "<div class=\"il_ContainerItemCommands\"><a class=\"il_ContainerItemCommand\" href=\"".$this->ctrl->getLinkTarget($this,
"editPrice").
"\">".$this->lng->txt(
"edit").
"</a></div>";
775 $this->ctrl->setParameter($this,
'cmd',
'editprices');
781 $tbl->setTitle($tmp_obj->getTitle());
785 $tbl->setTitle($this->lng->txt(
'object_not_found'));
788 $tbl->setId(
'tbl_bookings');
789 $tbl->setRowTemplate(
"tpl.shop_prices_row.html",
"Services/Payment");
791 $tbl->addColumn(
' ',
'price_id',
'5%');
792 $tbl->addColumn($this->lng->txt(
'duration'),
'duration',
'40%');
793 $tbl->addColumn($this->lng->txt(
'price_a'),
'price',
'1%');
794 $tbl->addColumn($this->lng->txt(
'currency'),
'currency_unit',
'10%');
795 $tbl->addColumn($this->lng->txt(
'extension_price'),
'extension',
'10%');
796 $tbl->addColumn(
'',
'edit',
'30%' );
798 $tbl->setSelectAllCheckbox(
'price_id');
799 $tbl->addCommandButton(
'addPrice',$this->lng->txt(
'paya_add_price'));
801 $tbl->addMultiCommand(
"deletePrice", $this->lng->txt(
"paya_delete_price"));
804 $tbl->setData($a_result_set);
806 $this->tpl->setVariable(
'TABLE', $tbl->getHTML());
811 public function addPriceObject()
818 if(!$_GET[
'pobject_id'])
830 $this->ctrl->setParameter($this,
'pobject_id',(
int) $_GET[
'pobject_id']);
834 $ilToolbar->addButton($this->lng->txt(
'paya_edit_details'), $this->ctrl->getLinkTarget($this,
'editDetails'));
835 $ilToolbar->addButton($this->lng->txt(
'paya_edit_prices'), $this->ctrl->getLinkTarget($this,
'editPrices'));
836 $ilToolbar->addButton($this->lng->txt(
'pay_edit_abstract'), $this->ctrl->getLinkTargetByClass(array(
'ilshoppagegui'),
'edit'));
839 if(is_object($tmp_obj))
841 $tmp_object[
'title'] = $tmp_obj->getTitle();
845 $tmp_object[
'title'] = $this->lng->txt(
'object_not_found');
847 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.main_view.html',
'Services/Payment');
850 $form->setFormAction($this->ctrl->getFormAction($this));
851 $form->setTitle($this->lng->txt(
'paya_add_price_title'));
856 $oTitle->
setValue($tmp_object[
'title']);
857 $form->addItem($oTitle);
862 $radio_group->setTitle($this->lng->txt(
'duration'));
863 $radio_group->setRequired(
true);
864 $radio_group->setValue(
$_POST[
'price_type']);
865 $radio_group->setPostVar(
'price_type');
867 $radio_option_1 =
new ilRadioOption($this->lng->txt(
'duration_month'),
'duration_month');
871 $oDuration->
setTitle($this->lng->txt(
'paya_months'));
872 $oDuration->setSize(
'30%');
874 $oDuration->setPostVar(
'duration_month');
877 $radio_group->addOption($radio_option_1);
879 $radio_option_3 =
new ilRadioOption($this->lng->txt(
'duration_date'),
'duration_date');
883 $o_date_from->
setTitle($this->lng->txt(
'cal_from'));
884 $o_date_from->setPostVar(
'duration_date_from');
889 $o_date_until->setTitle($this->lng->txt(
'cal_until'));
890 $o_date_until->setPostVar(
'duration_date_until');
891 $radio_option_3->addSubItem($o_date_until);
893 $radio_group->addOption($radio_option_3);
895 $radio_option_2 =
new ilRadioOption($this->lng->txt(
'unlimited_duration'),
'unlimited_duration');
896 $radio_group->addOption($radio_option_2);
898 $form->addItem($radio_group);
901 $oDescription =
new ilTextAreaInputGUI($this->lng->txt(
'description'),
'description');
903 $oDescription->setCols(35);
904 $oDescription->setValue(
$_POST[
'description']);
905 $form->addItem($oDescription);
909 $oPrice->setTitle($this->lng->txt(
'price_a'));
910 $oPrice->setValue(
$_POST[
'price']);
911 $oPrice->setPostVar(
'price');
912 $oPrice->setRequired(
true);
913 $oPrice->allowDecimals(
true);
914 $form->addItem($oPrice);
919 #TODO: CURRENCY not finished yet
935 $currency_options = $genSet->get(
'currency_unit');
937 $oCurrency->
setValue($currency_options);
938 $form->addItem($oCurrency);
942 $oExtension =
new ilCheckboxInputGUI($this->lng->txt(
'extension_price'),
'extension');
945 $form->addItem($oExtension);
947 $form->addCommandButton(
'performAddPrice',$this->lng->txt(
'paya_add_price'));
948 $form->addCommandButton(
'editPrices', $this->lng->txt(
'cancel'));
949 $this->tpl->setVariable(
'FORM',
$form->getHTML());
958 switch($_POST[
'price_type'])
960 case 'unlimited_duration':
963 $po->setDurationFrom(NULL);
964 $po->setDurationUntil(NULL);
965 $po->setUnlimitedDuration(1);
969 case 'duration_date':
972 $po->setDuration(NULL);
974 $_POST[
'duration_date_from'][
'date'][
'y'].
'-'.
975 $_POST[
'duration_date_from'][
'date'][
'm'].
'-'.
976 $_POST[
'duration_date_from'][
'date'][
'd']));
978 $_POST[
'duration_date_until'][
'date'][
'y'].
'-'.
979 $_POST[
'duration_date_until'][
'date'][
'm'].
'-'.
980 $_POST[
'duration_date_until'][
'date'][
'd']));
984 case 'duration_month':
986 $po->setDuration($_POST[
'duration_month']);
987 $po->setDurationFrom(NULL);
988 $po->setDurationUntil(NULL);
992 $po->setDescription($_POST[
'description'] ?
ilUtil::stripSlashes($_POST[
'description']) : NULL);
996 if($_POST[
'extension_price'])
998 $po->setExtension(1);
1002 $po->setExtension(0);
1010 return $this->editPricesObject();
1015 return $this->addPriceObject();
1021 if(!$_GET[
'pobject_id'])
1039 foreach(
$_SESSION[
'price_ids'] as $price_id)
1041 if($prices->delete($price_id))
1047 if(!count($prices->getPrices()))
1051 $this->pobject->setStatus($this->pobject->STATUS_NOT_BUYABLE);
1052 $this->pobject->update();
1059 return $this->editPricesObject();
1064 if(!$_GET[
'pobject_id'])
1072 if(!count($_POST[
'price_ids']))
1076 $this->editPricesObject();
1079 $_SESSION[
'price_ids'] = $_POST[
'price_ids'];
1081 $this->editPricesObject(
true);
1087 if(!$_GET[
'pobject_id'] && !$_POST[
'pobject_id'])
1094 if(isset($_GET[
'pobject_id']))
1096 $pobject_id = (int)$_GET[
'pobject_id'];
1100 $pobject_id = (int)$_POST[
'pobject_id'];
1103 if(!(
int)$_GET[
'price_id'] && !$_POST[
'price_id'])
1106 return $this->editPricesObject();
1108 if(isset($_GET[
'price_id']))
1110 $price_id = (int)$_GET[
'price_id'];
1114 $price_id = (int)$_POST[
'price_id'];
1118 switch($_POST[
'price_type'])
1122 $po->setDuration(NULL);
1123 $po->setDurationFrom(NULL);
1124 $po->setDurationUntil(NULL);
1125 $po->setUnlimitedDuration(1);
1131 $po->setDuration(NULL);
1133 $_POST[
'duration_date_from'][
'date'][
'y'].
'-'.
1134 $_POST[
'duration_date_from'][
'date'][
'm'].
'-'.
1135 $_POST[
'duration_date_from'][
'date'][
'd']));
1137 $_POST[
'duration_date_until'][
'date'][
'y'].
'-'.
1138 $_POST[
'duration_date_until'][
'date'][
'm'].
'-'.
1139 $_POST[
'duration_date_until'][
'date'][
'd']));
1145 $po->setDuration($_POST[
'duration_month']);
1146 $po->setDurationFrom(NULL);
1147 $po->setDurationUntil(NULL);
1151 $po->setDescription($_POST[
'description'] ?
ilUtil::stripSlashes($_POST[
'description']) : NULL);
1154 if($_POST[
'extension_price'])
1156 $po->setExtension(1);
1160 $po->setExtension(0);
1165 $po->update($price_id);
1167 return $this->editPricesObject();
1181 if(!(
int)$_GET[
'pobject_id'])
1189 $this->ctrl->setParameter($this,
'pobject_id', (
int)$_GET[
'pobject_id']);
1191 $ilToolbar->addButton($this->lng->txt(
'paya_edit_details'), $this->ctrl->getLinkTarget($this,
'editDetails'));
1192 $ilToolbar->addButton($this->lng->txt(
'paya_edit_prices'), $this->ctrl->getLinkTarget($this,
'editPrices'));
1193 $ilToolbar->addButton($this->lng->txt(
'pay_edit_abstract'), $this->ctrl->getLinkTargetByClass(array(
'ilshoppagegui'),
'edit'));
1195 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.main_view.html',
'Services/Payment');
1200 $tmp_object[
'title'] = $tmp_obj->getTitle();
1201 $tmp_object[
'type'] = $tmp_obj->getType();
1205 $tmp_object[
'title'] = $this->lng->txt(
'object_not_found');
1206 $tmp_object[
'type'] =
'';
1211 include_once
'./Services/Utilities/classes/class.ilConfirmationGUI.php';
1215 $oConfirmationGUI->setFormAction($this->ctrl->getFormAction($this,
"performObjectDelete"));
1216 $oConfirmationGUI->setHeaderText($this->lng->txt(
"paya_sure_delete_object"));
1217 $oConfirmationGUI->setCancel($this->lng->txt(
"cancel"),
"objects");
1218 $oConfirmationGUI->setConfirm($this->lng->txt(
"confirm"),
"performObjectDelete");
1220 $oConfirmationGUI->addItem(
'', $tmp_object[
'title'], $tmp_object[
'title']);
1221 $this->tpl->setVariable(
'CONFIRMATION',$oConfirmationGUI->getHTML());
1227 $oForm->setFormAction($this->ctrl->getFormAction($this,
'updateDetails'));
1228 $oForm->setTitle($tmp_object[
'title']);
1233 $oForm->addItem($oPathGUI);
1238 $oForm->addItem($oPurchasersGUI);
1241 $oVendorsGUI =
new ilSelectInputGUI($this->lng->txt(
'paya_vendor'),
'vendor');
1243 $oVendorsGUI->setValue($this->pobject->getVendorId());
1244 $oForm->addItem($oVendorsGUI);
1249 $oStatusGUI->setValue($this->pobject->getStatus());
1250 $oForm->addItem($oStatusGUI);
1253 $oPayMethodsGUI =
new ilSelectInputGUI($this->lng->txt(
'paya_pay_method'),
'pay_method');
1256 $oPayMethodsGUI->setValue($this->pobject->getPayMethod());
1257 $oForm->addItem($oPayMethodsGUI);
1260 include_once
'./Services/Payment/classes/class.ilShopTopics.php';
1267 $topic_options = array();
1268 $topic_options[
''] = $this->lng->txt(
'please_choose');
1270 foreach($topics as $oTopic)
1272 $topic_options[$oTopic->getId()] = $oTopic->getTitle();
1275 $oTopicsGUI->setOptions($topic_options);
1276 $oTopicsGUI->setValue($this->pobject->getTopicId());
1277 $oForm->addItem($oTopicsGUI);
1282 $oShopVatsList->read();
1283 if($oShopVatsList->hasItems())
1287 $vats_options = array();
1288 foreach($oShopVatsList as $oVAT)
1293 $oVatsGUI->setOptions($vats_options);
1294 $oVatsGUI->setValue($this->pobject->getVatId());
1295 $oForm->addItem($oVatsGUI);
1300 $oVatsGUI->
setValue($this->lng->txt(
'paya_no_vats_assigned'));
1301 $oForm->addItem($oVatsGUI);
1306 if(($webpath_file = $oFile->getCurrentImageWebPath()) !==
false)
1308 $oThumbnail->setImage($webpath_file);
1310 $oForm->addItem($oThumbnail);
1313 $oForm->addCommandButton(
'updateDetails', $this->lng->txt(
'save'));
1314 $oForm->addCommandButton(
'deleteObject', $this->lng->txt(
'delete'));
1316 $this->tpl->setVariable(
'FORM', $oForm->getHTML());
1325 if(!$_GET[
'pobject_id'])
1351 if(!$_GET[
'pobject_id'])
1361 $this->pobject->delete();
1365 $price_obj->deleteAllPrices();
1379 $path = $tree->getPathFull($a_ref_id);
1387 $html .= $data[
'title'].
' > ';
1390 return substr($html,0,-2);
1398 $all_vendors = $this->vendors_obj->getVendors();
1399 if (is_array($all_vendors))
1401 foreach ($all_vendors as $vendor)
1403 $vendors[] = $vendor[
'vendor_id'];
1407 foreach($vendors as $vendor)
1414 $options[$vendor] = $tmp_obj->getFullname().
' ['.$tmp_obj->getLogin().
']';
1422 $option[$this->pobject->STATUS_NOT_BUYABLE] = $this->lng->txt(
'paya_not_buyable');
1423 $option[$this->pobject->STATUS_BUYABLE] = $this->lng->txt(
'paya_buyable');
1424 $option[$this->pobject->STATUS_EXPIRES] = $this->lng->txt(
'paya_expires');
1432 unset($_POST[
'title_type']);
1433 unset($_POST[
'title_value']);
1434 unset($_POST[
'vendor']);
1435 unset($_POST[
'pay_method']);
1447 if(!$rbacsystem->checkAccess(
'read', $this->object->getRefId()))
1449 $this->ilErr->raiseError($this->lng->txt(
'msg_no_perm_read'),$this->ilErr->MESSAGE);
1452 if ($_POST[
'updateView'] == 1)
1454 $_SESSION[
'pay_objects'][
'title_type'] = $_POST[
'title_type'];
1455 $_SESSION[
'pay_objects'][
'title_value'] = $_POST[
'title_value'];
1456 $_SESSION[
'pay_objects'][
'pay_method'] = $_POST[
'pay_method'];
1457 $_SESSION[
'pay_objects'][
'vendor'] = $_POST[
'vendor'];
1460 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.main_view.html',
'Services/Payment');
1463 $this->lng->loadLanguageModule(
'search');
1466 $filter_form->setFormAction($this->ctrl->getFormAction($this));
1467 $filter_form->setTitle($this->lng->txt(
'pay_filter'));
1468 $filter_form->setId(
'filter_form');
1469 $filter_form->setTableWidth(
'100 %');
1472 $o_hide_check =
new ilCheckBoxInputGUI($this->lng->txt(
'show_filter'),
'show_filter');
1473 $o_hide_check->setValue(1);
1474 $o_hide_check->setChecked($_POST[
'show_filter'] ? 1 : 0);
1477 $o_hidden->setValue(1);
1478 $o_hidden->setPostVar(
'updateView');
1479 $o_hide_check->addSubItem($o_hidden);
1483 $radio_option =
new ilRadioOption($this->lng->txt(
'search_any_word'),
'or');
1484 $radio_group->addOption($radio_option);
1485 $radio_option =
new ilRadioOption($this->lng->txt(
'search_all_words'),
'and');
1486 $radio_group->addOption($radio_option);
1488 $radio_group->setRequired(
false);
1490 $radio_group->setPostVar(
'title_type');
1493 $o_title->setValue(
$_SESSION[
'pay_objects'][
'title_value']);
1494 $o_title->setPostVar(
'title_value');
1495 $o_title->setTitle($this->lng->txt(
'title'));
1497 $o_hide_check->addSubItem($radio_group);
1498 $o_hide_check->addSubItem($o_title);
1502 $o_vendor->setTitle($this->lng->txt(
'paya_vendor'));
1503 $o_vendor->setValue(
$_SESSION[
'pay_objects'][
'vendor']);
1504 $o_vendor->setPostVar(
'vendor');
1505 $o_hide_check->addSubItem($o_vendor);
1509 $o_paymethod->setTitle($this->lng->txt(
'payment_system'));
1510 $o_paymethod->setOptions(ilPaymethods::getPayMethodsOptions(
'all'));
1511 $o_paymethod->setValue(
$_SESSION[
'pay_objects'][
'pay_method']);
1512 $o_paymethod->setPostVar(
'pay_method');
1513 $o_hide_check->addSubItem($o_paymethod);
1515 $filter_form->addCommandButton(
'objects', $this->lng->txt(
'pay_update_view'));
1516 $filter_form->addCommandButton(
'resetObjectFilter', $this->lng->txt(
'pay_reset_filter'));
1518 $filter_form->addItem($o_hide_check);
1525 $this->tpl->setVariable(
'FORM', $filter_form->getHTML());
1528 foreach($objects as
$data)
1533 $f_result[$counter][
'title'] = $tmp_obj->getTitle();
1537 $f_result[$counter][
'title'] = $this->lng->txt(
'object_not_found');
1540 switch($data[
'status'])
1542 case $this->pobject->STATUS_BUYABLE:
1543 $f_result[$counter][
'status'] = $this->lng->txt(
'paya_buyable');
1546 case $this->pobject->STATUS_NOT_BUYABLE:
1547 $f_result[$counter][
'status'] = $this->lng->txt(
'paya_not_buyable');
1550 case $this->pobject->STATUS_EXPIRES:
1551 $f_result[$counter][
'status'] = $this->lng->txt(
'paya_expires');
1555 include_once
'./Services/Payment/classes/class.ilPayMethods.php';
1557 $f_result[$counter][
'pay_method'] = $str_paymethod;
1559 if($data[
'vat_id'] <= 0)
1561 $vat_rate = $this->lng->txt(
'payment_vat_has_to_be_defined_by_administration_short');
1567 $oVAT =
new ilShopVats((
int)$data[
'vat_id']);
1572 $vat_rate = $this->lng->txt(
'payment_vat_has_to_be_defined_by_administration_short');
1576 $f_result[$counter][
'vat_rate'] = $vat_rate;
1581 $f_result[$counter][
'vendor'] = $tmp_user->getFullname().
' ['.$tmp_user->getLogin().
']';
1585 $f_result[$counter][
'vendor'] = $this->lng->txt(
'user_not_found');
1592 $this->ctrl->setParameter($this,
'pobject_id',$data[
'pobject_id']);
1593 $link_change =
"<div class=\"il_ContainerItemCommands\"><a class=\"il_ContainerItemCommand\" href=\"".$this->ctrl->getLinkTarget($this,
"editDetails").
"\">".$this->lng->txt(
"edit").
"</a></div>";
1595 $f_result[$counter][
'options'] = $link_change;
1609 $this->ctrl->setParameter($this,
'cmd',
'objects');
1612 $tbl->setTitle($this->lng->txt(
'objects'));
1614 $tbl->setId(
'tbl_show_objects');
1615 $tbl->setRowTemplate(
"tpl.shop_objects_row.html",
"Services/Payment");
1617 $tbl->addColumn($this->lng->txt(
'title'),
'title',
'10%');
1618 $tbl->addColumn($this->lng->txt(
'status'),
'status',
'10%');
1619 $tbl->addColumn($this->lng->txt(
'paya_pay_method'),
'pay_method',
'10%');
1620 $tbl->addColumn($this->lng->txt(
'vat_rate'),
'vat_rate',
'15%');
1621 $tbl->addColumn($this->lng->txt(
'paya_vendor'),
'vendor',
'10%');
1622 $tbl->addColumn($this->lng->txt(
'paya_count_purchaser'),
'purchasers',
'10%');
1623 $tbl->addColumn(
'',
'options',
'10%');
1625 $tbl->setData($a_result_set);
1627 $this->tpl->setVariable(
'TABLE', $tbl->getHTML());
1640 switch($_POST[
'action'])
1642 case 'deleteVendorsObject':
1643 $this->deleteVendors();
1646 case 'editVendorObject':
1647 $this->editVendor();
1650 case 'performEditVendorObject':
1664 unset($_POST[
'transaction_type']);
1665 unset($_POST[
'transaction_value']);
1666 unset($_POST[
'from']);
1667 unset($_POST[
'til']);
1668 unset($_POST[
'payed']);
1669 unset($_POST[
'access']);
1670 unset($_POST[
'customer']);
1671 unset($_POST[
'pay_method']);
1672 unset($_POST[
'updateView']);
1673 unset($_POST[
"adm_filter_title_id"]);
1681 global $rbacsystem, $ilToolbar,$ilObjDataCache;
1683 include_once
'./Services/Payment/classes/class.ilPayMethods.php';
1686 if(!$rbacsystem->checkAccess(
'read', $this->object->getRefId()))
1688 $this->ilErr->raiseError($this->lng->txt(
'msg_no_perm_read'),$this->ilErr->MESSAGE);
1691 $ilToolbar->addButton($this->lng->txt(
'paya_add_customer'), $this->ctrl->getLinkTarget($this,
'showObjectSelector'));
1693 if ($_POST[
'updateView'] == 1)
1695 $_SESSION[
'pay_statistics'][
'show_filter']= $_POST[
'show_filter'];
1696 $_SESSION[
'pay_statistics'][
'updateView'] =
true;
1697 $_SESSION[
'pay_statistics'][
'until_check'] = $_POST[
'until_check'];
1698 $_SESSION[
'pay_statistics'][
'from_check'] = $_POST[
'from_check'];
1699 $_SESSION[
'pay_statistics'][
'transaction_type'] = isset($_POST[
'transaction_type']) ? $_POST[
'transaction_type'] :
'' ;
1700 $_SESSION[
'pay_statistics'][
'transaction_value'] = isset($_POST[
'transaction_value']) ? $_POST[
'transaction_value'] :
'';
1701 $_SESSION[
'pay_statistics'][
'adm_filter_title_id'] = (int)$_POST[
'adm_filter_title_id'];
1703 if(
$_SESSION[
'pay_statistics'][
'from_check'] ==
'1')
1705 $_SESSION[
'pay_statistics'][
'from'][
'date'][
'd'] = $_POST[
'from'][
'date'][
'd'];
1706 $_SESSION[
'pay_statistics'][
'from'][
'date'][
'm'] = $_POST[
'from'][
'date'][
'm'];
1707 $_SESSION[
'pay_statistics'][
'from'][
'date'][
'y'] = $_POST[
'from'][
'date'][
'y'];
1711 $_SESSION[
'pay_statistics'][
'from'][
'date'][
'd'] =
'';
1712 $_SESSION[
'pay_statistics'][
'from'][
'date'][
'm'] =
'';
1713 $_SESSION[
'pay_statistics'][
'from'][
'date'][
'y'] =
'';
1716 if(
$_SESSION[
'pay_statistics'][
'until_check']==
'1')
1718 $_SESSION[
'pay_statistics'][
'til'][
'date'][
'd'] = $_POST[
'til'][
'date'][
'd'];
1719 $_SESSION[
'pay_statistics'][
'til'][
'date'][
'm'] = $_POST[
'til'][
'date'][
'm'];
1720 $_SESSION[
'pay_statistics'][
'til'][
'date'][
'y'] = $_POST[
'til'][
'date'][
'y'];
1724 $_SESSION[
'pay_statistics'][
'til'][
'date'][
'd'] =
'';
1725 $_SESSION[
'pay_statistics'][
'til'][
'date'][
'm'] =
'';
1726 $_SESSION[
'pay_statistics'][
'til'][
'date'][
'y'] =
'';
1729 $_SESSION[
'pay_statistics'][
'payed'] = $_POST[
'payed'];
1730 $_SESSION[
'pay_statistics'][
'access'] = $_POST[
'access'];
1731 $_SESSION[
'pay_statistics'][
'pay_method'] = $_POST[
'pay_method'];
1732 $_SESSION[
'pay_statistics'][
'customer'] = isset ($_POST[
'customer']) ? $_POST[
'customer'] :
'';
1733 $_SESSION[
'pay_statistics'][
'vendor'] = isset ($_POST[
'vendor']) ? $_POST[
'vendor']:
'';
1737 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.main_view.html',
'Services/Payment');
1740 $filter_form->setFormAction($this->ctrl->getFormAction($this));
1741 $filter_form->setTitle($this->lng->txt(
'pay_filter'));
1742 $filter_form->setId(
'formular');
1743 $filter_form->setTableWidth(
'100 %');
1745 $o_hide_check =
new ilCheckBoxInputGUI($this->lng->txt(
'show_filter'),
'show_filter');
1746 $o_hide_check->setValue(1);
1747 $o_hide_check->setChecked($_POST[
'show_filter'] ? 1 : 0);
1750 $o_hidden->setValue(1);
1751 $o_hidden->setPostVar(
'updateView');
1752 $o_hide_check->addSubItem($o_hidden);
1755 $trans_option = array($this->lng->txt(
'pay_starting'),$this->lng->txt(
'pay_ending'));
1756 $trans_value = array(
'0',
'1');
1757 $o_transaction_type->setTitle($this->lng->txt(
'paya_transaction'));
1758 $o_transaction_type->setOptions($trans_option);
1759 $o_transaction_type->setValue(
$_SESSION[
'pay_statistics'][
'transaction_type']);
1760 $o_transaction_type->setPostVar(
'transaction_type');
1761 $o_hide_check->addSubItem($o_transaction_type);
1764 $o_transaction_val->setValue(
$_SESSION[
'pay_statistics'][
'transaction_value']);
1765 $o_transaction_val->setPostVar(
'transaction_value');
1766 $o_hide_check->addSubItem($o_transaction_val);
1769 $o_customer->setTitle($this->lng->txt(
'paya_customer'));
1770 $o_customer->setValue(
$_SESSION[
'pay_statistics'][
'customer']);
1771 $o_customer->setPostVar(
'customer');
1772 $o_hide_check->addSubItem($o_customer);
1775 $o_vendor->setTitle($this->lng->txt(
'paya_vendor'));
1776 $o_vendor->setValue(
$_SESSION[
'pay_statistics'][
'vendor']);
1777 $o_vendor->setPostVar(
'vendor');
1778 $o_hide_check->addSubItem($o_vendor);
1780 $o_from_check =
new ilCheckBoxInputGUI($this->lng->txt(
'pay_order_date_from'),
'from_check');
1781 $o_from_check->setValue(1);
1782 $o_from_check->setChecked(
$_SESSION[
'pay_statistics'][
'from_check'] ? 1 : 0);
1785 $o_date_from->setPostVar(
'from');
1787 if(
$_SESSION[
'pay_statistics'][
'from_check'] ==
'1')
1789 $o_date_from->setValueByArray(
$_SESSION[
'pay_statistics'][
'from']);
1790 $o_date_from->checkInput();
1794 $o_hide_check->addSubItem($o_from_check);
1796 $o_until_check =
new ilCheckBoxInputGUI($this->lng->txt(
'pay_order_date_til'),
'until_check');
1797 $o_until_check->setValue(1);
1798 $o_until_check->setChecked(
$_SESSION[
'pay_statistics'][
'until_check'] ? 1 : 0);
1801 $o_date_until->setPostVar(
'til');
1803 if(
$_SESSION[
'pay_statistics'][
'until_check'] ==
'1')
1805 $o_date_until->setValueByArray(
$_SESSION[
'pay_statistics'][
'til']);
1806 $o_date_until->checkInput();
1809 $o_until_check->addSubItem($o_date_until);
1810 $o_hide_check->addSubItem($o_until_check);
1814 $title_options[
'all']=$this->lng->txt(
'pay_all');
1815 $unique_titles = $this->booking_obj->getUniqueTitles();
1817 if(is_array($unique_titles) && count($unique_titles))
1819 foreach($unique_titles as
$ref_id)
1821 $title_options[
$ref_id] = $ilObjDataCache->lookupTitle($ilObjDataCache->lookupObjId($ref_id));
1826 $o_object_title->setTitle($this->lng->txt(
'title'));
1827 $o_object_title->setOptions($title_options);
1828 $o_object_title->setValue(
$_SESSION[
"pay_statistics"][
"adm_filter_title_id"]);
1829 $o_object_title->setPostVar(
'adm_filter_title_id');
1830 $o_hide_check->addSubItem($o_object_title);
1833 $payed_option = array(
'all'=>$this->lng->txt(
'pay_all'),
'1'=>$this->lng->txt(
'yes'),
'0'=>$this->lng->txt(
'no'));
1835 $o_payed->setTitle($this->lng->txt(
'paya_payed'));
1836 $o_payed->setOptions($payed_option);
1837 $o_payed->setValue(
$_SESSION[
'pay_statistics'][
'payed']);
1838 $o_payed->setPostVar(
'payed');
1840 $o_hide_check->addSubItem($o_payed);
1843 $access_option = array(
'all'=>$this->lng->txt(
'pay_all'),
'1'=>$this->lng->txt(
'yes'),
'0'=>$this->lng->txt(
'no'));
1845 $o_access->setTitle($this->lng->txt(
'paya_access'));
1846 $o_access->setOptions($access_option);
1847 $o_access->setValue(
$_SESSION[
'pay_statistics'][
'access']);
1848 $o_access->setPostVar(
'access');
1849 $o_hide_check->addSubItem($o_access);
1852 $o_paymethod->setTitle($this->lng->txt(
'payment_system'));
1853 $o_paymethod->setOptions(ilPaymethods::getPayMethodsOptions(
'all'));
1854 $o_paymethod->setValue(
$_SESSION[
'pay_statistics'][
'pay_method']);
1855 $o_paymethod->setPostVar(
'pay_method');
1856 $o_hide_check->addSubItem($o_paymethod);
1858 $filter_form->addCommandButton(
'statistic', $this->lng->txt(
'pay_update_view'));
1859 $filter_form->addCommandButton(
'resetFilter', $this->lng->txt(
'pay_reset_filter'));
1861 $filter_form->addItem($o_hide_check);
1863 $this->tpl->setVariable(
'FORM', $filter_form->getHTML());
1869 if(!count($bookings = $this->booking_obj->getBookings()))
1877 # $this->__showButton('exportVendors',$this->lng->txt('excel_export'));
1880 include_once
'Services/User/classes/class.ilObjUser.php';
1881 $object_title_cache = array();
1882 $user_title_cache = array();
1885 foreach($bookings as $booking)
1887 if(array_key_exists($booking[
'ref_id'], $object_title_cache))
1889 $tmp_obj = $object_title_cache[$booking[
'ref_id']];
1894 $object_title_cache[$booking[
'ref_id']] = $tmp_obj;
1898 if(array_key_exists($booking[
'b_vendor_id'], $user_title_cache))
1900 $tmp_vendor = $user_title_cache[$booking[
'b_vendor_id']];
1905 $user_title_cache[$booking[
'b_vendor_id']] = $tmp_vendor;
1907 if(array_key_exists($booking[
'customer_id'], $user_title_cache))
1909 $tmp_purchaser = $user_title_cache[$booking[
'customer_id']];
1913 if(ANONYMOUS_USER_ID == $booking[
'customer_id'])
1916 $purchaser_name = $booking[
'name_extern'];
1917 $tmp_purchaser_email = $booking[
'email_extern'];
1923 $purchaser_name = $tmp_purchaser_name[
'firstname'].
' '.$tmp_purchaser_name[
'lastname'];
1926 $user_title_cache[$booking[
'customer_id']] = $tmp_purchaser;
1929 $transaction = $booking[
'transaction_extern'];
1931 $transaction .= $booking[
'transaction'].
"<br> (" . $str_paymethod .
")";
1933 $f_result[$counter][
'transaction'] = $transaction;
1934 $f_result[$counter][
'object_title'] = ($tmp_obj !=
'' ? $tmp_obj : $this->lng->txt(
'object_deleted'));
1935 $f_result[$counter][
'vendor'] = ($tmp_vendor !=
'' ?
'['.$tmp_vendor.
']' : $this->lng->txt(
'user_deleted'));
1936 $f_result[$counter][
'customer'] = ($tmp_purchaser !=
'' ?
1937 $purchaser_name.
' ['.$tmp_purchaser.
']<br>'
1938 .$tmp_purchaser_email
1939 : $this->lng->txt(
'user_deleted'));
1943 if($booking[
'duration'] == 0 && $booking[
'access_enddate'] == NULL)
1945 $f_result[$counter][
'duration'] = $this->lng->txt(
"unlimited_duration");
1957 $f_result[$counter][
'price'] = $booking[
'price'].
' '.$booking[
'currency_unit'];
1958 $f_result[$counter][
'discount'] = ($booking[
'discount'] !=
'' ? ($booking[
'discount'].
' '.$booking[
'currency_unit']) :
' ');
1960 $payed_access = $booking[
'payed'] ?
1961 $this->lng->txt(
'yes') :
1962 $this->lng->txt(
'no');
1964 $payed_access .=
'/';
1965 $payed_access .= $booking[
'access_granted'] ?
1966 $this->lng->txt(
'yes') :
1967 $this->lng->txt(
'no');
1969 $f_result[$counter][
'payed_access'] = $payed_access;
1971 $this->ctrl->setParameter($this,
"booking_id",$booking[
'booking_id']);
1972 $link_change =
"<div class=\"il_ContainerItemCommands\"><a class=\"il_ContainerItemCommand\" href=\"".$this->ctrl->getLinkTarget($this,
"editStatistic").
"\">".$this->lng->txt(
"edit").
"</a></div>";
1974 $f_result[$counter][
'edit'] = $link_change;
1978 unset($tmp_purchaser);
1989 include_once
'./Services/Payment/classes/class.ilPayMethods.php';
1991 if(!isset($_GET[
'booking_id']))
1994 $this->showStatistics();
1999 $ilToolbar->addButton($this->lng->txt(
'back'), $this->ctrl->getLinkTarget($this,
'statistic'));
2001 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.main_view.html',
'Services/Payment');
2002 $this->ctrl->setParameter($this,
'booking_id',(
int) $_GET[
'booking_id']);
2005 if($a_show_confirm_delete)
2010 $oConfirmationGUI->setFormAction($this->ctrl->getFormAction($this,
"performDelete"));
2011 $oConfirmationGUI->setHeaderText($this->lng->txt(
"paya_sure_delete_stat"));
2012 $oConfirmationGUI->setCancel($this->lng->txt(
"cancel"),
"statistic");
2013 $oConfirmationGUI->setConfirm($this->lng->txt(
"confirm"),
"performDelete");
2015 $this->tpl->setVariable(
'CONFIRMATION', $oConfirmationGUI->getHTML());
2021 $bookings = $this->booking_obj->getBookings();
2022 $booking = $bookings[(int) $_GET[
'booking_id']];
2028 $oForm->setFormAction($this->ctrl->getFormAction($this));
2029 $oForm->setId(
'stat_form');
2030 $oForm->setTableWidth(
'50 %');
2031 if(is_object($tmp_user))
2033 $frm_user = $tmp_user->getFullname().
' ['.$tmp_user->getLogin().
']';
2037 $frm_user = $this->lng->txt(
'user_deleted');
2039 $oForm->setTitle($frm_user);
2046 $oTitleGUI->
setValue($tmp_obj !=
'' ? $tmp_obj : $this->lng->txt(
'object_deleted'));
2047 $oForm->addItem($oTitleGUI);
2051 $oTransactionGUI->
setValue($booking[
'transaction']);
2052 $oForm->addItem($oTransactionGUI);
2057 if(is_object($tmp_vendor))
2059 $frm_vendor = $tmp_vendor->getFullname().
' ['.$tmp_vendor->getLogin().
']';
2063 $frm_vendor = $this->lng->txt(
'user_deleted');
2065 $oVendorGUI->
setValue($frm_vendor);
2066 $oForm->addItem($oVendorGUI);
2071 $oForm->addItem($oPaymethodGUI);
2076 $oForm->addItem($oOrderdateGUI);
2080 if($booking[
'duration'] == 0 && $booking[
'access_enddate'] == NULL)
2082 $frm_duration = $this->lng->txt(
"unlimited_duration");
2087 if($booking[
'duration'] > 0)
2089 $frm_duration = $booking[
'duration'].
' '.$this->lng->txt(
'paya_months').
'</br>';
2095 $oDurationGUI->setValue($frm_duration);
2096 $oForm->addItem($oDurationGUI);
2100 $oPriceGUI->
setValue($booking[
'price'].
' '.$booking[
'currency_unit']);
2101 $oForm->addItem($oPriceGUI);
2105 $oDiscountGUI->
setValue($booking[
'discount'].
' '.$booking[
'currency_unit']);
2106 $oForm->addItem($oDiscountGUI);
2110 $payed_option = array(0 => $this->lng->txt(
'no'),1 => $this->lng->txt(
'yes'));
2112 $oPayedGUI->setTitle($this->lng->txt(
'paya_payed'));
2113 $oPayedGUI->setOptions($payed_option);
2114 $oPayedGUI->setValue($booking[
'payed']);
2115 $oPayedGUI->setPostVar(
'payed');
2116 $oForm->addItem($oPayedGUI);
2120 $access_option = array(0 => $this->lng->txt(
'no'),1 => $this->lng->txt(
'yes'));
2122 $oAccessGUI->setTitle($this->lng->txt(
'paya_access'));
2123 $oAccessGUI->setOptions($access_option);
2124 $oAccessGUI->setValue($booking[
'access_granted']);
2125 $oAccessGUI->setPostVar(
'access');
2126 $oForm->addItem($oAccessGUI);
2128 $oForm->addCommandButton(
'updateStatistic',$this->lng->txt(
'save'));
2129 $oForm->addCommandButton(
'deleteStatistic',$this->lng->txt(
'delete'));
2135 $oForm2->setId(
'cust_form');
2136 $oForm2->setTableWidth(
'50%');
2137 $oForm2->setTitle($frm_user);
2141 $email = (!$tmp_user) ? $this->lng->txt(
'user_deleted') : $tmp_user->getEmail();
2143 $oForm2->addItem($oEmailGUI);
2147 $oStreetGUI->
setValue($booking[
'street']);
2148 $oForm2->addItem($oStreetGUI);
2152 $oPoBoxGUI->
setValue($booking[
'po_box']);
2153 $oForm2->addItem($oPoBoxGUI);
2157 $oPoBoxGUI->
setValue($booking[
'zipcode']);
2158 $oForm2->addItem($oPoBoxGUI);
2162 $oCityGUI->
setValue($booking[
'city']);
2163 $oForm2->addItem($oCityGUI);
2167 $oCountryGUI->
setValue($booking[
'country']);
2168 $oForm2->addItem($oCountryGUI);
2171 $this->tpl->setVariable(
'FORM',$oForm->getHTML());
2172 $this->tpl->setVariable(
'FORM_2',$oForm2->getHTML());
2178 if(!isset($_GET[
'booking_id']))
2187 $this->booking_obj->setBookingId((
int) $_GET[
'booking_id']);
2188 $this->booking_obj->setAccess((
int) $_POST[
'access']);
2189 $this->booking_obj->setPayed((
int) $_POST[
'payed']);
2191 if($this->booking_obj->update())
2209 if(!isset($_GET[
'booking_id']))
2224 if(!isset($_GET[
'booking_id']))
2233 $this->booking_obj->setBookingId((
int) $_GET[
'booking_id']);
2234 if(!$this->booking_obj->delete())
2236 die(
'Error deleting booking');
2252 global $rbacsystem, $ilHelp;
2255 $ilHelp->setScreenIdComponent(
"pays");
2256 if ($rbacsystem->checkAccess(
'visible,read',$this->object->getRefId()))
2259 $tabs_gui->addTarget(
'settings', $this->ctrl->getLinkTarget($this,
'generalSettings'),
2260 array(
'saveGeneralSettings',
'generalSettings ',
'saveBmfSettings',
'savePaypalSettings',
'paypalSettings',
2262 '',
'view'),
'',
'');
2265 $tabs_gui->addTarget(
'bookings', $this->ctrl->getLinkTarget($this,
'statistic'),
2266 array(
'statistic',
'editStatistic',
'updateStatistic',
'deleteStatistic',
'performDelete',
2267 'resetFilter',
'exportVendors',
'addCustomer',
'saveCustomer',
'showObjectSelector',
2268 'searchUserSP',
'performSearchSP'),
'',
'');
2270 $tabs_gui->addTarget(
'objects', $this->ctrl->getLinkTarget($this,
'objects'),
2271 array(
'updateObjectDetails',
'deleteObject',
'performObjectDelete',
'objects',
2272 'editPrices',
'addPrice',
'editDetails',
'resetObjectFilter'),
'',
'');
2274 $tabs_gui->addTarget(
'vendors', $this->ctrl->getLinkTarget($this,
'vendors'),
2275 array(
'vendors',
'searchUser',
'search',
'performSearch',
'addVendor',
'addUser',
'exportVendors',
'deleteVendors',
'performDeleteVendors',
2276 'cancelDeleteVendors',
'editVendor',
'performEditVendor'),
'',
'');
2278 #TODO: CURRENCY not finished yet
2286 $tabs_gui->addTarget(
'pay_methods', $this->ctrl->getLinkTarget($this,
'payMethods'),
2287 #array('payMethods','savePayMethods'), '', '');
2288 array(
'payMethods',
'savePayMethods ',
'saveBmfSettings',
'savePaypalSettings',
'paypalSettings',
2290 '',
'view'),
'',
'');
2294 $this->ctrl->getLinkTargetByClass(
'ilshoptopicsgui',
''),
'payment_topics',
'',
'');
2298 $this->ctrl->getLinkTarget($this,
'vats'),
'vats',
'',
'');
2301 $tabs_gui->addTarget(
'documents', $this->ctrl->getLinkTarget($this,
'documents'),
2302 array(
'documents',
'TermsConditions',
'saveTermsConditions',
'BillingMail',
2303 'saveBillingMail',
'InvoiceNumber',
'saveInvoiceNumber',
'StatutoryRegulations',
'saveStatutoryRegulations'),
'',
'');
2306 if ($rbacsystem->checkAccess(
'edit_permission',$this->object->getRefId()))
2310 $this->ctrl->getLinkTargetByClass(array(get_class($this),
'ilpermissiongui'),
'perm'), array(
'perm',
'info',
'owner'),
'ilpermissiongui');
2326 if(!$a_sub_tab) $a_sub_tab =
'payMethods';
2327 $this->tabs_gui->addSubTabTarget(
'settings',
2328 $this->ctrl->getLinkTargetByClass(
'ilobjpaymentsettingsgui',
'payMethods'),
2329 '',
'',
'',$a_sub_tab ==
'payMethods' ?
true :
false);
2331 $this->tabs_gui->addSubTabTarget(
'pays_bmf',
2332 $this->ctrl->getLinkTargetByClass(
'ilobjpaymentsettingsgui',
'bmfSettings'),
2333 '',
'',
'',$a_sub_tab ==
'bmfSettings' ?
true :
false);
2335 $this->tabs_gui->addSubTabTarget(
'pays_paypal',
2336 $this->ctrl->getLinkTargetByClass(
'ilobjpaymentsettingsgui',
'paypalSettings'),
2337 '',
'',
'',$a_sub_tab ==
'paypalSettings' ?
true :
false);
2345 if(!$a_sub_tab) $a_sub_tab =
'topics';
2346 $this->tabs_gui->addSubTabTarget(
'topics',
2347 $this->ctrl->getLinkTargetByClass(
'ilshoptopicsgui',
'showTopicsList'),
2348 '',
'',
'',$a_sub_tab ==
'showTopicsList' ?
true :
false);
2350 $this->tabs_gui->addSubTabTarget(
'topics_settings',
2351 $this->ctrl->getLinkTargetByClass(
'ilshoptopicsgui',
'showTopicsSettings'),
2352 '',
'',
'',$a_sub_tab ==
'showTopicsSettings' ?
true :
false);
2356 if(!$a_sub_tab) $a_sub_tab =
'terms_conditions';
2357 $this->tabs_gui->addSubTabTarget(
'terms_conditions',
2358 $this->ctrl->getLinkTargetByClass(
'ilobjpaymentsettingsgui',
'TermsConditions'),
2359 '',
'',
'',$a_sub_tab ==
'terms_conditions' ?
true :
false);
2361 $this->tabs_gui->addSubTabTarget(
'billing_mail',
2362 $this->ctrl->getLinkTargetByClass(
'ilobjpaymentsettingsgui',
'BillingMail'),
2363 '',
'',
'',$a_sub_tab ==
'billing_mail' ?
true :
false);
2364 $this->tabs_gui->addSubTabTarget(
'invoice_number',
2365 $this->ctrl->getLinkTargetByClass(
'ilobjpaymentsettingsgui',
'InvoiceNumber'),
2366 '',
'',
'',$a_sub_tab ==
'invoice_number' ?
true :
false);
2367 $this->tabs_gui->addSubTabTarget(
'statutory_regulations',
2368 $this->ctrl->getLinkTargetByClass(
'ilobjpaymentsettingsgui',
'StatutoryRegulations'),
2369 '',
'',
'',$a_sub_tab ==
'statutory_regulations' ?
true :
false);
2374 if (($_GET[
'cmd'] ==
'') || ($_GET[
'cmd'] ==
'view') || ($a_sub_tab ==
'generalSettings'))
2375 $a_sub_tab =
'generalSettings';
2380 public function generalSettingsObject()
2388 if(!$rbacsystem->checkAccess(
'read', $this->object->getRefId()))
2390 $this->ilErr->raiseError($this->lng->txt(
'msg_no_perm_read'),$this->ilErr->MESSAGE);
2393 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.main_view.html',
'Services/Payment');
2399 $form->setFormAction($this->ctrl->getFormAction($this,
'saveGeneralSettings'));
2400 $form->setTitle($this->lng->txt(
'pays_general_settings'));
2402 $form->addCommandButton(
'saveGeneralSettings',$this->lng->txt(
'save'));
2405 $formItem =
new ilCheckboxInputGUI($this->lng->txt(
'pay_enable_shop'),
'shop_enabled');
2407 $formItem->setInfo($this->lng->txt(
'pay_enable_shop_info'));
2408 $form->addItem($formItem);
2410 $formItem =
new ilTextInputGUI($this->lng->txt(
'pays_currency_unit'),
'currency_unit');
2412 $formItem->setValue($this->error !=
'' && isset($_POST[
'currency_unit'])
2415 $formItem->setRequired(
true);
2416 $form->addItem($formItem);
2420 $formItem->setCols(35);
2421 $formItem->setRequired(
true);
2422 $formItem->setValue($this->error !=
'' && isset($_POST[
'address'])
2424 : $genSetData[
'address']);
2425 $form->addItem($formItem);
2429 $formItem->setCols(35);
2430 $formItem->setRequired(
true);
2431 $formItem->setValue($this->error !=
'' && isset($_POST[
'bank_data'])
2433 : $genSetData[
'bank_data']);
2434 $form->addItem($formItem);
2438 $formItem->setCols(35);
2439 $formItem->setValue($this->error !=
'' && isset($_POST[
'add_info'])
2441 : $genSetData[
'add_info']);
2442 $form->addItem($formItem);
2444 $formItem =
new ilTextInputGUI($this->lng->txt(
'pays_pdf_path'),
'pdf_path');
2445 $formItem->
setValue($this->error !=
"" && isset($_POST[
'pdf_path'])
2448 $formItem->setRequired(
true);
2449 $form->addItem($formItem);
2452 $formItem =
new ilSelectInputGUI($this->lng->txt(
'pay_max_hits'),
'max_hits');
2453 $formItem->
setValue($genSetData[
'max_hits']);
2455 for($i = 10; $i <= 100; $i += 10)
2460 $formItem->setInfo($this->lng->txt(
'pay_max_hits_info'));
2461 $form->addItem($formItem);
2464 $formItem =
new ilCheckboxInputGUI($this->lng->txt(
'pay_hide_advanced_search'),
'hide_advanced_search');
2465 $formItem->
setChecked((
int)$genSetData[
'hide_advanced_search']);
2466 $formItem->setInfo($this->lng->txt(
'pay_hide_advanced_search_info'));
2467 $form->addItem($formItem);
2471 $formItem->
setChecked((
int)$genSetData[
'hide_news']);
2472 $formItem->setInfo($this->lng->txt(
'pay_hide_news_info'));
2473 $form->addItem($formItem);
2476 $formItem =
new ilCheckboxInputGUI($this->lng->txt(
'pay_hide_coupons'),
'hide_coupons');
2477 $formItem->
setChecked((
int)$genSetData[
'hide_coupons']);
2478 $formItem->setInfo($this->lng->txt(
'pay_hide_coupons'));
2479 $form->addItem($formItem);
2482 $formItem =
new ilCheckboxInputGUI($this->lng->txt(
'pay_hide_shop_info'),
'hide_shop_info');
2483 $formItem->
setChecked((
int)$genSetData[
'hide_shop_info']);
2484 $formItem->setInfo($this->lng->txt(
'pay_hide_shop_info_info'));
2485 $form->addItem($formItem);
2488 $formItem =
new ilCheckboxInputGUI($this->lng->txt(
'use_shop_specials'),
'use_shop_specials');
2489 $formItem->
setChecked((
int)$genSetData[
'use_shop_specials']);
2490 $formItem->setInfo($this->lng->txt(
'use_shop_specials_info'));
2491 $form->addItem($formItem);
2494 $formItem =
new ilCheckboxInputGUI($this->lng->txt(
'show_general_filter'),
'show_general_filter');
2495 $formItem->
setChecked((
int)$genSetData[
'show_general_filter']);
2496 $formItem->setInfo($this->lng->txt(
'show_general_filter_info'));
2497 $form->addItem($formItem);
2500 $formItem =
new ilCheckboxInputGUI($this->lng->txt(
'show_shop_explorer'),
'show_shop_explorer');
2501 $formItem->
setChecked((
int)$genSetData[
'show_shop_explorer']);
2502 $formItem->setInfo($this->lng->txt(
'show_shop_explorer_info'));
2503 $form->addItem($formItem);
2507 $payment_noti =
new ilCheckboxInputGUI($this->lng->txt(
"payment_notification"),
"payment_notification");
2509 $payment_noti->setChecked((
int)$ilSetting->get(
'payment_notification', 0) == 1);
2510 $payment_noti->setInfo($this->lng->txt(
'payment_notification_desc'));
2512 $num_days =
new ilNumberInputGUI($this->lng->txt(
'payment_notification_days'),
'payment_notification_days');
2514 $num_days->setMinValue(0);
2515 $num_days->setMaxValue(120);
2516 $num_days->setRequired(
true);
2517 $num_days->setValue($ilSetting->get(
'payment_notification_days'));
2518 $num_days->setInfo($this->lng->txt(
'payment_notification_days_desc'));
2520 $payment_noti->addSubItem($num_days);
2521 $form->addItem($payment_noti);
2524 $this->tpl->setVariable(
'FORM',
$form->getHTML());
2528 public function saveGeneralSettingsObject()
2533 if(!$rbacsystem->checkAccess(
'read', $this->object->getRefId()))
2535 $this->ilErr->raiseError($this->lng->txt(
'msg_no_perm_read'),$this->ilErr->MESSAGE);
2543 if ($_POST[
'currency_unit'] ==
'' ||
2544 $_POST[
'address'] ==
'' ||
2545 $_POST[
'bank_data'] ==
'' ||
2546 $_POST[
'pdf_path'] ==
'')
2548 $this->error = $this->lng->txt(
'pays_general_settings_not_valid');
2550 return $this->generalSettingsObject();
2554 $genSet->set(
'currency_unit', $_POST[
'currency_unit'],
'currencies');
2555 $genSet->set(
'address', $_POST[
'address'],
'invoice');
2556 $genSet->set(
'bank_data', $_POST[
'bank_data'],
'invoice');
2557 $genSet->set(
'add_info', $_POST[
'add_info'],
'invoice');
2558 $genSet->set(
'pdf_path', $_POST[
'pdf_path'],
'invoice');
2560 $genSet->set(
'max_hits', $_POST[
'max_hits'],
'gui');
2562 $genSet->set(
'hide_advanced_search', $_POST[
'hide_advanced_search'],
'gui');
2563 #$genSet->set('hide_filtering', $_POST['hide_filtering'], 'gui');
2564 $genSet->set(
'objects_allow_custom_sorting', $_POST[
'objects_allow_custom_sorting'],
'gui');
2565 $genSet->set(
'hide_coupons', $_POST[
'hide_coupons'],
'gui');
2566 $genSet->set(
'hide_news', $_POST[
'hide_news'],
'gui');
2568 if( (
int)$_POST[
'hide_news'] == 0 )
2570 if( (
int)$ilSetting->get(
'payment_news_archive_period') == 0)
2572 $ilSetting->set(
'payment_news_archive_period',
'5');
2576 $genSet->set(
'hide_shop_info', $_POST[
'hide_shop_info'],
'gui');
2577 $genSet->set(
'use_shop_specials', $_POST[
'use_shop_specials'],
'gui');
2578 $genSet->set(
'show_general_filter', $_POST[
'show_general_filter'],
'gui');
2579 $genSet->set(
'show_shop_explorer', $_POST[
'show_shop_explorer'],
'gui');
2582 $ilSetting->set(
'payment_notification', $_POST[
'payment_notification'] ? 1 : 0);
2583 $ilSetting->set(
'payment_notification_days', $_POST[
'payment_notification_days']);
2586 if($check ==
true && (
int)$_POST[
'shop_enabled'])
2588 $genSet->set(
'shop_enabled', 1,
'common');
2592 $genSet->set(
'shop_enabled', 0,
'common');
2596 $this->generalSettingsObject();
2600 public function paypalSettingsObject()
2609 if(!$rbacsystem->checkAccess(
'read', $this->object->getRefId()))
2611 $this->ilErr->raiseError($this->lng->txt(
'msg_no_perm_read'),$this->ilErr->MESSAGE);
2614 include_once
'./Services/Payment/classes/class.ilPaypalSettings.php';
2616 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.main_view.html',
'Services/Payment');
2621 $form->setFormAction($this->ctrl->getFormAction($this,
'savePaypalSettings'));
2622 $form->setTitle($this->lng->txt(
'pays_paypal_settings'));
2624 $form->addCommandButton(
'savePaypalSettings',$this->lng->txt(
'save'));
2626 $formItem =
new ilTextInputGUI($this->lng->txt(
'pays_server_host'),
'server_host');
2627 $formItem->
setValue($ppSet->getServerHost());
2628 $form->addItem($formItem);
2630 $formItem =
new ilTextInputGUI($this->lng->txt(
'pays_server_path'),
'server_path');
2631 $formItem->
setValue($ppSet->getServerPath());
2632 $form->addItem($formItem);
2634 $formItem =
new ilTextInputGUI($this->lng->txt(
'pays_email_vendor'),
'vendor');
2635 $formItem->
setValue($ppSet->getVendor());
2636 $form->addItem($formItem);
2643 $formItem =
new ilTextInputGUI($this->lng->txt(
'pays_auth_token'),
'auth_token');
2644 $formItem->
setValue($ppSet->getAuthToken());
2645 $form->addItem($formItem);
2647 $formItem =
new ilTextInputGUI($this->lng->txt(
'pays_page_style'),
'page_style');
2648 $formItem->
setValue($ppSet->getPageStyle());
2649 $form->addItem($formItem);
2651 $this->tpl->setVariable(
'FORM',
$form->getHTML());
2656 include_once
'./Services/Payment/classes/class.ilPaypalSettings.php';
2661 if(!$rbacsystem->checkAccess(
'read', $this->object->getRefId()))
2663 $this->ilErr->raiseError($this->lng->txt(
'msg_no_perm_read'),$this->ilErr->MESSAGE);
2676 if ($_POST[
'server_host'] ==
'' ||
2677 $_POST[
'server_path'] ==
'' ||
2678 $_POST[
'vendor'] ==
'' ||
2680 $_POST[
'auth_token'] ==
'')
2682 $this->error = $this->lng->txt(
'pays_paypal_settings_not_valid');
2684 $this->paypalSettingsObject();
2691 $this->paypalSettingsObject();
2702 #include_once './Services/Table/classes/class.ilTable2GUI.php';
2704 global $rbacsystem, $ilToolbar;
2707 if(!$rbacsystem->checkAccess(
'read', $this->object->getRefId()))
2709 $this->ilErr->raiseError($this->lng->txt(
'msg_no_perm_read'),$this->ilErr->MESSAGE);
2714 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.main_view.html',
'Services/Payment');
2721 'auto_complete_name' => $this->lng->txt(
'user'),
2722 'user_type' => null,
2723 'submit_name' => $this->lng->txt(
'add')
2726 if(!count($vendors = $this->vendors_obj->getVendors()))
2736 $oConfirmationGUI->setFormAction($this->ctrl->getFormAction($this,
"performDeleteVendors"));
2737 $oConfirmationGUI->setHeaderText($this->lng->txt(
"pays_sure_delete_selected_vendors"));
2738 $oConfirmationGUI->setCancel($this->lng->txt(
"cancel"),
"vendors");
2739 $oConfirmationGUI->setConfirm($this->lng->txt(
"confirm"),
"performDeleteVendors");
2741 foreach($vendors as $vendor)
2743 if(in_array($vendor[
'vendor_id'],
$_SESSION[
'pays_vendor']))
2749 $delete_row = $tmp_obj->getLogin().
' '.
2750 $vendor[
'cost_center'].
' '.
2752 $oConfirmationGUI->addItem(
'',$delete_row, $delete_row);
2758 if(count($vendors) == count(
$_SESSION[
'pays_vendor']))
2763 $this->tpl->setVariable(
'CONFIRMATION', $oConfirmationGUI->getHTML()); #
2768 $f_result = array();
2769 foreach($vendors as $vendor)
2775 $_SESSION[
'pays_vendor']) ? 1 : 0,
"vendor[]", $vendor[
'vendor_id']);
2776 $f_result[$counter][
'login'] = $tmp_obj->getLogin();
2777 $f_result[$counter][
'cost_center'] = $vendor[
'cost_center'];
2791 include_once
'./Services/Payment/classes/class.ilPaymentExcelWriterAdapter.php';
2801 $workbook = $pewa->getWorkbook();
2802 @$workbook->close();
2807 include_once
'./Services/Excel/classes/class.ilExcelUtils.php';
2808 include_once
'./Services/Payment/classes/class.ilPaymentVendors.php';
2812 $workbook = $pewa->getWorkbook();
2813 $worksheet = $workbook->addWorksheet(utf8_decode($this->lng->txt(
'bookings')));
2815 $worksheet->mergeCells(0,0,0,3);
2816 $worksheet->setColumn(0,0,16);
2817 $worksheet->setColumn(0,1,32);
2818 $worksheet->setColumn(0,2,32);
2819 $worksheet->setColumn(0,3,16);
2820 $worksheet->setColumn(0,4,16);
2821 $worksheet->setColumn(0,5,16);
2822 $worksheet->setColumn(0,6,24);
2823 $worksheet->setColumn(0,7,8);
2824 $worksheet->setColumn(0,8,12);
2825 $worksheet->setColumn(0,9,16);
2827 $title = $this->lng->txt(
'bookings');
2828 $title .=
' '.$this->lng->txt(
'as_of').
' ';
2829 $title .= strftime(
'%Y-%m-%d %R',time());
2831 $worksheet->writeString(0,0,$title,$pewa->getFormatTitle());
2833 $worksheet->writeString(1,0,$this->lng->txt(
'payment_system'),$pewa->getFormatHeader());
2834 $worksheet->writeString(1,1,$this->lng->txt(
'paya_transaction'),$pewa->getFormatHeader());
2835 $worksheet->writeString(1,2,$this->lng->txt(
'title'),$pewa->getFormatHeader());
2836 $worksheet->writeString(1,3,$this->lng->txt(
'paya_vendor'),$pewa->getFormatHeader());
2837 $worksheet->writeString(1,4,$this->lng->txt(
'pays_cost_center'),$pewa->getFormatHeader());
2838 $worksheet->writeString(1,5,$this->lng->txt(
'paya_customer'),$pewa->getFormatHeader());
2839 $worksheet->writeString(1,6,$this->lng->txt(
'email'),$pewa->getFormatHeader());
2840 $worksheet->writeString(1,7,$this->lng->txt(
'paya_order_date'),$pewa->getFormatHeader());
2841 $worksheet->writeString(1,8,$this->lng->txt(
'duration'),$pewa->getFormatHeader());
2842 $worksheet->writeString(1,9,$this->lng->txt(
'price_a'),$pewa->getFormatHeader());
2843 $worksheet->writeString(1,10,$this->lng->txt(
'paya_payed_access'),$pewa->getFormatHeader());
2845 $worksheet->writeString(1,11,$this->lng->txt(
'street'),$pewa->getFormatHeader());
2846 $worksheet->writeString(1,12,$this->lng->txt(
'pay_bmf_po_box'),$pewa->getFormatHeader());
2847 $worksheet->writeString(1,13,$this->lng->txt(
'zipcode'),$pewa->getFormatHeader());
2848 $worksheet->writeString(1,14,$this->lng->txt(
'city'),$pewa->getFormatHeader());
2849 $worksheet->writeString(1,15,$this->lng->txt(
'country'),$pewa->getFormatHeader());
2851 if(!count($bookings = $this->booking_obj->getBookings()))
2856 include_once
'Services/User/classes/class.ilObjUser.php';
2857 $object_title_cache = array();
2858 $user_title_cache = array();
2861 foreach($bookings as $booking)
2863 if(array_key_exists($booking[
'ref_id'], $object_title_cache))
2865 $tmp_obj = $object_title_cache[$booking[
'ref_id']];
2870 $object_title_cache[$booking[
'ref_id']] = $tmp_obj;
2872 if(array_key_exists($booking[
'b_vendor_id'], $user_title_cache))
2874 $tmp_vendor = $user_title_cache[$booking[
'b_vendor_id']];
2879 $user_title_cache[$booking[
'b_vendor_id']] = $tmp_vendor;
2881 if(array_key_exists($booking[
'customer_id'], $user_title_cache))
2883 $tmp_purchaser = $user_title_cache[$booking[
'customer_id']];
2890 $tmp_purchaser =
''.$tmp_purchaser_name[
'firstname'].
' '.$tmp_purchaser_name[
'lastname'].
' ['.$tmp_purchaser_login.
']';
2891 $user_title_cache[$booking[
'customer_id']] = $tmp_purchaser;
2894 include_once
'./Services/Payment/classes/class.ilPayMethods.php';
2897 $worksheet->writeString($counter,0,$str_paymethod);
2898 $worksheet->writeString($counter,1,$booking[
'transaction']);
2899 $worksheet->writeString($counter,2,($tmp_obj !=
'' ? $tmp_obj : $this->lng->txt(
'object_deleted')));
2900 $worksheet->writeString($counter,3,($tmp_vendor !=
'' ? $tmp_vendor : $this->lng->txt(
'user_deleted')));
2901 $worksheet->writeString($counter,4,ilPaymentVendors::_getCostCenter($booking[
'b_vendor_id']));
2902 $worksheet->writeString($counter,5,($tmp_purchaser !=
'' ? $tmp_purchaser : $this->lng->txt(
'user_deleted')));
2903 $worksheet->writeString($counter,6,$tmp_purchaser_email);
2904 $worksheet->writeString($counter,7,strftime(
'%Y-%m-%d %R',$booking[
'order_date']));
2905 $worksheet->writeString($counter,8,$booking[
'duration']);
2906 $worksheet->writeString($counter,9,$booking[
'price']);
2908 $payed_access = $booking[
'payed'] ?
2909 $this->lng->txt(
'yes') :
2910 $this->lng->txt(
'no');
2912 $payed_access .=
'/';
2913 $payed_access .= $booking[
'access_granted'] ?
2914 $this->lng->txt(
'yes') :
2915 $this->lng->txt(
'no');
2917 $worksheet->writeString($counter,10,$payed_access);
2919 $worksheet->writeString($counter,11,$booking[
'street']);
2920 $worksheet->writeString($counter,12,$booking[
'po_box']);
2921 $worksheet->writeString($counter,13,$booking[
'zipcode']);
2922 $worksheet->writeString($counter,14,$booking[
'city']);
2923 $worksheet->writeString($counter,15,$booking[
'country']);
2927 unset($tmp_purchaser);
2936 include_once
'./Services/Excel/classes/class.ilExcelUtils.php';
2938 $workbook = $pewa->getWorkbook();
2939 $worksheet = $workbook->addWorksheet($this->lng->txt(
'pays_vendor'));
2942 $worksheet->mergeCells(0,0,0,2);
2943 $worksheet->setColumn(1,0,32);
2944 $worksheet->setColumn(1,1,32);
2945 $worksheet->setColumn(1,2,32);
2947 $title = $this->lng->txt(
'pays_vendor');
2948 $title .=
' '.$this->lng->txt(
'as_of').
' ';
2949 $title .= strftime(
'%Y-%m-%d %R',time());
2951 $worksheet->writeString(0,0,$title,$pewa->getFormatTitle());
2953 $worksheet->writeString(1,0,$this->lng->txt(
'login'),$pewa->getFormatHeader());
2954 $worksheet->writeString(1,1,$this->lng->txt(
'fullname'),$pewa->getFormatHeader());
2955 $worksheet->writeString(1,2,$this->lng->txt(
'pays_cost_center'),$pewa->getFormatHeader());
2957 if(!count($vendors = $this->vendors_obj->getVendors()))
2963 foreach($vendors as $vendor)
2968 $worksheet->writeString($counter,0,$tmp_obj->getLogin());
2969 $worksheet->writeString($counter,1,$tmp_obj->getFullname());
2970 $worksheet->writeString($counter,2,$vendor[
'cost_center']);
2980 include_once
'./Services/Payment/classes/class.ilPayMethods.php';
2984 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.main_view.html',
'Services/Payment');
2986 if(!$rbacsystem->checkAccess(
'read', $this->object->getRefId()))
2988 $this->ilErr->raiseError($this->lng->txt(
'msg_no_perm_read'),$this->ilErr->MESSAGE);
2991 if(count($askForDeletingAddresses))
2996 $oConfirmationGUI->setFormAction($ilCtrl->getFormAction($this,
"deleteAddressesForPaymethods"));
2997 $oConfirmationGUI->setHeaderText($this->lng->txt(
"info_delete_sure"));
2998 $oConfirmationGUI->setCancel($this->lng->txt(
"cancel"),
"payMethods");
2999 $oConfirmationGUI->setConfirm($this->lng->txt(
"confirm"),
"deleteAddressesForPaymethods");
3001 foreach($askForDeletingAddresses as $pm_id)
3004 $oConfirmationGUI->additem(
'paymethod['.$pm_obj->getPmId().
']',$pm_obj->getPmId(), $this->lng->txt(
'delete_addresses_bill').
' -> '.
ilPayMethods::getStringByPaymethod($pm_obj->getPmTitle()));
3007 $this->tpl->setVariable(
'CONFIRMATION', $oConfirmationGUI->getHtml());
3012 $paymethods = $obj_paymethods->readAll();
3016 foreach($paymethods as $paymethod)
3018 if($paymethod[
'pm_title'] !=
'epay')
3022 $result[$counter][
'save_usr_adr'] =
ilUtil::formCheckbox($paymethod[
'save_usr_adr'] ? 1 : 0,
'save_usr_adr['.$paymethod[
'pm_id'].
']',1);
3023 $this->ctrl->clearParameters($this);
3028 $this->ctrl->setParameter($this,
'cmd',
'savePayMethods');
3030 $tbl->setTitle($this->lng->txt(
'pays_pay_methods'));
3032 $tbl->setId(
'tbl_paymethods');
3033 $tbl->setRowTemplate(
"tpl.shop_paymethods_row.html",
"Services/Payment");
3035 $tbl->addColumn($this->lng->txt(
'title'),
'pm_title',
'10%');
3036 $tbl->addColumn($this->lng->txt(
'enabled'),
'pm_enabled',
'10%');
3037 $tbl->addColumn($this->lng->txt(
'save_customer_address'),
'save_usr_adr',
'10%');
3038 $tbl->addCommandButton(
'savePayMethods', $this->lng->txt(
'save'));
3040 $tbl->disable(
'sort');
3043 $this->tpl->setVariable(
'TABLE', $tbl->getHTML());
3050 include_once
'./Services/Payment/classes/class.ilPayMethods.php';
3054 if(!$rbacsystem->checkAccess(
'read', $this->object->getRefId()))
3056 $this->ilErr->raiseError($this->lng->txt(
'msg_no_perm_read'),$this->ilErr->MESSAGE);
3060 $paymethods = $obj_paymethods->readAll();
3062 $askForDeletingAddresses = array();
3064 $pm_enabled = (array)$_POST[
'pm_enabled'];
3065 $pm_addr = (array)$_POST[
'save_usr_adr'];
3070 $this->genSetData->set(
'shop_enabled', 0,
'common');
3074 $info_msg = array();
3075 foreach($paymethods as $paymethod)
3078 (!isset($pm_enabled[$paymethod[
'pm_id']]) || !$pm_enabled[$paymethod[
'pm_id']]) &&
3079 $paymethod[
'pm_enabled']
3084 $info_msg[] = $this->lng->txt(
'pays_objects_'.$paymethod[
'pm_title'].
'_exist');
3096 foreach($paymethods as $paymethod)
3099 (!isset($pm_enabled[$paymethod[
'pm_id']]) || !$pm_enabled[$paymethod[
'pm_id']]) &&
3100 $paymethod[
'pm_enabled']
3106 else if(isset($pm_enabled[$paymethod[
'pm_id']]) && $pm_enabled[$paymethod[
'pm_id']] && !$paymethod[
'pm_enabled'])
3113 (!isset($pm_addr[$paymethod[
'pm_id']]) || !$pm_addr[$paymethod[
'pm_id']]) &&
3114 $paymethod[
'save_usr_adr'])
3116 $askForDeletingAddresses[] = $paymethod[
'pm_id'];
3119 (!isset($pm_addr[$paymethod[
'pm_id']]) || !$pm_addr[$paymethod[
'pm_id']]) &&
3120 !$paymethod[
'save_usr_adr']
3131 if($num_changed && !$askForDeletingAddresses)
3153 if(!count($_POST[
'vendor']))
3161 foreach($_POST[
'vendor'] as $vendor)
3172 $_SESSION[
'pays_vendor'] = $_POST[
'vendor'];
3181 include_once
'./Services/Payment/classes/class.ilPaymentTrustees.php';
3186 if(!$rbacsystem->checkAccess(
'write', $this->object->getRefId()))
3188 $this->ilErr->raiseError($this->lng->txt(
'msg_no_perm_write'),$this->ilErr->MESSAGE);
3191 foreach(
$_SESSION[
'pays_vendor'] as $vendor)
3193 $this->vendors_obj->delete($vendor);
3201 $this->genSetData->set(
'shop_enabled', 0,
'common');
3215 if(!$rbacsystem->checkAccess(
"write", $this->object->getRefId()))
3217 $this->ilErr->raiseError($this->lng->txt(
"msg_no_perm_write"),$this->ilErr->MESSAGE);
3220 if(!count($_POST[
'vendor']))
3227 if(count($_POST[
'vendor']) > 1)
3235 $_SESSION[
'pays_vendor'] = $_POST[
'vendor'][0];
3237 if (!is_array($this->vendors_obj->vendors[
$_SESSION[
'pays_vendor']]))
3244 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.main_view.html',
'Services/Payment');
3247 $form_gui->setFormAction($this->ctrl->getFormAction($this,
'performEditVendor'));
3248 $form_gui->setTitle($this->lng->txt(
'pays_vendor'));
3252 $form_gui->addItem($oVendorGUI);
3254 $oCostcenterGUI =
new ilTextInputGUI($this->lng->txt(
'pays_cost_center'),
'cost_center');
3255 $oCostcenterGUI->
setValue($this->error !=
'' && isset($_POST[
'cost_center'])
3258 $form_gui->addItem($oCostcenterGUI);
3260 $form_gui->addCommandButton(
'performEditVendor',$this->lng->txt(
'save'));
3261 $this->tpl->setVariable(
'FORM', $form_gui->getHTML());
3270 if(!$rbacsystem->checkAccess(
'write', $this->object->getRefId()))
3272 $this->ilErr->raiseError($this->lng->txt(
'msg_no_perm_write'),$this->ilErr->MESSAGE);
3290 if (!is_array($this->vendors_obj->vendors[
$_SESSION[
'pays_vendor']]))
3296 if ($_POST[
'cost_center'] ==
'')
3298 $this->error = $this->lng->txt(
'pays_cost_center_not_valid');
3300 $_POST[
'vendor'] = array(
$_SESSION[
'pays_vendor']);
3301 return $this->editVendor();
3305 $this->vendors_obj->update(
$_SESSION[
'pays_vendor'], $_POST[
'cost_center']);
3316 global $rbacsystem, $ilToolbar;
3319 if(!$rbacsystem->checkAccess(
'read', $this->object->getRefId()))
3321 $this->ilErr->raiseError($this->lng->txt(
'msg_no_perm_read'),$this->ilErr->MESSAGE);
3324 $ilToolbar->addButton($this->lng->txt(
'back'), $this->ctrl->getLinkTarget($this,
'statistic'));
3328 include_once(
"./Services/Payment/classes/class.ilPaymentObjectSelector.php");
3330 if (!$exp->handleCommand())
3332 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.paya_object_selector.html",
'Services/Payment');
3333 $this->tpl->setVariable(
"EXPLORER",$exp->getHTML());
3343 if(!$rbacsystem->checkAccess(
'read', $this->object->getRefId()))
3345 $this->ilErr->raiseError($this->lng->txt(
'msg_no_perm_read'),$this->ilErr->MESSAGE);
3348 $_SESSION[
'pays_search_str'] = $_POST[
'search_str'] = $_POST[
'search_str'] ? $_POST[
'search_str'] :
$_SESSION[
'pays_search_str'];
3350 if(!isset($_POST[
'search_str']))
3353 $this->searchUserObject();
3360 $this->searchUserObject();
3365 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.main_view.html',
'Services/Payment');
3368 $f_result = array();
3376 $f_result[$counter][
'login'] = $tmp_obj->getLogin();
3377 $f_result[$counter][
'lastname'] = $tmp_obj->getLastname();
3378 $f_result[$counter][
'firstname'] = $tmp_obj->getFirstname();
3393 if(!$rbacsystem->checkAccess(
'write', $this->object->getRefId()))
3395 $this->ilErr->raiseError($this->lng->txt(
'msg_no_perm_write'),$this->ilErr->MESSAGE);
3397 if(!$_POST[
'user_login'])
3412 if($this->vendors_obj->isAssigned($usr_id))
3419 $this->vendors_obj->add($usr_id);
3432 if(!$rbacsystem->checkAccess(
'write', $this->object->getRefId()))
3434 $this->ilErr->raiseError($this->lng->txt(
'msg_no_perm_write'),$this->ilErr->MESSAGE);
3437 $this->lng->loadLanguageModule(
'crs');
3438 if(!is_array($_POST[
'user']))
3446 $already_assigned = $assigned = 0;
3447 foreach($_POST[
'user'] as $usr_id)
3449 if($this->vendors_obj->isAssigned($usr_id))
3451 ++$already_assigned;
3454 $this->vendors_obj->add($usr_id);
3462 $message .= $this->lng->txt(
'pays_assigned_vendors').
' '.$assigned;
3464 if($already_assigned)
3466 $message .=
'<br />'.$this->lng->txt(
'pays_already_assigned_vendors').
' '.$already_assigned;
3479 if(!isset($_GET[
'sell_id']))
3481 ilUtil::sendFailiure($this->lng->txt(
'paya_no_booking_id_given'));
3487 $ilToolbar->addButton($this->lng->txt(
'back'), $this->ctrl->getLinkTarget($this,
'showObjectSelector'));
3488 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.main_view.html',
'Services/Payment');
3490 $this->lng->loadLanguageModule(
'search');
3491 $this->ctrl->setParameter($this,
'sell_id', $_GET[
'sell_id']);
3494 $form_gui->setFormAction($this->ctrl->getFormAction($this));
3495 $form_gui->setTitle($this->lng->txt(
'search_user'));
3496 $form_gui->setId(
'search_form');
3498 $oTitle =
new ilTextInputGUI($this->lng->txt(
'search_search_term'),
'search_str');
3500 $oTitle->setSize(40);
3501 $oTitle->setValue($_POST[
'search_str']);
3502 $form_gui->addItem($oTitle);
3505 $form_gui->addCommandButton(
'performSearchSP', $this->lng->txt(
'search'));
3506 $form_gui->addCommandButton(
'bookings', $this->lng->txt(
'cancel'));
3508 $this->tpl->setVariable(
'FORM',$form_gui->getHTML());
3516 $_SESSION[
'paya_search_str_user_sp'] = $_POST[
'search_str'] = $_POST[
'search_str'] ? $_POST[
'search_str'] :
$_SESSION[
'paya_search_str_user_sp'];
3518 if(!trim($_POST[
'search_str']))
3521 $this->statistics();
3533 if(!isset($_GET[
'sell_id']))
3541 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.main_view.html',
'Services/Payment');
3542 $this->ctrl->setParameter($this,
'sell_id', $_GET[
'sell_id']);
3544 $ilToolbar->addButton($this->lng->txt(
'back'), $this->ctrl->getLinkTarget($this,
'searchUserSP'));
3547 $f_result = array();
3554 $f_result[$counter][
'user_id'] = $user[
'id'];
3555 $f_result[$counter][
'login'] = $tmp_obj->getLogin();
3556 $f_result[$counter][
'firstname'] = $tmp_obj->getFirstname();
3557 $f_result[$counter][
'lastname'] = $tmp_obj->getLastname();
3569 if ($_POST[
'sell_id'] !=
'') $_GET[
'sell_id'] = $_POST[
'sell_id'];
3570 if ($_GET[
'user_id'] !=
'') $_POST[
'user_id'] = $_GET[
'user_id'];
3572 if(!isset($_GET[
'sell_id']))
3580 if(!isset($_POST[
'user_id']))
3587 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.main_view.html',
'Services/Payment');
3588 $this->ctrl->setParameter($this,
'sell_id', $_GET[
'sell_id']);
3590 $ilToolbar->addButton($this->lng->txt(
'back'), $this->ctrl->getLinkTarget($this,
'searchUserSP'));
3592 $this->ctrl->setParameter($this,
'user_id', $_POST[
'user_id']);
3601 $tmp_object[
'title'] = $tmp_obj->getTitle();
3605 $tmp_object[
'title'] = $this->lng->txt(
'object_not_found');
3613 $oForm->setFormAction($this->ctrl->getFormAction($this,
'saveCustomer'));
3614 $oForm->setTitle($this->lng->txt($tmp_user->getFullname().
' ['.$tmp_user->getLogin().
']'));
3618 $oTransaction->setTitle($this->lng->txt(
'paya_transaction'));
3620 $oTransaction->setValue($_POST[
'transaction']);
3621 $oTransaction->setPostVar(
'transaction');
3622 $oForm->addItem($oTransaction);
3626 $oObject->
setValue($tmp_obj->getTitle());
3627 $oForm->addItem($oObject);
3631 $oVendor->
setValue($tmp_vendor->getFullname().
' ['.$tmp_vendor->getLogin().
']');
3632 $oForm->addItem($oVendor);
3635 $oPayMethods =
new ilSelectInputGUI($this->lng->txt(
'paya_pay_method'),
'pay_method');
3636 $payOptions = ilPaymethods::getPayMethodsOptions(
false);
3637 $oPayMethods->setOptions($payOptions);
3638 $oPayMethods->setValue($_POST[
'pay_method']);
3639 $oPayMethods->setPostVar(
'pay_method');
3640 $oForm->addItem($oPayMethods);
3643 $duration_options = array();
3646 $standard_prices = array();
3647 $extension_prices = array();
3648 $standard_prices = $price_obj->getPrices();
3649 $extension_prices = $price_obj->getExtensionPrices();
3651 $prices = array_merge($standard_prices, $extension_prices );
3653 if (is_array($prices))
3656 $currency_unit = $genSet->get(
'currency_unit');
3658 foreach($prices as $price)
3660 switch($price[
'price_type'])
3664 $price[
'duration'].
' '.$this->lng->txt(
'paya_months').
' -> '.$price[
'price'].
' '. $currency_unit;
3668 include_once
'./Services/Calendar/classes/class.ilDatePresentation.php';
3675 $txt_duration = $this->lng->txt(
'unlimited_duration').
' -> '.$price[
'price'].
' '. $currency_unit;
3678 $txt_extension =
'';
3679 if($price[
'extension'] == 1)
3681 $txt_extension =
' ('.$this->lng->txt(
'extension_price').
') ';
3683 $duration_options[$price[
'price_id']] .= $txt_duration.
''.$txt_extension;
3687 $oDuration =
new ilSelectInputGUI($this->lng->txt(
'duration'),
'price_id');
3688 $oDuration->setOptions($duration_options);
3689 $oDuration->
setValue($_POST[
'price_id']);
3690 $oForm->addItem($oDuration);
3694 $payed_option = array(
'1'=>$this->lng->txt(
'yes'),
'0'=>$this->lng->txt(
'no'));
3696 $o_payed->setTitle($this->lng->txt(
'paya_payed'));
3697 $o_payed->setOptions($payed_option);
3698 $o_payed->setValue($_POST[
'payed']);
3699 $o_payed->setPostVar(
'payed');
3700 $oForm->addItem($o_payed);
3704 $access_option = array(
'1'=>$this->lng->txt(
'yes'),
'0'=>$this->lng->txt(
'no'));
3706 $o_access->setTitle($this->lng->txt(
'paya_access'));
3707 $o_access->setOptions($access_option);
3708 $o_access->setValue($_POST[
'access']);
3709 $o_access->setPostVar(
'access');
3711 $oForm->addItem($o_access);
3713 $oForm->addCommandButton(
'saveCustomer',$this->lng->txt(
'save'));
3714 $oForm->addCommandButton(
'bookings', $this->lng->txt(
'cancel'));
3716 $this->tpl->setVariable(
'FORM',$oForm->getHTML());
3722 global
$ilUser,$ilObjDataCache;
3724 if(!isset($_GET[
'sell_id']))
3732 if(!isset($_GET[
'user_id']))
3740 if ($_POST[
'pay_method'] ==
'' ||
3741 $_POST[
'price_id'] ==
'')
3756 $this->booking_obj->setTransaction($transaction);
3757 $this->booking_obj->setTransactionExtern($_POST[
'transaction']);
3758 $this->booking_obj->setPobjectId($pObjectId);
3759 $this->booking_obj->setCustomerId($_GET[
'user_id']);
3760 $this->booking_obj->setVendorId($obj->getVendorId());
3762 $this->booking_obj->setPayMethod($_POST[
'pay_method']);
3763 $this->booking_obj->setOrderDate(time());
3769 switch($price[
'price_type'])
3772 $this->booking_obj->setDuration($price[
'duration']);
3776 $this->booking_obj->setDuration(0);
3777 $this->booking_obj->setAccessStartdate($price[
'duration_from']);
3778 $this->booking_obj->setAccessEnddate($price[
'duration_until']);
3781 $this->booking_obj->setDuration(0);
3782 $this->booking_obj->setAccessEnddate(NULL);
3786 $this->booking_obj->setPriceType($price[
'price_type']);
3787 $this->booking_obj->setPrice($price[
'price']);
3789 $this->booking_obj->setAccess((
int) $_POST[
'access']);
3790 $this->booking_obj->setPayed((
int) $_POST[
'payed']);
3791 $this->booking_obj->setVoucher(
'');
3793 $obj_id = $ilObjDataCache->lookupObjId($obj->getRefId());
3794 $obj_type = $ilObjDataCache->lookupType(
$obj_id);
3795 $obj_title = $ilObjDataCache->lookupTitle(
$obj_id);
3798 $oVAT =
new ilShopVats((
int)$obj->getVatId());
3799 $obj_vat_rate = $oVAT->
getRate();
3800 $obj_vat_unit = $obj->getVat($this->booking_obj->getPrice());
3802 $this->booking_obj->setObjectTitle($obj_title);
3803 $this->booking_obj->setVatRate($obj_vat_rate);
3804 $this->booking_obj->setVatUnit($obj_vat_unit);
3807 $this->booking_obj->setCurrencyUnit( $genSet->get(
'currency_unit'));
3809 include_once
'./Services/Payment/classes/class.ilPayMethods.php';
3812 if($save_user_address_enabled == 1)
3815 $user_id[] = $_GET[
"user_id"];
3819 $this->booking_obj->setStreet($cust_obj[$_GET[
"user_id"]][
'street'],
'');
3821 $this->booking_obj->setZipcode($cust_obj[$_GET[
"user_id"]][
'zipcode']);
3822 $this->booking_obj->setCity($cust_obj[$_GET[
"user_id"]][
'city']);
3823 $this->booking_obj->setCountry($cust_obj[$_GET[
"user_id"]][
'country']);
3826 if($this->booking_obj->add())
3832 if($obj_type ==
'crs')
3851 $this->ctrl->setParameter($this,
'cmd',
'statistic');
3854 $tbl->setTitle($this->lng->txt(
"bookings"));
3855 $tbl->setId(
'tbl_show_statistics');
3856 $tbl->setRowTemplate(
"tpl.shop_statistics_row.html",
"Services/Payment");
3858 $tbl->addColumn($this->lng->txt(
'paya_transaction'),
'transaction',
'10%');
3859 $tbl->addColumn($this->lng->txt(
'title'),
'object_title',
'10%');
3860 $tbl->addColumn($this->lng->txt(
'paya_vendor'),
'vendor',
'10%');
3861 $tbl->addColumn($this->lng->txt(
'paya_customer'),
'customer',
'10%');
3862 $tbl->addColumn($this->lng->txt(
'paya_order_date'),
'order_date',
'10%');
3863 $tbl->addColumn($this->lng->txt(
'duration'),
'duration',
'20%');
3864 $tbl->addColumn($this->lng->txt(
'price_a'),
'price',
'5%');
3865 $tbl->addColumn($this->lng->txt(
'paya_coupons_coupon'),
'discount',
'5%');
3866 $tbl->addColumn($this->lng->txt(
'paya_payed_access'),
'payed_access',
'1%');
3867 $tbl->addColumn(
'',
'edit',
'5%');
3869 $tbl->addCommandButton(
'exportVendors',$this->lng->txt(
'excel_export'));
3870 $tbl->setData($a_result_set);
3872 $this->tpl->setVariable(
'TABLE', $tbl->getHTML());
3879 include_once
'./Services/Payment/classes/class.ilPaymentBookings.php';
3886 $this->ctrl->setParameter($this,
'cmd',
'vendors');
3889 $tbl->setTitle($this->lng->txt(
"vendors"));
3890 $tbl->setId(
'tbl_show_vendors');
3891 $tbl->setRowTemplate(
"tpl.shop_users_row.html",
"Services/Payment");
3893 $tbl->addColumn(
'',
'vendor_id',
'1%');
3894 $tbl->addColumn($this->lng->txt(
'paya_vendor'),
'login',
'10%');
3895 $tbl->addColumn($this->lng->txt(
'pays_cost_center'),
'cost_center',
'10%');
3896 $tbl->addColumn($this->lng->txt(
'pays_number_bookings'),
'number_bookings',
'10%');
3898 $tbl->addMultiCommand(
"editVendor", $this->lng->txt(
'pays_edit_vendor'));
3899 $tbl->addMultiCommand(
"deleteVendors", $this->lng->txt(
'pays_delete_vendor'));
3901 $tbl->addCommandButton(
'exportVendors',$this->lng->txt(
'excel_export'));
3903 $tbl->setData($a_result_set);
3904 $this->tpl->setVariable(
'TABLE', $tbl->getHTML());
3913 $tbl->setTitle($this->lng->txt(
"pays_header_select_vendor"));
3914 $tbl->setId(
'tbl_search_user_vendor');
3915 $tbl->setRowTemplate(
"tpl.shop_users_row.html",
"Services/Payment");
3917 $tbl->addColumn(
' ',
'vendor_id',
'3%',
true);
3918 $tbl->addColumn($this->lng->txt(
'login'),
'login',
'32%');
3919 $tbl->addColumn($this->lng->txt(
'firstname'),
'firstname',
'32%');
3920 $tbl->addColumn($this->lng->txt(
'lastname'),
'lastname',
'32%');
3922 $tbl->setSelectAllCheckbox(
'vendor_id');
3923 $tbl->addMultiCommand(
"addUser", $this->lng->txt(
"add"));
3924 $tbl->addCommandButton(
'vendors',$this->lng->txt(
'cancel'));
3927 $tbl->setData($a_result_set);
3928 $this->tpl->setVariable(
'TABLE', $tbl->getHTML());
3935 include_once(
'./Services/Search/classes/class.ilSearch.php');
3937 $this->lng->loadLanguageModule(
'content');
3940 $search->setPerformUpdate(
false);
3942 $search->setCombination(
'and');
3943 $search->setSearchFor(array(0 =>
'usr'));
3944 $search->setSearchType(
'new');
3946 if($search->validate($message))
3948 $search->performSearch();
3953 $this->ctrl->redirect($this,
'searchUser');
3955 return $search->getResultByType(
'usr');
3960 include_once(
'./Services/Search/classes/class.ilSearch.php');
3962 $this->lng->loadLanguageModule(
'content');
3964 $search =
new ilSearch($this->user_obj->getId());
3967 $search->setCombination(
'and');
3968 $search->setSearchFor(array(0 =>
'usr'));
3969 $search->setSearchType(
'new');
3971 if($search->validate($message))
3973 $search->performSearchSPObject();
3978 $this->ctrl->redirect($this,
'searchUserSP');
3980 return $search->getResultByType(
'usr');
3984 $this->ctrl->setParameter($this,
'sell_id', $_GET[
'sell_id']);
3987 $tbl->setTitle($this->lng->txt(
'users'));
3988 $tbl->setId(
'tbl_search_user_vendor');
3989 $tbl->setRowTemplate(
"tpl.shop_users_row.html",
"Services/Payment");
3991 $tbl->addColumn(
' ',
'user_id',
'3%',
true);
3992 $tbl->addColumn($this->lng->txt(
'login'),
'login',
'32%');
3993 $tbl->addColumn($this->lng->txt(
'firstname'),
'firstname',
'32%');
3994 $tbl->addColumn($this->lng->txt(
'lastname'),
'lastname',
'32%');
3997 $tbl->addMultiCommand(
"addCustomer", $this->lng->txt(
"add"));
3998 $tbl->addCommandButton(
'statistic',$this->lng->txt(
'cancel'));
4001 $tbl->setData($a_result_set);
4002 $this->tpl->setVariable(
'TABLE', $tbl->getHTML());
4010 if(!$ilAccess->checkAccess(
'read',
'', $this->object->getRefId()))
4012 $this->ilErr->raiseError($this->lng->txt(
'msg_no_perm_read'), $this->ilErr->MESSAGE);
4015 include_once
'Services/Table/classes/class.ilTable2GUI.php';
4017 $tbl->setId(
'pay_vats_tbl');
4018 $tbl->setFormAction($this->ctrl->getFormAction($this),
'createVat');
4019 $tbl->setTitle($this->lng->txt(
'payment_tax_rates'));
4020 $tbl->setRowTemplate(
'tpl.shop_vats_list_row.html',
'Services/Payment');
4022 $tbl->setDefaultOrderField(
'title');
4024 $tbl->addColumn(
'',
'check',
'1%');
4025 $tbl->addColumn($this->lng->txt(
'vat_title'),
'vat_title',
'33%');
4026 $tbl->addColumn($this->lng->txt(
'vat_rate'),
'vat_rate',
'33%');
4027 $tbl->addColumn(
'',
'commands',
'33%');
4030 $oShopVatsList->read();
4034 $_SESSION[
'count_vats'] = $oShopVatsList->getNumItems();
4036 if($oShopVatsList->hasItems())
4038 $tbl->enable(
'select_all');
4039 $tbl->setSelectAllCheckbox(
'vat_id');
4042 foreach($oShopVatsList as $oVAT)
4045 $result[$counter][
'vat_title'] = $oVAT->getTitle();
4047 $this->ctrl->setParameter($this,
'vat_id', $oVAT->getId());
4048 $result[$counter][
'edit_text'] = $this->lng->txt(
'edit');
4049 $result[$counter][
'edit_url'] = $this->ctrl->getLinkTarget($this,
'editVat');
4050 $result[$counter][
'delete_text'] = $this->lng->txt(
'delete');
4051 $result[$counter][
'delete_url'] = $this->ctrl->getLinkTarget($this,
'confirmDeleteVat');
4052 $this->ctrl->clearParameters($this);
4056 $tbl->addMultiCommand(
'confirmDeleteVat', $this->lng->txt(
'delete'));
4060 $tbl->disable(
'header');
4061 $tbl->disable(
'footer');
4063 $tbl->setNoEntriesText($this->lng->txt(
'paya_no_vats_assigned'));
4068 $tbl->addCommandButton(
'createVat', $this->lng->txt(
'paya_insert_vats'));
4070 $this->tpl->setContent($tbl->getHTML());
4077 if((
int)$_GET[
'vat_id'] && !isset($_POST[
'vat_id']))
4079 $_POST[
'vat_id'][] = $_GET[
'vat_id'];
4082 if(
$_SESSION[
'count_vats'] == count($_POST[
'vat_id']))
4089 $c_gui->setFormAction($this->ctrl->getFormAction($this,
'performDeleteVat'));
4090 $c_gui->setHeaderText($this->lng->txt(
'paya_sure_delete_vats'));
4091 $c_gui->setCancel($this->lng->txt(
'cancel'),
'vats');
4092 $c_gui->setConfirm($this->lng->txt(
'confirm'),
'performDeleteVat');
4095 foreach((array)$_POST[
'vat_id'] as $vat_id)
4100 $c_gui->addItem(
'vat_id[]', $oVAT->getId(), $oVAT->getTitle());
4112 $this->tpl->setContent($c_gui->getHTML());
4124 if(!is_array($_POST[
'vat_id']))
4129 foreach($_POST[
'vat_id'] as $vat_id)
4147 $this->genSetData->set(
'shop_enabled', 0,
'common');
4156 $this->tpl->setContent($this->form->getHtml());
4163 $this->tpl->setContent($this->form->getHtml());
4169 if($a_type ==
'edit')
4171 $this->ctrl->setParameter($this,
'vat_id', $_GET[
'vat_id']);
4172 $this->form->setFormAction($this->ctrl->getFormAction($this,
'updateVat'));
4173 $this->form->setTitle($this->lng->txt(
'payment_edit_vat'));
4177 $this->form->setFormAction($this->ctrl->getFormAction($this,
'saveVat'));
4178 $this->form->setTitle($this->lng->txt(
'payment_add_vat'));
4181 $oTitle =
new ilTextInputGUI($this->lng->txt(
'title'),
'vat_title');
4183 $oTitle->setSize(40);
4184 $oTitle->setRequired(
true);
4185 $oTitle->setInfo($this->lng->txt(
'payment_vat_title_info'));
4186 $this->form->addItem($oTitle);
4188 $oRate =
new ilTextInputGUI($this->lng->txt(
'vat_rate'),
'vat_rate');
4191 $oRate->setRequired(
true);
4192 $oRate->setInfo($this->lng->txt(
'payment_vat_rate_info'));
4193 $this->form->addItem($oRate);
4195 if($a_type ==
'edit')
4197 $this->form->addCommandButton(
'updateVat', $this->lng->txt(
'save'));
4201 $this->form->addCommandButton(
'saveVat', $this->lng->txt(
'save'));
4204 $this->form->addCommandButton(
'vats', $this->lng->txt(
'cancel'));
4209 $oVAT =
new ilShopVats((
int)$_GET[
'vat_id']);
4210 $this->form->setValuesByArray(array(
4211 'vat_title' => $oVAT->getTitle(),
4212 'vat_rate' => $oVAT->getRate()
4219 if(!$this->form->checkInput())
4221 $this->form->setValuesByPost();
4222 $this->tpl->setContent($this->form->getHtml());
4228 $this->form->getItemByPostVar(
'vat_rate')->setAlert($this->lng->txt(
'payment_vat_input_invalid'));
4229 $this->form->setValuesByPost();
4230 $this->tpl->setContent($this->form->getHtml());
4236 $oVAT =
new ilShopVats((
int)$_GET[
'vat_id']);
4237 $oVAT->setTitle($this->form->getInput(
'vat_title'));
4238 $oVAT->setRate((
float)str_replace(
',',
'.', $this->form->getInput(
'vat_rate')));
4244 $this->form->setValuesByPost();
4245 $this->tpl->setContent($this->form->getHtml());
4256 if(!$this->form->checkInput())
4258 $this->form->setValuesByPost();
4259 $this->tpl->setContent($this->form->getHtml());
4265 $this->form->getItemByPostVar(
'vat_rate')->setAlert($this->lng->txt(
'payment_vat_input_invalid'));
4266 $this->form->setValuesByPost();
4267 $this->tpl->setContent($this->form->getHtml());
4274 $oVAT->setTitle($this->form->getInput(
'vat_title'));
4275 $oVAT->setRate((
float)str_replace(
',',
'.', $this->form->getInput(
'vat_rate')));
4281 $this->form->setValuesByPost();
4282 $this->tpl->setContent($this->form->getHtml());
4296 include_once
'./Services/Payment/classes/class.ilPayMethods.php';
4299 foreach($_POST[
'paymethod'] as $pay_method)
4302 $del_bookings = $this->booking_obj->deleteAddressesByPaymethod((
int)$pay_method);
4311 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.main_view.html',
'Services/Payment');
4315 foreach($currency_res as $cur)
4318 $f_result[$counter][
'is_default'] = $cur[
'is_default'] == 1 ? $this->lng->txt(
'yes') : $this->lng->txt(
'no');
4320 $f_result[$counter][
'currency_unit'] = $cur[
'unit'];
4321 $f_result[$counter][
'iso_code'] = $cur[
'iso_code'];
4322 $f_result[$counter][
'currency_symbol'] = $cur[
'symbol'];
4323 $f_result[$counter][
'conversion_rate'] = $cur[
'conversion_rate'];
4330 $tbl->setTitle($this->lng->txt(
"currencies"));
4331 $tbl->setId(
'tbl_show_currencies');
4332 $tbl->setRowTemplate(
"tpl.shop_currencies_row.html",
"Services/Payment");
4334 $tbl->addColumn(
' ',
'currency_id',
'1%',
true);
4335 $tbl->addColumn($this->lng->txt(
'is_default'),
'is_default',
'5%');
4336 $tbl->addColumn($this->lng->txt(
'currency_unit'),
'currency_unit',
'10%');
4337 $tbl->addColumn($this->lng->txt(
'iso_code'),
'iso_code',
'20%');
4338 $tbl->addColumn($this->lng->txt(
'currency_symbol'),
'currency_symbol',
'20%');
4339 $tbl->addColumn($this->lng->txt(
'conversion_rate'),
'conversion_rate',
'15%');
4340 $tbl->addColumn(
'',
'options',
'5%');
4342 $this->ctrl->setParameter($this,
'cmd',
'currencies');
4344 $tbl->addMultiCommand(
'updateDefaultCurrency', $this->lng->txt(
'paya_set_default_currency'));
4345 $tbl->addMultiCommand(
"editCurrency",$this->lng->txt(
'edit'));
4346 $tbl->addMultiCommand(
"deleteCurrency", $this->lng->txt(
'delete'));
4348 $tbl->addCommandButton(
'addCurrency',$this->lng->txt(
'add_currency'));
4349 $tbl->setData($f_result);
4350 $this->tpl->setVariable(
'TABLE', $tbl->getHTML());
4355 if(isset($_POST[
'currency_id'] ))
4366 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.main_view.html',
'Services/Payment');
4368 $form->setFormAction($this->ctrl->getFormAction($this));
4369 $form->setTitle($this->lng->txt(
'paya_add_currency'));
4371 $o_Unit =
new ilTextInputGUI($this->lng->txt(
'paya_currency_unit'),
'currency_unit');
4372 $o_Unit->
setValue($_POST[
'currency_unit']);
4373 $o_Unit->setPostVar(
'currency_unit');
4374 $o_Unit->setRequired(
true);
4376 $o_Isocode =
new ilTextInputGUI($this->lng->txt(
'iso_code'),
'iso_code');
4377 $o_Isocode->
setValue($_POST[
'iso_code']);
4378 $o_Isocode->setPostVar(
'iso_code');
4379 $o_Isocode->setRequired(
true);
4381 $o_Symbol =
new ilTextInputGUI($this->lng->txt(
'symbol'),
'symbol');
4382 $o_Symbol->
setValue($_POST[
'symbol']);
4383 $o_Symbol->setPostVar(
'symbol');
4384 $o_Symbol->setRequired(
true);
4386 $o_Conversionrate =
new IlTextInputGUI($this->lng->txt(
'conversion_rate'),
'conversion_rate');
4387 $o_Conversionrate->setValue($_POST[
'conversion_rate']);
4388 $o_Conversionrate->setPostVar(
'conversion_rate');
4389 $o_Conversionrate->setRequired(
true);
4391 $form->addItem($o_Unit);
4392 $form->addItem($o_Isocode);
4393 $form->addItem($o_Symbol);
4394 $form->addItem($o_Conversionrate);
4396 $form->addCommandButton(
'saveCurrency', $this->lng->txt(
'save'));
4397 $form->addCommandButton(
'currencies', $this->lng->txt(
'cancel'));
4399 $this->tpl->setVariable(
'FORM',
$form->getHTML());
4405 $obj_currency->setUnit($_POST[
'currency_unit']);
4406 $obj_currency->setIsoCode($_POST[
'iso_code']);
4407 $obj_currency->setSymbol($_POST[
'symbol']);
4408 $obj_currency->setConversionRate($_POST[
'conversion_rate']);
4409 $obj_currency->addCurrency();
4415 $currency_id = $_POST[
'currency_id'];
4418 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.main_view.html',
'Services/Payment');
4420 $form->setFormAction($this->ctrl->getFormAction($this));
4421 $form->setTitle($this->lng->txt(
'paya_edit_currency'));
4423 $o_Unit =
new ilTextInputGUI($this->lng->txt(
'paya_currency_unit'),
'currency_unit');
4424 $o_Unit->
setValue($obj_currency[$currency_id][
'unit']);
4425 $o_Unit->setPostVar(
'currency_unit');
4426 $o_Unit->setRequired(
true);
4428 $o_Isocode =
new ilTextInputGUI($this->lng->txt(
'iso_code'),
'iso_code');
4429 $o_Isocode->
setValue($obj_currency[$currency_id][
'iso_code']);
4430 $o_Isocode->setPostVar(
'iso_code');
4431 $o_Isocode->setRequired(
true);
4433 $o_Symbol =
new ilTextInputGUI($this->lng->txt(
'symbol'),
'symbol');
4434 $o_Symbol->
setValue($obj_currency[$currency_id][
'symbol']);
4435 $o_Symbol->setPostVar(
'symbol');
4436 $o_Symbol->setRequired(
true);
4438 $o_Conversionrate =
new IlTextInputGUI($this->lng->txt(
'conversion_rate'),
'conversion_rate');
4439 $o_Conversionrate->setValue($obj_currency[$currency_id][
'conversion_rate']);
4440 $o_Conversionrate->setPostVar(
'conversion_rate');
4441 $o_Conversionrate->setRequired(
true);
4444 $o_hidden->setValue($obj_currency[$currency_id][
'currency_id']);
4445 $o_hidden->setPostVar(
'currency_id');
4446 $form->addItem($o_hidden);
4448 $form->addItem($o_Unit);
4449 $form->addItem($o_Isocode);
4450 $form->addItem($o_Symbol);
4451 $form->addItem($o_Conversionrate);
4453 $form->addCommandButton(
'updateCurrency', $this->lng->txt(
'save'));
4454 $form->addCommandButton(
'currencies', $this->lng->txt(
'cancel'));
4456 $this->tpl->setVariable(
'FORM',
$form->getHTML());
4462 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.main_view.html',
'Services/Payment');
4464 $_SESSION[
'currency_id'] = $_POST[
'currency_id'];
4467 $this->ctrl->setParameter($this,
'currency_id',(
int) $_POST[
'currency_id']);
4469 $oConfirmationGUI->setFormAction($this->ctrl->getFormAction($this,
"performDeleteCurrency"));
4471 $oConfirmationGUI->setHeaderText($this->lng->txt(
"paya_sure_delete_selected_currency"));
4472 $oConfirmationGUI->setCancel($this->lng->txt(
"cancel"),
"currencies");
4473 $oConfirmationGUI->setConfirm($this->lng->txt(
"confirm"),
"performDeleteCurrency");
4477 $this->tpl->setVariable(
'CONFIRMATION', $oConfirmationGUI->getHtml());
4483 if(!
$_SESSION[
'currency_id'])
return false;
4486 $obj_currency->deleteCurrency();
4492 if(!$_POST[
'currency_id'])
return false;
4495 $obj_currency->setUnit($_POST[
'currency_unit']);
4496 $obj_currency->setIsoCode($_POST[
'iso_code']);
4497 $obj_currency->setSymbol($_POST[
'symbol']);
4498 $obj_currency->setConversionRate($_POST[
'conversion_rate']);
4500 $obj_currency->updateCurrency();
4511 $ilToolbar->addButton($this->lng->txt(
'edit_page'), $this->ctrl->getLinkTargetByClass(array(
'ilshoppagegui'),
'edit'));
4513 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.main_view.html',
'Services/Payment');
4521 include_once(
'./Services/Form/classes/class.ilPropertyFormGUI.php');
4523 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.main_view.html',
'Services/Payment');
4524 $this->tpl->addJavaScript(
'Services/Mail/js/ilMailComposeFunctions.js');
4527 $form_gui->setFormAction($this->ctrl->getFormAction($this,
'savebillingmail'));
4528 $form_gui->setTitle($this->lng->txt(
'billing_mail'));
4535 $inp->setRequired(
false);
4540 $chb =
new ilCheckboxInputGUI($this->lng->txt(
'activate_placeholders'),
'use_placeholders');
4544 $form_gui->addItem($inp);
4546 include_once
'Services/Payment/classes/class.ilBillingMailPlaceholdersPropertyGUI.php';
4549 $chb->addSubItem($prop);
4550 $chb->setChecked(
true);
4552 $form_gui->addItem($chb);
4554 $form_gui->addCommandButton(
'saveBillingMail', $this->lng->txt(
'save'));
4555 $this->tpl->setVariable(
'FORM', $form_gui->getHTML());
4562 if($_POST[
'm_message'])
4567 $_POST[
'use_placeholders'] ? $placeholders = 1: $placeholders = 0;
4579 include_once
'Services/Payment/classes/class.ilShopPage.php';
4580 include_once
'Services/Payment/classes/class.ilShopPageGUI.php';
4588 include_once
'Services/Style/classes/class.ilObjStyleSheet.php';
4594 return $page_gui->showPage();
4601 $ilTabs->clearTargets();
4602 $ilTabs->setBackTarget($this->lng->txt(
'back'), $this->ctrl->getLinkTarget($this,
'documents'),
'_self');
4604 include_once
'Services/Payment/classes/class.ilShopPage.php';
4605 include_once
'Services/Payment/classes/class.ilShopPageGUI.php';
4606 include_once(
'./Services/Style/classes/class.ilObjStyleSheet.php');
4614 $new_page_object->setParentId(0);
4615 $new_page_object->setId($a_editor_page_id);
4616 $new_page_object->createFromXML();
4619 $this->ctrl->setReturnByClass(
'ilshoppagegui',
'edit');
4621 $page_gui =
new ilShopPageGUI(self::CONDITIONS_EDITOR_PAGE_ID);
4623 return $this->ctrl->forwardCommand($page_gui);
4628 include_once(
'./Services/Form/classes/class.ilPropertyFormGUI.php');
4632 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.main_view.html',
'Services/Payment');
4633 $this->tpl->addJavaScript(
'Services/Mail/js/ilMailComposeFunctions.js');
4636 $form_gui->setFormAction($this->ctrl->getFormAction($this,
'saveInvoiceNumber'));
4637 $form_gui->setTitle($this->lng->txt(
'invoice_number_setting'));
4640 $radio_group =
new ilRadioGroupInputGUI($this->lng->txt(
'invoice_number'),
'ud_invoice_number');
4641 $radio_option_1 =
new ilRadioOption($this->lng->txt(
'ilias_invoice_number'),
'0');
4642 $radio_group->addOption($radio_option_1);
4643 $radio_option_2 =
new ilRadioOption($this->lng->txt(
'userdefined_invoice_number'),
'1');
4644 $radio_group->addOption($radio_option_2);
4645 $radio_group->setRequired(
true);
4646 $radio_group->
setValue($invObj->getUDInvoiceNumberActive(),
'0');
4647 $radio_group->setPostVar(
'ud_invoice_number');
4648 $form_gui->addItem($radio_group);
4651 $cur_num =
new ilNonEditableValueGUI($this->lng->txt(
'incremental_current_value'),
'inc_current_value');
4653 $radio_option_2->addSubItem($cur_num);
4656 $inc_num =
new ilNumberInputGUI($this->lng->txt(
'incremental_start_value'),
'inc_start_value');
4657 $inc_num->
setValue($this->error !=
"" && isset($_POST[
'incremental_start_value'])
4660 $inc_num->setInfo($this->lng->txt(
'incremental_start_value_info'));
4661 $radio_option_2->addSubItem($inc_num);
4664 $sel_reset =
new ilSelectInputGUI($this->lng->txt(
'invoice_number_reset_period'),
'inc_reset_period');
4665 $sel_reset->
setValue($this->error !=
"" && isset($_POST[
'inc_reset_period'])
4666 ? $_POST[
'inc_reset_period']
4667 : $invObj->getIncResetPeriod());
4669 $reset_options = array(
4670 1 => $this->lng->txt(
'yearly'),
4671 2 => $this->lng->txt(
'monthly'));
4672 $sel_reset->setOptions($reset_options);
4674 $radio_option_2->addSubItem($sel_reset);
4677 $inp =
new ilTextAreaInputGUI($this->lng->txt(
'invoice_number_text'),
'invoice_number_text');
4678 $inp->
setValue( $this->error !=
"" && isset($_POST[
'invoice_number_text'])
4683 $inp->setRequired(
false);
4686 $radio_option_2->addSubItem($inp);
4691 $radio_option_2->addSubItem($prop);
4693 $form_gui->addCommandButton(
'saveInvoiceNumber', $this->lng->txt(
'save'));
4694 $this->tpl->setVariable(
'FORM', $form_gui->getHTML());
4700 if($_POST[
'ud_invoice_number'] == 1)
4702 if($_POST[
'inc_start_value'] <= 0 || $_POST[
'inc_start_value'] == NULL)
4704 $this->error = $this->lng->txt(
'start_value_cannot_be_null');
4710 if($_POST[
'invoice_number_text'] !== NULL)
4712 $check_text = $_POST[
'invoice_number_text'];
4714 if(strpos($check_text,
'[INCREMENTAL_NUMBER]') === FALSE)
4716 $this->error = $this->lng->txt(
'invoice_number_must_contain_incremental_number');
4723 if($_POST[
'inc_reset_period'] == 1)
4725 if(strpos($check_text,
'[YEAR]') === FALSE && strpos($check_text,
'[CURRENT_TIMESTAMP]') === FALSE)
4727 $this->error = $this->lng->txt(
'invoice_number_must_contain_year_ct');
4733 else if($_POST[
'inc_reset_period'] == 2)
4735 if((strpos($check_text,
'[YEAR]') === FALSE || strpos($check_text,
'[MONTH]') === FALSE )
4736 && (strpos($check_text,
'[CURRENT_TIMESTAMP]') === FALSE))
4738 $this->error = $this->lng->txt(
'invoice_number_must_contain_year_month_ct');
4755 $invObj->setUDInvoiceNumberActive($_POST[
'ud_invoice_number']);
4756 $invObj->setIncStartValue($_POST[
'inc_start_value']);
4757 $invObj->setIncResetPeriod($_POST[
'inc_reset_period']);
4758 $invObj->setInvoiceNumberText($_POST[
'invoice_number_text']);
4769 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.main_view.html',
'Services/Payment');
4771 $form->setFormAction($this->ctrl->getFormAction($this,
'saveStatutoryRegulations'));
4772 $form->setTitle($this->lng->txt(
'statutory_regulations'));
4773 $form->setTableWidth(
'100%');
4775 $post_gui =
new ilTextAreaInputGUI($this->lng->txt(
'content'),
'statutory_regulations');
4777 $post_gui->setRows(15);
4778 $post_gui->setUseRte(
true);
4779 $post_gui->addPlugin(
'latex');
4780 $post_gui->addButton(
'latex');
4781 $post_gui->addButton(
'pastelatex');
4782 $post_gui->addPlugin(
'ilimgupload');
4783 $post_gui->addButton(
'ilimgupload');
4784 $post_gui->removePlugin(
'advlink');
4786 $post_gui->removePlugin(
'image');
4787 $post_gui->usePurifier(
true);
4788 $post_gui->setRTERootBlockElement(
'');
4789 $post_gui->setRTESupport(
ilObject::_lookupObjId($this->ref_id),
'pays~',
'frm_post',
'tpl.tinymce_frm_post.html',
false,
'3.4.7');
4790 $post_gui->disableButtons(array(
4808 require_once
'Services/Html/classes/class.ilHtmlPurifierFactory.php';
4809 require_once
'Services/RTE/classes/class.ilRTE.php';
4812 $form->addItem($post_gui);
4815 $cb_showShoppingCart =
new ilCheckboxInputGUI($this->lng->txt(
'show_sr_shoppingcart'),
'show_sr_shoppingcart');
4816 $cb_showShoppingCart->
setInfo($this->lng->txt(
'show_sr_shoppingcart_info'));
4817 $cb_showShoppingCart->setValue(1);
4818 $cb_showShoppingCart->setChecked($this->genSetData->get(
'show_sr_shoppingcart'));
4819 $form->addItem($cb_showShoppingCart);
4822 $cb_attachInvoice =
new ilCheckboxInputGUI($this->lng->txt(
'attach_sr_invoice'),
'attach_sr_invoice');
4823 $cb_attachInvoice->
setInfo($this->lng->txt(
'attach_sr_invoice_info'));
4824 $cb_attachInvoice->setValue(1);
4825 $cb_attachInvoice->setChecked($this->genSetData->get(
'attach_sr_invoice'));
4826 $form->addItem($cb_attachInvoice);
4828 $form->addCommandButton(
'saveStatutoryRegulations', $this->lng->txt(
'save'));
4829 $this->tpl->setVariable(
'FORM',
$form->getHTML());
4835 require_once
'Services/RTE/classes/class.ilRTE.php';
4837 if(isset($_POST[
'statutory_regulations']) && $_POST[
'statutory_regulations'] != NULL)
4842 include_once
'Services/MediaObjects/classes/class.ilObjMediaObject.php';
4845 foreach($mediaObjects as $mob)
4847 foreach($myMediaObjects as $myMob)
4861 $this->genSetData->set(
'statutory_regulations', NULL,
'regulations');
4865 include_once
'Services/MediaObjects/classes/class.ilObjMediaObject.php';
4868 foreach($oldMediaObjects as $oldMob)
4871 foreach($curMediaObjects as $curMob)
4873 if($oldMob == $curMob)
4890 $this->genSetData->set(
'show_sr_shoppingcart', isset($_POST[
'show_sr_shoppingcart']) ? 1 : 0,
'regulations');
4891 $this->genSetData->set(
'attach_sr_invoice', isset($_POST[
'attach_sr_invoice']) ? 1 : 0,
'regulations');
4900 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.main_view.html',
'Services/Payment');
4902 $price_id = $_GET[
'price_id']?$_GET[
'price_id']: $_POST[
'price_id'];
4904 $this->ctrl->setParameter($this,
'pobject_id',(
int) $_GET[
'pobject_id']);
4906 include_once
'Services/Form/classes/class.ilPropertyFormGUI.php';
4908 $form->setFormAction($this->ctrl->getFormAction($this));
4914 $form->setTitle($tmp_obj->getTitle());
4918 $form->setTitle($this->lng->txt(
'object_not_found'));
4923 $radio_group->setTitle($this->lng->txt(
'duration'));
4924 $radio_group->setRequired(
true);
4925 $radio_group->setValue($price[
'price_type']);
4926 $radio_group->setPostVar(
'price_type');
4932 $oDuration->
setTitle($this->lng->txt(
'paya_months'));
4933 $oDuration->setSize(
'20%');
4934 $oDuration->
setValue($price[
'duration']);
4935 $oDuration->setPostVar(
'duration_month');
4938 $radio_group->addOption($radio_option_1);
4944 $o_date_from->
setTitle($this->lng->txt(
'cal_from'));
4946 $o_date_from->setPostVar(
'duration_date_from');
4951 $o_date_until->setTitle($this->lng->txt(
'cal_until'));
4953 $o_date_until->setPostVar(
'duration_date_until');
4954 $radio_option_3->addSubItem($o_date_until);
4956 $radio_group->addOption($radio_option_3);
4959 $radio_group->addOption($radio_option_2);
4961 $form->addItem($radio_group);
4964 $oDescription =
new ilTextAreaInputGUI($this->lng->txt(
'description'),
'description');
4966 $oDescription->setCols(35);
4967 $oDescription->setValue($price[
'description']);
4968 $form->addItem($oDescription);
4972 $oPrice->setTitle($this->lng->txt(
'price_a'));
4973 $oPrice->setSize(
'20%');
4974 $oPrice->setRequired(
true);
4975 $oPrice->setValue($price[
'price']);
4976 include_once
'./Services/Payment/classes/class.ilPaymentSettings.php';
4978 $oPrice->setInfo($genSet->get(
'currency_unit'));
4979 $oPrice->setPostVar(
'price');
4980 $oPrice->allowDecimals(
true);
4981 $form->addItem($oPrice);
4984 $oExtension =
new ilCheckboxInputGUI($this->lng->txt(
'extension_price'),
'extension');
4986 $oExtension->
setChecked($price[
'extension']);
4988 $form->addItem($oExtension);
4991 $o_hidden_1->setValue( (
int)$_GET[
'pobject_id']);
4992 $o_hidden_1->setPostVar(
'pobject_id');
4995 $o_hidden_2->setValue( (
int)$_GET[
'price_id']);
4996 $o_hidden_2->setPostVar(
'price_id');
4998 $form->addItem($o_hidden_1);
4999 $form->addItem($o_hidden_2);
5001 $form->addCommandButton(
'updatePrice',$this->lng->txt(
'save'));
5002 $form->addCommandButton(
'editPrices', $this->lng->txt(
'cancel'));
5004 $this->tpl->setVariable(
'FORM',
$form->getHTML());