19 require_once
'./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';
50 $this->user_obj = $ilias->account;
55 #$this->genSetData = $genSet->getAll();
58 $this->
ilObjectGUI($a_data,$a_id,$a_call_by_reference,$a_prepare_output);
60 $this->lng->loadLanguageModule(
'payment');
66 $check = $this->genSetData->get(
'currency_unit');
73 $check = $this->genSetData->get(
'address');
80 $check = $this->genSetData->get(
'bank_data');
87 $check = $this->genSetData->get(
'pdf_path');
95 $pm_array = ilPaymethods::_getActivePaymethods();
97 if(count($pm_array) == 0)
103 foreach($pm_array as $paymethod)
105 switch($paymethod[
'pm_title'])
108 $check = unserialize($this->genSetData->get(
'bmf'));
109 if ($check[
'mandantNr'] ==
'' ||
110 $check[
'bewirtschafterNr'] ==
'' ||
111 $check[
'haushaltsstelle'] ==
'' ||
112 $check[
'objektNr'] ==
'' ||
113 $check[
'kennzeichenMahnverfahren'] ==
'' ||
114 $check[
'waehrungskennzeichen'] ==
'' ||
115 $check[
'ePaymentServer'] ==
'' ||
116 $check[
'clientCertificate'] ==
'' ||
117 $check[
'caCertificate'] ==
'' ||
118 $check[
'timeOut'] ==
'')
125 $check = unserialize($this->genSetData->get(
'paypal'));
126 if ($check[
'server_host'] ==
'' ||
127 $check[
'server_path'] ==
'' ||
128 $check[
'vendor'] ==
'' ||
129 $check[
'auth_token'] ==
'')
136 $check = unserialize($this->genSetData->get(
'epay'));
137 if ($check[
'server_host'] ==
'' ||
138 $check[
'server_path'] ==
'' ||
139 $check[
'merchant_number'] ==
'' ||
140 $check[
'auth_token'] ==
'' ||
141 $check[
'auth_email'] ==
'')
152 include_once
'./Services/Payment/classes/class.ilShopVats.php';
154 if(count($check) == 0)
160 $this->
object->initPaymentVendorsObject();
161 $vendors = $this->
object->payment_vendors_obj->getVendors();
163 if(count($vendors) == 0)
178 $next_class = $this->ctrl->getNextClass($this);
179 $cmd = $this->ctrl->getCmd();
187 if(!IS_PAYMENT_ENABLED)
188 $ilToolbar->addButton($this->lng->txt(
'check_shop_activation'),$this->ctrl->getLinkTarget($this,
'checkShopActivation'));
191 $this->
getTabs($this->tabs_gui);
195 case 'ilpermissiongui':
196 include_once(
'Services/AccessControl/classes/class.ilPermissionGUI.php');
198 $ret = $this->ctrl->forwardCommand($perm_gui);
201 case 'ilpageobjectgui':
205 # $ret = $this->forwardToPageObject();
208 $this->tpl->setContent(
$ret);
212 case 'ilshoptopicsgui':
213 include_once
'./Services/Payment/classes/class.ilShopTopicsGUI.php';
215 $ret = $this->ctrl->forwardCommand($topics_gui);
221 $cmd =
'generalSettings';
226 case 'saveGeneralSettings' :
227 case 'generalSettings' :
228 $this->tabs_gui->setTabActive(
'settings');
229 $this->
getSubTabs(
'settings',
'generalSettings');
232 case 'savePayMethods':
233 $this->tabs_gui->setTabActive(
'pay_methods');
234 $this->
getSubTabs(
'payMethods',
'payMethods');
236 case 'saveBmfSettings' :
237 case 'bmfSettings' : $this->tabs_gui->setTabActive(
'pay_methods');
238 $this->
getSubTabs(
'payMethods',
'bmfSettings');
240 case 'savePaypalSettings' :
241 case 'paypalSettings' :
242 $this->tabs_gui->setTabActive(
'pay_methods');
243 $this->
getSubTabs(
'payMethods',
'paypalSettings');
245 case 'saveEPaySettings' :
246 case 'epaySettings' :
247 $this->tabs_gui->setTabActive(
'pay_methods');
248 $this->
getSubTabs(
'payMethods',
'epaySettings');
250 case 'saveERPsettings' :
251 case 'delERPpreview':
252 case 'testERPsettings' :
254 $this->tabs_gui->setTabActive(
'payMethods');
255 $this->
getSubTabs(
'payMethods',
'erpSettings');
262 case 'performDeleteVat':
263 case 'confirmDeleteVat':
267 case 'vats' : $this->tabs_gui->setTabActive(
'vats');
271 #TODO: CURRENCY not finished yet
274 # case 'performDeleteCurrency':
275 case 'updateCurrency':
276 # if($_POST['action'] == 'editCurrency' || $_POST['action'] == 'deleteCurrency')
277 # $cmd = $_POST['action'];
278 $this->tabs_gui->setTabActive(
'currencies');
281 case 'TermsConditions':
283 $this->active_sub_tab =
'terms_conditions';
284 $this->tabs_gui->setTabActive(
'documents');
285 $this->
getSubTabs(
'documents',
'terms_conditions');
287 $cmd =
'TermsConditions';
290 case 'saveBillingMail':
291 $this->active_sub_tab =
'billing_mail';
292 $this->tabs_gui->setTabActive(
'documents');
293 $this->
getSubTabs(
'documents',
'billing_mail');
295 # $cmd = 'BillingMail';
297 case 'InvoiceNumber':
298 case 'saveInvoiceNumber':
299 $this->active_sub_tab =
'invoice_number';
300 $this->tabs_gui->setTabActive(
'documents');
301 $this->
getSubTabs(
'documents',
'invoice_number');
303 #$cmd = 'InvoiceNumber';
305 case 'checkShopActivation':
322 if(!(
int)
$_GET[
'pobject_id'])
325 return $this->showObjects();
327 $this->ctrl->setParameter($this,
'pobject_id', (
int)$_GET[
'pobject_id']);
330 $this->lng->loadLanguageModule(
'content');
332 $ilTabs->clearTargets();
333 $ilTabs->clearSubTabs();
334 $ilTabs->setBackTarget($this->lng->txt(
'back'), $this->ctrl->getLinkTarget($this,
'editDetails'));
337 include_once
'Services/COPage/classes/class.ilPageObject.php';
338 include_once
'Services/COPage/classes/class.ilPageObjectGUI.php';
339 include_once(
'./Services/Style/classes/class.ilObjStyleSheet.php');
347 $new_page_object->setParentId(0);
348 $new_page_object->setId($this->pobject->getPobjectId());
349 $new_page_object->createFromXML();
352 $this->ctrl->setReturnByClass(
'ilpageobjectgui',
'edit');
354 $page_gui =
new ilPageObjectGUI(
'shop', $this->pobject->getPobjectId());
355 $this->ctrl->setParameter($page_gui,
'pobject_id', (
int)$_GET[
'pobject_id']);
357 $page_gui->setTemplateTargetVar(
'ADM_CONTENT');
358 $page_gui->setLinkXML(
'');
359 $page_gui->setFileDownloadLink($this->ctrl->getLinkTargetByClass(array(
'ilpageobjectgui'),
'downloadFile'));
360 $page_gui->setFullscreenLink($this->ctrl->getLinkTargetByClass(array(
'ilpageobjectgui'),
'displayMediaFullscreen'));
361 $page_gui->setSourcecodeDownloadScript($this->ctrl->getLinkTargetByClass(array(
'ilpageobjectgui'),
'download_paragraph'));
362 $page_gui->setPresentationTitle(
'');
363 $page_gui->setTemplateOutput(
false);
364 $page_gui->setHeader(
'');
365 $page_gui->setEnabledRepositoryObjects(
false);
366 $page_gui->setEnabledFileLists(
true);
367 $page_gui->setEnabledMaps(
true);
368 $page_gui->setEnabledPCTabs(
true);
370 return $this->ctrl->forwardCommand($page_gui);
378 if(!$rbacsystem->checkAccess(
'read', $this->object->getRefId()))
380 $this->ilias->raiseError($this->lng->txt(
'msg_no_perm_read'),$this->ilias->error_obj->MESSAGE);
383 include_once
'./Services/Payment/classes/class.ilBMFSettings.php';
400 if (
$_POST[
'mandantNr'] ==
'' ||
401 $_POST[
'bewirtschafterNr'] ==
'' ||
402 $_POST[
'haushaltsstelle'] ==
'' ||
403 $_POST[
'objektNr'] ==
'' ||
404 $_POST[
'kennzeichenMahnverfahren'] ==
'' ||
405 $_POST[
'waehrungskennzeichen'] ==
'' ||
406 $_POST[
'ePaymentServer'] ==
'' ||
407 $_POST[
'clientCertificate'] ==
'' ||
408 $_POST[
'caCertificate'] ==
'' ||
411 $this->error = $this->lng->txt(
'pays_bmf_settings_not_valid');
431 if(!$rbacsystem->checkAccess(
'read', $this->object->getRefId()))
433 $this->ilias->raiseError($this->lng->txt(
'msg_no_perm_read'),$this->ilias->error_obj->MESSAGE);
435 include_once
'./Services/Payment/classes/class.ilBMFSettings.php';
438 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.main_view.html',
'Services/Payment');
443 $form->setFormAction($this->ctrl->getFormAction($this,
'saveBmfSettings'));
444 $form->setTitle($this->lng->txt(
'pays_bmf_settings'));
446 $form->addCommandButton(
'saveBmfSettings',$this->lng->txt(
'save'));
448 $formItem =
new ilTextInputGUI($this->lng->txt(
'pays_bmf_client_id'),
'mandantNr');
449 $formItem->
setValue($bmfSetObj->getClientId());
450 $form->addItem($formItem);
452 $formItem =
new ilTextInputGUI($this->lng->txt(
'pays_bmf_bewirtschafter_nr'),
'bewirtschafterNr');
453 $formItem->
setValue($bmfSetObj->getBewirtschafterNr());
454 $form->addItem($formItem);
456 $formItem =
new ilTextInputGUI($this->lng->txt(
'pays_bmf_haushaltsstelle'),
'haushaltsstelle');
457 $formItem->
setValue($bmfSetObj->getHaushaltsstelle());
458 $form->addItem($formItem);
460 $formItem =
new ilTextInputGUI($this->lng->txt(
'pays_bmf_object_id'),
'objektNr');
461 $formItem->
setValue($bmfSetObj->getObjectId());
462 $form->addItem($formItem);
464 $formItem =
new ilTextInputGUI($this->lng->txt(
'pays_bmf_kennzeichen_mahnverfahren'),
'kennzeichenMahnverfahren');
465 $formItem->
setValue($bmfSetObj->getKennzeichenMahnverfahren());
466 $form->addItem($formItem);
468 $formItem =
new ilTextInputGUI($this->lng->txt(
'pays_bmf_waehrungskennzeichen'),
'waehrungskennzeichen');
469 $formItem->
setValue($bmfSetObj->getWaehrungsKennzeichen());
470 $form->addItem($formItem);
472 $formItem =
new ilTextInputGUI($this->lng->txt(
'pays_bmf_epayment_server'),
'ePaymentServer');
473 $formItem->
setValue($bmfSetObj->getEpaymentServer());
474 $form->addItem($formItem);
476 $formItem =
new ilTextInputGUI($this->lng->txt(
'pays_bmf_client_certificate'),
'clientCertificate');
477 $formItem->
setValue($bmfSetObj->getClientCertificate());
478 $form->addItem($formItem);
480 $formItem =
new ilTextInputGUI($this->lng->txt(
'pays_bmf_ca_certificate'),
'caCertificate');
481 $formItem->
setValue($bmfSetObj->getCaCertificate());
482 $form->addItem($formItem);
484 $formItem =
new ilTextInputGUI($this->lng->txt(
'pays_bmf_timeout'),
'timeOut');
485 $formItem->
setValue($bmfSetObj->getTimeOut());
486 $form->addItem($formItem);
488 $this->tpl->setVariable(
'FORM',$form->getHTML());
494 if(!
$_GET[
'pobject_id'])
498 $this->objectObjects();
503 $this->ctrl->setParameter($this,
'pobject_id',(
int) $_GET[
'pobject_id']);
506 $old_pay_method = $this->pobject->getPayMethod();
507 $old_status = $this->pobject->getStatus();
508 $old_vat_id = $this->pobject->getVatId();
511 if($old_status == $this->pobject->STATUS_NOT_BUYABLE and
512 (
int)
$_POST[
'status'] != $old_status)
515 switch((
int)
$_POST[
'pay_method'])
517 case $this->pobject->PAY_METHOD_NOT_SPECIFIED:
527 $standard_prices = array();
528 $extension_prices = array();
529 $standard_prices = $prices_obj->getPrices();
530 $extension_prices = $prices_obj->getExtensionPrices();
532 $prices = array_merge($standard_prices, $extension_prices );
534 if(!count($prices_obj->getPrices()))
544 $this->pobject->setStatus((
int)
$_POST[
'status']);
545 $this->pobject->setVendorId((
int) $_POST[
'vendor']);
546 $this->pobject->setPayMethod((
int) $_POST[
'pay_method']);
547 $this->pobject->setTopicId((
int) $_POST[
'topic_id']);
548 $this->pobject->setVatId((
int) $_POST[
'vat_id']);
550 $this->pobject->update();
562 if($a_show_delete ==
false) unset(
$_SESSION[
'price_ids']);
566 if(!
$_GET[
'pobject_id'])
573 $this->ctrl->setParameter($this,
'pobject_id',(
int)
$_GET[
'pobject_id']);
575 $ilToolbar->addButton($this->lng->txt(
'back'), $this->ctrl->getLinkTarget($this,
'objects'));
576 $ilToolbar->addButton($this->lng->txt(
'paya_edit_details'), $this->ctrl->getLinkTarget($this,
'editDetails'));
577 $ilToolbar->addButton($this->lng->txt(
'paya_edit_prices'), $this->ctrl->getLinkTarget($this,
'editPrices'));
581 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.main_view.html',
'Services/Payment');
584 $standard_prices = array();
585 $extension_prices = array();
586 $standard_prices = $price_obj->getPrices();
587 $extension_prices = $price_obj->getExtensionPrices();
589 $prices = array_merge($standard_prices, $extension_prices );
596 $ilToolbar->addButton($this->lng->txt(
'paya_add_price'), $this->ctrl->getLinkTarget($this,
'addPrice'));
606 $oConfirmationGUI->setFormAction($this->ctrl->getFormAction($this,
"performDeletePrice"));
607 $oConfirmationGUI->setHeaderText($this->lng->txt(
"paya_sure_delete_selected_prices"));
608 $oConfirmationGUI->setCancel($this->lng->txt(
"cancel"),
"editPrices");
609 $oConfirmationGUI->setConfirm($this->lng->txt(
"confirm"),
"performDeletePrice");
611 foreach($prices as $price)
616 if(in_array($price[
'price_id'],
$_SESSION[
'price_ids']))
618 if ($price[
'unlimited_duration'] ==
'1')
620 $tmp_price = $this->lng->txt(
'unlimited_duration');
624 $tmp_price = $price[
'duration'].
' '.$this->lng->txt(
'paya_months');
626 $delete_row =
''.$tmp_price.
' '.
628 $this->genSetData[
'currency_unit'];
631 $oConfirmationGUI->addItem(
'',$delete_row, $delete_row);
635 $this->tpl->setVariable(
'CONFIRMATION', $oConfirmationGUI->getHTML());
644 $tpl->setCurrentBlock(
'tbl_form_header');
646 $tpl->setVariable(
'FORMACTION',$this->ctrl->getFormAction($this));
647 $tpl->parseCurrentBlock();
650 foreach($prices as $price)
653 if($a_show_delete ==
true )
655 $this->ctrl->setParameter($this,
'show_delete',
'true');
657 if(in_array($price[
'price_id'],
$_SESSION[
'price_ids']))
660 $data[$counter][
'price_id'] =
'';
661 $data[$counter][
'duration'] =$price[
'duration'] ;
662 $data[$counter][
'month'] = $this->lng->txt(
'paya_months');
664 $data[$counter][
'unlimited_duration'] = ilUtil::formCheckBox($price[
'unlimited_duration'] ? 1 : 0,
665 'duration_ids[]', (
int)$price[
'price_id']);
669 $data[$counter][
'currency_unit'] = $this->genSetData[
'currency_unit'];
674 $data[$counter][
'price_id'] = ilUtil::formCheckBox(in_array($price[
'price_id'],
$_SESSION[
'price_ids']) ? 1 : 0,
675 'price_ids[]', $price[
'price_id']);
677 $data[$counter][
'duration'] =
ilUtil::formInput(
'prices['.$price[
'price_id'].
'][duration]',$price[
'duration']);
678 $data[$counter][
'month'] = $this->lng->txt(
'paya_months');
680 $data[$counter][
'unlimited_duration'] = ilUtil::formCheckBox($price[
'unlimited_duration'] ? 1 : 0,
681 'duration_ids[]', (
int)$price[
'price_id']);
684 # $data[$counter]['currency_unit'] = $currency['unit']; #
685 $data[$counter][
'currency_unit'] = $this->genSetData->get(
'currency_unit');
686 $data[$counter][
'extension'] = ilUtil::formCheckBox($price[
'extension'] ? 1 : 0,
687 'extension_ids[]', (
int)$price[
'price_id']);
700 $this->ctrl->setParameter($this,
'cmd',
'editprices');
706 $tbl->setTitle($tmp_obj->getTitle());
710 $tbl->setTitle($this->lng->txt(
'object_not_found'));
713 $tbl->setId(
'tbl_bookings');
714 $tbl->setRowTemplate(
"tpl.shop_prices_row.html",
"Services/Payment");
716 $tbl->addColumn(
' ',
'price_id',
'5%');
717 $tbl->addColumn($this->lng->txt(
'duration'),
'duration',
'10%');
718 $tbl->addColumn(
'',
'month',
'10%');
719 $tbl->addColumn($this->lng->txt(
'unlimited_duration'),
'unlimitied_duration',
'15%');
720 $tbl->addColumn($this->lng->txt(
'price_a'),
'price',
'10%');
721 $tbl->addColumn($this->lng->txt(
'currency'),
'currency_unit',
'10%');
722 $tbl->addColumn($this->lng->txt(
'extension_price'),
'extension',
'40%');
723 $tbl->setSelectAllCheckbox(
'price_id');
724 $tbl->addCommandButton(
'updatePrice',$this->lng->txt(
'paya_update_price'));
725 $tbl->addCommandButton(
'addPrice',$this->lng->txt(
'paya_add_price'));
727 $tbl->addMultiCommand(
"deletePrice", $this->lng->txt(
"paya_delete_price"));
730 $tbl->setData($a_result_set);
732 $this->tpl->setVariable(
'TABLE', $tbl->getHTML());
741 if(!
$_GET[
'pobject_id'])
745 $this->showObjects();
751 $this->ctrl->setParameter($this,
'pobject_id',(
int)
$_GET[
'pobject_id']);
755 $ilToolbar->addButton($this->lng->txt(
'paya_edit_details'), $this->ctrl->getLinkTarget($this,
'editDetails'));
756 $ilToolbar->addButton($this->lng->txt(
'paya_edit_prices'), $this->ctrl->getLinkTarget($this,
'editPrices'));
759 if(is_object($tmp_obj))
761 $tmp_object[
'title'] = $tmp_obj->getTitle();
765 $tmp_object[
'title'] = $this->lng->txt(
'object_not_found');
767 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.main_view.html',
'Services/Payment');
770 $form->setFormAction($this->ctrl->getFormAction($this));
771 $form->setTitle($this->lng->txt(
'paya_add_price_title'));
776 $oTitle->
setValue($tmp_object[
'title']);
777 $form->addItem($oTitle);
781 $oDuration->setTitle($this->lng->txt(
'duration'));
782 $oDuration->setValue(
$_POST[
'duration']);
783 $oDuration->setInfo($this->lng->txt(
'paya_months'));
784 $oDuration->setPostVar(
'duration');
785 $form->addItem($oDuration);
788 $oUnlimitedDuration =
new ilCheckboxInputGUI($this->lng->txt(
'unlimited_duration'),
'unlimited_duration');
790 $form->addItem($oUnlimitedDuration);
794 $oPrice->setTitle($this->lng->txt(
'price_a'));
795 $oPrice->setValue(
$_POST[
'price']);
796 $oPrice->setPostVar(
'price');
797 $oPrice->setRequired(
true);
798 $form->addItem($oPrice);
803 #TODO: CURRENCY not finished yet
819 $currency_options = $genSet->get(
'currency_unit');
821 $oCurrency->
setValue($currency_options);
822 $form->addItem($oCurrency);
826 $oExtension =
new ilCheckboxInputGUI($this->lng->txt(
'extension_price'),
'extension');
829 $form->addItem($oExtension);
831 $form->addCommandButton(
'performAddPrice',$this->lng->txt(
'paya_add_price'));
832 $form->addCommandButton(
'editPrices', $this->lng->txt(
'cancel'));
833 $this->tpl->setVariable(
'FORM',$form->getHTML());
840 if(!
$_GET[
'pobject_id'])
852 $prices->setUnlimitedDuration((
int)
$_POST[
'unlimited_duration']);
854 if($_POST[
'unlimited_duration'] ==
'1')
856 $prices->setUnlimitedDuration(1);
859 $prices->setDuration($_POST[
'duration']);
860 $prices->setPrice($_POST[
'price']);
861 $prices->setCurrency($currency[
'currency_id']);
862 $prices->setExtension($_POST[
'extension']);
863 if(!$prices->validate())
880 if(!
$_GET[
'pobject_id'])
898 foreach(
$_SESSION[
'price_ids'] as $price_id)
900 if($prices->delete($price_id))
906 if(!count($prices->getPrices()))
910 $this->pobject->setStatus($this->pobject->STATUS_NOT_BUYABLE);
911 $this->pobject->update();
923 if(!
$_GET[
'pobject_id'])
931 if(!count(
$_POST[
'price_ids']))
946 if(!
$_GET[
'pobject_id'])
955 $this->ctrl->setParameter($this,
'pobject_id',(
int) $_GET[
'pobject_id']);
958 foreach(
$_POST[
'prices'] as $price_id => $price)
960 $old_price = $po->getPrice($price_id);
962 $po->setDuration($price[
'duration']);
963 $po->setPrice($price[
'price']);
964 $po->setCurrency($old_price[
'currency']);
965 $po->setExtension($price[
'extension']);
981 foreach(
$_POST[
'prices'] as $price_id => $price)
983 $old_price = $po->getPrice($price_id);
985 if(isset(
$_POST[
'duration_ids']))
987 $search = in_array((
string)$price_id,
$_POST[
'duration_ids']);
989 if(
$_POST[
'duration_ids'] == NULL)
991 $po->setUnlimitedDuration(0);
992 $po->setDuration($price[
'duration']);
995 else if( $search = in_array((
string)$price_id,
$_POST[
'duration_ids']))
997 $po->setUnlimitedDuration(1);
1002 $po->setUnlimitedDuration(0);
1005 if(isset(
$_POST[
'extension_ids']))
1007 $search = in_array((
string)$price_id,
$_POST[
'extension_ids']);
1009 if( $search = in_array((
string)$price_id,
$_POST[
'extension_ids']))
1011 $po->setExtension(1);
1015 $po->setExtension(0);
1020 $po->setDuration($price[
'duration']);
1021 $po->setPrice($price[
'price']);
1022 $po->setCurrency($old_price[
'currency']);
1024 $po->update($price_id);
1036 if(!(
int)
$_GET[
'pobject_id'])
1039 return $this->showObjects();
1044 $this->ctrl->setParameter($this,
'pobject_id', (
int)$_GET[
'pobject_id']);
1050 # $ilToolbar->addButton($this->lng->txt('pay_edit_abstract'), $this->ctrl->getLinkTargetByClass(array('ilpageobjectgui'), 'edit'));
1052 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.main_view.html',
'Services/Payment');
1058 $oConfirmationGUI->setFormAction($this->ctrl->getFormAction($this,
"performDelete"));
1059 $oConfirmationGUI->setHeaderText($this->lng->txt(
"paya_sure_delete_stat"));
1060 $oConfirmationGUI->setCancel($this->lng->txt(
"cancel"),
"editDetails");
1061 $oConfirmationGUI->setConfirm($this->lng->txt(
"confirm"),
"performDelete");
1063 $this->tpl->setVariable(
'CONFIRMATION', $oConfirmationGUI->getHTML());
1068 $ilToolbar->addButton($this->lng->txt(
'paya_edit_details'), $this->ctrl->getLinkTarget($this,
'editDetails'));
1069 $ilToolbar->addButton($this->lng->txt(
'paya_edit_prices'), $this->ctrl->getLinkTarget($this,
'editPrices'));
1075 $tmp_object[
'title'] = $tmp_obj->getTitle();
1076 $tmp_object[
'type'] = $tmp_obj->getType();
1080 $tmp_object[
'title'] = $this->lng->txt(
'object_not_found');
1081 $tmp_object[
'type'] =
'';
1086 $oForm->setFormAction($this->ctrl->getFormAction($this,
'updateDetails'));
1087 $oForm->setTitle($tmp_object[
'title']);
1093 $oForm->addItem($oPathGUI);
1098 $oForm->addItem($oPurchasersGUI);
1101 $oVendorsGUI =
new ilSelectInputGUI($this->lng->txt(
'paya_vendor'),
'vendor');
1103 $oVendorsGUI->setValue($this->pobject->getVendorId());
1104 $oForm->addItem($oVendorsGUI);
1109 $oStatusGUI->setValue($this->pobject->getStatus());
1110 $oForm->addItem($oStatusGUI);
1113 $oPayMethodsGUI =
new ilSelectInputGUI($this->lng->txt(
'paya_pay_method'),
'pay_method');
1116 $oPayMethodsGUI->setValue($this->pobject->getPayMethod());
1117 $oForm->addItem($oPayMethodsGUI);
1120 include_once
'./Services/Payment/classes/class.ilShopTopics.php';
1127 $topic_options = array();
1128 $topic_options[
''] = $this->lng->txt(
'please_choose');
1130 foreach($topics as $oTopic)
1132 $topic_options[$oTopic->getId()] = $oTopic->getTitle();
1135 $oTopicsGUI->setOptions($topic_options);
1136 $oTopicsGUI->setValue($this->pobject->getTopicId());
1137 $oForm->addItem($oTopicsGUI);
1142 $oShopVatsList->read();
1143 if($oShopVatsList->hasItems())
1147 $vats_options = array();
1148 foreach($oShopVatsList as $oVAT)
1153 $oVatsGUI->setOptions($vats_options);
1154 $oVatsGUI->setValue($this->pobject->getVatId());
1155 $oForm->addItem($oVatsGUI);
1160 $oVatsGUI->
setValue($this->lng->txt(
'paya_no_vats_assigned'));
1161 $oForm->addItem($oVatsGUI);
1166 if(($webpath_file = $oFile->getCurrentImageWebPath()) !==
false)
1168 $oThumbnail->setImage($webpath_file);
1170 $oForm->addItem($oThumbnail);
1173 $oForm->addCommandButton(
'updateDetails', $this->lng->txt(
'save'));
1174 $oForm->addCommandButton(
'deleteObject', $this->lng->txt(
'delete'));
1176 $this->tpl->setVariable(
'FORM', $oForm->getHTML());
1184 if(!
$_GET[
'pobject_id'])
1210 if(!
$_GET[
'pobject_id'])
1220 $this->pobject->delete();
1224 $price_obj->deleteAllPrices();
1238 $path = $tree->getPathFull($a_ref_id);
1246 $html .= $data[
'title'].
' > ';
1249 return substr($html,0,-2);
1254 include_once
'Services/Payment/classes/class.ilPaymentVendors.php';
1260 $all_vendors = $vendor_obj->getVendors();
1261 if (is_array($all_vendors))
1263 foreach ($all_vendors as
$vendor)
1265 $vendors[] = $vendor[
'vendor_id'];
1272 $options[
$vendor] = $tmp_obj->getFullname().
' ['.$tmp_obj->getLogin().
']';
1280 $option[$this->pobject->STATUS_NOT_BUYABLE] = $this->lng->txt(
'paya_not_buyable');
1281 $option[$this->pobject->STATUS_BUYABLE] = $this->lng->txt(
'paya_buyable');
1282 $option[$this->pobject->STATUS_EXPIRES] = $this->lng->txt(
'paya_expires');
1290 unset(
$_POST[
'title_type']);
1291 unset(
$_POST[
'title_value']);
1293 unset(
$_POST[
'pay_method']);
1305 if(!$rbacsystem->checkAccess(
'read', $this->object->getRefId()))
1307 $this->ilias->raiseError($this->lng->txt(
'msg_no_perm_read'),$this->ilias->error_obj->MESSAGE);
1310 if (
$_POST[
'updateView'] == 1)
1318 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.main_view.html',
'Services/Payment');
1321 $this->lng->loadLanguageModule(
'search');
1324 $filter_form->setFormAction($this->ctrl->getFormAction($this));
1325 $filter_form->setTitle($this->lng->txt(
'pay_filter'));
1326 $filter_form->setId(
'filter_form');
1327 $filter_form->setTableWidth(
'100 %');
1330 $o_hide_check =
new ilCheckBoxInputGUI($this->lng->txt(
'show_filter'),
'show_filter');
1331 $o_hide_check->setValue(1);
1332 $o_hide_check->setChecked(
$_POST[
'show_filter'] ? 1 : 0);
1335 $o_hidden->setValue(1);
1336 $o_hidden->setPostVar(
'updateView');
1337 $o_hide_check->addSubItem($o_hidden);
1341 $radio_option =
new ilRadioOption($this->lng->txt(
'search_any_word'),
'or');
1342 $radio_group->addOption($radio_option);
1343 $radio_option =
new ilRadioOption($this->lng->txt(
'search_all_words'),
'and');
1344 $radio_group->addOption($radio_option);
1346 $radio_group->setRequired(
false);
1348 $radio_group->setPostVar(
'title_type');
1351 $o_title->setValue(
$_SESSION[
'pay_objects'][
'title_value']);
1352 $o_title->setPostVar(
'title_value');
1353 $o_title->setTitle($this->lng->txt(
'title'));
1355 $o_hide_check->addSubItem($radio_group);
1356 $o_hide_check->addSubItem($o_title);
1360 $o_vendor->setTitle($this->lng->txt(
'paya_vendor'));
1361 $o_vendor->setValue(
$_SESSION[
'pay_objects'][
'vendor']);
1362 $o_vendor->setPostVar(
'vendor');
1363 $o_hide_check->addSubItem($o_vendor);
1367 $o_paymethod->setTitle($this->lng->txt(
'payment_system'));
1368 $o_paymethod->setOptions(ilPaymethods::getPayMethodsOptions(
'all'));
1369 $o_paymethod->setValue(
$_SESSION[
'pay_objects'][
'pay_method']);
1370 $o_paymethod->setPostVar(
'pay_method');
1371 $o_hide_check->addSubItem($o_paymethod);
1373 $filter_form->addCommandButton(
'objects', $this->lng->txt(
'pay_update_view'));
1374 $filter_form->addCommandButton(
'resetObjectFilter', $this->lng->txt(
'pay_reset_filter'));
1376 $filter_form->addItem($o_hide_check);
1383 $this->tpl->setVariable(
'FORM', $filter_form->getHTML());
1386 foreach($objects as
$data)
1391 $f_result[$counter][
'title'] = $tmp_obj->getTitle();
1395 $f_result[$counter][
'title'] = $this->lng->txt(
'object_not_found');
1398 switch($data[
'status'])
1400 case $this->pobject->STATUS_BUYABLE:
1401 $f_result[$counter][
'status'] = $this->lng->txt(
'paya_buyable');
1404 case $this->pobject->STATUS_NOT_BUYABLE:
1405 $f_result[$counter][
'status'] = $this->lng->txt(
'paya_not_buyable');
1408 case $this->pobject->STATUS_EXPIRES:
1409 $f_result[$counter][
'status'] = $this->lng->txt(
'paya_expires');
1413 include_once
'./Services/Payment/classes/class.ilPayMethods.php';
1415 $f_result[$counter][
'pay_method'] = $str_paymethod;
1417 if($data[
'vat_id'] <= 0)
1419 $vat_rate = $this->lng->txt(
'payment_vat_has_to_be_defined_by_administration_short');
1425 $oVAT =
new ilShopVats((
int)$data[
'vat_id']);
1430 $vat_rate = $this->lng->txt(
'payment_vat_has_to_be_defined_by_administration_short');
1434 $f_result[$counter][
'vat_rate'] = $vat_rate;
1439 $f_result[$counter][
'vendor'] = $tmp_user->getFullname().
' ['.$tmp_user->getLogin().
']';
1443 $f_result[$counter][
'vendor'] = $this->lng->txt(
'user_not_found');
1450 $this->ctrl->setParameter($this,
'pobject_id',$data[
'pobject_id']);
1451 $link_change =
"<div class=\"il_ContainerItemCommands\"><a class=\"il_ContainerItemCommand\" href=\"".$this->ctrl->getLinkTarget($this,
"editDetails").
"\">".$this->lng->txt(
"edit").
"</a></div>";
1453 $f_result[$counter][
'options'] = $link_change;
1467 $this->ctrl->setParameter($this,
'cmd',
'objects');
1470 $tbl->setTitle($this->lng->txt(
'objects'));
1472 $tbl->setId(
'tbl_show_objects');
1473 $tbl->setRowTemplate(
"tpl.shop_objects_row.html",
"Services/Payment");
1475 $tbl->addColumn($this->lng->txt(
'title'),
'title',
'10%');
1476 $tbl->addColumn($this->lng->txt(
'status'),
'status',
'10%');
1477 $tbl->addColumn($this->lng->txt(
'paya_pay_method'),
'pay_method',
'10%');
1478 $tbl->addColumn($this->lng->txt(
'vat_rate'),
'vat_rate',
'15%');
1479 $tbl->addColumn($this->lng->txt(
'paya_vendor'),
'vendor',
'10%');
1480 $tbl->addColumn($this->lng->txt(
'paya_count_purchaser'),
'purchasers',
'10%');
1481 $tbl->addColumn(
'',
'options',
'10%');
1483 $tbl->setData($a_result_set);
1485 $this->tpl->setVariable(
'TABLE', $tbl->getHTML());
1500 case 'deleteVendorsObject':
1501 $this->deleteVendors();
1504 case 'editVendorObject':
1505 $this->editVendor();
1508 case 'performEditVendorObject':
1522 unset(
$_POST[
'transaction_type']);
1523 unset(
$_POST[
'transaction_value']);
1528 unset(
$_POST[
'customer']);
1529 unset(
$_POST[
'pay_method']);
1530 unset(
$_POST[
'updateView']);
1531 unset(
$_POST[
"adm_filter_title_id"]);
1539 global $rbacsystem, $ilToolbar,$ilObjDataCache;
1541 include_once
'./Services/Payment/classes/class.ilPayMethods.php';
1544 if(!$rbacsystem->checkAccess(
'read', $this->object->getRefId()))
1546 $this->ilias->raiseError($this->lng->txt(
'msg_no_perm_read'),$this->ilias->error_obj->MESSAGE);
1549 $ilToolbar->addButton($this->lng->txt(
'paya_add_customer'), $this->ctrl->getLinkTarget($this,
'showObjectSelector'));
1551 if (
$_POST[
'updateView'] == 1)
1554 $_SESSION[
'pay_statistics'][
'updateView'] =
true;
1557 $_SESSION[
'pay_statistics'][
'transaction_type'] = isset(
$_POST[
'transaction_type']) ?
$_POST[
'transaction_type'] :
'' ;
1558 $_SESSION[
'pay_statistics'][
'transaction_value'] = isset(
$_POST[
'transaction_value']) ?
$_POST[
'transaction_value'] :
'';
1559 $_SESSION[
'pay_statistics'][
'adm_filter_title_id'] = (int)
$_POST[
'adm_filter_title_id'];
1561 if(
$_SESSION[
'pay_statistics'][
'from_check'] ==
'1')
1563 $_SESSION[
'pay_statistics'][
'from'][
'date'][
'd'] =
$_POST[
'from'][
'date'][
'd'];
1564 $_SESSION[
'pay_statistics'][
'from'][
'date'][
'm'] =
$_POST[
'from'][
'date'][
'm'];
1565 $_SESSION[
'pay_statistics'][
'from'][
'date'][
'y'] =
$_POST[
'from'][
'date'][
'y'];
1569 $_SESSION[
'pay_statistics'][
'from'][
'date'][
'd'] =
'';
1570 $_SESSION[
'pay_statistics'][
'from'][
'date'][
'm'] =
'';
1571 $_SESSION[
'pay_statistics'][
'from'][
'date'][
'y'] =
'';
1574 if(
$_SESSION[
'pay_statistics'][
'until_check']==
'1')
1576 $_SESSION[
'pay_statistics'][
'til'][
'date'][
'd'] =
$_POST[
'til'][
'date'][
'd'];
1577 $_SESSION[
'pay_statistics'][
'til'][
'date'][
'm'] =
$_POST[
'til'][
'date'][
'm'];
1578 $_SESSION[
'pay_statistics'][
'til'][
'date'][
'y'] =
$_POST[
'til'][
'date'][
'y'];
1582 $_SESSION[
'pay_statistics'][
'til'][
'date'][
'd'] =
'';
1583 $_SESSION[
'pay_statistics'][
'til'][
'date'][
'm'] =
'';
1584 $_SESSION[
'pay_statistics'][
'til'][
'date'][
'y'] =
'';
1595 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.main_view.html',
'Services/Payment');
1598 $filter_form->setFormAction($this->ctrl->getFormAction($this));
1599 $filter_form->setTitle($this->lng->txt(
'pay_filter'));
1600 $filter_form->setId(
'formular');
1601 $filter_form->setTableWidth(
'100 %');
1603 $o_hide_check =
new ilCheckBoxInputGUI($this->lng->txt(
'show_filter'),
'show_filter');
1604 $o_hide_check->setValue(1);
1605 $o_hide_check->setChecked(
$_POST[
'show_filter'] ? 1 : 0);
1608 $o_hidden->setValue(1);
1609 $o_hidden->setPostVar(
'updateView');
1610 $o_hide_check->addSubItem($o_hidden);
1613 $trans_option = array($this->lng->txt(
'pay_starting'),$this->lng->txt(
'pay_ending'));
1614 $trans_value = array(
'0',
'1');
1615 $o_transaction_type->setTitle($this->lng->txt(
'paya_transaction'));
1616 $o_transaction_type->setOptions($trans_option);
1617 $o_transaction_type->setValue(
$_SESSION[
'pay_statistics'][
'transaction_type']);
1618 $o_transaction_type->setPostVar(
'transaction_type');
1619 $o_hide_check->addSubItem($o_transaction_type);
1622 $o_transaction_val->setValue(
$_SESSION[
'pay_statistics'][
'transaction_value']);
1623 $o_transaction_val->setPostVar(
'transaction_value');
1624 $o_hide_check->addSubItem($o_transaction_val);
1627 $o_customer->setTitle($this->lng->txt(
'paya_customer'));
1628 $o_customer->setValue(
$_SESSION[
'pay_statistics'][
'customer']);
1629 $o_customer->setPostVar(
'customer');
1630 $o_hide_check->addSubItem($o_customer);
1633 $o_vendor->setTitle($this->lng->txt(
'paya_vendor'));
1634 $o_vendor->setValue(
$_SESSION[
'pay_statistics'][
'vendor']);
1635 $o_vendor->setPostVar(
'vendor');
1636 $o_hide_check->addSubItem($o_vendor);
1638 $o_from_check =
new ilCheckBoxInputGUI($this->lng->txt(
'pay_order_date_from'),
'from_check');
1639 $o_from_check->setValue(1);
1640 $o_from_check->setChecked(
$_SESSION[
'pay_statistics'][
'from_check'] ? 1 : 0);
1643 $o_date_from->setPostVar(
'from');
1645 if(
$_SESSION[
'pay_statistics'][
'from_check'] ==
'1')
1647 $o_date_from->setValueByArray(
$_SESSION[
'pay_statistics'][
'from']);
1648 $o_date_from->checkInput();
1651 $o_from_check->addSubItem($o_date_from);
1652 $o_hide_check->addSubItem($o_from_check);
1654 $o_until_check =
new ilCheckBoxInputGUI($this->lng->txt(
'pay_order_date_til'),
'until_check');
1655 $o_until_check->setValue(1);
1656 $o_until_check->setChecked(
$_SESSION[
'pay_statistics'][
'until_check'] ? 1 : 0);
1659 $o_date_until->setPostVar(
'til');
1661 if(
$_SESSION[
'pay_statistics'][
'until_check'] ==
'1')
1663 $o_date_until->setValueByArray(
$_SESSION[
'pay_statistics'][
'til']);
1664 $o_date_until->checkInput();
1667 $o_until_check->addSubItem($o_date_until);
1668 $o_hide_check->addSubItem($o_until_check);
1672 $title_options[
'all']=$this->lng->txt(
'pay_all');
1673 $unique_titles = $this->booking_obj->getUniqueTitles();
1675 if(is_array($unique_titles) && count($unique_titles))
1677 foreach($unique_titles as
$ref_id)
1679 $title_options[
$ref_id] = $ilObjDataCache->lookupTitle($ilObjDataCache->lookupObjId($ref_id));
1684 $o_object_title->setTitle($this->lng->txt(
'title'));
1685 $o_object_title->setOptions($title_options);
1686 $o_object_title->setValue(
$_SESSION[
"pay_statistics"][
"adm_filter_title_id"]);
1687 $o_object_title->setPostVar(
'adm_filter_title_id');
1688 $o_hide_check->addSubItem($o_object_title);
1691 $payed_option = array(
'all'=>$this->lng->txt(
'pay_all'),
'1'=>$this->lng->txt(
'yes'),
'0'=>$this->lng->txt(
'no'));
1693 $o_payed->setTitle($this->lng->txt(
'paya_payed'));
1694 $o_payed->setOptions($payed_option);
1695 $o_payed->setValue(
$_SESSION[
'pay_statistics'][
'payed']);
1696 $o_payed->setPostVar(
'payed');
1698 $o_hide_check->addSubItem($o_payed);
1701 $access_option = array(
'all'=>$this->lng->txt(
'pay_all'),
'1'=>$this->lng->txt(
'yes'),
'0'=>$this->lng->txt(
'no'));
1703 $o_access->setTitle($this->lng->txt(
'paya_access'));
1704 $o_access->setOptions($access_option);
1705 $o_access->setValue(
$_SESSION[
'pay_statistics'][
'access']);
1706 $o_access->setPostVar(
'access');
1707 $o_hide_check->addSubItem($o_access);
1710 $o_paymethod->setTitle($this->lng->txt(
'payment_system'));
1711 $o_paymethod->setOptions(ilPaymethods::getPayMethodsOptions(
'all'));
1712 $o_paymethod->setValue(
$_SESSION[
'pay_statistics'][
'pay_method']);
1713 $o_paymethod->setPostVar(
'pay_method');
1714 $o_hide_check->addSubItem($o_paymethod);
1716 $filter_form->addCommandButton(
'statistic', $this->lng->txt(
'pay_update_view'));
1717 $filter_form->addCommandButton(
'resetFilter', $this->lng->txt(
'pay_reset_filter'));
1719 $filter_form->addItem($o_hide_check);
1721 $this->tpl->setVariable(
'FORM', $filter_form->getHTML());
1727 if(!count($bookings = $this->booking_obj->getBookings()))
1735 # $this->__showButton('exportVendors',$this->lng->txt('excel_export'));
1737 $img_change =
"<img src=\"".ilUtil::getImagePath(
"edit.gif").
"\" alt=\"".
1738 $this->lng->txt(
"edit").
"\" title=\"".$this->lng->txt(
"edit").
1739 "\" border=\"0\" vspace=\"0\"/>";
1741 include_once
'Services/User/classes/class.ilObjUser.php';
1742 $object_title_cache = array();
1743 $user_title_cache = array();
1746 foreach($bookings as $booking)
1748 if(array_key_exists($booking[
'ref_id'], $object_title_cache))
1750 $tmp_obj = $object_title_cache[$booking[
'ref_id']];
1755 $object_title_cache[$booking[
'ref_id']] = $tmp_obj;
1759 if(array_key_exists($booking[
'b_vendor_id'], $user_title_cache))
1761 $tmp_vendor = $user_title_cache[$booking[
'b_vendor_id']];
1766 $user_title_cache[$booking[
'b_vendor_id']] = $tmp_vendor;
1768 if(array_key_exists($booking[
'customer_id'], $user_title_cache))
1770 $tmp_purchaser = $user_title_cache[$booking[
'customer_id']];
1774 if(ANONYMOUS_USER_ID == $booking[
'customer_id'])
1777 $purchaser_name = $booking[
'name_extern'];
1778 $tmp_purchaser_email = $booking[
'email_extern'];
1784 $purchaser_name = $tmp_purchaser_name[
'firstname'].
' '.$tmp_purchaser_name[
'lastname'];
1787 $user_title_cache[$booking[
'customer_id']] = $tmp_purchaser;
1790 $transaction = $booking[
'transaction_extern'];
1792 $transaction .= $booking[
'transaction'].
"<br> (" . $str_paymethod .
")";
1794 $f_result[$counter][
'transaction'] = $transaction;
1795 $f_result[$counter][
'object_title'] = ($tmp_obj !=
'' ? $tmp_obj : $this->lng->txt(
'object_deleted'));
1796 $f_result[$counter][
'vendor'] = ($tmp_vendor !=
'' ?
'['.$tmp_vendor.
']' : $this->lng->txt(
'user_deleted'));
1797 $f_result[$counter][
'customer'] = ($tmp_purchaser !=
'' ?
1798 $purchaser_name.
' ['.$tmp_purchaser.
']<br>'
1799 .$tmp_purchaser_email
1800 : $this->lng->txt(
'user_deleted'));
1803 if($booking[
'duration'] != 0)
1805 $f_result[$counter][
'duration'] = $booking[
'duration'].
' '.$this->lng->txt(
'paya_months');
1809 $f_result[$counter][
'duration'] = $this->lng->txt(
"unlimited_duration");
1812 $f_result[$counter][
'price'] = $booking[
'price'].
' '.$booking[
'currency_unit'];
1813 $f_result[$counter][
'discount'] = ($booking[
'discount'] !=
'' ? ($booking[
'discount'].
' '.$booking[
'currency_unit']) :
' ');
1815 $payed_access = $booking[
'payed'] ?
1816 $this->lng->txt(
'yes') :
1817 $this->lng->txt(
'no');
1819 $payed_access .=
'/';
1820 $payed_access .= $booking[
'access_granted'] ?
1821 $this->lng->txt(
'yes') :
1822 $this->lng->txt(
'no');
1824 $f_result[$counter][
'payed_access'] = $payed_access;
1826 $this->ctrl->setParameter($this,
"booking_id",$booking[
'booking_id']);
1827 $link_change =
"<div class=\"il_ContainerItemCommands\"><a class=\"il_ContainerItemCommand\" href=\"".$this->ctrl->getLinkTarget($this,
"editStatistic").
"\">".$this->lng->txt(
"edit").
"</a></div>";
1829 $f_result[$counter][
'edit'] = $link_change;
1833 unset($tmp_purchaser);
1844 include_once
'./Services/Payment/classes/class.ilPayMethods.php';
1846 if(!isset(
$_GET[
'booking_id']))
1849 $this->showStatistics();
1854 $ilToolbar->addButton($this->lng->txt(
'back'), $this->ctrl->getLinkTarget($this,
'statistic'));
1856 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.main_view.html',
'Services/Payment');
1857 $this->ctrl->setParameter($this,
'booking_id',(
int)
$_GET[
'booking_id']);
1860 if($a_show_confirm_delete)
1865 $oConfirmationGUI->setFormAction($this->ctrl->getFormAction($this,
"performDelete"));
1866 $oConfirmationGUI->setHeaderText($this->lng->txt(
"paya_sure_delete_stat"));
1867 $oConfirmationGUI->setCancel($this->lng->txt(
"cancel"),
"statistic");
1868 $oConfirmationGUI->setConfirm($this->lng->txt(
"confirm"),
"performDelete");
1870 $this->tpl->setVariable(
'CONFIRMATION', $oConfirmationGUI->getHTML());
1876 $bookings = $this->booking_obj->getBookings();
1877 $booking = $bookings[(int) $_GET[
'booking_id']];
1883 $oForm->setFormAction($this->ctrl->getFormAction($this));
1884 $oForm->setId(
'stat_form');
1885 $oForm->setTableWidth(
'50 %');
1887 if(is_object($tmp_user))
1889 $frm_user = $tmp_user->getFullname().
' ['.$tmp_user->getLogin().
']';
1893 $frm_user = $this->lng->txt(
'user_deleted');
1895 $oForm->setTitle($frm_user);
1902 $oTitleGUI->
setValue($tmp_obj !=
'' ? $tmp_obj : $this->lng->txt(
'object_deleted'));
1903 $oForm->addItem($oTitleGUI);
1907 $oTransactionGUI->
setValue($booking[
'transaction']);
1908 $oForm->addItem($oTransactionGUI);
1913 if(is_object($tmp_vendor))
1915 $frm_vendor = $tmp_vendor->getFullname().
' ['.$tmp_vendor->getLogin().
']';
1919 $frm_vendor = $this->lng->txt(
'user_deleted');
1921 $oVendorGUI->
setValue($frm_vendor);
1922 $oForm->addItem($oVendorGUI);
1927 $oForm->addItem($oPaymethodGUI);
1932 $oForm->addItem($oOrderdateGUI);
1936 if($booking[
'duration'] != 0)
1938 $frm_duration = $booking[
'duration'].
' '.$this->lng->txt(
'paya_months');
1942 $frm_duration = $this->lng->txt(
"unlimited_duration");
1944 $oDurationGUI->
setValue($frm_duration);
1945 $oForm->addItem($oDurationGUI);
1949 $oPriceGUI->
setValue($booking[
'price'].
' '.$booking[
'currency_unit']);
1950 $oForm->addItem($oPriceGUI);
1954 $payed_option = array(0 => $this->lng->txt(
'no'),1 => $this->lng->txt(
'yes'));
1956 $oPayedGUI->setTitle($this->lng->txt(
'paya_payed'));
1957 $oPayedGUI->setOptions($payed_option);
1958 $oPayedGUI->setValue($booking[
'payed']);
1959 $oPayedGUI->setPostVar(
'payed');
1960 $oForm->addItem($oPayedGUI);
1964 $access_option = array(0 => $this->lng->txt(
'no'),1 => $this->lng->txt(
'yes'));
1966 $oAccessGUI->setTitle($this->lng->txt(
'paya_access'));
1967 $oAccessGUI->setOptions($payed_option);
1968 $oAccessGUI->setValue($booking[
'access_granted']);
1969 $oAccessGUI->setPostVar(
'access');
1970 $oForm->addItem($oAccessGUI);
1972 $oForm->addCommandButton(
'updateStatistic',$this->lng->txt(
'save'));
1973 $oForm->addCommandButton(
'deleteStatistic',$this->lng->txt(
'delete'));
1979 $oForm2->setId(
'cust_form');
1980 $oForm2->setTableWidth(
'50 %');
1981 $oForm2->setTitle($frm_user);
1985 $email = (!$tmp_user) ? $this->lng->txt(
'user_deleted') : $tmp_user->getEmail();
1987 $oForm2->addItem($oEmailGUI);
1991 $oStreetGUI->
setValue($booking[
'street']);
1992 $oForm2->addItem($oStreetGUI);
1996 $oPoBoxGUI->
setValue($booking[
'po_box']);
1997 $oForm2->addItem($oPoBoxGUI);
2001 $oPoBoxGUI->
setValue($booking[
'zipcode']);
2002 $oForm2->addItem($oPoBoxGUI);
2006 $oCityGUI->
setValue($booking[
'city']);
2007 $oForm2->addItem($oCityGUI);
2011 $oCountryGUI->
setValue($booking[
'country']);
2012 $oForm2->addItem($oCountryGUI);
2015 $this->tpl->setVariable(
'FORM',$oForm->getHTML());
2016 $this->tpl->setVariable(
'FORM_2',$oForm2->getHTML());
2022 if(!isset(
$_GET[
'booking_id']))
2031 $this->booking_obj->setBookingId((
int)
$_GET[
'booking_id']);
2032 $this->booking_obj->setAccess((
int)
$_POST[
'access']);
2033 $this->booking_obj->setPayed((
int) $_POST[
'payed']);
2035 if($this->booking_obj->update())
2053 if(!isset(
$_GET[
'booking_id']))
2068 if(!isset(
$_GET[
'booking_id']))
2077 $this->booking_obj->setBookingId((
int)
$_GET[
'booking_id']);
2078 if(!$this->booking_obj->delete())
2080 die(
'Error deleting booking');
2098 $tabs_gui->clearTargets();
2099 if ($rbacsystem->checkAccess(
'visible,read',$this->object->getRefId()))
2102 $tabs_gui->addTarget(
'settings', $this->ctrl->getLinkTarget($this,
'generalSettings'),
2103 array(
'saveGeneralSettings',
'generalSettings ',
'saveBmfSettings',
'savePaypalSettings',
'paypalSettings',
2104 'saveEPaySettings',
'epaySettings',
'saveERPsettings',
'delERPpreview',
'',
'testERPsettings',
'erpSettings',
'',
'view'),
'',
'');
2107 $tabs_gui->addTarget(
'bookings', $this->ctrl->getLinkTarget($this,
'statistic'),
2108 array(
'statistic',
'editStatistic',
'updateStatistic',
'deleteStatistic',
'performDelete',
2109 'resetFilter',
'exportVendors',
'addCustomer',
'saveCustomer',
'showObjectSelector',
2110 'searchUserSP',
'performSearchSP'),
'',
'');
2112 $tabs_gui->addTarget(
'objects', $this->ctrl->getLinkTarget($this,
'objects'),
2113 array(
'updateObjectDetails',
'deleteObject',
'performObjectDelete',
'objects',
2114 'editPrices',
'addPrice',
'editDetails',
'resetObjectFilter'),
'',
'');
2116 $tabs_gui->addTarget(
'vendors', $this->ctrl->getLinkTarget($this,
'vendors'),
2117 array(
'vendors',
'searchUser',
'search',
'performSearch',
'addVendor',
'addUser',
'exportVendors',
'deleteVendors',
'performDeleteVendors',
2118 'cancelDeleteVendors',
'editVendor',
'performEditVendor'),
'',
'');
2120 #TODO: CURRENCY not finished yet
2128 $tabs_gui->addTarget(
'pay_methods', $this->ctrl->getLinkTarget($this,
'payMethods'),
2129 #array('payMethods','savePayMethods'), '', '');
2130 array(
'payMethods',
'savePayMethods ',
'saveBmfSettings',
'savePaypalSettings',
'paypalSettings',
2131 'saveEPaySettings',
'epaySettings',
'saveERPsettings',
'delERPpreview',
'',
'testERPsettings',
'erpSettings',
'',
'view'),
'',
'');
2134 $tabs_gui->addTarget(
'topics',
2135 $this->ctrl->getLinkTargetByClass(
'ilshoptopicsgui',
''),
'payment_topics',
'',
'');
2138 $tabs_gui->addTarget(
'vats',
2139 $this->ctrl->getLinkTarget($this,
'vats'),
'vats',
'',
'');
2142 $tabs_gui->addTarget(
'documents', $this->ctrl->getLinkTarget($this,
'documents'),
2143 array(
'documents',
'TermsConditions',
'saveTermsConditions',
'BillingMail',
'saveBillingMail',
'InvoiceNumber',
'saveInvoiceNumber'),
'',
'');
2146 if ($rbacsystem->checkAccess(
'edit_permission',$this->object->getRefId()))
2149 $tabs_gui->addTarget(
'perm_settings',
2150 $this->ctrl->getLinkTargetByClass(array(get_class($this),
'ilpermissiongui'),
'perm'), array(
'perm',
'info',
'owner'),
'ilpermissiongui');
2166 if(!$a_sub_tab) $a_sub_tab =
'payMethods';
2167 $this->tabs_gui->addSubTabTarget(
'settings',
2168 $this->ctrl->getLinkTargetByClass(
'ilobjpaymentsettingsgui',
'payMethods'),
2169 '',
'',
'',$a_sub_tab ==
'paymethods' ?
true :
false);
2171 $this->tabs_gui->addSubTabTarget(
'pays_bmf',
2172 $this->ctrl->getLinkTargetByClass(
'ilobjpaymentsettingsgui',
'bmfSettings'),
2173 '',
'',
'',$a_sub_tab ==
'bmfSettings' ?
true :
false);
2175 $this->tabs_gui->addSubTabTarget(
'pays_paypal',
2176 $this->ctrl->getLinkTargetByClass(
'ilobjpaymentsettingsgui',
'paypalSettings'),
2177 '',
'',
'',$a_sub_tab ==
'paypalSettings' ?
true :
false);
2179 $this->tabs_gui->addSubTabTarget(
'pays_epay',
2180 $this->ctrl->getLinkTargetByClass(
'ilobjpaymentsettingsgui',
'epaySettings'),
2181 '',
'',
'',$a_sub_tab ==
'epaySettings' ?
true :
false);
2183 $this->tabs_gui->addSubTabTarget(
'pays_erp',
2184 $this->ctrl->getLinkTargetByClass(
'ilobjpaymentsettingsgui',
'erpSettings'),
2185 '',
'',
'',$a_sub_tab ==
'erpSettings' ?
true :
false);
2194 if(!$a_sub_tab) $a_sub_tab =
'terms_conditions';
2195 $this->tabs_gui->addSubTabTarget(
'terms_conditions',
2196 $this->ctrl->getLinkTargetByClass(
'ilobjpaymentsettingsgui',
'TermsConditions'),
2197 '',
'',
'',$a_sub_tab ==
'terms_conditions' ?
true :
false);
2199 $this->tabs_gui->addSubTabTarget(
'billing_mail',
2200 $this->ctrl->getLinkTargetByClass(
'ilobjpaymentsettingsgui',
'BillingMail'),
2201 '',
'',
'',$a_sub_tab ==
'billing_mail' ?
true :
false);
2202 $this->tabs_gui->addSubTabTarget(
'invoice_number',
2203 $this->ctrl->getLinkTargetByClass(
'ilobjpaymentsettingsgui',
'InvoiceNumber'),
2204 '',
'',
'',$a_sub_tab ==
'invoice_number' ?
true :
false);
2209 if ((
$_GET[
'cmd'] ==
'') || (
$_GET[
'cmd'] ==
'view') || ($a_sub_tab ==
'generalSettings'))
2210 $a_sub_tab =
'generalSettings';
2220 if(!$rbacsystem->checkAccess(
'read', $this->object->getRefId()))
2222 $this->ilias->raiseError($this->lng->txt(
'msg_no_perm_read'),$this->ilias->error_obj->MESSAGE);
2225 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.main_view.html',
'Services/Payment');
2231 $form->setFormAction($this->ctrl->getFormAction($this,
'saveGeneralSettings'));
2232 $form->setTitle($this->lng->txt(
'pays_general_settings'));
2234 $form->addCommandButton(
'saveGeneralSettings',$this->lng->txt(
'save'));
2237 $formItem =
new ilCheckboxInputGUI($this->lng->txt(
'pay_enable_shop'),
'shop_enabled');
2239 $formItem->setInfo($this->lng->txt(
'pay_enable_shop_info'));
2240 $form->addItem($formItem);
2242 $formItem =
new ilTextInputGUI($this->lng->txt(
'pays_currency_unit'),
'currency_unit');
2244 $formItem->setValue($this->error !=
'' && isset(
$_POST[
'currency_unit'])
2247 $formItem->setRequired(
true);
2248 $form->addItem($formItem);
2252 $formItem->setCols(35);
2253 $formItem->setRequired(
true);
2254 $formItem->setValue($this->error !=
'' && isset(
$_POST[
'address'])
2256 : $genSetData[
'address']);
2257 $form->addItem($formItem);
2261 $formItem->setCols(35);
2262 $formItem->setRequired(
true);
2263 $formItem->setValue($this->error !=
'' && isset(
$_POST[
'bank_data'])
2265 : $genSetData[
'bank_data']);
2266 $form->addItem($formItem);
2270 $formItem->setCols(35);
2271 $formItem->setValue($this->error !=
'' && isset(
$_POST[
'add_info'])
2273 : $genSetData[
'add_info']);
2274 $form->addItem($formItem);
2276 $formItem =
new ilTextInputGUI($this->lng->txt(
'pays_pdf_path'),
'pdf_path');
2277 $formItem->
setValue($this->error !=
"" && isset(
$_POST[
'pdf_path'])
2280 $formItem->setRequired(
true);
2281 $form->addItem($formItem);
2284 $formItem =
new ilSelectInputGUI($this->lng->txt(
'pay_topics_default_sorting_type'),
'topics_sorting_type');
2285 $formItem->
setValue($genSetData[
'topics_sorting_type']);
2287 1 => $this->lng->txt(
'pay_topics_sort_by_title'),
2288 2 => $this->lng->txt(
'pay_topics_sort_by_date'),
2289 3 => $this->lng->txt(
'pay_topics_sort_manually')
2291 $formItem->setOptions($options);
2292 $form->addItem($formItem);
2295 $formItem =
new ilSelectInputGUI($this->lng->txt(
'pay_topics_default_sorting_direction'),
'topics_sorting_direction');
2296 $formItem->
setValue($genSetData[
'topics_sorting_direction']);
2298 'asc' => $this->lng->txt(
'sort_asc'),
2299 'desc' => $this->lng->txt(
'sort_desc'),
2301 $formItem->setOptions($options);
2302 $form->addItem($formItem);
2305 $formItem =
new ilCheckboxInputGUI($this->lng->txt(
'pay_topics_allow_custom_sorting'),
'topics_allow_custom_sorting');
2306 $formItem->
setChecked((
int)$genSetData[
'topics_allow_custom_sorting']);
2307 $formItem->setInfo($this->lng->txt(
'pay_topics_allow_custom_sorting_info'));
2308 $form->addItem($formItem);
2317 $formItem =
new ilSelectInputGUI($this->lng->txt(
'pay_max_hits'),
'max_hits');
2318 $formItem->
setValue($genSetData[
'max_hits']);
2320 for($i = 10; $i <= 100; $i += 10)
2324 $formItem->setOptions($options);
2325 $formItem->setInfo($this->lng->txt(
'pay_max_hits_info'));
2326 $form->addItem($formItem);
2329 $formItem =
new ilCheckboxInputGUI($this->lng->txt(
'pay_hide_advanced_search'),
'hide_advanced_search');
2330 $formItem->
setChecked((
int)$genSetData[
'hide_advanced_search']);
2331 $formItem->setInfo($this->lng->txt(
'pay_hide_advanced_search_info'));
2332 $form->addItem($formItem);
2336 $formItem->
setChecked((
int)$genSetData[
'hide_news']);
2337 $formItem->setInfo($this->lng->txt(
'pay_hide_news_info'));
2338 $form->addItem($formItem);
2341 $formItem =
new ilCheckboxInputGUI($this->lng->txt(
'pay_hide_coupons'),
'hide_coupons');
2342 $formItem->
setChecked((
int)$genSetData[
'hide_coupons']);
2343 $formItem->setInfo($this->lng->txt(
'pay_hide_coupons'));
2344 $form->addItem($formItem);
2347 $formItem =
new ilCheckboxInputGUI($this->lng->txt(
'pay_hide_shop_info'),
'hide_shop_info');
2348 $formItem->
setChecked((
int)$genSetData[
'hide_shop_info']);
2349 $formItem->setInfo($this->lng->txt(
'pay_hide_shop_info_info'));
2350 $form->addItem($formItem);
2353 $formItem =
new ilCheckboxInputGUI($this->lng->txt(
'use_shop_specials'),
'use_shop_specials');
2354 $formItem->
setChecked((
int)$genSetData[
'use_shop_specials']);
2355 $formItem->setInfo($this->lng->txt(
'use_shop_specials_info'));
2356 $form->addItem($formItem);
2359 $formItem =
new ilCheckboxInputGUI($this->lng->txt(
'show_general_filter'),
'show_general_filter');
2360 $formItem->
setChecked((
int)$genSetData[
'show_general_filter']);
2361 $formItem->setInfo($this->lng->txt(
'show_general_filter_info'));
2362 $form->addItem($formItem);
2365 $formItem =
new ilCheckboxInputGUI($this->lng->txt(
'show_topics_filter'),
'show_topics_filter');
2366 $formItem->
setChecked((
int)$genSetData[
'show_topics_filter']);
2367 $formItem->setInfo($this->lng->txt(
'show_topics_filter_info'));
2368 $form->addItem($formItem);
2371 $formItem =
new ilCheckboxInputGUI($this->lng->txt(
'show_shop_explorer'),
'show_shop_explorer');
2372 $formItem->
setChecked((
int)$genSetData[
'show_shop_explorer']);
2373 $formItem->setInfo($this->lng->txt(
'show_shop_explorer_info'));
2374 $form->addItem($formItem);
2378 $payment_noti =
new ilCheckboxInputGUI($this->lng->txt(
"payment_notification"),
"payment_notification");
2380 $payment_noti->setChecked((
int)$ilSetting->get(
'payment_notification', 0) == 1);
2381 $payment_noti->setInfo($this->lng->txt(
'payment_notification_desc'));
2383 $num_days =
new ilNumberInputGUI($this->lng->txt(
'payment_notification_days'),
'payment_notification_days');
2385 $num_days->setMinValue(0);
2386 $num_days->setMaxValue(120);
2387 $num_days->setRequired(
true);
2388 $num_days->setValue($ilSetting->get(
'payment_notification_days'));
2389 $num_days->setInfo($this->lng->txt(
'payment_notification_days_desc'));
2391 $payment_noti->addSubItem($num_days);
2392 $form->addItem($payment_noti);
2395 $this->tpl->setVariable(
'FORM',$form->getHTML());
2404 if(!$rbacsystem->checkAccess(
'read', $this->object->getRefId()))
2406 $this->ilias->raiseError($this->lng->txt(
'msg_no_perm_read'),$this->ilias->error_obj->MESSAGE);
2412 if (
$_POST[
'currency_unit'] ==
'' ||
2413 $_POST[
'address'] ==
'' ||
2414 $_POST[
'bank_data'] ==
'' ||
2415 $_POST[
'pdf_path'] ==
'')
2417 $this->error = $this->lng->txt(
'pays_general_settings_not_valid');
2423 $genSet->set(
'currency_unit',
$_POST[
'currency_unit'],
'currencies');
2424 $genSet->set(
'address',
$_POST[
'address'],
'invoice');
2425 $genSet->set(
'bank_data',
$_POST[
'bank_data'],
'invoice');
2426 $genSet->set(
'add_info',
$_POST[
'add_info'],
'invoice');
2427 $genSet->set(
'pdf_path',
$_POST[
'pdf_path'],
'invoice');
2429 $genSet->set(
'topics_allow_custom_sorting',
$_POST[
'topics_allow_custom_sorting'],
'gui');
2430 $genSet->set(
'topics_sorting_type',
$_POST[
'topics_sorting_type'],
'gui');
2431 $genSet->set(
'topics_sorting_direction',
$_POST[
'topics_sorting_direction'],
'gui');
2432 $genSet->set(
'max_hits',
$_POST[
'max_hits'],
'gui');
2433 $genSet->set(
'shop_enabled',
$_POST[
'shop_enabled'],
'common');
2434 $genSet->set(
'hide_advanced_search',
$_POST[
'hide_advanced_search'],
'gui');
2435 #$genSet->set('hide_filtering', $_POST['hide_filtering'], 'gui');
2436 $genSet->set(
'objects_allow_custom_sorting',
$_POST[
'objects_allow_custom_sorting'],
'gui');
2437 $genSet->set(
'hide_coupons',
$_POST[
'hide_coupons'],
'gui');
2438 $genSet->set(
'hide_news',
$_POST[
'hide_news'],
'gui');
2439 $genSet->set(
'hide_shop_info',
$_POST[
'hide_shop_info'],
'gui');
2440 $genSet->set(
'use_shop_specials',
$_POST[
'use_shop_specials'],
'gui');
2441 $genSet->set(
'show_general_filter',
$_POST[
'show_general_filter'],
'gui');
2442 $genSet->set(
'show_topics_filter',
$_POST[
'show_topics_filter'],
'gui');
2443 $genSet->set(
'show_shop_explorer',
$_POST[
'show_shop_explorer'],
'gui');
2446 $ilSetting->set(
'payment_notification',
$_POST[
'payment_notification'] ? 1 : 0);
2447 $ilSetting->set(
'payment_notification_days',
$_POST[
'payment_notification_days']);
2461 if(!$rbacsystem->checkAccess(
'read', $this->object->getRefId()))
2463 $this->ilias->raiseError($this->lng->txt(
'msg_no_perm_read'),$this->ilias->error_obj->MESSAGE);
2466 include_once
'./Services/Payment/classes/class.ilEPaySettings.php';
2468 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.pays_epay_settings.html',
'Services/Payment');
2472 $ep = $ePayObj->getAll();
2475 $form->setFormAction($this->ctrl->getFormAction($this,
'saveEPaySettings'));
2476 $form->setTitle($this->lng->txt(
'pays_epay_settings'));
2478 $form->addCommandButton(
'saveEPaySettings',$this->lng->txt(
'save'));
2481 array(
'pays_epay_server_host',
'server_host',
true, null),
2482 array(
'pays_epay_server_path',
'server_path',
true, null),
2483 array(
'pays_epay_merchant_number',
'merchant_number',
true, null),
2484 array(
'pays_epay_auth_token',
'auth_token',
true,
'pays_epay_auth_token_info'),
2485 array(
'pays_epay_auth_email',
'auth_email',
true,
'pays_epay_auth_email_info')
2488 foreach ($fields as $f)
2492 $fi->setRequired($f[2]);
2493 if ($f[3] != null ) $fi->setInfo($this->lng->txt($f[3]));
2494 if ($f[1] ==
'auth_token') $fi->setInputType(
'password');
2495 $form->addItem($fi);
2498 $formItem =
new ilCheckboxInputGUI($this->lng->txt(
'pays_epay_instant_capture'),
'instant_capture');
2499 $formItem->
setChecked($ep[
'instant_capture'] == 1);
2500 $formItem->setInfo($this->lng->txt(
'pays_epay_instant_capture_info'));
2501 $form->addItem($formItem);
2503 $this->tpl->setVariable(
'EPAY_INFO', $this->lng->txt(
'pays_epay_info'));
2504 $this->tpl->setVariable(
'EPAY_SETTINGS',$form->getHTML());
2509 include_once
'./Services/Payment/classes/class.ilEPaySettings.php';
2511 if(!$rbacsystem->checkAccess(
'read', $this->object->getRefId()))
2513 $this->ilias->raiseError($this->lng->txt(
'msg_no_perm_read'),$this->ilias->error_obj->MESSAGE);
2520 $arr[
'instant_capture'] = isset(
$_POST[
'instant_capture']) ? 1 : 0;
2522 $epSet->setAll($arr);
2524 if (!$epSet->valid())
2526 $this->error = $this->lng->txt(
'pays_epay_settings_not_valid');
2546 $erp->loadSettings($erps_id);
2547 $set = $erp->getSettings(0);
2550 array(
"pays_eco_agreement",
"agreement", 10),
2551 array(
"username",
"username", 16),
2552 array(
"password",
"password", 16),
2553 array(
"pays_eco_product_number",
"product", 6),
2554 array(
"pays_eco_payment_terms",
"terms", 6),
2555 array(
"pays_eco_layout",
"layout", 6),
2556 array(
"pays_eco_cur_handle_code",
"code", 3)
2559 foreach ($fields as $f)
2563 $txt->setValue($set[$f[1]]);
2564 if ($f[0] ==
'password') $txt->setInputType(
'password');
2565 $op->addSubItem($txt);
2582 require_once
'./Services/Payment/classes/class.ilERP_eco.php';
2592 $frm->setFormAction($this->ctrl->getFormAction($this,
'saveEEPsettings'));
2593 $frm->setTitle($this->lng->txt(
'pays_erp_settings'));
2597 $preview_link =
"<br/><a href='".
ilERP::getPreviewUrl() .
"' target='_blank'>" . $this->lng->txt(
'pays_erp_invoice_preview') .
"</a>";
2598 $frm->addCommandButton(
'delERPpreview', $this->lng->txt(
'pays_erp_invoice_delpreview') );
2601 $frm->addCommandButton(
'saveERPsettings',$this->lng->txt(
'save'));
2602 $frm->addCommandButton(
'testERPsettings',$this->lng->txt(
'test'));
2604 $savepdf =
new ilCheckboxInputGUI($this->lng->txt(
'pays_erp_invoice_copies'),
'save_copy');
2611 $rdo->
setInfo(
"The ERP is currently in development");
2613 $rdo->setValue($active[
'erp_id']);
2615 foreach ($systems as $system)
2617 $desc = $system[
'description'];
2618 $desc .= empty($system[
'url']) ?
'' :
' <a href="'.$system[
'url'].
'" target="_blank">' . $this->lng->txt(
"additional_info") .
"</a>";
2620 $op =
new ilRadioOption($system[
'name'], $system[
'erp_id'], $desc);
2622 $function =
"getERPform_" . $system[
'erp_short'];
2623 $this->$function(&$op, $active[
'erps_id']);
2625 $rdo->addOption($op);
2627 $frm->addItem($rdo);
2629 $savepdf->setChecked( $active[
'save_copy'] );
2632 $save_msg = $this->lng->txt(
'pays_erp_invoice_copies_info') .
' ' .ilERP::getSaveDirectory();
2634 if (!is_writable(
ilERP::getSaveDirectory() )) $save_msg .=
"<br/><b>" . $this->lng->txt(
'pays_erp_invoice_nowrite') .
"</b>";
2635 $save_msg .= $preview_link;
2636 $savepdf->setInfo($save_msg);
2637 $frm->addItem($savepdf);
2639 $chk->
setInfo($this->lng->txt(
'enable_ean_info'));
2640 $frm->addItem($chk);
2652 require_once
'./Services/Payment/classes/class.ilERP.php';
2657 require_once
'./Services/Payment/classes/class.ilERP_none.php';
2661 require_once
'./Services/Payment/classes/class.ilERP_eco.php';
2675 $a[
'use_ean'] = (isset(
$_POST[
'use_ean'])) ? 1 : 0;
2676 $a[
'save_copy'] = (isset(
$_POST[
'save_copy'])) ? 1 : 0;
2683 require_once
'./Services/Payment/classes/class.ilERP.php';
2695 if(!$rbacsystem->checkAccess(
'read', $this->object->getRefId()))
2697 $this->ilias->raiseError($this->lng->txt(
'msg_no_perm_write'),$this->ilias->error_obj->MESSAGE);
2704 assert ($active[
'erp_id'] == (
int)
$_POST[
'erp_id']);
2706 $cls =
"ilERPDebtor_" . $active[
'erp_short'] ;
2707 require_once
'./Services/Payment/classes/class.' . $cls .
".php";
2713 $nr = rand(1030,1040);
2714 if ($deb->getDebtorByNumber($nr))
2716 $good .= $this->lng->txt(
'pays_erp_tst_existing');
2720 $deb->setTestValues();
2721 $deb->createDebtor($nr);
2723 $good = $this->lng->txt(
'pays_erp_tst_new');
2726 $good .=
" " . $nr .
", " . $deb->getName() .
" ";
2728 $amount = rand(10,1000);
2730 $good .= $this->lng->txt(
'pays_erp_tst_billed') .
" " . $pcs .
" x " . $amount .
2731 "<br/>" . $this->lng->txt(
'total') .
" " . number_format( $pcs*$amount, 2,
',',
'.');
2733 $deb->createInvoice();
2734 $deb->createInvoiceLine( 0, $this->lng->txt(
'pays_erp_tst_product'), $pcs, $amount);
2735 $deb->createInvoiceLine( 0,
"www.ilias.dk", 1, 1);
2736 $v = $deb->bookInvoice();
2737 $good .=
", # " . $deb->getInvoiceNumber();
2739 $attach = $deb->getInvoicePDF($v);
2741 $deb->saveInvoice($attach,
true);
2742 $deb->sendInvoice($this->lng->txt(
'pay_order_paid_subject'), $deb->getName() .
",\n" . $this->lng->txt(
'pays_erp_invoice_attached'), $ilUser->getEmail(), $attach,
"faktura");
2744 $good .=
"<br/>" . $ilUser->getEmail() .
" => " . $this->lng->txt(
'mail_sent');
2765 if (!$instance->looksValid()) $message = str_replace(
'%s', $instance->getName, $this->lng->txt(
'pays_erp_bad_settings'));
2770 $instance->connect();
2771 ilUtil::sendInfo(str_replace(
'%s', $instance->getName(), $this->lng->txt(
"pays_erp_connection_established")));
2786 if(!$rbacsystem->checkAccess(
'write', $this->object->getRefId()))
2788 $this->ilias->raiseError($this->lng->txt(
'msg_no_perm_write'),$this->ilias->error_obj->MESSAGE);
2792 $system = (int)
$_POST[
'erp_id'];
2794 $instance->setSettings($settings);
2805 $instance->setActive($system);
2806 $instance->saveSettings($settings);
2807 ilUtil::sendSuccess(str_replace(
'%s', $instance->getName(), $this->lng->txt(
'pays_erp_updated_settings')));
2821 if(!$rbacsystem->checkAccess(
'read', $this->object->getRefId()))
2823 $this->ilias->raiseError($this->lng->txt(
'msg_no_perm_read'),$this->ilias->error_obj->MESSAGE);
2825 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.pays_erp_settings.html',
'Services/Payment');
2829 $this->tpl->setVariable(
'ERP_INFO', $this->lng->txt(
'pays_erp_info'));
2830 $this->tpl->setVariable(
'ERP_SETTINGS',$form->getHTML());
2838 if(!$rbacsystem->checkAccess(
'read', $this->object->getRefId()))
2840 $this->ilias->raiseError($this->lng->txt(
'msg_no_perm_read'),$this->ilias->error_obj->MESSAGE);
2843 include_once
'./Services/Payment/classes/class.ilPaypalSettings.php';
2845 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.main_view.html',
'Services/Payment');
2850 $form->setFormAction($this->ctrl->getFormAction($this,
'savePaypalSettings'));
2851 $form->setTitle($this->lng->txt(
'pays_paypal_settings'));
2853 $form->addCommandButton(
'savePaypalSettings',$this->lng->txt(
'save'));
2855 $formItem =
new ilTextInputGUI($this->lng->txt(
'pays_server_host'),
'server_host');
2856 $formItem->
setValue($ppSet->getServerHost());
2857 $form->addItem($formItem);
2859 $formItem =
new ilTextInputGUI($this->lng->txt(
'pays_server_path'),
'server_path');
2860 $formItem->
setValue($ppSet->getServerPath());
2861 $form->addItem($formItem);
2863 $formItem =
new ilTextInputGUI($this->lng->txt(
'pays_email_vendor'),
'vendor');
2864 $formItem->
setValue($ppSet->getVendor());
2865 $form->addItem($formItem);
2867 $formItem =
new ilTextInputGUI($this->lng->txt(
'pays_auth_token'),
'auth_token');
2868 $formItem->
setValue($ppSet->getAuthToken());
2869 $form->addItem($formItem);
2871 $formItem =
new ilTextInputGUI($this->lng->txt(
'pays_page_style'),
'page_style');
2872 $formItem->
setValue($ppSet->getPageStyle());
2873 $form->addItem($formItem);
2875 $this->tpl->setVariable(
'FORM',$form->getHTML());
2880 include_once
'./Services/Payment/classes/class.ilPaypalSettings.php';
2885 if(!$rbacsystem->checkAccess(
'read', $this->object->getRefId()))
2887 $this->ilias->raiseError($this->lng->txt(
'msg_no_perm_read'),$this->ilias->error_obj->MESSAGE);
2899 if (
$_POST[
'server_host'] ==
'' ||
2900 $_POST[
'server_path'] ==
'' ||
2901 $_POST[
'vendor'] ==
'' ||
2902 $_POST[
'auth_token'] ==
'')
2904 $this->error = $this->lng->txt(
'pays_paypal_settings_not_valid');
2923 #include_once './Services/Table/classes/class.ilTable2GUI.php';
2925 global $rbacsystem, $ilToolbar;
2928 if(!$rbacsystem->checkAccess(
'read', $this->object->getRefId()))
2930 $this->ilias->raiseError($this->lng->txt(
'msg_no_perm_read'),$this->ilias->error_obj->MESSAGE);
2935 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.main_view.html',
'Services/Payment');
2937 include_once(
"./Services/Form/classes/class.ilUserLoginAutoCompleteInputGUI.php");
2940 $ilToolbar->addInputItem($ul,
true);
2941 $ilToolbar->addFormButton($this->lng->txt(
"add"),
"search");
2942 $ilToolbar->setFormAction($this->ctrl->getFormAction($this));
2944 $this->
object->initPaymentVendorsObject();
2945 if(!count($vendors = $this->object->payment_vendors_obj->getVendors()))
2955 $oConfirmationGUI->setFormAction($this->ctrl->getFormAction($this,
"performDeleteVendors"));
2956 $oConfirmationGUI->setHeaderText($this->lng->txt(
"pays_sure_delete_selected_vendors"));
2957 $oConfirmationGUI->setCancel($this->lng->txt(
"cancel"),
"vendors");
2958 $oConfirmationGUI->setConfirm($this->lng->txt(
"confirm"),
"performDeleteVendors");
2962 if(in_array($vendor[
'vendor_id'],
$_SESSION[
'pays_vendor']))
2968 $delete_row = $tmp_obj->getLogin().
' '.
2969 $vendor[
'cost_center'].
' '.
2971 $oConfirmationGUI->addItem(
'',$delete_row, $delete_row);
2976 $this->tpl->setVariable(
'CONFIRMATION', $oConfirmationGUI->getHTML()); #
2981 $f_result = array();
2988 $_SESSION[
'pays_vendor']) ? 1 : 0,
"vendor[]", $vendor[
'vendor_id']);
2989 $f_result[$counter][
'login'] = $tmp_obj->getLogin();
2990 $f_result[$counter][
'cost_center'] = $vendor[
'cost_center'];
3004 include_once
'./Services/Payment/classes/class.ilPaymentExcelWriterAdapter.php';
3014 $workbook = $pewa->getWorkbook();
3015 @$workbook->close();
3020 include_once
'./Services/Excel/classes/class.ilExcelUtils.php';
3021 include_once
'./Services/Payment/classes/class.ilPaymentVendors.php';
3025 $workbook = $pewa->getWorkbook();
3026 $worksheet = $workbook->addWorksheet(utf8_decode($this->lng->txt(
'bookings')));
3028 $worksheet->mergeCells(0,0,0,3);
3029 $worksheet->setColumn(0,0,16);
3030 $worksheet->setColumn(0,1,32);
3031 $worksheet->setColumn(0,2,32);
3032 $worksheet->setColumn(0,3,16);
3033 $worksheet->setColumn(0,4,16);
3034 $worksheet->setColumn(0,5,16);
3035 $worksheet->setColumn(0,6,24);
3036 $worksheet->setColumn(0,7,8);
3037 $worksheet->setColumn(0,8,12);
3038 $worksheet->setColumn(0,9,16);
3040 $title = $this->lng->txt(
'bookings');
3041 $title .=
' '.$this->lng->txt(
'as_of').
' ';
3042 $title .= strftime(
'%Y-%m-%d %R',time());
3044 $worksheet->writeString(0,0,
$title,$pewa->getFormatTitle());
3064 if(!count($bookings = $this->booking_obj->getBookings()))
3069 include_once
'Services/User/classes/class.ilObjUser.php';
3070 $object_title_cache = array();
3071 $user_title_cache = array();
3074 foreach($bookings as $booking)
3076 if(array_key_exists($booking[
'ref_id'], $object_title_cache))
3078 $tmp_obj = $object_title_cache[$booking[
'ref_id']];
3083 $object_title_cache[$booking[
'ref_id']] = $tmp_obj;
3085 if(array_key_exists($booking[
'b_vendor_id'], $user_title_cache))
3087 $tmp_vendor = $user_title_cache[$booking[
'b_vendor_id']];
3092 $user_title_cache[$booking[
'b_vendor_id']] = $tmp_vendor;
3094 if(array_key_exists($booking[
'customer_id'], $user_title_cache))
3096 $tmp_purchaser = $user_title_cache[$booking[
'customer_id']];
3103 $tmp_purchaser =
''.$tmp_purchaser_name[
'firstname'].
' '.$tmp_purchaser_name[
'lastname'].
' ['.$tmp_purchaser_login.
']';
3104 $user_title_cache[$booking[
'customer_id']] = $tmp_purchaser;
3107 include_once
'./Services/Payment/classes/class.ilPayMethods.php';
3113 $worksheet->writeString($counter,3,
ilExcelUtils::_convert_text(($tmp_vendor !=
'' ? $tmp_vendor : $this->lng->txt(
'user_deleted'))));
3115 $worksheet->writeString($counter,5,
ilExcelUtils::_convert_text(($tmp_purchaser !=
'' ? $tmp_purchaser : $this->lng->txt(
'user_deleted'))));
3117 $worksheet->writeString($counter,7,strftime(
'%Y-%m-%d %R',$booking[
'order_date']));
3118 $worksheet->writeString($counter,8,$booking[
'duration']);
3121 $payed_access = $booking[
'payed'] ?
3122 $this->lng->txt(
'yes') :
3123 $this->lng->txt(
'no');
3125 $payed_access .=
'/';
3126 $payed_access .= $booking[
'access_granted'] ?
3127 $this->lng->txt(
'yes') :
3128 $this->lng->txt(
'no');
3130 $worksheet->writeString($counter,10,$payed_access);
3140 unset($tmp_purchaser);
3148 include_once
'./Services/Excel/classes/class.ilExcelUtils.php';
3150 $this->
object->initPaymentVendorsObject();
3152 $workbook = $pewa->getWorkbook();
3156 $worksheet->mergeCells(0,0,0,2);
3157 $worksheet->setColumn(1,0,32);
3158 $worksheet->setColumn(1,1,32);
3159 $worksheet->setColumn(1,2,32);
3161 $title = $this->lng->txt(
'bookings');
3162 $title .=
' '.$this->lng->txt(
'as_of').
' ';
3163 $title .= strftime(
'%Y-%m-%d %R',time());
3165 $worksheet->writeString(0,0,
$title,$pewa->getFormatTitle());
3171 if(!count($vendors = $this->object->payment_vendors_obj->getVendors()))
3193 include_once
'./Services/Payment/classes/class.ilPayMethods.php';
3197 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.main_view.html',
'Services/Payment');
3200 if(!$rbacsystem->checkAccess(
'read', $this->object->getRefId()))
3202 $this->ilias->raiseError($this->lng->txt(
'msg_no_perm_read'),$this->ilias->error_obj->MESSAGE);
3205 if(count($askForDeletingAddresses))
3210 $oConfirmationGUI->setFormAction($ilCtrl->getFormAction($this,
"deleteAddressesForPaymethods"));
3211 $oConfirmationGUI->setHeaderText($this->lng->txt(
"info_delete_sure"));
3212 $oConfirmationGUI->setCancel($this->lng->txt(
"cancel"),
"paymethods");
3213 $oConfirmationGUI->setConfirm($this->lng->txt(
"confirm"),
"deleteAddressesForPaymethods");
3215 foreach($askForDeletingAddresses as $pm_id)
3219 $oConfirmationGUI->addHiddenItem(
'pm_id[]',$pm_id);
3220 $oConfirmationGUI->additem(
'paymethod',$pm_obj->getPmId(), $this->lng->txt(
'delete_addresses_bill').
' -> '.
ilPayMethods::getStringByPaymethod($pm_obj->getPmTitle()));
3223 $this->tpl->setVariable(
'CONFIRMATION', $oConfirmationGUI->getHtml());
3228 $paymethods = $obj_paymethods->readAll();
3230 $result = array(); $counter = 0;
3231 foreach($paymethods as $paymethod)
3235 $result[$counter][
'save_usr_adr'] =
ilUtil::formCheckbox($paymethod[
'save_usr_adr'] ? 1 : 0,
'save_usr_adr['.$paymethod[
'pm_id'].
']',1);
3236 $this->ctrl->clearParameters($this);
3242 $this->ctrl->setParameter($this,
'cmd',
'savePayMethods');
3244 $tbl->setTitle($this->lng->txt(
'pays_pay_methods'));
3246 $tbl->setId(
'tbl_paymethods');
3247 $tbl->setRowTemplate(
"tpl.shop_paymethods_row.html",
"Services/Payment");
3249 $tbl->addColumn($this->lng->txt(
'title'),
'pm_title',
'10%');
3250 $tbl->addColumn($this->lng->txt(
'enabled'),
'pm_enabled',
'10%');
3251 $tbl->addColumn($this->lng->txt(
'save_customer_address'),
'save_usr_adr',
'10%');
3252 $tbl->addCommandButton(
'savePayMethods', $this->lng->txt(
'save'));
3254 $tbl->disable(
'sort');
3257 $this->tpl->setVariable(
'TABLE', $tbl->getHTML());
3264 include_once
'./Services/Payment/classes/class.ilPayMethods.php';
3269 if(!$rbacsystem->checkAccess(
'read', $this->object->getRefId()))
3271 $this->ilias->raiseError($this->lng->txt(
'msg_no_perm_read'),$this->ilias->error_obj->MESSAGE);
3276 $askForDeletingAddresses = array();
3278 for($i = 1; $i <= $count_pm; $i++)
3280 if(!array_key_exists($i,
$_POST[
'pm_enabled']) && ilPayMethods::_PmEnabled($i) == 1)
3292 if(!array_key_exists($i,
$_POST[
'pm_enabled']) && ilPayMethods::_PmEnabled($i) == 0)
3303 $askForDeletingAddresses[] = $i;
3316 $tmp = $this->
payMethodsObject($askForDeletingAddresses,$oConfirmationGUI);
3317 if(!$askForDeletingAddresses)
3335 if(!count(
$_POST[
'vendor']))
3363 include_once
'./Services/Payment/classes/class.ilPaymentTrustees.php';
3368 if(!$rbacsystem->checkAccess(
'write', $this->object->getRefId()))
3370 $this->ilias->raiseError($this->lng->txt(
'msg_no_perm_write'),$this->ilias->error_obj->MESSAGE);
3373 $this->
object->initPaymentVendorsObject();
3377 $this->
object->payment_vendors_obj->delete($vendor);
3394 if(!$rbacsystem->checkAccess(
"write", $this->object->getRefId()))
3396 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_write"),$this->ilias->error_obj->MESSAGE);
3399 if(!count(
$_POST[
'vendor']))
3406 if(count(
$_POST[
'vendor']) > 1)
3416 $this->
object->initPaymentVendorsObject();
3418 if (!is_array($this->object->payment_vendors_obj->vendors[
$_SESSION[
'pays_vendor']]))
3425 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.main_view.html',
'Services/Payment');
3428 $form_gui->setFormAction($this->ctrl->getFormAction($this,
'performEditVendor'));
3429 $form_gui->setTitle($this->lng->txt(
'pays_vendor'));
3433 $form_gui->addItem($oVendorGUI);
3435 $oCostcenterGUI =
new ilTextInputGUI($this->lng->txt(
'pays_cost_center'),
'cost_center');
3436 $oCostcenterGUI->
setValue($this->error !=
'' && isset(
$_POST[
'cost_center'])
3439 $form_gui->addItem($oCostcenterGUI);
3441 $form_gui->addCommandButton(
'performEditVendor',$this->lng->txt(
'save'));
3442 $this->tpl->setVariable(
'FORM', $form_gui->getHTML());
3450 if(!$rbacsystem->checkAccess(
'write', $this->object->getRefId()))
3452 $this->ilias->raiseError($this->lng->txt(
'msg_no_perm_write'),$this->ilias->error_obj->MESSAGE);
3470 $this->
object->initPaymentVendorsObject();
3472 if (!is_array($this->object->payment_vendors_obj->vendors[
$_SESSION[
'pays_vendor']]))
3478 if (
$_POST[
'cost_center'] ==
'')
3480 $this->error = $this->lng->txt(
'pays_cost_center_not_valid');
3483 $this->editVendor();
3487 $this->
object->initPaymentVendorsObject();
3488 $this->
object->payment_vendors_obj->update(
$_SESSION[
'pays_vendor'],
$_POST[
'cost_center']);
3499 global $rbacsystem,
$tree, $ilToolbar;
3502 if(!$rbacsystem->checkAccess(
'read', $this->object->getRefId()))
3504 $this->ilias->raiseError($this->lng->txt(
'msg_no_perm_read'),$this->ilias->error_obj->MESSAGE);
3507 include_once
'./Services/Payment/classes/class.ilPaymentObjectSelector.php';
3509 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.paya_object_selector.html',
'Services/Payment');
3511 $ilToolbar->addButton($this->lng->txt(
'back'), $this->ctrl->getLinkTarget($this,
'statistic'));
3515 $exp =
new ilPaymentObjectSelector($this->ctrl->getLinkTarget($this,
'showObjectSelector'), strtolower(get_class($this)));
3516 $exp->
setExpand(
$_GET[
'paya_link_expand'] ?
$_GET[
'paya_link_expand'] : $tree->readRootId());
3517 $exp->setExpandTarget($this->ctrl->getLinkTarget($this,
'showObjectSelector'));
3521 $this->tpl->setVariable(
'EXPLORER',$exp->getOutput());
3563 global $rbacsystem,
$tree, $ilToolbar;
3565 if(!$rbacsystem->checkAccess(
'read', $this->object->getRefId()))
3567 $this->ilias->raiseError($this->lng->txt(
'msg_no_perm_read'),$this->ilias->error_obj->MESSAGE);
3572 if(!isset(
$_POST[
'search_str']))
3587 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.main_view.html',
'Services/Payment');
3588 # $ilToolbar->addButton($this->lng->txt('crs_new_search'), $this->ctrl->getLinkTarget($this, 'searchUser'));
3591 $f_result = array();
3599 $f_result[$counter][
'login'] = $tmp_obj->getLogin();
3600 $f_result[$counter][
'lastname'] = $tmp_obj->getLastname();
3601 $f_result[$counter][
'firstname'] = $tmp_obj->getFirstname();
3616 if(!$rbacsystem->checkAccess(
'write', $this->object->getRefId()))
3618 $this->ilias->raiseError($this->lng->txt(
'msg_no_perm_write'),$this->ilias->error_obj->MESSAGE);
3620 if(!
$_POST[
'vendor_login'])
3635 $this->
object->initPaymentVendorsObject();
3637 if($this->object->payment_vendors_obj->isAssigned(
$usr_id))
3644 $this->
object->payment_vendors_obj->add(
$usr_id);
3657 if(!$rbacsystem->checkAccess(
'write', $this->object->getRefId()))
3659 $this->ilias->raiseError($this->lng->txt(
'msg_no_perm_write'),$this->ilias->error_obj->MESSAGE);
3662 $this->lng->loadLanguageModule(
'crs');
3663 if(!is_array(
$_POST[
'user']))
3671 $this->
object->initPaymentVendorsObject();
3673 $already_assigned = $assigned = 0;
3676 if($this->object->payment_vendors_obj->isAssigned($usr_id))
3678 ++$already_assigned;
3681 $this->
object->payment_vendors_obj->add($usr_id);
3689 $message .= $this->lng->txt(
'pays_assigned_vendors').
' '.$assigned;
3691 if($already_assigned)
3693 $message .=
'<br />'.$this->lng->txt(
'pays_already_assigned_vendors').
' '.$already_assigned;
3706 if(!isset(
$_GET[
'sell_id']))
3708 ilUtil::sendFailiure($this->lng->txt(
'paya_no_booking_id_given'));
3714 $ilToolbar->addButton($this->lng->txt(
'back'), $this->ctrl->getLinkTarget($this,
'showObjectSelector'));
3715 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.main_view.html',
'Services/Payment');
3717 $this->lng->loadLanguageModule(
'search');
3718 $this->ctrl->setParameter($this,
'sell_id',
$_GET[
'sell_id']);
3721 $form_gui->setFormAction($this->ctrl->getFormAction($this));
3722 $form_gui->setTitle($this->lng->txt(
'search_user'));
3723 $form_gui->setId(
'search_form');
3725 $oTitle =
new ilTextInputGUI($this->lng->txt(
'search_search_term'),
'search_str');
3727 $oTitle->setSize(40);
3728 $oTitle->setValue(
$_POST[
'search_str']);
3729 $form_gui->addItem($oTitle);
3732 $form_gui->addCommandButton(
'performSearchSP', $this->lng->txt(
'search'));
3733 $form_gui->addCommandButton(
'bookings', $this->lng->txt(
'cancel'));
3735 $this->tpl->setVariable(
'FORM',$form_gui->getHTML());
3745 if(!trim(
$_POST[
'search_str']))
3748 $this->statistics();
3760 if(!isset(
$_GET[
'sell_id']))
3768 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.main_view.html',
'Services/Payment');
3769 $this->ctrl->setParameter($this,
'sell_id',
$_GET[
'sell_id']);
3771 $ilToolbar->addButton($this->lng->txt(
'back'), $this->ctrl->getLinkTarget($this,
'searchUserSP'));
3774 $f_result = array();
3781 $f_result[$counter][
'user_id'] = $user[
'id'];
3782 $f_result[$counter][
'login'] = $tmp_obj->getLogin();
3783 $f_result[$counter][
'firstname'] = $tmp_obj->getFirstname();
3784 $f_result[$counter][
'lastname'] = $tmp_obj->getLastname();
3798 if(!isset(
$_GET[
'sell_id']))
3806 if(!isset(
$_POST[
'user_id']))
3813 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.main_view.html',
'Services/Payment');
3814 $this->ctrl->setParameter($this,
'sell_id',
$_GET[
'sell_id']);
3816 $ilToolbar->addButton($this->lng->txt(
'back'), $this->ctrl->getLinkTarget($this,
'searchUserSP'));
3818 $this->ctrl->setParameter($this,
'user_id',
$_POST[
'user_id']);
3827 $tmp_object[
'title'] = $tmp_obj->getTitle();
3831 $tmp_object[
'title'] = $this->lng->txt(
'object_not_found');
3839 $oForm->setFormAction($this->ctrl->getFormAction($this,
'saveCustomer'));
3840 $oForm->setTitle($this->lng->txt($tmp_user->getFullname().
' ['.$tmp_user->getLogin().
']'));
3844 $oTransaction->setTitle($this->lng->txt(
'paya_transaction'));
3846 $oTransaction->setValue(
$_POST[
'transaction']);
3847 $oTransaction->setPostVar(
'transaction');
3848 $oForm->addItem($oTransaction);
3852 $oObject->
setValue($tmp_obj->getTitle());
3853 $oForm->addItem($oObject);
3857 $oVendor->
setValue($tmp_vendor->getFullname().
' ['.$tmp_vendor->getLogin().
']');
3858 $oForm->addItem($oVendor);
3861 $oPayMethods =
new ilSelectInputGUI($this->lng->txt(
'paya_pay_method'),
'pay_method');
3862 $payOptions = ilPaymethods::getPayMethodsOptions(
false);
3863 $oPayMethods->setOptions($payOptions);
3864 $oPayMethods->setValue(
$_POST[
'pay_method']);
3865 $oPayMethods->setPostVar(
'pay_method');
3866 $oForm->addItem($oPayMethods);
3869 $duration_opions = array();
3871 $prices = $prices_obj->getPrices();
3873 if (is_array($prices = $prices_obj->getPrices()))
3876 $currency_unit = $genSet->get(
'currency_unit');
3878 foreach($prices as $price)
3880 $txt_extension =
'';
3881 if($price[
'extension'] == 1)
3883 $txt_extension =
' ('.$this->lng->txt(
'extension_price').
') ';
3885 $duration_options[$price[
'price_id']] =
3886 $price[
'duration'].
' '.$this->lng->txt(
'paya_months').
', '.$price[
'price'].
' '. $currency_unit
3891 $oDuration =
new ilSelectInputGUI($this->lng->txt(
'duration'),
'duration');
3893 $oDuration->setValue(
$_POST[
'duration']);
3894 $oForm->addItem($oDuration);
3898 $payed_option = array(
'1'=>$this->lng->txt(
'yes'),
'0'=>$this->lng->txt(
'no'));
3900 $o_payed->setTitle($this->lng->txt(
'paya_payed'));
3901 $o_payed->setOptions($payed_option);
3902 $o_payed->setValue(
$_POST[
'payed']);
3903 $o_payed->setPostVar(
'payed');
3904 $oForm->addItem($o_payed);
3908 $access_option = array(
'1'=>$this->lng->txt(
'yes'),
'0'=>$this->lng->txt(
'no'));
3910 $o_access->setTitle($this->lng->txt(
'paya_access'));
3911 $o_access->setOptions($access_option);
3912 $o_access->setValue(
$_POST[
'access']);
3913 $o_access->setPostVar(
'access');
3915 $oForm->addItem($o_access);
3917 $oForm->addCommandButton(
'saveCustomer',$this->lng->txt(
'save'));
3918 $oForm->addCommandButton(
'bookings', $this->lng->txt(
'cancel'));
3920 $this->tpl->setVariable(
'FORM',$oForm->getHTML());
3926 global
$ilias, $ilUser,$ilObjDataCache;
3928 if(!isset(
$_GET[
'sell_id']))
3936 if(!isset(
$_GET[
'user_id']))
3944 if (
$_POST[
'pay_method'] ==
'' ||
3945 $_POST[
'duration'] ==
'')
3960 $this->booking_obj->setTransaction($transaction);
3961 $this->booking_obj->setTransactionExtern(
$_POST[
'transaction']);
3962 $this->booking_obj->setPobjectId($pObjectId);
3963 $this->booking_obj->setCustomerId(
$_GET[
'user_id']);
3964 $this->booking_obj->setVendorId($obj->getVendorId());
3966 $this->booking_obj->setPayMethod(
$_POST[
'pay_method']);
3967 $this->booking_obj->setOrderDate(time());
3971 $this->booking_obj->setDuration($price[
'duration']);
3972 $this->booking_obj->setPrice($price[
'price']);
3973 $this->booking_obj->setAccess((
int)
$_POST[
'access']);
3974 $this->booking_obj->setPayed((
int) $_POST[
'payed']);
3975 $this->booking_obj->setVoucher(
'');
3976 # $this->booking_obj->setAccessEnddate($price['extension']);
3978 $obj_id = $ilObjDataCache->lookupObjId($obj->getRefId());
3979 $obj_type = $ilObjDataCache->lookupType(
$obj_id);
3980 $obj_title = $ilObjDataCache->lookupTitle(
$obj_id);
3983 $oVAT =
new ilShopVats((
int)$obj->getVatId());
3984 $obj_vat_rate = $oVAT->
getRate();
3985 $obj_vat_unit = $obj->getVat($this->booking_obj->getPrice());
3987 $this->booking_obj->setObjectTitle($obj_title);
3988 $this->booking_obj->setVatRate($obj_vat_rate);
3989 $this->booking_obj->setVatUnit($obj_vat_unit);
3992 $this->booking_obj->setCurrencyUnit( $genSet->get(
'currency_unit'));
3994 include_once
'./Services/Payment/classes/class.ilPayMethods.php';
3997 if($save_user_address_enabled == 1)
4000 $user_id[] =
$_GET[
"user_id"];
4004 $this->booking_obj->setStreet($cust_obj[
$_GET[
"user_id"]][
'street'],
'');
4006 $this->booking_obj->setZipcode($cust_obj[$_GET[
"user_id"]][
'zipcode']);
4007 $this->booking_obj->setCity($cust_obj[$_GET[
"user_id"]][
'city']);
4008 $this->booking_obj->setCountry($cust_obj[$_GET[
"user_id"]][
'country']);
4011 if($this->booking_obj->add())
4017 if($obj_type ==
'crs')
4036 $this->ctrl->setParameter($this,
'cmd',
'statistic');
4039 $tbl->setTitle($this->lng->txt(
"bookings"));
4040 $tbl->setId(
'tbl_show_statistics');
4041 $tbl->setRowTemplate(
"tpl.shop_statistics_row.html",
"Services/Payment");
4043 $tbl->addColumn($this->lng->txt(
'paya_transaction'),
'transaction',
'10%');
4044 $tbl->addColumn($this->lng->txt(
'title'),
'object_title',
'10%');
4045 $tbl->addColumn($this->lng->txt(
'paya_vendor'),
'vendor',
'10%');
4046 $tbl->addColumn($this->lng->txt(
'paya_customer'),
'customer',
'10%');
4047 $tbl->addColumn($this->lng->txt(
'paya_order_date'),
'order_date',
'10%');
4048 $tbl->addColumn($this->lng->txt(
'duration'),
'duration',
'10%');
4049 $tbl->addColumn($this->lng->txt(
'price_a'),
'price',
'5%');
4050 $tbl->addColumn($this->lng->txt(
'paya_coupons_coupon'),
'discount',
'5%');
4051 $tbl->addColumn($this->lng->txt(
'paya_payed_access'),
'payed_access',
'5%');
4052 $tbl->addColumn(
'',
'edit',
'5%');
4054 $tbl->addCommandButton(
'exportVendors',$this->lng->txt(
'excel_export'));
4055 $tbl->setData($a_result_set);
4057 $this->tpl->setVariable(
'TABLE', $tbl->getHTML());
4064 include_once
'./Services/Payment/classes/class.ilPaymentBookings.php';
4071 $this->ctrl->setParameter($this,
'cmd',
'vendors');
4074 $tbl->setTitle($this->lng->txt(
"vendors"));
4075 $tbl->setId(
'tbl_show_vendors');
4076 $tbl->setRowTemplate(
"tpl.shop_users_row.html",
"Services/Payment");
4078 $tbl->addColumn(
'',
'vendor_id',
'1%');
4079 $tbl->addColumn($this->lng->txt(
'paya_vendor'),
'login',
'10%');
4080 $tbl->addColumn($this->lng->txt(
'pays_cost_center'),
'cost_center',
'10%');
4081 $tbl->addColumn($this->lng->txt(
'pays_number_bookings'),
'number_bookings',
'10%');
4083 $tbl->addMultiCommand(
"editVendor", $this->lng->txt(
'pays_edit_vendor'));
4084 $tbl->addMultiCommand(
"deleteVendors", $this->lng->txt(
'pays_delete_vendor'));
4086 $tbl->addCommandButton(
'exportVendors',$this->lng->txt(
'excel_export'));
4088 $tbl->setData($a_result_set);
4089 $this->tpl->setVariable(
'TABLE', $tbl->getHTML());
4098 $tbl->setTitle($this->lng->txt(
"pays_header_select_vendor"));
4099 $tbl->setId(
'tbl_search_user_vendor');
4100 $tbl->setRowTemplate(
"tpl.shop_users_row.html",
"Services/Payment");
4102 $tbl->addColumn(
' ',
'vendor_id',
'3%',
true);
4103 $tbl->addColumn($this->lng->txt(
'login'),
'login',
'32%');
4104 $tbl->addColumn($this->lng->txt(
'firstname'),
'firstname',
'32%');
4105 $tbl->addColumn($this->lng->txt(
'lastname'),
'lastname',
'32%');
4107 $tbl->setSelectAllCheckbox(
'vendor_id');
4108 $tbl->addMultiCommand(
"addUser", $this->lng->txt(
"add"));
4109 $tbl->addCommandButton(
'vendors',$this->lng->txt(
'cancel'));
4112 $tbl->setData($a_result_set);
4113 $this->tpl->setVariable(
'TABLE', $tbl->getHTML());
4120 include_once(
'./classes/class.ilSearch.php');
4122 $this->lng->loadLanguageModule(
'content');
4125 $search->setPerformUpdate(
false);
4127 $search->setCombination(
'and');
4128 $search->setSearchFor(array(0 =>
'usr'));
4129 $search->setSearchType(
'new');
4131 if($search->validate($message))
4133 $search->performSearch();
4138 $this->ctrl->redirect($this,
'searchUser');
4140 return $search->getResultByType(
'usr');
4145 include_once(
'./classes/class.ilSearch.php');
4147 $this->lng->loadLanguageModule(
'content');
4149 $search =
new ilSearch($this->user_obj->getId());
4152 $search->setCombination(
'and');
4153 $search->setSearchFor(array(0 =>
'usr'));
4154 $search->setSearchType(
'new');
4156 if($search->validate($message))
4158 $search->performSearchSPObject();
4163 $this->ctrl->redirect($this,
'searchUserSP');
4165 return $search->getResultByType(
'usr');
4169 $this->ctrl->setParameter($this,
'sell_id',
$_GET[
'sell_id']);
4172 $tbl->setTitle($this->lng->txt(
'users'));
4173 $tbl->setId(
'tbl_search_user_vendor');
4174 $tbl->setRowTemplate(
"tpl.shop_users_row.html",
"Services/Payment");
4176 $tbl->addColumn(
' ',
'user_id',
'3%',
true);
4177 $tbl->addColumn($this->lng->txt(
'login'),
'login',
'32%');
4178 $tbl->addColumn($this->lng->txt(
'firstname'),
'firstname',
'32%');
4179 $tbl->addColumn($this->lng->txt(
'lastname'),
'lastname',
'32%');
4182 $tbl->addMultiCommand(
"addCustomer", $this->lng->txt(
"add"));
4183 $tbl->addCommandButton(
'statistic',$this->lng->txt(
'cancel'));
4186 $tbl->setData($a_result_set);
4187 $this->tpl->setVariable(
'TABLE', $tbl->getHTML());
4195 if(!$ilAccess->checkAccess(
'read',
'', $this->object->getRefId()))
4197 $this->ilias->raiseError($this->lng->txt(
'msg_no_perm_read'), $this->ilias->error_obj->MESSAGE);
4200 include_once
'Services/Table/classes/class.ilTable2GUI.php';
4202 $tbl->setId(
'pay_vats_tbl');
4203 $tbl->setFormAction($this->ctrl->getFormAction($this),
'createVat');
4204 $tbl->setTitle($this->lng->txt(
'payment_tax_rates'));
4205 $tbl->setRowTemplate(
'tpl.shop_vats_list_row.html',
'Services/Payment');
4207 $tbl->setDefaultOrderField(
'title');
4211 $tbl->addColumn(
'',
'check',
'1%');
4212 $tbl->addColumn($this->lng->txt(
'vat_title'),
'vat_title',
'33%');
4213 $tbl->addColumn($this->lng->txt(
'vat_rate'),
'vat_rate',
'33%');
4214 $tbl->addColumn(
'',
'commands',
'33%');
4217 $oShopVatsList->read();
4221 if($oShopVatsList->hasItems())
4223 $tbl->enable(
'select_all');
4224 $tbl->setSelectAllCheckbox(
'vat_id');
4227 foreach($oShopVatsList as $oVAT)
4230 $result[$counter][
'vat_title'] = $oVAT->getTitle();
4232 $this->ctrl->setParameter($this,
'vat_id', $oVAT->getId());
4233 $result[$counter][
'edit_text'] = $this->lng->txt(
'edit');
4234 $result[$counter][
'edit_url'] = $this->ctrl->getLinkTarget($this,
'editVat');
4235 $result[$counter][
'delete_text'] = $this->lng->txt(
'delete');
4236 $result[$counter][
'delete_url'] = $this->ctrl->getLinkTarget($this,
'confirmDeleteVat');
4237 $this->ctrl->clearParameters($this);
4241 $tbl->addMultiCommand(
'confirmDeleteVat', $this->lng->txt(
'delete'));
4245 $tbl->disable(
'header');
4246 $tbl->disable(
'footer');
4248 $tbl->setNoEntriesText($this->lng->txt(
'paya_no_vats_assigned'));
4253 $tbl->addCommandButton(
'createVat', $this->lng->txt(
'paya_insert_vats'));
4255 $this->tpl->setContent($tbl->getHTML());
4262 if((
int)
$_GET[
'vat_id'] && !isset(
$_POST[
'vat_id']))
4268 $c_gui->setFormAction($this->ctrl->getFormAction($this,
'performDeleteVat'));
4269 $c_gui->setHeaderText($this->lng->txt(
'paya_sure_delete_vats'));
4270 $c_gui->setCancel($this->lng->txt(
'cancel'),
'vats');
4271 $c_gui->setConfirm($this->lng->txt(
'confirm'),
'performDeleteVat');
4274 foreach((array)
$_POST[
'vat_id'] as $vat_id)
4279 $c_gui->addItem(
'vat_id[]', $oVAT->getId(), $oVAT->getTitle());
4291 return $this->tpl->setContent($c_gui->getHTML());
4301 if(!is_array(
$_POST[
'vat_id']))
4306 foreach(
$_POST[
'vat_id'] as $vat_id)
4327 $this->tpl->setContent($this->form->getHtml());
4334 $this->tpl->setContent($this->form->getHtml());
4340 if($a_type ==
'edit')
4342 $this->ctrl->setParameter($this,
'vat_id',
$_GET[
'vat_id']);
4343 $this->form->setFormAction($this->ctrl->getFormAction($this,
'updateVat'));
4344 $this->form->setTitle($this->lng->txt(
'payment_edit_vat'));
4348 $this->form->setFormAction($this->ctrl->getFormAction($this,
'saveVat'));
4349 $this->form->setTitle($this->lng->txt(
'payment_add_vat'));
4352 $oTitle =
new ilTextInputGUI($this->lng->txt(
'title'),
'vat_title');
4354 $oTitle->setSize(40);
4355 $oTitle->setRequired(
true);
4356 $oTitle->setInfo($this->lng->txt(
'payment_vat_title_info'));
4357 $this->form->addItem($oTitle);
4359 $oRate =
new ilTextInputGUI($this->lng->txt(
'vat_rate'),
'vat_rate');
4362 $oRate->setRequired(
true);
4363 $oRate->setInfo($this->lng->txt(
'payment_vat_rate_info'));
4364 $this->form->addItem($oRate);
4366 if($a_type ==
'edit')
4368 $this->form->addCommandButton(
'updateVat', $this->lng->txt(
'save'));
4372 $this->form->addCommandButton(
'saveVat', $this->lng->txt(
'save'));
4375 $this->form->addCommandButton(
'vats', $this->lng->txt(
'cancel'));
4381 $this->form->setValuesByArray(array(
4382 'vat_title' => $oVAT->getTitle(),
4383 'vat_rate' => $oVAT->getRate()
4390 if(!$this->form->checkInput())
4392 $this->form->setValuesByPost();
4393 return $this->tpl->setContent($this->form->getHtml());
4398 $this->form->getItemByPostVar(
'vat_rate')->setAlert($this->lng->txt(
'payment_vat_input_invalid'));
4399 $this->form->setValuesByPost();
4400 return $this->tpl->setContent($this->form->getHtml());
4406 $oVAT->setTitle($this->form->getInput(
'vat_title'));
4407 $oVAT->setRate((
float)str_replace(
',',
'.', $this->form->getInput(
'vat_rate')));
4413 $this->form->setValuesByPost();
4414 return $this->tpl->setContent($this->form->getHtml());
4424 if(!$this->form->checkInput())
4426 $this->form->setValuesByPost();
4427 return $this->tpl->setContent($this->form->getHtml());
4432 $this->form->getItemByPostVar(
'vat_rate')->setAlert($this->lng->txt(
'payment_vat_input_invalid'));
4433 $this->form->setValuesByPost();
4434 return $this->tpl->setContent($this->form->getHtml());
4440 $oVAT->setTitle($this->form->getInput(
'vat_title'));
4441 $oVAT->setRate((
float)str_replace(
',',
'.', $this->form->getInput(
'vat_rate')));
4447 $this->form->setValuesByPost();
4448 return $this->tpl->setContent($this->form->getHtml());
4460 include_once
'./Services/Payment/classes/class.ilPayMethods.php';
4467 $del_bookings = $this->booking_obj->deleteAddressesByPaymethod((
int)$pay_method);
4478 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.main_view.html',
'Services/Payment');
4482 foreach($currency_res as $cur)
4485 $f_result[$counter][
'is_default'] = $cur[
'is_default'] == 1 ? $this->lng->txt(
'yes') : $this->lng->txt(
'no');
4487 $f_result[$counter][
'currency_unit'] = $cur[
'unit'];
4488 $f_result[$counter][
'iso_code'] = $cur[
'iso_code'];
4489 $f_result[$counter][
'currency_symbol'] = $cur[
'symbol'];
4490 $f_result[$counter][
'conversion_rate'] = $cur[
'conversion_rate'];
4497 $tbl->setTitle($this->lng->txt(
"currencies"));
4498 $tbl->setId(
'tbl_show_currencies');
4499 $tbl->setRowTemplate(
"tpl.shop_currencies_row.html",
"Services/Payment");
4501 $tbl->addColumn(
' ',
'currency_id',
'1%',
true);
4502 $tbl->addColumn($this->lng->txt(
'is_default'),
'is_default',
'5%');
4503 $tbl->addColumn($this->lng->txt(
'currency_unit'),
'currency_unit',
'10%');
4504 $tbl->addColumn($this->lng->txt(
'iso_code'),
'iso_code',
'20%');
4505 $tbl->addColumn($this->lng->txt(
'currency_symbol'),
'currency_symbol',
'20%');
4506 $tbl->addColumn($this->lng->txt(
'conversion_rate'),
'conversion_rate',
'15%');
4507 $tbl->addColumn(
'',
'options',
'5%');
4509 $this->ctrl->setParameter($this,
'cmd',
'currencies');
4511 $tbl->addMultiCommand(
'updateDefaultCurrency', $this->lng->txt(
'paya_set_default_currency'));
4512 $tbl->addMultiCommand(
"editCurrency",$this->lng->txt(
'edit'));
4513 $tbl->addMultiCommand(
"deleteCurrency", $this->lng->txt(
'delete'));
4515 $tbl->addCommandButton(
'addCurrency',$this->lng->txt(
'add_currency'));
4516 $tbl->setData($f_result);
4517 $this->tpl->setVariable(
'TABLE', $tbl->getHTML());
4522 if(isset(
$_POST[
'currency_id'] ))
4533 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.main_view.html',
'Services/Payment');
4535 $form->setFormAction($this->ctrl->getFormAction($this));
4536 $form->setTitle($this->lng->txt(
'paya_add_currency'));
4538 $o_Unit =
new ilTextInputGUI($this->lng->txt(
'paya_currency_unit'),
'currency_unit');
4540 $o_Unit->setPostVar(
'currency_unit');
4541 $o_Unit->setRequired(
true);
4543 $o_Isocode =
new ilTextInputGUI($this->lng->txt(
'iso_code'),
'iso_code');
4545 $o_Isocode->setPostVar(
'iso_code');
4546 $o_Isocode->setRequired(
true);
4548 $o_Symbol =
new ilTextInputGUI($this->lng->txt(
'symbol'),
'symbol');
4550 $o_Symbol->setPostVar(
'symbol');
4551 $o_Symbol->setRequired(
true);
4553 $o_Conversionrate =
new IlTextInputGUI($this->lng->txt(
'conversion_rate'),
'conversion_rate');
4554 $o_Conversionrate->setValue(
$_POST[
'conversion_rate']);
4555 $o_Conversionrate->setPostVar(
'conversion_rate');
4556 $o_Conversionrate->setRequired(
true);
4558 $form->addItem($o_Unit);
4559 $form->addItem($o_Isocode);
4560 $form->addItem($o_Symbol);
4561 $form->addItem($o_Conversionrate);
4563 $form->addCommandButton(
'saveCurrency', $this->lng->txt(
'save'));
4564 $form->addCommandButton(
'currencies', $this->lng->txt(
'cancel'));
4566 $this->tpl->setVariable(
'FORM', $form->getHTML());
4572 $obj_currency->setUnit(
$_POST[
'currency_unit']);
4573 $obj_currency->setIsoCode(
$_POST[
'iso_code']);
4574 $obj_currency->setSymbol(
$_POST[
'symbol']);
4575 $obj_currency->setConversionRate(
$_POST[
'conversion_rate']);
4576 $obj_currency->addCurrency();
4582 $currency_id =
$_POST[
'currency_id'];
4585 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.main_view.html',
'Services/Payment');
4587 $form->setFormAction($this->ctrl->getFormAction($this));
4588 $form->setTitle($this->lng->txt(
'paya_edit_currency'));
4590 $o_Unit =
new ilTextInputGUI($this->lng->txt(
'paya_currency_unit'),
'currency_unit');
4591 $o_Unit->
setValue($obj_currency[$currency_id][
'unit']);
4592 $o_Unit->setPostVar(
'currency_unit');
4593 $o_Unit->setRequired(
true);
4595 $o_Isocode =
new ilTextInputGUI($this->lng->txt(
'iso_code'),
'iso_code');
4596 $o_Isocode->
setValue($obj_currency[$currency_id][
'iso_code']);
4597 $o_Isocode->setPostVar(
'iso_code');
4598 $o_Isocode->setRequired(
true);
4600 $o_Symbol =
new ilTextInputGUI($this->lng->txt(
'symbol'),
'symbol');
4601 $o_Symbol->
setValue($obj_currency[$currency_id][
'symbol']);
4602 $o_Symbol->setPostVar(
'symbol');
4603 $o_Symbol->setRequired(
true);
4605 $o_Conversionrate =
new IlTextInputGUI($this->lng->txt(
'conversion_rate'),
'conversion_rate');
4606 $o_Conversionrate->setValue($obj_currency[$currency_id][
'conversion_rate']);
4607 $o_Conversionrate->setPostVar(
'conversion_rate');
4608 $o_Conversionrate->setRequired(
true);
4611 $o_hidden->setValue($obj_currency[$currency_id][
'currency_id']);
4612 $o_hidden->setPostVar(
'currency_id');
4613 $form->addItem($o_hidden);
4615 $form->addItem($o_Unit);
4616 $form->addItem($o_Isocode);
4617 $form->addItem($o_Symbol);
4618 $form->addItem($o_Conversionrate);
4620 $form->addCommandButton(
'updateCurrency', $this->lng->txt(
'save'));
4621 $form->addCommandButton(
'currencies', $this->lng->txt(
'cancel'));
4623 $this->tpl->setVariable(
'FORM', $form->getHTML());
4630 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.main_view.html',
'Services/Payment');
4635 $this->ctrl->setParameter($this,
'currency_id',(
int)
$_POST[
'currency_id']);
4637 $oConfirmationGUI->setFormAction($this->ctrl->getFormAction($this,
"performDeleteCurrency"));
4639 $oConfirmationGUI->setHeaderText($this->lng->txt(
"paya_sure_delete_selected_currency"));
4640 $oConfirmationGUI->setCancel($this->lng->txt(
"cancel"),
"currencies");
4641 $oConfirmationGUI->setConfirm($this->lng->txt(
"confirm"),
"performDeleteCurrency");
4645 $this->tpl->setVariable(
'CONFIRMATION', $oConfirmationGUI->getHtml());
4650 if(!
$_SESSION[
'currency_id'])
return false;
4653 $obj_currency->deleteCurrency();
4659 if(!
$_POST[
'currency_id'])
return false;
4662 $obj_currency->setUnit(
$_POST[
'currency_unit']);
4663 $obj_currency->setIsoCode(
$_POST[
'iso_code']);
4664 $obj_currency->setSymbol(
$_POST[
'symbol']);
4665 $obj_currency->setConversionRate(
$_POST[
'conversion_rate']);
4667 $obj_currency->updateCurrency();
4677 $ilToolbar->addButton($this->lng->txt(
'edit_page'), $this->ctrl->getLinkTargetByClass(array(
'ilpageobjectgui'),
'edit'));
4679 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.main_view.html',
'Services/Payment');
4688 include_once(
'./Services/Form/classes/class.ilPropertyFormGUI.php');
4690 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.main_view.html',
'Services/Payment');
4691 $this->tpl->addJavaScript(
'Services/Mail/js/ilMailComposeFunctions.js');
4694 $form_gui->setFormAction($this->ctrl->getFormAction($this,
'savebillingmail'));
4695 $form_gui->setTitle($this->lng->txt(
'billing_mail'));
4702 $inp->setRequired(
false);
4707 $chb =
new ilCheckboxInputGUI($this->lng->txt(
'activate_placeholders'),
'use_placeholders');
4711 $form_gui->addItem($inp);
4713 include_once
'Services/Payment/classes/class.ilBillingMailPlaceholdersPropertyGUI.php';
4716 $chb->addSubItem($prop);
4717 $chb->setChecked(
true);
4719 $form_gui->addItem($chb);
4721 $form_gui->addCommandButton(
'saveBillingMail', $this->lng->txt(
'save'));
4722 $this->tpl->setVariable(
'FORM', $form_gui->getHTML());
4734 $_POST[
'use_placeholders'] ? $placeholders = 1: $placeholders = 0;
4746 include_once
'Services/COPage/classes/class.ilPageObject.php';
4747 include_once
'Services/COPage/classes/class.ilPageObjectGUI.php';
4755 include_once
'Services/Style/classes/class.ilObjStyleSheet.php';
4760 $page_gui->setIntLinkHelpDefault(
'StructureObject',$a_editor_page_id);
4761 $page_gui->setLinkXML(
'');
4762 $page_gui->setFileDownloadLink($this->ctrl->getLinkTargetByClass(array(
'ilpageobjectgui'),
'downloadFile'));
4763 $page_gui->setFullscreenLink($this->ctrl->getLinkTargetByClass(array(
'ilpageobjectgui'),
'displayMediaFullscreen'));
4764 $page_gui->setSourcecodeDownloadScript($this->ctrl->getLinkTargetByClass(array(
'ilpageobjectgui'),
'download_paragraph'));
4765 $page_gui->setPresentationTitle(
'');
4766 $page_gui->setTemplateOutput(
false);
4767 $page_gui->setHeader(
'');
4768 $page_gui->setEnabledRepositoryObjects(
false);
4769 $page_gui->setEnabledFileLists(
true);
4770 $page_gui->setEnabledPCTabs(
true);
4771 $page_gui->setEnabledMaps(
true);
4772 $page_gui->setEnableEditing(
true);
4774 return $page_gui->showPage();
4781 $ilTabs->clearTargets();
4782 $ilTabs->setBackTarget($this->lng->txt(
'back'), $this->ctrl->getLinkTarget($this,
'documents'),
'_self');
4784 include_once
'Services/COPage/classes/class.ilPageObject.php';
4785 include_once
'Services/COPage/classes/class.ilPageObjectGUI.php';
4786 include_once(
'./Services/Style/classes/class.ilObjStyleSheet.php');
4794 $new_page_object->setParentId(0);
4795 $new_page_object->setId($a_editor_page_id);
4796 $new_page_object->createFromXML();
4799 $this->ctrl->setReturnByClass(
'ilpageobjectgui',
'edit');
4801 $page_gui =
new ilPageObjectGUI(
'shop',self::CONDITIONS_EDITOR_PAGE_ID);
4802 $page_gui->setIntLinkHelpDefault(
'StructureObject', self::CONDITIONS_EDITOR_PAGE_ID);
4803 $page_gui->setTemplateTargetVar(
'ADM_CONTENT');
4804 $page_gui->setLinkXML(
'');
4805 $page_gui->setFileDownloadLink($this->ctrl->getLinkTargetByClass(array(
'ilpageobjectgui'),
'downloadFile'));
4806 $page_gui->setFullscreenLink($this->ctrl->getLinkTargetByClass(array(
'ilpageobjectgui'),
'displayMediaFullscreen'));
4807 $page_gui->setSourcecodeDownloadScript($this->ctrl->getLinkTargetByClass(array(
'ilpageobjectgui'),
'download_paragraph'));
4808 $page_gui->setPresentationTitle(
'');
4809 $page_gui->setTemplateOutput(
false);
4810 $page_gui->setHeader(
'');
4811 $page_gui->setEnabledRepositoryObjects(
false);
4812 $page_gui->setEnabledFileLists(
true);
4813 $page_gui->setEnabledMaps(
true);
4814 $page_gui->setEnabledPCTabs(
true);
4816 return $this->ctrl->forwardCommand($page_gui);
4822 include_once(
'./Services/Form/classes/class.ilPropertyFormGUI.php');
4826 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.main_view.html',
'Services/Payment');
4827 $this->tpl->addJavaScript(
'Services/Mail/js/ilMailComposeFunctions.js');
4830 $form_gui->setFormAction($this->ctrl->getFormAction($this,
'saveInvoiceNumber'));
4831 $form_gui->setTitle($this->lng->txt(
'invoice_number_setting'));
4834 $radio_group =
new ilRadioGroupInputGUI($this->lng->txt(
'invoice_number'),
'ud_invoice_number');
4835 $radio_option_1 =
new ilRadioOption($this->lng->txt(
'ilias_invoice_number'),
'0');
4836 $radio_group->addOption($radio_option_1);
4837 $radio_option_2 =
new ilRadioOption($this->lng->txt(
'userdefined_invoice_number'),
'1');
4838 $radio_group->addOption($radio_option_2);
4839 $radio_group->setRequired(
true);
4840 $radio_group->
setValue($invObj->getUDInvoiceNumberActive(),
'0');
4841 $radio_group->setPostVar(
'ud_invoice_number');
4842 $form_gui->addItem($radio_group);
4845 $cur_num =
new ilNonEditableValueGUI($this->lng->txt(
'incremental_current_value'),
'inc_current_value');
4847 $radio_option_2->addSubItem($cur_num);
4850 $inc_num =
new ilNumberInputGUI($this->lng->txt(
'incremental_start_value'),
'inc_start_value');
4851 $inc_num->
setValue($this->error !=
"" && isset(
$_POST[
'incremental_start_value'])
4854 $inc_num->setInfo($this->lng->txt(
'incremental_start_value_info'));
4855 $radio_option_2->addSubItem($inc_num);
4858 $sel_reset =
new ilSelectInputGUI($this->lng->txt(
'invoice_number_reset_period'),
'inc_reset_period');
4859 $sel_reset->
setValue($this->error !=
"" && isset(
$_POST[
'inc_reset_period'])
4860 ?
$_POST[
'inc_reset_period']
4861 : $invObj->getIncResetPeriod());
4863 $reset_options = array(
4864 1 => $this->lng->txt(
'yearly'),
4865 2 => $this->lng->txt(
'monthly'));
4866 $sel_reset->setOptions($reset_options);
4868 $radio_option_2->addSubItem($sel_reset);
4871 $inp =
new ilTextAreaInputGUI($this->lng->txt(
'invoice_number_text'),
'invoice_number_text');
4872 $inp->
setValue( $this->error !=
"" && isset(
$_POST[
'invoice_number_text'])
4877 $inp->setRequired(
false);
4880 $radio_option_2->addSubItem($inp);
4885 $radio_option_2->addSubItem($prop);
4887 $form_gui->addCommandButton(
'saveInvoiceNumber', $this->lng->txt(
'save'));
4888 $this->tpl->setVariable(
'FORM', $form_gui->getHTML());
4894 if(
$_POST[
'ud_invoice_number'] == 1)
4896 if(
$_POST[
'inc_start_value'] <= 0 ||
$_POST[
'inc_start_value'] == NULL)
4898 $this->error = $this->lng->txt(
'start_value_cannot_be_null');
4903 if(
$_POST[
'invoice_number_text'] !== NULL)
4905 $check_text =
$_POST[
'invoice_number_text'];
4907 if(strpos($check_text,
'[INCREMENTAL_NUMBER]') === FALSE)
4909 $this->error = $this->lng->txt(
'invoice_number_must_contain_incremental_number');
4915 if(
$_POST[
'inc_reset_period'] == 1)
4917 if(strpos($check_text,
'[YEAR]') === FALSE && strpos($check_text,
'[CURRENT_TIMESTAMP]') === FALSE)
4919 $this->error = $this->lng->txt(
'invoice_number_must_contain_year_ct');
4924 else if(
$_POST[
'inc_reset_period'] == 2)
4926 if((strpos($check_text,
'[YEAR]') === FALSE || strpos($check_text,
'[MONTH]') === FALSE )
4927 && (strpos($check_text,
'[CURRENT_TIMESTAMP]') === FALSE))
4929 $this->error = $this->lng->txt(
'invoice_number_must_contain_year_month_ct');
4944 $invObj->setUDInvoiceNumberActive(
$_POST[
'ud_invoice_number']);
4945 $invObj->setIncStartValue(
$_POST[
'inc_start_value']);
4946 $invObj->setIncResetPeriod(
$_POST[
'inc_reset_period']);
4947 $invObj->setInvoiceNumberText(
$_POST[
'invoice_number_text']);