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 'ilpageobjectgui':
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/COPage/classes/class.ilPageObject.php';
397 include_once
'Services/COPage/classes/class.ilPageObjectGUI.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(
'ilpageobjectgui',
'edit');
413 if(!(
int)$_GET[
'pobject_id'])
418 $this->ctrl->setParameter($this,
'pobject_id', (
int)$_GET[
'pobject_id']);
421 $page_gui =
new ilPageObjectGUI(
'shop', (
int)$this->pobject->getPobjectId());
422 $this->ctrl->setParameter($page_gui,
'pobject_id', (
int)$_GET[
'pobject_id']);
424 $page_gui->setTemplateTargetVar(
'ADM_CONTENT');
425 $page_gui->setLinkXML(
'');
426 $page_gui->setFileDownloadLink($this->ctrl->getLinkTargetByClass(array(
'ilpageobjectgui'),
'downloadFile'));
427 $page_gui->setFullscreenLink($this->ctrl->getLinkTargetByClass(array(
'ilpageobjectgui'),
'displayMediaFullscreen'));
428 $page_gui->setSourcecodeDownloadScript($this->ctrl->getLinkTargetByClass(array(
'ilpageobjectgui'),
'download_paragraph'));
429 $page_gui->setPresentationTitle(
'');
430 $page_gui->setTemplateOutput(
false);
431 $page_gui->setHeader(
'');
432 $page_gui->setEnabledRepositoryObjects(
false);
433 $page_gui->setEnabledFileLists(
true);
434 $page_gui->setEnabledMaps(
true);
435 $page_gui->setEnabledPCTabs(
true);
445 $ilTabs->clearTargets();
446 $ilTabs->setBackTarget($lng->txt(
'back'), $this->ctrl->getLinkTarget($this),
'_top');
449 include_once
'Services/COPage/classes/class.ilPageObject.php';
450 include_once
'Services/COPage/classes/class.ilPageObjectGUI.php';
452 $lng->loadLanguageModule(
'content');
454 include_once(
'./Services/Style/classes/class.ilObjStyleSheet.php');
461 $new_page_object->setParentId(0);
462 $new_page_object->setId(self::CONDITIONS_EDITOR_PAGE_ID);
463 $new_page_object->createFromXML();
466 $this->ctrl->setReturnByClass(
'ilpageobjectgui',
'edit');
468 $page_gui =
new ilPageObjectGUI(
'shop', self::CONDITIONS_EDITOR_PAGE_ID);
469 $page_gui->setIntLinkHelpDefault(
'StructureObject', self::CONDITIONS_EDITOR_PAGE_ID);
470 $page_gui->setTemplateTargetVar(
'ADM_CONTENT');
471 $page_gui->setLinkXML(
'');
472 $page_gui->setFileDownloadLink($ilCtrl->getLinkTargetByClass(array(
'ilpageobjectgui'),
'downloadFile'));
473 $page_gui->setFullscreenLink($ilCtrl->getLinkTargetByClass(array(
'ilpageobjectgui'),
'displayMediaFullscreen'));
474 $page_gui->setSourcecodeDownloadScript($ilCtrl->getLinkTargetByClass(array(
'ilpageobjectgui'),
'download_paragraph'));
475 $page_gui->setPresentationTitle(
'');
476 $page_gui->setTemplateOutput(
false);
477 $page_gui->setHeader(
'');
478 $page_gui->setEnabledRepositoryObjects(
false);
479 $page_gui->setEnabledFileLists(
true);
480 $page_gui->setEnabledMaps(
true);
481 $page_gui->setEnabledPCTabs(
true);
484 return $this->ctrl->forwardCommand($page_gui);
487 public function saveBmfSettingsObject()
495 if(!$rbacsystem->checkAccess(
'read', $this->object->getRefId()))
497 $this->ilErr->raiseError($this->lng->txt(
'msg_no_perm_read'),$this->ilErr->MESSAGE);
500 include_once
'./Services/Payment/classes/class.ilBMFSettings.php';
519 if (
$_POST[
'mandantNr'] ==
'' ||
520 $_POST[
'bewirtschafterNr'] ==
'' ||
521 $_POST[
'haushaltsstelle'] ==
'' ||
522 $_POST[
'objektNr'] ==
'' ||
523 $_POST[
'kennzeichenMahnverfahren'] ==
'' ||
524 $_POST[
'waehrungskennzeichen'] ==
'' ||
525 $_POST[
'ePaymentServer'] ==
'' ||
526 $_POST[
'clientCertificate'] ==
'' ||
527 $_POST[
'caCertificate'] ==
'' ||
530 $this->error = $this->lng->txt(
'pays_bmf_settings_not_valid');
532 $this->bmfSettingsObject();
538 $this->bmfSettingsObject();
545 public function bmfSettingsObject()
553 if(!$rbacsystem->checkAccess(
'read', $this->object->getRefId()))
555 $this->ilErr->raiseError($this->lng->txt(
'msg_no_perm_read'),$this->ilErr->MESSAGE);
557 include_once
'./Services/Payment/classes/class.ilBMFSettings.php';
560 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.main_view.html',
'Services/Payment');
568 $form->setFormAction($this->ctrl->getFormAction($this,
'saveBmfSettings'));
569 $form->setTitle($this->lng->txt(
'pays_bmf_settings'));
571 $form->addCommandButton(
'saveBmfSettings',$this->lng->txt(
'save'));
573 $formItem =
new ilTextInputGUI($this->lng->txt(
'pays_bmf_client_id'),
'mandantNr');
574 $formItem->
setValue($bmfSetObj->getClientId());
575 $form->addItem($formItem);
577 $formItem =
new ilTextInputGUI($this->lng->txt(
'pays_bmf_bewirtschafter_nr'),
'bewirtschafterNr');
578 $formItem->
setValue($bmfSetObj->getBewirtschafterNr());
579 $form->addItem($formItem);
581 $formItem =
new ilTextInputGUI($this->lng->txt(
'pays_bmf_haushaltsstelle'),
'haushaltsstelle');
582 $formItem->
setValue($bmfSetObj->getHaushaltsstelle());
583 $form->addItem($formItem);
585 $formItem =
new ilTextInputGUI($this->lng->txt(
'pays_bmf_object_id'),
'objektNr');
586 $formItem->
setValue($bmfSetObj->getObjectId());
587 $form->addItem($formItem);
589 $formItem =
new ilTextInputGUI($this->lng->txt(
'pays_bmf_kennzeichen_mahnverfahren'),
'kennzeichenMahnverfahren');
590 $formItem->
setValue($bmfSetObj->getKennzeichenMahnverfahren());
591 $form->addItem($formItem);
593 $formItem =
new ilTextInputGUI($this->lng->txt(
'pays_bmf_waehrungskennzeichen'),
'waehrungskennzeichen');
594 $formItem->
setValue($bmfSetObj->getWaehrungsKennzeichen());
595 $form->addItem($formItem);
597 $formItem =
new ilTextInputGUI($this->lng->txt(
'pays_bmf_epayment_server'),
'ePaymentServer');
598 $formItem->
setValue($bmfSetObj->getEpaymentServer());
599 $form->addItem($formItem);
601 $formItem =
new ilTextInputGUI($this->lng->txt(
'pays_bmf_client_certificate'),
'clientCertificate');
602 $formItem->
setValue($bmfSetObj->getClientCertificate());
603 $form->addItem($formItem);
605 $formItem =
new ilTextInputGUI($this->lng->txt(
'pays_bmf_ca_certificate'),
'caCertificate');
606 $formItem->
setValue($bmfSetObj->getCaCertificate());
607 $form->addItem($formItem);
609 $formItem =
new ilTextInputGUI($this->lng->txt(
'pays_bmf_timeout'),
'timeOut');
610 $formItem->
setValue($bmfSetObj->getTimeOut());
611 $form->addItem($formItem);
613 $this->tpl->setVariable(
'FORM',
$form->getHTML());
620 if(!$_GET[
'pobject_id'])
624 $this->objectObjects();
629 $this->ctrl->setParameter($this,
'pobject_id',(
int) $_GET[
'pobject_id']);
632 $old_status = $this->pobject->getStatus();
635 if($old_status == $this->pobject->STATUS_NOT_BUYABLE and
636 (
int)
$_POST[
'status'] != $old_status)
639 switch((
int)
$_POST[
'pay_method'])
641 case $this->pobject->PAY_METHOD_NOT_SPECIFIED:
651 $standard_prices = array();
652 $standard_prices = $prices_obj->getPrices();
654 if(!count($standard_prices))
663 $this->pobject->setStatus((
int)
$_POST[
'status']);
664 $this->pobject->setVendorId((
int) $_POST[
'vendor']);
665 $this->pobject->setPayMethod((
int) $_POST[
'pay_method']);
666 $this->pobject->setTopicId((
int) $_POST[
'topic_id']);
667 $this->pobject->setVatId((
int) $_POST[
'vat_id']);
669 $this->pobject->update();
677 public function editPricesObject($a_show_delete =
false)
684 if($a_show_delete ==
false) unset(
$_SESSION[
'price_ids']);
688 if(!$_GET[
'pobject_id'])
695 $this->ctrl->setParameter($this,
'pobject_id',(
int) $_GET[
'pobject_id']);
697 $ilToolbar->addButton($this->lng->txt(
'back'), $this->ctrl->getLinkTarget($this,
'objects'));
698 $ilToolbar->addButton($this->lng->txt(
'paya_edit_details'), $this->ctrl->getLinkTarget($this,
'editDetails'));
699 $ilToolbar->addButton($this->lng->txt(
'paya_edit_prices'), $this->ctrl->getLinkTarget($this,
'editPrices'));
700 $ilToolbar->addButton($this->lng->txt(
'pay_edit_abstract'), $this->ctrl->getLinkTargetByClass(array(
'ilpageobjectgui'),
'edit'));
704 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.main_view.html',
'Services/Payment');
707 $standard_prices = array();
708 $extension_prices = array();
709 $standard_prices = $price_obj->getPrices();
710 $extension_prices = $price_obj->getExtensionPrices();
712 $prices = array_merge($standard_prices, $extension_prices );
719 $ilToolbar->addButton($this->lng->txt(
'paya_add_price'), $this->ctrl->getLinkTarget($this,
'addPrice'));
729 $oConfirmationGUI->setFormAction($this->ctrl->getFormAction($this,
"performDeletePrice"));
730 $oConfirmationGUI->setHeaderText($this->lng->txt(
"paya_sure_delete_selected_prices"));
731 $oConfirmationGUI->setCancel($this->lng->txt(
"cancel"),
"editPrices");
732 $oConfirmationGUI->setConfirm($this->lng->txt(
"confirm"),
"performDeletePrice");
734 foreach($prices as $price)
739 if(in_array($price[
'price_id'],
$_SESSION[
'price_ids']))
741 switch($price[
'price_type'])
744 include_once
'./Services/Calendar/classes/class.ilDatePresentation.php';
750 $tmp_price = $price[
'duration'].
' '.$this->lng->txt(
'paya_months');
754 $tmp_price = $this->lng->txt(
'unlimited_duration');
758 $delete_row .=
''.$tmp_price.
' -> '.
760 $this->genSetData->get(
'currency_unit');
762 $oConfirmationGUI->addItem(
'',$delete_row, $delete_row);
766 $this->tpl->setVariable(
'CONFIRMATION', $oConfirmationGUI->getHTML());
778 $tpl->setCurrentBlock(
'tbl_form_header');
780 $tpl->setVariable(
'FORMACTION',$this->ctrl->getFormAction($this));
781 $tpl->parseCurrentBlock();
785 foreach($prices as $price)
787 $data[$counter][
'price_id'] = ilUtil::formCheckBox(in_array($price[
'price_id'],
$_SESSION[
'price_ids']) ? 1 : 0,
788 'price_ids[]', $price[
'price_id']);
790 switch($price[
'price_type'])
793 $data[$counter][
'duration'] = $price[
'duration'].
' '.$this->lng->txt(
'paya_months');
801 $data[$counter][
'duration'] = $this->lng->txt(
'unlimited_duration');
805 $data[$counter][
'currency_unit'] = $this->genSetData->get(
'currency_unit');
806 $data[$counter][
'extension'] = ilUtil::formCheckBox($price[
'extension'] ? 1 : 0,
807 'extension_ids[]', (
int)$price[
'price_id'],
true);
809 $this->ctrl->setParameter($this,
"price_id",$price[
'price_id']);
810 $data[$counter][
'edit'] =
811 "<div class=\"il_ContainerItemCommands\"><a class=\"il_ContainerItemCommand\" href=\"".$this->ctrl->getLinkTarget($this,
"editPrice").
"\">".$this->lng->txt(
"edit").
"</a></div>";
822 $this->ctrl->setParameter($this,
'cmd',
'editprices');
828 $tbl->setTitle($tmp_obj->getTitle());
832 $tbl->setTitle($this->lng->txt(
'object_not_found'));
835 $tbl->setId(
'tbl_bookings');
836 $tbl->setRowTemplate(
"tpl.shop_prices_row.html",
"Services/Payment");
838 $tbl->addColumn(
' ',
'price_id',
'5%');
839 $tbl->addColumn($this->lng->txt(
'duration'),
'duration',
'40%');
840 $tbl->addColumn($this->lng->txt(
'price_a'),
'price',
'1%');
841 $tbl->addColumn($this->lng->txt(
'currency'),
'currency_unit',
'10%');
842 $tbl->addColumn($this->lng->txt(
'extension_price'),
'extension',
'10%');
843 $tbl->addColumn(
'',
'edit',
'30%' );
845 $tbl->setSelectAllCheckbox(
'price_id');
846 $tbl->addCommandButton(
'addPrice',$this->lng->txt(
'paya_add_price'));
848 $tbl->addMultiCommand(
"deletePrice", $this->lng->txt(
"paya_delete_price"));
851 $tbl->setData($a_result_set);
853 $this->tpl->setVariable(
'TABLE', $tbl->getHTML());
858 public function addPriceObject()
865 if(!$_GET[
'pobject_id'])
877 $this->ctrl->setParameter($this,
'pobject_id',(
int) $_GET[
'pobject_id']);
881 $ilToolbar->addButton($this->lng->txt(
'paya_edit_details'), $this->ctrl->getLinkTarget($this,
'editDetails'));
882 $ilToolbar->addButton($this->lng->txt(
'paya_edit_prices'), $this->ctrl->getLinkTarget($this,
'editPrices'));
883 $ilToolbar->addButton($this->lng->txt(
'pay_edit_abstract'), $this->ctrl->getLinkTargetByClass(array(
'ilpageobjectgui'),
'edit'));
886 if(is_object($tmp_obj))
888 $tmp_object[
'title'] = $tmp_obj->getTitle();
892 $tmp_object[
'title'] = $this->lng->txt(
'object_not_found');
894 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.main_view.html',
'Services/Payment');
897 $form->setFormAction($this->ctrl->getFormAction($this));
898 $form->setTitle($this->lng->txt(
'paya_add_price_title'));
903 $oTitle->
setValue($tmp_object[
'title']);
904 $form->addItem($oTitle);
909 $radio_group->setTitle($this->lng->txt(
'duration'));
910 $radio_group->setRequired(
true);
911 $radio_group->setValue(
$_POST[
'price_type']);
912 $radio_group->setPostVar(
'price_type');
914 $radio_option_1 =
new ilRadioOption($this->lng->txt(
'duration_month'),
'duration_month');
918 $oDuration->
setTitle($this->lng->txt(
'paya_months'));
919 $oDuration->setSize(
'30%');
921 $oDuration->setPostVar(
'duration_month');
924 $radio_group->addOption($radio_option_1);
926 $radio_option_3 =
new ilRadioOption($this->lng->txt(
'duration_date'),
'duration_date');
930 $o_date_from->
setTitle($this->lng->txt(
'cal_from'));
931 $o_date_from->setPostVar(
'duration_date_from');
936 $o_date_until->setTitle($this->lng->txt(
'cal_until'));
937 $o_date_until->setPostVar(
'duration_date_until');
938 $radio_option_3->addSubItem($o_date_until);
940 $radio_group->addOption($radio_option_3);
942 $radio_option_2 =
new ilRadioOption($this->lng->txt(
'unlimited_duration'),
'unlimited_duration');
943 $radio_group->addOption($radio_option_2);
945 $form->addItem($radio_group);
948 $oDescription =
new ilTextAreaInputGUI($this->lng->txt(
'description'),
'description');
950 $oDescription->setCols(35);
951 $oDescription->setValue(
$_POST[
'description']);
952 $form->addItem($oDescription);
956 $oPrice->setTitle($this->lng->txt(
'price_a'));
957 $oPrice->setValue(
$_POST[
'price']);
958 $oPrice->setPostVar(
'price');
959 $oPrice->setRequired(
true);
960 $oPrice->allowDecimals(
true);
961 $form->addItem($oPrice);
966 #TODO: CURRENCY not finished yet
982 $currency_options = $genSet->get(
'currency_unit');
984 $oCurrency->
setValue($currency_options);
985 $form->addItem($oCurrency);
989 $oExtension =
new ilCheckboxInputGUI($this->lng->txt(
'extension_price'),
'extension');
992 $form->addItem($oExtension);
994 $form->addCommandButton(
'performAddPrice',$this->lng->txt(
'paya_add_price'));
995 $form->addCommandButton(
'editPrices', $this->lng->txt(
'cancel'));
996 $this->tpl->setVariable(
'FORM',
$form->getHTML());
1005 switch($_POST[
'price_type'])
1007 case 'unlimited_duration':
1009 $po->setDuration(0);
1010 $po->setDurationFrom(NULL);
1011 $po->setDurationUntil(NULL);
1012 $po->setUnlimitedDuration(1);
1016 case 'duration_date':
1019 $po->setDuration(NULL);
1021 $_POST[
'duration_date_from'][
'date'][
'y'].
'-'.
1022 $_POST[
'duration_date_from'][
'date'][
'm'].
'-'.
1023 $_POST[
'duration_date_from'][
'date'][
'd']));
1025 $_POST[
'duration_date_until'][
'date'][
'y'].
'-'.
1026 $_POST[
'duration_date_until'][
'date'][
'm'].
'-'.
1027 $_POST[
'duration_date_until'][
'date'][
'd']));
1031 case 'duration_month':
1033 $po->setDuration($_POST[
'duration_month']);
1034 $po->setDurationFrom(NULL);
1035 $po->setDurationUntil(NULL);
1039 $po->setDescription($_POST[
'description'] ?
ilUtil::stripSlashes($_POST[
'description']) : NULL);
1043 if($_POST[
'extension_price'])
1045 $po->setExtension(1);
1049 $po->setExtension(0);
1057 return $this->editPricesObject();
1062 return $this->addPriceObject();
1068 if(!$_GET[
'pobject_id'])
1086 foreach(
$_SESSION[
'price_ids'] as $price_id)
1088 if($prices->delete($price_id))
1094 if(!count($prices->getPrices()))
1098 $this->pobject->setStatus($this->pobject->STATUS_NOT_BUYABLE);
1099 $this->pobject->update();
1106 return $this->editPricesObject();
1111 if(!$_GET[
'pobject_id'])
1119 if(!count($_POST[
'price_ids']))
1123 $this->editPricesObject();
1126 $_SESSION[
'price_ids'] = $_POST[
'price_ids'];
1128 $this->editPricesObject(
true);
1134 if(!$_GET[
'pobject_id'] && !$_POST[
'pobject_id'])
1141 if(isset($_GET[
'pobject_id']))
1143 $pobject_id = (int)$_GET[
'pobject_id'];
1147 $pobject_id = (int)$_POST[
'pobject_id'];
1150 if(!(
int)$_GET[
'price_id'] && !$_POST[
'price_id'])
1153 return $this->editPricesObject();
1155 if(isset($_GET[
'price_id']))
1157 $price_id = (int)$_GET[
'price_id'];
1161 $price_id = (int)$_POST[
'price_id'];
1165 switch($_POST[
'price_type'])
1169 $po->setDuration(NULL);
1170 $po->setDurationFrom(NULL);
1171 $po->setDurationUntil(NULL);
1172 $po->setUnlimitedDuration(1);
1178 $po->setDuration(NULL);
1180 $_POST[
'duration_date_from'][
'date'][
'y'].
'-'.
1181 $_POST[
'duration_date_from'][
'date'][
'm'].
'-'.
1182 $_POST[
'duration_date_from'][
'date'][
'd']));
1184 $_POST[
'duration_date_until'][
'date'][
'y'].
'-'.
1185 $_POST[
'duration_date_until'][
'date'][
'm'].
'-'.
1186 $_POST[
'duration_date_until'][
'date'][
'd']));
1192 $po->setDuration($_POST[
'duration_month']);
1193 $po->setDurationFrom(NULL);
1194 $po->setDurationUntil(NULL);
1198 $po->setDescription($_POST[
'description'] ?
ilUtil::stripSlashes($_POST[
'description']) : NULL);
1201 if($_POST[
'extension_price'])
1203 $po->setExtension(1);
1207 $po->setExtension(0);
1212 $po->update($price_id);
1214 return $this->editPricesObject();
1228 if(!(
int)$_GET[
'pobject_id'])
1236 $this->ctrl->setParameter($this,
'pobject_id', (
int)$_GET[
'pobject_id']);
1238 $ilToolbar->addButton($this->lng->txt(
'paya_edit_details'), $this->ctrl->getLinkTarget($this,
'editDetails'));
1239 $ilToolbar->addButton($this->lng->txt(
'paya_edit_prices'), $this->ctrl->getLinkTarget($this,
'editPrices'));
1240 $ilToolbar->addButton($this->lng->txt(
'pay_edit_abstract'), $this->ctrl->getLinkTargetByClass(array(
'ilpageobjectgui'),
'edit'));
1242 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.main_view.html',
'Services/Payment');
1247 $tmp_object[
'title'] = $tmp_obj->getTitle();
1248 $tmp_object[
'type'] = $tmp_obj->getType();
1252 $tmp_object[
'title'] = $this->lng->txt(
'object_not_found');
1253 $tmp_object[
'type'] =
'';
1258 include_once
'./Services/Utilities/classes/class.ilConfirmationGUI.php';
1262 $oConfirmationGUI->setFormAction($this->ctrl->getFormAction($this,
"performObjectDelete"));
1263 $oConfirmationGUI->setHeaderText($this->lng->txt(
"paya_sure_delete_object"));
1264 $oConfirmationGUI->setCancel($this->lng->txt(
"cancel"),
"objects");
1265 $oConfirmationGUI->setConfirm($this->lng->txt(
"confirm"),
"performObjectDelete");
1267 $oConfirmationGUI->addItem(
'', $tmp_object[
'title'], $tmp_object[
'title']);
1268 $this->tpl->setVariable(
'CONFIRMATION',$oConfirmationGUI->getHTML());
1274 $oForm->setFormAction($this->ctrl->getFormAction($this,
'updateDetails'));
1275 $oForm->setTitle($tmp_object[
'title']);
1281 $oForm->addItem($oPathGUI);
1286 $oForm->addItem($oPurchasersGUI);
1289 $oVendorsGUI =
new ilSelectInputGUI($this->lng->txt(
'paya_vendor'),
'vendor');
1291 $oVendorsGUI->setValue($this->pobject->getVendorId());
1292 $oForm->addItem($oVendorsGUI);
1297 $oStatusGUI->setValue($this->pobject->getStatus());
1298 $oForm->addItem($oStatusGUI);
1301 $oPayMethodsGUI =
new ilSelectInputGUI($this->lng->txt(
'paya_pay_method'),
'pay_method');
1304 $oPayMethodsGUI->setValue($this->pobject->getPayMethod());
1305 $oForm->addItem($oPayMethodsGUI);
1308 include_once
'./Services/Payment/classes/class.ilShopTopics.php';
1315 $topic_options = array();
1316 $topic_options[
''] = $this->lng->txt(
'please_choose');
1318 foreach($topics as $oTopic)
1320 $topic_options[$oTopic->getId()] = $oTopic->getTitle();
1323 $oTopicsGUI->setOptions($topic_options);
1324 $oTopicsGUI->setValue($this->pobject->getTopicId());
1325 $oForm->addItem($oTopicsGUI);
1330 $oShopVatsList->read();
1331 if($oShopVatsList->hasItems())
1335 $vats_options = array();
1336 foreach($oShopVatsList as $oVAT)
1341 $oVatsGUI->setOptions($vats_options);
1342 $oVatsGUI->setValue($this->pobject->getVatId());
1343 $oForm->addItem($oVatsGUI);
1348 $oVatsGUI->
setValue($this->lng->txt(
'paya_no_vats_assigned'));
1349 $oForm->addItem($oVatsGUI);
1354 if(($webpath_file = $oFile->getCurrentImageWebPath()) !==
false)
1356 $oThumbnail->setImage($webpath_file);
1358 $oForm->addItem($oThumbnail);
1361 $oForm->addCommandButton(
'updateDetails', $this->lng->txt(
'save'));
1362 $oForm->addCommandButton(
'deleteObject', $this->lng->txt(
'delete'));
1364 $this->tpl->setVariable(
'FORM', $oForm->getHTML());
1373 if(!$_GET[
'pobject_id'])
1399 if(!$_GET[
'pobject_id'])
1409 $this->pobject->delete();
1413 $price_obj->deleteAllPrices();
1427 $path = $tree->getPathFull($a_ref_id);
1435 $html .= $data[
'title'].
' > ';
1438 return substr($html,0,-2);
1446 $all_vendors = $this->vendors_obj->getVendors();
1447 if (is_array($all_vendors))
1449 foreach ($all_vendors as $vendor)
1451 $vendors[] = $vendor[
'vendor_id'];
1455 foreach($vendors as $vendor)
1458 $options[$vendor] = $tmp_obj->getFullname().
' ['.$tmp_obj->getLogin().
']';
1466 $option[$this->pobject->STATUS_NOT_BUYABLE] = $this->lng->txt(
'paya_not_buyable');
1467 $option[$this->pobject->STATUS_BUYABLE] = $this->lng->txt(
'paya_buyable');
1468 $option[$this->pobject->STATUS_EXPIRES] = $this->lng->txt(
'paya_expires');
1476 unset($_POST[
'title_type']);
1477 unset($_POST[
'title_value']);
1478 unset($_POST[
'vendor']);
1479 unset($_POST[
'pay_method']);
1491 if(!$rbacsystem->checkAccess(
'read', $this->object->getRefId()))
1493 $this->ilErr->raiseError($this->lng->txt(
'msg_no_perm_read'),$this->ilErr->MESSAGE);
1496 if ($_POST[
'updateView'] == 1)
1498 $_SESSION[
'pay_objects'][
'title_type'] = $_POST[
'title_type'];
1499 $_SESSION[
'pay_objects'][
'title_value'] = $_POST[
'title_value'];
1500 $_SESSION[
'pay_objects'][
'pay_method'] = $_POST[
'pay_method'];
1501 $_SESSION[
'pay_objects'][
'vendor'] = $_POST[
'vendor'];
1504 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.main_view.html',
'Services/Payment');
1507 $this->lng->loadLanguageModule(
'search');
1510 $filter_form->setFormAction($this->ctrl->getFormAction($this));
1511 $filter_form->setTitle($this->lng->txt(
'pay_filter'));
1512 $filter_form->setId(
'filter_form');
1513 $filter_form->setTableWidth(
'100 %');
1516 $o_hide_check =
new ilCheckBoxInputGUI($this->lng->txt(
'show_filter'),
'show_filter');
1517 $o_hide_check->setValue(1);
1518 $o_hide_check->setChecked($_POST[
'show_filter'] ? 1 : 0);
1521 $o_hidden->setValue(1);
1522 $o_hidden->setPostVar(
'updateView');
1523 $o_hide_check->addSubItem($o_hidden);
1527 $radio_option =
new ilRadioOption($this->lng->txt(
'search_any_word'),
'or');
1528 $radio_group->addOption($radio_option);
1529 $radio_option =
new ilRadioOption($this->lng->txt(
'search_all_words'),
'and');
1530 $radio_group->addOption($radio_option);
1532 $radio_group->setRequired(
false);
1534 $radio_group->setPostVar(
'title_type');
1537 $o_title->setValue(
$_SESSION[
'pay_objects'][
'title_value']);
1538 $o_title->setPostVar(
'title_value');
1539 $o_title->setTitle($this->lng->txt(
'title'));
1541 $o_hide_check->addSubItem($radio_group);
1542 $o_hide_check->addSubItem($o_title);
1546 $o_vendor->setTitle($this->lng->txt(
'paya_vendor'));
1547 $o_vendor->setValue(
$_SESSION[
'pay_objects'][
'vendor']);
1548 $o_vendor->setPostVar(
'vendor');
1549 $o_hide_check->addSubItem($o_vendor);
1553 $o_paymethod->setTitle($this->lng->txt(
'payment_system'));
1554 $o_paymethod->setOptions(ilPaymethods::getPayMethodsOptions(
'all'));
1555 $o_paymethod->setValue(
$_SESSION[
'pay_objects'][
'pay_method']);
1556 $o_paymethod->setPostVar(
'pay_method');
1557 $o_hide_check->addSubItem($o_paymethod);
1559 $filter_form->addCommandButton(
'objects', $this->lng->txt(
'pay_update_view'));
1560 $filter_form->addCommandButton(
'resetObjectFilter', $this->lng->txt(
'pay_reset_filter'));
1562 $filter_form->addItem($o_hide_check);
1569 $this->tpl->setVariable(
'FORM', $filter_form->getHTML());
1572 foreach($objects as
$data)
1577 $f_result[$counter][
'title'] = $tmp_obj->getTitle();
1581 $f_result[$counter][
'title'] = $this->lng->txt(
'object_not_found');
1584 switch($data[
'status'])
1586 case $this->pobject->STATUS_BUYABLE:
1587 $f_result[$counter][
'status'] = $this->lng->txt(
'paya_buyable');
1590 case $this->pobject->STATUS_NOT_BUYABLE:
1591 $f_result[$counter][
'status'] = $this->lng->txt(
'paya_not_buyable');
1594 case $this->pobject->STATUS_EXPIRES:
1595 $f_result[$counter][
'status'] = $this->lng->txt(
'paya_expires');
1599 include_once
'./Services/Payment/classes/class.ilPayMethods.php';
1601 $f_result[$counter][
'pay_method'] = $str_paymethod;
1603 if($data[
'vat_id'] <= 0)
1605 $vat_rate = $this->lng->txt(
'payment_vat_has_to_be_defined_by_administration_short');
1611 $oVAT =
new ilShopVats((
int)$data[
'vat_id']);
1616 $vat_rate = $this->lng->txt(
'payment_vat_has_to_be_defined_by_administration_short');
1620 $f_result[$counter][
'vat_rate'] = $vat_rate;
1625 $f_result[$counter][
'vendor'] = $tmp_user->getFullname().
' ['.$tmp_user->getLogin().
']';
1629 $f_result[$counter][
'vendor'] = $this->lng->txt(
'user_not_found');
1636 $this->ctrl->setParameter($this,
'pobject_id',$data[
'pobject_id']);
1637 $link_change =
"<div class=\"il_ContainerItemCommands\"><a class=\"il_ContainerItemCommand\" href=\"".$this->ctrl->getLinkTarget($this,
"editDetails").
"\">".$this->lng->txt(
"edit").
"</a></div>";
1639 $f_result[$counter][
'options'] = $link_change;
1653 $this->ctrl->setParameter($this,
'cmd',
'objects');
1656 $tbl->setTitle($this->lng->txt(
'objects'));
1658 $tbl->setId(
'tbl_show_objects');
1659 $tbl->setRowTemplate(
"tpl.shop_objects_row.html",
"Services/Payment");
1661 $tbl->addColumn($this->lng->txt(
'title'),
'title',
'10%');
1662 $tbl->addColumn($this->lng->txt(
'status'),
'status',
'10%');
1663 $tbl->addColumn($this->lng->txt(
'paya_pay_method'),
'pay_method',
'10%');
1664 $tbl->addColumn($this->lng->txt(
'vat_rate'),
'vat_rate',
'15%');
1665 $tbl->addColumn($this->lng->txt(
'paya_vendor'),
'vendor',
'10%');
1666 $tbl->addColumn($this->lng->txt(
'paya_count_purchaser'),
'purchasers',
'10%');
1667 $tbl->addColumn(
'',
'options',
'10%');
1669 $tbl->setData($a_result_set);
1671 $this->tpl->setVariable(
'TABLE', $tbl->getHTML());
1684 switch($_POST[
'action'])
1686 case 'deleteVendorsObject':
1687 $this->deleteVendors();
1690 case 'editVendorObject':
1691 $this->editVendor();
1694 case 'performEditVendorObject':
1708 unset($_POST[
'transaction_type']);
1709 unset($_POST[
'transaction_value']);
1710 unset($_POST[
'from']);
1711 unset($_POST[
'til']);
1712 unset($_POST[
'payed']);
1713 unset($_POST[
'access']);
1714 unset($_POST[
'customer']);
1715 unset($_POST[
'pay_method']);
1716 unset($_POST[
'updateView']);
1717 unset($_POST[
"adm_filter_title_id"]);
1725 global $rbacsystem, $ilToolbar,$ilObjDataCache;
1727 include_once
'./Services/Payment/classes/class.ilPayMethods.php';
1730 if(!$rbacsystem->checkAccess(
'read', $this->object->getRefId()))
1732 $this->ilErr->raiseError($this->lng->txt(
'msg_no_perm_read'),$this->ilErr->MESSAGE);
1735 $ilToolbar->addButton($this->lng->txt(
'paya_add_customer'), $this->ctrl->getLinkTarget($this,
'showObjectSelector'));
1737 if ($_POST[
'updateView'] == 1)
1739 $_SESSION[
'pay_statistics'][
'show_filter']= $_POST[
'show_filter'];
1740 $_SESSION[
'pay_statistics'][
'updateView'] =
true;
1741 $_SESSION[
'pay_statistics'][
'until_check'] = $_POST[
'until_check'];
1742 $_SESSION[
'pay_statistics'][
'from_check'] = $_POST[
'from_check'];
1743 $_SESSION[
'pay_statistics'][
'transaction_type'] = isset($_POST[
'transaction_type']) ? $_POST[
'transaction_type'] :
'' ;
1744 $_SESSION[
'pay_statistics'][
'transaction_value'] = isset($_POST[
'transaction_value']) ? $_POST[
'transaction_value'] :
'';
1745 $_SESSION[
'pay_statistics'][
'adm_filter_title_id'] = (int)$_POST[
'adm_filter_title_id'];
1747 if(
$_SESSION[
'pay_statistics'][
'from_check'] ==
'1')
1749 $_SESSION[
'pay_statistics'][
'from'][
'date'][
'd'] = $_POST[
'from'][
'date'][
'd'];
1750 $_SESSION[
'pay_statistics'][
'from'][
'date'][
'm'] = $_POST[
'from'][
'date'][
'm'];
1751 $_SESSION[
'pay_statistics'][
'from'][
'date'][
'y'] = $_POST[
'from'][
'date'][
'y'];
1755 $_SESSION[
'pay_statistics'][
'from'][
'date'][
'd'] =
'';
1756 $_SESSION[
'pay_statistics'][
'from'][
'date'][
'm'] =
'';
1757 $_SESSION[
'pay_statistics'][
'from'][
'date'][
'y'] =
'';
1760 if(
$_SESSION[
'pay_statistics'][
'until_check']==
'1')
1762 $_SESSION[
'pay_statistics'][
'til'][
'date'][
'd'] = $_POST[
'til'][
'date'][
'd'];
1763 $_SESSION[
'pay_statistics'][
'til'][
'date'][
'm'] = $_POST[
'til'][
'date'][
'm'];
1764 $_SESSION[
'pay_statistics'][
'til'][
'date'][
'y'] = $_POST[
'til'][
'date'][
'y'];
1768 $_SESSION[
'pay_statistics'][
'til'][
'date'][
'd'] =
'';
1769 $_SESSION[
'pay_statistics'][
'til'][
'date'][
'm'] =
'';
1770 $_SESSION[
'pay_statistics'][
'til'][
'date'][
'y'] =
'';
1773 $_SESSION[
'pay_statistics'][
'payed'] = $_POST[
'payed'];
1774 $_SESSION[
'pay_statistics'][
'access'] = $_POST[
'access'];
1775 $_SESSION[
'pay_statistics'][
'pay_method'] = $_POST[
'pay_method'];
1776 $_SESSION[
'pay_statistics'][
'customer'] = isset ($_POST[
'customer']) ? $_POST[
'customer'] :
'';
1777 $_SESSION[
'pay_statistics'][
'vendor'] = isset ($_POST[
'vendor']) ? $_POST[
'vendor']:
'';
1781 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.main_view.html',
'Services/Payment');
1784 $filter_form->setFormAction($this->ctrl->getFormAction($this));
1785 $filter_form->setTitle($this->lng->txt(
'pay_filter'));
1786 $filter_form->setId(
'formular');
1787 $filter_form->setTableWidth(
'100 %');
1789 $o_hide_check =
new ilCheckBoxInputGUI($this->lng->txt(
'show_filter'),
'show_filter');
1790 $o_hide_check->setValue(1);
1791 $o_hide_check->setChecked($_POST[
'show_filter'] ? 1 : 0);
1794 $o_hidden->setValue(1);
1795 $o_hidden->setPostVar(
'updateView');
1796 $o_hide_check->addSubItem($o_hidden);
1799 $trans_option = array($this->lng->txt(
'pay_starting'),$this->lng->txt(
'pay_ending'));
1800 $trans_value = array(
'0',
'1');
1801 $o_transaction_type->setTitle($this->lng->txt(
'paya_transaction'));
1802 $o_transaction_type->setOptions($trans_option);
1803 $o_transaction_type->setValue(
$_SESSION[
'pay_statistics'][
'transaction_type']);
1804 $o_transaction_type->setPostVar(
'transaction_type');
1805 $o_hide_check->addSubItem($o_transaction_type);
1808 $o_transaction_val->setValue(
$_SESSION[
'pay_statistics'][
'transaction_value']);
1809 $o_transaction_val->setPostVar(
'transaction_value');
1810 $o_hide_check->addSubItem($o_transaction_val);
1813 $o_customer->setTitle($this->lng->txt(
'paya_customer'));
1814 $o_customer->setValue(
$_SESSION[
'pay_statistics'][
'customer']);
1815 $o_customer->setPostVar(
'customer');
1816 $o_hide_check->addSubItem($o_customer);
1819 $o_vendor->setTitle($this->lng->txt(
'paya_vendor'));
1820 $o_vendor->setValue(
$_SESSION[
'pay_statistics'][
'vendor']);
1821 $o_vendor->setPostVar(
'vendor');
1822 $o_hide_check->addSubItem($o_vendor);
1824 $o_from_check =
new ilCheckBoxInputGUI($this->lng->txt(
'pay_order_date_from'),
'from_check');
1825 $o_from_check->setValue(1);
1826 $o_from_check->setChecked(
$_SESSION[
'pay_statistics'][
'from_check'] ? 1 : 0);
1829 $o_date_from->setPostVar(
'from');
1831 if(
$_SESSION[
'pay_statistics'][
'from_check'] ==
'1')
1833 $o_date_from->setValueByArray(
$_SESSION[
'pay_statistics'][
'from']);
1834 $o_date_from->checkInput();
1838 $o_hide_check->addSubItem($o_from_check);
1840 $o_until_check =
new ilCheckBoxInputGUI($this->lng->txt(
'pay_order_date_til'),
'until_check');
1841 $o_until_check->setValue(1);
1842 $o_until_check->setChecked(
$_SESSION[
'pay_statistics'][
'until_check'] ? 1 : 0);
1845 $o_date_until->setPostVar(
'til');
1847 if(
$_SESSION[
'pay_statistics'][
'until_check'] ==
'1')
1849 $o_date_until->setValueByArray(
$_SESSION[
'pay_statistics'][
'til']);
1850 $o_date_until->checkInput();
1853 $o_until_check->addSubItem($o_date_until);
1854 $o_hide_check->addSubItem($o_until_check);
1858 $title_options[
'all']=$this->lng->txt(
'pay_all');
1859 $unique_titles = $this->booking_obj->getUniqueTitles();
1861 if(is_array($unique_titles) && count($unique_titles))
1863 foreach($unique_titles as
$ref_id)
1865 $title_options[
$ref_id] = $ilObjDataCache->lookupTitle($ilObjDataCache->lookupObjId($ref_id));
1870 $o_object_title->setTitle($this->lng->txt(
'title'));
1871 $o_object_title->setOptions($title_options);
1872 $o_object_title->setValue(
$_SESSION[
"pay_statistics"][
"adm_filter_title_id"]);
1873 $o_object_title->setPostVar(
'adm_filter_title_id');
1874 $o_hide_check->addSubItem($o_object_title);
1877 $payed_option = array(
'all'=>$this->lng->txt(
'pay_all'),
'1'=>$this->lng->txt(
'yes'),
'0'=>$this->lng->txt(
'no'));
1879 $o_payed->setTitle($this->lng->txt(
'paya_payed'));
1880 $o_payed->setOptions($payed_option);
1881 $o_payed->setValue(
$_SESSION[
'pay_statistics'][
'payed']);
1882 $o_payed->setPostVar(
'payed');
1884 $o_hide_check->addSubItem($o_payed);
1887 $access_option = array(
'all'=>$this->lng->txt(
'pay_all'),
'1'=>$this->lng->txt(
'yes'),
'0'=>$this->lng->txt(
'no'));
1889 $o_access->setTitle($this->lng->txt(
'paya_access'));
1890 $o_access->setOptions($access_option);
1891 $o_access->setValue(
$_SESSION[
'pay_statistics'][
'access']);
1892 $o_access->setPostVar(
'access');
1893 $o_hide_check->addSubItem($o_access);
1896 $o_paymethod->setTitle($this->lng->txt(
'payment_system'));
1897 $o_paymethod->setOptions(ilPaymethods::getPayMethodsOptions(
'all'));
1898 $o_paymethod->setValue(
$_SESSION[
'pay_statistics'][
'pay_method']);
1899 $o_paymethod->setPostVar(
'pay_method');
1900 $o_hide_check->addSubItem($o_paymethod);
1902 $filter_form->addCommandButton(
'statistic', $this->lng->txt(
'pay_update_view'));
1903 $filter_form->addCommandButton(
'resetFilter', $this->lng->txt(
'pay_reset_filter'));
1905 $filter_form->addItem($o_hide_check);
1907 $this->tpl->setVariable(
'FORM', $filter_form->getHTML());
1913 if(!count($bookings = $this->booking_obj->getBookings()))
1921 # $this->__showButton('exportVendors',$this->lng->txt('excel_export'));
1924 include_once
'Services/User/classes/class.ilObjUser.php';
1925 $object_title_cache = array();
1926 $user_title_cache = array();
1929 foreach($bookings as $booking)
1931 if(array_key_exists($booking[
'ref_id'], $object_title_cache))
1933 $tmp_obj = $object_title_cache[$booking[
'ref_id']];
1938 $object_title_cache[$booking[
'ref_id']] = $tmp_obj;
1942 if(array_key_exists($booking[
'b_vendor_id'], $user_title_cache))
1944 $tmp_vendor = $user_title_cache[$booking[
'b_vendor_id']];
1949 $user_title_cache[$booking[
'b_vendor_id']] = $tmp_vendor;
1951 if(array_key_exists($booking[
'customer_id'], $user_title_cache))
1953 $tmp_purchaser = $user_title_cache[$booking[
'customer_id']];
1957 if(ANONYMOUS_USER_ID == $booking[
'customer_id'])
1960 $purchaser_name = $booking[
'name_extern'];
1961 $tmp_purchaser_email = $booking[
'email_extern'];
1967 $purchaser_name = $tmp_purchaser_name[
'firstname'].
' '.$tmp_purchaser_name[
'lastname'];
1970 $user_title_cache[$booking[
'customer_id']] = $tmp_purchaser;
1973 $transaction = $booking[
'transaction_extern'];
1975 $transaction .= $booking[
'transaction'].
"<br> (" . $str_paymethod .
")";
1977 $f_result[$counter][
'transaction'] = $transaction;
1978 $f_result[$counter][
'object_title'] = ($tmp_obj !=
'' ? $tmp_obj : $this->lng->txt(
'object_deleted'));
1979 $f_result[$counter][
'vendor'] = ($tmp_vendor !=
'' ?
'['.$tmp_vendor.
']' : $this->lng->txt(
'user_deleted'));
1980 $f_result[$counter][
'customer'] = ($tmp_purchaser !=
'' ?
1981 $purchaser_name.
' ['.$tmp_purchaser.
']<br>'
1982 .$tmp_purchaser_email
1983 : $this->lng->txt(
'user_deleted'));
1987 if($booking[
'duration'] == 0 && $booking[
'access_enddate'] == NULL)
1989 $f_result[$counter][
'duration'] = $this->lng->txt(
"unlimited_duration");
2001 $f_result[$counter][
'price'] = $booking[
'price'].
' '.$booking[
'currency_unit'];
2002 $f_result[$counter][
'discount'] = ($booking[
'discount'] !=
'' ? ($booking[
'discount'].
' '.$booking[
'currency_unit']) :
' ');
2004 $payed_access = $booking[
'payed'] ?
2005 $this->lng->txt(
'yes') :
2006 $this->lng->txt(
'no');
2008 $payed_access .=
'/';
2009 $payed_access .= $booking[
'access_granted'] ?
2010 $this->lng->txt(
'yes') :
2011 $this->lng->txt(
'no');
2013 $f_result[$counter][
'payed_access'] = $payed_access;
2015 $this->ctrl->setParameter($this,
"booking_id",$booking[
'booking_id']);
2016 $link_change =
"<div class=\"il_ContainerItemCommands\"><a class=\"il_ContainerItemCommand\" href=\"".$this->ctrl->getLinkTarget($this,
"editStatistic").
"\">".$this->lng->txt(
"edit").
"</a></div>";
2018 $f_result[$counter][
'edit'] = $link_change;
2022 unset($tmp_purchaser);
2033 include_once
'./Services/Payment/classes/class.ilPayMethods.php';
2035 if(!isset($_GET[
'booking_id']))
2038 $this->showStatistics();
2043 $ilToolbar->addButton($this->lng->txt(
'back'), $this->ctrl->getLinkTarget($this,
'statistic'));
2045 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.main_view.html',
'Services/Payment');
2046 $this->ctrl->setParameter($this,
'booking_id',(
int) $_GET[
'booking_id']);
2049 if($a_show_confirm_delete)
2054 $oConfirmationGUI->setFormAction($this->ctrl->getFormAction($this,
"performDelete"));
2055 $oConfirmationGUI->setHeaderText($this->lng->txt(
"paya_sure_delete_stat"));
2056 $oConfirmationGUI->setCancel($this->lng->txt(
"cancel"),
"statistic");
2057 $oConfirmationGUI->setConfirm($this->lng->txt(
"confirm"),
"performDelete");
2059 $this->tpl->setVariable(
'CONFIRMATION', $oConfirmationGUI->getHTML());
2065 $bookings = $this->booking_obj->getBookings();
2066 $booking = $bookings[(int) $_GET[
'booking_id']];
2072 $oForm->setFormAction($this->ctrl->getFormAction($this));
2073 $oForm->setId(
'stat_form');
2074 $oForm->setTableWidth(
'50 %');
2076 if(is_object($tmp_user))
2078 $frm_user = $tmp_user->getFullname().
' ['.$tmp_user->getLogin().
']';
2082 $frm_user = $this->lng->txt(
'user_deleted');
2084 $oForm->setTitle($frm_user);
2091 $oTitleGUI->
setValue($tmp_obj !=
'' ? $tmp_obj : $this->lng->txt(
'object_deleted'));
2092 $oForm->addItem($oTitleGUI);
2096 $oTransactionGUI->
setValue($booking[
'transaction']);
2097 $oForm->addItem($oTransactionGUI);
2102 if(is_object($tmp_vendor))
2104 $frm_vendor = $tmp_vendor->getFullname().
' ['.$tmp_vendor->getLogin().
']';
2108 $frm_vendor = $this->lng->txt(
'user_deleted');
2110 $oVendorGUI->
setValue($frm_vendor);
2111 $oForm->addItem($oVendorGUI);
2116 $oForm->addItem($oPaymethodGUI);
2121 $oForm->addItem($oOrderdateGUI);
2125 if($booking[
'duration'] == 0 && $booking[
'access_enddate'] == NULL)
2127 $frm_duration = $this->lng->txt(
"unlimited_duration");
2132 if($booking[
'duration'] > 0)
2134 $frm_duration = $booking[
'duration'].
' '.$this->lng->txt(
'paya_months').
'</br>';
2140 $oDurationGUI->setValue($frm_duration);
2141 $oForm->addItem($oDurationGUI);
2145 $oPriceGUI->
setValue($booking[
'price'].
' '.$booking[
'currency_unit']);
2146 $oForm->addItem($oPriceGUI);
2150 $oDiscountGUI->
setValue($booking[
'discount'].
' '.$booking[
'currency_unit']);
2151 $oForm->addItem($oDiscountGUI);
2155 $payed_option = array(0 => $this->lng->txt(
'no'),1 => $this->lng->txt(
'yes'));
2157 $oPayedGUI->setTitle($this->lng->txt(
'paya_payed'));
2158 $oPayedGUI->setOptions($payed_option);
2159 $oPayedGUI->setValue($booking[
'payed']);
2160 $oPayedGUI->setPostVar(
'payed');
2161 $oForm->addItem($oPayedGUI);
2165 $access_option = array(0 => $this->lng->txt(
'no'),1 => $this->lng->txt(
'yes'));
2167 $oAccessGUI->setTitle($this->lng->txt(
'paya_access'));
2168 $oAccessGUI->setOptions($access_option);
2169 $oAccessGUI->setValue($booking[
'access_granted']);
2170 $oAccessGUI->setPostVar(
'access');
2171 $oForm->addItem($oAccessGUI);
2173 $oForm->addCommandButton(
'updateStatistic',$this->lng->txt(
'save'));
2174 $oForm->addCommandButton(
'deleteStatistic',$this->lng->txt(
'delete'));
2180 $oForm2->setId(
'cust_form');
2181 $oForm2->setTableWidth(
'50%');
2182 $oForm2->setTitle($frm_user);
2186 $email = (!$tmp_user) ? $this->lng->txt(
'user_deleted') : $tmp_user->getEmail();
2188 $oForm2->addItem($oEmailGUI);
2192 $oStreetGUI->
setValue($booking[
'street']);
2193 $oForm2->addItem($oStreetGUI);
2197 $oPoBoxGUI->
setValue($booking[
'po_box']);
2198 $oForm2->addItem($oPoBoxGUI);
2202 $oPoBoxGUI->
setValue($booking[
'zipcode']);
2203 $oForm2->addItem($oPoBoxGUI);
2207 $oCityGUI->
setValue($booking[
'city']);
2208 $oForm2->addItem($oCityGUI);
2212 $oCountryGUI->
setValue($booking[
'country']);
2213 $oForm2->addItem($oCountryGUI);
2216 $this->tpl->setVariable(
'FORM',$oForm->getHTML());
2217 $this->tpl->setVariable(
'FORM_2',$oForm2->getHTML());
2223 if(!isset($_GET[
'booking_id']))
2232 $this->booking_obj->setBookingId((
int) $_GET[
'booking_id']);
2233 $this->booking_obj->setAccess((
int) $_POST[
'access']);
2234 $this->booking_obj->setPayed((
int) $_POST[
'payed']);
2236 if($this->booking_obj->update())
2254 if(!isset($_GET[
'booking_id']))
2269 if(!isset($_GET[
'booking_id']))
2278 $this->booking_obj->setBookingId((
int) $_GET[
'booking_id']);
2279 if(!$this->booking_obj->delete())
2281 die(
'Error deleting booking');
2300 if ($rbacsystem->checkAccess(
'visible,read',$this->object->getRefId()))
2303 $tabs_gui->addTarget(
'settings', $this->ctrl->getLinkTarget($this,
'generalSettings'),
2304 array(
'saveGeneralSettings',
'generalSettings ',
'saveBmfSettings',
'savePaypalSettings',
'paypalSettings',
2306 '',
'view'),
'',
'');
2309 $tabs_gui->addTarget(
'bookings', $this->ctrl->getLinkTarget($this,
'statistic'),
2310 array(
'statistic',
'editStatistic',
'updateStatistic',
'deleteStatistic',
'performDelete',
2311 'resetFilter',
'exportVendors',
'addCustomer',
'saveCustomer',
'showObjectSelector',
2312 'searchUserSP',
'performSearchSP'),
'',
'');
2314 $tabs_gui->addTarget(
'objects', $this->ctrl->getLinkTarget($this,
'objects'),
2315 array(
'updateObjectDetails',
'deleteObject',
'performObjectDelete',
'objects',
2316 'editPrices',
'addPrice',
'editDetails',
'resetObjectFilter'),
'',
'');
2318 $tabs_gui->addTarget(
'vendors', $this->ctrl->getLinkTarget($this,
'vendors'),
2319 array(
'vendors',
'searchUser',
'search',
'performSearch',
'addVendor',
'addUser',
'exportVendors',
'deleteVendors',
'performDeleteVendors',
2320 'cancelDeleteVendors',
'editVendor',
'performEditVendor'),
'',
'');
2322 #TODO: CURRENCY not finished yet
2330 $tabs_gui->addTarget(
'pay_methods', $this->ctrl->getLinkTarget($this,
'payMethods'),
2331 #array('payMethods','savePayMethods'), '', '');
2332 array(
'payMethods',
'savePayMethods ',
'saveBmfSettings',
'savePaypalSettings',
'paypalSettings',
2334 '',
'view'),
'',
'');
2338 $this->ctrl->getLinkTargetByClass(
'ilshoptopicsgui',
''),
'payment_topics',
'',
'');
2342 $this->ctrl->getLinkTarget($this,
'vats'),
'vats',
'',
'');
2345 $tabs_gui->addTarget(
'documents', $this->ctrl->getLinkTarget($this,
'documents'),
2346 array(
'documents',
'TermsConditions',
'saveTermsConditions',
'BillingMail',
2347 'saveBillingMail',
'InvoiceNumber',
'saveInvoiceNumber',
'StatutoryRegulations',
'saveStatutoryRegulations'),
'',
'');
2350 if ($rbacsystem->checkAccess(
'edit_permission',$this->object->getRefId()))
2354 $this->ctrl->getLinkTargetByClass(array(get_class($this),
'ilpermissiongui'),
'perm'), array(
'perm',
'info',
'owner'),
'ilpermissiongui');
2370 if(!$a_sub_tab) $a_sub_tab =
'payMethods';
2371 $this->tabs_gui->addSubTabTarget(
'settings',
2372 $this->ctrl->getLinkTargetByClass(
'ilobjpaymentsettingsgui',
'payMethods'),
2373 '',
'',
'',$a_sub_tab ==
'paymethods' ?
true :
false);
2375 $this->tabs_gui->addSubTabTarget(
'pays_bmf',
2376 $this->ctrl->getLinkTargetByClass(
'ilobjpaymentsettingsgui',
'bmfSettings'),
2377 '',
'',
'',$a_sub_tab ==
'bmfSettings' ?
true :
false);
2379 $this->tabs_gui->addSubTabTarget(
'pays_paypal',
2380 $this->ctrl->getLinkTargetByClass(
'ilobjpaymentsettingsgui',
'paypalSettings'),
2381 '',
'',
'',$a_sub_tab ==
'paypalSettings' ?
true :
false);
2398 if(!$a_sub_tab) $a_sub_tab =
'terms_conditions';
2399 $this->tabs_gui->addSubTabTarget(
'terms_conditions',
2400 $this->ctrl->getLinkTargetByClass(
'ilobjpaymentsettingsgui',
'TermsConditions'),
2401 '',
'',
'',$a_sub_tab ==
'terms_conditions' ?
true :
false);
2403 $this->tabs_gui->addSubTabTarget(
'billing_mail',
2404 $this->ctrl->getLinkTargetByClass(
'ilobjpaymentsettingsgui',
'BillingMail'),
2405 '',
'',
'',$a_sub_tab ==
'billing_mail' ?
true :
false);
2406 $this->tabs_gui->addSubTabTarget(
'invoice_number',
2407 $this->ctrl->getLinkTargetByClass(
'ilobjpaymentsettingsgui',
'InvoiceNumber'),
2408 '',
'',
'',$a_sub_tab ==
'invoice_number' ?
true :
false);
2409 $this->tabs_gui->addSubTabTarget(
'statutory_regulations',
2410 $this->ctrl->getLinkTargetByClass(
'ilobjpaymentsettingsgui',
'StatutoryRegulations'),
2411 '',
'',
'',$a_sub_tab ==
'statutory_regulations' ?
true :
false);
2416 if (($_GET[
'cmd'] ==
'') || ($_GET[
'cmd'] ==
'view') || ($a_sub_tab ==
'generalSettings'))
2417 $a_sub_tab =
'generalSettings';
2422 public function generalSettingsObject()
2430 if(!$rbacsystem->checkAccess(
'read', $this->object->getRefId()))
2432 $this->ilErr->raiseError($this->lng->txt(
'msg_no_perm_read'),$this->ilErr->MESSAGE);
2435 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.main_view.html',
'Services/Payment');
2441 $form->setFormAction($this->ctrl->getFormAction($this,
'saveGeneralSettings'));
2442 $form->setTitle($this->lng->txt(
'pays_general_settings'));
2444 $form->addCommandButton(
'saveGeneralSettings',$this->lng->txt(
'save'));
2447 $formItem =
new ilCheckboxInputGUI($this->lng->txt(
'pay_enable_shop'),
'shop_enabled');
2449 $formItem->setInfo($this->lng->txt(
'pay_enable_shop_info'));
2450 $form->addItem($formItem);
2452 $formItem =
new ilTextInputGUI($this->lng->txt(
'pays_currency_unit'),
'currency_unit');
2454 $formItem->setValue($this->error !=
'' && isset($_POST[
'currency_unit'])
2457 $formItem->setRequired(
true);
2458 $form->addItem($formItem);
2462 $formItem->setCols(35);
2463 $formItem->setRequired(
true);
2464 $formItem->setValue($this->error !=
'' && isset($_POST[
'address'])
2466 : $genSetData[
'address']);
2467 $form->addItem($formItem);
2471 $formItem->setCols(35);
2472 $formItem->setRequired(
true);
2473 $formItem->setValue($this->error !=
'' && isset($_POST[
'bank_data'])
2475 : $genSetData[
'bank_data']);
2476 $form->addItem($formItem);
2480 $formItem->setCols(35);
2481 $formItem->setValue($this->error !=
'' && isset($_POST[
'add_info'])
2483 : $genSetData[
'add_info']);
2484 $form->addItem($formItem);
2486 $formItem =
new ilTextInputGUI($this->lng->txt(
'pays_pdf_path'),
'pdf_path');
2487 $formItem->
setValue($this->error !=
"" && isset($_POST[
'pdf_path'])
2490 $formItem->setRequired(
true);
2491 $form->addItem($formItem);
2494 $formItem =
new ilSelectInputGUI($this->lng->txt(
'pay_topics_default_sorting_type'),
'topics_sorting_type');
2495 $formItem->
setValue($genSetData[
'topics_sorting_type']);
2497 1 => $this->lng->txt(
'pay_topics_sort_by_title'),
2498 2 => $this->lng->txt(
'pay_topics_sort_by_date'),
2499 3 => $this->lng->txt(
'pay_topics_sort_manually')
2501 $formItem->setOptions($options);
2502 $form->addItem($formItem);
2505 $formItem =
new ilSelectInputGUI($this->lng->txt(
'pay_topics_default_sorting_direction'),
'topics_sorting_direction');
2506 $formItem->
setValue($genSetData[
'topics_sorting_direction']);
2508 'asc' => $this->lng->txt(
'sort_asc'),
2509 'desc' => $this->lng->txt(
'sort_desc'),
2511 $formItem->setOptions($options);
2512 $form->addItem($formItem);
2515 $formItem =
new ilCheckboxInputGUI($this->lng->txt(
'pay_topics_allow_custom_sorting'),
'topics_allow_custom_sorting');
2516 $formItem->
setChecked((
int)$genSetData[
'topics_allow_custom_sorting']);
2517 $formItem->setInfo($this->lng->txt(
'pay_topics_allow_custom_sorting_info'));
2518 $form->addItem($formItem);
2527 $formItem =
new ilSelectInputGUI($this->lng->txt(
'pay_max_hits'),
'max_hits');
2528 $formItem->
setValue($genSetData[
'max_hits']);
2530 for($i = 10; $i <= 100; $i += 10)
2534 $formItem->setOptions($options);
2535 $formItem->setInfo($this->lng->txt(
'pay_max_hits_info'));
2536 $form->addItem($formItem);
2539 $formItem =
new ilCheckboxInputGUI($this->lng->txt(
'pay_hide_advanced_search'),
'hide_advanced_search');
2540 $formItem->
setChecked((
int)$genSetData[
'hide_advanced_search']);
2541 $formItem->setInfo($this->lng->txt(
'pay_hide_advanced_search_info'));
2542 $form->addItem($formItem);
2546 $formItem->
setChecked((
int)$genSetData[
'hide_news']);
2547 $formItem->setInfo($this->lng->txt(
'pay_hide_news_info'));
2548 $form->addItem($formItem);
2551 $formItem =
new ilCheckboxInputGUI($this->lng->txt(
'pay_hide_coupons'),
'hide_coupons');
2552 $formItem->
setChecked((
int)$genSetData[
'hide_coupons']);
2553 $formItem->setInfo($this->lng->txt(
'pay_hide_coupons'));
2554 $form->addItem($formItem);
2557 $formItem =
new ilCheckboxInputGUI($this->lng->txt(
'pay_hide_shop_info'),
'hide_shop_info');
2558 $formItem->
setChecked((
int)$genSetData[
'hide_shop_info']);
2559 $formItem->setInfo($this->lng->txt(
'pay_hide_shop_info_info'));
2560 $form->addItem($formItem);
2563 $formItem =
new ilCheckboxInputGUI($this->lng->txt(
'use_shop_specials'),
'use_shop_specials');
2564 $formItem->
setChecked((
int)$genSetData[
'use_shop_specials']);
2565 $formItem->setInfo($this->lng->txt(
'use_shop_specials_info'));
2566 $form->addItem($formItem);
2569 $formItem =
new ilCheckboxInputGUI($this->lng->txt(
'show_general_filter'),
'show_general_filter');
2570 $formItem->
setChecked((
int)$genSetData[
'show_general_filter']);
2571 $formItem->setInfo($this->lng->txt(
'show_general_filter_info'));
2572 $form->addItem($formItem);
2575 $formItem =
new ilCheckboxInputGUI($this->lng->txt(
'show_topics_filter'),
'show_topics_filter');
2576 $formItem->
setChecked((
int)$genSetData[
'show_topics_filter']);
2577 $formItem->setInfo($this->lng->txt(
'show_topics_filter_info'));
2578 $form->addItem($formItem);
2581 $formItem =
new ilCheckboxInputGUI($this->lng->txt(
'show_shop_explorer'),
'show_shop_explorer');
2582 $formItem->
setChecked((
int)$genSetData[
'show_shop_explorer']);
2583 $formItem->setInfo($this->lng->txt(
'show_shop_explorer_info'));
2584 $form->addItem($formItem);
2588 $payment_noti =
new ilCheckboxInputGUI($this->lng->txt(
"payment_notification"),
"payment_notification");
2590 $payment_noti->setChecked((
int)$ilSetting->get(
'payment_notification', 0) == 1);
2591 $payment_noti->setInfo($this->lng->txt(
'payment_notification_desc'));
2593 $num_days =
new ilNumberInputGUI($this->lng->txt(
'payment_notification_days'),
'payment_notification_days');
2595 $num_days->setMinValue(0);
2596 $num_days->setMaxValue(120);
2597 $num_days->setRequired(
true);
2598 $num_days->setValue($ilSetting->get(
'payment_notification_days'));
2599 $num_days->setInfo($this->lng->txt(
'payment_notification_days_desc'));
2601 $payment_noti->addSubItem($num_days);
2602 $form->addItem($payment_noti);
2605 $this->tpl->setVariable(
'FORM',
$form->getHTML());
2609 public function saveGeneralSettingsObject()
2614 if(!$rbacsystem->checkAccess(
'read', $this->object->getRefId()))
2616 $this->ilErr->raiseError($this->lng->txt(
'msg_no_perm_read'),$this->ilErr->MESSAGE);
2624 if ($_POST[
'currency_unit'] ==
'' ||
2625 $_POST[
'address'] ==
'' ||
2626 $_POST[
'bank_data'] ==
'' ||
2627 $_POST[
'pdf_path'] ==
'')
2629 $this->error = $this->lng->txt(
'pays_general_settings_not_valid');
2631 return $this->generalSettingsObject();
2635 $genSet->set(
'currency_unit', $_POST[
'currency_unit'],
'currencies');
2636 $genSet->set(
'address', $_POST[
'address'],
'invoice');
2637 $genSet->set(
'bank_data', $_POST[
'bank_data'],
'invoice');
2638 $genSet->set(
'add_info', $_POST[
'add_info'],
'invoice');
2639 $genSet->set(
'pdf_path', $_POST[
'pdf_path'],
'invoice');
2641 $genSet->set(
'topics_allow_custom_sorting', $_POST[
'topics_allow_custom_sorting'],
'gui');
2642 $genSet->set(
'topics_sorting_type', $_POST[
'topics_sorting_type'],
'gui');
2643 $genSet->set(
'topics_sorting_direction', $_POST[
'topics_sorting_direction'],
'gui');
2644 $genSet->set(
'max_hits', $_POST[
'max_hits'],
'gui');
2646 $genSet->set(
'hide_advanced_search', $_POST[
'hide_advanced_search'],
'gui');
2647 #$genSet->set('hide_filtering', $_POST['hide_filtering'], 'gui');
2648 $genSet->set(
'objects_allow_custom_sorting', $_POST[
'objects_allow_custom_sorting'],
'gui');
2649 $genSet->set(
'hide_coupons', $_POST[
'hide_coupons'],
'gui');
2650 $genSet->set(
'hide_news', $_POST[
'hide_news'],
'gui');
2652 if( (
int)$_POST[
'hide_news'] == 0 )
2654 if( (
int)$ilSetting->get(
'payment_news_archive_period') == 0)
2656 $ilSetting->set(
'payment_news_archive_period',
'5');
2660 $genSet->set(
'hide_shop_info', $_POST[
'hide_shop_info'],
'gui');
2661 $genSet->set(
'use_shop_specials', $_POST[
'use_shop_specials'],
'gui');
2662 $genSet->set(
'show_general_filter', $_POST[
'show_general_filter'],
'gui');
2663 $genSet->set(
'show_topics_filter', $_POST[
'show_topics_filter'],
'gui');
2664 $genSet->set(
'show_shop_explorer', $_POST[
'show_shop_explorer'],
'gui');
2667 $ilSetting->set(
'payment_notification', $_POST[
'payment_notification'] ? 1 : 0);
2668 $ilSetting->set(
'payment_notification_days', $_POST[
'payment_notification_days']);
2671 if($check ==
true && (
int)$_POST[
'shop_enabled'])
2673 $genSet->set(
'shop_enabled', 1,
'common');
2677 $genSet->set(
'shop_enabled', 0,
'common');
2681 $this->generalSettingsObject();
2917 private function testERPSettingsObject()
3065 public function paypalSettingsObject($a_show_confirm =
false)
3074 if(!$rbacsystem->checkAccess(
'read', $this->object->getRefId()))
3076 $this->ilErr->raiseError($this->lng->txt(
'msg_no_perm_read'),$this->ilErr->MESSAGE);
3079 include_once
'./Services/Payment/classes/class.ilPaypalSettings.php';
3081 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.main_view.html',
'Services/Payment');
3086 $form->setFormAction($this->ctrl->getFormAction($this,
'savePaypalSettings'));
3087 $form->setTitle($this->lng->txt(
'pays_paypal_settings'));
3089 $form->addCommandButton(
'savePaypalSettings',$this->lng->txt(
'save'));
3091 $formItem =
new ilTextInputGUI($this->lng->txt(
'pays_server_host'),
'server_host');
3092 $formItem->
setValue($ppSet->getServerHost());
3093 $form->addItem($formItem);
3095 $formItem =
new ilTextInputGUI($this->lng->txt(
'pays_server_path'),
'server_path');
3096 $formItem->
setValue($ppSet->getServerPath());
3097 $form->addItem($formItem);
3099 $formItem =
new ilTextInputGUI($this->lng->txt(
'pays_email_vendor'),
'vendor');
3100 $formItem->
setValue($ppSet->getVendor());
3101 $form->addItem($formItem);
3108 $formItem =
new ilTextInputGUI($this->lng->txt(
'pays_auth_token'),
'auth_token');
3109 $formItem->
setValue($ppSet->getAuthToken());
3110 $form->addItem($formItem);
3112 $formItem =
new ilTextInputGUI($this->lng->txt(
'pays_page_style'),
'page_style');
3113 $formItem->
setValue($ppSet->getPageStyle());
3114 $form->addItem($formItem);
3116 $this->tpl->setVariable(
'FORM',
$form->getHTML());
3121 include_once
'./Services/Payment/classes/class.ilPaypalSettings.php';
3126 if(!$rbacsystem->checkAccess(
'read', $this->object->getRefId()))
3128 $this->ilErr->raiseError($this->lng->txt(
'msg_no_perm_read'),$this->ilErr->MESSAGE);
3141 if ($_POST[
'server_host'] ==
'' ||
3142 $_POST[
'server_path'] ==
'' ||
3143 $_POST[
'vendor'] ==
'' ||
3145 $_POST[
'auth_token'] ==
'')
3147 $this->error = $this->lng->txt(
'pays_paypal_settings_not_valid');
3149 $this->paypalSettingsObject();
3156 $this->paypalSettingsObject();
3167 #include_once './Services/Table/classes/class.ilTable2GUI.php';
3169 global $rbacsystem, $ilToolbar;
3172 if(!$rbacsystem->checkAccess(
'read', $this->object->getRefId()))
3174 $this->ilErr->raiseError($this->lng->txt(
'msg_no_perm_read'),$this->ilErr->MESSAGE);
3179 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.main_view.html',
'Services/Payment');
3186 'auto_complete_name' => $this->lng->txt(
'user'),
3187 'user_type' => null,
3188 'submit_name' => $this->lng->txt(
'add')
3191 if(!count($vendors = $this->vendors_obj->getVendors()))
3201 $oConfirmationGUI->setFormAction($this->ctrl->getFormAction($this,
"performDeleteVendors"));
3202 $oConfirmationGUI->setHeaderText($this->lng->txt(
"pays_sure_delete_selected_vendors"));
3203 $oConfirmationGUI->setCancel($this->lng->txt(
"cancel"),
"vendors");
3204 $oConfirmationGUI->setConfirm($this->lng->txt(
"confirm"),
"performDeleteVendors");
3206 foreach($vendors as $vendor)
3208 if(in_array($vendor[
'vendor_id'],
$_SESSION[
'pays_vendor']))
3214 $delete_row = $tmp_obj->getLogin().
' '.
3215 $vendor[
'cost_center'].
' '.
3217 $oConfirmationGUI->addItem(
'',$delete_row, $delete_row);
3223 if(count($vendors) == count(
$_SESSION[
'pays_vendor']))
3228 $this->tpl->setVariable(
'CONFIRMATION', $oConfirmationGUI->getHTML()); #
3233 $f_result = array();
3234 foreach($vendors as $vendor)
3240 $_SESSION[
'pays_vendor']) ? 1 : 0,
"vendor[]", $vendor[
'vendor_id']);
3241 $f_result[$counter][
'login'] = $tmp_obj->getLogin();
3242 $f_result[$counter][
'cost_center'] = $vendor[
'cost_center'];
3256 include_once
'./Services/Payment/classes/class.ilPaymentExcelWriterAdapter.php';
3266 $workbook = $pewa->getWorkbook();
3267 @$workbook->close();
3272 include_once
'./Services/Excel/classes/class.ilExcelUtils.php';
3273 include_once
'./Services/Payment/classes/class.ilPaymentVendors.php';
3277 $workbook = $pewa->getWorkbook();
3278 $worksheet = $workbook->addWorksheet(utf8_decode($this->lng->txt(
'bookings')));
3280 $worksheet->mergeCells(0,0,0,3);
3281 $worksheet->setColumn(0,0,16);
3282 $worksheet->setColumn(0,1,32);
3283 $worksheet->setColumn(0,2,32);
3284 $worksheet->setColumn(0,3,16);
3285 $worksheet->setColumn(0,4,16);
3286 $worksheet->setColumn(0,5,16);
3287 $worksheet->setColumn(0,6,24);
3288 $worksheet->setColumn(0,7,8);
3289 $worksheet->setColumn(0,8,12);
3290 $worksheet->setColumn(0,9,16);
3292 $title = $this->lng->txt(
'bookings');
3293 $title .=
' '.$this->lng->txt(
'as_of').
' ';
3294 $title .= strftime(
'%Y-%m-%d %R',time());
3296 $worksheet->writeString(0,0,
$title,$pewa->getFormatTitle());
3298 $worksheet->writeString(1,0,$this->lng->txt(
'payment_system'),$pewa->getFormatHeader());
3299 $worksheet->writeString(1,1,$this->lng->txt(
'paya_transaction'),$pewa->getFormatHeader());
3300 $worksheet->writeString(1,2,$this->lng->txt(
'title'),$pewa->getFormatHeader());
3301 $worksheet->writeString(1,3,$this->lng->txt(
'paya_vendor'),$pewa->getFormatHeader());
3302 $worksheet->writeString(1,4,$this->lng->txt(
'pays_cost_center'),$pewa->getFormatHeader());
3303 $worksheet->writeString(1,5,$this->lng->txt(
'paya_customer'),$pewa->getFormatHeader());
3304 $worksheet->writeString(1,6,$this->lng->txt(
'email'),$pewa->getFormatHeader());
3305 $worksheet->writeString(1,7,$this->lng->txt(
'paya_order_date'),$pewa->getFormatHeader());
3306 $worksheet->writeString(1,8,$this->lng->txt(
'duration'),$pewa->getFormatHeader());
3307 $worksheet->writeString(1,9,$this->lng->txt(
'price_a'),$pewa->getFormatHeader());
3308 $worksheet->writeString(1,10,$this->lng->txt(
'paya_payed_access'),$pewa->getFormatHeader());
3310 $worksheet->writeString(1,11,$this->lng->txt(
'street'),$pewa->getFormatHeader());
3311 $worksheet->writeString(1,12,$this->lng->txt(
'pay_bmf_po_box'),$pewa->getFormatHeader());
3312 $worksheet->writeString(1,13,$this->lng->txt(
'zipcode'),$pewa->getFormatHeader());
3313 $worksheet->writeString(1,14,$this->lng->txt(
'city'),$pewa->getFormatHeader());
3314 $worksheet->writeString(1,15,$this->lng->txt(
'country'),$pewa->getFormatHeader());
3316 if(!count($bookings = $this->booking_obj->getBookings()))
3321 include_once
'Services/User/classes/class.ilObjUser.php';
3322 $object_title_cache = array();
3323 $user_title_cache = array();
3326 foreach($bookings as $booking)
3328 if(array_key_exists($booking[
'ref_id'], $object_title_cache))
3330 $tmp_obj = $object_title_cache[$booking[
'ref_id']];
3335 $object_title_cache[$booking[
'ref_id']] = $tmp_obj;
3337 if(array_key_exists($booking[
'b_vendor_id'], $user_title_cache))
3339 $tmp_vendor = $user_title_cache[$booking[
'b_vendor_id']];
3344 $user_title_cache[$booking[
'b_vendor_id']] = $tmp_vendor;
3346 if(array_key_exists($booking[
'customer_id'], $user_title_cache))
3348 $tmp_purchaser = $user_title_cache[$booking[
'customer_id']];
3355 $tmp_purchaser =
''.$tmp_purchaser_name[
'firstname'].
' '.$tmp_purchaser_name[
'lastname'].
' ['.$tmp_purchaser_login.
']';
3356 $user_title_cache[$booking[
'customer_id']] = $tmp_purchaser;
3359 include_once
'./Services/Payment/classes/class.ilPayMethods.php';
3362 $worksheet->writeString($counter,0,$str_paymethod);
3363 $worksheet->writeString($counter,1,$booking[
'transaction']);
3364 $worksheet->writeString($counter,2,($tmp_obj !=
'' ? $tmp_obj : $this->lng->txt(
'object_deleted')));
3365 $worksheet->writeString($counter,3,($tmp_vendor !=
'' ? $tmp_vendor : $this->lng->txt(
'user_deleted')));
3366 $worksheet->writeString($counter,4,ilPaymentVendors::_getCostCenter($booking[
'b_vendor_id']));
3367 $worksheet->writeString($counter,5,($tmp_purchaser !=
'' ? $tmp_purchaser : $this->lng->txt(
'user_deleted')));
3368 $worksheet->writeString($counter,6,$tmp_purchaser_email);
3369 $worksheet->writeString($counter,7,strftime(
'%Y-%m-%d %R',$booking[
'order_date']));
3370 $worksheet->writeString($counter,8,$booking[
'duration']);
3371 $worksheet->writeString($counter,9,$booking[
'price']);
3373 $payed_access = $booking[
'payed'] ?
3374 $this->lng->txt(
'yes') :
3375 $this->lng->txt(
'no');
3377 $payed_access .=
'/';
3378 $payed_access .= $booking[
'access_granted'] ?
3379 $this->lng->txt(
'yes') :
3380 $this->lng->txt(
'no');
3382 $worksheet->writeString($counter,10,$payed_access);
3384 $worksheet->writeString($counter,11,$booking[
'street']);
3385 $worksheet->writeString($counter,12,$booking[
'po_box']);
3386 $worksheet->writeString($counter,13,$booking[
'zipcode']);
3387 $worksheet->writeString($counter,14,$booking[
'city']);
3388 $worksheet->writeString($counter,15,$booking[
'country']);
3392 unset($tmp_purchaser);
3401 include_once
'./Services/Excel/classes/class.ilExcelUtils.php';
3403 $workbook = $pewa->getWorkbook();
3404 $worksheet = $workbook->addWorksheet($this->lng->txt(
'pays_vendor'));
3407 $worksheet->mergeCells(0,0,0,2);
3408 $worksheet->setColumn(1,0,32);
3409 $worksheet->setColumn(1,1,32);
3410 $worksheet->setColumn(1,2,32);
3412 $title = $this->lng->txt(
'pays_vendor');
3413 $title .=
' '.$this->lng->txt(
'as_of').
' ';
3414 $title .= strftime(
'%Y-%m-%d %R',time());
3416 $worksheet->writeString(0,0,
$title,$pewa->getFormatTitle());
3418 $worksheet->writeString(1,0,$this->lng->txt(
'login'),$pewa->getFormatHeader());
3419 $worksheet->writeString(1,1,$this->lng->txt(
'fullname'),$pewa->getFormatHeader());
3420 $worksheet->writeString(1,2,$this->lng->txt(
'pays_cost_center'),$pewa->getFormatHeader());
3422 if(!count($vendors = $this->vendors_obj->getVendors()))
3428 foreach($vendors as $vendor)
3433 $worksheet->writeString($counter,0,$tmp_obj->getLogin());
3434 $worksheet->writeString($counter,1,$tmp_obj->getFullname());
3435 $worksheet->writeString($counter,2,$vendor[
'cost_center']);
3445 include_once
'./Services/Payment/classes/class.ilPayMethods.php';
3449 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.main_view.html',
'Services/Payment');
3452 if(!$rbacsystem->checkAccess(
'read', $this->object->getRefId()))
3454 $this->ilErr->raiseError($this->lng->txt(
'msg_no_perm_read'),$this->ilErr->MESSAGE);
3457 if(count($askForDeletingAddresses))
3462 $oConfirmationGUI->setFormAction($ilCtrl->getFormAction($this,
"deleteAddressesForPaymethods"));
3463 $oConfirmationGUI->setHeaderText($this->lng->txt(
"info_delete_sure"));
3464 $oConfirmationGUI->setCancel($this->lng->txt(
"cancel"),
"paymethods");
3465 $oConfirmationGUI->setConfirm($this->lng->txt(
"confirm"),
"deleteAddressesForPaymethods");
3467 foreach($askForDeletingAddresses as $pm_id)
3470 $oConfirmationGUI->additem(
'paymethod['.$pm_obj->getPmId().
']',$pm_obj->getPmId(), $this->lng->txt(
'delete_addresses_bill').
' -> '.
ilPayMethods::getStringByPaymethod($pm_obj->getPmTitle()));
3473 $this->tpl->setVariable(
'CONFIRMATION', $oConfirmationGUI->getHtml());
3478 $paymethods = $obj_paymethods->readAll();
3482 foreach($paymethods as $paymethod)
3484 if($paymethod[
'pm_title'] !=
'epay')
3488 $result[$counter][
'save_usr_adr'] =
ilUtil::formCheckbox($paymethod[
'save_usr_adr'] ? 1 : 0,
'save_usr_adr['.$paymethod[
'pm_id'].
']',1);
3489 $this->ctrl->clearParameters($this);
3496 $this->ctrl->setParameter($this,
'cmd',
'savePayMethods');
3498 $tbl->setTitle($this->lng->txt(
'pays_pay_methods'));
3500 $tbl->setId(
'tbl_paymethods');
3501 $tbl->setRowTemplate(
"tpl.shop_paymethods_row.html",
"Services/Payment");
3503 $tbl->addColumn($this->lng->txt(
'title'),
'pm_title',
'10%');
3504 $tbl->addColumn($this->lng->txt(
'enabled'),
'pm_enabled',
'10%');
3505 $tbl->addColumn($this->lng->txt(
'save_customer_address'),
'save_usr_adr',
'10%');
3506 $tbl->addCommandButton(
'savePayMethods', $this->lng->txt(
'save'));
3508 $tbl->disable(
'sort');
3511 $this->tpl->setVariable(
'TABLE', $tbl->getHTML());
3518 include_once
'./Services/Payment/classes/class.ilPayMethods.php';
3523 if(!$rbacsystem->checkAccess(
'read', $this->object->getRefId()))
3525 $this->ilErr->raiseError($this->lng->txt(
'msg_no_perm_read'),$this->ilErr->MESSAGE);
3530 $askForDeletingAddresses = array();
3532 $pm_enabled = array();
3533 if(is_array($_POST[
'pm_enabled']) )
3535 $pm_enabled = $_POST[
'pm_enabled'];
3537 else if($_POST[
'pm_enabled'] == NULL)
3540 $this->genSetData->set(
'shop_enabled', 0,
'common');
3544 for($i = 1; $i <= $count_pm; $i++)
3546 if(!array_key_exists($i, $pm_enabled) && ilPayMethods::_PmEnabled($i) == 1)
3558 if(!array_key_exists($i, $pm_enabled) && ilPayMethods::_PmEnabled($i) == 0)
3569 $askForDeletingAddresses[] = $i;
3582 if(!$askForDeletingAddresses)
3601 if(!count($_POST[
'vendor']))
3609 foreach($_POST[
'vendor'] as $vendor)
3620 $_SESSION[
'pays_vendor'] = $_POST[
'vendor'];
3629 include_once
'./Services/Payment/classes/class.ilPaymentTrustees.php';
3634 if(!$rbacsystem->checkAccess(
'write', $this->object->getRefId()))
3636 $this->ilErr->raiseError($this->lng->txt(
'msg_no_perm_write'),$this->ilErr->MESSAGE);
3639 foreach(
$_SESSION[
'pays_vendor'] as $vendor)
3641 $this->vendors_obj->delete($vendor);
3649 $this->genSetData->set(
'shop_enabled', 0,
'common');
3663 if(!$rbacsystem->checkAccess(
"write", $this->object->getRefId()))
3665 $this->ilErr->raiseError($this->lng->txt(
"msg_no_perm_write"),$this->ilErr->MESSAGE);
3668 if(!count($_POST[
'vendor']))
3675 if(count($_POST[
'vendor']) > 1)
3683 $_SESSION[
'pays_vendor'] = $_POST[
'vendor'][0];
3685 if (!is_array($this->vendors_obj->vendors[
$_SESSION[
'pays_vendor']]))
3692 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.main_view.html',
'Services/Payment');
3695 $form_gui->setFormAction($this->ctrl->getFormAction($this,
'performEditVendor'));
3696 $form_gui->setTitle($this->lng->txt(
'pays_vendor'));
3700 $form_gui->addItem($oVendorGUI);
3702 $oCostcenterGUI =
new ilTextInputGUI($this->lng->txt(
'pays_cost_center'),
'cost_center');
3703 $oCostcenterGUI->
setValue($this->error !=
'' && isset($_POST[
'cost_center'])
3706 $form_gui->addItem($oCostcenterGUI);
3708 $form_gui->addCommandButton(
'performEditVendor',$this->lng->txt(
'save'));
3709 $this->tpl->setVariable(
'FORM', $form_gui->getHTML());
3718 if(!$rbacsystem->checkAccess(
'write', $this->object->getRefId()))
3720 $this->ilErr->raiseError($this->lng->txt(
'msg_no_perm_write'),$this->ilErr->MESSAGE);
3738 if (!is_array($this->vendors_obj->vendors[
$_SESSION[
'pays_vendor']]))
3744 if ($_POST[
'cost_center'] ==
'')
3746 $this->error = $this->lng->txt(
'pays_cost_center_not_valid');
3748 $_POST[
'vendor'] = array(
$_SESSION[
'pays_vendor']);
3749 return $this->editVendor();
3753 $this->vendors_obj->update(
$_SESSION[
'pays_vendor'], $_POST[
'cost_center']);
3764 global $rbacsystem,
$tree, $ilToolbar;
3767 if(!$rbacsystem->checkAccess(
'read', $this->object->getRefId()))
3769 $this->ilErr->raiseError($this->lng->txt(
'msg_no_perm_read'),$this->ilErr->MESSAGE);
3772 include_once
'./Services/Payment/classes/class.ilPaymentObjectSelector.php';
3774 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.paya_object_selector.html',
'Services/Payment');
3776 $ilToolbar->addButton($this->lng->txt(
'back'), $this->ctrl->getLinkTarget($this,
'statistic'));
3780 $exp =
new ilPaymentObjectSelector($this->ctrl->getLinkTarget($this,
'showObjectSelector'), (string)strtolower(get_class($this)));
3781 $exp->setExpand($_GET[
'paya_link_expand'] ? $_GET[
'paya_link_expand'] : $tree->readRootId());
3782 $exp->setExpandTarget($this->ctrl->getLinkTarget($this,
'showObjectSelector'));
3786 $this->tpl->setVariable(
'EXPLORER',$exp->getOutput());
3830 if(!$rbacsystem->checkAccess(
'read', $this->object->getRefId()))
3832 $this->ilErr->raiseError($this->lng->txt(
'msg_no_perm_read'),$this->ilErr->MESSAGE);
3835 $_SESSION[
'pays_search_str'] = $_POST[
'search_str'] = $_POST[
'search_str'] ? $_POST[
'search_str'] :
$_SESSION[
'pays_search_str'];
3837 if(!isset($_POST[
'search_str']))
3852 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.main_view.html',
'Services/Payment');
3855 $f_result = array();
3863 $f_result[$counter][
'login'] = $tmp_obj->getLogin();
3864 $f_result[$counter][
'lastname'] = $tmp_obj->getLastname();
3865 $f_result[$counter][
'firstname'] = $tmp_obj->getFirstname();
3880 if(!$rbacsystem->checkAccess(
'write', $this->object->getRefId()))
3882 $this->ilErr->raiseError($this->lng->txt(
'msg_no_perm_write'),$this->ilErr->MESSAGE);
3884 if(!$_POST[
'user_login'])
3899 if($this->vendors_obj->isAssigned(
$usr_id))
3906 $this->vendors_obj->add(
$usr_id);
3919 if(!$rbacsystem->checkAccess(
'write', $this->object->getRefId()))
3921 $this->ilErr->raiseError($this->lng->txt(
'msg_no_perm_write'),$this->ilErr->MESSAGE);
3924 $this->lng->loadLanguageModule(
'crs');
3925 if(!is_array($_POST[
'user']))
3933 $already_assigned = $assigned = 0;
3934 foreach($_POST[
'user'] as
$usr_id)
3936 if($this->vendors_obj->isAssigned($usr_id))
3938 ++$already_assigned;
3941 $this->vendors_obj->add($usr_id);
3949 $message .= $this->lng->txt(
'pays_assigned_vendors').
' '.$assigned;
3951 if($already_assigned)
3953 $message .=
'<br />'.$this->lng->txt(
'pays_already_assigned_vendors').
' '.$already_assigned;
3966 if(!isset($_GET[
'sell_id']))
3968 ilUtil::sendFailiure($this->lng->txt(
'paya_no_booking_id_given'));
3974 $ilToolbar->addButton($this->lng->txt(
'back'), $this->ctrl->getLinkTarget($this,
'showObjectSelector'));
3975 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.main_view.html',
'Services/Payment');
3977 $this->lng->loadLanguageModule(
'search');
3978 $this->ctrl->setParameter($this,
'sell_id', $_GET[
'sell_id']);
3981 $form_gui->setFormAction($this->ctrl->getFormAction($this));
3982 $form_gui->setTitle($this->lng->txt(
'search_user'));
3983 $form_gui->setId(
'search_form');
3985 $oTitle =
new ilTextInputGUI($this->lng->txt(
'search_search_term'),
'search_str');
3987 $oTitle->setSize(40);
3988 $oTitle->setValue($_POST[
'search_str']);
3989 $form_gui->addItem($oTitle);
3992 $form_gui->addCommandButton(
'performSearchSP', $this->lng->txt(
'search'));
3993 $form_gui->addCommandButton(
'bookings', $this->lng->txt(
'cancel'));
3995 $this->tpl->setVariable(
'FORM',$form_gui->getHTML());
4003 $_SESSION[
'paya_search_str_user_sp'] = $_POST[
'search_str'] = $_POST[
'search_str'] ? $_POST[
'search_str'] :
$_SESSION[
'paya_search_str_user_sp'];
4005 if(!trim($_POST[
'search_str']))
4008 $this->statistics();
4020 if(!isset($_GET[
'sell_id']))
4028 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.main_view.html',
'Services/Payment');
4029 $this->ctrl->setParameter($this,
'sell_id', $_GET[
'sell_id']);
4031 $ilToolbar->addButton($this->lng->txt(
'back'), $this->ctrl->getLinkTarget($this,
'searchUserSP'));
4034 $f_result = array();
4041 $f_result[$counter][
'user_id'] = $user[
'id'];
4042 $f_result[$counter][
'login'] = $tmp_obj->getLogin();
4043 $f_result[$counter][
'firstname'] = $tmp_obj->getFirstname();
4044 $f_result[$counter][
'lastname'] = $tmp_obj->getLastname();
4056 if ($_POST[
'sell_id'] !=
'') $_GET[
'sell_id'] = $_POST[
'sell_id'];
4057 if ($_GET[
'user_id'] !=
'') $_POST[
'user_id'] = $_GET[
'user_id'];
4059 if(!isset($_GET[
'sell_id']))
4067 if(!isset($_POST[
'user_id']))
4074 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.main_view.html',
'Services/Payment');
4075 $this->ctrl->setParameter($this,
'sell_id', $_GET[
'sell_id']);
4077 $ilToolbar->addButton($this->lng->txt(
'back'), $this->ctrl->getLinkTarget($this,
'searchUserSP'));
4079 $this->ctrl->setParameter($this,
'user_id', $_POST[
'user_id']);
4088 $tmp_object[
'title'] = $tmp_obj->getTitle();
4092 $tmp_object[
'title'] = $this->lng->txt(
'object_not_found');
4100 $oForm->setFormAction($this->ctrl->getFormAction($this,
'saveCustomer'));
4101 $oForm->setTitle($this->lng->txt($tmp_user->getFullname().
' ['.$tmp_user->getLogin().
']'));
4105 $oTransaction->setTitle($this->lng->txt(
'paya_transaction'));
4107 $oTransaction->setValue($_POST[
'transaction']);
4108 $oTransaction->setPostVar(
'transaction');
4109 $oForm->addItem($oTransaction);
4113 $oObject->
setValue($tmp_obj->getTitle());
4114 $oForm->addItem($oObject);
4118 $oVendor->
setValue($tmp_vendor->getFullname().
' ['.$tmp_vendor->getLogin().
']');
4119 $oForm->addItem($oVendor);
4122 $oPayMethods =
new ilSelectInputGUI($this->lng->txt(
'paya_pay_method'),
'pay_method');
4123 $payOptions = ilPaymethods::getPayMethodsOptions(
false);
4124 $oPayMethods->setOptions($payOptions);
4125 $oPayMethods->setValue($_POST[
'pay_method']);
4126 $oPayMethods->setPostVar(
'pay_method');
4127 $oForm->addItem($oPayMethods);
4130 $duration_options = array();
4133 $standard_prices = array();
4134 $extension_prices = array();
4135 $standard_prices .= $price_obj->getPrices();
4136 $extension_prices .= $price_obj->getExtensionPrices();
4138 $prices = array_merge($standard_prices, $extension_prices );
4140 if (is_array($prices))
4143 $currency_unit = $genSet->get(
'currency_unit');
4145 foreach($prices as $price)
4147 switch($price[
'price_type'])
4151 $price[
'duration'].
' '.$this->lng->txt(
'paya_months').
' -> '.$price[
'price'].
' '. $currency_unit;
4155 include_once
'./Services/Calendar/classes/class.ilDatePresentation.php';
4162 $txt_duration = $this->lng->txt(
'unlimited_duration').
' -> '.$price[
'price'].
' '. $currency_unit;
4165 $txt_extension =
'';
4166 if($price[
'extension'] == 1)
4168 $txt_extension =
' ('.$this->lng->txt(
'extension_price').
') ';
4170 $duration_options[$price[
'price_id']] .= $txt_duration.
''.$txt_extension;
4174 $oDuration =
new ilSelectInputGUI($this->lng->txt(
'duration'),
'price_id');
4175 $oDuration->setOptions($duration_options);
4176 $oDuration->
setValue($_POST[
'price_id']);
4177 $oForm->addItem($oDuration);
4181 $payed_option = array(
'1'=>$this->lng->txt(
'yes'),
'0'=>$this->lng->txt(
'no'));
4183 $o_payed->setTitle($this->lng->txt(
'paya_payed'));
4184 $o_payed->setOptions($payed_option);
4185 $o_payed->setValue($_POST[
'payed']);
4186 $o_payed->setPostVar(
'payed');
4187 $oForm->addItem($o_payed);
4191 $access_option = array(
'1'=>$this->lng->txt(
'yes'),
'0'=>$this->lng->txt(
'no'));
4193 $o_access->setTitle($this->lng->txt(
'paya_access'));
4194 $o_access->setOptions($access_option);
4195 $o_access->setValue($_POST[
'access']);
4196 $o_access->setPostVar(
'access');
4198 $oForm->addItem($o_access);
4200 $oForm->addCommandButton(
'saveCustomer',$this->lng->txt(
'save'));
4201 $oForm->addCommandButton(
'bookings', $this->lng->txt(
'cancel'));
4203 $this->tpl->setVariable(
'FORM',$oForm->getHTML());
4209 global
$ilUser,$ilObjDataCache;
4211 if(!isset($_GET[
'sell_id']))
4219 if(!isset($_GET[
'user_id']))
4227 if ($_POST[
'pay_method'] ==
'' ||
4228 $_POST[
'price_id'] ==
'')
4243 $this->booking_obj->setTransaction($transaction);
4244 $this->booking_obj->setTransactionExtern($_POST[
'transaction']);
4245 $this->booking_obj->setPobjectId($pObjectId);
4246 $this->booking_obj->setCustomerId($_GET[
'user_id']);
4247 $this->booking_obj->setVendorId($obj->getVendorId());
4249 $this->booking_obj->setPayMethod($_POST[
'pay_method']);
4250 $this->booking_obj->setOrderDate(time());
4256 switch($price[
'price_type'])
4259 $this->booking_obj->setDuration($price[
'duration']);
4263 $this->booking_obj->setDuration(0);
4264 $this->booking_obj->setAccessStartdate($price[
'duration_from']);
4265 $this->booking_obj->setAccessEnddate($price[
'duration_until']);
4268 $this->booking_obj->setDuration(0);
4269 $this->booking_obj->setAccessEnddate(NULL);
4273 $this->booking_obj->setPriceType($price[
'price_type']);
4274 $this->booking_obj->setPrice($price[
'price']);
4276 $this->booking_obj->setAccess((
int) $_POST[
'access']);
4277 $this->booking_obj->setPayed((
int) $_POST[
'payed']);
4278 $this->booking_obj->setVoucher(
'');
4280 $obj_id = $ilObjDataCache->lookupObjId($obj->getRefId());
4281 $obj_type = $ilObjDataCache->lookupType(
$obj_id);
4282 $obj_title = $ilObjDataCache->lookupTitle(
$obj_id);
4285 $oVAT =
new ilShopVats((
int)$obj->getVatId());
4286 $obj_vat_rate = $oVAT->
getRate();
4287 $obj_vat_unit = $obj->getVat($this->booking_obj->getPrice());
4289 $this->booking_obj->setObjectTitle($obj_title);
4290 $this->booking_obj->setVatRate($obj_vat_rate);
4291 $this->booking_obj->setVatUnit($obj_vat_unit);
4294 $this->booking_obj->setCurrencyUnit( $genSet->get(
'currency_unit'));
4296 include_once
'./Services/Payment/classes/class.ilPayMethods.php';
4299 if($save_user_address_enabled == 1)
4302 $user_id[] = $_GET[
"user_id"];
4306 $this->booking_obj->setStreet($cust_obj[$_GET[
"user_id"]][
'street'],
'');
4308 $this->booking_obj->setZipcode($cust_obj[$_GET[
"user_id"]][
'zipcode']);
4309 $this->booking_obj->setCity($cust_obj[$_GET[
"user_id"]][
'city']);
4310 $this->booking_obj->setCountry($cust_obj[$_GET[
"user_id"]][
'country']);
4313 if($this->booking_obj->add())
4319 if($obj_type ==
'crs')
4338 $this->ctrl->setParameter($this,
'cmd',
'statistic');
4341 $tbl->setTitle($this->lng->txt(
"bookings"));
4342 $tbl->setId(
'tbl_show_statistics');
4343 $tbl->setRowTemplate(
"tpl.shop_statistics_row.html",
"Services/Payment");
4345 $tbl->addColumn($this->lng->txt(
'paya_transaction'),
'transaction',
'10%');
4346 $tbl->addColumn($this->lng->txt(
'title'),
'object_title',
'10%');
4347 $tbl->addColumn($this->lng->txt(
'paya_vendor'),
'vendor',
'10%');
4348 $tbl->addColumn($this->lng->txt(
'paya_customer'),
'customer',
'10%');
4349 $tbl->addColumn($this->lng->txt(
'paya_order_date'),
'order_date',
'10%');
4350 $tbl->addColumn($this->lng->txt(
'duration'),
'duration',
'20%');
4351 $tbl->addColumn($this->lng->txt(
'price_a'),
'price',
'5%');
4352 $tbl->addColumn($this->lng->txt(
'paya_coupons_coupon'),
'discount',
'5%');
4353 $tbl->addColumn($this->lng->txt(
'paya_payed_access'),
'payed_access',
'1%');
4354 $tbl->addColumn(
'',
'edit',
'5%');
4356 $tbl->addCommandButton(
'exportVendors',$this->lng->txt(
'excel_export'));
4357 $tbl->setData($a_result_set);
4359 $this->tpl->setVariable(
'TABLE', $tbl->getHTML());
4366 include_once
'./Services/Payment/classes/class.ilPaymentBookings.php';
4373 $this->ctrl->setParameter($this,
'cmd',
'vendors');
4376 $tbl->setTitle($this->lng->txt(
"vendors"));
4377 $tbl->setId(
'tbl_show_vendors');
4378 $tbl->setRowTemplate(
"tpl.shop_users_row.html",
"Services/Payment");
4380 $tbl->addColumn(
'',
'vendor_id',
'1%');
4381 $tbl->addColumn($this->lng->txt(
'paya_vendor'),
'login',
'10%');
4382 $tbl->addColumn($this->lng->txt(
'pays_cost_center'),
'cost_center',
'10%');
4383 $tbl->addColumn($this->lng->txt(
'pays_number_bookings'),
'number_bookings',
'10%');
4385 $tbl->addMultiCommand(
"editVendor", $this->lng->txt(
'pays_edit_vendor'));
4386 $tbl->addMultiCommand(
"deleteVendors", $this->lng->txt(
'pays_delete_vendor'));
4388 $tbl->addCommandButton(
'exportVendors',$this->lng->txt(
'excel_export'));
4390 $tbl->setData($a_result_set);
4391 $this->tpl->setVariable(
'TABLE', $tbl->getHTML());
4400 $tbl->setTitle($this->lng->txt(
"pays_header_select_vendor"));
4401 $tbl->setId(
'tbl_search_user_vendor');
4402 $tbl->setRowTemplate(
"tpl.shop_users_row.html",
"Services/Payment");
4404 $tbl->addColumn(
' ',
'vendor_id',
'3%',
true);
4405 $tbl->addColumn($this->lng->txt(
'login'),
'login',
'32%');
4406 $tbl->addColumn($this->lng->txt(
'firstname'),
'firstname',
'32%');
4407 $tbl->addColumn($this->lng->txt(
'lastname'),
'lastname',
'32%');
4409 $tbl->setSelectAllCheckbox(
'vendor_id');
4410 $tbl->addMultiCommand(
"addUser", $this->lng->txt(
"add"));
4411 $tbl->addCommandButton(
'vendors',$this->lng->txt(
'cancel'));
4414 $tbl->setData($a_result_set);
4415 $this->tpl->setVariable(
'TABLE', $tbl->getHTML());
4422 include_once(
'./Services/Search/classes/class.ilSearch.php');
4424 $this->lng->loadLanguageModule(
'content');
4427 $search->setPerformUpdate(
false);
4429 $search->setCombination(
'and');
4430 $search->setSearchFor(array(0 =>
'usr'));
4431 $search->setSearchType(
'new');
4433 if($search->validate($message))
4435 $search->performSearch();
4440 $this->ctrl->redirect($this,
'searchUser');
4442 return $search->getResultByType(
'usr');
4447 include_once(
'./Services/Search/classes/class.ilSearch.php');
4449 $this->lng->loadLanguageModule(
'content');
4451 $search =
new ilSearch($this->user_obj->getId());
4454 $search->setCombination(
'and');
4455 $search->setSearchFor(array(0 =>
'usr'));
4456 $search->setSearchType(
'new');
4458 if($search->validate($message))
4460 $search->performSearchSPObject();
4465 $this->ctrl->redirect($this,
'searchUserSP');
4467 return $search->getResultByType(
'usr');
4471 $this->ctrl->setParameter($this,
'sell_id', $_GET[
'sell_id']);
4474 $tbl->setTitle($this->lng->txt(
'users'));
4475 $tbl->setId(
'tbl_search_user_vendor');
4476 $tbl->setRowTemplate(
"tpl.shop_users_row.html",
"Services/Payment");
4478 $tbl->addColumn(
' ',
'user_id',
'3%',
true);
4479 $tbl->addColumn($this->lng->txt(
'login'),
'login',
'32%');
4480 $tbl->addColumn($this->lng->txt(
'firstname'),
'firstname',
'32%');
4481 $tbl->addColumn($this->lng->txt(
'lastname'),
'lastname',
'32%');
4484 $tbl->addMultiCommand(
"addCustomer", $this->lng->txt(
"add"));
4485 $tbl->addCommandButton(
'statistic',$this->lng->txt(
'cancel'));
4488 $tbl->setData($a_result_set);
4489 $this->tpl->setVariable(
'TABLE', $tbl->getHTML());
4497 if(!$ilAccess->checkAccess(
'read',
'', $this->object->getRefId()))
4499 $this->ilErr->raiseError($this->lng->txt(
'msg_no_perm_read'), $this->ilErr->MESSAGE);
4502 include_once
'Services/Table/classes/class.ilTable2GUI.php';
4504 $tbl->setId(
'pay_vats_tbl');
4505 $tbl->setFormAction($this->ctrl->getFormAction($this),
'createVat');
4506 $tbl->setTitle($this->lng->txt(
'payment_tax_rates'));
4507 $tbl->setRowTemplate(
'tpl.shop_vats_list_row.html',
'Services/Payment');
4509 $tbl->setDefaultOrderField(
'title');
4511 $tbl->addColumn(
'',
'check',
'1%');
4512 $tbl->addColumn($this->lng->txt(
'vat_title'),
'vat_title',
'33%');
4513 $tbl->addColumn($this->lng->txt(
'vat_rate'),
'vat_rate',
'33%');
4514 $tbl->addColumn(
'',
'commands',
'33%');
4517 $oShopVatsList->read();
4521 $_SESSION[
'count_vats'] = $oShopVatsList->getNumItems();
4523 if($oShopVatsList->hasItems())
4525 $tbl->enable(
'select_all');
4526 $tbl->setSelectAllCheckbox(
'vat_id');
4529 foreach($oShopVatsList as $oVAT)
4532 $result[$counter][
'vat_title'] = $oVAT->getTitle();
4534 $this->ctrl->setParameter($this,
'vat_id', $oVAT->getId());
4535 $result[$counter][
'edit_text'] = $this->lng->txt(
'edit');
4536 $result[$counter][
'edit_url'] = $this->ctrl->getLinkTarget($this,
'editVat');
4537 $result[$counter][
'delete_text'] = $this->lng->txt(
'delete');
4538 $result[$counter][
'delete_url'] = $this->ctrl->getLinkTarget($this,
'confirmDeleteVat');
4539 $this->ctrl->clearParameters($this);
4543 $tbl->addMultiCommand(
'confirmDeleteVat', $this->lng->txt(
'delete'));
4547 $tbl->disable(
'header');
4548 $tbl->disable(
'footer');
4550 $tbl->setNoEntriesText($this->lng->txt(
'paya_no_vats_assigned'));
4555 $tbl->addCommandButton(
'createVat', $this->lng->txt(
'paya_insert_vats'));
4557 $this->tpl->setContent($tbl->getHTML());
4564 if((
int)$_GET[
'vat_id'] && !isset($_POST[
'vat_id']))
4566 $_POST[
'vat_id'][] = $_GET[
'vat_id'];
4569 if(
$_SESSION[
'count_vats'] == count($_POST[
'vat_id']))
4576 $c_gui->setFormAction($this->ctrl->getFormAction($this,
'performDeleteVat'));
4577 $c_gui->setHeaderText($this->lng->txt(
'paya_sure_delete_vats'));
4578 $c_gui->setCancel($this->lng->txt(
'cancel'),
'vats');
4579 $c_gui->setConfirm($this->lng->txt(
'confirm'),
'performDeleteVat');
4582 foreach((array)$_POST[
'vat_id'] as $vat_id)
4587 $c_gui->addItem(
'vat_id[]', $oVAT->getId(), $oVAT->getTitle());
4599 $this->tpl->setContent($c_gui->getHTML());
4611 if(!is_array($_POST[
'vat_id']))
4616 foreach($_POST[
'vat_id'] as $vat_id)
4634 $this->genSetData->set(
'shop_enabled', 0,
'common');
4643 $this->tpl->setContent($this->form->getHtml());
4650 $this->tpl->setContent($this->form->getHtml());
4656 if($a_type ==
'edit')
4658 $this->ctrl->setParameter($this,
'vat_id', $_GET[
'vat_id']);
4659 $this->form->setFormAction($this->ctrl->getFormAction($this,
'updateVat'));
4660 $this->form->setTitle($this->lng->txt(
'payment_edit_vat'));
4664 $this->form->setFormAction($this->ctrl->getFormAction($this,
'saveVat'));
4665 $this->form->setTitle($this->lng->txt(
'payment_add_vat'));
4668 $oTitle =
new ilTextInputGUI($this->lng->txt(
'title'),
'vat_title');
4670 $oTitle->setSize(40);
4671 $oTitle->setRequired(
true);
4672 $oTitle->setInfo($this->lng->txt(
'payment_vat_title_info'));
4673 $this->form->addItem($oTitle);
4675 $oRate =
new ilTextInputGUI($this->lng->txt(
'vat_rate'),
'vat_rate');
4678 $oRate->setRequired(
true);
4679 $oRate->setInfo($this->lng->txt(
'payment_vat_rate_info'));
4680 $this->form->addItem($oRate);
4682 if($a_type ==
'edit')
4684 $this->form->addCommandButton(
'updateVat', $this->lng->txt(
'save'));
4688 $this->form->addCommandButton(
'saveVat', $this->lng->txt(
'save'));
4691 $this->form->addCommandButton(
'vats', $this->lng->txt(
'cancel'));
4696 $oVAT =
new ilShopVats((
int)$_GET[
'vat_id']);
4697 $this->form->setValuesByArray(array(
4698 'vat_title' => $oVAT->getTitle(),
4699 'vat_rate' => $oVAT->getRate()
4706 if(!$this->form->checkInput())
4708 $this->form->setValuesByPost();
4709 $this->tpl->setContent($this->form->getHtml());
4715 $this->form->getItemByPostVar(
'vat_rate')->setAlert($this->lng->txt(
'payment_vat_input_invalid'));
4716 $this->form->setValuesByPost();
4717 $this->tpl->setContent($this->form->getHtml());
4723 $oVAT =
new ilShopVats((
int)$_GET[
'vat_id']);
4724 $oVAT->setTitle($this->form->getInput(
'vat_title'));
4725 $oVAT->setRate((
float)str_replace(
',',
'.', $this->form->getInput(
'vat_rate')));
4731 $this->form->setValuesByPost();
4732 $this->tpl->setContent($this->form->getHtml());
4743 if(!$this->form->checkInput())
4745 $this->form->setValuesByPost();
4746 $this->tpl->setContent($this->form->getHtml());
4752 $this->form->getItemByPostVar(
'vat_rate')->setAlert($this->lng->txt(
'payment_vat_input_invalid'));
4753 $this->form->setValuesByPost();
4754 $this->tpl->setContent($this->form->getHtml());
4761 $oVAT->setTitle($this->form->getInput(
'vat_title'));
4762 $oVAT->setRate((
float)str_replace(
',',
'.', $this->form->getInput(
'vat_rate')));
4768 $this->form->setValuesByPost();
4769 $this->tpl->setContent($this->form->getHtml());
4783 include_once
'./Services/Payment/classes/class.ilPayMethods.php';
4789 $del_bookings = $this->booking_obj->deleteAddressesByPaymethod((
int)$pay_method);
4798 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.main_view.html',
'Services/Payment');
4802 foreach($currency_res as $cur)
4805 $f_result[$counter][
'is_default'] = $cur[
'is_default'] == 1 ? $this->lng->txt(
'yes') : $this->lng->txt(
'no');
4807 $f_result[$counter][
'currency_unit'] = $cur[
'unit'];
4808 $f_result[$counter][
'iso_code'] = $cur[
'iso_code'];
4809 $f_result[$counter][
'currency_symbol'] = $cur[
'symbol'];
4810 $f_result[$counter][
'conversion_rate'] = $cur[
'conversion_rate'];
4817 $tbl->setTitle($this->lng->txt(
"currencies"));
4818 $tbl->setId(
'tbl_show_currencies');
4819 $tbl->setRowTemplate(
"tpl.shop_currencies_row.html",
"Services/Payment");
4821 $tbl->addColumn(
' ',
'currency_id',
'1%',
true);
4822 $tbl->addColumn($this->lng->txt(
'is_default'),
'is_default',
'5%');
4823 $tbl->addColumn($this->lng->txt(
'currency_unit'),
'currency_unit',
'10%');
4824 $tbl->addColumn($this->lng->txt(
'iso_code'),
'iso_code',
'20%');
4825 $tbl->addColumn($this->lng->txt(
'currency_symbol'),
'currency_symbol',
'20%');
4826 $tbl->addColumn($this->lng->txt(
'conversion_rate'),
'conversion_rate',
'15%');
4827 $tbl->addColumn(
'',
'options',
'5%');
4829 $this->ctrl->setParameter($this,
'cmd',
'currencies');
4831 $tbl->addMultiCommand(
'updateDefaultCurrency', $this->lng->txt(
'paya_set_default_currency'));
4832 $tbl->addMultiCommand(
"editCurrency",$this->lng->txt(
'edit'));
4833 $tbl->addMultiCommand(
"deleteCurrency", $this->lng->txt(
'delete'));
4835 $tbl->addCommandButton(
'addCurrency',$this->lng->txt(
'add_currency'));
4836 $tbl->setData($f_result);
4837 $this->tpl->setVariable(
'TABLE', $tbl->getHTML());
4842 if(isset($_POST[
'currency_id'] ))
4853 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.main_view.html',
'Services/Payment');
4855 $form->setFormAction($this->ctrl->getFormAction($this));
4856 $form->setTitle($this->lng->txt(
'paya_add_currency'));
4858 $o_Unit =
new ilTextInputGUI($this->lng->txt(
'paya_currency_unit'),
'currency_unit');
4859 $o_Unit->
setValue($_POST[
'currency_unit']);
4860 $o_Unit->setPostVar(
'currency_unit');
4861 $o_Unit->setRequired(
true);
4863 $o_Isocode =
new ilTextInputGUI($this->lng->txt(
'iso_code'),
'iso_code');
4864 $o_Isocode->
setValue($_POST[
'iso_code']);
4865 $o_Isocode->setPostVar(
'iso_code');
4866 $o_Isocode->setRequired(
true);
4868 $o_Symbol =
new ilTextInputGUI($this->lng->txt(
'symbol'),
'symbol');
4869 $o_Symbol->
setValue($_POST[
'symbol']);
4870 $o_Symbol->setPostVar(
'symbol');
4871 $o_Symbol->setRequired(
true);
4873 $o_Conversionrate =
new IlTextInputGUI($this->lng->txt(
'conversion_rate'),
'conversion_rate');
4874 $o_Conversionrate->setValue($_POST[
'conversion_rate']);
4875 $o_Conversionrate->setPostVar(
'conversion_rate');
4876 $o_Conversionrate->setRequired(
true);
4878 $form->addItem($o_Unit);
4879 $form->addItem($o_Isocode);
4880 $form->addItem($o_Symbol);
4881 $form->addItem($o_Conversionrate);
4883 $form->addCommandButton(
'saveCurrency', $this->lng->txt(
'save'));
4884 $form->addCommandButton(
'currencies', $this->lng->txt(
'cancel'));
4886 $this->tpl->setVariable(
'FORM',
$form->getHTML());
4892 $obj_currency->setUnit($_POST[
'currency_unit']);
4893 $obj_currency->setIsoCode($_POST[
'iso_code']);
4894 $obj_currency->setSymbol($_POST[
'symbol']);
4895 $obj_currency->setConversionRate($_POST[
'conversion_rate']);
4896 $obj_currency->addCurrency();
4902 $currency_id = $_POST[
'currency_id'];
4905 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.main_view.html',
'Services/Payment');
4907 $form->setFormAction($this->ctrl->getFormAction($this));
4908 $form->setTitle($this->lng->txt(
'paya_edit_currency'));
4910 $o_Unit =
new ilTextInputGUI($this->lng->txt(
'paya_currency_unit'),
'currency_unit');
4911 $o_Unit->
setValue($obj_currency[$currency_id][
'unit']);
4912 $o_Unit->setPostVar(
'currency_unit');
4913 $o_Unit->setRequired(
true);
4915 $o_Isocode =
new ilTextInputGUI($this->lng->txt(
'iso_code'),
'iso_code');
4916 $o_Isocode->
setValue($obj_currency[$currency_id][
'iso_code']);
4917 $o_Isocode->setPostVar(
'iso_code');
4918 $o_Isocode->setRequired(
true);
4920 $o_Symbol =
new ilTextInputGUI($this->lng->txt(
'symbol'),
'symbol');
4921 $o_Symbol->
setValue($obj_currency[$currency_id][
'symbol']);
4922 $o_Symbol->setPostVar(
'symbol');
4923 $o_Symbol->setRequired(
true);
4925 $o_Conversionrate =
new IlTextInputGUI($this->lng->txt(
'conversion_rate'),
'conversion_rate');
4926 $o_Conversionrate->setValue($obj_currency[$currency_id][
'conversion_rate']);
4927 $o_Conversionrate->setPostVar(
'conversion_rate');
4928 $o_Conversionrate->setRequired(
true);
4931 $o_hidden->setValue($obj_currency[$currency_id][
'currency_id']);
4932 $o_hidden->setPostVar(
'currency_id');
4933 $form->addItem($o_hidden);
4935 $form->addItem($o_Unit);
4936 $form->addItem($o_Isocode);
4937 $form->addItem($o_Symbol);
4938 $form->addItem($o_Conversionrate);
4940 $form->addCommandButton(
'updateCurrency', $this->lng->txt(
'save'));
4941 $form->addCommandButton(
'currencies', $this->lng->txt(
'cancel'));
4943 $this->tpl->setVariable(
'FORM',
$form->getHTML());
4949 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.main_view.html',
'Services/Payment');
4951 $_SESSION[
'currency_id'] = $_POST[
'currency_id'];
4954 $this->ctrl->setParameter($this,
'currency_id',(
int) $_POST[
'currency_id']);
4956 $oConfirmationGUI->setFormAction($this->ctrl->getFormAction($this,
"performDeleteCurrency"));
4958 $oConfirmationGUI->setHeaderText($this->lng->txt(
"paya_sure_delete_selected_currency"));
4959 $oConfirmationGUI->setCancel($this->lng->txt(
"cancel"),
"currencies");
4960 $oConfirmationGUI->setConfirm($this->lng->txt(
"confirm"),
"performDeleteCurrency");
4964 $this->tpl->setVariable(
'CONFIRMATION', $oConfirmationGUI->getHtml());
4970 if(!
$_SESSION[
'currency_id'])
return false;
4973 $obj_currency->deleteCurrency();
4979 if(!$_POST[
'currency_id'])
return false;
4982 $obj_currency->setUnit($_POST[
'currency_unit']);
4983 $obj_currency->setIsoCode($_POST[
'iso_code']);
4984 $obj_currency->setSymbol($_POST[
'symbol']);
4985 $obj_currency->setConversionRate($_POST[
'conversion_rate']);
4987 $obj_currency->updateCurrency();
4998 $ilToolbar->addButton($this->lng->txt(
'edit_page'), $this->ctrl->getLinkTargetByClass(array(
'ilpageobjectgui'),
'edit'));
5000 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.main_view.html',
'Services/Payment');
5008 include_once(
'./Services/Form/classes/class.ilPropertyFormGUI.php');
5010 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.main_view.html',
'Services/Payment');
5011 $this->tpl->addJavaScript(
'Services/Mail/js/ilMailComposeFunctions.js');
5014 $form_gui->setFormAction($this->ctrl->getFormAction($this,
'savebillingmail'));
5015 $form_gui->setTitle($this->lng->txt(
'billing_mail'));
5022 $inp->setRequired(
false);
5027 $chb =
new ilCheckboxInputGUI($this->lng->txt(
'activate_placeholders'),
'use_placeholders');
5031 $form_gui->addItem($inp);
5033 include_once
'Services/Payment/classes/class.ilBillingMailPlaceholdersPropertyGUI.php';
5036 $chb->addSubItem($prop);
5037 $chb->setChecked(
true);
5039 $form_gui->addItem($chb);
5041 $form_gui->addCommandButton(
'saveBillingMail', $this->lng->txt(
'save'));
5042 $this->tpl->setVariable(
'FORM', $form_gui->getHTML());
5049 if($_POST[
'm_message'])
5054 $_POST[
'use_placeholders'] ? $placeholders = 1: $placeholders = 0;
5066 include_once
'Services/COPage/classes/class.ilPageObject.php';
5067 include_once
'Services/COPage/classes/class.ilPageObjectGUI.php';
5075 include_once
'Services/Style/classes/class.ilObjStyleSheet.php';
5080 $page_gui->setIntLinkHelpDefault(
'StructureObject',$a_editor_page_id);
5081 $page_gui->setLinkXML(
'');
5082 $page_gui->setFileDownloadLink($this->ctrl->getLinkTargetByClass(array(
'ilpageobjectgui'),
'downloadFile'));
5083 $page_gui->setFullscreenLink($this->ctrl->getLinkTargetByClass(array(
'ilpageobjectgui'),
'displayMediaFullscreen'));
5084 $page_gui->setSourcecodeDownloadScript($this->ctrl->getLinkTargetByClass(array(
'ilpageobjectgui'),
'download_paragraph'));
5085 $page_gui->setPresentationTitle(
'');
5086 $page_gui->setTemplateOutput(
false);
5087 $page_gui->setHeader(
'');
5088 $page_gui->setEnabledRepositoryObjects(
false);
5089 $page_gui->setEnabledFileLists(
true);
5090 $page_gui->setEnabledPCTabs(
true);
5091 $page_gui->setEnabledMaps(
true);
5092 $page_gui->setEnableEditing(
true);
5094 return $page_gui->showPage();
5101 $ilTabs->clearTargets();
5102 $ilTabs->setBackTarget($this->lng->txt(
'back'), $this->ctrl->getLinkTarget($this,
'documents'),
'_self');
5104 include_once
'Services/COPage/classes/class.ilPageObject.php';
5105 include_once
'Services/COPage/classes/class.ilPageObjectGUI.php';
5106 include_once(
'./Services/Style/classes/class.ilObjStyleSheet.php');
5114 $new_page_object->setParentId(0);
5115 $new_page_object->setId($a_editor_page_id);
5116 $new_page_object->createFromXML();
5119 $this->ctrl->setReturnByClass(
'ilpageobjectgui',
'edit');
5121 $page_gui =
new ilPageObjectGUI(
'shop',self::CONDITIONS_EDITOR_PAGE_ID);
5122 $page_gui->setIntLinkHelpDefault(
'StructureObject', self::CONDITIONS_EDITOR_PAGE_ID);
5123 $page_gui->setTemplateTargetVar(
'ADM_CONTENT');
5124 $page_gui->setLinkXML(
'');
5125 $page_gui->setFileDownloadLink($this->ctrl->getLinkTargetByClass(array(
'ilpageobjectgui'),
'downloadFile'));
5126 $page_gui->setFullscreenLink($this->ctrl->getLinkTargetByClass(array(
'ilpageobjectgui'),
'displayMediaFullscreen'));
5127 $page_gui->setSourcecodeDownloadScript($this->ctrl->getLinkTargetByClass(array(
'ilpageobjectgui'),
'download_paragraph'));
5128 $page_gui->setPresentationTitle(
'');
5129 $page_gui->setTemplateOutput(
false);
5130 $page_gui->setHeader(
'');
5131 $page_gui->setEnabledRepositoryObjects(
false);
5132 $page_gui->setEnabledFileLists(
true);
5133 $page_gui->setEnabledMaps(
true);
5134 $page_gui->setEnabledPCTabs(
true);
5136 return $this->ctrl->forwardCommand($page_gui);
5141 include_once(
'./Services/Form/classes/class.ilPropertyFormGUI.php');
5145 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.main_view.html',
'Services/Payment');
5146 $this->tpl->addJavaScript(
'Services/Mail/js/ilMailComposeFunctions.js');
5149 $form_gui->setFormAction($this->ctrl->getFormAction($this,
'saveInvoiceNumber'));
5150 $form_gui->setTitle($this->lng->txt(
'invoice_number_setting'));
5153 $radio_group =
new ilRadioGroupInputGUI($this->lng->txt(
'invoice_number'),
'ud_invoice_number');
5154 $radio_option_1 =
new ilRadioOption($this->lng->txt(
'ilias_invoice_number'),
'0');
5155 $radio_group->addOption($radio_option_1);
5156 $radio_option_2 =
new ilRadioOption($this->lng->txt(
'userdefined_invoice_number'),
'1');
5157 $radio_group->addOption($radio_option_2);
5158 $radio_group->setRequired(
true);
5159 $radio_group->
setValue($invObj->getUDInvoiceNumberActive(),
'0');
5160 $radio_group->setPostVar(
'ud_invoice_number');
5161 $form_gui->addItem($radio_group);
5164 $cur_num =
new ilNonEditableValueGUI($this->lng->txt(
'incremental_current_value'),
'inc_current_value');
5166 $radio_option_2->addSubItem($cur_num);
5169 $inc_num =
new ilNumberInputGUI($this->lng->txt(
'incremental_start_value'),
'inc_start_value');
5170 $inc_num->
setValue($this->error !=
"" && isset($_POST[
'incremental_start_value'])
5173 $inc_num->setInfo($this->lng->txt(
'incremental_start_value_info'));
5174 $radio_option_2->addSubItem($inc_num);
5177 $sel_reset =
new ilSelectInputGUI($this->lng->txt(
'invoice_number_reset_period'),
'inc_reset_period');
5178 $sel_reset->
setValue($this->error !=
"" && isset($_POST[
'inc_reset_period'])
5179 ? $_POST[
'inc_reset_period']
5180 : $invObj->getIncResetPeriod());
5182 $reset_options = array(
5183 1 => $this->lng->txt(
'yearly'),
5184 2 => $this->lng->txt(
'monthly'));
5185 $sel_reset->setOptions($reset_options);
5187 $radio_option_2->addSubItem($sel_reset);
5190 $inp =
new ilTextAreaInputGUI($this->lng->txt(
'invoice_number_text'),
'invoice_number_text');
5191 $inp->
setValue( $this->error !=
"" && isset($_POST[
'invoice_number_text'])
5196 $inp->setRequired(
false);
5199 $radio_option_2->addSubItem($inp);
5204 $radio_option_2->addSubItem($prop);
5206 $form_gui->addCommandButton(
'saveInvoiceNumber', $this->lng->txt(
'save'));
5207 $this->tpl->setVariable(
'FORM', $form_gui->getHTML());
5213 if($_POST[
'ud_invoice_number'] == 1)
5215 if($_POST[
'inc_start_value'] <= 0 || $_POST[
'inc_start_value'] == NULL)
5217 $this->error = $this->lng->txt(
'start_value_cannot_be_null');
5223 if($_POST[
'invoice_number_text'] !== NULL)
5225 $check_text = $_POST[
'invoice_number_text'];
5227 if(strpos($check_text,
'[INCREMENTAL_NUMBER]') === FALSE)
5229 $this->error = $this->lng->txt(
'invoice_number_must_contain_incremental_number');
5236 if($_POST[
'inc_reset_period'] == 1)
5238 if(strpos($check_text,
'[YEAR]') === FALSE && strpos($check_text,
'[CURRENT_TIMESTAMP]') === FALSE)
5240 $this->error = $this->lng->txt(
'invoice_number_must_contain_year_ct');
5246 else if($_POST[
'inc_reset_period'] == 2)
5248 if((strpos($check_text,
'[YEAR]') === FALSE || strpos($check_text,
'[MONTH]') === FALSE )
5249 && (strpos($check_text,
'[CURRENT_TIMESTAMP]') === FALSE))
5251 $this->error = $this->lng->txt(
'invoice_number_must_contain_year_month_ct');
5268 $invObj->setUDInvoiceNumberActive($_POST[
'ud_invoice_number']);
5269 $invObj->setIncStartValue($_POST[
'inc_start_value']);
5270 $invObj->setIncResetPeriod($_POST[
'inc_reset_period']);
5271 $invObj->setInvoiceNumberText($_POST[
'invoice_number_text']);
5282 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.main_view.html',
'Services/Payment');
5284 $form->setFormAction($this->ctrl->getFormAction($this,
'saveStatutoryRegulations'));
5285 $form->setTitle($this->lng->txt(
'statutory_regulations'));
5286 $form->setTableWidth(
'100%');
5288 $post_gui =
new ilTextAreaInputGUI($this->lng->txt(
'content'),
'statutory_regulations');
5290 $post_gui->setRows(15);
5291 $post_gui->setUseRte(
true);
5292 $post_gui->addPlugin(
'latex');
5293 $post_gui->addButton(
'latex');
5294 $post_gui->addButton(
'pastelatex');
5295 $post_gui->addPlugin(
'ilimgupload');
5296 $post_gui->addButton(
'ilimgupload');
5297 $post_gui->removePlugin(
'advlink');
5299 $post_gui->removePlugin(
'image');
5300 $post_gui->usePurifier(
true);
5301 $post_gui->setRTERootBlockElement(
'');
5302 $post_gui->setRTESupport(
ilObject::_lookupObjId($this->ref_id),
'pays~',
'frm_post',
'tpl.tinymce_frm_post.html',
false,
'3.4.7');
5303 $post_gui->disableButtons(array(
5321 require_once
'Services/Html/classes/class.ilHtmlPurifierFactory.php';
5322 require_once
'Services/RTE/classes/class.ilRTE.php';
5325 $form->addItem($post_gui);
5328 $cb_showShoppingCart =
new ilCheckboxInputGUI($this->lng->txt(
'show_sr_shoppingcart'),
'show_sr_shoppingcart');
5329 $cb_showShoppingCart->
setInfo($this->lng->txt(
'show_sr_shoppingcart_info'));
5330 $cb_showShoppingCart->setValue(1);
5331 $cb_showShoppingCart->setChecked($this->genSetData->get(
'show_sr_shoppingcart'));
5332 $form->addItem($cb_showShoppingCart);
5335 $cb_attachInvoice =
new ilCheckboxInputGUI($this->lng->txt(
'attach_sr_invoice'),
'attach_sr_invoice');
5336 $cb_attachInvoice->
setInfo($this->lng->txt(
'attach_sr_invoice_info'));
5337 $cb_attachInvoice->setValue(1);
5338 $cb_attachInvoice->setChecked($this->genSetData->get(
'attach_sr_invoice'));
5339 $form->addItem($cb_attachInvoice);
5341 $form->addCommandButton(
'saveStatutoryRegulations', $this->lng->txt(
'save'));
5342 $this->tpl->setVariable(
'FORM',
$form->getHTML());
5348 require_once
'Services/RTE/classes/class.ilRTE.php';
5350 if(isset($_POST[
'statutory_regulations']) && $_POST[
'statutory_regulations'] != NULL)
5355 include_once
'Services/MediaObjects/classes/class.ilObjMediaObject.php';
5358 foreach($mediaObjects as $mob)
5360 foreach($myMediaObjects as $myMob)
5374 $this->genSetData->set(
'statutory_regulations', NULL,
'regulations');
5378 include_once
'Services/MediaObjects/classes/class.ilObjMediaObject.php';
5381 foreach($oldMediaObjects as $oldMob)
5384 foreach($curMediaObjects as $curMob)
5386 if($oldMob == $curMob)
5403 $this->genSetData->set(
'show_sr_shoppingcart', isset($_POST[
'show_sr_shoppingcart']) ? 1 : 0,
'regulations');
5404 $this->genSetData->set(
'attach_sr_invoice', isset($_POST[
'attach_sr_invoice']) ? 1 : 0,
'regulations');
5413 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.main_view.html',
'Services/Payment');
5415 $price_id = $_GET[
'price_id']?$_GET[
'price_id']: $_POST[
'price_id'];
5417 $this->ctrl->setParameter($this,
'pobject_id',(
int) $_GET[
'pobject_id']);
5419 include_once
'Services/Form/classes/class.ilPropertyFormGUI.php';
5421 $form->setFormAction($this->ctrl->getFormAction($this));
5427 $form->setTitle($tmp_obj->getTitle());
5431 $form->setTitle($this->lng->txt(
'object_not_found'));
5436 $radio_group->setTitle($this->lng->txt(
'duration'));
5437 $radio_group->setRequired(
true);
5438 $radio_group->setValue($price[
'price_type']);
5439 $radio_group->setPostVar(
'price_type');
5445 $oDuration->
setTitle($this->lng->txt(
'paya_months'));
5446 $oDuration->setSize(
'20%');
5447 $oDuration->
setValue($price[
'duration']);
5448 $oDuration->setPostVar(
'duration_month');
5451 $radio_group->addOption($radio_option_1);
5457 $o_date_from->
setTitle($this->lng->txt(
'cal_from'));
5459 $o_date_from->setPostVar(
'duration_date_from');
5464 $o_date_until->setTitle($this->lng->txt(
'cal_until'));
5466 $o_date_until->setPostVar(
'duration_date_until');
5467 $radio_option_3->addSubItem($o_date_until);
5469 $radio_group->addOption($radio_option_3);
5472 $radio_group->addOption($radio_option_2);
5474 $form->addItem($radio_group);
5477 $oDescription =
new ilTextAreaInputGUI($this->lng->txt(
'description'),
'description');
5479 $oDescription->setCols(35);
5480 $oDescription->setValue($price[
'description']);
5481 $form->addItem($oDescription);
5485 $oPrice->setTitle($this->lng->txt(
'price_a'));
5486 $oPrice->setSize(
'20%');
5487 $oPrice->setRequired(
true);
5488 $oPrice->setValue($price[
'price']);
5489 include_once
'./Services/Payment/classes/class.ilPaymentSettings.php';
5491 $oPrice->setInfo($genSet->get(
'currency_unit'));
5492 $oPrice->setPostVar(
'price');
5493 $oPrice->allowDecimals(
true);
5494 $form->addItem($oPrice);
5497 $oExtension =
new ilCheckboxInputGUI($this->lng->txt(
'extension_price'),
'extension');
5499 $oExtension->
setChecked($price[
'extension']);
5501 $form->addItem($oExtension);
5504 $o_hidden_1->setValue( (
int)$_GET[
'pobject_id']);
5505 $o_hidden_1->setPostVar(
'pobject_id');
5508 $o_hidden_2->setValue( (
int)$_GET[
'price_id']);
5509 $o_hidden_2->setPostVar(
'price_id');
5511 $form->addItem($o_hidden_1);
5512 $form->addItem($o_hidden_2);
5514 $form->addCommandButton(
'updatePrice',$this->lng->txt(
'save'));
5515 $form->addCommandButton(
'editPrices', $this->lng->txt(
'cancel'));
5517 $this->tpl->setVariable(
'FORM',
$form->getHTML());