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';
76 public function __construct($a_data, $a_id, $a_call_by_reference, $a_prepare_output =
true)
89 $this->
ilObjectGUI($a_data,$a_id,$a_call_by_reference,$a_prepare_output);
91 $this->lng->loadLanguageModule(
'payment');
97 $check = $this->genSetData->get(
'currency_unit');
101 return $this->generalSettingsObject();
104 $check = $this->genSetData->get(
'address');
108 return $this->generalSettingsObject();
111 $check = $this->genSetData->get(
'bank_data');
115 return $this->generalSettingsObject();
118 $check = $this->genSetData->get(
'pdf_path');
122 return $this->generalSettingsObject();
126 $pm_array = ilPaymethods::_getActivePaymethods();
128 if(count($pm_array) == 0)
135 foreach($pm_array as $paymethod)
137 switch($paymethod[
'pm_title'])
140 $check = unserialize($this->genSetData->get(
'bmf'));
141 if ($check[
'mandantNr'] ==
'' ||
142 $check[
'bewirtschafterNr'] ==
'' ||
143 $check[
'haushaltsstelle'] ==
'' ||
144 $check[
'objektNr'] ==
'' ||
145 $check[
'kennzeichenMahnverfahren'] ==
'' ||
146 $check[
'waehrungskennzeichen'] ==
'' ||
147 $check[
'ePaymentServer'] ==
'' ||
148 $check[
'clientCertificate'] ==
'' ||
149 $check[
'caCertificate'] ==
'' ||
150 $check[
'timeOut'] ==
'')
153 $this->bmfSettingsObject();
159 $check = unserialize($this->genSetData->get(
'paypal'));
160 if ($check[
'server_host'] ==
'' ||
161 $check[
'server_path'] ==
'' ||
162 $check[
'vendor'] ==
'' ||
163 $check[
'auth_token'] ==
'')
166 $this->paypalSettingsObject();
188 include_once
'./Services/Payment/classes/class.ilShopVats.php';
190 if(count($check) == 0)
197 $vendors = $this->vendors_obj->getVendors();
199 if(count($vendors) == 0)
208 $this->generalSettingsObject();
215 $next_class = $this->ctrl->getNextClass($this);
216 $cmd = $this->ctrl->getCmd();
228 $ilToolbar->addButton($this->lng->txt(
'check_shop_activation'),$this->ctrl->getLinkTarget($this,
'checkShopActivation'));
230 $this->
getTabs($this->tabs_gui);
234 case 'ilrepositorysearchgui':
235 include_once(
'./Services/Search/classes/class.ilRepositorySearchGUI.php');
238 $rep_search->setCallback($this,
239 'addVendorObject', array()
242 $this->ctrl->setReturn($this,
'vendors');
243 $ret =& $this->ctrl->forwardCommand($rep_search);
246 case 'ilpermissiongui':
247 include_once(
'Services/AccessControl/classes/class.ilPermissionGUI.php');
249 $ret = $this->ctrl->forwardCommand($perm_gui);
252 case 'ilshoppagegui':
253 if(
$cmd ==
'TermsConditions')
260 $ret = $this->forwardToPageObject();
264 $this->tpl->setContent(
$ret);
268 case 'ilshoptopicsgui':
269 include_once
'./Services/Payment/classes/class.ilShopTopicsGUI.php';
271 $ret = $this->ctrl->forwardCommand($topics_gui);
277 $cmd =
'generalSettings';
282 case 'saveGeneralSettings' :
283 case 'generalSettings' :
284 $this->tabs_gui->setTabActive(
'settings');
285 $this->
getSubTabs(
'settings',
'generalSettings');
288 case 'savePayMethods':
289 $this->tabs_gui->setTabActive(
'pay_methods');
290 $this->
getSubTabs(
'payMethods',
'payMethods');
292 case 'saveBmfSettings' :
293 case 'bmfSettings' : $this->tabs_gui->setTabActive(
'pay_methods');
294 $this->
getSubTabs(
'payMethods',
'bmfSettings');
296 case 'savePaypalSettings' :
297 case 'paypalSettings' :
298 $this->tabs_gui->setTabActive(
'pay_methods');
299 $this->
getSubTabs(
'payMethods',
'paypalSettings');
301 case 'saveEPaySettings' :
302 case 'epaySettings' :
306 case 'saveERPsettings' :
307 case 'delERPpreview':
308 case 'testERPsettings' :
318 case 'performDeleteVat':
319 case 'confirmDeleteVat':
323 case 'vats' : $this->tabs_gui->setTabActive(
'vats');
327 #TODO: CURRENCY not finished yet
330 # case 'performDeleteCurrency':
331 case 'updateCurrency':
332 # if($_POST['action'] == 'editCurrency' || $_POST['action'] == 'deleteCurrency')
333 # $cmd = $_POST['action'];
334 $this->tabs_gui->setTabActive(
'currencies');
337 case 'StatutoryRegulations':
338 case 'saveStatutoryRegulations':
339 $this->active_sub_tab =
'statutory_regulations';
340 $this->tabs_gui->setTabActive(
'documents');
341 $this->
getSubTabs(
'documents',
'statutory_regulations');
343 case 'TermsConditions':
345 $this->active_sub_tab =
'terms_conditions';
346 $this->tabs_gui->setTabActive(
'documents');
347 $this->
getSubTabs(
'documents',
'terms_conditions');
349 $cmd =
'TermsConditions';
352 case 'saveBillingMail':
353 $this->active_sub_tab =
'billing_mail';
354 $this->tabs_gui->setTabActive(
'documents');
355 $this->
getSubTabs(
'documents',
'billing_mail');
357 # $cmd = 'BillingMail';
359 case 'InvoiceNumber':
360 case 'saveInvoiceNumber':
361 $this->active_sub_tab =
'invoice_number';
362 $this->tabs_gui->setTabActive(
'documents');
363 $this->
getSubTabs(
'documents',
'invoice_number');
365 #$cmd = 'InvoiceNumber';
367 case 'checkShopActivation':
379 public function forwardToPageObject()
386 if(isset(
$_GET[
'pobject_id']) &&
$_GET[
'pobject_id'] > 0)
388 $this->ctrl->setParameter($this,
'pobject_id', (
int)
$_GET[
'pobject_id']);
390 $this->lng->loadLanguageModule(
'content');
392 $ilTabs->clearTargets();
393 $ilTabs->clearSubTabs();
394 $ilTabs->setBackTarget($this->lng->txt(
'back'), $this->ctrl->getLinkTarget($this,
'editDetails'));
396 include_once
'Services/Payment/classes/class.ilShopPage.php';
397 include_once
'Services/Payment/classes/class.ilShopPageGUI.php';
398 include_once(
'./Services/Style/classes/class.ilObjStyleSheet.php');
406 $new_page_object->setParentId(0);
407 $new_page_object->setId($this->pobject->getPobjectId());
408 $new_page_object->createFromXML();
411 $this->ctrl->setReturnByClass(
'ilshoppagegui',
'edit');
413 if(!(
int)$_GET[
'pobject_id'])
418 $this->ctrl->setParameter($this,
'pobject_id', (
int)$_GET[
'pobject_id']);
421 $page_gui =
new ilShopPageGUI((
int)$this->pobject->getPobjectId());
422 $this->ctrl->setParameter($page_gui,
'pobject_id', (
int)$_GET[
'pobject_id']);
432 $ilTabs->clearTargets();
433 $ilTabs->setBackTarget($lng->txt(
'back'), $this->ctrl->getLinkTarget($this),
'_top');
436 include_once
'Services/Payment/classes/class.ilShopPage.php';
437 include_once
'Services/Payment/classes/class.ilShopPageGUI.php';
439 $lng->loadLanguageModule(
'content');
441 include_once(
'./Services/Style/classes/class.ilObjStyleSheet.php');
448 $new_page_object->setParentId(0);
449 $new_page_object->setId(self::CONDITIONS_EDITOR_PAGE_ID);
450 $new_page_object->createFromXML();
453 $this->ctrl->setReturnByClass(
'ilshoppagegui',
'edit');
455 $page_gui =
new ilShopPageGUI(self::CONDITIONS_EDITOR_PAGE_ID);
458 return $this->ctrl->forwardCommand($page_gui);
461 public function saveBmfSettingsObject()
469 if(!$rbacsystem->checkAccess(
'read', $this->object->getRefId()))
471 $this->ilErr->raiseError($this->lng->txt(
'msg_no_perm_read'),$this->ilErr->MESSAGE);
474 include_once
'./Services/Payment/classes/class.ilBMFSettings.php';
493 if (
$_POST[
'mandantNr'] ==
'' ||
494 $_POST[
'bewirtschafterNr'] ==
'' ||
495 $_POST[
'haushaltsstelle'] ==
'' ||
496 $_POST[
'objektNr'] ==
'' ||
497 $_POST[
'kennzeichenMahnverfahren'] ==
'' ||
498 $_POST[
'waehrungskennzeichen'] ==
'' ||
499 $_POST[
'ePaymentServer'] ==
'' ||
500 $_POST[
'clientCertificate'] ==
'' ||
501 $_POST[
'caCertificate'] ==
'' ||
504 $this->error = $this->lng->txt(
'pays_bmf_settings_not_valid');
506 $this->bmfSettingsObject();
512 $this->bmfSettingsObject();
519 public function bmfSettingsObject()
527 if(!$rbacsystem->checkAccess(
'read', $this->object->getRefId()))
529 $this->ilErr->raiseError($this->lng->txt(
'msg_no_perm_read'),$this->ilErr->MESSAGE);
531 include_once
'./Services/Payment/classes/class.ilBMFSettings.php';
534 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.main_view.html',
'Services/Payment');
542 $form->setFormAction($this->ctrl->getFormAction($this,
'saveBmfSettings'));
543 $form->setTitle($this->lng->txt(
'pays_bmf_settings'));
545 $form->addCommandButton(
'saveBmfSettings',$this->lng->txt(
'save'));
547 $formItem =
new ilTextInputGUI($this->lng->txt(
'pays_bmf_client_id'),
'mandantNr');
548 $formItem->
setValue($bmfSetObj->getClientId());
549 $form->addItem($formItem);
551 $formItem =
new ilTextInputGUI($this->lng->txt(
'pays_bmf_bewirtschafter_nr'),
'bewirtschafterNr');
552 $formItem->
setValue($bmfSetObj->getBewirtschafterNr());
553 $form->addItem($formItem);
555 $formItem =
new ilTextInputGUI($this->lng->txt(
'pays_bmf_haushaltsstelle'),
'haushaltsstelle');
556 $formItem->
setValue($bmfSetObj->getHaushaltsstelle());
557 $form->addItem($formItem);
559 $formItem =
new ilTextInputGUI($this->lng->txt(
'pays_bmf_object_id'),
'objektNr');
560 $formItem->
setValue($bmfSetObj->getObjectId());
561 $form->addItem($formItem);
563 $formItem =
new ilTextInputGUI($this->lng->txt(
'pays_bmf_kennzeichen_mahnverfahren'),
'kennzeichenMahnverfahren');
564 $formItem->
setValue($bmfSetObj->getKennzeichenMahnverfahren());
565 $form->addItem($formItem);
567 $formItem =
new ilTextInputGUI($this->lng->txt(
'pays_bmf_waehrungskennzeichen'),
'waehrungskennzeichen');
568 $formItem->
setValue($bmfSetObj->getWaehrungsKennzeichen());
569 $form->addItem($formItem);
571 $formItem =
new ilTextInputGUI($this->lng->txt(
'pays_bmf_epayment_server'),
'ePaymentServer');
572 $formItem->
setValue($bmfSetObj->getEpaymentServer());
573 $form->addItem($formItem);
575 $formItem =
new ilTextInputGUI($this->lng->txt(
'pays_bmf_client_certificate'),
'clientCertificate');
576 $formItem->
setValue($bmfSetObj->getClientCertificate());
577 $form->addItem($formItem);
579 $formItem =
new ilTextInputGUI($this->lng->txt(
'pays_bmf_ca_certificate'),
'caCertificate');
580 $formItem->
setValue($bmfSetObj->getCaCertificate());
581 $form->addItem($formItem);
583 $formItem =
new ilTextInputGUI($this->lng->txt(
'pays_bmf_timeout'),
'timeOut');
584 $formItem->
setValue($bmfSetObj->getTimeOut());
585 $form->addItem($formItem);
587 $this->tpl->setVariable(
'FORM',
$form->getHTML());
594 if(!$_GET[
'pobject_id'])
598 $this->objectObjects();
603 $this->ctrl->setParameter($this,
'pobject_id',(
int) $_GET[
'pobject_id']);
606 $old_status = $this->pobject->getStatus();
609 if($old_status == $this->pobject->STATUS_NOT_BUYABLE and
610 (
int)
$_POST[
'status'] != $old_status)
613 switch((
int)
$_POST[
'pay_method'])
615 case $this->pobject->PAY_METHOD_NOT_SPECIFIED:
625 $standard_prices = array();
626 $standard_prices = $prices_obj->getPrices();
628 if(!count($standard_prices))
637 $this->pobject->setStatus((
int)
$_POST[
'status']);
638 $this->pobject->setVendorId((
int) $_POST[
'vendor']);
639 $this->pobject->setPayMethod((
int) $_POST[
'pay_method']);
640 $this->pobject->setTopicId((
int) $_POST[
'topic_id']);
641 $this->pobject->setVatId((
int) $_POST[
'vat_id']);
643 $this->pobject->update();
651 public function editPricesObject($a_show_delete =
false)
658 if($a_show_delete ==
false) unset(
$_SESSION[
'price_ids']);
662 if(!$_GET[
'pobject_id'])
669 $this->ctrl->setParameter($this,
'pobject_id',(
int) $_GET[
'pobject_id']);
671 $ilToolbar->addButton($this->lng->txt(
'back'), $this->ctrl->getLinkTarget($this,
'objects'));
672 $ilToolbar->addButton($this->lng->txt(
'paya_edit_details'), $this->ctrl->getLinkTarget($this,
'editDetails'));
673 $ilToolbar->addButton($this->lng->txt(
'paya_edit_prices'), $this->ctrl->getLinkTarget($this,
'editPrices'));
674 $ilToolbar->addButton($this->lng->txt(
'pay_edit_abstract'), $this->ctrl->getLinkTargetByClass(array(
'ilshoppagegui'),
'edit'));
678 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.main_view.html',
'Services/Payment');
681 $standard_prices = array();
682 $extension_prices = array();
683 $standard_prices = $price_obj->getPrices();
684 $extension_prices = $price_obj->getExtensionPrices();
686 $prices = array_merge($standard_prices, $extension_prices );
693 $ilToolbar->addButton($this->lng->txt(
'paya_add_price'), $this->ctrl->getLinkTarget($this,
'addPrice'));
703 $oConfirmationGUI->setFormAction($this->ctrl->getFormAction($this,
"performDeletePrice"));
704 $oConfirmationGUI->setHeaderText($this->lng->txt(
"paya_sure_delete_selected_prices"));
705 $oConfirmationGUI->setCancel($this->lng->txt(
"cancel"),
"editPrices");
706 $oConfirmationGUI->setConfirm($this->lng->txt(
"confirm"),
"performDeletePrice");
708 foreach($prices as $price)
713 if(in_array($price[
'price_id'],
$_SESSION[
'price_ids']))
715 switch($price[
'price_type'])
718 include_once
'./Services/Calendar/classes/class.ilDatePresentation.php';
724 $tmp_price = $price[
'duration'].
' '.$this->lng->txt(
'paya_months');
728 $tmp_price = $this->lng->txt(
'unlimited_duration');
732 $delete_row .=
''.$tmp_price.
' -> '.
734 $this->genSetData->get(
'currency_unit');
736 $oConfirmationGUI->addItem(
'',$delete_row, $delete_row);
740 $this->tpl->setVariable(
'CONFIRMATION', $oConfirmationGUI->getHTML());
752 $tpl->setCurrentBlock(
'tbl_form_header');
754 $tpl->setVariable(
'FORMACTION',$this->ctrl->getFormAction($this));
755 $tpl->parseCurrentBlock();
759 foreach($prices as $price)
761 $data[$counter][
'price_id'] = ilUtil::formCheckBox(in_array($price[
'price_id'],
$_SESSION[
'price_ids']) ? 1 : 0,
762 'price_ids[]', $price[
'price_id']);
764 switch($price[
'price_type'])
767 $data[$counter][
'duration'] = $price[
'duration'].
' '.$this->lng->txt(
'paya_months');
775 $data[$counter][
'duration'] = $this->lng->txt(
'unlimited_duration');
779 $data[$counter][
'currency_unit'] = $this->genSetData->get(
'currency_unit');
780 $data[$counter][
'extension'] = ilUtil::formCheckBox($price[
'extension'] ? 1 : 0,
781 'extension_ids[]', (
int)$price[
'price_id'],
true);
783 $this->ctrl->setParameter($this,
"price_id",$price[
'price_id']);
784 $data[$counter][
'edit'] =
785 "<div class=\"il_ContainerItemCommands\"><a class=\"il_ContainerItemCommand\" href=\"".$this->ctrl->getLinkTarget($this,
"editPrice").
"\">".$this->lng->txt(
"edit").
"</a></div>";
796 $this->ctrl->setParameter($this,
'cmd',
'editprices');
802 $tbl->setTitle($tmp_obj->getTitle());
806 $tbl->setTitle($this->lng->txt(
'object_not_found'));
809 $tbl->setId(
'tbl_bookings');
810 $tbl->setRowTemplate(
"tpl.shop_prices_row.html",
"Services/Payment");
812 $tbl->addColumn(
' ',
'price_id',
'5%');
813 $tbl->addColumn($this->lng->txt(
'duration'),
'duration',
'40%');
814 $tbl->addColumn($this->lng->txt(
'price_a'),
'price',
'1%');
815 $tbl->addColumn($this->lng->txt(
'currency'),
'currency_unit',
'10%');
816 $tbl->addColumn($this->lng->txt(
'extension_price'),
'extension',
'10%');
817 $tbl->addColumn(
'',
'edit',
'30%' );
819 $tbl->setSelectAllCheckbox(
'price_id');
820 $tbl->addCommandButton(
'addPrice',$this->lng->txt(
'paya_add_price'));
822 $tbl->addMultiCommand(
"deletePrice", $this->lng->txt(
"paya_delete_price"));
825 $tbl->setData($a_result_set);
827 $this->tpl->setVariable(
'TABLE', $tbl->getHTML());
832 public function addPriceObject()
839 if(!$_GET[
'pobject_id'])
851 $this->ctrl->setParameter($this,
'pobject_id',(
int) $_GET[
'pobject_id']);
855 $ilToolbar->addButton($this->lng->txt(
'paya_edit_details'), $this->ctrl->getLinkTarget($this,
'editDetails'));
856 $ilToolbar->addButton($this->lng->txt(
'paya_edit_prices'), $this->ctrl->getLinkTarget($this,
'editPrices'));
857 $ilToolbar->addButton($this->lng->txt(
'pay_edit_abstract'), $this->ctrl->getLinkTargetByClass(array(
'ilshoppagegui'),
'edit'));
860 if(is_object($tmp_obj))
862 $tmp_object[
'title'] = $tmp_obj->getTitle();
866 $tmp_object[
'title'] = $this->lng->txt(
'object_not_found');
868 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.main_view.html',
'Services/Payment');
871 $form->setFormAction($this->ctrl->getFormAction($this));
872 $form->setTitle($this->lng->txt(
'paya_add_price_title'));
877 $oTitle->
setValue($tmp_object[
'title']);
878 $form->addItem($oTitle);
883 $radio_group->setTitle($this->lng->txt(
'duration'));
884 $radio_group->setRequired(
true);
885 $radio_group->setValue(
$_POST[
'price_type']);
886 $radio_group->setPostVar(
'price_type');
888 $radio_option_1 =
new ilRadioOption($this->lng->txt(
'duration_month'),
'duration_month');
892 $oDuration->
setTitle($this->lng->txt(
'paya_months'));
893 $oDuration->setSize(
'30%');
895 $oDuration->setPostVar(
'duration_month');
898 $radio_group->addOption($radio_option_1);
900 $radio_option_3 =
new ilRadioOption($this->lng->txt(
'duration_date'),
'duration_date');
904 $o_date_from->
setTitle($this->lng->txt(
'cal_from'));
905 $o_date_from->setPostVar(
'duration_date_from');
910 $o_date_until->setTitle($this->lng->txt(
'cal_until'));
911 $o_date_until->setPostVar(
'duration_date_until');
912 $radio_option_3->addSubItem($o_date_until);
914 $radio_group->addOption($radio_option_3);
916 $radio_option_2 =
new ilRadioOption($this->lng->txt(
'unlimited_duration'),
'unlimited_duration');
917 $radio_group->addOption($radio_option_2);
919 $form->addItem($radio_group);
922 $oDescription =
new ilTextAreaInputGUI($this->lng->txt(
'description'),
'description');
924 $oDescription->setCols(35);
925 $oDescription->setValue(
$_POST[
'description']);
926 $form->addItem($oDescription);
930 $oPrice->setTitle($this->lng->txt(
'price_a'));
931 $oPrice->setValue(
$_POST[
'price']);
932 $oPrice->setPostVar(
'price');
933 $oPrice->setRequired(
true);
934 $oPrice->allowDecimals(
true);
935 $form->addItem($oPrice);
940 #TODO: CURRENCY not finished yet
956 $currency_options = $genSet->get(
'currency_unit');
958 $oCurrency->
setValue($currency_options);
959 $form->addItem($oCurrency);
963 $oExtension =
new ilCheckboxInputGUI($this->lng->txt(
'extension_price'),
'extension');
966 $form->addItem($oExtension);
968 $form->addCommandButton(
'performAddPrice',$this->lng->txt(
'paya_add_price'));
969 $form->addCommandButton(
'editPrices', $this->lng->txt(
'cancel'));
970 $this->tpl->setVariable(
'FORM',
$form->getHTML());
979 switch($_POST[
'price_type'])
981 case 'unlimited_duration':
984 $po->setDurationFrom(NULL);
985 $po->setDurationUntil(NULL);
986 $po->setUnlimitedDuration(1);
990 case 'duration_date':
993 $po->setDuration(NULL);
995 $_POST[
'duration_date_from'][
'date'][
'y'].
'-'.
996 $_POST[
'duration_date_from'][
'date'][
'm'].
'-'.
997 $_POST[
'duration_date_from'][
'date'][
'd']));
999 $_POST[
'duration_date_until'][
'date'][
'y'].
'-'.
1000 $_POST[
'duration_date_until'][
'date'][
'm'].
'-'.
1001 $_POST[
'duration_date_until'][
'date'][
'd']));
1005 case 'duration_month':
1007 $po->setDuration($_POST[
'duration_month']);
1008 $po->setDurationFrom(NULL);
1009 $po->setDurationUntil(NULL);
1013 $po->setDescription($_POST[
'description'] ?
ilUtil::stripSlashes($_POST[
'description']) : NULL);
1017 if($_POST[
'extension_price'])
1019 $po->setExtension(1);
1023 $po->setExtension(0);
1031 return $this->editPricesObject();
1036 return $this->addPriceObject();
1042 if(!$_GET[
'pobject_id'])
1060 foreach(
$_SESSION[
'price_ids'] as $price_id)
1062 if($prices->delete($price_id))
1068 if(!count($prices->getPrices()))
1072 $this->pobject->setStatus($this->pobject->STATUS_NOT_BUYABLE);
1073 $this->pobject->update();
1080 return $this->editPricesObject();
1085 if(!$_GET[
'pobject_id'])
1093 if(!count($_POST[
'price_ids']))
1097 $this->editPricesObject();
1100 $_SESSION[
'price_ids'] = $_POST[
'price_ids'];
1102 $this->editPricesObject(
true);
1108 if(!$_GET[
'pobject_id'] && !$_POST[
'pobject_id'])
1115 if(isset($_GET[
'pobject_id']))
1117 $pobject_id = (int)$_GET[
'pobject_id'];
1121 $pobject_id = (int)$_POST[
'pobject_id'];
1124 if(!(
int)$_GET[
'price_id'] && !$_POST[
'price_id'])
1127 return $this->editPricesObject();
1129 if(isset($_GET[
'price_id']))
1131 $price_id = (int)$_GET[
'price_id'];
1135 $price_id = (int)$_POST[
'price_id'];
1139 switch($_POST[
'price_type'])
1143 $po->setDuration(NULL);
1144 $po->setDurationFrom(NULL);
1145 $po->setDurationUntil(NULL);
1146 $po->setUnlimitedDuration(1);
1152 $po->setDuration(NULL);
1154 $_POST[
'duration_date_from'][
'date'][
'y'].
'-'.
1155 $_POST[
'duration_date_from'][
'date'][
'm'].
'-'.
1156 $_POST[
'duration_date_from'][
'date'][
'd']));
1158 $_POST[
'duration_date_until'][
'date'][
'y'].
'-'.
1159 $_POST[
'duration_date_until'][
'date'][
'm'].
'-'.
1160 $_POST[
'duration_date_until'][
'date'][
'd']));
1166 $po->setDuration($_POST[
'duration_month']);
1167 $po->setDurationFrom(NULL);
1168 $po->setDurationUntil(NULL);
1172 $po->setDescription($_POST[
'description'] ?
ilUtil::stripSlashes($_POST[
'description']) : NULL);
1175 if($_POST[
'extension_price'])
1177 $po->setExtension(1);
1181 $po->setExtension(0);
1186 $po->update($price_id);
1188 return $this->editPricesObject();
1202 if(!(
int)$_GET[
'pobject_id'])
1210 $this->ctrl->setParameter($this,
'pobject_id', (
int)$_GET[
'pobject_id']);
1212 $ilToolbar->addButton($this->lng->txt(
'paya_edit_details'), $this->ctrl->getLinkTarget($this,
'editDetails'));
1213 $ilToolbar->addButton($this->lng->txt(
'paya_edit_prices'), $this->ctrl->getLinkTarget($this,
'editPrices'));
1214 $ilToolbar->addButton($this->lng->txt(
'pay_edit_abstract'), $this->ctrl->getLinkTargetByClass(array(
'ilshoppagegui'),
'edit'));
1216 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.main_view.html',
'Services/Payment');
1221 $tmp_object[
'title'] = $tmp_obj->getTitle();
1222 $tmp_object[
'type'] = $tmp_obj->getType();
1226 $tmp_object[
'title'] = $this->lng->txt(
'object_not_found');
1227 $tmp_object[
'type'] =
'';
1232 include_once
'./Services/Utilities/classes/class.ilConfirmationGUI.php';
1236 $oConfirmationGUI->setFormAction($this->ctrl->getFormAction($this,
"performObjectDelete"));
1237 $oConfirmationGUI->setHeaderText($this->lng->txt(
"paya_sure_delete_object"));
1238 $oConfirmationGUI->setCancel($this->lng->txt(
"cancel"),
"objects");
1239 $oConfirmationGUI->setConfirm($this->lng->txt(
"confirm"),
"performObjectDelete");
1241 $oConfirmationGUI->addItem(
'', $tmp_object[
'title'], $tmp_object[
'title']);
1242 $this->tpl->setVariable(
'CONFIRMATION',$oConfirmationGUI->getHTML());
1248 $oForm->setFormAction($this->ctrl->getFormAction($this,
'updateDetails'));
1249 $oForm->setTitle($tmp_object[
'title']);
1255 $oForm->addItem($oPathGUI);
1260 $oForm->addItem($oPurchasersGUI);
1263 $oVendorsGUI =
new ilSelectInputGUI($this->lng->txt(
'paya_vendor'),
'vendor');
1265 $oVendorsGUI->setValue($this->pobject->getVendorId());
1266 $oForm->addItem($oVendorsGUI);
1271 $oStatusGUI->setValue($this->pobject->getStatus());
1272 $oForm->addItem($oStatusGUI);
1275 $oPayMethodsGUI =
new ilSelectInputGUI($this->lng->txt(
'paya_pay_method'),
'pay_method');
1278 $oPayMethodsGUI->setValue($this->pobject->getPayMethod());
1279 $oForm->addItem($oPayMethodsGUI);
1282 include_once
'./Services/Payment/classes/class.ilShopTopics.php';
1289 $topic_options = array();
1290 $topic_options[
''] = $this->lng->txt(
'please_choose');
1292 foreach($topics as $oTopic)
1294 $topic_options[$oTopic->getId()] = $oTopic->getTitle();
1297 $oTopicsGUI->setOptions($topic_options);
1298 $oTopicsGUI->setValue($this->pobject->getTopicId());
1299 $oForm->addItem($oTopicsGUI);
1304 $oShopVatsList->read();
1305 if($oShopVatsList->hasItems())
1309 $vats_options = array();
1310 foreach($oShopVatsList as $oVAT)
1315 $oVatsGUI->setOptions($vats_options);
1316 $oVatsGUI->setValue($this->pobject->getVatId());
1317 $oForm->addItem($oVatsGUI);
1322 $oVatsGUI->
setValue($this->lng->txt(
'paya_no_vats_assigned'));
1323 $oForm->addItem($oVatsGUI);
1328 if(($webpath_file = $oFile->getCurrentImageWebPath()) !==
false)
1330 $oThumbnail->setImage($webpath_file);
1332 $oForm->addItem($oThumbnail);
1335 $oForm->addCommandButton(
'updateDetails', $this->lng->txt(
'save'));
1336 $oForm->addCommandButton(
'deleteObject', $this->lng->txt(
'delete'));
1338 $this->tpl->setVariable(
'FORM', $oForm->getHTML());
1347 if(!$_GET[
'pobject_id'])
1373 if(!$_GET[
'pobject_id'])
1383 $this->pobject->delete();
1387 $price_obj->deleteAllPrices();
1401 $path = $tree->getPathFull($a_ref_id);
1409 $html .= $data[
'title'].
' > ';
1412 return substr($html,0,-2);
1420 $all_vendors = $this->vendors_obj->getVendors();
1421 if (is_array($all_vendors))
1423 foreach ($all_vendors as $vendor)
1425 $vendors[] = $vendor[
'vendor_id'];
1429 foreach($vendors as $vendor)
1436 $options[$vendor] = $tmp_obj->getFullname().
' ['.$tmp_obj->getLogin().
']';
1444 $option[$this->pobject->STATUS_NOT_BUYABLE] = $this->lng->txt(
'paya_not_buyable');
1445 $option[$this->pobject->STATUS_BUYABLE] = $this->lng->txt(
'paya_buyable');
1446 $option[$this->pobject->STATUS_EXPIRES] = $this->lng->txt(
'paya_expires');
1454 unset($_POST[
'title_type']);
1455 unset($_POST[
'title_value']);
1456 unset($_POST[
'vendor']);
1457 unset($_POST[
'pay_method']);
1469 if(!$rbacsystem->checkAccess(
'read', $this->object->getRefId()))
1471 $this->ilErr->raiseError($this->lng->txt(
'msg_no_perm_read'),$this->ilErr->MESSAGE);
1474 if ($_POST[
'updateView'] == 1)
1476 $_SESSION[
'pay_objects'][
'title_type'] = $_POST[
'title_type'];
1477 $_SESSION[
'pay_objects'][
'title_value'] = $_POST[
'title_value'];
1478 $_SESSION[
'pay_objects'][
'pay_method'] = $_POST[
'pay_method'];
1479 $_SESSION[
'pay_objects'][
'vendor'] = $_POST[
'vendor'];
1482 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.main_view.html',
'Services/Payment');
1485 $this->lng->loadLanguageModule(
'search');
1488 $filter_form->setFormAction($this->ctrl->getFormAction($this));
1489 $filter_form->setTitle($this->lng->txt(
'pay_filter'));
1490 $filter_form->setId(
'filter_form');
1491 $filter_form->setTableWidth(
'100 %');
1494 $o_hide_check =
new ilCheckBoxInputGUI($this->lng->txt(
'show_filter'),
'show_filter');
1495 $o_hide_check->setValue(1);
1496 $o_hide_check->setChecked($_POST[
'show_filter'] ? 1 : 0);
1499 $o_hidden->setValue(1);
1500 $o_hidden->setPostVar(
'updateView');
1501 $o_hide_check->addSubItem($o_hidden);
1505 $radio_option =
new ilRadioOption($this->lng->txt(
'search_any_word'),
'or');
1506 $radio_group->addOption($radio_option);
1507 $radio_option =
new ilRadioOption($this->lng->txt(
'search_all_words'),
'and');
1508 $radio_group->addOption($radio_option);
1510 $radio_group->setRequired(
false);
1512 $radio_group->setPostVar(
'title_type');
1515 $o_title->setValue(
$_SESSION[
'pay_objects'][
'title_value']);
1516 $o_title->setPostVar(
'title_value');
1517 $o_title->setTitle($this->lng->txt(
'title'));
1519 $o_hide_check->addSubItem($radio_group);
1520 $o_hide_check->addSubItem($o_title);
1524 $o_vendor->setTitle($this->lng->txt(
'paya_vendor'));
1525 $o_vendor->setValue(
$_SESSION[
'pay_objects'][
'vendor']);
1526 $o_vendor->setPostVar(
'vendor');
1527 $o_hide_check->addSubItem($o_vendor);
1531 $o_paymethod->setTitle($this->lng->txt(
'payment_system'));
1532 $o_paymethod->setOptions(ilPaymethods::getPayMethodsOptions(
'all'));
1533 $o_paymethod->setValue(
$_SESSION[
'pay_objects'][
'pay_method']);
1534 $o_paymethod->setPostVar(
'pay_method');
1535 $o_hide_check->addSubItem($o_paymethod);
1537 $filter_form->addCommandButton(
'objects', $this->lng->txt(
'pay_update_view'));
1538 $filter_form->addCommandButton(
'resetObjectFilter', $this->lng->txt(
'pay_reset_filter'));
1540 $filter_form->addItem($o_hide_check);
1547 $this->tpl->setVariable(
'FORM', $filter_form->getHTML());
1550 foreach($objects as
$data)
1555 $f_result[$counter][
'title'] = $tmp_obj->getTitle();
1559 $f_result[$counter][
'title'] = $this->lng->txt(
'object_not_found');
1562 switch($data[
'status'])
1564 case $this->pobject->STATUS_BUYABLE:
1565 $f_result[$counter][
'status'] = $this->lng->txt(
'paya_buyable');
1568 case $this->pobject->STATUS_NOT_BUYABLE:
1569 $f_result[$counter][
'status'] = $this->lng->txt(
'paya_not_buyable');
1572 case $this->pobject->STATUS_EXPIRES:
1573 $f_result[$counter][
'status'] = $this->lng->txt(
'paya_expires');
1577 include_once
'./Services/Payment/classes/class.ilPayMethods.php';
1579 $f_result[$counter][
'pay_method'] = $str_paymethod;
1581 if($data[
'vat_id'] <= 0)
1583 $vat_rate = $this->lng->txt(
'payment_vat_has_to_be_defined_by_administration_short');
1589 $oVAT =
new ilShopVats((
int)$data[
'vat_id']);
1594 $vat_rate = $this->lng->txt(
'payment_vat_has_to_be_defined_by_administration_short');
1598 $f_result[$counter][
'vat_rate'] = $vat_rate;
1603 $f_result[$counter][
'vendor'] = $tmp_user->getFullname().
' ['.$tmp_user->getLogin().
']';
1607 $f_result[$counter][
'vendor'] = $this->lng->txt(
'user_not_found');
1614 $this->ctrl->setParameter($this,
'pobject_id',$data[
'pobject_id']);
1615 $link_change =
"<div class=\"il_ContainerItemCommands\"><a class=\"il_ContainerItemCommand\" href=\"".$this->ctrl->getLinkTarget($this,
"editDetails").
"\">".$this->lng->txt(
"edit").
"</a></div>";
1617 $f_result[$counter][
'options'] = $link_change;
1631 $this->ctrl->setParameter($this,
'cmd',
'objects');
1634 $tbl->setTitle($this->lng->txt(
'objects'));
1636 $tbl->setId(
'tbl_show_objects');
1637 $tbl->setRowTemplate(
"tpl.shop_objects_row.html",
"Services/Payment");
1639 $tbl->addColumn($this->lng->txt(
'title'),
'title',
'10%');
1640 $tbl->addColumn($this->lng->txt(
'status'),
'status',
'10%');
1641 $tbl->addColumn($this->lng->txt(
'paya_pay_method'),
'pay_method',
'10%');
1642 $tbl->addColumn($this->lng->txt(
'vat_rate'),
'vat_rate',
'15%');
1643 $tbl->addColumn($this->lng->txt(
'paya_vendor'),
'vendor',
'10%');
1644 $tbl->addColumn($this->lng->txt(
'paya_count_purchaser'),
'purchasers',
'10%');
1645 $tbl->addColumn(
'',
'options',
'10%');
1647 $tbl->setData($a_result_set);
1649 $this->tpl->setVariable(
'TABLE', $tbl->getHTML());
1662 switch($_POST[
'action'])
1664 case 'deleteVendorsObject':
1665 $this->deleteVendors();
1668 case 'editVendorObject':
1669 $this->editVendor();
1672 case 'performEditVendorObject':
1686 unset($_POST[
'transaction_type']);
1687 unset($_POST[
'transaction_value']);
1688 unset($_POST[
'from']);
1689 unset($_POST[
'til']);
1690 unset($_POST[
'payed']);
1691 unset($_POST[
'access']);
1692 unset($_POST[
'customer']);
1693 unset($_POST[
'pay_method']);
1694 unset($_POST[
'updateView']);
1695 unset($_POST[
"adm_filter_title_id"]);
1703 global $rbacsystem, $ilToolbar,$ilObjDataCache;
1705 include_once
'./Services/Payment/classes/class.ilPayMethods.php';
1708 if(!$rbacsystem->checkAccess(
'read', $this->object->getRefId()))
1710 $this->ilErr->raiseError($this->lng->txt(
'msg_no_perm_read'),$this->ilErr->MESSAGE);
1713 $ilToolbar->addButton($this->lng->txt(
'paya_add_customer'), $this->ctrl->getLinkTarget($this,
'showObjectSelector'));
1715 if ($_POST[
'updateView'] == 1)
1717 $_SESSION[
'pay_statistics'][
'show_filter']= $_POST[
'show_filter'];
1718 $_SESSION[
'pay_statistics'][
'updateView'] =
true;
1719 $_SESSION[
'pay_statistics'][
'until_check'] = $_POST[
'until_check'];
1720 $_SESSION[
'pay_statistics'][
'from_check'] = $_POST[
'from_check'];
1721 $_SESSION[
'pay_statistics'][
'transaction_type'] = isset($_POST[
'transaction_type']) ? $_POST[
'transaction_type'] :
'' ;
1722 $_SESSION[
'pay_statistics'][
'transaction_value'] = isset($_POST[
'transaction_value']) ? $_POST[
'transaction_value'] :
'';
1723 $_SESSION[
'pay_statistics'][
'adm_filter_title_id'] = (int)$_POST[
'adm_filter_title_id'];
1725 if(
$_SESSION[
'pay_statistics'][
'from_check'] ==
'1')
1727 $_SESSION[
'pay_statistics'][
'from'][
'date'][
'd'] = $_POST[
'from'][
'date'][
'd'];
1728 $_SESSION[
'pay_statistics'][
'from'][
'date'][
'm'] = $_POST[
'from'][
'date'][
'm'];
1729 $_SESSION[
'pay_statistics'][
'from'][
'date'][
'y'] = $_POST[
'from'][
'date'][
'y'];
1733 $_SESSION[
'pay_statistics'][
'from'][
'date'][
'd'] =
'';
1734 $_SESSION[
'pay_statistics'][
'from'][
'date'][
'm'] =
'';
1735 $_SESSION[
'pay_statistics'][
'from'][
'date'][
'y'] =
'';
1738 if(
$_SESSION[
'pay_statistics'][
'until_check']==
'1')
1740 $_SESSION[
'pay_statistics'][
'til'][
'date'][
'd'] = $_POST[
'til'][
'date'][
'd'];
1741 $_SESSION[
'pay_statistics'][
'til'][
'date'][
'm'] = $_POST[
'til'][
'date'][
'm'];
1742 $_SESSION[
'pay_statistics'][
'til'][
'date'][
'y'] = $_POST[
'til'][
'date'][
'y'];
1746 $_SESSION[
'pay_statistics'][
'til'][
'date'][
'd'] =
'';
1747 $_SESSION[
'pay_statistics'][
'til'][
'date'][
'm'] =
'';
1748 $_SESSION[
'pay_statistics'][
'til'][
'date'][
'y'] =
'';
1751 $_SESSION[
'pay_statistics'][
'payed'] = $_POST[
'payed'];
1752 $_SESSION[
'pay_statistics'][
'access'] = $_POST[
'access'];
1753 $_SESSION[
'pay_statistics'][
'pay_method'] = $_POST[
'pay_method'];
1754 $_SESSION[
'pay_statistics'][
'customer'] = isset ($_POST[
'customer']) ? $_POST[
'customer'] :
'';
1755 $_SESSION[
'pay_statistics'][
'vendor'] = isset ($_POST[
'vendor']) ? $_POST[
'vendor']:
'';
1759 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.main_view.html',
'Services/Payment');
1762 $filter_form->setFormAction($this->ctrl->getFormAction($this));
1763 $filter_form->setTitle($this->lng->txt(
'pay_filter'));
1764 $filter_form->setId(
'formular');
1765 $filter_form->setTableWidth(
'100 %');
1767 $o_hide_check =
new ilCheckBoxInputGUI($this->lng->txt(
'show_filter'),
'show_filter');
1768 $o_hide_check->setValue(1);
1769 $o_hide_check->setChecked($_POST[
'show_filter'] ? 1 : 0);
1772 $o_hidden->setValue(1);
1773 $o_hidden->setPostVar(
'updateView');
1774 $o_hide_check->addSubItem($o_hidden);
1777 $trans_option = array($this->lng->txt(
'pay_starting'),$this->lng->txt(
'pay_ending'));
1778 $trans_value = array(
'0',
'1');
1779 $o_transaction_type->setTitle($this->lng->txt(
'paya_transaction'));
1780 $o_transaction_type->setOptions($trans_option);
1781 $o_transaction_type->setValue(
$_SESSION[
'pay_statistics'][
'transaction_type']);
1782 $o_transaction_type->setPostVar(
'transaction_type');
1783 $o_hide_check->addSubItem($o_transaction_type);
1786 $o_transaction_val->setValue(
$_SESSION[
'pay_statistics'][
'transaction_value']);
1787 $o_transaction_val->setPostVar(
'transaction_value');
1788 $o_hide_check->addSubItem($o_transaction_val);
1791 $o_customer->setTitle($this->lng->txt(
'paya_customer'));
1792 $o_customer->setValue(
$_SESSION[
'pay_statistics'][
'customer']);
1793 $o_customer->setPostVar(
'customer');
1794 $o_hide_check->addSubItem($o_customer);
1797 $o_vendor->setTitle($this->lng->txt(
'paya_vendor'));
1798 $o_vendor->setValue(
$_SESSION[
'pay_statistics'][
'vendor']);
1799 $o_vendor->setPostVar(
'vendor');
1800 $o_hide_check->addSubItem($o_vendor);
1802 $o_from_check =
new ilCheckBoxInputGUI($this->lng->txt(
'pay_order_date_from'),
'from_check');
1803 $o_from_check->setValue(1);
1804 $o_from_check->setChecked(
$_SESSION[
'pay_statistics'][
'from_check'] ? 1 : 0);
1807 $o_date_from->setPostVar(
'from');
1809 if(
$_SESSION[
'pay_statistics'][
'from_check'] ==
'1')
1811 $o_date_from->setValueByArray(
$_SESSION[
'pay_statistics'][
'from']);
1812 $o_date_from->checkInput();
1816 $o_hide_check->addSubItem($o_from_check);
1818 $o_until_check =
new ilCheckBoxInputGUI($this->lng->txt(
'pay_order_date_til'),
'until_check');
1819 $o_until_check->setValue(1);
1820 $o_until_check->setChecked(
$_SESSION[
'pay_statistics'][
'until_check'] ? 1 : 0);
1823 $o_date_until->setPostVar(
'til');
1825 if(
$_SESSION[
'pay_statistics'][
'until_check'] ==
'1')
1827 $o_date_until->setValueByArray(
$_SESSION[
'pay_statistics'][
'til']);
1828 $o_date_until->checkInput();
1831 $o_until_check->addSubItem($o_date_until);
1832 $o_hide_check->addSubItem($o_until_check);
1836 $title_options[
'all']=$this->lng->txt(
'pay_all');
1837 $unique_titles = $this->booking_obj->getUniqueTitles();
1839 if(is_array($unique_titles) && count($unique_titles))
1841 foreach($unique_titles as
$ref_id)
1843 $title_options[
$ref_id] = $ilObjDataCache->lookupTitle($ilObjDataCache->lookupObjId($ref_id));
1848 $o_object_title->setTitle($this->lng->txt(
'title'));
1849 $o_object_title->setOptions($title_options);
1850 $o_object_title->setValue(
$_SESSION[
"pay_statistics"][
"adm_filter_title_id"]);
1851 $o_object_title->setPostVar(
'adm_filter_title_id');
1852 $o_hide_check->addSubItem($o_object_title);
1855 $payed_option = array(
'all'=>$this->lng->txt(
'pay_all'),
'1'=>$this->lng->txt(
'yes'),
'0'=>$this->lng->txt(
'no'));
1857 $o_payed->setTitle($this->lng->txt(
'paya_payed'));
1858 $o_payed->setOptions($payed_option);
1859 $o_payed->setValue(
$_SESSION[
'pay_statistics'][
'payed']);
1860 $o_payed->setPostVar(
'payed');
1862 $o_hide_check->addSubItem($o_payed);
1865 $access_option = array(
'all'=>$this->lng->txt(
'pay_all'),
'1'=>$this->lng->txt(
'yes'),
'0'=>$this->lng->txt(
'no'));
1867 $o_access->setTitle($this->lng->txt(
'paya_access'));
1868 $o_access->setOptions($access_option);
1869 $o_access->setValue(
$_SESSION[
'pay_statistics'][
'access']);
1870 $o_access->setPostVar(
'access');
1871 $o_hide_check->addSubItem($o_access);
1874 $o_paymethod->setTitle($this->lng->txt(
'payment_system'));
1875 $o_paymethod->setOptions(ilPaymethods::getPayMethodsOptions(
'all'));
1876 $o_paymethod->setValue(
$_SESSION[
'pay_statistics'][
'pay_method']);
1877 $o_paymethod->setPostVar(
'pay_method');
1878 $o_hide_check->addSubItem($o_paymethod);
1880 $filter_form->addCommandButton(
'statistic', $this->lng->txt(
'pay_update_view'));
1881 $filter_form->addCommandButton(
'resetFilter', $this->lng->txt(
'pay_reset_filter'));
1883 $filter_form->addItem($o_hide_check);
1885 $this->tpl->setVariable(
'FORM', $filter_form->getHTML());
1891 if(!count($bookings = $this->booking_obj->getBookings()))
1899 # $this->__showButton('exportVendors',$this->lng->txt('excel_export'));
1902 include_once
'Services/User/classes/class.ilObjUser.php';
1903 $object_title_cache = array();
1904 $user_title_cache = array();
1907 foreach($bookings as $booking)
1909 if(array_key_exists($booking[
'ref_id'], $object_title_cache))
1911 $tmp_obj = $object_title_cache[$booking[
'ref_id']];
1916 $object_title_cache[$booking[
'ref_id']] = $tmp_obj;
1920 if(array_key_exists($booking[
'b_vendor_id'], $user_title_cache))
1922 $tmp_vendor = $user_title_cache[$booking[
'b_vendor_id']];
1927 $user_title_cache[$booking[
'b_vendor_id']] = $tmp_vendor;
1929 if(array_key_exists($booking[
'customer_id'], $user_title_cache))
1931 $tmp_purchaser = $user_title_cache[$booking[
'customer_id']];
1935 if(ANONYMOUS_USER_ID == $booking[
'customer_id'])
1938 $purchaser_name = $booking[
'name_extern'];
1939 $tmp_purchaser_email = $booking[
'email_extern'];
1945 $purchaser_name = $tmp_purchaser_name[
'firstname'].
' '.$tmp_purchaser_name[
'lastname'];
1948 $user_title_cache[$booking[
'customer_id']] = $tmp_purchaser;
1951 $transaction = $booking[
'transaction_extern'];
1953 $transaction .= $booking[
'transaction'].
"<br> (" . $str_paymethod .
")";
1955 $f_result[$counter][
'transaction'] = $transaction;
1956 $f_result[$counter][
'object_title'] = ($tmp_obj !=
'' ? $tmp_obj : $this->lng->txt(
'object_deleted'));
1957 $f_result[$counter][
'vendor'] = ($tmp_vendor !=
'' ?
'['.$tmp_vendor.
']' : $this->lng->txt(
'user_deleted'));
1958 $f_result[$counter][
'customer'] = ($tmp_purchaser !=
'' ?
1959 $purchaser_name.
' ['.$tmp_purchaser.
']<br>'
1960 .$tmp_purchaser_email
1961 : $this->lng->txt(
'user_deleted'));
1965 if($booking[
'duration'] == 0 && $booking[
'access_enddate'] == NULL)
1967 $f_result[$counter][
'duration'] = $this->lng->txt(
"unlimited_duration");
1979 $f_result[$counter][
'price'] = $booking[
'price'].
' '.$booking[
'currency_unit'];
1980 $f_result[$counter][
'discount'] = ($booking[
'discount'] !=
'' ? ($booking[
'discount'].
' '.$booking[
'currency_unit']) :
' ');
1982 $payed_access = $booking[
'payed'] ?
1983 $this->lng->txt(
'yes') :
1984 $this->lng->txt(
'no');
1986 $payed_access .=
'/';
1987 $payed_access .= $booking[
'access_granted'] ?
1988 $this->lng->txt(
'yes') :
1989 $this->lng->txt(
'no');
1991 $f_result[$counter][
'payed_access'] = $payed_access;
1993 $this->ctrl->setParameter($this,
"booking_id",$booking[
'booking_id']);
1994 $link_change =
"<div class=\"il_ContainerItemCommands\"><a class=\"il_ContainerItemCommand\" href=\"".$this->ctrl->getLinkTarget($this,
"editStatistic").
"\">".$this->lng->txt(
"edit").
"</a></div>";
1996 $f_result[$counter][
'edit'] = $link_change;
2000 unset($tmp_purchaser);
2011 include_once
'./Services/Payment/classes/class.ilPayMethods.php';
2013 if(!isset($_GET[
'booking_id']))
2016 $this->showStatistics();
2021 $ilToolbar->addButton($this->lng->txt(
'back'), $this->ctrl->getLinkTarget($this,
'statistic'));
2023 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.main_view.html',
'Services/Payment');
2024 $this->ctrl->setParameter($this,
'booking_id',(
int) $_GET[
'booking_id']);
2027 if($a_show_confirm_delete)
2032 $oConfirmationGUI->setFormAction($this->ctrl->getFormAction($this,
"performDelete"));
2033 $oConfirmationGUI->setHeaderText($this->lng->txt(
"paya_sure_delete_stat"));
2034 $oConfirmationGUI->setCancel($this->lng->txt(
"cancel"),
"statistic");
2035 $oConfirmationGUI->setConfirm($this->lng->txt(
"confirm"),
"performDelete");
2037 $this->tpl->setVariable(
'CONFIRMATION', $oConfirmationGUI->getHTML());
2043 $bookings = $this->booking_obj->getBookings();
2044 $booking = $bookings[(int) $_GET[
'booking_id']];
2050 $oForm->setFormAction($this->ctrl->getFormAction($this));
2051 $oForm->setId(
'stat_form');
2052 $oForm->setTableWidth(
'50 %');
2054 if(is_object($tmp_user))
2056 $frm_user = $tmp_user->getFullname().
' ['.$tmp_user->getLogin().
']';
2060 $frm_user = $this->lng->txt(
'user_deleted');
2062 $oForm->setTitle($frm_user);
2069 $oTitleGUI->
setValue($tmp_obj !=
'' ? $tmp_obj : $this->lng->txt(
'object_deleted'));
2070 $oForm->addItem($oTitleGUI);
2074 $oTransactionGUI->
setValue($booking[
'transaction']);
2075 $oForm->addItem($oTransactionGUI);
2080 if(is_object($tmp_vendor))
2082 $frm_vendor = $tmp_vendor->getFullname().
' ['.$tmp_vendor->getLogin().
']';
2086 $frm_vendor = $this->lng->txt(
'user_deleted');
2088 $oVendorGUI->
setValue($frm_vendor);
2089 $oForm->addItem($oVendorGUI);
2094 $oForm->addItem($oPaymethodGUI);
2099 $oForm->addItem($oOrderdateGUI);
2103 if($booking[
'duration'] == 0 && $booking[
'access_enddate'] == NULL)
2105 $frm_duration = $this->lng->txt(
"unlimited_duration");
2110 if($booking[
'duration'] > 0)
2112 $frm_duration = $booking[
'duration'].
' '.$this->lng->txt(
'paya_months').
'</br>';
2118 $oDurationGUI->setValue($frm_duration);
2119 $oForm->addItem($oDurationGUI);
2123 $oPriceGUI->
setValue($booking[
'price'].
' '.$booking[
'currency_unit']);
2124 $oForm->addItem($oPriceGUI);
2128 $oDiscountGUI->
setValue($booking[
'discount'].
' '.$booking[
'currency_unit']);
2129 $oForm->addItem($oDiscountGUI);
2133 $payed_option = array(0 => $this->lng->txt(
'no'),1 => $this->lng->txt(
'yes'));
2135 $oPayedGUI->setTitle($this->lng->txt(
'paya_payed'));
2136 $oPayedGUI->setOptions($payed_option);
2137 $oPayedGUI->setValue($booking[
'payed']);
2138 $oPayedGUI->setPostVar(
'payed');
2139 $oForm->addItem($oPayedGUI);
2143 $access_option = array(0 => $this->lng->txt(
'no'),1 => $this->lng->txt(
'yes'));
2145 $oAccessGUI->setTitle($this->lng->txt(
'paya_access'));
2146 $oAccessGUI->setOptions($access_option);
2147 $oAccessGUI->setValue($booking[
'access_granted']);
2148 $oAccessGUI->setPostVar(
'access');
2149 $oForm->addItem($oAccessGUI);
2151 $oForm->addCommandButton(
'updateStatistic',$this->lng->txt(
'save'));
2152 $oForm->addCommandButton(
'deleteStatistic',$this->lng->txt(
'delete'));
2158 $oForm2->setId(
'cust_form');
2159 $oForm2->setTableWidth(
'50%');
2160 $oForm2->setTitle($frm_user);
2164 $email = (!$tmp_user) ? $this->lng->txt(
'user_deleted') : $tmp_user->getEmail();
2166 $oForm2->addItem($oEmailGUI);
2170 $oStreetGUI->
setValue($booking[
'street']);
2171 $oForm2->addItem($oStreetGUI);
2175 $oPoBoxGUI->
setValue($booking[
'po_box']);
2176 $oForm2->addItem($oPoBoxGUI);
2180 $oPoBoxGUI->
setValue($booking[
'zipcode']);
2181 $oForm2->addItem($oPoBoxGUI);
2185 $oCityGUI->
setValue($booking[
'city']);
2186 $oForm2->addItem($oCityGUI);
2190 $oCountryGUI->
setValue($booking[
'country']);
2191 $oForm2->addItem($oCountryGUI);
2194 $this->tpl->setVariable(
'FORM',$oForm->getHTML());
2195 $this->tpl->setVariable(
'FORM_2',$oForm2->getHTML());
2201 if(!isset($_GET[
'booking_id']))
2210 $this->booking_obj->setBookingId((
int) $_GET[
'booking_id']);
2211 $this->booking_obj->setAccess((
int) $_POST[
'access']);
2212 $this->booking_obj->setPayed((
int) $_POST[
'payed']);
2214 if($this->booking_obj->update())
2232 if(!isset($_GET[
'booking_id']))
2247 if(!isset($_GET[
'booking_id']))
2256 $this->booking_obj->setBookingId((
int) $_GET[
'booking_id']);
2257 if(!$this->booking_obj->delete())
2259 die(
'Error deleting booking');
2275 global $rbacsystem, $ilHelp;
2278 $ilHelp->setScreenIdComponent(
"pays");
2279 if ($rbacsystem->checkAccess(
'visible,read',$this->object->getRefId()))
2282 $tabs_gui->addTarget(
'settings', $this->ctrl->getLinkTarget($this,
'generalSettings'),
2283 array(
'saveGeneralSettings',
'generalSettings ',
'saveBmfSettings',
'savePaypalSettings',
'paypalSettings',
2285 '',
'view'),
'',
'');
2288 $tabs_gui->addTarget(
'bookings', $this->ctrl->getLinkTarget($this,
'statistic'),
2289 array(
'statistic',
'editStatistic',
'updateStatistic',
'deleteStatistic',
'performDelete',
2290 'resetFilter',
'exportVendors',
'addCustomer',
'saveCustomer',
'showObjectSelector',
2291 'searchUserSP',
'performSearchSP'),
'',
'');
2293 $tabs_gui->addTarget(
'objects', $this->ctrl->getLinkTarget($this,
'objects'),
2294 array(
'updateObjectDetails',
'deleteObject',
'performObjectDelete',
'objects',
2295 'editPrices',
'addPrice',
'editDetails',
'resetObjectFilter'),
'',
'');
2297 $tabs_gui->addTarget(
'vendors', $this->ctrl->getLinkTarget($this,
'vendors'),
2298 array(
'vendors',
'searchUser',
'search',
'performSearch',
'addVendor',
'addUser',
'exportVendors',
'deleteVendors',
'performDeleteVendors',
2299 'cancelDeleteVendors',
'editVendor',
'performEditVendor'),
'',
'');
2301 #TODO: CURRENCY not finished yet
2309 $tabs_gui->addTarget(
'pay_methods', $this->ctrl->getLinkTarget($this,
'payMethods'),
2310 #array('payMethods','savePayMethods'), '', '');
2311 array(
'payMethods',
'savePayMethods ',
'saveBmfSettings',
'savePaypalSettings',
'paypalSettings',
2313 '',
'view'),
'',
'');
2317 $this->ctrl->getLinkTargetByClass(
'ilshoptopicsgui',
''),
'payment_topics',
'',
'');
2321 $this->ctrl->getLinkTarget($this,
'vats'),
'vats',
'',
'');
2324 $tabs_gui->addTarget(
'documents', $this->ctrl->getLinkTarget($this,
'documents'),
2325 array(
'documents',
'TermsConditions',
'saveTermsConditions',
'BillingMail',
2326 'saveBillingMail',
'InvoiceNumber',
'saveInvoiceNumber',
'StatutoryRegulations',
'saveStatutoryRegulations'),
'',
'');
2329 if ($rbacsystem->checkAccess(
'edit_permission',$this->object->getRefId()))
2333 $this->ctrl->getLinkTargetByClass(array(get_class($this),
'ilpermissiongui'),
'perm'), array(
'perm',
'info',
'owner'),
'ilpermissiongui');
2349 if(!$a_sub_tab) $a_sub_tab =
'payMethods';
2350 $this->tabs_gui->addSubTabTarget(
'settings',
2351 $this->ctrl->getLinkTargetByClass(
'ilobjpaymentsettingsgui',
'payMethods'),
2352 '',
'',
'',$a_sub_tab ==
'payMethods' ?
true :
false);
2354 $this->tabs_gui->addSubTabTarget(
'pays_bmf',
2355 $this->ctrl->getLinkTargetByClass(
'ilobjpaymentsettingsgui',
'bmfSettings'),
2356 '',
'',
'',$a_sub_tab ==
'bmfSettings' ?
true :
false);
2358 $this->tabs_gui->addSubTabTarget(
'pays_paypal',
2359 $this->ctrl->getLinkTargetByClass(
'ilobjpaymentsettingsgui',
'paypalSettings'),
2360 '',
'',
'',$a_sub_tab ==
'paypalSettings' ?
true :
false);
2377 if(!$a_sub_tab) $a_sub_tab =
'terms_conditions';
2378 $this->tabs_gui->addSubTabTarget(
'terms_conditions',
2379 $this->ctrl->getLinkTargetByClass(
'ilobjpaymentsettingsgui',
'TermsConditions'),
2380 '',
'',
'',$a_sub_tab ==
'terms_conditions' ?
true :
false);
2382 $this->tabs_gui->addSubTabTarget(
'billing_mail',
2383 $this->ctrl->getLinkTargetByClass(
'ilobjpaymentsettingsgui',
'BillingMail'),
2384 '',
'',
'',$a_sub_tab ==
'billing_mail' ?
true :
false);
2385 $this->tabs_gui->addSubTabTarget(
'invoice_number',
2386 $this->ctrl->getLinkTargetByClass(
'ilobjpaymentsettingsgui',
'InvoiceNumber'),
2387 '',
'',
'',$a_sub_tab ==
'invoice_number' ?
true :
false);
2388 $this->tabs_gui->addSubTabTarget(
'statutory_regulations',
2389 $this->ctrl->getLinkTargetByClass(
'ilobjpaymentsettingsgui',
'StatutoryRegulations'),
2390 '',
'',
'',$a_sub_tab ==
'statutory_regulations' ?
true :
false);
2395 if (($_GET[
'cmd'] ==
'') || ($_GET[
'cmd'] ==
'view') || ($a_sub_tab ==
'generalSettings'))
2396 $a_sub_tab =
'generalSettings';
2401 public function generalSettingsObject()
2409 if(!$rbacsystem->checkAccess(
'read', $this->object->getRefId()))
2411 $this->ilErr->raiseError($this->lng->txt(
'msg_no_perm_read'),$this->ilErr->MESSAGE);
2414 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.main_view.html',
'Services/Payment');
2420 $form->setFormAction($this->ctrl->getFormAction($this,
'saveGeneralSettings'));
2421 $form->setTitle($this->lng->txt(
'pays_general_settings'));
2423 $form->addCommandButton(
'saveGeneralSettings',$this->lng->txt(
'save'));
2426 $formItem =
new ilCheckboxInputGUI($this->lng->txt(
'pay_enable_shop'),
'shop_enabled');
2428 $formItem->setInfo($this->lng->txt(
'pay_enable_shop_info'));
2429 $form->addItem($formItem);
2431 $formItem =
new ilTextInputGUI($this->lng->txt(
'pays_currency_unit'),
'currency_unit');
2433 $formItem->setValue($this->error !=
'' && isset($_POST[
'currency_unit'])
2436 $formItem->setRequired(
true);
2437 $form->addItem($formItem);
2441 $formItem->setCols(35);
2442 $formItem->setRequired(
true);
2443 $formItem->setValue($this->error !=
'' && isset($_POST[
'address'])
2445 : $genSetData[
'address']);
2446 $form->addItem($formItem);
2450 $formItem->setCols(35);
2451 $formItem->setRequired(
true);
2452 $formItem->setValue($this->error !=
'' && isset($_POST[
'bank_data'])
2454 : $genSetData[
'bank_data']);
2455 $form->addItem($formItem);
2459 $formItem->setCols(35);
2460 $formItem->setValue($this->error !=
'' && isset($_POST[
'add_info'])
2462 : $genSetData[
'add_info']);
2463 $form->addItem($formItem);
2465 $formItem =
new ilTextInputGUI($this->lng->txt(
'pays_pdf_path'),
'pdf_path');
2466 $formItem->
setValue($this->error !=
"" && isset($_POST[
'pdf_path'])
2469 $formItem->setRequired(
true);
2470 $form->addItem($formItem);
2473 $formItem =
new ilSelectInputGUI($this->lng->txt(
'pay_topics_default_sorting_type'),
'topics_sorting_type');
2474 $formItem->
setValue($genSetData[
'topics_sorting_type']);
2476 1 => $this->lng->txt(
'pay_topics_sort_by_title'),
2477 2 => $this->lng->txt(
'pay_topics_sort_by_date'),
2478 3 => $this->lng->txt(
'pay_topics_sort_manually')
2481 $form->addItem($formItem);
2484 $formItem =
new ilSelectInputGUI($this->lng->txt(
'pay_topics_default_sorting_direction'),
'topics_sorting_direction');
2485 $formItem->
setValue($genSetData[
'topics_sorting_direction']);
2487 'asc' => $this->lng->txt(
'sort_asc'),
2488 'desc' => $this->lng->txt(
'sort_desc'),
2491 $form->addItem($formItem);
2494 $formItem =
new ilCheckboxInputGUI($this->lng->txt(
'pay_topics_allow_custom_sorting'),
'topics_allow_custom_sorting');
2495 $formItem->
setChecked((
int)$genSetData[
'topics_allow_custom_sorting']);
2496 $formItem->setInfo($this->lng->txt(
'pay_topics_allow_custom_sorting_info'));
2497 $form->addItem($formItem);
2506 $formItem =
new ilSelectInputGUI($this->lng->txt(
'pay_max_hits'),
'max_hits');
2507 $formItem->
setValue($genSetData[
'max_hits']);
2509 for($i = 10; $i <= 100; $i += 10)
2514 $formItem->setInfo($this->lng->txt(
'pay_max_hits_info'));
2515 $form->addItem($formItem);
2518 $formItem =
new ilCheckboxInputGUI($this->lng->txt(
'pay_hide_advanced_search'),
'hide_advanced_search');
2519 $formItem->
setChecked((
int)$genSetData[
'hide_advanced_search']);
2520 $formItem->setInfo($this->lng->txt(
'pay_hide_advanced_search_info'));
2521 $form->addItem($formItem);
2525 $formItem->
setChecked((
int)$genSetData[
'hide_news']);
2526 $formItem->setInfo($this->lng->txt(
'pay_hide_news_info'));
2527 $form->addItem($formItem);
2530 $formItem =
new ilCheckboxInputGUI($this->lng->txt(
'pay_hide_coupons'),
'hide_coupons');
2531 $formItem->
setChecked((
int)$genSetData[
'hide_coupons']);
2532 $formItem->setInfo($this->lng->txt(
'pay_hide_coupons'));
2533 $form->addItem($formItem);
2536 $formItem =
new ilCheckboxInputGUI($this->lng->txt(
'pay_hide_shop_info'),
'hide_shop_info');
2537 $formItem->
setChecked((
int)$genSetData[
'hide_shop_info']);
2538 $formItem->setInfo($this->lng->txt(
'pay_hide_shop_info_info'));
2539 $form->addItem($formItem);
2542 $formItem =
new ilCheckboxInputGUI($this->lng->txt(
'use_shop_specials'),
'use_shop_specials');
2543 $formItem->
setChecked((
int)$genSetData[
'use_shop_specials']);
2544 $formItem->setInfo($this->lng->txt(
'use_shop_specials_info'));
2545 $form->addItem($formItem);
2548 $formItem =
new ilCheckboxInputGUI($this->lng->txt(
'show_general_filter'),
'show_general_filter');
2549 $formItem->
setChecked((
int)$genSetData[
'show_general_filter']);
2550 $formItem->setInfo($this->lng->txt(
'show_general_filter_info'));
2551 $form->addItem($formItem);
2554 $formItem =
new ilCheckboxInputGUI($this->lng->txt(
'show_topics_filter'),
'show_topics_filter');
2555 $formItem->
setChecked((
int)$genSetData[
'show_topics_filter']);
2556 $formItem->setInfo($this->lng->txt(
'show_topics_filter_info'));
2557 $form->addItem($formItem);
2560 $formItem =
new ilCheckboxInputGUI($this->lng->txt(
'show_shop_explorer'),
'show_shop_explorer');
2561 $formItem->
setChecked((
int)$genSetData[
'show_shop_explorer']);
2562 $formItem->setInfo($this->lng->txt(
'show_shop_explorer_info'));
2563 $form->addItem($formItem);
2567 $payment_noti =
new ilCheckboxInputGUI($this->lng->txt(
"payment_notification"),
"payment_notification");
2569 $payment_noti->setChecked((
int)$ilSetting->get(
'payment_notification', 0) == 1);
2570 $payment_noti->setInfo($this->lng->txt(
'payment_notification_desc'));
2572 $num_days =
new ilNumberInputGUI($this->lng->txt(
'payment_notification_days'),
'payment_notification_days');
2574 $num_days->setMinValue(0);
2575 $num_days->setMaxValue(120);
2576 $num_days->setRequired(
true);
2577 $num_days->setValue($ilSetting->get(
'payment_notification_days'));
2578 $num_days->setInfo($this->lng->txt(
'payment_notification_days_desc'));
2580 $payment_noti->addSubItem($num_days);
2581 $form->addItem($payment_noti);
2584 $this->tpl->setVariable(
'FORM',
$form->getHTML());
2588 public function saveGeneralSettingsObject()
2593 if(!$rbacsystem->checkAccess(
'read', $this->object->getRefId()))
2595 $this->ilErr->raiseError($this->lng->txt(
'msg_no_perm_read'),$this->ilErr->MESSAGE);
2603 if ($_POST[
'currency_unit'] ==
'' ||
2604 $_POST[
'address'] ==
'' ||
2605 $_POST[
'bank_data'] ==
'' ||
2606 $_POST[
'pdf_path'] ==
'')
2608 $this->error = $this->lng->txt(
'pays_general_settings_not_valid');
2610 return $this->generalSettingsObject();
2614 $genSet->set(
'currency_unit', $_POST[
'currency_unit'],
'currencies');
2615 $genSet->set(
'address', $_POST[
'address'],
'invoice');
2616 $genSet->set(
'bank_data', $_POST[
'bank_data'],
'invoice');
2617 $genSet->set(
'add_info', $_POST[
'add_info'],
'invoice');
2618 $genSet->set(
'pdf_path', $_POST[
'pdf_path'],
'invoice');
2620 $genSet->set(
'topics_allow_custom_sorting', $_POST[
'topics_allow_custom_sorting'],
'gui');
2621 $genSet->set(
'topics_sorting_type', $_POST[
'topics_sorting_type'],
'gui');
2622 $genSet->set(
'topics_sorting_direction', $_POST[
'topics_sorting_direction'],
'gui');
2623 $genSet->set(
'max_hits', $_POST[
'max_hits'],
'gui');
2625 $genSet->set(
'hide_advanced_search', $_POST[
'hide_advanced_search'],
'gui');
2626 #$genSet->set('hide_filtering', $_POST['hide_filtering'], 'gui');
2627 $genSet->set(
'objects_allow_custom_sorting', $_POST[
'objects_allow_custom_sorting'],
'gui');
2628 $genSet->set(
'hide_coupons', $_POST[
'hide_coupons'],
'gui');
2629 $genSet->set(
'hide_news', $_POST[
'hide_news'],
'gui');
2631 if( (
int)$_POST[
'hide_news'] == 0 )
2633 if( (
int)$ilSetting->get(
'payment_news_archive_period') == 0)
2635 $ilSetting->set(
'payment_news_archive_period',
'5');
2639 $genSet->set(
'hide_shop_info', $_POST[
'hide_shop_info'],
'gui');
2640 $genSet->set(
'use_shop_specials', $_POST[
'use_shop_specials'],
'gui');
2641 $genSet->set(
'show_general_filter', $_POST[
'show_general_filter'],
'gui');
2642 $genSet->set(
'show_topics_filter', $_POST[
'show_topics_filter'],
'gui');
2643 $genSet->set(
'show_shop_explorer', $_POST[
'show_shop_explorer'],
'gui');
2646 $ilSetting->set(
'payment_notification', $_POST[
'payment_notification'] ? 1 : 0);
2647 $ilSetting->set(
'payment_notification_days', $_POST[
'payment_notification_days']);
2650 if($check ==
true && (
int)$_POST[
'shop_enabled'])
2652 $genSet->set(
'shop_enabled', 1,
'common');
2656 $genSet->set(
'shop_enabled', 0,
'common');
2660 $this->generalSettingsObject();
2664 public function paypalSettingsObject()
2673 if(!$rbacsystem->checkAccess(
'read', $this->object->getRefId()))
2675 $this->ilErr->raiseError($this->lng->txt(
'msg_no_perm_read'),$this->ilErr->MESSAGE);
2678 include_once
'./Services/Payment/classes/class.ilPaypalSettings.php';
2680 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.main_view.html',
'Services/Payment');
2685 $form->setFormAction($this->ctrl->getFormAction($this,
'savePaypalSettings'));
2686 $form->setTitle($this->lng->txt(
'pays_paypal_settings'));
2688 $form->addCommandButton(
'savePaypalSettings',$this->lng->txt(
'save'));
2690 $formItem =
new ilTextInputGUI($this->lng->txt(
'pays_server_host'),
'server_host');
2691 $formItem->
setValue($ppSet->getServerHost());
2692 $form->addItem($formItem);
2694 $formItem =
new ilTextInputGUI($this->lng->txt(
'pays_server_path'),
'server_path');
2695 $formItem->
setValue($ppSet->getServerPath());
2696 $form->addItem($formItem);
2698 $formItem =
new ilTextInputGUI($this->lng->txt(
'pays_email_vendor'),
'vendor');
2699 $formItem->
setValue($ppSet->getVendor());
2700 $form->addItem($formItem);
2707 $formItem =
new ilTextInputGUI($this->lng->txt(
'pays_auth_token'),
'auth_token');
2708 $formItem->
setValue($ppSet->getAuthToken());
2709 $form->addItem($formItem);
2711 $formItem =
new ilTextInputGUI($this->lng->txt(
'pays_page_style'),
'page_style');
2712 $formItem->
setValue($ppSet->getPageStyle());
2713 $form->addItem($formItem);
2715 $this->tpl->setVariable(
'FORM',
$form->getHTML());
2720 include_once
'./Services/Payment/classes/class.ilPaypalSettings.php';
2725 if(!$rbacsystem->checkAccess(
'read', $this->object->getRefId()))
2727 $this->ilErr->raiseError($this->lng->txt(
'msg_no_perm_read'),$this->ilErr->MESSAGE);
2740 if ($_POST[
'server_host'] ==
'' ||
2741 $_POST[
'server_path'] ==
'' ||
2742 $_POST[
'vendor'] ==
'' ||
2744 $_POST[
'auth_token'] ==
'')
2746 $this->error = $this->lng->txt(
'pays_paypal_settings_not_valid');
2748 $this->paypalSettingsObject();
2755 $this->paypalSettingsObject();
2766 #include_once './Services/Table/classes/class.ilTable2GUI.php';
2768 global $rbacsystem, $ilToolbar;
2771 if(!$rbacsystem->checkAccess(
'read', $this->object->getRefId()))
2773 $this->ilErr->raiseError($this->lng->txt(
'msg_no_perm_read'),$this->ilErr->MESSAGE);
2778 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.main_view.html',
'Services/Payment');
2785 'auto_complete_name' => $this->lng->txt(
'user'),
2786 'user_type' => null,
2787 'submit_name' => $this->lng->txt(
'add')
2790 if(!count($vendors = $this->vendors_obj->getVendors()))
2800 $oConfirmationGUI->setFormAction($this->ctrl->getFormAction($this,
"performDeleteVendors"));
2801 $oConfirmationGUI->setHeaderText($this->lng->txt(
"pays_sure_delete_selected_vendors"));
2802 $oConfirmationGUI->setCancel($this->lng->txt(
"cancel"),
"vendors");
2803 $oConfirmationGUI->setConfirm($this->lng->txt(
"confirm"),
"performDeleteVendors");
2805 foreach($vendors as $vendor)
2807 if(in_array($vendor[
'vendor_id'],
$_SESSION[
'pays_vendor']))
2813 $delete_row = $tmp_obj->getLogin().
' '.
2814 $vendor[
'cost_center'].
' '.
2816 $oConfirmationGUI->addItem(
'',$delete_row, $delete_row);
2822 if(count($vendors) == count(
$_SESSION[
'pays_vendor']))
2827 $this->tpl->setVariable(
'CONFIRMATION', $oConfirmationGUI->getHTML()); #
2832 $f_result = array();
2833 foreach($vendors as $vendor)
2839 $_SESSION[
'pays_vendor']) ? 1 : 0,
"vendor[]", $vendor[
'vendor_id']);
2840 $f_result[$counter][
'login'] = $tmp_obj->getLogin();
2841 $f_result[$counter][
'cost_center'] = $vendor[
'cost_center'];
2855 include_once
'./Services/Payment/classes/class.ilPaymentExcelWriterAdapter.php';
2865 $workbook = $pewa->getWorkbook();
2866 @$workbook->close();
2871 include_once
'./Services/Excel/classes/class.ilExcelUtils.php';
2872 include_once
'./Services/Payment/classes/class.ilPaymentVendors.php';
2876 $workbook = $pewa->getWorkbook();
2877 $worksheet = $workbook->addWorksheet(utf8_decode($this->lng->txt(
'bookings')));
2879 $worksheet->mergeCells(0,0,0,3);
2880 $worksheet->setColumn(0,0,16);
2881 $worksheet->setColumn(0,1,32);
2882 $worksheet->setColumn(0,2,32);
2883 $worksheet->setColumn(0,3,16);
2884 $worksheet->setColumn(0,4,16);
2885 $worksheet->setColumn(0,5,16);
2886 $worksheet->setColumn(0,6,24);
2887 $worksheet->setColumn(0,7,8);
2888 $worksheet->setColumn(0,8,12);
2889 $worksheet->setColumn(0,9,16);
2891 $title = $this->lng->txt(
'bookings');
2892 $title .=
' '.$this->lng->txt(
'as_of').
' ';
2893 $title .= strftime(
'%Y-%m-%d %R',time());
2895 $worksheet->writeString(0,0,$title,$pewa->getFormatTitle());
2897 $worksheet->writeString(1,0,$this->lng->txt(
'payment_system'),$pewa->getFormatHeader());
2898 $worksheet->writeString(1,1,$this->lng->txt(
'paya_transaction'),$pewa->getFormatHeader());
2899 $worksheet->writeString(1,2,$this->lng->txt(
'title'),$pewa->getFormatHeader());
2900 $worksheet->writeString(1,3,$this->lng->txt(
'paya_vendor'),$pewa->getFormatHeader());
2901 $worksheet->writeString(1,4,$this->lng->txt(
'pays_cost_center'),$pewa->getFormatHeader());
2902 $worksheet->writeString(1,5,$this->lng->txt(
'paya_customer'),$pewa->getFormatHeader());
2903 $worksheet->writeString(1,6,$this->lng->txt(
'email'),$pewa->getFormatHeader());
2904 $worksheet->writeString(1,7,$this->lng->txt(
'paya_order_date'),$pewa->getFormatHeader());
2905 $worksheet->writeString(1,8,$this->lng->txt(
'duration'),$pewa->getFormatHeader());
2906 $worksheet->writeString(1,9,$this->lng->txt(
'price_a'),$pewa->getFormatHeader());
2907 $worksheet->writeString(1,10,$this->lng->txt(
'paya_payed_access'),$pewa->getFormatHeader());
2909 $worksheet->writeString(1,11,$this->lng->txt(
'street'),$pewa->getFormatHeader());
2910 $worksheet->writeString(1,12,$this->lng->txt(
'pay_bmf_po_box'),$pewa->getFormatHeader());
2911 $worksheet->writeString(1,13,$this->lng->txt(
'zipcode'),$pewa->getFormatHeader());
2912 $worksheet->writeString(1,14,$this->lng->txt(
'city'),$pewa->getFormatHeader());
2913 $worksheet->writeString(1,15,$this->lng->txt(
'country'),$pewa->getFormatHeader());
2915 if(!count($bookings = $this->booking_obj->getBookings()))
2920 include_once
'Services/User/classes/class.ilObjUser.php';
2921 $object_title_cache = array();
2922 $user_title_cache = array();
2925 foreach($bookings as $booking)
2927 if(array_key_exists($booking[
'ref_id'], $object_title_cache))
2929 $tmp_obj = $object_title_cache[$booking[
'ref_id']];
2934 $object_title_cache[$booking[
'ref_id']] = $tmp_obj;
2936 if(array_key_exists($booking[
'b_vendor_id'], $user_title_cache))
2938 $tmp_vendor = $user_title_cache[$booking[
'b_vendor_id']];
2943 $user_title_cache[$booking[
'b_vendor_id']] = $tmp_vendor;
2945 if(array_key_exists($booking[
'customer_id'], $user_title_cache))
2947 $tmp_purchaser = $user_title_cache[$booking[
'customer_id']];
2954 $tmp_purchaser =
''.$tmp_purchaser_name[
'firstname'].
' '.$tmp_purchaser_name[
'lastname'].
' ['.$tmp_purchaser_login.
']';
2955 $user_title_cache[$booking[
'customer_id']] = $tmp_purchaser;
2958 include_once
'./Services/Payment/classes/class.ilPayMethods.php';
2961 $worksheet->writeString($counter,0,$str_paymethod);
2962 $worksheet->writeString($counter,1,$booking[
'transaction']);
2963 $worksheet->writeString($counter,2,($tmp_obj !=
'' ? $tmp_obj : $this->lng->txt(
'object_deleted')));
2964 $worksheet->writeString($counter,3,($tmp_vendor !=
'' ? $tmp_vendor : $this->lng->txt(
'user_deleted')));
2965 $worksheet->writeString($counter,4,ilPaymentVendors::_getCostCenter($booking[
'b_vendor_id']));
2966 $worksheet->writeString($counter,5,($tmp_purchaser !=
'' ? $tmp_purchaser : $this->lng->txt(
'user_deleted')));
2967 $worksheet->writeString($counter,6,$tmp_purchaser_email);
2968 $worksheet->writeString($counter,7,strftime(
'%Y-%m-%d %R',$booking[
'order_date']));
2969 $worksheet->writeString($counter,8,$booking[
'duration']);
2970 $worksheet->writeString($counter,9,$booking[
'price']);
2972 $payed_access = $booking[
'payed'] ?
2973 $this->lng->txt(
'yes') :
2974 $this->lng->txt(
'no');
2976 $payed_access .=
'/';
2977 $payed_access .= $booking[
'access_granted'] ?
2978 $this->lng->txt(
'yes') :
2979 $this->lng->txt(
'no');
2981 $worksheet->writeString($counter,10,$payed_access);
2983 $worksheet->writeString($counter,11,$booking[
'street']);
2984 $worksheet->writeString($counter,12,$booking[
'po_box']);
2985 $worksheet->writeString($counter,13,$booking[
'zipcode']);
2986 $worksheet->writeString($counter,14,$booking[
'city']);
2987 $worksheet->writeString($counter,15,$booking[
'country']);
2991 unset($tmp_purchaser);
3000 include_once
'./Services/Excel/classes/class.ilExcelUtils.php';
3002 $workbook = $pewa->getWorkbook();
3003 $worksheet = $workbook->addWorksheet($this->lng->txt(
'pays_vendor'));
3006 $worksheet->mergeCells(0,0,0,2);
3007 $worksheet->setColumn(1,0,32);
3008 $worksheet->setColumn(1,1,32);
3009 $worksheet->setColumn(1,2,32);
3011 $title = $this->lng->txt(
'pays_vendor');
3012 $title .=
' '.$this->lng->txt(
'as_of').
' ';
3013 $title .= strftime(
'%Y-%m-%d %R',time());
3015 $worksheet->writeString(0,0,$title,$pewa->getFormatTitle());
3017 $worksheet->writeString(1,0,$this->lng->txt(
'login'),$pewa->getFormatHeader());
3018 $worksheet->writeString(1,1,$this->lng->txt(
'fullname'),$pewa->getFormatHeader());
3019 $worksheet->writeString(1,2,$this->lng->txt(
'pays_cost_center'),$pewa->getFormatHeader());
3021 if(!count($vendors = $this->vendors_obj->getVendors()))
3027 foreach($vendors as $vendor)
3032 $worksheet->writeString($counter,0,$tmp_obj->getLogin());
3033 $worksheet->writeString($counter,1,$tmp_obj->getFullname());
3034 $worksheet->writeString($counter,2,$vendor[
'cost_center']);
3044 include_once
'./Services/Payment/classes/class.ilPayMethods.php';
3048 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.main_view.html',
'Services/Payment');
3050 if(!$rbacsystem->checkAccess(
'read', $this->object->getRefId()))
3052 $this->ilErr->raiseError($this->lng->txt(
'msg_no_perm_read'),$this->ilErr->MESSAGE);
3055 if(count($askForDeletingAddresses))
3060 $oConfirmationGUI->setFormAction($ilCtrl->getFormAction($this,
"deleteAddressesForPaymethods"));
3061 $oConfirmationGUI->setHeaderText($this->lng->txt(
"info_delete_sure"));
3062 $oConfirmationGUI->setCancel($this->lng->txt(
"cancel"),
"payMethods");
3063 $oConfirmationGUI->setConfirm($this->lng->txt(
"confirm"),
"deleteAddressesForPaymethods");
3065 foreach($askForDeletingAddresses as $pm_id)
3068 $oConfirmationGUI->additem(
'paymethod['.$pm_obj->getPmId().
']',$pm_obj->getPmId(), $this->lng->txt(
'delete_addresses_bill').
' -> '.
ilPayMethods::getStringByPaymethod($pm_obj->getPmTitle()));
3071 $this->tpl->setVariable(
'CONFIRMATION', $oConfirmationGUI->getHtml());
3076 $paymethods = $obj_paymethods->readAll();
3080 foreach($paymethods as $paymethod)
3082 if($paymethod[
'pm_title'] !=
'epay')
3086 $result[$counter][
'save_usr_adr'] =
ilUtil::formCheckbox($paymethod[
'save_usr_adr'] ? 1 : 0,
'save_usr_adr['.$paymethod[
'pm_id'].
']',1);
3087 $this->ctrl->clearParameters($this);
3092 $this->ctrl->setParameter($this,
'cmd',
'savePayMethods');
3094 $tbl->setTitle($this->lng->txt(
'pays_pay_methods'));
3096 $tbl->setId(
'tbl_paymethods');
3097 $tbl->setRowTemplate(
"tpl.shop_paymethods_row.html",
"Services/Payment");
3099 $tbl->addColumn($this->lng->txt(
'title'),
'pm_title',
'10%');
3100 $tbl->addColumn($this->lng->txt(
'enabled'),
'pm_enabled',
'10%');
3101 $tbl->addColumn($this->lng->txt(
'save_customer_address'),
'save_usr_adr',
'10%');
3102 $tbl->addCommandButton(
'savePayMethods', $this->lng->txt(
'save'));
3104 $tbl->disable(
'sort');
3107 $this->tpl->setVariable(
'TABLE', $tbl->getHTML());
3114 include_once
'./Services/Payment/classes/class.ilPayMethods.php';
3118 if(!$rbacsystem->checkAccess(
'read', $this->object->getRefId()))
3120 $this->ilErr->raiseError($this->lng->txt(
'msg_no_perm_read'),$this->ilErr->MESSAGE);
3124 $paymethods = $obj_paymethods->readAll();
3126 $askForDeletingAddresses = array();
3128 $pm_enabled = (array)$_POST[
'pm_enabled'];
3129 $pm_addr = (array)$_POST[
'save_usr_adr'];
3134 $this->genSetData->set(
'shop_enabled', 0,
'common');
3138 $info_msg = array();
3139 foreach($paymethods as $paymethod)
3142 (!isset($pm_enabled[$paymethod[
'pm_id']]) || !$pm_enabled[$paymethod[
'pm_id']]) &&
3143 $paymethod[
'pm_enabled']
3148 $info_msg[] = $this->lng->txt(
'pays_objects_'.$paymethod[
'pm_title'].
'_exist');
3160 foreach($paymethods as $paymethod)
3163 (!isset($pm_enabled[$paymethod[
'pm_id']]) || !$pm_enabled[$paymethod[
'pm_id']]) &&
3164 $paymethod[
'pm_enabled']
3170 else if(isset($pm_enabled[$paymethod[
'pm_id']]) && $pm_enabled[$paymethod[
'pm_id']] && !$paymethod[
'pm_enabled'])
3177 (!isset($pm_addr[$paymethod[
'pm_id']]) || !$pm_addr[$paymethod[
'pm_id']]) &&
3178 $paymethod[
'save_usr_adr'])
3180 $askForDeletingAddresses[] = $paymethod[
'pm_id'];
3183 (!isset($pm_addr[$paymethod[
'pm_id']]) || !$pm_addr[$paymethod[
'pm_id']]) &&
3184 !$paymethod[
'save_usr_adr']
3195 if($num_changed && !$askForDeletingAddresses)
3217 if(!count($_POST[
'vendor']))
3225 foreach($_POST[
'vendor'] as $vendor)
3236 $_SESSION[
'pays_vendor'] = $_POST[
'vendor'];
3245 include_once
'./Services/Payment/classes/class.ilPaymentTrustees.php';
3250 if(!$rbacsystem->checkAccess(
'write', $this->object->getRefId()))
3252 $this->ilErr->raiseError($this->lng->txt(
'msg_no_perm_write'),$this->ilErr->MESSAGE);
3255 foreach(
$_SESSION[
'pays_vendor'] as $vendor)
3257 $this->vendors_obj->delete($vendor);
3265 $this->genSetData->set(
'shop_enabled', 0,
'common');
3279 if(!$rbacsystem->checkAccess(
"write", $this->object->getRefId()))
3281 $this->ilErr->raiseError($this->lng->txt(
"msg_no_perm_write"),$this->ilErr->MESSAGE);
3284 if(!count($_POST[
'vendor']))
3291 if(count($_POST[
'vendor']) > 1)
3299 $_SESSION[
'pays_vendor'] = $_POST[
'vendor'][0];
3301 if (!is_array($this->vendors_obj->vendors[
$_SESSION[
'pays_vendor']]))
3308 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.main_view.html',
'Services/Payment');
3311 $form_gui->setFormAction($this->ctrl->getFormAction($this,
'performEditVendor'));
3312 $form_gui->setTitle($this->lng->txt(
'pays_vendor'));
3316 $form_gui->addItem($oVendorGUI);
3318 $oCostcenterGUI =
new ilTextInputGUI($this->lng->txt(
'pays_cost_center'),
'cost_center');
3319 $oCostcenterGUI->
setValue($this->error !=
'' && isset($_POST[
'cost_center'])
3322 $form_gui->addItem($oCostcenterGUI);
3324 $form_gui->addCommandButton(
'performEditVendor',$this->lng->txt(
'save'));
3325 $this->tpl->setVariable(
'FORM', $form_gui->getHTML());
3334 if(!$rbacsystem->checkAccess(
'write', $this->object->getRefId()))
3336 $this->ilErr->raiseError($this->lng->txt(
'msg_no_perm_write'),$this->ilErr->MESSAGE);
3354 if (!is_array($this->vendors_obj->vendors[
$_SESSION[
'pays_vendor']]))
3360 if ($_POST[
'cost_center'] ==
'')
3362 $this->error = $this->lng->txt(
'pays_cost_center_not_valid');
3364 $_POST[
'vendor'] = array(
$_SESSION[
'pays_vendor']);
3365 return $this->editVendor();
3369 $this->vendors_obj->update(
$_SESSION[
'pays_vendor'], $_POST[
'cost_center']);
3380 global $rbacsystem,
$tree, $ilToolbar;
3383 if(!$rbacsystem->checkAccess(
'read', $this->object->getRefId()))
3385 $this->ilErr->raiseError($this->lng->txt(
'msg_no_perm_read'),$this->ilErr->MESSAGE);
3388 include_once
'./Services/Payment/classes/class.ilPaymentObjectSelector.php';
3390 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.paya_object_selector.html',
'Services/Payment');
3392 $ilToolbar->addButton($this->lng->txt(
'back'), $this->ctrl->getLinkTarget($this,
'statistic'));
3396 $exp =
new ilPaymentObjectSelector($this->ctrl->getLinkTarget($this,
'showObjectSelector'), (string)strtolower(get_class($this)));
3397 $exp->setExpand($_GET[
'paya_link_expand'] ? $_GET[
'paya_link_expand'] : $tree->readRootId());
3398 $exp->setExpandTarget($this->ctrl->getLinkTarget($this,
'showObjectSelector'));
3402 $this->tpl->setVariable(
'EXPLORER',$exp->getOutput());
3446 if(!$rbacsystem->checkAccess(
'read', $this->object->getRefId()))
3448 $this->ilErr->raiseError($this->lng->txt(
'msg_no_perm_read'),$this->ilErr->MESSAGE);
3451 $_SESSION[
'pays_search_str'] = $_POST[
'search_str'] = $_POST[
'search_str'] ? $_POST[
'search_str'] :
$_SESSION[
'pays_search_str'];
3453 if(!isset($_POST[
'search_str']))
3468 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.main_view.html',
'Services/Payment');
3471 $f_result = array();
3479 $f_result[$counter][
'login'] = $tmp_obj->getLogin();
3480 $f_result[$counter][
'lastname'] = $tmp_obj->getLastname();
3481 $f_result[$counter][
'firstname'] = $tmp_obj->getFirstname();
3496 if(!$rbacsystem->checkAccess(
'write', $this->object->getRefId()))
3498 $this->ilErr->raiseError($this->lng->txt(
'msg_no_perm_write'),$this->ilErr->MESSAGE);
3500 if(!$_POST[
'user_login'])
3515 if($this->vendors_obj->isAssigned(
$usr_id))
3522 $this->vendors_obj->add(
$usr_id);
3535 if(!$rbacsystem->checkAccess(
'write', $this->object->getRefId()))
3537 $this->ilErr->raiseError($this->lng->txt(
'msg_no_perm_write'),$this->ilErr->MESSAGE);
3540 $this->lng->loadLanguageModule(
'crs');
3541 if(!is_array($_POST[
'user']))
3549 $already_assigned = $assigned = 0;
3550 foreach($_POST[
'user'] as
$usr_id)
3552 if($this->vendors_obj->isAssigned($usr_id))
3554 ++$already_assigned;
3557 $this->vendors_obj->add($usr_id);
3565 $message .= $this->lng->txt(
'pays_assigned_vendors').
' '.$assigned;
3567 if($already_assigned)
3569 $message .=
'<br />'.$this->lng->txt(
'pays_already_assigned_vendors').
' '.$already_assigned;
3582 if(!isset($_GET[
'sell_id']))
3584 ilUtil::sendFailiure($this->lng->txt(
'paya_no_booking_id_given'));
3590 $ilToolbar->addButton($this->lng->txt(
'back'), $this->ctrl->getLinkTarget($this,
'showObjectSelector'));
3591 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.main_view.html',
'Services/Payment');
3593 $this->lng->loadLanguageModule(
'search');
3594 $this->ctrl->setParameter($this,
'sell_id', $_GET[
'sell_id']);
3597 $form_gui->setFormAction($this->ctrl->getFormAction($this));
3598 $form_gui->setTitle($this->lng->txt(
'search_user'));
3599 $form_gui->setId(
'search_form');
3601 $oTitle =
new ilTextInputGUI($this->lng->txt(
'search_search_term'),
'search_str');
3603 $oTitle->setSize(40);
3604 $oTitle->setValue($_POST[
'search_str']);
3605 $form_gui->addItem($oTitle);
3608 $form_gui->addCommandButton(
'performSearchSP', $this->lng->txt(
'search'));
3609 $form_gui->addCommandButton(
'bookings', $this->lng->txt(
'cancel'));
3611 $this->tpl->setVariable(
'FORM',$form_gui->getHTML());
3619 $_SESSION[
'paya_search_str_user_sp'] = $_POST[
'search_str'] = $_POST[
'search_str'] ? $_POST[
'search_str'] :
$_SESSION[
'paya_search_str_user_sp'];
3621 if(!trim($_POST[
'search_str']))
3624 $this->statistics();
3636 if(!isset($_GET[
'sell_id']))
3644 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.main_view.html',
'Services/Payment');
3645 $this->ctrl->setParameter($this,
'sell_id', $_GET[
'sell_id']);
3647 $ilToolbar->addButton($this->lng->txt(
'back'), $this->ctrl->getLinkTarget($this,
'searchUserSP'));
3650 $f_result = array();
3657 $f_result[$counter][
'user_id'] = $user[
'id'];
3658 $f_result[$counter][
'login'] = $tmp_obj->getLogin();
3659 $f_result[$counter][
'firstname'] = $tmp_obj->getFirstname();
3660 $f_result[$counter][
'lastname'] = $tmp_obj->getLastname();
3672 if ($_POST[
'sell_id'] !=
'') $_GET[
'sell_id'] = $_POST[
'sell_id'];
3673 if ($_GET[
'user_id'] !=
'') $_POST[
'user_id'] = $_GET[
'user_id'];
3675 if(!isset($_GET[
'sell_id']))
3683 if(!isset($_POST[
'user_id']))
3690 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.main_view.html',
'Services/Payment');
3691 $this->ctrl->setParameter($this,
'sell_id', $_GET[
'sell_id']);
3693 $ilToolbar->addButton($this->lng->txt(
'back'), $this->ctrl->getLinkTarget($this,
'searchUserSP'));
3695 $this->ctrl->setParameter($this,
'user_id', $_POST[
'user_id']);
3704 $tmp_object[
'title'] = $tmp_obj->getTitle();
3708 $tmp_object[
'title'] = $this->lng->txt(
'object_not_found');
3716 $oForm->setFormAction($this->ctrl->getFormAction($this,
'saveCustomer'));
3717 $oForm->setTitle($this->lng->txt($tmp_user->getFullname().
' ['.$tmp_user->getLogin().
']'));
3721 $oTransaction->setTitle($this->lng->txt(
'paya_transaction'));
3723 $oTransaction->setValue($_POST[
'transaction']);
3724 $oTransaction->setPostVar(
'transaction');
3725 $oForm->addItem($oTransaction);
3729 $oObject->
setValue($tmp_obj->getTitle());
3730 $oForm->addItem($oObject);
3734 $oVendor->
setValue($tmp_vendor->getFullname().
' ['.$tmp_vendor->getLogin().
']');
3735 $oForm->addItem($oVendor);
3738 $oPayMethods =
new ilSelectInputGUI($this->lng->txt(
'paya_pay_method'),
'pay_method');
3739 $payOptions = ilPaymethods::getPayMethodsOptions(
false);
3740 $oPayMethods->setOptions($payOptions);
3741 $oPayMethods->setValue($_POST[
'pay_method']);
3742 $oPayMethods->setPostVar(
'pay_method');
3743 $oForm->addItem($oPayMethods);
3746 $duration_options = array();
3749 $standard_prices = array();
3750 $extension_prices = array();
3751 $standard_prices = $price_obj->getPrices();
3752 $extension_prices = $price_obj->getExtensionPrices();
3754 $prices = array_merge($standard_prices, $extension_prices );
3756 if (is_array($prices))
3759 $currency_unit = $genSet->get(
'currency_unit');
3761 foreach($prices as $price)
3763 switch($price[
'price_type'])
3767 $price[
'duration'].
' '.$this->lng->txt(
'paya_months').
' -> '.$price[
'price'].
' '. $currency_unit;
3771 include_once
'./Services/Calendar/classes/class.ilDatePresentation.php';
3778 $txt_duration = $this->lng->txt(
'unlimited_duration').
' -> '.$price[
'price'].
' '. $currency_unit;
3781 $txt_extension =
'';
3782 if($price[
'extension'] == 1)
3784 $txt_extension =
' ('.$this->lng->txt(
'extension_price').
') ';
3786 $duration_options[$price[
'price_id']] .= $txt_duration.
''.$txt_extension;
3790 $oDuration =
new ilSelectInputGUI($this->lng->txt(
'duration'),
'price_id');
3791 $oDuration->setOptions($duration_options);
3792 $oDuration->
setValue($_POST[
'price_id']);
3793 $oForm->addItem($oDuration);
3797 $payed_option = array(
'1'=>$this->lng->txt(
'yes'),
'0'=>$this->lng->txt(
'no'));
3799 $o_payed->setTitle($this->lng->txt(
'paya_payed'));
3800 $o_payed->setOptions($payed_option);
3801 $o_payed->setValue($_POST[
'payed']);
3802 $o_payed->setPostVar(
'payed');
3803 $oForm->addItem($o_payed);
3807 $access_option = array(
'1'=>$this->lng->txt(
'yes'),
'0'=>$this->lng->txt(
'no'));
3809 $o_access->setTitle($this->lng->txt(
'paya_access'));
3810 $o_access->setOptions($access_option);
3811 $o_access->setValue($_POST[
'access']);
3812 $o_access->setPostVar(
'access');
3814 $oForm->addItem($o_access);
3816 $oForm->addCommandButton(
'saveCustomer',$this->lng->txt(
'save'));
3817 $oForm->addCommandButton(
'bookings', $this->lng->txt(
'cancel'));
3819 $this->tpl->setVariable(
'FORM',$oForm->getHTML());
3825 global
$ilUser,$ilObjDataCache;
3827 if(!isset($_GET[
'sell_id']))
3835 if(!isset($_GET[
'user_id']))
3843 if ($_POST[
'pay_method'] ==
'' ||
3844 $_POST[
'price_id'] ==
'')
3859 $this->booking_obj->setTransaction($transaction);
3860 $this->booking_obj->setTransactionExtern($_POST[
'transaction']);
3861 $this->booking_obj->setPobjectId($pObjectId);
3862 $this->booking_obj->setCustomerId($_GET[
'user_id']);
3863 $this->booking_obj->setVendorId($obj->getVendorId());
3865 $this->booking_obj->setPayMethod($_POST[
'pay_method']);
3866 $this->booking_obj->setOrderDate(time());
3872 switch($price[
'price_type'])
3875 $this->booking_obj->setDuration($price[
'duration']);
3879 $this->booking_obj->setDuration(0);
3880 $this->booking_obj->setAccessStartdate($price[
'duration_from']);
3881 $this->booking_obj->setAccessEnddate($price[
'duration_until']);
3884 $this->booking_obj->setDuration(0);
3885 $this->booking_obj->setAccessEnddate(NULL);
3889 $this->booking_obj->setPriceType($price[
'price_type']);
3890 $this->booking_obj->setPrice($price[
'price']);
3892 $this->booking_obj->setAccess((
int) $_POST[
'access']);
3893 $this->booking_obj->setPayed((
int) $_POST[
'payed']);
3894 $this->booking_obj->setVoucher(
'');
3896 $obj_id = $ilObjDataCache->lookupObjId($obj->getRefId());
3897 $obj_type = $ilObjDataCache->lookupType(
$obj_id);
3898 $obj_title = $ilObjDataCache->lookupTitle(
$obj_id);
3901 $oVAT =
new ilShopVats((
int)$obj->getVatId());
3902 $obj_vat_rate = $oVAT->
getRate();
3903 $obj_vat_unit = $obj->getVat($this->booking_obj->getPrice());
3905 $this->booking_obj->setObjectTitle($obj_title);
3906 $this->booking_obj->setVatRate($obj_vat_rate);
3907 $this->booking_obj->setVatUnit($obj_vat_unit);
3910 $this->booking_obj->setCurrencyUnit( $genSet->get(
'currency_unit'));
3912 include_once
'./Services/Payment/classes/class.ilPayMethods.php';
3915 if($save_user_address_enabled == 1)
3918 $user_id[] = $_GET[
"user_id"];
3922 $this->booking_obj->setStreet($cust_obj[$_GET[
"user_id"]][
'street'],
'');
3924 $this->booking_obj->setZipcode($cust_obj[$_GET[
"user_id"]][
'zipcode']);
3925 $this->booking_obj->setCity($cust_obj[$_GET[
"user_id"]][
'city']);
3926 $this->booking_obj->setCountry($cust_obj[$_GET[
"user_id"]][
'country']);
3929 if($this->booking_obj->add())
3935 if($obj_type ==
'crs')
3954 $this->ctrl->setParameter($this,
'cmd',
'statistic');
3957 $tbl->setTitle($this->lng->txt(
"bookings"));
3958 $tbl->setId(
'tbl_show_statistics');
3959 $tbl->setRowTemplate(
"tpl.shop_statistics_row.html",
"Services/Payment");
3961 $tbl->addColumn($this->lng->txt(
'paya_transaction'),
'transaction',
'10%');
3962 $tbl->addColumn($this->lng->txt(
'title'),
'object_title',
'10%');
3963 $tbl->addColumn($this->lng->txt(
'paya_vendor'),
'vendor',
'10%');
3964 $tbl->addColumn($this->lng->txt(
'paya_customer'),
'customer',
'10%');
3965 $tbl->addColumn($this->lng->txt(
'paya_order_date'),
'order_date',
'10%');
3966 $tbl->addColumn($this->lng->txt(
'duration'),
'duration',
'20%');
3967 $tbl->addColumn($this->lng->txt(
'price_a'),
'price',
'5%');
3968 $tbl->addColumn($this->lng->txt(
'paya_coupons_coupon'),
'discount',
'5%');
3969 $tbl->addColumn($this->lng->txt(
'paya_payed_access'),
'payed_access',
'1%');
3970 $tbl->addColumn(
'',
'edit',
'5%');
3972 $tbl->addCommandButton(
'exportVendors',$this->lng->txt(
'excel_export'));
3973 $tbl->setData($a_result_set);
3975 $this->tpl->setVariable(
'TABLE', $tbl->getHTML());
3982 include_once
'./Services/Payment/classes/class.ilPaymentBookings.php';
3989 $this->ctrl->setParameter($this,
'cmd',
'vendors');
3992 $tbl->setTitle($this->lng->txt(
"vendors"));
3993 $tbl->setId(
'tbl_show_vendors');
3994 $tbl->setRowTemplate(
"tpl.shop_users_row.html",
"Services/Payment");
3996 $tbl->addColumn(
'',
'vendor_id',
'1%');
3997 $tbl->addColumn($this->lng->txt(
'paya_vendor'),
'login',
'10%');
3998 $tbl->addColumn($this->lng->txt(
'pays_cost_center'),
'cost_center',
'10%');
3999 $tbl->addColumn($this->lng->txt(
'pays_number_bookings'),
'number_bookings',
'10%');
4001 $tbl->addMultiCommand(
"editVendor", $this->lng->txt(
'pays_edit_vendor'));
4002 $tbl->addMultiCommand(
"deleteVendors", $this->lng->txt(
'pays_delete_vendor'));
4004 $tbl->addCommandButton(
'exportVendors',$this->lng->txt(
'excel_export'));
4006 $tbl->setData($a_result_set);
4007 $this->tpl->setVariable(
'TABLE', $tbl->getHTML());
4016 $tbl->setTitle($this->lng->txt(
"pays_header_select_vendor"));
4017 $tbl->setId(
'tbl_search_user_vendor');
4018 $tbl->setRowTemplate(
"tpl.shop_users_row.html",
"Services/Payment");
4020 $tbl->addColumn(
' ',
'vendor_id',
'3%',
true);
4021 $tbl->addColumn($this->lng->txt(
'login'),
'login',
'32%');
4022 $tbl->addColumn($this->lng->txt(
'firstname'),
'firstname',
'32%');
4023 $tbl->addColumn($this->lng->txt(
'lastname'),
'lastname',
'32%');
4025 $tbl->setSelectAllCheckbox(
'vendor_id');
4026 $tbl->addMultiCommand(
"addUser", $this->lng->txt(
"add"));
4027 $tbl->addCommandButton(
'vendors',$this->lng->txt(
'cancel'));
4030 $tbl->setData($a_result_set);
4031 $this->tpl->setVariable(
'TABLE', $tbl->getHTML());
4038 include_once(
'./Services/Search/classes/class.ilSearch.php');
4040 $this->lng->loadLanguageModule(
'content');
4043 $search->setPerformUpdate(
false);
4045 $search->setCombination(
'and');
4046 $search->setSearchFor(array(0 =>
'usr'));
4047 $search->setSearchType(
'new');
4049 if($search->validate($message))
4051 $search->performSearch();
4056 $this->ctrl->redirect($this,
'searchUser');
4058 return $search->getResultByType(
'usr');
4063 include_once(
'./Services/Search/classes/class.ilSearch.php');
4065 $this->lng->loadLanguageModule(
'content');
4067 $search =
new ilSearch($this->user_obj->getId());
4070 $search->setCombination(
'and');
4071 $search->setSearchFor(array(0 =>
'usr'));
4072 $search->setSearchType(
'new');
4074 if($search->validate($message))
4076 $search->performSearchSPObject();
4081 $this->ctrl->redirect($this,
'searchUserSP');
4083 return $search->getResultByType(
'usr');
4087 $this->ctrl->setParameter($this,
'sell_id', $_GET[
'sell_id']);
4090 $tbl->setTitle($this->lng->txt(
'users'));
4091 $tbl->setId(
'tbl_search_user_vendor');
4092 $tbl->setRowTemplate(
"tpl.shop_users_row.html",
"Services/Payment");
4094 $tbl->addColumn(
' ',
'user_id',
'3%',
true);
4095 $tbl->addColumn($this->lng->txt(
'login'),
'login',
'32%');
4096 $tbl->addColumn($this->lng->txt(
'firstname'),
'firstname',
'32%');
4097 $tbl->addColumn($this->lng->txt(
'lastname'),
'lastname',
'32%');
4100 $tbl->addMultiCommand(
"addCustomer", $this->lng->txt(
"add"));
4101 $tbl->addCommandButton(
'statistic',$this->lng->txt(
'cancel'));
4104 $tbl->setData($a_result_set);
4105 $this->tpl->setVariable(
'TABLE', $tbl->getHTML());
4113 if(!$ilAccess->checkAccess(
'read',
'', $this->object->getRefId()))
4115 $this->ilErr->raiseError($this->lng->txt(
'msg_no_perm_read'), $this->ilErr->MESSAGE);
4118 include_once
'Services/Table/classes/class.ilTable2GUI.php';
4120 $tbl->setId(
'pay_vats_tbl');
4121 $tbl->setFormAction($this->ctrl->getFormAction($this),
'createVat');
4122 $tbl->setTitle($this->lng->txt(
'payment_tax_rates'));
4123 $tbl->setRowTemplate(
'tpl.shop_vats_list_row.html',
'Services/Payment');
4125 $tbl->setDefaultOrderField(
'title');
4127 $tbl->addColumn(
'',
'check',
'1%');
4128 $tbl->addColumn($this->lng->txt(
'vat_title'),
'vat_title',
'33%');
4129 $tbl->addColumn($this->lng->txt(
'vat_rate'),
'vat_rate',
'33%');
4130 $tbl->addColumn(
'',
'commands',
'33%');
4133 $oShopVatsList->read();
4137 $_SESSION[
'count_vats'] = $oShopVatsList->getNumItems();
4139 if($oShopVatsList->hasItems())
4141 $tbl->enable(
'select_all');
4142 $tbl->setSelectAllCheckbox(
'vat_id');
4145 foreach($oShopVatsList as $oVAT)
4148 $result[$counter][
'vat_title'] = $oVAT->getTitle();
4150 $this->ctrl->setParameter($this,
'vat_id', $oVAT->getId());
4151 $result[$counter][
'edit_text'] = $this->lng->txt(
'edit');
4152 $result[$counter][
'edit_url'] = $this->ctrl->getLinkTarget($this,
'editVat');
4153 $result[$counter][
'delete_text'] = $this->lng->txt(
'delete');
4154 $result[$counter][
'delete_url'] = $this->ctrl->getLinkTarget($this,
'confirmDeleteVat');
4155 $this->ctrl->clearParameters($this);
4159 $tbl->addMultiCommand(
'confirmDeleteVat', $this->lng->txt(
'delete'));
4163 $tbl->disable(
'header');
4164 $tbl->disable(
'footer');
4166 $tbl->setNoEntriesText($this->lng->txt(
'paya_no_vats_assigned'));
4171 $tbl->addCommandButton(
'createVat', $this->lng->txt(
'paya_insert_vats'));
4173 $this->tpl->setContent($tbl->getHTML());
4180 if((
int)$_GET[
'vat_id'] && !isset($_POST[
'vat_id']))
4182 $_POST[
'vat_id'][] = $_GET[
'vat_id'];
4185 if(
$_SESSION[
'count_vats'] == count($_POST[
'vat_id']))
4192 $c_gui->setFormAction($this->ctrl->getFormAction($this,
'performDeleteVat'));
4193 $c_gui->setHeaderText($this->lng->txt(
'paya_sure_delete_vats'));
4194 $c_gui->setCancel($this->lng->txt(
'cancel'),
'vats');
4195 $c_gui->setConfirm($this->lng->txt(
'confirm'),
'performDeleteVat');
4198 foreach((array)$_POST[
'vat_id'] as $vat_id)
4203 $c_gui->addItem(
'vat_id[]', $oVAT->getId(), $oVAT->getTitle());
4215 $this->tpl->setContent($c_gui->getHTML());
4227 if(!is_array($_POST[
'vat_id']))
4232 foreach($_POST[
'vat_id'] as $vat_id)
4250 $this->genSetData->set(
'shop_enabled', 0,
'common');
4259 $this->tpl->setContent($this->form->getHtml());
4266 $this->tpl->setContent($this->form->getHtml());
4272 if($a_type ==
'edit')
4274 $this->ctrl->setParameter($this,
'vat_id', $_GET[
'vat_id']);
4275 $this->form->setFormAction($this->ctrl->getFormAction($this,
'updateVat'));
4276 $this->form->setTitle($this->lng->txt(
'payment_edit_vat'));
4280 $this->form->setFormAction($this->ctrl->getFormAction($this,
'saveVat'));
4281 $this->form->setTitle($this->lng->txt(
'payment_add_vat'));
4284 $oTitle =
new ilTextInputGUI($this->lng->txt(
'title'),
'vat_title');
4286 $oTitle->setSize(40);
4287 $oTitle->setRequired(
true);
4288 $oTitle->setInfo($this->lng->txt(
'payment_vat_title_info'));
4289 $this->form->addItem($oTitle);
4291 $oRate =
new ilTextInputGUI($this->lng->txt(
'vat_rate'),
'vat_rate');
4294 $oRate->setRequired(
true);
4295 $oRate->setInfo($this->lng->txt(
'payment_vat_rate_info'));
4296 $this->form->addItem($oRate);
4298 if($a_type ==
'edit')
4300 $this->form->addCommandButton(
'updateVat', $this->lng->txt(
'save'));
4304 $this->form->addCommandButton(
'saveVat', $this->lng->txt(
'save'));
4307 $this->form->addCommandButton(
'vats', $this->lng->txt(
'cancel'));
4312 $oVAT =
new ilShopVats((
int)$_GET[
'vat_id']);
4313 $this->form->setValuesByArray(array(
4314 'vat_title' => $oVAT->getTitle(),
4315 'vat_rate' => $oVAT->getRate()
4322 if(!$this->form->checkInput())
4324 $this->form->setValuesByPost();
4325 $this->tpl->setContent($this->form->getHtml());
4331 $this->form->getItemByPostVar(
'vat_rate')->setAlert($this->lng->txt(
'payment_vat_input_invalid'));
4332 $this->form->setValuesByPost();
4333 $this->tpl->setContent($this->form->getHtml());
4339 $oVAT =
new ilShopVats((
int)$_GET[
'vat_id']);
4340 $oVAT->setTitle($this->form->getInput(
'vat_title'));
4341 $oVAT->setRate((
float)str_replace(
',',
'.', $this->form->getInput(
'vat_rate')));
4347 $this->form->setValuesByPost();
4348 $this->tpl->setContent($this->form->getHtml());
4359 if(!$this->form->checkInput())
4361 $this->form->setValuesByPost();
4362 $this->tpl->setContent($this->form->getHtml());
4368 $this->form->getItemByPostVar(
'vat_rate')->setAlert($this->lng->txt(
'payment_vat_input_invalid'));
4369 $this->form->setValuesByPost();
4370 $this->tpl->setContent($this->form->getHtml());
4377 $oVAT->setTitle($this->form->getInput(
'vat_title'));
4378 $oVAT->setRate((
float)str_replace(
',',
'.', $this->form->getInput(
'vat_rate')));
4384 $this->form->setValuesByPost();
4385 $this->tpl->setContent($this->form->getHtml());
4399 include_once
'./Services/Payment/classes/class.ilPayMethods.php';
4405 $del_bookings = $this->booking_obj->deleteAddressesByPaymethod((
int)$pay_method);
4414 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.main_view.html',
'Services/Payment');
4418 foreach($currency_res as $cur)
4421 $f_result[$counter][
'is_default'] = $cur[
'is_default'] == 1 ? $this->lng->txt(
'yes') : $this->lng->txt(
'no');
4423 $f_result[$counter][
'currency_unit'] = $cur[
'unit'];
4424 $f_result[$counter][
'iso_code'] = $cur[
'iso_code'];
4425 $f_result[$counter][
'currency_symbol'] = $cur[
'symbol'];
4426 $f_result[$counter][
'conversion_rate'] = $cur[
'conversion_rate'];
4433 $tbl->setTitle($this->lng->txt(
"currencies"));
4434 $tbl->setId(
'tbl_show_currencies');
4435 $tbl->setRowTemplate(
"tpl.shop_currencies_row.html",
"Services/Payment");
4437 $tbl->addColumn(
' ',
'currency_id',
'1%',
true);
4438 $tbl->addColumn($this->lng->txt(
'is_default'),
'is_default',
'5%');
4439 $tbl->addColumn($this->lng->txt(
'currency_unit'),
'currency_unit',
'10%');
4440 $tbl->addColumn($this->lng->txt(
'iso_code'),
'iso_code',
'20%');
4441 $tbl->addColumn($this->lng->txt(
'currency_symbol'),
'currency_symbol',
'20%');
4442 $tbl->addColumn($this->lng->txt(
'conversion_rate'),
'conversion_rate',
'15%');
4443 $tbl->addColumn(
'',
'options',
'5%');
4445 $this->ctrl->setParameter($this,
'cmd',
'currencies');
4447 $tbl->addMultiCommand(
'updateDefaultCurrency', $this->lng->txt(
'paya_set_default_currency'));
4448 $tbl->addMultiCommand(
"editCurrency",$this->lng->txt(
'edit'));
4449 $tbl->addMultiCommand(
"deleteCurrency", $this->lng->txt(
'delete'));
4451 $tbl->addCommandButton(
'addCurrency',$this->lng->txt(
'add_currency'));
4452 $tbl->setData($f_result);
4453 $this->tpl->setVariable(
'TABLE', $tbl->getHTML());
4458 if(isset($_POST[
'currency_id'] ))
4469 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.main_view.html',
'Services/Payment');
4471 $form->setFormAction($this->ctrl->getFormAction($this));
4472 $form->setTitle($this->lng->txt(
'paya_add_currency'));
4474 $o_Unit =
new ilTextInputGUI($this->lng->txt(
'paya_currency_unit'),
'currency_unit');
4475 $o_Unit->
setValue($_POST[
'currency_unit']);
4476 $o_Unit->setPostVar(
'currency_unit');
4477 $o_Unit->setRequired(
true);
4479 $o_Isocode =
new ilTextInputGUI($this->lng->txt(
'iso_code'),
'iso_code');
4480 $o_Isocode->
setValue($_POST[
'iso_code']);
4481 $o_Isocode->setPostVar(
'iso_code');
4482 $o_Isocode->setRequired(
true);
4484 $o_Symbol =
new ilTextInputGUI($this->lng->txt(
'symbol'),
'symbol');
4485 $o_Symbol->
setValue($_POST[
'symbol']);
4486 $o_Symbol->setPostVar(
'symbol');
4487 $o_Symbol->setRequired(
true);
4489 $o_Conversionrate =
new IlTextInputGUI($this->lng->txt(
'conversion_rate'),
'conversion_rate');
4490 $o_Conversionrate->setValue($_POST[
'conversion_rate']);
4491 $o_Conversionrate->setPostVar(
'conversion_rate');
4492 $o_Conversionrate->setRequired(
true);
4494 $form->addItem($o_Unit);
4495 $form->addItem($o_Isocode);
4496 $form->addItem($o_Symbol);
4497 $form->addItem($o_Conversionrate);
4499 $form->addCommandButton(
'saveCurrency', $this->lng->txt(
'save'));
4500 $form->addCommandButton(
'currencies', $this->lng->txt(
'cancel'));
4502 $this->tpl->setVariable(
'FORM',
$form->getHTML());
4508 $obj_currency->setUnit($_POST[
'currency_unit']);
4509 $obj_currency->setIsoCode($_POST[
'iso_code']);
4510 $obj_currency->setSymbol($_POST[
'symbol']);
4511 $obj_currency->setConversionRate($_POST[
'conversion_rate']);
4512 $obj_currency->addCurrency();
4518 $currency_id = $_POST[
'currency_id'];
4521 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.main_view.html',
'Services/Payment');
4523 $form->setFormAction($this->ctrl->getFormAction($this));
4524 $form->setTitle($this->lng->txt(
'paya_edit_currency'));
4526 $o_Unit =
new ilTextInputGUI($this->lng->txt(
'paya_currency_unit'),
'currency_unit');
4527 $o_Unit->
setValue($obj_currency[$currency_id][
'unit']);
4528 $o_Unit->setPostVar(
'currency_unit');
4529 $o_Unit->setRequired(
true);
4531 $o_Isocode =
new ilTextInputGUI($this->lng->txt(
'iso_code'),
'iso_code');
4532 $o_Isocode->
setValue($obj_currency[$currency_id][
'iso_code']);
4533 $o_Isocode->setPostVar(
'iso_code');
4534 $o_Isocode->setRequired(
true);
4536 $o_Symbol =
new ilTextInputGUI($this->lng->txt(
'symbol'),
'symbol');
4537 $o_Symbol->
setValue($obj_currency[$currency_id][
'symbol']);
4538 $o_Symbol->setPostVar(
'symbol');
4539 $o_Symbol->setRequired(
true);
4541 $o_Conversionrate =
new IlTextInputGUI($this->lng->txt(
'conversion_rate'),
'conversion_rate');
4542 $o_Conversionrate->setValue($obj_currency[$currency_id][
'conversion_rate']);
4543 $o_Conversionrate->setPostVar(
'conversion_rate');
4544 $o_Conversionrate->setRequired(
true);
4547 $o_hidden->setValue($obj_currency[$currency_id][
'currency_id']);
4548 $o_hidden->setPostVar(
'currency_id');
4549 $form->addItem($o_hidden);
4551 $form->addItem($o_Unit);
4552 $form->addItem($o_Isocode);
4553 $form->addItem($o_Symbol);
4554 $form->addItem($o_Conversionrate);
4556 $form->addCommandButton(
'updateCurrency', $this->lng->txt(
'save'));
4557 $form->addCommandButton(
'currencies', $this->lng->txt(
'cancel'));
4559 $this->tpl->setVariable(
'FORM',
$form->getHTML());
4565 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.main_view.html',
'Services/Payment');
4567 $_SESSION[
'currency_id'] = $_POST[
'currency_id'];
4570 $this->ctrl->setParameter($this,
'currency_id',(
int) $_POST[
'currency_id']);
4572 $oConfirmationGUI->setFormAction($this->ctrl->getFormAction($this,
"performDeleteCurrency"));
4574 $oConfirmationGUI->setHeaderText($this->lng->txt(
"paya_sure_delete_selected_currency"));
4575 $oConfirmationGUI->setCancel($this->lng->txt(
"cancel"),
"currencies");
4576 $oConfirmationGUI->setConfirm($this->lng->txt(
"confirm"),
"performDeleteCurrency");
4580 $this->tpl->setVariable(
'CONFIRMATION', $oConfirmationGUI->getHtml());
4586 if(!
$_SESSION[
'currency_id'])
return false;
4589 $obj_currency->deleteCurrency();
4595 if(!$_POST[
'currency_id'])
return false;
4598 $obj_currency->setUnit($_POST[
'currency_unit']);
4599 $obj_currency->setIsoCode($_POST[
'iso_code']);
4600 $obj_currency->setSymbol($_POST[
'symbol']);
4601 $obj_currency->setConversionRate($_POST[
'conversion_rate']);
4603 $obj_currency->updateCurrency();
4614 $ilToolbar->addButton($this->lng->txt(
'edit_page'), $this->ctrl->getLinkTargetByClass(array(
'ilshoppagegui'),
'edit'));
4616 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.main_view.html',
'Services/Payment');
4624 include_once(
'./Services/Form/classes/class.ilPropertyFormGUI.php');
4626 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.main_view.html',
'Services/Payment');
4627 $this->tpl->addJavaScript(
'Services/Mail/js/ilMailComposeFunctions.js');
4630 $form_gui->setFormAction($this->ctrl->getFormAction($this,
'savebillingmail'));
4631 $form_gui->setTitle($this->lng->txt(
'billing_mail'));
4638 $inp->setRequired(
false);
4643 $chb =
new ilCheckboxInputGUI($this->lng->txt(
'activate_placeholders'),
'use_placeholders');
4647 $form_gui->addItem($inp);
4649 include_once
'Services/Payment/classes/class.ilBillingMailPlaceholdersPropertyGUI.php';
4652 $chb->addSubItem($prop);
4653 $chb->setChecked(
true);
4655 $form_gui->addItem($chb);
4657 $form_gui->addCommandButton(
'saveBillingMail', $this->lng->txt(
'save'));
4658 $this->tpl->setVariable(
'FORM', $form_gui->getHTML());
4665 if($_POST[
'm_message'])
4670 $_POST[
'use_placeholders'] ? $placeholders = 1: $placeholders = 0;
4682 include_once
'Services/Payment/classes/class.ilShopPage.php';
4683 include_once
'Services/Payment/classes/class.ilShopPageGUI.php';
4691 include_once
'Services/Style/classes/class.ilObjStyleSheet.php';
4697 return $page_gui->showPage();
4704 $ilTabs->clearTargets();
4705 $ilTabs->setBackTarget($this->lng->txt(
'back'), $this->ctrl->getLinkTarget($this,
'documents'),
'_self');
4707 include_once
'Services/Payment/classes/class.ilShopPage.php';
4708 include_once
'Services/Payment/classes/class.ilShopPageGUI.php';
4709 include_once(
'./Services/Style/classes/class.ilObjStyleSheet.php');
4717 $new_page_object->setParentId(0);
4718 $new_page_object->setId($a_editor_page_id);
4719 $new_page_object->createFromXML();
4722 $this->ctrl->setReturnByClass(
'ilshoppagegui',
'edit');
4724 $page_gui =
new ilShopPageGUI(self::CONDITIONS_EDITOR_PAGE_ID);
4726 return $this->ctrl->forwardCommand($page_gui);
4731 include_once(
'./Services/Form/classes/class.ilPropertyFormGUI.php');
4735 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.main_view.html',
'Services/Payment');
4736 $this->tpl->addJavaScript(
'Services/Mail/js/ilMailComposeFunctions.js');
4739 $form_gui->setFormAction($this->ctrl->getFormAction($this,
'saveInvoiceNumber'));
4740 $form_gui->setTitle($this->lng->txt(
'invoice_number_setting'));
4743 $radio_group =
new ilRadioGroupInputGUI($this->lng->txt(
'invoice_number'),
'ud_invoice_number');
4744 $radio_option_1 =
new ilRadioOption($this->lng->txt(
'ilias_invoice_number'),
'0');
4745 $radio_group->addOption($radio_option_1);
4746 $radio_option_2 =
new ilRadioOption($this->lng->txt(
'userdefined_invoice_number'),
'1');
4747 $radio_group->addOption($radio_option_2);
4748 $radio_group->setRequired(
true);
4749 $radio_group->
setValue($invObj->getUDInvoiceNumberActive(),
'0');
4750 $radio_group->setPostVar(
'ud_invoice_number');
4751 $form_gui->addItem($radio_group);
4754 $cur_num =
new ilNonEditableValueGUI($this->lng->txt(
'incremental_current_value'),
'inc_current_value');
4756 $radio_option_2->addSubItem($cur_num);
4759 $inc_num =
new ilNumberInputGUI($this->lng->txt(
'incremental_start_value'),
'inc_start_value');
4760 $inc_num->
setValue($this->error !=
"" && isset($_POST[
'incremental_start_value'])
4763 $inc_num->setInfo($this->lng->txt(
'incremental_start_value_info'));
4764 $radio_option_2->addSubItem($inc_num);
4767 $sel_reset =
new ilSelectInputGUI($this->lng->txt(
'invoice_number_reset_period'),
'inc_reset_period');
4768 $sel_reset->
setValue($this->error !=
"" && isset($_POST[
'inc_reset_period'])
4769 ? $_POST[
'inc_reset_period']
4770 : $invObj->getIncResetPeriod());
4772 $reset_options = array(
4773 1 => $this->lng->txt(
'yearly'),
4774 2 => $this->lng->txt(
'monthly'));
4775 $sel_reset->setOptions($reset_options);
4777 $radio_option_2->addSubItem($sel_reset);
4780 $inp =
new ilTextAreaInputGUI($this->lng->txt(
'invoice_number_text'),
'invoice_number_text');
4781 $inp->
setValue( $this->error !=
"" && isset($_POST[
'invoice_number_text'])
4786 $inp->setRequired(
false);
4789 $radio_option_2->addSubItem($inp);
4794 $radio_option_2->addSubItem($prop);
4796 $form_gui->addCommandButton(
'saveInvoiceNumber', $this->lng->txt(
'save'));
4797 $this->tpl->setVariable(
'FORM', $form_gui->getHTML());
4803 if($_POST[
'ud_invoice_number'] == 1)
4805 if($_POST[
'inc_start_value'] <= 0 || $_POST[
'inc_start_value'] == NULL)
4807 $this->error = $this->lng->txt(
'start_value_cannot_be_null');
4813 if($_POST[
'invoice_number_text'] !== NULL)
4815 $check_text = $_POST[
'invoice_number_text'];
4817 if(strpos($check_text,
'[INCREMENTAL_NUMBER]') === FALSE)
4819 $this->error = $this->lng->txt(
'invoice_number_must_contain_incremental_number');
4826 if($_POST[
'inc_reset_period'] == 1)
4828 if(strpos($check_text,
'[YEAR]') === FALSE && strpos($check_text,
'[CURRENT_TIMESTAMP]') === FALSE)
4830 $this->error = $this->lng->txt(
'invoice_number_must_contain_year_ct');
4836 else if($_POST[
'inc_reset_period'] == 2)
4838 if((strpos($check_text,
'[YEAR]') === FALSE || strpos($check_text,
'[MONTH]') === FALSE )
4839 && (strpos($check_text,
'[CURRENT_TIMESTAMP]') === FALSE))
4841 $this->error = $this->lng->txt(
'invoice_number_must_contain_year_month_ct');
4858 $invObj->setUDInvoiceNumberActive($_POST[
'ud_invoice_number']);
4859 $invObj->setIncStartValue($_POST[
'inc_start_value']);
4860 $invObj->setIncResetPeriod($_POST[
'inc_reset_period']);
4861 $invObj->setInvoiceNumberText($_POST[
'invoice_number_text']);
4872 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.main_view.html',
'Services/Payment');
4874 $form->setFormAction($this->ctrl->getFormAction($this,
'saveStatutoryRegulations'));
4875 $form->setTitle($this->lng->txt(
'statutory_regulations'));
4876 $form->setTableWidth(
'100%');
4878 $post_gui =
new ilTextAreaInputGUI($this->lng->txt(
'content'),
'statutory_regulations');
4880 $post_gui->setRows(15);
4881 $post_gui->setUseRte(
true);
4882 $post_gui->addPlugin(
'latex');
4883 $post_gui->addButton(
'latex');
4884 $post_gui->addButton(
'pastelatex');
4885 $post_gui->addPlugin(
'ilimgupload');
4886 $post_gui->addButton(
'ilimgupload');
4887 $post_gui->removePlugin(
'advlink');
4889 $post_gui->removePlugin(
'image');
4890 $post_gui->usePurifier(
true);
4891 $post_gui->setRTERootBlockElement(
'');
4892 $post_gui->setRTESupport(
ilObject::_lookupObjId($this->ref_id),
'pays~',
'frm_post',
'tpl.tinymce_frm_post.html',
false,
'3.4.7');
4893 $post_gui->disableButtons(array(
4911 require_once
'Services/Html/classes/class.ilHtmlPurifierFactory.php';
4912 require_once
'Services/RTE/classes/class.ilRTE.php';
4915 $form->addItem($post_gui);
4918 $cb_showShoppingCart =
new ilCheckboxInputGUI($this->lng->txt(
'show_sr_shoppingcart'),
'show_sr_shoppingcart');
4919 $cb_showShoppingCart->
setInfo($this->lng->txt(
'show_sr_shoppingcart_info'));
4920 $cb_showShoppingCart->setValue(1);
4921 $cb_showShoppingCart->setChecked($this->genSetData->get(
'show_sr_shoppingcart'));
4922 $form->addItem($cb_showShoppingCart);
4925 $cb_attachInvoice =
new ilCheckboxInputGUI($this->lng->txt(
'attach_sr_invoice'),
'attach_sr_invoice');
4926 $cb_attachInvoice->
setInfo($this->lng->txt(
'attach_sr_invoice_info'));
4927 $cb_attachInvoice->setValue(1);
4928 $cb_attachInvoice->setChecked($this->genSetData->get(
'attach_sr_invoice'));
4929 $form->addItem($cb_attachInvoice);
4931 $form->addCommandButton(
'saveStatutoryRegulations', $this->lng->txt(
'save'));
4932 $this->tpl->setVariable(
'FORM',
$form->getHTML());
4938 require_once
'Services/RTE/classes/class.ilRTE.php';
4940 if(isset($_POST[
'statutory_regulations']) && $_POST[
'statutory_regulations'] != NULL)
4945 include_once
'Services/MediaObjects/classes/class.ilObjMediaObject.php';
4948 foreach($mediaObjects as $mob)
4950 foreach($myMediaObjects as $myMob)
4964 $this->genSetData->set(
'statutory_regulations', NULL,
'regulations');
4968 include_once
'Services/MediaObjects/classes/class.ilObjMediaObject.php';
4971 foreach($oldMediaObjects as $oldMob)
4974 foreach($curMediaObjects as $curMob)
4976 if($oldMob == $curMob)
4993 $this->genSetData->set(
'show_sr_shoppingcart', isset($_POST[
'show_sr_shoppingcart']) ? 1 : 0,
'regulations');
4994 $this->genSetData->set(
'attach_sr_invoice', isset($_POST[
'attach_sr_invoice']) ? 1 : 0,
'regulations');
5003 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.main_view.html',
'Services/Payment');
5005 $price_id = $_GET[
'price_id']?$_GET[
'price_id']: $_POST[
'price_id'];
5007 $this->ctrl->setParameter($this,
'pobject_id',(
int) $_GET[
'pobject_id']);
5009 include_once
'Services/Form/classes/class.ilPropertyFormGUI.php';
5011 $form->setFormAction($this->ctrl->getFormAction($this));
5017 $form->setTitle($tmp_obj->getTitle());
5021 $form->setTitle($this->lng->txt(
'object_not_found'));
5026 $radio_group->setTitle($this->lng->txt(
'duration'));
5027 $radio_group->setRequired(
true);
5028 $radio_group->setValue($price[
'price_type']);
5029 $radio_group->setPostVar(
'price_type');
5035 $oDuration->
setTitle($this->lng->txt(
'paya_months'));
5036 $oDuration->setSize(
'20%');
5037 $oDuration->
setValue($price[
'duration']);
5038 $oDuration->setPostVar(
'duration_month');
5041 $radio_group->addOption($radio_option_1);
5047 $o_date_from->
setTitle($this->lng->txt(
'cal_from'));
5049 $o_date_from->setPostVar(
'duration_date_from');
5054 $o_date_until->setTitle($this->lng->txt(
'cal_until'));
5056 $o_date_until->setPostVar(
'duration_date_until');
5057 $radio_option_3->addSubItem($o_date_until);
5059 $radio_group->addOption($radio_option_3);
5062 $radio_group->addOption($radio_option_2);
5064 $form->addItem($radio_group);
5067 $oDescription =
new ilTextAreaInputGUI($this->lng->txt(
'description'),
'description');
5069 $oDescription->setCols(35);
5070 $oDescription->setValue($price[
'description']);
5071 $form->addItem($oDescription);
5075 $oPrice->setTitle($this->lng->txt(
'price_a'));
5076 $oPrice->setSize(
'20%');
5077 $oPrice->setRequired(
true);
5078 $oPrice->setValue($price[
'price']);
5079 include_once
'./Services/Payment/classes/class.ilPaymentSettings.php';
5081 $oPrice->setInfo($genSet->get(
'currency_unit'));
5082 $oPrice->setPostVar(
'price');
5083 $oPrice->allowDecimals(
true);
5084 $form->addItem($oPrice);
5087 $oExtension =
new ilCheckboxInputGUI($this->lng->txt(
'extension_price'),
'extension');
5089 $oExtension->
setChecked($price[
'extension']);
5091 $form->addItem($oExtension);
5094 $o_hidden_1->setValue( (
int)$_GET[
'pobject_id']);
5095 $o_hidden_1->setPostVar(
'pobject_id');
5098 $o_hidden_2->setValue( (
int)$_GET[
'price_id']);
5099 $o_hidden_2->setPostVar(
'price_id');
5101 $form->addItem($o_hidden_1);
5102 $form->addItem($o_hidden_2);
5104 $form->addCommandButton(
'updatePrice',$this->lng->txt(
'save'));
5105 $form->addCommandButton(
'editPrices', $this->lng->txt(
'cancel'));
5107 $this->tpl->setVariable(
'FORM',
$form->getHTML());