ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
ilObjPaymentSettingsGUI Class Reference
+ Inheritance diagram for ilObjPaymentSettingsGUI:
+ Collaboration diagram for ilObjPaymentSettingsGUI:

Public Member Functions

 __construct ($a_data, $a_id, $a_call_by_reference, $a_prepare_output=true)
 Constructor @access public. More...
 
 checkShopActivationObject ()
 
 updateDetailsObject ()
 
 performAddPriceObject ()
 
 performDeletePriceObject ()
 
 deletePriceObject ()
 
 updatePriceObject ()
 
 editDetailsObject ($a_show_confirm=false)
 
 deleteObjectObject ()
 
 performObjectDeleteObject ()
 
 resetObjectFilterObject ()
 
 objectsObject ()
 
 gatewayObject ()
 
 resetFilterObject ()
 
 statisticObject ()
 
 editStatisticObject ($a_show_confirm_delete=false)
 
 updateStatisticObject ()
 
 deleteStatisticObject ()
 
 performDeleteObject ()
 
 getTabs ($tabs_gui)
 get tabs @access public More...
 
 savePaypalSettingsObject ()
 
 vendorsObject ($a_show_confirm=false)
 
 exportVendorsObject ()
 
 addStatisticWorksheet (&$pewa)
 
 addVendorWorksheet ($pewa)
 
 payMethodsObject ($askForDeletingAddresses=array())
 
 savePayMethodsObject ()
 
 cancelDeleteVendorsObject ()
 
 deleteVendorsObject ()
 
 performDeleteVendorsObject ()
 
 editVendorObject ()
 
 performEditVendorObject ()
 
 showObjectSelectorObject ()
 
 searchObject ()
 
 addVendorObject ()
 
 addUserObject ()
 
 searchUserSPObject ()
 
 performSearchSPObject ()
 
 addCustomerObject ()
 
 saveCustomerObject ()
 
 vatsObject ()
 
 confirmDeleteVatObject ()
 
 performDeleteVatObject ()
 
 createVatObject ()
 
 editVatObject ()
 
 updateVatObject ()
 
 saveVatObject ()
 
 deleteAddressesForPaymethodsObject ()
 
 currenciesObject ()
 
 updateDefaultCurrencyObject ()
 
 addCurrencyObject ()
 
 saveCurrencyObject ()
 
 editCurrencyObject ()
 
 deleteCurrencyObject ()
 
 performDeleteCurrencyObject ()
 
 updateCurrencyObject ()
 
 TermsConditionsObject ()
 
 BillingMailObject ()
 
 saveBillingMailObject ()
 
 getDocumentsPageHTML ($a_editor_page_id)
 
 forwardToDocumentsPageObject ($a_editor_page_id)
 
 InvoiceNumberObject ()
 
 saveInvoiceNumberObject ()
 
 StatutoryRegulationsObject ()
 
 saveStatutoryRegulationsObject ()
 
 editPriceObject ()
 
- Public Member Functions inherited from ilObjectGUI
 ilObjectGUI ($a_data, $a_id=0, $a_call_by_reference=true, $a_prepare_output=true)
 Constructor @access public. More...
 
executeCommand ()
 execute command More...
 
 withReferences ()
 determines wether objects are referenced or not (got ref ids or not) More...
 
 setCreationMode ($a_mode=true)
 if true, a creation screen is displayed the current $_GET[ref_id] don't belong to the current class! the mode is determined in ilrepositorygui More...
 
 getCreationMode ()
 get creation mode More...
 
 getAdminTabs (&$tabs_gui)
 administration tabs show only permissions and trash folder More...
 
 getHTML ()
 
 confirmedDeleteObject ()
 confirmed deletion of object -> objects are moved to trash or deleted immediately, if trash is disabled More...
 
 cancelDeleteObject ()
 cancel deletion of object More...
 
 cancelObject ($in_rep=false)
 cancel action and go back to previous page @access public More...
 
 createObject ()
 create new object form More...
 
 cancelCreation ()
 cancel create action and go back to repository parent More...
 
 saveObject ()
 save object More...
 
 editObject ()
 edit object More...
 
 addExternalEditFormCustom (ilPropertyFormGUI $a_form)
 
 updateObject ()
 updates object entry in object_data More...
 
 getFormAction ($a_cmd, $a_formaction="")
 get form action for command (command is method name without "Object", e.g. More...
 
 isVisible ($a_ref_id, $a_type)
 
 viewObject ()
 list childs of current object More...
 
 deleteObject ($a_error=false)
 Display deletion confirmation screen. More...
 
 cloneAllObject ()
 Clone single (not container object) Method is overwritten in ilContainerGUI. More...
 

Data Fields

const CONDITIONS_EDITOR_PAGE_ID = 99999997
 
 $user_obj = null
 
 $pobject = null
 
 $genSetData = null
 
 $active_sub_tab
 
 $error = false
 
 $booking_obj = null
 
 $form = null
 
 $ilErr = null
 
 $vendors_obj = null
 
 $ctrl = null
 
 $tabs_gui = null
 
- Data Fields inherited from ilObjectGUI
const COPY_WIZARD_NEEDS_PAGE = 1
 
 $ilias
 
 $objDefinition
 
 $tpl
 
 $tree
 
 $lng
 
 $data
 
 $object
 
 $ref_id
 
 $obj_id
 
 $maxcount
 
 $formaction
 
 $return_location
 
 $target_frame
 
 $tab_target_script
 
 $actions
 
 $sub_objects
 
 $omit_locator = false
 
const CFORM_NEW = 1
 
const CFORM_IMPORT = 2
 
const CFORM_CLONE = 3
 

Private Member Functions

 __editPricesTable ($a_result_set)
 
 __getHTMLPath ($a_ref_id)
 
 __getVendors ()
 
 __getStatus ()
 
 __showObjectsTable ($a_result_set)
 
 __initPaymentObject ($a_pobject_id=0)
 
 getSubTabs ($a_tab, $a_sub_tab=null)
 
 __showStatisticTable ($a_result_set)
 
 __initBookingObject ()
 
 __showVendorsTable ($a_result_set)
 
 __showSearchUserTable ($a_result_set)
 
 __search ($a_search_string)
 
 __searchSP ($a_search_string)
 
 __showSearchUserSPTable ($a_result_set)
 
 initVatForm ($a_type='create')
 
 fillVATDataIntoVATForm ()
 

Additional Inherited Members

- Static Public Member Functions inherited from ilObjectGUI
static _gotoRepositoryRoot ($a_raise_error=false)
 Goto repository root. More...
 
static _gotoRepositoryNode ($a_ref_id, $a_cmd="frameset")
 Goto repository root. More...
 
- Protected Member Functions inherited from ilObjectGUI
 assignObject ()
 
 prepareOutput ()
 prepare output More...
 
 setTitleAndDescription ()
 called by prepare output More...
 
 initHeaderAction ($a_sub_type=null, $a_sub_id=null)
 Add header action menu. More...
 
 insertHeaderAction ($a_list_gui)
 Insert header action into main template. More...
 
 addHeaderAction ()
 Add header action menu. More...
 
 redrawHeaderActionObject ()
 Ajax call: redraw action header only. More...
 
 showMountWebfolderIcon ()
 
 setTabs ()
 set admin tabs @access public More...
 
 setAdminTabs ()
 set admin tabs @access public More...
 
 setLocator ()
 set Locator More...
 
 addLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 omitLocator ($a_omit=true)
 
 addAdminLocatorItems ($a_do_not_add_object=false)
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 initCreationForms ($a_new_type)
 Init creation froms. More...
 
 getCreationFormsHTML (array $a_forms)
 Get HTML for creation forms (accordion) More...
 
 initCreateForm ($a_new_type)
 Init object creation form. More...
 
 initDidacticTemplate (ilPropertyFormGUI $form)
 Show didactic template types. More...
 
 addDidacticTemplateOptions (array &$a_options)
 Add custom templates. More...
 
 getDidacticTemplateVar ($a_type)
 Get didactic template setting from creation screen. More...
 
 putObjectInTree (ilObject $a_obj, $a_parent_node_id=null)
 Add object to tree at given position. More...
 
 afterSave (ilObject $a_new_object)
 Post (successful) object creation hook. More...
 
 initEditForm ()
 Init object edit form. More...
 
 initEditCustomForm (ilPropertyFormGUI $a_form)
 Add custom fields to update form. More...
 
 getEditFormValues ()
 Get values for edit form. More...
 
 getEditFormCustomValues (array &$a_values)
 Add values to custom edit fields. More...
 
 validateCustom (ilPropertyFormGUI $a_form)
 Validate custom values (if not possible with checkInput()) More...
 
 updateCustom (ilPropertyFormGUI $a_form)
 Insert custom update form values into object. More...
 
 afterUpdate ()
 Post (successful) object update hook. More...
 
 initImportForm ($a_new_type)
 Init object import form. More...
 
 importFileObject ($parent_id=null, $a_catch_errors=true)
 Import. More...
 
 afterImport (ilObject $a_new_object)
 Post (successful) object import hook. More...
 
 setFormAction ($a_cmd, $a_formaction)
 set specific form action for command More...
 
 getReturnLocation ($a_cmd, $a_location="")
 get return location for command (command is method name without "Object", e.g. More...
 
 setReturnLocation ($a_cmd, $a_location)
 set specific return location for command More...
 
 getTargetFrame ($a_cmd, $a_target_frame="")
 get target frame for command (command is method name without "Object", e.g. More...
 
 setTargetFrame ($a_cmd, $a_target_frame)
 set specific target frame for command More...
 
 showPossibleSubObjects ()
 show possible subobjects (pulldown menu) More...
 
 getTemplateFile ($a_cmd, $a_type="")
 get a template blockfile format: tpl. More...
 
 getTitlesByRefId ($a_ref_ids)
 get Titles of objects this method is used for error messages in methods cut/copy/paste More...
 
 getTabs (&$tabs_gui)
 get tabs abstract method. More...
 
 __showButton ($a_cmd, $a_text, $a_target='')
 
 hitsperpageObject ()
 
__initTableGUI ()
 
 __setTableGUIBasicData (&$tbl, &$result_set, $a_from="")
 standard implementation for tables use 'from' variable use different initial setting of table More...
 
 redirectToRefId ($a_ref_id, $a_cmd="")
 redirects to (repository) view per ref id usually to a container and usually used at the end of a save/import method where the object gui type (of the new object) doesn't match with the type of the current $_GET["ref_id"] value More...
 
 fillCloneTemplate ($a_tpl_varname, $a_type)
 Fill object clone template This method can be called from any object GUI class that wants to offer object cloning. More...
 
 getCenterColumnHTML ()
 Get center column. More...
 
 getRightColumnHTML ()
 Display right column. More...
 
 setColumnSettings ($column_gui)
 May be overwritten in subclasses. More...
 
 checkPermission ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission and redirect on error. More...
 
 checkPermissionBool ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission. More...
 
 enableDragDropFileUpload ()
 Enables the file upload into this object by dropping files. More...
 
 handleAutoRating (ilObject $a_new_obj)
 Activate rating automatically if parent container setting. More...
 
- Protected Attributes inherited from ilObjectGUI
 $tmp_import_dir
 

Detailed Description

Definition at line 35 of file class.ilObjPaymentSettingsGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilObjPaymentSettingsGUI::__construct (   $a_data,
  $a_id,
  $a_call_by_reference,
  $a_prepare_output = true 
)

Constructor @access public.

Definition at line 77 of file class.ilObjPaymentSettingsGUI.php.

78 {
79 global $ilErr, $ilUser;
80
81 $this->user_obj = $ilUser;
82 $this->ilErr = $ilErr;
83
84 $this->pobject = new ilPaymentObject($this->user_obj);
85
86 $this->genSetData = ilPaymentSettings::_getInstance();
87 $this->vendors_obj = ilPaymentVendors::getInstance();
88
89 $this->type = 'pays';
90 $this->ilObjectGUI($a_data,$a_id,$a_call_by_reference,$a_prepare_output);
91
92 $this->lng->loadLanguageModule('payment');
93 }
ilObjectGUI($a_data, $a_id=0, $a_call_by_reference=true, $a_prepare_output=true)
Constructor @access public.
global $ilUser
Definition: imgupload.php:15

References $ilErr, $ilUser, ilPaymentSettings\_getInstance(), ilPaymentVendors\getInstance(), and ilObjectGUI\ilObjectGUI().

+ Here is the call graph for this function:

Member Function Documentation

◆ __editPricesTable()

ilObjPaymentSettingsGUI::__editPricesTable (   $a_result_set)
private

Definition at line 773 of file class.ilObjPaymentSettingsGUI.php.

774 {
775 $this->ctrl->setParameter($this, 'cmd', 'editprices');
776 $tbl = new ilShopTableGUI($this);
777
778 $tmp_obj = ilObjectFactory::getInstanceByRefId($this->pobject->getRefId(), false);
779 if($tmp_obj)
780 {
781 $tbl->setTitle($tmp_obj->getTitle());
782 }
783 else
784 {
785 $tbl->setTitle($this->lng->txt('object_not_found'));
786 }
787
788 $tbl->setId('tbl_bookings');
789 $tbl->setRowTemplate("tpl.shop_prices_row.html", "Services/Payment");
790
791 $tbl->addColumn(' ', 'price_id', '5%');
792 $tbl->addColumn($this->lng->txt('duration'), 'duration', '40%');
793 $tbl->addColumn($this->lng->txt('price_a'), 'price', '1%');
794 $tbl->addColumn($this->lng->txt('currency'), 'currency_unit', '10%');
795 $tbl->addColumn($this->lng->txt('extension_price'), 'extension', '10%');
796 $tbl->addColumn('', 'edit', '30%' );
797
798 $tbl->setSelectAllCheckbox('price_id');
799 $tbl->addCommandButton('addPrice',$this->lng->txt('paya_add_price'));
800
801 $tbl->addMultiCommand("deletePrice", $this->lng->txt("paya_delete_price"));
802 $tbl->fillFooter();
803
804 $tbl->setData($a_result_set);
805
806 $this->tpl->setVariable('TABLE', $tbl->getHTML());
807
808 return true;
809 }
getInstanceByRefId($a_ref_id, $stop_on_error=true)
get an instance of an Ilias object by reference id
Class ilShopTableGUI.
$tbl
Definition: example_048.php:81

References $tbl, and ilObjectFactory\getInstanceByRefId().

+ Here is the call graph for this function:

◆ __getHTMLPath()

ilObjPaymentSettingsGUI::__getHTMLPath (   $a_ref_id)
private

Definition at line 1375 of file class.ilObjPaymentSettingsGUI.php.

1376 {
1377 global $tree;
1378
1379 $path = $tree->getPathFull($a_ref_id);
1380
1381 unset($path[0]);
1382 $html = '';
1383 if(is_array($path))
1384 {
1385 foreach($path as $data)
1386 {
1387 $html .= $data['title'].' > ';
1388 }
1389 }
1390 return substr($html,0,-2);
1391 }
$html
Definition: example_001.php:87
$path
Definition: index.php:22

References ilObjectGUI\$data, $html, $path, and ilObjectGUI\$tree.

Referenced by editDetailsObject().

+ Here is the caller graph for this function:

◆ __getStatus()

ilObjPaymentSettingsGUI::__getStatus ( )
private

Definition at line 1419 of file class.ilObjPaymentSettingsGUI.php.

1420 {
1421 $option = array();
1422 $option[$this->pobject->STATUS_NOT_BUYABLE] = $this->lng->txt('paya_not_buyable');
1423 $option[$this->pobject->STATUS_BUYABLE] = $this->lng->txt('paya_buyable');
1424 $option[$this->pobject->STATUS_EXPIRES] = $this->lng->txt('paya_expires');
1425
1426 return $option;
1427 }

Referenced by editDetailsObject().

+ Here is the caller graph for this function:

◆ __getVendors()

ilObjPaymentSettingsGUI::__getVendors ( )
private

Definition at line 1393 of file class.ilObjPaymentSettingsGUI.php.

1394 {
1395 $options = array();
1396 $vendors = array();
1397
1398 $all_vendors = $this->vendors_obj->getVendors();
1399 if (is_array($all_vendors))
1400 {
1401 foreach ($all_vendors as $vendor)
1402 {
1403 $vendors[] = $vendor['vendor_id'];
1404 }
1405 }
1406
1407 foreach($vendors as $vendor)
1408 {
1409 if(!$tmp_obj = ilObjectFactory::getInstanceByObjId($vendor, false))
1410 {
1411 continue;
1412 }
1413
1414 $options[$vendor] = $tmp_obj->getFullname().' ['.$tmp_obj->getLogin().']';
1415 }
1416 return $options;
1417 }
getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
if(!is_array($argv)) $options

References $options, and ilObjectFactory\getInstanceByObjId().

Referenced by editDetailsObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __initBookingObject()

ilObjPaymentSettingsGUI::__initBookingObject ( )
private

Definition at line 3877 of file class.ilObjPaymentSettingsGUI.php.

3878 {
3879 include_once './Services/Payment/classes/class.ilPaymentBookings.php';
3880
3881 $this->booking_obj = new ilPaymentBookings($this->user_obj->getId(),true);
3882 }

Referenced by addStatisticWorksheet(), deleteAddressesForPaymethodsObject(), editStatisticObject(), performDeleteObject(), saveCustomerObject(), statisticObject(), and updateStatisticObject().

+ Here is the caller graph for this function:

◆ __initPaymentObject()

ilObjPaymentSettingsGUI::__initPaymentObject (   $a_pobject_id = 0)
private

Definition at line 1632 of file class.ilObjPaymentSettingsGUI.php.

1633 {
1634 $this->pobject = new ilPaymentObject($this->user_obj,$a_pobject_id);
1635 return true;
1636 }

Referenced by editDetailsObject(), objectsObject(), performDeletePriceObject(), performObjectDeleteObject(), and updateDetailsObject().

+ Here is the caller graph for this function:

◆ __search()

ilObjPaymentSettingsGUI::__search (   $a_search_string)
private

Definition at line 3933 of file class.ilObjPaymentSettingsGUI.php.

3934 {
3935 include_once('./Services/Search/classes/class.ilSearch.php');
3936
3937 $this->lng->loadLanguageModule('content');
3938
3939 $search = new ilSearch($_SESSION['AccountId']);
3940 $search->setPerformUpdate(false);
3941 $search->setSearchString(ilUtil::stripSlashes($a_search_string));
3942 $search->setCombination('and');
3943 $search->setSearchFor(array(0 => 'usr'));
3944 $search->setSearchType('new');
3945
3946 if($search->validate($message))
3947 {
3948 $search->performSearch();
3949 }
3950 else
3951 {
3952 ilUtil::sendInfo($message,true);
3953 $this->ctrl->redirect($this,'searchUser');
3954 }
3955 return $search->getResultByType('usr');
3956 }
$_SESSION["AccountId"]
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.

References $_SESSION, ilUtil\sendInfo(), and ilUtil\stripSlashes().

Referenced by performSearchSPObject(), and searchObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __searchSP()

ilObjPaymentSettingsGUI::__searchSP (   $a_search_string)
private

Definition at line 3958 of file class.ilObjPaymentSettingsGUI.php.

3959 {
3960 include_once('./Services/Search/classes/class.ilSearch.php');
3961
3962 $this->lng->loadLanguageModule('content');
3963
3964 $search = new ilSearch($this->user_obj->getId());
3965 $search->setPerformUpdate(false);
3966 $search->setSearchString(ilUtil::stripSlashes($a_search_string));
3967 $search->setCombination('and');
3968 $search->setSearchFor(array(0 => 'usr'));
3969 $search->setSearchType('new');
3970
3971 if($search->validate($message))
3972 {
3973 $search->performSearchSPObject();
3974 }
3975 else
3976 {
3977 ilUtil::sendInfo($message,true);
3978 $this->ctrl->redirect($this,'searchUserSP');
3979 }
3980 return $search->getResultByType('usr');
3981 }

References ilUtil\sendInfo(), and ilUtil\stripSlashes().

+ Here is the call graph for this function:

◆ __showObjectsTable()

ilObjPaymentSettingsGUI::__showObjectsTable (   $a_result_set)
private

Definition at line 1607 of file class.ilObjPaymentSettingsGUI.php.

1608 {
1609 $this->ctrl->setParameter($this, 'cmd', 'objects');
1610
1611 $tbl = new ilShopTableGUI($this);
1612 $tbl->setTitle($this->lng->txt('objects'));
1613
1614 $tbl->setId('tbl_show_objects');
1615 $tbl->setRowTemplate("tpl.shop_objects_row.html", "Services/Payment");
1616
1617 $tbl->addColumn($this->lng->txt('title'), 'title', '10%');
1618 $tbl->addColumn($this->lng->txt('status'), 'status', '10%');
1619 $tbl->addColumn($this->lng->txt('paya_pay_method'),'pay_method','10%');
1620 $tbl->addColumn($this->lng->txt('vat_rate'), 'vat_rate', '15%');
1621 $tbl->addColumn($this->lng->txt('paya_vendor'), 'vendor', '10%');
1622 $tbl->addColumn($this->lng->txt('paya_count_purchaser'), 'purchasers', '10%');
1623 $tbl->addColumn('','options','10%');
1624
1625 $tbl->setData($a_result_set);
1626
1627 $this->tpl->setVariable('TABLE', $tbl->getHTML());
1628
1629 return true;
1630 }

References $tbl.

Referenced by objectsObject().

+ Here is the caller graph for this function:

◆ __showSearchUserSPTable()

ilObjPaymentSettingsGUI::__showSearchUserSPTable (   $a_result_set)
private

Definition at line 3982 of file class.ilObjPaymentSettingsGUI.php.

3983 {
3984 $this->ctrl->setParameter($this, 'sell_id', $_GET['sell_id']);
3985 $tbl = new ilShopTableGUI($this);
3986
3987 $tbl->setTitle($this->lng->txt('users'));
3988 $tbl->setId('tbl_search_user_vendor');
3989 $tbl->setRowTemplate("tpl.shop_users_row.html", "Services/Payment");
3990
3991 $tbl->addColumn(' ', 'user_id', '3%', true);
3992 $tbl->addColumn($this->lng->txt('login'), 'login', '32%');
3993 $tbl->addColumn($this->lng->txt('firstname'),'firstname','32%');
3994 $tbl->addColumn($this->lng->txt('lastname'), 'lastname', '32%');
3995
3996
3997 $tbl->addMultiCommand("addCustomer", $this->lng->txt("add"));
3998 $tbl->addCommandButton('statistic',$this->lng->txt('cancel'));
3999
4000 $tbl->fillFooter();
4001 $tbl->setData($a_result_set);
4002 $this->tpl->setVariable('TABLE', $tbl->getHTML());
4003 return true;
4004 }
$_GET["client_id"]

References $_GET, and $tbl.

Referenced by performSearchSPObject().

+ Here is the caller graph for this function:

◆ __showSearchUserTable()

ilObjPaymentSettingsGUI::__showSearchUserTable (   $a_result_set)
private

Definition at line 3909 of file class.ilObjPaymentSettingsGUI.php.

3910 {
3911 $tbl = new ilShopTableGUI($this);
3912
3913 $tbl->setTitle($this->lng->txt("pays_header_select_vendor"));
3914 $tbl->setId('tbl_search_user_vendor');
3915 $tbl->setRowTemplate("tpl.shop_users_row.html", "Services/Payment");
3916
3917 $tbl->addColumn(' ', 'vendor_id', '3%', true);
3918 $tbl->addColumn($this->lng->txt('login'), 'login', '32%');
3919 $tbl->addColumn($this->lng->txt('firstname'),'firstname','32%');
3920 $tbl->addColumn($this->lng->txt('lastname'), 'lastname', '32%');
3921
3922 $tbl->setSelectAllCheckbox('vendor_id');
3923 $tbl->addMultiCommand("addUser", $this->lng->txt("add"));
3924 $tbl->addCommandButton('vendors',$this->lng->txt('cancel'));
3925
3926 $tbl->fillFooter();
3927 $tbl->setData($a_result_set);
3928 $this->tpl->setVariable('TABLE', $tbl->getHTML());
3929
3930 return true;
3931 }

References $tbl.

Referenced by searchObject().

+ Here is the caller graph for this function:

◆ __showStatisticTable()

ilObjPaymentSettingsGUI::__showStatisticTable (   $a_result_set)
private

Definition at line 3849 of file class.ilObjPaymentSettingsGUI.php.

3850 {
3851 $this->ctrl->setParameter($this, 'cmd', 'statistic');
3852
3853 $tbl = new ilShopTableGUI($this);
3854 $tbl->setTitle($this->lng->txt("bookings"));
3855 $tbl->setId('tbl_show_statistics');
3856 $tbl->setRowTemplate("tpl.shop_statistics_row.html", "Services/Payment");
3857
3858 $tbl->addColumn($this->lng->txt('paya_transaction'), 'transaction', '10%');
3859 $tbl->addColumn($this->lng->txt('title'), 'object_title', '10%');
3860 $tbl->addColumn($this->lng->txt('paya_vendor'), 'vendor', '10%');
3861 $tbl->addColumn($this->lng->txt('paya_customer'), 'customer', '10%');
3862 $tbl->addColumn($this->lng->txt('paya_order_date'), 'order_date', '10%');
3863 $tbl->addColumn($this->lng->txt('duration'), 'duration', '20%');
3864 $tbl->addColumn($this->lng->txt('price_a'), 'price', '5%');
3865 $tbl->addColumn($this->lng->txt('paya_coupons_coupon'), 'discount', '5%');
3866 $tbl->addColumn($this->lng->txt('paya_payed_access'), 'payed_access', '1%');
3867 $tbl->addColumn('','edit', '5%');
3868
3869 $tbl->addCommandButton('exportVendors',$this->lng->txt('excel_export'));
3870 $tbl->setData($a_result_set);
3871
3872 $this->tpl->setVariable('TABLE', $tbl->getHTML());
3873
3874 return true;
3875 }

References $tbl.

Referenced by statisticObject().

+ Here is the caller graph for this function:

◆ __showVendorsTable()

ilObjPaymentSettingsGUI::__showVendorsTable (   $a_result_set)
private

Definition at line 3884 of file class.ilObjPaymentSettingsGUI.php.

3885 {
3886 $this->ctrl->setParameter($this, 'cmd', 'vendors');
3887
3888 $tbl = new ilShopTableGUI($this);
3889 $tbl->setTitle($this->lng->txt("vendors"));
3890 $tbl->setId('tbl_show_vendors');
3891 $tbl->setRowTemplate("tpl.shop_users_row.html", "Services/Payment");
3892
3893 $tbl->addColumn('', 'vendor_id', '1%');
3894 $tbl->addColumn($this->lng->txt('paya_vendor'), 'login', '10%');
3895 $tbl->addColumn($this->lng->txt('pays_cost_center'), 'cost_center', '10%');
3896 $tbl->addColumn($this->lng->txt('pays_number_bookings'), 'number_bookings', '10%');
3897
3898 $tbl->addMultiCommand("editVendor", $this->lng->txt('pays_edit_vendor'));
3899 $tbl->addMultiCommand("deleteVendors", $this->lng->txt('pays_delete_vendor'));
3900
3901 $tbl->addCommandButton('exportVendors',$this->lng->txt('excel_export'));
3902
3903 $tbl->setData($a_result_set);
3904 $this->tpl->setVariable('TABLE', $tbl->getHTML());
3905
3906 return true;
3907 }

References $tbl.

Referenced by vendorsObject().

+ Here is the caller graph for this function:

◆ addCurrencyObject()

ilObjPaymentSettingsGUI::addCurrencyObject ( )

Definition at line 4364 of file class.ilObjPaymentSettingsGUI.php.

4365 {
4366 $this->tpl->addBlockfile('ADM_CONTENT','adm_content','tpl.main_view.html','Services/Payment');
4367 $form = new ilPropertyFormGUI();
4368 $form->setFormAction($this->ctrl->getFormAction($this));
4369 $form->setTitle($this->lng->txt('paya_add_currency'));
4370
4371 $o_Unit = new ilTextInputGUI($this->lng->txt('paya_currency_unit'),'currency_unit');
4372 $o_Unit->setValue($_POST['currency_unit']);
4373 $o_Unit->setPostVar('currency_unit');
4374 $o_Unit->setRequired(true);
4375
4376 $o_Isocode = new ilTextInputGUI($this->lng->txt('iso_code'),'iso_code');
4377 $o_Isocode->setValue($_POST['iso_code']);
4378 $o_Isocode->setPostVar('iso_code');
4379 $o_Isocode->setRequired(true);
4380
4381 $o_Symbol = new ilTextInputGUI($this->lng->txt('symbol'), 'symbol');
4382 $o_Symbol->setValue($_POST['symbol']);
4383 $o_Symbol->setPostVar('symbol');
4384 $o_Symbol->setRequired(true);
4385
4386 $o_Conversionrate = new IlTextInputGUI($this->lng->txt('conversion_rate'), 'conversion_rate');
4387 $o_Conversionrate->setValue($_POST['conversion_rate']);
4388 $o_Conversionrate->setPostVar('conversion_rate');
4389 $o_Conversionrate->setRequired(true);
4390
4391 $form->addItem($o_Unit);
4392 $form->addItem($o_Isocode);
4393 $form->addItem($o_Symbol);
4394 $form->addItem($o_Conversionrate);
4395
4396 $form->addCommandButton('saveCurrency', $this->lng->txt('save'));
4397 $form->addCommandButton('currencies', $this->lng->txt('cancel'));
4398
4399 $this->tpl->setVariable('FORM', $form->getHTML());
4400 }
This class represents a property form user interface.
This class represents a text property in a property form.
$_POST['username']
Definition: cron.php:12

References $_POST, and $form.

◆ addCustomerObject()

ilObjPaymentSettingsGUI::addCustomerObject ( )

Definition at line 3565 of file class.ilObjPaymentSettingsGUI.php.

3566 {
3567 global $ilToolbar;
3568
3569 if ($_POST['sell_id'] != '') $_GET['sell_id'] = $_POST['sell_id'];
3570 if ($_GET['user_id'] != '') $_POST['user_id'] = $_GET['user_id'];
3571
3572 if(!isset($_GET['sell_id']))
3573 {
3574 ilUtil::sendInfo($this->lng->txt('paya_no_booking_id_given'));
3575 $this->showObjectSelectorObject();
3576
3577 return true;
3578 }
3579
3580 if(!isset($_POST['user_id']))
3581 {
3582 ilUtil::sendInfo($this->lng->txt('paya_no_user_id_given'));
3583 $this->searchUserSPObject();
3584
3585 return true;
3586 }
3587 $this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.main_view.html','Services/Payment');
3588 $this->ctrl->setParameter($this, 'sell_id', $_GET['sell_id']);
3589
3590 $ilToolbar->addButton($this->lng->txt('back'), $this->ctrl->getLinkTarget($this, 'searchUserSP'));
3591
3592 $this->ctrl->setParameter($this, 'user_id', $_POST['user_id']);
3593
3594 $pObjectId = ilPaymentObject::_lookupPobjectId($_GET['sell_id']);
3595 $obj = new ilPaymentObject($this->user_obj, $pObjectId);
3596
3597 // get obj
3598 $tmp_obj = ilObjectFactory::getInstanceByRefId($_GET['sell_id'], false);
3599 if($tmp_obj)
3600 {
3601 $tmp_object['title'] = $tmp_obj->getTitle();
3602 }
3603 else
3604 {
3605 $tmp_object['title'] = $this->lng->txt('object_not_found');
3606 }
3607 // get customer_obj
3608 $tmp_user = ilObjectFactory::getInstanceByObjId($_POST['user_id']);
3609 // get vendor_obj
3610 $tmp_vendor = ilObjectFactory::getInstanceByObjId($obj->getVendorId());
3611
3612 $oForm = new ilPropertyFormGUI();
3613 $oForm->setFormAction($this->ctrl->getFormAction($this, 'saveCustomer'));
3614 $oForm->setTitle($this->lng->txt($tmp_user->getFullname().' ['.$tmp_user->getLogin().']'));
3615
3616 //transaction
3617 $oTransaction = new ilTextInputGUI();
3618 $oTransaction->setTitle($this->lng->txt('paya_transaction'));
3619 //$oTransaction->setValue(ilUtil::prepareFormOutut($_POST['transaction'], true));
3620 $oTransaction->setValue($_POST['transaction']);
3621 $oTransaction->setPostVar('transaction');
3622 $oForm->addItem($oTransaction);
3623
3624 //object
3625 $oObject = new ilNonEditableValueGUI($this->lng->txt('title'));
3626 $oObject->setValue($tmp_obj->getTitle());
3627 $oForm->addItem($oObject);
3628
3629 //vendor
3630 $oVendor = new ilNonEditableValueGUI($this->lng->txt('paya_vendor'));
3631 $oVendor->setValue($tmp_vendor->getFullname().' ['.$tmp_vendor->getLogin().']');
3632 $oForm->addItem($oVendor);
3633
3634 // pay methods
3635 $oPayMethods = new ilSelectInputGUI($this->lng->txt('paya_pay_method'), 'pay_method');
3636 $payOptions = ilPaymethods::getPayMethodsOptions(false);
3637 $oPayMethods->setOptions($payOptions);
3638 $oPayMethods->setValue($_POST['pay_method']);
3639 $oPayMethods->setPostVar('pay_method');
3640 $oForm->addItem($oPayMethods);
3641
3642 //duration
3643 $duration_options = array();
3644 $price_obj = new ilPaymentPrices($pObjectId);
3645
3646 $standard_prices = array();
3647 $extension_prices = array();
3648 $standard_prices = $price_obj->getPrices();
3649 $extension_prices = $price_obj->getExtensionPrices();
3650
3651 $prices = array_merge($standard_prices, $extension_prices );
3652
3653 if (is_array($prices))
3654 {
3656 $currency_unit = $genSet->get('currency_unit');
3657
3658 foreach($prices as $price)
3659 {
3660 switch($price['price_type'])
3661 {
3663 $txt_duration =
3664 $price['duration'].' '.$this->lng->txt('paya_months').' -> '.$price['price'].' '. $currency_unit;
3665 break;
3666
3668 include_once './Services/Calendar/classes/class.ilDatePresentation.php';
3669 $txt_duration = ilDatePresentation::formatDate(new ilDate($price['duration_from'], IL_CAL_DATE))
3670 .' - '.ilDatePresentation::formatDate(new ilDate($price['duration_until'], IL_CAL_DATE))
3671 ." -> ".ilPaymentPrices::_getPriceString($price["price_id"]) .' '.$currency_unit;
3672 break;
3673
3675 $txt_duration = $this->lng->txt('unlimited_duration').' -> '.$price['price'].' '. $currency_unit;
3676 break;
3677 }
3678 $txt_extension = '';
3679 if($price['extension'] == 1)
3680 {
3681 $txt_extension = ' ('.$this->lng->txt('extension_price').') ';
3682 }
3683 $duration_options[$price['price_id']] .= $txt_duration.''.$txt_extension;
3684 }
3685 }
3686
3687 $oDuration = new ilSelectInputGUI($this->lng->txt('duration'), 'price_id');
3688 $oDuration->setOptions($duration_options);
3689 $oDuration->setValue($_POST['price_id']);
3690 $oForm->addItem($oDuration);
3691
3692 //payed
3693 $o_payed = new ilSelectInputGUI();
3694 $payed_option = array('1'=>$this->lng->txt('yes'),'0'=>$this->lng->txt('no'));
3695
3696 $o_payed->setTitle($this->lng->txt('paya_payed'));
3697 $o_payed->setOptions($payed_option);
3698 $o_payed->setValue($_POST['payed']);
3699 $o_payed->setPostVar('payed');
3700 $oForm->addItem($o_payed);
3701
3702
3703 $o_access = new ilSelectInputGUI();
3704 $access_option = array('1'=>$this->lng->txt('yes'),'0'=>$this->lng->txt('no'));
3705
3706 $o_access->setTitle($this->lng->txt('paya_access'));
3707 $o_access->setOptions($access_option);
3708 $o_access->setValue($_POST['access']);
3709 $o_access->setPostVar('access');
3710
3711 $oForm->addItem($o_access);
3712
3713 $oForm->addCommandButton('saveCustomer',$this->lng->txt('save'));
3714 $oForm->addCommandButton('bookings', $this->lng->txt('cancel'));
3715
3716 $this->tpl->setVariable('FORM',$oForm->getHTML());
3717 return true;
3718 }
const IL_CAL_DATE
static formatDate(ilDateTime $date)
Format a date @access public.
Class for single dates.
This class represents a non editable value in a property form.
static _lookupPobjectId($a_ref_id)
static _getPriceString($a_price_id)
This class represents a selection list property in a property form.

References $_GET, $_POST, ilPaymentSettings\_getInstance(), ilPaymentPrices\_getPriceString(), ilPaymentObject\_lookupPobjectId(), ilDatePresentation\formatDate(), ilObjectFactory\getInstanceByObjId(), ilObjectFactory\getInstanceByRefId(), IL_CAL_DATE, searchUserSPObject(), ilUtil\sendInfo(), showObjectSelectorObject(), ilPaymentPrices\TYPE_DURATION_DATE, ilPaymentPrices\TYPE_DURATION_MONTH, and ilPaymentPrices\TYPE_UNLIMITED_DURATION.

Referenced by saveCustomerObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addStatisticWorksheet()

ilObjPaymentSettingsGUI::addStatisticWorksheet ( $pewa)

Definition at line 2805 of file class.ilObjPaymentSettingsGUI.php.

2806 {
2807 include_once './Services/Excel/classes/class.ilExcelUtils.php';
2808 include_once './Services/Payment/classes/class.ilPaymentVendors.php';
2809
2810 $this->__initBookingObject();
2811
2812 $workbook = $pewa->getWorkbook();
2813 $worksheet = $workbook->addWorksheet(utf8_decode($this->lng->txt('bookings')));
2814
2815 $worksheet->mergeCells(0,0,0,3);
2816 $worksheet->setColumn(0,0,16);
2817 $worksheet->setColumn(0,1,32);
2818 $worksheet->setColumn(0,2,32);
2819 $worksheet->setColumn(0,3,16);
2820 $worksheet->setColumn(0,4,16);
2821 $worksheet->setColumn(0,5,16);
2822 $worksheet->setColumn(0,6,24);
2823 $worksheet->setColumn(0,7,8);
2824 $worksheet->setColumn(0,8,12);
2825 $worksheet->setColumn(0,9,16);
2826
2827 $title = $this->lng->txt('bookings');
2828 $title .= ' '.$this->lng->txt('as_of').' ';
2829 $title .= strftime('%Y-%m-%d %R',time());
2830
2831 $worksheet->writeString(0,0,$title,$pewa->getFormatTitle());
2832
2833 $worksheet->writeString(1,0,$this->lng->txt('payment_system'),$pewa->getFormatHeader());
2834 $worksheet->writeString(1,1,$this->lng->txt('paya_transaction'),$pewa->getFormatHeader());
2835 $worksheet->writeString(1,2,$this->lng->txt('title'),$pewa->getFormatHeader());
2836 $worksheet->writeString(1,3,$this->lng->txt('paya_vendor'),$pewa->getFormatHeader());
2837 $worksheet->writeString(1,4,$this->lng->txt('pays_cost_center'),$pewa->getFormatHeader());
2838 $worksheet->writeString(1,5,$this->lng->txt('paya_customer'),$pewa->getFormatHeader());
2839 $worksheet->writeString(1,6,$this->lng->txt('email'),$pewa->getFormatHeader());
2840 $worksheet->writeString(1,7,$this->lng->txt('paya_order_date'),$pewa->getFormatHeader());
2841 $worksheet->writeString(1,8,$this->lng->txt('duration'),$pewa->getFormatHeader());
2842 $worksheet->writeString(1,9,$this->lng->txt('price_a'),$pewa->getFormatHeader());
2843 $worksheet->writeString(1,10,$this->lng->txt('paya_payed_access'),$pewa->getFormatHeader());
2844
2845 $worksheet->writeString(1,11,$this->lng->txt('street'),$pewa->getFormatHeader());
2846 $worksheet->writeString(1,12,$this->lng->txt('pay_bmf_po_box'),$pewa->getFormatHeader());
2847 $worksheet->writeString(1,13,$this->lng->txt('zipcode'),$pewa->getFormatHeader());
2848 $worksheet->writeString(1,14,$this->lng->txt('city'),$pewa->getFormatHeader());
2849 $worksheet->writeString(1,15,$this->lng->txt('country'),$pewa->getFormatHeader());
2850
2851 if(!count($bookings = $this->booking_obj->getBookings()))
2852 {
2853 return false;
2854 }
2855
2856 include_once 'Services/User/classes/class.ilObjUser.php';
2857 $object_title_cache = array();
2858 $user_title_cache = array();
2859
2860 $counter = 2;
2861 foreach($bookings as $booking)
2862 {
2863 if(array_key_exists($booking['ref_id'], $object_title_cache))
2864 {
2865 $tmp_obj = $object_title_cache[$booking['ref_id']];
2866 }
2867 else
2868 {
2869 $tmp_obj = ilObject::_lookupTitle(ilObject::_lookupObjId($booking['ref_id']));
2870 $object_title_cache[$booking['ref_id']] = $tmp_obj;
2871 }
2872 if(array_key_exists($booking['b_vendor_id'], $user_title_cache))
2873 {
2874 $tmp_vendor = $user_title_cache[$booking['b_vendor_id']];
2875 }
2876 else
2877 {
2878 $tmp_vendor = ilObjUser::_lookupLogin($booking['b_vendor_id']);
2879 $user_title_cache[$booking['b_vendor_id']] = $tmp_vendor;
2880 }
2881 if(array_key_exists($booking['customer_id'], $user_title_cache))
2882 {
2883 $tmp_purchaser = $user_title_cache[$booking['customer_id']];
2884 }
2885 else
2886 {
2887 $tmp_purchaser_name = ilObjUser::_lookupName($booking['customer_id']);
2888 $tmp_purchaser_login = ilObjUser::_lookupLogin($booking['customer_id']);
2889 $tmp_purchaser_email = ilObjUser::_lookupEmail($booking['customer_id']);
2890 $tmp_purchaser = ''.$tmp_purchaser_name['firstname'].' '.$tmp_purchaser_name['lastname'].' ['.$tmp_purchaser_login.']';
2891 $user_title_cache[$booking['customer_id']] = $tmp_purchaser;
2892 }
2893
2894 include_once './Services/Payment/classes/class.ilPayMethods.php';
2895 $str_paymethod = ilPayMethods::getStringByPaymethod($booking['b_pay_method']);
2896
2897 $worksheet->writeString($counter,0,$str_paymethod);
2898 $worksheet->writeString($counter,1,$booking['transaction']);
2899 $worksheet->writeString($counter,2,($tmp_obj != '' ? $tmp_obj : $this->lng->txt('object_deleted')));
2900 $worksheet->writeString($counter,3,($tmp_vendor != '' ? $tmp_vendor : $this->lng->txt('user_deleted')));
2901 $worksheet->writeString($counter,4,ilPaymentVendors::_getCostCenter($booking['b_vendor_id']));
2902 $worksheet->writeString($counter,5,($tmp_purchaser != '' ? $tmp_purchaser : $this->lng->txt('user_deleted')));
2903 $worksheet->writeString($counter,6,$tmp_purchaser_email);
2904 $worksheet->writeString($counter,7,strftime('%Y-%m-%d %R',$booking['order_date']));
2905 $worksheet->writeString($counter,8,$booking['duration']);
2906 $worksheet->writeString($counter,9,$booking['price']);
2907
2908 $payed_access = $booking['payed'] ?
2909 $this->lng->txt('yes') :
2910 $this->lng->txt('no');
2911
2912 $payed_access .= '/';
2913 $payed_access .= $booking['access_granted'] ?
2914 $this->lng->txt('yes') :
2915 $this->lng->txt('no');
2916
2917 $worksheet->writeString($counter,10,$payed_access);
2918
2919 $worksheet->writeString($counter,11,$booking['street']);
2920 $worksheet->writeString($counter,12,$booking['po_box']);
2921 $worksheet->writeString($counter,13,$booking['zipcode']);
2922 $worksheet->writeString($counter,14,$booking['city']);
2923 $worksheet->writeString($counter,15,$booking['country']);
2924
2925 unset($tmp_obj);
2926 unset($tmp_vendor);
2927 unset($tmp_purchaser);
2928
2929 ++$counter;
2930 }
2931 return true;
2932 }
static _lookupLogin($a_user_id)
lookup login
static _lookupName($a_user_id)
lookup user name
_lookupEmail($a_user_id)
Lookup email.
static _lookupObjId($a_id)
static _lookupTitle($a_id)
lookup object title
static getStringByPaymethod($a_type)

References __initBookingObject(), ilObjUser\_lookupEmail(), ilObjUser\_lookupLogin(), ilObjUser\_lookupName(), ilObject\_lookupObjId(), ilObject\_lookupTitle(), and ilPayMethods\getStringByPaymethod().

Referenced by exportVendorsObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addUserObject()

ilObjPaymentSettingsGUI::addUserObject ( )

Definition at line 3427 of file class.ilObjPaymentSettingsGUI.php.

3428 {
3429 global $rbacsystem;
3430
3431 // MINIMUM ACCESS LEVEL = 'administrate'
3432 if(!$rbacsystem->checkAccess('write', $this->object->getRefId()))
3433 {
3434 $this->ilErr->raiseError($this->lng->txt('msg_no_perm_write'),$this->ilErr->MESSAGE);
3435 }
3436
3437 $this->lng->loadLanguageModule('crs');
3438 if(!is_array($_POST['user']))
3439 {
3440 ilUtil::sendFailure($this->lng->txt('crs_no_users_selected'));
3441 $this->searchObject();
3442
3443 return false;
3444 }
3445
3446 $already_assigned = $assigned = 0;
3447 foreach($_POST['user'] as $usr_id)
3448 {
3449 if($this->vendors_obj->isAssigned($usr_id))
3450 {
3451 ++$already_assigned;
3452 continue;
3453 }
3454 $this->vendors_obj->add($usr_id);
3455 ++$assigned;
3456
3457 // TODO: SEND NOTIFICATION
3458 }
3459 $message = '';
3460 if($assigned)
3461 {
3462 $message .= $this->lng->txt('pays_assigned_vendors').' '.$assigned;
3463 }
3464 if($already_assigned)
3465 {
3466 $message .= '<br />'.$this->lng->txt('pays_already_assigned_vendors').' '.$already_assigned;
3467 }
3468
3469 ilUtil::sendInfo($message);
3470 $this->vendorsObject();
3471
3472 return true;
3473 }
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.

References $_POST, searchObject(), ilUtil\sendFailure(), ilUtil\sendInfo(), and vendorsObject().

+ Here is the call graph for this function:

◆ addVendorObject()

ilObjPaymentSettingsGUI::addVendorObject ( )

Definition at line 3388 of file class.ilObjPaymentSettingsGUI.php.

3389 {
3390 global $rbacsystem;
3391
3392 // MINIMUM ACCESS LEVEL = 'administrate'
3393 if(!$rbacsystem->checkAccess('write', $this->object->getRefId()))
3394 {
3395 $this->ilErr->raiseError($this->lng->txt('msg_no_perm_write'),$this->ilErr->MESSAGE);
3396 }
3397 if(!$_POST['user_login'])
3398 {
3399 ilUtil::sendFailure($this->lng->txt('pays_no_username_given'));
3400 $this->vendorsObject();
3401
3402 return true;
3403 }
3404 if(!($usr_id = ilObjUser::getUserIdByLogin(ilUtil::stripSlashes($_POST['user_login']))))
3405 {
3406 ilUtil::sendFailure($this->lng->txt('pays_no_valid_username_given'));
3407 $this->vendorsObject();
3408
3409 return true;
3410 }
3411
3412 if($this->vendors_obj->isAssigned($usr_id))
3413 {
3414 ilUtil::sendFailure($this->lng->txt('pays_user_already_assigned'));
3415 $this->vendorsObject();
3416
3417 return true;
3418 }
3419 $this->vendors_obj->add($usr_id);
3420
3421 ilUtil::sendSuccess($this->lng->txt('pays_added_vendor'));
3422 $this->vendorsObject();
3423
3424 return true;
3425 }
getUserIdByLogin($a_login)
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.

References $_POST, ilObjUser\getUserIdByLogin(), ilUtil\sendFailure(), ilUtil\sendSuccess(), ilUtil\stripSlashes(), and vendorsObject().

+ Here is the call graph for this function:

◆ addVendorWorksheet()

ilObjPaymentSettingsGUI::addVendorWorksheet (   $pewa)

Definition at line 2934 of file class.ilObjPaymentSettingsGUI.php.

2935 {
2936 include_once './Services/Excel/classes/class.ilExcelUtils.php';
2937
2938 $workbook = $pewa->getWorkbook();
2939 $worksheet = $workbook->addWorksheet($this->lng->txt('pays_vendor'));
2940
2941 // SHOW HEADER
2942 $worksheet->mergeCells(0,0,0,2);
2943 $worksheet->setColumn(1,0,32);
2944 $worksheet->setColumn(1,1,32);
2945 $worksheet->setColumn(1,2,32);
2946
2947 $title = $this->lng->txt('pays_vendor');
2948 $title .= ' '.$this->lng->txt('as_of').' ';
2949 $title .= strftime('%Y-%m-%d %R',time());
2950
2951 $worksheet->writeString(0,0,$title,$pewa->getFormatTitle());
2952
2953 $worksheet->writeString(1,0,$this->lng->txt('login'),$pewa->getFormatHeader());
2954 $worksheet->writeString(1,1,$this->lng->txt('fullname'),$pewa->getFormatHeader());
2955 $worksheet->writeString(1,2,$this->lng->txt('pays_cost_center'),$pewa->getFormatHeader());
2956
2957 if(!count($vendors = $this->vendors_obj->getVendors()))
2958 {
2959 return false;
2960 }
2961
2962 $counter = 2;
2963 foreach($vendors as $vendor)
2964 {
2965 // GET USER OBJ
2966 if($tmp_obj = ilObjectFactory::getInstanceByObjId($vendor['vendor_id'],false))
2967 {
2968 $worksheet->writeString($counter,0,$tmp_obj->getLogin());
2969 $worksheet->writeString($counter,1,$tmp_obj->getFullname());
2970 $worksheet->writeString($counter,2,$vendor['cost_center']);
2971 }
2972 unset($tmp_obj);
2973 ++$counter;
2974 }
2975 return true;
2976 }

References ilObjectFactory\getInstanceByObjId().

Referenced by exportVendorsObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ BillingMailObject()

ilObjPaymentSettingsGUI::BillingMailObject ( )

Definition at line 4519 of file class.ilObjPaymentSettingsGUI.php.

4520 {
4521 include_once('./Services/Form/classes/class.ilPropertyFormGUI.php');
4522
4523 $this->tpl->addBlockfile('ADM_CONTENT','adm_content','tpl.main_view.html','Services/Payment');
4524 $this->tpl->addJavaScript('Services/Mail/js/ilMailComposeFunctions.js');
4525
4526 $form_gui = new ilPropertyFormGUI();
4527 $form_gui->setFormAction($this->ctrl->getFormAction($this, 'savebillingmail'));
4528 $form_gui->setTitle($this->lng->txt('billing_mail'));
4529
4530
4531 // MESSAGE
4532 $inp = new ilTextAreaInputGUI($this->lng->txt('message_content'), 'm_message');
4533
4534 $inp->setValue(ilPaymentSettings::getMailBillingText());
4535 $inp->setRequired(false);
4536 $inp->setCols(60);
4537 $inp->setRows(10);
4538
4539 // PLACEHOLDERS
4540 $chb = new ilCheckboxInputGUI($this->lng->txt('activate_placeholders'), 'use_placeholders');
4541 $chb->setOptionTitle($this->lng->txt('activate_placeholders'));
4542 $chb->setValue(1);
4544 $form_gui->addItem($inp);
4545
4546 include_once 'Services/Payment/classes/class.ilBillingMailPlaceholdersPropertyGUI.php';
4548
4549 $chb->addSubItem($prop);
4550 $chb->setChecked(true);
4551
4552 $form_gui->addItem($chb);
4553
4554 $form_gui->addCommandButton('saveBillingMail', $this->lng->txt('save'));
4555 $this->tpl->setVariable('FORM', $form_gui->getHTML());
4556
4557 return true;
4558 }
This class represents a checkbox property in a property form.
This class represents a text area property in a property form.

References ilPaymentSettings\getMailBillingText(), and ilPaymentSettings\getMailUsePlaceholders().

Referenced by saveBillingMailObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cancelDeleteVendorsObject()

ilObjPaymentSettingsGUI::cancelDeleteVendorsObject ( )

Definition at line 3140 of file class.ilObjPaymentSettingsGUI.php.

3141 {
3142 unset($_SESSION['pays_vendor']);
3143 $_SESSION['disable_shop'] = false;
3144 $this->vendorsObject();
3145
3146 return true;
3147 }

References $_SESSION, and vendorsObject().

+ Here is the call graph for this function:

◆ checkShopActivationObject()

ilObjPaymentSettingsGUI::checkShopActivationObject ( )

Definition at line 95 of file class.ilObjPaymentSettingsGUI.php.

96 {
97// check general settings
98 $check = $this->genSetData->get('currency_unit');
99 if($check == null)
100 {
101 ilUtil::sendInfo($this->lng->txt('please_enter_currency'));
102 return $this->generalSettingsObject();
103 }
104
105 $check = $this->genSetData->get('address');
106 if($check == null)
107 {
108 ilUtil::sendInfo($this->lng->txt('please_enter_address'));
109 return $this->generalSettingsObject();
110 }
111
112 $check = $this->genSetData->get('bank_data');
113 if($check == null)
114 {
115 ilUtil::sendInfo($this->lng->txt('please_enter_bank_data'));
116 return $this->generalSettingsObject();
117 }
118
119 $check = $this->genSetData->get('pdf_path');
120 if($check == null)
121 {
122 ilUtil::sendInfo($this->lng->txt('please_enter_pdf_path'));
123 return $this->generalSettingsObject();
124 }
125
126// check paymethods
127 $pm_array = ilPaymethods::_getActivePaymethods();
128
129 if(count($pm_array) == 0)
130 {
131 ilUtil::sendInfo($this->lng->txt('please_activate_one_paymethod'));
132 $this->payMethodsObject();
133 return false;
134 }
135
136 foreach($pm_array as $paymethod)
137 {
138 switch($paymethod['pm_title'])
139 {
140 case 'bmf':
141 $check = unserialize($this->genSetData->get('bmf'));
142 if ($check['mandantNr'] == '' ||
143 $check['bewirtschafterNr'] == '' ||
144 $check['haushaltsstelle'] == '' ||
145 $check['objektNr'] == '' ||
146 $check['kennzeichenMahnverfahren'] == '' ||
147 $check['waehrungskennzeichen'] == '' ||
148 $check['ePaymentServer'] == '' ||
149 $check['clientCertificate'] == '' ||
150 $check['caCertificate'] == '' ||
151 $check['timeOut'] == '')
152 {
153 ilUtil::sendInfo($this->lng->txt('please_enter_bmf_data'));
154 $this->bmfSettingsObject();
155 return false;
156
157 }
158 break;
159 case 'paypal':
160 $check = unserialize($this->genSetData->get('paypal'));
161 if ($check['server_host'] == '' ||
162 $check['server_path'] == '' ||
163 $check['vendor'] == '' ||
164 $check['auth_token'] == '')
165 {
166 ilUtil::sendInfo($this->lng->txt('please_enter_paypal_data'));
167 $this->paypalSettingsObject();
168 return false;
169 }
170 break;
171 case 'epay':
172 case 'erp':
173 break;
174 }
175 }
176// check vats
177 include_once './Services/Payment/classes/class.ilShopVats.php';
178 $check= ilShopVats::_readAllVats();
179 if(count($check) == 0)
180 {
181 ilUtil::sendInfo($this->lng->txt('please_enter_vats'));
182 $this->vatsObject();
183 return false;
184 }
185// check vendors
186 $vendors = $this->vendors_obj->getVendors();
187
188 if(count($vendors) == 0)
189 {
190 ilUtil::sendInfo($this->lng->txt('please_create_vendor'));
191 $this->vendorsObject();
192 return false;
193 }
194
195// everything ok
196 ilUtil::sendInfo($this->lng->txt('shop_activation_ok'));
197 $this->generalSettingsObject();
198 return true;
199
200 }
payMethodsObject($askForDeletingAddresses=array())
static _readAllVats()

References ilShopVats\_readAllVats(), payMethodsObject(), ilUtil\sendInfo(), vatsObject(), and vendorsObject().

+ Here is the call graph for this function:

◆ confirmDeleteVatObject()

ilObjPaymentSettingsGUI::confirmDeleteVatObject ( )

Definition at line 4075 of file class.ilObjPaymentSettingsGUI.php.

4076 {
4077 if((int)$_GET['vat_id'] && !isset($_POST['vat_id']))
4078 {
4079 $_POST['vat_id'][] = $_GET['vat_id'];
4080 }
4081
4082 if($_SESSION['count_vats'] == count($_POST['vat_id']))
4083 {
4084 ilUtil::sendInfo($this->lng->txt('shop_disabled_no_vats'));
4085 $_SESSION['disable_shop'] = true;
4086 }
4087
4088 $c_gui = new ilConfirmationGUI();
4089 $c_gui->setFormAction($this->ctrl->getFormAction($this, 'performDeleteVat'));
4090 $c_gui->setHeaderText($this->lng->txt('paya_sure_delete_vats'));
4091 $c_gui->setCancel($this->lng->txt('cancel'), 'vats');
4092 $c_gui->setConfirm($this->lng->txt('confirm'), 'performDeleteVat');
4093
4094 $counter = 0;
4095 foreach((array)$_POST['vat_id'] as $vat_id)
4096 {
4097 try
4098 {
4099 $oVAT = new ilShopVats((int)$vat_id);
4100 $c_gui->addItem('vat_id[]', $oVAT->getId(), $oVAT->getTitle());
4101 ++$counter;
4102 }
4103 catch(ilShopException $e)
4104 {
4105 ilUtil::sendInfo($e->getMessage());
4106 return $this->vatsObject();
4107 }
4108 }
4109
4110 if($counter)
4111 {
4112 $this->tpl->setContent($c_gui->getHTML());
4113 return true;
4114 }
4115 else
4116 {
4117 $this->vatsObject();
4118 return true;
4119 }
4120 }
Confirmation screen class.
Class for shop related exception handling in ILIAS.
Class ilShopVats.

References $_GET, $_POST, $_SESSION, ilUtil\sendInfo(), and vatsObject().

+ Here is the call graph for this function:

◆ createVatObject()

ilObjPaymentSettingsGUI::createVatObject ( )

Definition at line 4153 of file class.ilObjPaymentSettingsGUI.php.

4154 {
4155 $this->initVatForm('create');
4156 $this->tpl->setContent($this->form->getHtml());
4157 }

References initVatForm().

+ Here is the call graph for this function:

◆ currenciesObject()

ilObjPaymentSettingsGUI::currenciesObject ( )

Definition at line 4309 of file class.ilObjPaymentSettingsGUI.php.

4310 {
4311 $this->tpl->addBlockfile('ADM_CONTENT','adm_content','tpl.main_view.html','Services/Payment');
4313 // currency table
4314 $counter = 0;
4315 foreach($currency_res as $cur)
4316 {
4317 $f_result[$counter]['currency_id'] = ilUtil::formRadioButton(0,'currency_id',$cur['currency_id']);
4318 $f_result[$counter]['is_default'] = $cur['is_default'] == 1 ? $this->lng->txt('yes') : $this->lng->txt('no');
4319
4320 $f_result[$counter]['currency_unit'] = $cur['unit'];
4321 $f_result[$counter]['iso_code'] = $cur['iso_code'];
4322 $f_result[$counter]['currency_symbol'] = $cur['symbol'];
4323 $f_result[$counter]['conversion_rate'] = $cur['conversion_rate'];
4324
4325 $counter++;
4326 }
4327
4328 $tbl = new ilShopTableGUI($this);
4329
4330 $tbl->setTitle($this->lng->txt("currencies"));
4331 $tbl->setId('tbl_show_currencies');
4332 $tbl->setRowTemplate("tpl.shop_currencies_row.html", "Services/Payment");
4333
4334 $tbl->addColumn(' ', 'currency_id', '1%', true);
4335 $tbl->addColumn($this->lng->txt('is_default'), 'is_default', '5%');
4336 $tbl->addColumn($this->lng->txt('currency_unit'), 'currency_unit', '10%');
4337 $tbl->addColumn($this->lng->txt('iso_code'),'iso_code','20%');
4338 $tbl->addColumn($this->lng->txt('currency_symbol'), 'currency_symbol', '20%');
4339 $tbl->addColumn($this->lng->txt('conversion_rate'), 'conversion_rate', '15%');
4340 $tbl->addColumn('', 'options', '5%');
4341
4342 $this->ctrl->setParameter($this, 'cmd', 'currencies');
4343
4344 $tbl->addMultiCommand('updateDefaultCurrency', $this->lng->txt('paya_set_default_currency'));
4345 $tbl->addMultiCommand("editCurrency",$this->lng->txt('edit'));
4346 $tbl->addMultiCommand("deleteCurrency", $this->lng->txt('delete'));
4347
4348 $tbl->addCommandButton('addCurrency',$this->lng->txt('add_currency'));
4349 $tbl->setData($f_result);
4350 $this->tpl->setVariable('TABLE', $tbl->getHTML());
4351 return true;
4352 }
static formRadioButton($checked, $varname, $value, $onclick=null, $disabled=false)
??? @access public

References $tbl, ilPaymentCurrency\_getAvailableCurrencies(), and ilUtil\formRadioButton().

Referenced by performDeleteCurrencyObject(), saveCurrencyObject(), updateCurrencyObject(), and updateDefaultCurrencyObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ deleteAddressesForPaymethodsObject()

ilObjPaymentSettingsGUI::deleteAddressesForPaymethodsObject ( )

Definition at line 4293 of file class.ilObjPaymentSettingsGUI.php.

4294 {
4295 // delete addresses here
4296 include_once './Services/Payment/classes/class.ilPayMethods.php';
4297 $this->__initBookingObject();
4298
4299 foreach($_POST['paymethod'] as $pay_method)
4300 {
4302 $del_bookings = $this->booking_obj->deleteAddressesByPaymethod((int)$pay_method);
4303 }
4304 ilUtil::sendSuccess($this->lng->txt('pays_updated_pay_method'));
4305 return $this->payMethodsObject();
4306 }
static _disableSaveUserAddress($a_id)

References __initBookingObject(), ilPayMethods\_disableSaveUserAddress(), payMethodsObject(), and ilUtil\sendSuccess().

+ Here is the call graph for this function:

◆ deleteCurrencyObject()

ilObjPaymentSettingsGUI::deleteCurrencyObject ( )

Definition at line 4459 of file class.ilObjPaymentSettingsGUI.php.

4460 {
4461
4462 $this->tpl->addBlockfile('ADM_CONTENT','adm_content','tpl.main_view.html','Services/Payment');
4463 if(ilPaymentCurrency::_isDefault($_POST['currency_id'])) return false;
4464 $_SESSION['currency_id'] = $_POST['currency_id'];
4465
4466 $oConfirmationGUI = new ilConfirmationGUI();
4467 $this->ctrl->setParameter($this,'currency_id',(int) $_POST['currency_id']);
4468 // set confirm/cancel commands
4469 $oConfirmationGUI->setFormAction($this->ctrl->getFormAction($this,"performDeleteCurrency"));
4470
4471 $oConfirmationGUI->setHeaderText($this->lng->txt("paya_sure_delete_selected_currency"));
4472 $oConfirmationGUI->setCancel($this->lng->txt("cancel"), "currencies");
4473 $oConfirmationGUI->setConfirm($this->lng->txt("confirm"), "performDeleteCurrency");
4474
4475 $oConfirmationGUI->addItem('currency_id','', ilPaymentCurrency::_getUnit($_POST['currency_id']),'' );
4476
4477 $this->tpl->setVariable('CONFIRMATION', $oConfirmationGUI->getHtml());
4478 return true;
4479 }
static _getUnit($a_currency_id)
static _isDefault($a_currency_id)

References $_POST, $_SESSION, ilPaymentCurrency\_getUnit(), and ilPaymentCurrency\_isDefault().

+ Here is the call graph for this function:

◆ deleteObjectObject()

ilObjPaymentSettingsGUI::deleteObjectObject ( )

Definition at line 1321 of file class.ilObjPaymentSettingsGUI.php.

1322 {
1323 //include_once './Services/Payment/classes/class.ilPaymentBookings.php';
1324
1325 if(!$_GET['pobject_id'])
1326 {
1327 ilUtil::sendInfo($this->lng->txt('paya_no_object_selected'));
1328
1329 $this->editDetailsObject();
1330 return true;
1331 }
1333 {
1334 ilUtil::sendInfo($this->lng->txt('paya_bookings_available'));
1335 $this->editDetailsObject();
1336
1337 return false;
1338 }
1339 else
1340 {
1341 ilUtil::sendQuestion($this->lng->txt('paya_sure_delete_object'));
1342 $this->editDetailsObject(true);
1343
1344 return true;
1345 }
1346 }
static _getCountBookingsByObject($a_pobject_id)
static sendQuestion($a_info="", $a_keep=false)
Send Question to Screen.

References $_GET, ilPaymentBookings\_getCountBookingsByObject(), editDetailsObject(), ilUtil\sendInfo(), and ilUtil\sendQuestion().

+ Here is the call graph for this function:

◆ deletePriceObject()

ilObjPaymentSettingsGUI::deletePriceObject ( )

Definition at line 1062 of file class.ilObjPaymentSettingsGUI.php.

1063 {
1064 if(!$_GET['pobject_id'])
1065 {
1066 ilUtil::sendInfo($this->lng->txt('paya_no_object_selected'));
1067
1068 $this->objectsObject();
1069 return true;
1070 }
1071
1072 if(!count($_POST['price_ids']))
1073 {
1074 ilUtil::sendInfo($this->lng->txt('paya_no_prices_selected'));
1075
1076 $this->editPricesObject();
1077 return true;
1078 }
1079 $_SESSION['price_ids'] = $_POST['price_ids'];
1080
1081 $this->editPricesObject(true);
1082 return true;
1083 }

References $_GET, $_POST, $_SESSION, objectsObject(), and ilUtil\sendInfo().

+ Here is the call graph for this function:

◆ deleteStatisticObject()

ilObjPaymentSettingsGUI::deleteStatisticObject ( )

Definition at line 2207 of file class.ilObjPaymentSettingsGUI.php.

2208 {
2209 if(!isset($_GET['booking_id']))
2210 {
2211 ilUtil::sendInfo($this->lng->txt('paya_no_booking_id_given'));
2212 $this->statisticObject();
2213
2214 return true;
2215 }
2216 ilUtil::sendQuestion($this->lng->txt('paya_sure_delete_stat'));
2217
2218 $this->editStatisticObject(true);
2219
2220 return true;
2221 }
editStatisticObject($a_show_confirm_delete=false)

References $_GET, editStatisticObject(), ilUtil\sendInfo(), ilUtil\sendQuestion(), and statisticObject().

+ Here is the call graph for this function:

◆ deleteVendorsObject()

ilObjPaymentSettingsGUI::deleteVendorsObject ( )

Definition at line 3149 of file class.ilObjPaymentSettingsGUI.php.

3150 {
3151 //include_once './Services/Payment/classes/class.ilPaymentBookings.php';
3152
3153 if(!count($_POST['vendor']))
3154 {
3155 ilUtil::sendFailure($this->lng->txt('pays_no_vendor_selected'));
3156 $this->vendorsObject();
3157
3158 return true;
3159 }
3160 // CHECK BOOKINGS
3161 foreach($_POST['vendor'] as $vendor)
3162 {
3164 {
3165 ilUtil::sendInfo($this->lng->txt('pays_active_bookings'));
3166 $this->vendorsObject();
3167
3168 return true;
3169 }
3170 }
3171
3172 $_SESSION['pays_vendor'] = $_POST['vendor'];
3173 ilUtil::sendQuestion($this->lng->txt('pays_sure_delete_selected_vendors'));
3174 $this->vendorsObject(true);
3175
3176 return true;
3177 }
static _getCountBookingsByVendor($a_vendor_id)

References $_POST, $_SESSION, ilPaymentBookings\_getCountBookingsByVendor(), ilUtil\sendFailure(), ilUtil\sendInfo(), ilUtil\sendQuestion(), and vendorsObject().

+ Here is the call graph for this function:

◆ editCurrencyObject()

ilObjPaymentSettingsGUI::editCurrencyObject ( )

Definition at line 4413 of file class.ilObjPaymentSettingsGUI.php.

4414 {
4415 $currency_id = $_POST['currency_id'];
4416 $obj_currency = ilPaymentCurrency::_getCurrency($currency_id);
4417
4418 $this->tpl->addBlockfile('ADM_CONTENT','adm_content','tpl.main_view.html','Services/Payment');
4419 $form = new ilPropertyFormGUI();
4420 $form->setFormAction($this->ctrl->getFormAction($this));
4421 $form->setTitle($this->lng->txt('paya_edit_currency'));
4422
4423 $o_Unit = new ilTextInputGUI($this->lng->txt('paya_currency_unit'),'currency_unit');
4424 $o_Unit->setValue($obj_currency[$currency_id]['unit']);
4425 $o_Unit->setPostVar('currency_unit');
4426 $o_Unit->setRequired(true);
4427
4428 $o_Isocode = new ilTextInputGUI($this->lng->txt('iso_code'),'iso_code');
4429 $o_Isocode->setValue($obj_currency[$currency_id]['iso_code']);
4430 $o_Isocode->setPostVar('iso_code');
4431 $o_Isocode->setRequired(true);
4432
4433 $o_Symbol = new ilTextInputGUI($this->lng->txt('symbol'), 'symbol');
4434 $o_Symbol->setValue($obj_currency[$currency_id]['symbol']);
4435 $o_Symbol->setPostVar('symbol');
4436 $o_Symbol->setRequired(true);
4437
4438 $o_Conversionrate = new IlTextInputGUI($this->lng->txt('conversion_rate'), 'conversion_rate');
4439 $o_Conversionrate->setValue($obj_currency[$currency_id]['conversion_rate']);
4440 $o_Conversionrate->setPostVar('conversion_rate');
4441 $o_Conversionrate->setRequired(true);
4442
4443 $o_hidden = new ilHiddenInputGUI('currency_id');
4444 $o_hidden->setValue($obj_currency[$currency_id]['currency_id']);
4445 $o_hidden->setPostVar('currency_id');
4446 $form->addItem($o_hidden);
4447
4448 $form->addItem($o_Unit);
4449 $form->addItem($o_Isocode);
4450 $form->addItem($o_Symbol);
4451 $form->addItem($o_Conversionrate);
4452
4453 $form->addCommandButton('updateCurrency', $this->lng->txt('save'));
4454 $form->addCommandButton('currencies', $this->lng->txt('cancel'));
4455
4456 $this->tpl->setVariable('FORM', $form->getHTML());
4457 }
This class represents a hidden form property in a property form.
static _getCurrency($a_currency_id)

References $_POST, $form, and ilPaymentCurrency\_getCurrency().

+ Here is the call graph for this function:

◆ editDetailsObject()

ilObjPaymentSettingsGUI::editDetailsObject (   $a_show_confirm = false)

Definition at line 1177 of file class.ilObjPaymentSettingsGUI.php.

1178 {
1179 global $ilToolbar;
1180
1181 if(!(int)$_GET['pobject_id'])
1182 {
1183 ilUtil::sendInfo($this->lng->txt('paya_no_object_selected'));
1184 return $this->objectsObject();
1185 }
1186
1187 $this->__initPaymentObject((int)$_GET['pobject_id']);
1188
1189 $this->ctrl->setParameter($this,'pobject_id', (int)$_GET['pobject_id']);
1190
1191 $ilToolbar->addButton($this->lng->txt('paya_edit_details'), $this->ctrl->getLinkTarget($this, 'editDetails'));
1192 $ilToolbar->addButton($this->lng->txt('paya_edit_prices'), $this->ctrl->getLinkTarget($this, 'editPrices'));
1193 $ilToolbar->addButton($this->lng->txt('pay_edit_abstract'), $this->ctrl->getLinkTargetByClass(array('ilshoppagegui'), 'edit'));
1194
1195 $this->tpl->addBlockfile('ADM_CONTENT','adm_content','tpl.main_view.html','Services/Payment');
1196
1197 $tmp_obj = ilObjectFactory::getInstanceByRefId($this->pobject->getRefId(),false);
1198 if($tmp_obj)
1199 {
1200 $tmp_object['title'] = $tmp_obj->getTitle();
1201 $tmp_object['type'] = $tmp_obj->getType();
1202 }
1203 else
1204 {
1205 $tmp_object['title'] = $this->lng->txt('object_not_found');
1206 $tmp_object['type'] = '';
1207
1208 }
1209 if($a_show_confirm)
1210 {
1211 include_once './Services/Utilities/classes/class.ilConfirmationGUI.php';
1212 $oConfirmationGUI = new ilConfirmationGUI();
1213
1214 // set confirm/cancel commands
1215 $oConfirmationGUI->setFormAction($this->ctrl->getFormAction($this,"performObjectDelete"));
1216 $oConfirmationGUI->setHeaderText($this->lng->txt("paya_sure_delete_object"));
1217 $oConfirmationGUI->setCancel($this->lng->txt("cancel"), "objects");
1218 $oConfirmationGUI->setConfirm($this->lng->txt("confirm"), "performObjectDelete");
1219
1220 $oConfirmationGUI->addItem('', $tmp_object['title'], $tmp_object['title']);
1221 $this->tpl->setVariable('CONFIRMATION',$oConfirmationGUI->getHTML());
1222
1223 return true;
1224 }
1225
1226 $oForm = new ilPropertyFormGUI();
1227 $oForm->setFormAction($this->ctrl->getFormAction($this, 'updateDetails'));
1228 $oForm->setTitle($tmp_object['title']);
1229
1230 // repository path
1231 $oPathGUI = new ilNonEditableValueGUI($this->lng->txt('path'));
1232 $oPathGUI->setValue($this->__getHTMLPath($this->pobject->getRefId()));
1233 $oForm->addItem($oPathGUI);
1234
1235 // number of purchasers
1236 $oPurchasersGUI = new ilNonEditableValueGUI($this->lng->txt('paya_count_purchaser'));
1237 $oPurchasersGUI->setValue(ilPaymentBookings::_getCountBookingsByObject((int)$_GET['pobject_id']));
1238 $oForm->addItem($oPurchasersGUI);
1239
1240 // vendors
1241 $oVendorsGUI = new ilSelectInputGUI($this->lng->txt('paya_vendor'), 'vendor');
1242 $oVendorsGUI->setOptions($this->__getVendors());
1243 $oVendorsGUI->setValue($this->pobject->getVendorId());
1244 $oForm->addItem($oVendorsGUI);
1245
1246 // status
1247 $oStatusGUI = new ilSelectInputGUI($this->lng->txt('status'), 'status');
1248 $oStatusGUI->setOptions($this->__getStatus());
1249 $oStatusGUI->setValue($this->pobject->getStatus());
1250 $oForm->addItem($oStatusGUI);
1251
1252 // pay methods
1253 $oPayMethodsGUI = new ilSelectInputGUI($this->lng->txt('paya_pay_method'), 'pay_method');
1254 $oPayMethodsGUI->setOptions(ilPayMethods::getPayMethodsOptions('not_specified'));
1255
1256 $oPayMethodsGUI->setValue($this->pobject->getPayMethod());
1257 $oForm->addItem($oPayMethodsGUI);
1258
1259 // topics
1260 include_once './Services/Payment/classes/class.ilShopTopics.php';
1262 if(is_array($topics = ilShopTopics::_getInstance()->getTopics()) && count($topics))
1263 {
1264 $oTopicsGUI = new ilSelectInputGUI($this->lng->txt('topic'), 'topic_id');
1265
1267 $topic_options = array();
1268 $topic_options[''] = $this->lng->txt('please_choose');
1269
1270 foreach($topics as $oTopic)
1271 {
1272 $topic_options[$oTopic->getId()] = $oTopic->getTitle();
1273 }
1274
1275 $oTopicsGUI->setOptions($topic_options);
1276 $oTopicsGUI->setValue($this->pobject->getTopicId());
1277 $oForm->addItem($oTopicsGUI);
1278 }
1279
1280 // vats
1281 $oShopVatsList = new ilShopVatsList();
1282 $oShopVatsList->read();
1283 if($oShopVatsList->hasItems())
1284 {
1285 $oVatsGUI = new ilSelectInputGUI($this->lng->txt('vat_rate'), 'vat_id');
1286
1287 $vats_options = array();
1288 foreach($oShopVatsList as $oVAT)
1289 {
1290 $vats_options[$oVAT->getId()] = ilShopUtils::_formatVAT($oVAT->getRate()).' -> '.$oVAT->getTitle();
1291 }
1292
1293 $oVatsGUI->setOptions($vats_options);
1294 $oVatsGUI->setValue($this->pobject->getVatId());
1295 $oForm->addItem($oVatsGUI);
1296 }
1297 else
1298 {
1299 $oVatsGUI = new ilNonEditableValueGUI($this->lng->txt('vat_rate'));
1300 $oVatsGUI->setValue($this->lng->txt('paya_no_vats_assigned'));
1301 $oForm->addItem($oVatsGUI);
1302 }
1303
1304 $oThumbnail = new ilImageFileInputGUI($this->lng->txt('pay_thumbnail'), 'thumbnail');
1305 $oFile = new ilFileDataShop($this->pobject->getPobjectId());
1306 if(($webpath_file = $oFile->getCurrentImageWebPath()) !== false)
1307 {
1308 $oThumbnail->setImage($webpath_file);
1309 }
1310 $oForm->addItem($oThumbnail);
1311
1312 // buttons
1313 $oForm->addCommandButton('updateDetails', $this->lng->txt('save'));
1314 $oForm->addCommandButton('deleteObject', $this->lng->txt('delete'));
1315
1316 $this->tpl->setVariable('FORM', $oForm->getHTML());
1317 return true;
1318
1319 }
This class handles all operations on files in directory data/shop.
This class represents an image file property in a property form.
static getPayMethodsOptions($type=0)
static _formatVAT($a_vat)
Formats a vat rate for gui output.
Class ilShopVatsList.

References $_GET, __getHTMLPath(), __getStatus(), __getVendors(), __initPaymentObject(), ilShopUtils\_formatVAT(), ilPaymentBookings\_getCountBookingsByObject(), ilShopTopics\_getInstance(), ilObjectFactory\getInstanceByRefId(), ilPayMethods\getPayMethodsOptions(), objectsObject(), and ilUtil\sendInfo().

Referenced by deleteObjectObject(), and updateDetailsObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ editPriceObject()

ilObjPaymentSettingsGUI::editPriceObject ( )

Definition at line 4898 of file class.ilObjPaymentSettingsGUI.php.

4899 {
4900 $this->tpl->addBlockfile('ADM_CONTENT', 'adm_content', 'tpl.main_view.html', 'Services/Payment');
4901
4902 $price_id = $_GET['price_id']?$_GET['price_id']: $_POST['price_id'];
4903 $price= ilPaymentPrices::_getPrice($price_id);
4904 $this->ctrl->setParameter($this,'pobject_id',(int) $_GET['pobject_id']);
4905 $tmp_pobject = ilPaymentObject::_getObjectData($_GET['pobject_id']);
4906 include_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
4907 $form = new ilPropertyFormGUI();
4908 $form->setFormAction($this->ctrl->getFormAction($this));
4909
4910 $tmp_obj = ilObjectFactory::getInstanceByRefId($tmp_pobject['ref_id'], false);
4911
4912 if($tmp_obj)
4913 {
4914 $form->setTitle($tmp_obj->getTitle());
4915 }
4916 else
4917 {
4918 $form->setTitle($this->lng->txt('object_not_found'));
4919 }
4920
4921 //price_type
4922 $radio_group = new ilRadioGroupInputGUI('','price_type');
4923 $radio_group->setTitle($this->lng->txt('duration'));
4924 $radio_group->setRequired(true);
4925 $radio_group->setValue($price['price_type']);
4926 $radio_group->setPostVar('price_type');
4927
4928 $radio_option_1 = new ilRadioOption($this->lng->txt('duration_month'), ilPaymentPrices::TYPE_DURATION_MONTH);
4929
4930 // duration month
4931 $oDuration = new ilNumberInputGUI();
4932 $oDuration->setTitle($this->lng->txt('paya_months'));
4933 $oDuration->setSize('20%');
4934 $oDuration->setValue($price['duration']);
4935 $oDuration->setPostVar('duration_month');
4936 $radio_option_1->addSubItem($oDuration);
4937
4938 $radio_group->addOption($radio_option_1);
4939
4940 $radio_option_3 = new ilRadioOption($this->lng->txt('duration_date'), ilPaymentPrices::TYPE_DURATION_DATE);
4941
4942 // duration_date from
4943 $o_date_from = new ilDateTimeInputGUI();
4944 $o_date_from->setTitle($this->lng->txt('cal_from'));
4945 $o_date_from->setDate(new ilDate($price['duration_from'],IL_CAL_DATE));
4946 $o_date_from->setPostVar('duration_date_from');
4947 $radio_option_3->addSubItem($o_date_from);
4948
4949 // duration_date until
4950 $o_date_until = new ilDateTimeInputGUI();
4951 $o_date_until->setTitle($this->lng->txt('cal_until'));
4952 $o_date_until->setDate(new ilDate($price['duration_until'],IL_CAL_DATE));
4953 $o_date_until->setPostVar('duration_date_until');
4954 $radio_option_3->addSubItem($o_date_until);
4955
4956 $radio_group->addOption($radio_option_3);
4957
4958 $radio_option_2 = new ilRadioOption($this->lng->txt('unlimited_duration'), ilPaymentPrices::TYPE_UNLIMITED_DURATION);
4959 $radio_group->addOption($radio_option_2);
4960
4961 $form->addItem($radio_group);
4962
4963 // description
4964 $oDescription = new ilTextAreaInputGUI($this->lng->txt('description'), 'description');
4965 $oDescription->setRows(4);
4966 $oDescription->setCols(35);
4967 $oDescription->setValue($price['description']);
4968 $form->addItem($oDescription);
4969
4970 // price
4971 $oPrice = new ilNumberInputGUI();
4972 $oPrice->setTitle($this->lng->txt('price_a'));
4973 $oPrice->setSize('20%');
4974 $oPrice->setRequired(true);
4975 $oPrice->setValue($price['price']);
4976 include_once './Services/Payment/classes/class.ilPaymentSettings.php';
4978 $oPrice->setInfo($genSet->get('currency_unit'));
4979 $oPrice->setPostVar('price');
4980 $oPrice->allowDecimals(true);
4981 $form->addItem($oPrice);
4982
4983 //extension
4984 $oExtension = new ilCheckboxInputGUI($this->lng->txt('extension_price'), 'extension');
4985
4986 $oExtension->setChecked($price['extension']);
4987
4988 $form->addItem($oExtension);
4989
4990 $o_hidden_1 = new ilHiddenInputGUI('pobject_id');
4991 $o_hidden_1->setValue( (int)$_GET['pobject_id']);
4992 $o_hidden_1->setPostVar('pobject_id');
4993
4994 $o_hidden_2 = new ilHiddenInputGUI('price_id');
4995 $o_hidden_2->setValue( (int)$_GET['price_id']);
4996 $o_hidden_2->setPostVar('price_id');
4997
4998 $form->addItem($o_hidden_1);
4999 $form->addItem($o_hidden_2);
5000
5001 $form->addCommandButton('updatePrice',$this->lng->txt('save'));
5002 $form->addCommandButton('editPrices', $this->lng->txt('cancel'));
5003
5004 $this->tpl->setVariable('FORM',$form->getHTML());
5005 }
This class represents a date/time property in a property form.
This class represents a number property in a property form.
static _getObjectData($a_id)
static _getPrice($a_price_id)
This class represents a property in a property form.
This class represents an option in a radio group.

References $_GET, $_POST, $form, ilPaymentSettings\_getInstance(), ilPaymentObject\_getObjectData(), ilPaymentPrices\_getPrice(), ilObjectFactory\getInstanceByRefId(), IL_CAL_DATE, ilPaymentPrices\TYPE_DURATION_DATE, ilPaymentPrices\TYPE_DURATION_MONTH, and ilPaymentPrices\TYPE_UNLIMITED_DURATION.

Referenced by performDeletePriceObject(), and updatePriceObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ editStatisticObject()

ilObjPaymentSettingsGUI::editStatisticObject (   $a_show_confirm_delete = false)

Definition at line 1985 of file class.ilObjPaymentSettingsGUI.php.

1986 {
1987 global $ilToolbar;
1988
1989 include_once './Services/Payment/classes/class.ilPayMethods.php';
1990
1991 if(!isset($_GET['booking_id']))
1992 {
1993 ilUtil::sendInfo($this->lng->txt('paya_no_booking_id_given'));
1994 $this->showStatistics();
1995
1996 return true;
1997 }
1998
1999 $ilToolbar->addButton($this->lng->txt('back'), $this->ctrl->getLinkTarget($this, 'statistic'));
2000
2001 $this->tpl->addBlockfile('ADM_CONTENT','adm_content','tpl.main_view.html','Services/Payment');
2002 $this->ctrl->setParameter($this,'booking_id',(int) $_GET['booking_id']);
2003
2004 // confirm delete
2005 if($a_show_confirm_delete)
2006 {
2007 $oConfirmationGUI = new ilConfirmationGUI();
2008
2009 // set confirm/cancel commands
2010 $oConfirmationGUI->setFormAction($this->ctrl->getFormAction($this,"performDelete"));
2011 $oConfirmationGUI->setHeaderText($this->lng->txt("paya_sure_delete_stat"));
2012 $oConfirmationGUI->setCancel($this->lng->txt("cancel"), "statistic");
2013 $oConfirmationGUI->setConfirm($this->lng->txt("confirm"), "performDelete");
2014
2015 $this->tpl->setVariable('CONFIRMATION', $oConfirmationGUI->getHTML());
2016 return true;
2017 }
2018
2019
2020 $this->__initBookingObject();
2021 $bookings = $this->booking_obj->getBookings();
2022 $booking = $bookings[(int) $_GET['booking_id']];
2023
2024 // get customer_obj
2025 $tmp_user = ilObjectFactory::getInstanceByObjId($booking['customer_id'], false);
2026
2027 $oForm = new ilPropertyFormGUI();
2028 $oForm->setFormAction($this->ctrl->getFormAction($this));
2029 $oForm->setId('stat_form');
2030 $oForm->setTableWidth('50 %');
2031 if(is_object($tmp_user))
2032 {
2033 $frm_user = $tmp_user->getFullname().' ['.$tmp_user->getLogin().']';
2034 }
2035 else
2036 {
2037 $frm_user = $this->lng->txt('user_deleted');
2038 }
2039 $oForm->setTitle($frm_user);
2040
2041 $pObj = new ilPaymentObject($this->user_obj, $booking['pobject_id']);
2042 $tmp_obj = ilObject::_lookupTitle(ilObject::_lookupObjId($pObj->getRefId()));
2043
2044 // object_title
2045 $oTitleGUI = new ilNonEditableValueGUI($this->lng->txt('title'));
2046 $oTitleGUI->setValue($tmp_obj != '' ? $tmp_obj : $this->lng->txt('object_deleted'));
2047 $oForm->addItem($oTitleGUI);
2048
2049 // transaction
2050 $oTransactionGUI = new ilNonEditableValueGUI($this->lng->txt('paya_transaction'));
2051 $oTransactionGUI->setValue($booking['transaction']);
2052 $oForm->addItem($oTransactionGUI);
2053
2054 //vendor
2055 $oVendorGUI = new ilNonEditableValueGUI($this->lng->txt('paya_vendor'));
2056 $tmp_vendor = ilObjectFactory::getInstanceByObjId($booking['b_vendor_id'], false);
2057 if(is_object($tmp_vendor))
2058 {
2059 $frm_vendor = $tmp_vendor->getFullname().' ['.$tmp_vendor->getLogin().']';
2060 }
2061 else
2062 {
2063 $frm_vendor = $this->lng->txt('user_deleted');
2064 }
2065 $oVendorGUI->setValue($frm_vendor);
2066 $oForm->addItem($oVendorGUI);
2067
2068 // paymethod
2069 $oPaymethodGUI = new ilNonEditableValueGUI($this->lng->txt('paya_pay_method'));
2070 $oPaymethodGUI->setValue(ilPayMethods::getStringByPaymethod($booking['b_pay_method']));
2071 $oForm->addItem($oPaymethodGUI);
2072
2073 // order_date
2074 $oOrderdateGUI = new ilNonEditableValueGUI($this->lng->txt('paya_order_date'));
2075 $oOrderdateGUI->setValue(ilDatePresentation::formatDate(new ilDate($booking['order_date'], IL_CAL_UNIX)));
2076 $oForm->addItem($oOrderdateGUI);
2077
2078 // duration
2079 $oDurationGUI = new ilNonEditableValueGUI($this->lng->txt('duration'));
2080 if($booking['duration'] == 0 && $booking['access_enddate'] == NULL)
2081 {
2082 $frm_duration = $this->lng->txt("unlimited_duration");
2083
2084 }
2085 else
2086 {
2087 if($booking['duration'] > 0)
2088 {
2089 $frm_duration = $booking['duration'].' '.$this->lng->txt('paya_months').'</br>';
2090 }
2091 $frm_duration .= ilDatePresentation::formatDate(new ilDate($booking['access_startdate'], IL_CAL_DATETIME))
2092 .' - '.ilDatePresentation::formatDate(new ilDate($booking['access_enddate'], IL_CAL_DATETIME));
2093
2094 }
2095 $oDurationGUI->setValue($frm_duration);
2096 $oForm->addItem($oDurationGUI);
2097
2098 // price
2099 $oPriceGUI = new ilNonEditableValueGUI($this->lng->txt('price_a'));
2100 $oPriceGUI->setValue($booking['price'].' '.$booking['currency_unit']);
2101 $oForm->addItem($oPriceGUI);
2102
2103 //discount
2104 $oDiscountGUI = new ilNonEditableValueGUI($this->lng->txt('paya_coupons_coupon'));
2105 $oDiscountGUI->setValue($booking['discount'].' '.$booking['currency_unit']);
2106 $oForm->addItem($oDiscountGUI);
2107
2108 // payed
2109 $oPayedGUI = new ilSelectInputGUI();
2110 $payed_option = array(0 => $this->lng->txt('no'),1 => $this->lng->txt('yes'));
2111
2112 $oPayedGUI->setTitle($this->lng->txt('paya_payed'));
2113 $oPayedGUI->setOptions($payed_option);
2114 $oPayedGUI->setValue($booking['payed']);
2115 $oPayedGUI->setPostVar('payed');
2116 $oForm->addItem($oPayedGUI);
2117
2118 // access
2119 $oAccessGUI = new ilSelectInputGUI();
2120 $access_option = array(0 => $this->lng->txt('no'),1 => $this->lng->txt('yes'));
2121
2122 $oAccessGUI->setTitle($this->lng->txt('paya_access'));
2123 $oAccessGUI->setOptions($access_option);
2124 $oAccessGUI->setValue($booking['access_granted']);
2125 $oAccessGUI->setPostVar('access');
2126 $oForm->addItem($oAccessGUI);
2127
2128 $oForm->addCommandButton('updateStatistic',$this->lng->txt('save'));
2129 $oForm->addCommandButton('deleteStatistic',$this->lng->txt('delete'));
2130
2131 // show CUSTOMER_DATA if isset -> setting: save_user_address
2132 if(ilPayMethods::_PMEnabled($booking['b_pay_method']))
2133 {
2134 $oForm2 = new ilPropertyFormGUI();
2135 $oForm2->setId('cust_form');
2136 $oForm2->setTableWidth('50%');
2137 $oForm2->setTitle($frm_user);
2138
2139 // email
2140 $oEmailGUI = new ilNonEditableValueGUI($this->lng->txt('email'));
2141 $email = (!$tmp_user) ? $this->lng->txt('user_deleted') : $tmp_user->getEmail();
2142 $oEmailGUI->setValue($email);
2143 $oForm2->addItem($oEmailGUI);
2144
2145 // street
2146 $oStreetGUI = new ilNonEditableValueGUI($this->lng->txt('street'));
2147 $oStreetGUI->setValue($booking['street']);
2148 $oForm2->addItem($oStreetGUI);
2149
2150 // pobox
2151 $oPoBoxGUI = new ilNonEditableValueGUI($this->lng->txt('pay_bmf_po_box'));
2152 $oPoBoxGUI->setValue($booking['po_box']);
2153 $oForm2->addItem($oPoBoxGUI);
2154
2155 // zipcode
2156 $oPoBoxGUI = new ilNonEditableValueGUI($this->lng->txt('zipcode'));
2157 $oPoBoxGUI->setValue($booking['zipcode']);
2158 $oForm2->addItem($oPoBoxGUI);
2159
2160 // city
2161 $oCityGUI = new ilNonEditableValueGUI($this->lng->txt('city'));
2162 $oCityGUI->setValue($booking['city']);
2163 $oForm2->addItem($oCityGUI);
2164
2165 // country
2166 $oCountryGUI = new ilNonEditableValueGUI($this->lng->txt('country'));
2167 $oCountryGUI->setValue($booking['country']);
2168 $oForm2->addItem($oCountryGUI);
2169 }
2170
2171 $this->tpl->setVariable('FORM',$oForm->getHTML());
2172 $this->tpl->setVariable('FORM_2',$oForm2->getHTML());
2173 return true;
2174
2175 }
const IL_CAL_UNIX
const IL_CAL_DATETIME
static _PMEnabled($a_id)

References $_GET, __initBookingObject(), ilObject\_lookupObjId(), ilObject\_lookupTitle(), ilPayMethods\_PMEnabled(), ilDatePresentation\formatDate(), ilObjectFactory\getInstanceByObjId(), ilPayMethods\getStringByPaymethod(), IL_CAL_DATETIME, IL_CAL_UNIX, and ilUtil\sendInfo().

Referenced by deleteStatisticObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ editVatObject()

ilObjPaymentSettingsGUI::editVatObject ( )

Definition at line 4159 of file class.ilObjPaymentSettingsGUI.php.

4160 {
4161 $this->initVatForm('edit');
4162 $this->fillVATDataIntoVATForm();
4163 $this->tpl->setContent($this->form->getHtml());
4164 }

References fillVATDataIntoVATForm(), and initVatForm().

+ Here is the call graph for this function:

◆ editVendorObject()

ilObjPaymentSettingsGUI::editVendorObject ( )

Definition at line 3210 of file class.ilObjPaymentSettingsGUI.php.

3211 {
3212 global $rbacsystem;
3213
3214 // MINIMUM ACCESS LEVEL = 'read'
3215 if(!$rbacsystem->checkAccess("write", $this->object->getRefId()))
3216 {
3217 $this->ilErr->raiseError($this->lng->txt("msg_no_perm_write"),$this->ilErr->MESSAGE);
3218 }
3219
3220 if(!count($_POST['vendor']))
3221 {
3222 ilUtil::sendInfo($this->lng->txt('pays_no_vendor_selected'));
3223 $this->vendorsObject();
3224
3225 return true;
3226 }
3227 if(count($_POST['vendor']) > 1)
3228 {
3229 ilUtil::sendInfo($this->lng->txt('pays_too_many_vendors_selected'));
3230 $this->vendorsObject();
3231
3232 return true;
3233 }
3234
3235 $_SESSION['pays_vendor'] = $_POST['vendor'][0];
3236
3237 if (!is_array($this->vendors_obj->vendors[$_SESSION['pays_vendor']]))
3238 {
3239 $this->vendorsObject();
3240
3241 return true;
3242 }
3243
3244 $this->tpl->addBlockfile('ADM_CONTENT','adm_content','tpl.main_view.html','Services/Payment');
3245
3246 $form_gui = new ilPropertyFormGUI();
3247 $form_gui->setFormAction($this->ctrl->getFormAction($this, 'performEditVendor'));
3248 $form_gui->setTitle($this->lng->txt('pays_vendor'));
3249
3250 $oVendorGUI = new ilNonEditableValueGUI($this->lng->txt('pays_vendor'));
3251 $oVendorGUI->setValue(ilObjUser::getLoginByUserId($this->vendors_obj->vendors[$_SESSION['pays_vendor']]['vendor_id']), true);
3252 $form_gui->addItem($oVendorGUI);
3253
3254 $oCostcenterGUI = new ilTextInputGUI($this->lng->txt('pays_cost_center'),'cost_center');
3255 $oCostcenterGUI->setValue($this->error != '' && isset($_POST['cost_center'])
3256 ? ilUtil::prepareFormOutput($_POST['cost_center'],true)
3257 : ilUtil::prepareFormOutput($this->vendors_obj->vendors[$_SESSION['pays_vendor']]['cost_center'],true));
3258 $form_gui->addItem($oCostcenterGUI);
3259
3260 $form_gui->addCommandButton('performEditVendor',$this->lng->txt('save'));
3261 $this->tpl->setVariable('FORM', $form_gui->getHTML());
3262 return true;
3263 }
error($a_errmsg)
set error message @access public
getLoginByUserId($a_userid)
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms @access public

References $_POST, $_SESSION, error(), ilObjUser\getLoginByUserId(), ilUtil\prepareFormOutput(), ilUtil\sendInfo(), and vendorsObject().

+ Here is the call graph for this function:

◆ exportVendorsObject()

ilObjPaymentSettingsGUI::exportVendorsObject ( )

Definition at line 2789 of file class.ilObjPaymentSettingsGUI.php.

2790 {
2791 include_once './Services/Payment/classes/class.ilPaymentExcelWriterAdapter.php';
2792
2793 $pewa = new ilPaymentExcelWriterAdapter('payment_vendors.xls');
2794
2795 // add/fill worksheet
2796 $this->addVendorWorksheet($pewa);
2797 $this->addStatisticWorksheet($pewa);
2798
2799 // HEADER SENT
2800
2801 $workbook = $pewa->getWorkbook();
2802 @$workbook->close();
2803 }

References addStatisticWorksheet(), and addVendorWorksheet().

+ Here is the call graph for this function:

◆ fillVATDataIntoVATForm()

ilObjPaymentSettingsGUI::fillVATDataIntoVATForm ( )
private

Definition at line 4207 of file class.ilObjPaymentSettingsGUI.php.

4208 {
4209 $oVAT = new ilShopVats((int)$_GET['vat_id']);
4210 $this->form->setValuesByArray(array(
4211 'vat_title' => $oVAT->getTitle(),
4212 'vat_rate' => $oVAT->getRate()
4213 ));
4214 }

References $_GET.

Referenced by editVatObject().

+ Here is the caller graph for this function:

◆ forwardToDocumentsPageObject()

ilObjPaymentSettingsGUI::forwardToDocumentsPageObject (   $a_editor_page_id)

Definition at line 4597 of file class.ilObjPaymentSettingsGUI.php.

4598 {
4599 global $ilTabs;
4600
4601 $ilTabs->clearTargets();
4602 $ilTabs->setBackTarget($this->lng->txt('back'), $this->ctrl->getLinkTarget($this,'documents'), '_self');
4603
4604 include_once 'Services/Payment/classes/class.ilShopPage.php';
4605 include_once 'Services/Payment/classes/class.ilShopPageGUI.php';
4606 include_once('./Services/Style/classes/class.ilObjStyleSheet.php');
4607
4608 $this->tpl->setVariable('LOCATION_CONTENT_STYLESHEET', ilObjStyleSheet::getContentStylePath(0));
4609
4610 if(!ilShopPage::_exists('shop', $a_editor_page_id))
4611 {
4612 // doesn't exist -> create new one
4613 $new_page_object = new ilShopPage();
4614 $new_page_object->setParentId(0);
4615 $new_page_object->setId($a_editor_page_id);
4616 $new_page_object->createFromXML();
4617 }
4618
4619 $this->ctrl->setReturnByClass('ilshoppagegui', 'edit');
4620
4621 $page_gui = new ilShopPageGUI(self::CONDITIONS_EDITOR_PAGE_ID);
4622
4623 return $this->ctrl->forwardCommand($page_gui);
4624 }
getContentStylePath($a_style_id)
get content style path
static _exists($a_parent_type, $a_id, $a_lang="", $a_no_cache=false)
Checks whether page exists.
Shop page GUI class.
Shop page object.

References ilPageObject\_exists(), and ilObjStyleSheet\getContentStylePath().

+ Here is the call graph for this function:

◆ gatewayObject()

ilObjPaymentSettingsGUI::gatewayObject ( )

Definition at line 1638 of file class.ilObjPaymentSettingsGUI.php.

1639 {
1640 switch($_POST['action'])
1641 {
1642 case 'deleteVendorsObject':
1643 $this->deleteVendors();
1644 break;
1645
1646 case 'editVendorObject':
1647 $this->editVendor();
1648 break;
1649
1650 case 'performEditVendorObject':
1651 $this->performEditVendorObject();
1652 break;
1653
1654 default:
1655 $this->vendorsObject();
1656 break;
1657 }
1658 return true;
1659 }

References $_POST, performEditVendorObject(), and vendorsObject().

+ Here is the call graph for this function:

◆ getDocumentsPageHTML()

ilObjPaymentSettingsGUI::getDocumentsPageHTML (   $a_editor_page_id)

Definition at line 4574 of file class.ilObjPaymentSettingsGUI.php.

4575 {
4576
4577 // page object
4578
4579 include_once 'Services/Payment/classes/class.ilShopPage.php';
4580 include_once 'Services/Payment/classes/class.ilShopPageGUI.php';
4581
4582 // if page does not exist, return nothing
4583 if(!ilShopPage::_exists('shop', $a_editor_page_id))
4584 {
4585 return '';
4586 }
4587
4588 include_once 'Services/Style/classes/class.ilObjStyleSheet.php';
4589 $this->tpl->setVariable('LOCATION_CONTENT_STYLESHEET', ilObjStyleSheet::getContentStylePath(0));
4590
4591 // get page object
4592 $page_gui = new ilShopPageGUI($a_editor_page_id);
4593
4594 return $page_gui->showPage();
4595 }

References ilPageObject\_exists(), and ilObjStyleSheet\getContentStylePath().

Referenced by TermsConditionsObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getSubTabs()

ilObjPaymentSettingsGUI::getSubTabs (   $a_tab,
  $a_sub_tab = null 
)
private

Definition at line 2314 of file class.ilObjPaymentSettingsGUI.php.

2315 {
2316 switch($a_tab)
2317 {
2318 case 'bookings':
2319 break;
2320 case 'objects':
2321 break;
2322 case 'vendors':
2323 break;
2324 case 'payMethods':
2325
2326 if(!$a_sub_tab) $a_sub_tab = 'payMethods';
2327 $this->tabs_gui->addSubTabTarget('settings',
2328 $this->ctrl->getLinkTargetByClass('ilobjpaymentsettingsgui', 'payMethods'),
2329 '','', '',$a_sub_tab == 'payMethods' ? true : false);
2330
2331 $this->tabs_gui->addSubTabTarget('pays_bmf',
2332 $this->ctrl->getLinkTargetByClass('ilobjpaymentsettingsgui', 'bmfSettings'),
2333 '','', '',$a_sub_tab == 'bmfSettings' ? true : false);
2334
2335 $this->tabs_gui->addSubTabTarget('pays_paypal',
2336 $this->ctrl->getLinkTargetByClass('ilobjpaymentsettingsgui', 'paypalSettings'),
2337 '','', '',$a_sub_tab == 'paypalSettings' ? true : false);
2338
2339 break;
2340 case 'currencies':
2341 break;
2342 case 'vats':
2343 break;
2344 case 'topics':
2345 if(!$a_sub_tab) $a_sub_tab = 'topics';
2346 $this->tabs_gui->addSubTabTarget('topics',
2347 $this->ctrl->getLinkTargetByClass('ilshoptopicsgui', 'showTopicsList'),
2348 '','', '',$a_sub_tab == 'showTopicsList' ? true : false);
2349
2350 $this->tabs_gui->addSubTabTarget('topics_settings',
2351 $this->ctrl->getLinkTargetByClass('ilshoptopicsgui', 'showTopicsSettings'),
2352 '','', '',$a_sub_tab == 'showTopicsSettings' ? true : false);
2353
2354 break;
2355 case 'documents':
2356 if(!$a_sub_tab) $a_sub_tab = 'terms_conditions';
2357 $this->tabs_gui->addSubTabTarget('terms_conditions',
2358 $this->ctrl->getLinkTargetByClass('ilobjpaymentsettingsgui', 'TermsConditions'),
2359 '','', '',$a_sub_tab == 'terms_conditions' ? true : false);
2360
2361 $this->tabs_gui->addSubTabTarget('billing_mail',
2362 $this->ctrl->getLinkTargetByClass('ilobjpaymentsettingsgui', 'BillingMail'),
2363 '','', '',$a_sub_tab == 'billing_mail' ? true : false);
2364 $this->tabs_gui->addSubTabTarget('invoice_number',
2365 $this->ctrl->getLinkTargetByClass('ilobjpaymentsettingsgui', 'InvoiceNumber'),
2366 '','', '',$a_sub_tab == 'invoice_number' ? true : false);
2367 $this->tabs_gui->addSubTabTarget('statutory_regulations',
2368 $this->ctrl->getLinkTargetByClass('ilobjpaymentsettingsgui', 'StatutoryRegulations'),
2369 '','', '',$a_sub_tab == 'statutory_regulations' ? true : false);
2370 break;
2371
2372 default:
2373 case 'settings':
2374 if (($_GET['cmd'] == '') || ($_GET['cmd'] == 'view') || ($a_sub_tab == 'generalSettings'))
2375 $a_sub_tab = 'generalSettings';
2376 break;
2377 }
2378 }

References $_GET.

◆ getTabs()

ilObjPaymentSettingsGUI::getTabs (   $tabs_gui)

get tabs @access public

Parameters
objectilTabsGUI gui object

Definition at line 2250 of file class.ilObjPaymentSettingsGUI.php.

2251 {
2252 global $rbacsystem, $ilHelp;
2253
2254 $tabs_gui->clearTargets();
2255 $ilHelp->setScreenIdComponent("pays");
2256 if ($rbacsystem->checkAccess('visible,read',$this->object->getRefId()))
2257 {
2258 // Settings
2259 $tabs_gui->addTarget('settings', $this->ctrl->getLinkTarget($this, 'generalSettings'),
2260 array('saveGeneralSettings','generalSettings ','saveBmfSettings','savePaypalSettings','paypalSettings',
2261// 'saveEPaySettings','epaySettings','saveERPsettings','delERPpreview','','testERPsettings','erpSettings',
2262 '','view'), '', '');
2263
2264 // Bookings
2265 $tabs_gui->addTarget('bookings', $this->ctrl->getLinkTarget($this, 'statistic'),
2266 array( 'statistic','editStatistic','updateStatistic','deleteStatistic','performDelete',
2267 'resetFilter','exportVendors','addCustomer', 'saveCustomer','showObjectSelector',
2268 'searchUserSP','performSearchSP'), '', '');
2269 // Objects
2270 $tabs_gui->addTarget('objects', $this->ctrl->getLinkTarget($this, 'objects'),
2271 array('updateObjectDetails','deleteObject','performObjectDelete','objects',
2272 'editPrices','addPrice','editDetails','resetObjectFilter'), '', '');
2273 // Vendors
2274 $tabs_gui->addTarget('vendors', $this->ctrl->getLinkTarget($this, 'vendors'),
2275 array('vendors','searchUser','search','performSearch','addVendor','addUser','exportVendors','deleteVendors','performDeleteVendors',
2276 'cancelDeleteVendors','editVendor','performEditVendor'), '', '');
2277
2278#TODO: CURRENCY not finished yet
2279/*
2280 // Currencies
2281 $tabs_gui->addTarget('currencies',
2282 $this->ctrl->getLinkTarget($this, 'currencies'),
2283 array('currencies','editCurrency','deleteCurrency','performDeleteCurrency','updateCurrency','updateDefaultCurrency'), '','');
2284/**/
2285 // Paymethods
2286 $tabs_gui->addTarget('pay_methods', $this->ctrl->getLinkTarget($this, 'payMethods'),
2287 #array('payMethods','savePayMethods'), '', '');
2288 array('payMethods','savePayMethods ','saveBmfSettings','savePaypalSettings','paypalSettings',
2289// 'saveEPaySettings','epaySettings','saveERPsettings','delERPpreview','','testERPsettings','erpSettings',
2290 '','view'), '', '');
2291
2292 // Topics
2293 $tabs_gui->addTarget('topics',
2294 $this->ctrl->getLinkTargetByClass('ilshoptopicsgui', ''), 'payment_topics', '', '');
2295
2296 // Vats
2297 $tabs_gui->addTarget('vats',
2298 $this->ctrl->getLinkTarget($this, 'vats'), 'vats', '', '');
2299
2300 // Documents
2301 $tabs_gui->addTarget('documents', $this->ctrl->getLinkTarget($this, 'documents'),
2302 array('documents','TermsConditions','saveTermsConditions','BillingMail',
2303 'saveBillingMail','InvoiceNumber','saveInvoiceNumber','StatutoryRegulations', 'saveStatutoryRegulations'), '', '');
2304 }
2305
2306 if ($rbacsystem->checkAccess('edit_permission',$this->object->getRefId()))
2307 {
2308 // Permissions
2309 $tabs_gui->addTarget('perm_settings',
2310 $this->ctrl->getLinkTargetByClass(array(get_class($this),'ilpermissiongui'), 'perm'), array('perm','info','owner'), 'ilpermissiongui');
2311 }
2312 }

References $tabs_gui.

◆ initVatForm()

ilObjPaymentSettingsGUI::initVatForm (   $a_type = 'create')
private

Definition at line 4166 of file class.ilObjPaymentSettingsGUI.php.

4167 {
4168 $this->form = new ilPropertyFormGUI();
4169 if($a_type == 'edit')
4170 {
4171 $this->ctrl->setParameter($this, 'vat_id', $_GET['vat_id']);
4172 $this->form->setFormAction($this->ctrl->getFormAction($this, 'updateVat'));
4173 $this->form->setTitle($this->lng->txt('payment_edit_vat'));
4174 }
4175 else
4176 {
4177 $this->form->setFormAction($this->ctrl->getFormAction($this, 'saveVat'));
4178 $this->form->setTitle($this->lng->txt('payment_add_vat'));
4179 }
4180
4181 $oTitle = new ilTextInputGUI($this->lng->txt('title'), 'vat_title');
4182 $oTitle->setMaxLength(255);
4183 $oTitle->setSize(40);
4184 $oTitle->setRequired(true);
4185 $oTitle->setInfo($this->lng->txt('payment_vat_title_info'));
4186 $this->form->addItem($oTitle);
4187
4188 $oRate = new ilTextInputGUI($this->lng->txt('vat_rate'), 'vat_rate');
4189 $oRate->setMaxLength(5);
4190 $oRate->setSize(5);
4191 $oRate->setRequired(true);
4192 $oRate->setInfo($this->lng->txt('payment_vat_rate_info'));
4193 $this->form->addItem($oRate);
4194
4195 if($a_type == 'edit')
4196 {
4197 $this->form->addCommandButton('updateVat', $this->lng->txt('save'));
4198 }
4199 else
4200 {
4201 $this->form->addCommandButton('saveVat', $this->lng->txt('save'));
4202 }
4203
4204 $this->form->addCommandButton('vats', $this->lng->txt('cancel'));
4205 }

References $_GET.

Referenced by createVatObject(), editVatObject(), saveVatObject(), and updateVatObject().

+ Here is the caller graph for this function:

◆ InvoiceNumberObject()

ilObjPaymentSettingsGUI::InvoiceNumberObject ( )

Definition at line 4626 of file class.ilObjPaymentSettingsGUI.php.

4627 {
4628 include_once('./Services/Form/classes/class.ilPropertyFormGUI.php');
4629
4630 $invObj = new ilUserDefinedInvoiceNumber();
4631
4632 $this->tpl->addBlockfile('ADM_CONTENT','adm_content','tpl.main_view.html','Services/Payment');
4633 $this->tpl->addJavaScript('Services/Mail/js/ilMailComposeFunctions.js');
4634
4635 $form_gui = new ilPropertyFormGUI();
4636 $form_gui->setFormAction($this->ctrl->getFormAction($this, 'saveInvoiceNumber'));
4637 $form_gui->setTitle($this->lng->txt('invoice_number_setting'));
4638
4639 // invoice_type
4640 $radio_group = new ilRadioGroupInputGUI($this->lng->txt('invoice_number'), 'ud_invoice_number');
4641 $radio_option_1 = new ilRadioOption($this->lng->txt('ilias_invoice_number'), '0');
4642 $radio_group->addOption($radio_option_1);
4643 $radio_option_2 = new ilRadioOption($this->lng->txt('userdefined_invoice_number'), '1');
4644 $radio_group->addOption($radio_option_2);
4645 $radio_group->setRequired(true);
4646 $radio_group->setValue($invObj->getUDInvoiceNumberActive(),'0');
4647 $radio_group->setPostVar('ud_invoice_number');
4648 $form_gui->addItem($radio_group);
4649
4650 // incremental current value
4651 $cur_num = new ilNonEditableValueGUI($this->lng->txt('incremental_current_value'), 'inc_current_value');
4652 $cur_num->setValue(ilUserDefinedInvoiceNumber::_getIncCurrentValue(), 1);
4653 $radio_option_2->addSubItem($cur_num);
4654
4655 // incremental start value
4656 $inc_num = new ilNumberInputGUI($this->lng->txt('incremental_start_value'), 'inc_start_value');
4657 $inc_num->setValue($this->error != "" && isset($_POST['incremental_start_value'])
4658 ? ilUtil::prepareFormOutput($_POST['incremental_start_value'],true)
4659 : ilUtil::prepareFormOutput($invObj->getIncStartValue(),true));
4660 $inc_num->setInfo($this->lng->txt('incremental_start_value_info'));
4661 $radio_option_2->addSubItem($inc_num);
4662
4663 // reset period of current value
4664 $sel_reset = new ilSelectInputGUI($this->lng->txt('invoice_number_reset_period'), 'inc_reset_period');
4665 $sel_reset->setValue($this->error != "" && isset($_POST['inc_reset_period'])
4666 ? $_POST['inc_reset_period']
4667 : $invObj->getIncResetPeriod());
4668
4669 $reset_options = array(
4670 1 => $this->lng->txt('yearly'),
4671 2 => $this->lng->txt('monthly'));
4672 $sel_reset->setOptions($reset_options);
4673
4674 $radio_option_2->addSubItem($sel_reset);
4675
4676 // invoice_number_text
4677 $inp = new ilTextAreaInputGUI($this->lng->txt('invoice_number_text'), 'invoice_number_text');
4678 $inp->setValue( $this->error != "" && isset($_POST['invoice_number_text'])
4679 ? ilUtil::prepareFormOutput($_POST['invoice_number_text'],true)
4680 : ilUtil::prepareFormOutput($invObj->getInvoiceNumberText(),true));
4681
4682
4683 $inp->setRequired(false);
4684 $inp->setCols(60);
4685 $inp->setRows(3);
4686 $radio_option_2->addSubItem($inp);
4687
4688 // PLACEHOLDERS
4689
4691 $radio_option_2->addSubItem($prop);
4692
4693 $form_gui->addCommandButton('saveInvoiceNumber', $this->lng->txt('save'));
4694 $this->tpl->setVariable('FORM', $form_gui->getHTML());
4695 }

References $_POST, ilUserDefinedInvoiceNumber\_getIncCurrentValue(), error(), and ilUtil\prepareFormOutput().

Referenced by saveInvoiceNumberObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ objectsObject()

ilObjPaymentSettingsGUI::objectsObject ( )

Definition at line 1442 of file class.ilObjPaymentSettingsGUI.php.

1443 {
1444 global $rbacsystem;
1445
1446 // MINIMUM ACCESS LEVEL = 'read'
1447 if(!$rbacsystem->checkAccess('read', $this->object->getRefId()))
1448 {
1449 $this->ilErr->raiseError($this->lng->txt('msg_no_perm_read'),$this->ilErr->MESSAGE);
1450 }
1451
1452 if ($_POST['updateView'] == 1)
1453 {
1454 $_SESSION['pay_objects']['title_type'] = $_POST['title_type'];
1455 $_SESSION['pay_objects']['title_value'] = $_POST['title_value'];
1456 $_SESSION['pay_objects']['pay_method'] = $_POST['pay_method'];
1457 $_SESSION['pay_objects']['vendor'] = $_POST['vendor'];
1458 }
1459
1460 $this->tpl->addBlockfile('ADM_CONTENT','adm_content','tpl.main_view.html','Services/Payment');
1461
1462 $this->__initPaymentObject();
1463 $this->lng->loadLanguageModule('search');
1464
1465 $filter_form = new ilPropertyFormGUI();
1466 $filter_form->setFormAction($this->ctrl->getFormAction($this));
1467 $filter_form->setTitle($this->lng->txt('pay_filter'));
1468 $filter_form->setId('filter_form');
1469 $filter_form->setTableWidth('100 %');
1470
1471 //hide_filter
1472 $o_hide_check = new ilCheckBoxInputGUI($this->lng->txt('show_filter'),'show_filter');
1473 $o_hide_check->setValue(1);
1474 $o_hide_check->setChecked($_POST['show_filter'] ? 1 : 0);
1475
1476 $o_hidden = new ilHiddenInputGUI('updateView');
1477 $o_hidden->setValue(1);
1478 $o_hidden->setPostVar('updateView');
1479 $o_hide_check->addSubItem($o_hidden);
1480
1481 //title
1482 $radio_group = new ilRadioGroupInputGUI($this->lng->txt('search_in_title'), 'title_type');
1483 $radio_option = new ilRadioOption($this->lng->txt('search_any_word'), 'or');
1484 $radio_group->addOption($radio_option);
1485 $radio_option = new ilRadioOption($this->lng->txt('search_all_words'), 'and');
1486 $radio_group->addOption($radio_option);
1487
1488 $radio_group->setRequired(false);
1489 $radio_group->setValue('or');
1490 $radio_group->setPostVar('title_type');
1491
1492 $o_title = new ilTextInputGUI();
1493 $o_title->setValue($_SESSION['pay_objects']['title_value']);
1494 $o_title->setPostVar('title_value');
1495 $o_title->setTitle($this->lng->txt('title'));
1496
1497 $o_hide_check->addSubItem($radio_group);
1498 $o_hide_check->addSubItem($o_title);
1499
1500 //vendor
1501 $o_vendor = new ilTextInputGUI();
1502 $o_vendor->setTitle($this->lng->txt('paya_vendor'));
1503 $o_vendor->setValue($_SESSION['pay_objects']['vendor']);
1504 $o_vendor->setPostVar('vendor');
1505 $o_hide_check->addSubItem($o_vendor);
1506
1507 // paymethod
1508 $o_paymethod = new ilSelectInputGUI();
1509 $o_paymethod->setTitle($this->lng->txt('payment_system'));
1510 $o_paymethod->setOptions(ilPaymethods::getPayMethodsOptions('all'));
1511 $o_paymethod->setValue($_SESSION['pay_objects']['pay_method']);
1512 $o_paymethod->setPostVar('pay_method');
1513 $o_hide_check->addSubItem($o_paymethod);
1514
1515 $filter_form->addCommandButton('objects', $this->lng->txt('pay_update_view'));
1516 $filter_form->addCommandButton('resetObjectFilter', $this->lng->txt('pay_reset_filter'));
1517
1518 $filter_form->addItem($o_hide_check);
1519 if(!count($objects = ilPaymentObject::_getAllObjectsData()))
1520 {
1521 ilUtil::sendInfo($this->lng->txt('paya_no_objects_assigned'));
1522
1523 return true;
1524 }
1525 $this->tpl->setVariable('FORM', $filter_form->getHTML());
1526
1527 $counter = 0;
1528 foreach($objects as $data)
1529 {
1530 $tmp_obj = ilObjectFactory::getInstanceByRefId($data['ref_id'], false);
1531 if($tmp_obj)
1532 {
1533 $f_result[$counter]['title'] = $tmp_obj->getTitle();
1534 }
1535 else
1536 {
1537 $f_result[$counter]['title'] = $this->lng->txt('object_not_found');
1538 }
1539
1540 switch($data['status'])
1541 {
1542 case $this->pobject->STATUS_BUYABLE:
1543 $f_result[$counter]['status'] = $this->lng->txt('paya_buyable');
1544 break;
1545
1546 case $this->pobject->STATUS_NOT_BUYABLE:
1547 $f_result[$counter]['status'] = $this->lng->txt('paya_not_buyable');
1548 break;
1549
1550 case $this->pobject->STATUS_EXPIRES:
1551 $f_result[$counter]['status'] = $this->lng->txt('paya_expires');
1552 break;
1553 }
1554
1555 include_once './Services/Payment/classes/class.ilPayMethods.php';
1556 $str_paymethod = ilPayMethods::getStringByPaymethod($data['pay_method']);
1557 $f_result[$counter]['pay_method'] = $str_paymethod;
1558
1559 if($data['vat_id'] <= 0)
1560 {
1561 $vat_rate = $this->lng->txt('payment_vat_has_to_be_defined_by_administration_short');
1562 }
1563 else
1564 {
1565 try
1566 {
1567 $oVAT = new ilShopVats((int)$data['vat_id']);
1568 $vat_rate = ilShopUtils::_formatVAT((float)$oVAT->getRate());
1569 }
1570 catch(ilShopException $e)
1571 {
1572 $vat_rate = $this->lng->txt('payment_vat_has_to_be_defined_by_administration_short');
1573 }
1574 }
1575
1576 $f_result[$counter]['vat_rate'] = $vat_rate;
1577
1578 $tmp_user = ilObjectFactory::getInstanceByObjId($data['vendor_id'], false);
1579 if($tmp_user )
1580 {
1581 $f_result[$counter]['vendor'] = $tmp_user->getFullname().' ['.$tmp_user->getLogin().']';
1582 }
1583 else
1584 {
1585 $f_result[$counter]['vendor'] = $this->lng->txt('user_not_found');
1586 }
1587
1588 // Get number of purchasers
1589 $f_result[$counter]['purchasers'] = ilPaymentBookings::_getCountBookingsByObject($data['pobject_id']);
1590
1591 // edit link
1592 $this->ctrl->setParameter($this,'pobject_id',$data['pobject_id']);
1593 $link_change = "<div class=\"il_ContainerItemCommands\"><a class=\"il_ContainerItemCommand\" href=\"".$this->ctrl->getLinkTarget($this,"editDetails")."\">".$this->lng->txt("edit")."</a></div>";
1594
1595 $f_result[$counter]['options'] = $link_change;
1596 unset($tmp_user);
1597 unset($tmp_obj);
1598
1599 ++$counter;
1600 }
1601
1602 return $this->__showObjectsTable($f_result);
1603
1604 //return true;
1605 }

References $_POST, $_SESSION, ilObjectGUI\$data, __initPaymentObject(), __showObjectsTable(), ilShopUtils\_formatVAT(), ilPaymentObject\_getAllObjectsData(), ilPaymentBookings\_getCountBookingsByObject(), ilObjectFactory\getInstanceByObjId(), ilObjectFactory\getInstanceByRefId(), ilPayMethods\getStringByPaymethod(), and ilUtil\sendInfo().

Referenced by deletePriceObject(), editDetailsObject(), performDeletePriceObject(), performObjectDeleteObject(), resetObjectFilterObject(), and updatePriceObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ payMethodsObject()

ilObjPaymentSettingsGUI::payMethodsObject (   $askForDeletingAddresses = array())

Definition at line 2978 of file class.ilObjPaymentSettingsGUI.php.

2979 {
2980 include_once './Services/Payment/classes/class.ilPayMethods.php';
2981
2982 global $rbacsystem, $ilCtrl;
2983
2984 $this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.main_view.html','Services/Payment');
2985
2986 if(!$rbacsystem->checkAccess('read', $this->object->getRefId()))
2987 {
2988 $this->ilErr->raiseError($this->lng->txt('msg_no_perm_read'),$this->ilErr->MESSAGE);
2989 }
2990
2991 if(count($askForDeletingAddresses))
2992 {
2993 $oConfirmationGUI = new ilConfirmationGUI();
2994
2995 // set confirm/cancel commands
2996 $oConfirmationGUI->setFormAction($ilCtrl->getFormAction($this, "deleteAddressesForPaymethods"));
2997 $oConfirmationGUI->setHeaderText($this->lng->txt("info_delete_sure"));
2998 $oConfirmationGUI->setCancel($this->lng->txt("cancel"), "payMethods");
2999 $oConfirmationGUI->setConfirm($this->lng->txt("confirm"), "deleteAddressesForPaymethods");
3000
3001 foreach($askForDeletingAddresses as $pm_id)
3002 {
3003 $pm_obj = new ilPayMethods($pm_id);
3004 $oConfirmationGUI->additem('paymethod['.$pm_obj->getPmId().']',$pm_obj->getPmId(), $this->lng->txt('delete_addresses_bill').' -> '.ilPayMethods::getStringByPaymethod($pm_obj->getPmTitle()));
3005 }
3006
3007 $this->tpl->setVariable('CONFIRMATION', $oConfirmationGUI->getHtml());
3008 return true;
3009 }
3010
3011 $obj_paymethods = new ilPayMethods();
3012 $paymethods = $obj_paymethods->readAll();
3013
3014 $result = array();
3015 $counter = 0;
3016 foreach($paymethods as $paymethod)
3017 {
3018 if($paymethod['pm_title'] != 'epay')
3019 {
3020 $result[$counter]['pm_title'] = ilPayMethods::getStringByPaymethod($paymethod['pm_title']);
3021 $result[$counter]['pm_enabled'] = ilUtil::formCheckbox($paymethod['pm_enabled'] ? 1 : 0,'pm_enabled['.$paymethod['pm_id'].']',1);
3022 $result[$counter]['save_usr_adr'] = ilUtil::formCheckbox($paymethod['save_usr_adr'] ? 1 : 0,'save_usr_adr['.$paymethod['pm_id'].']',1);
3023 $this->ctrl->clearParameters($this);
3024 $counter++;
3025 }
3026 }
3027
3028 $this->ctrl->setParameter($this, 'cmd', 'savePayMethods');
3029 $tbl = new ilShopTableGUI($this);
3030 $tbl->setTitle($this->lng->txt('pays_pay_methods'));
3031
3032 $tbl->setId('tbl_paymethods');
3033 $tbl->setRowTemplate("tpl.shop_paymethods_row.html", "Services/Payment");
3034
3035 $tbl->addColumn($this->lng->txt('title'), 'pm_title', '10%');
3036 $tbl->addColumn($this->lng->txt('enabled'), 'pm_enabled', '10%');
3037 $tbl->addColumn($this->lng->txt('save_customer_address'),'save_usr_adr','10%');
3038 $tbl->addCommandButton('savePayMethods', $this->lng->txt('save'));
3039
3040 $tbl->disable('sort');
3041 $tbl->setData($result);
3042
3043 $this->tpl->setVariable('TABLE', $tbl->getHTML());
3044
3045 return true;
3046 }
$result
Class ilObjPaymentSettingsGUI.
static formCheckbox($checked, $varname, $value, $disabled=false)
??? @access public
global $ilCtrl
Definition: ilias.php:18

References $ilCtrl, $result, $tbl, ilUtil\formCheckbox(), and ilPayMethods\getStringByPaymethod().

Referenced by checkShopActivationObject(), deleteAddressesForPaymethodsObject(), and savePayMethodsObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ performAddPriceObject()

ilObjPaymentSettingsGUI::performAddPriceObject ( )

Definition at line 954 of file class.ilObjPaymentSettingsGUI.php.

955 {
956 $po = new ilPaymentPrices((int)$_GET['pobject_id']);
957
958 switch($_POST['price_type'])
959 {
960 case 'unlimited_duration':
962 $po->setDuration(0);
963 $po->setDurationFrom(NULL);
964 $po->setDurationUntil(NULL);
965 $po->setUnlimitedDuration(1);
966
967 break;
968
969 case 'duration_date':
970
972 $po->setDuration(NULL);
973 $po->setDurationFrom(ilUtil::stripSlashes(
974 $_POST['duration_date_from']['date']['y'].'-'.
975 $_POST['duration_date_from']['date']['m'].'-'.
976 $_POST['duration_date_from']['date']['d']));
977 $po->setDurationUntil(ilUtil::stripSlashes(
978 $_POST['duration_date_until']['date']['y'].'-'.
979 $_POST['duration_date_until']['date']['m'].'-'.
980 $_POST['duration_date_until']['date']['d']));
981 break;
982
983 default:
984 case 'duration_month':
986 $po->setDuration($_POST['duration_month']);
987 $po->setDurationFrom(NULL);
988 $po->setDurationUntil(NULL);
989 break;
990 }
991
992 $po->setDescription($_POST['description'] ? ilUtil::stripSlashes($_POST['description']) : NULL);
993 $po->setPrice(ilUtil::stripSlashes($_POST['price']));
994// $po->setCurrency($currency[1]['currency_id']);
995
996 if($_POST['extension_price'])
997 {
998 $po->setExtension(1);
999 }
1000 else
1001 {
1002 $po->setExtension(0);
1003 }
1004
1005 try
1006 {
1007 $po->validate();
1008 $po->add();
1009 ilUtil::sendInfo($this->lng->txt('paya_added_new_price'));
1010 return $this->editPricesObject();
1011 }
1012 catch(ilShopException $e)
1013 {
1014 ilUtil::sendInfo($e->getMessage());
1015 return $this->addPriceObject();
1016 }
1017 }

References $_GET, $_POST, ilUtil\sendInfo(), ilUtil\stripSlashes(), ilPaymentPrices\TYPE_DURATION_DATE, ilPaymentPrices\TYPE_DURATION_MONTH, and ilPaymentPrices\TYPE_UNLIMITED_DURATION.

+ Here is the call graph for this function:

◆ performDeleteCurrencyObject()

ilObjPaymentSettingsGUI::performDeleteCurrencyObject ( )

Definition at line 4481 of file class.ilObjPaymentSettingsGUI.php.

4482 {
4483 if(!$_SESSION['currency_id']) return false;
4484
4485 $obj_currency = new ilPaymentCurrency((int)$_SESSION['currency_id']);
4486 $obj_currency->deleteCurrency();
4487
4488 return $this->currenciesObject();
4489 }

References $_SESSION, and currenciesObject().

+ Here is the call graph for this function:

◆ performDeleteObject()

ilObjPaymentSettingsGUI::performDeleteObject ( )

Definition at line 2222 of file class.ilObjPaymentSettingsGUI.php.

2223 {
2224 if(!isset($_GET['booking_id']))
2225 {
2226 ilUtil::sendInfo($this->lng->txt('paya_no_booking_id_given'));
2227 $this->statisticObject();
2228
2229 return true;
2230 }
2231
2232 $this->__initBookingObject();
2233 $this->booking_obj->setBookingId((int) $_GET['booking_id']);
2234 if(!$this->booking_obj->delete())
2235 {
2236 die('Error deleting booking');
2237 }
2238 ilUtil::sendInfo($this->lng->txt('pay_deleted_booking'));
2239
2240 $this->statisticObject();
2241
2242 return true;
2243 }

References $_GET, __initBookingObject(), ilUtil\sendInfo(), and statisticObject().

+ Here is the call graph for this function:

◆ performDeletePriceObject()

ilObjPaymentSettingsGUI::performDeletePriceObject ( )

Definition at line 1019 of file class.ilObjPaymentSettingsGUI.php.

1020 {
1021 if(!$_GET['pobject_id'])
1022 {
1023 ilUtil::sendInfo($this->lng->txt('paya_no_object_selected'));
1024
1025 $this->objectsObject();
1026 return true;
1027 }
1028
1029 if(!count($_SESSION['price_ids']))
1030 {
1031 ilUtil::sendInfo($this->lng->txt('paya_no_prices_selected'));
1032
1033 $this->editPriceObject();
1034 return true;
1035 }
1036
1037 $prices = new ilPaymentPrices((int) $_GET['pobject_id']);
1038
1039 foreach($_SESSION['price_ids'] as $price_id)
1040 {
1041 if($prices->delete($price_id))
1042 ilUtil::sendInfo($this->lng->txt('paya_deleted_selected_prices'));
1043
1044 }
1045
1046 // check if it was last price otherwise set status to 'not_buyable'
1047 if(!count($prices->getPrices()))
1048 {
1049 $this->__initPaymentObject((int) $_GET['pobject_id']);
1050
1051 $this->pobject->setStatus($this->pobject->STATUS_NOT_BUYABLE);
1052 $this->pobject->update();
1053
1054 ilUtil::sendInfo($this->lng->txt('paya_deleted_last_price'));
1055 }
1056 unset($prices);
1057 unset($_SESSION['price_ids']);
1058
1059 return $this->editPricesObject();
1060 }

References $_GET, $_SESSION, __initPaymentObject(), editPriceObject(), objectsObject(), and ilUtil\sendInfo().

+ Here is the call graph for this function:

◆ performDeleteVatObject()

ilObjPaymentSettingsGUI::performDeleteVatObject ( )

Definition at line 4122 of file class.ilObjPaymentSettingsGUI.php.

4123 {
4124 if(!is_array($_POST['vat_id']))
4125 {
4126 return $this->vatsObject();
4127 }
4128
4129 foreach($_POST['vat_id'] as $vat_id)
4130 {
4131 try
4132 {
4133 $oVAT = new ilShopVats((int)$vat_id);
4134 $oVAT->delete();
4135
4136 }
4137 catch(ilShopException $e)
4138 {
4139 ilUtil::sendInfo($e->getMessage());
4140 $_SESSION['disable_shop'] = false;
4141 return $this->vatsObject();
4142 }
4143 }
4144
4145 if($_SESSION['disable_shop'] == true)
4146 {
4147 $this->genSetData->set('shop_enabled', 0, 'common');
4148 $_SESSION['disable_shop'] = false;
4149 }
4150 ilUtil::sendSuccess($this->lng->txt('payment_vat_deleted_successfully'));
4151 return $this->vatsObject();
4152 }

References $_POST, $_SESSION, ilUtil\sendInfo(), ilUtil\sendSuccess(), and vatsObject().

+ Here is the call graph for this function:

◆ performDeleteVendorsObject()

ilObjPaymentSettingsGUI::performDeleteVendorsObject ( )

Definition at line 3179 of file class.ilObjPaymentSettingsGUI.php.

3180 {
3181 include_once './Services/Payment/classes/class.ilPaymentTrustees.php';
3182
3183 global $rbacsystem;
3184
3185 // MINIMUM ACCESS LEVEL = 'read'
3186 if(!$rbacsystem->checkAccess('write', $this->object->getRefId()))
3187 {
3188 $this->ilErr->raiseError($this->lng->txt('msg_no_perm_write'),$this->ilErr->MESSAGE);
3189 }
3190
3191 foreach($_SESSION['pays_vendor'] as $vendor)
3192 {
3193 $this->vendors_obj->delete($vendor);
3195 }
3196
3197 ilUtil::sendInfo($this->lng->txt('pays_deleted_number_vendors').' '.count($_SESSION['pays_vendor']));
3198 unset($_SESSION['pays_vendor']);
3199 if($_SESSION['disable_shop'] == true)
3200 {
3201 $this->genSetData->set('shop_enabled', 0, 'common');
3202 $_SESSION['disable_shop'] = false;
3203 }
3204
3205 $this->vendorsObject();
3206
3207 return true;
3208 }
static _deleteTrusteesOfVendor($a_vendor_id)

References $_SESSION, ilPaymentTrustees\_deleteTrusteesOfVendor(), ilUtil\sendInfo(), and vendorsObject().

+ Here is the call graph for this function:

◆ performEditVendorObject()

ilObjPaymentSettingsGUI::performEditVendorObject ( )

Definition at line 3265 of file class.ilObjPaymentSettingsGUI.php.

3266 {
3267 global $rbacsystem;
3268
3269 // MINIMUM ACCESS LEVEL = 'read'
3270 if(!$rbacsystem->checkAccess('write', $this->object->getRefId()))
3271 {
3272 $this->ilErr->raiseError($this->lng->txt('msg_no_perm_write'),$this->ilErr->MESSAGE);
3273 }
3274
3275 if(!count($_SESSION['pays_vendor']))
3276 {
3277 ilUtil::sendInfo($this->lng->txt('pays_no_vendor_selected'));
3278 $this->vendorsObject();
3279
3280 return true;
3281 }
3282 if(count($_SESSION['pays_vendor']) > 1)
3283 {
3284 ilUtil::sendInfo($this->lng->txt('pays_too_many_vendors_selected'));
3285 $this->vendorsObject();
3286
3287 return true;
3288 }
3289
3290 if (!is_array($this->vendors_obj->vendors[$_SESSION['pays_vendor']]))
3291 {
3292 $this->vendorsObject();
3293 return true;
3294 }
3295
3296 if ($_POST['cost_center'] == '')
3297 {
3298 $this->error = $this->lng->txt('pays_cost_center_not_valid');
3299 ilUtil::sendFailure($this->error);
3300 $_POST['vendor'] = array($_SESSION['pays_vendor']);
3301 return $this->editVendor();
3302
3303 }
3304
3305 $this->vendors_obj->update($_SESSION['pays_vendor'], $_POST['cost_center']);
3306
3307 unset($_SESSION['pays_vendor']);
3308
3309 $this->vendorsObject();
3310
3311 return true;
3312 }

References $_POST, $_SESSION, error(), ilUtil\sendFailure(), ilUtil\sendInfo(), and vendorsObject().

Referenced by gatewayObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ performObjectDeleteObject()

ilObjPaymentSettingsGUI::performObjectDeleteObject ( )

Definition at line 1348 of file class.ilObjPaymentSettingsGUI.php.

1349 {
1350
1351 if(!$_GET['pobject_id'])
1352 {
1353 ilUtil::sendInfo($this->lng->txt('paya_no_object_selected'));
1354
1355 $this->objectsObject();
1356 return true;
1357 }
1358 $this->__initPaymentObject((int) $_GET['pobject_id']);
1359
1360 // delete object data
1361 $this->pobject->delete();
1362
1363 // delete payment prices
1364 $price_obj = new ilPaymentPrices((int) $_GET['pobject_id']);
1365 $price_obj->deleteAllPrices();
1366 unset($price_obj);
1367
1368 ilUtil::sendInfo($this->lng->txt('paya_deleted_object'));
1369
1370 $this->objectsObject();
1371
1372 return true;
1373 }

References $_GET, __initPaymentObject(), objectsObject(), and ilUtil\sendInfo().

+ Here is the call graph for this function:

◆ performSearchSPObject()

ilObjPaymentSettingsGUI::performSearchSPObject ( )

Definition at line 3512 of file class.ilObjPaymentSettingsGUI.php.

3513 {
3514 global $ilToolbar;
3515 // SAVE it to allow sort in tables
3516 $_SESSION['paya_search_str_user_sp'] = $_POST['search_str'] = $_POST['search_str'] ? $_POST['search_str'] : $_SESSION['paya_search_str_user_sp'];
3517
3518 if(!trim($_POST['search_str']))
3519 {
3520 ilUtil::sendFailure($this->lng->txt('search_no_search_term'));
3521 $this->statistics();
3522
3523 return false;
3524 }
3525 if(!count($result = $this->__search(ilUtil::stripSlashes($_POST['search_str']))))
3526 {
3527 ilUtil::sendInfo($this->lng->txt('search_no_match'));
3528 $this->searchUserSPObject();
3529
3530 return false;
3531 }
3532
3533 if(!isset($_GET['sell_id']))
3534 {
3535 ilUtil::sendInfo($this->lng->txt('paya_no_booking_id_given'));
3536 $this->showObjectSelectorObject();
3537
3538 return false;
3539 }
3540
3541 $this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.main_view.html','Services/Payment');
3542 $this->ctrl->setParameter($this, 'sell_id', $_GET['sell_id']);
3543
3544 $ilToolbar->addButton($this->lng->txt('back'), $this->ctrl->getLinkTarget($this, 'searchUserSP'));
3545
3546 $counter = 0;
3547 $f_result = array();
3548 foreach($result as $user)
3549 {
3550 if(!$tmp_obj = ilObjectFactory::getInstanceByObjId($user['id'],false))
3551 {
3552 continue;
3553 }
3554 $f_result[$counter]['user_id'] = $user['id'];
3555 $f_result[$counter]['login'] = $tmp_obj->getLogin();
3556 $f_result[$counter]['firstname'] = $tmp_obj->getFirstname();
3557 $f_result[$counter]['lastname'] = $tmp_obj->getLastname();
3558
3559 unset($tmp_obj);
3560 ++$counter;
3561 }
3562 return $this->__showSearchUserSPTable($f_result);
3563 }

References $_GET, $_POST, $_SESSION, $result, __search(), __showSearchUserSPTable(), ilObjectFactory\getInstanceByObjId(), searchUserSPObject(), ilUtil\sendFailure(), ilUtil\sendInfo(), showObjectSelectorObject(), and ilUtil\stripSlashes().

+ Here is the call graph for this function:

◆ resetFilterObject()

ilObjPaymentSettingsGUI::resetFilterObject ( )

Definition at line 1661 of file class.ilObjPaymentSettingsGUI.php.

1662 {
1663 unset($_SESSION['pay_statistics']);
1664 unset($_POST['transaction_type']);
1665 unset($_POST['transaction_value']);
1666 unset($_POST['from']);
1667 unset($_POST['til']);
1668 unset($_POST['payed']);
1669 unset($_POST['access']);
1670 unset($_POST['customer']);
1671 unset($_POST['pay_method']);
1672 unset($_POST['updateView']);
1673 unset($_POST["adm_filter_title_id"]);
1674 ilUtil::sendInfo($this->lng->txt('paya_filter_reseted'));
1675
1676 return $this->statisticObject();
1677 }

References $_POST, $_SESSION, ilUtil\sendInfo(), and statisticObject().

+ Here is the call graph for this function:

◆ resetObjectFilterObject()

ilObjPaymentSettingsGUI::resetObjectFilterObject ( )

Definition at line 1429 of file class.ilObjPaymentSettingsGUI.php.

1430 {
1431 unset($_SESSION['pay_statistics']);
1432 unset($_POST['title_type']);
1433 unset($_POST['title_value']);
1434 unset($_POST['vendor']);
1435 unset($_POST['pay_method']);
1436
1437 ilUtil::sendInfo($this->lng->txt('paya_filter_reseted'));
1438
1439 return $this->objectsObject();
1440 }

References $_POST, $_SESSION, objectsObject(), and ilUtil\sendInfo().

+ Here is the call graph for this function:

◆ saveBillingMailObject()

ilObjPaymentSettingsGUI::saveBillingMailObject ( )

Definition at line 4560 of file class.ilObjPaymentSettingsGUI.php.

4561 {
4562 if($_POST['m_message'])
4563 {
4565 }
4566
4567 $_POST['use_placeholders'] ? $placeholders = 1: $placeholders = 0;
4569
4570 ilUtil::sendSuccess($this->lng->txt('saved_successfully'));
4571 $this->BillingMailObject();
4572 }
static setMailBillingText($a_mail_billing_text)
static setMailUsePlaceholders($a_mail_use_placeholders)

References $_POST, BillingMailObject(), ilUtil\sendSuccess(), ilPaymentSettings\setMailBillingText(), and ilPaymentSettings\setMailUsePlaceholders().

+ Here is the call graph for this function:

◆ saveCurrencyObject()

ilObjPaymentSettingsGUI::saveCurrencyObject ( )

Definition at line 4402 of file class.ilObjPaymentSettingsGUI.php.

4403 {
4404 $obj_currency = new ilPaymentCurrency();
4405 $obj_currency->setUnit($_POST['currency_unit']);
4406 $obj_currency->setIsoCode($_POST['iso_code']);
4407 $obj_currency->setSymbol($_POST['symbol']);
4408 $obj_currency->setConversionRate($_POST['conversion_rate']);
4409 $obj_currency->addCurrency();
4410 $this->currenciesObject();
4411 }

References $_POST, and currenciesObject().

+ Here is the call graph for this function:

◆ saveCustomerObject()

ilObjPaymentSettingsGUI::saveCustomerObject ( )

Definition at line 3720 of file class.ilObjPaymentSettingsGUI.php.

3721 {
3722 global $ilUser,$ilObjDataCache;
3723
3724 if(!isset($_GET['sell_id']))
3725 {
3726 ilUtil::sendInfo($this->lng->txt('paya_error_no_object_id_given'));
3727 $this->showObjectSelectorObject();
3728
3729 return true;
3730 }
3731
3732 if(!isset($_GET['user_id']))
3733 {
3734 ilUtil::sendInfo($this->lng->txt('paya_error_no_user_id_given'));
3735 $this->searchUserSPObject();
3736
3737 return true;
3738 }
3739
3740 if ($_POST['pay_method'] == '' ||
3741 $_POST['price_id'] == '')
3742 {
3743 ilUtil::sendInfo($this->lng->txt('paya_error_mandatory_fields'));
3744 $this->addCustomerObject();
3745
3746 return true;
3747 }
3748
3749 $pObjectId = ilPaymentObject::_lookupPobjectId($_GET['sell_id']);
3750 $obj = new ilPaymentObject($this->user_obj, $pObjectId);
3751
3752 $this->__initBookingObject();
3753
3755
3756 $this->booking_obj->setTransaction($transaction);
3757 $this->booking_obj->setTransactionExtern($_POST['transaction']);
3758 $this->booking_obj->setPobjectId($pObjectId);
3759 $this->booking_obj->setCustomerId($_GET['user_id']);
3760 $this->booking_obj->setVendorId($obj->getVendorId());
3761
3762 $this->booking_obj->setPayMethod($_POST['pay_method']);
3763 $this->booking_obj->setOrderDate(time());
3764
3765 $price = ilPaymentPrices::_getPrice($_POST['price_id']);
3766// $currency = ilPaymentCurrency::_getUnit($price['currency']);
3767
3768#@todo check this.
3769 switch($price['price_type'])
3770 {
3772 $this->booking_obj->setDuration($price['duration']);
3773 break;
3774
3776 $this->booking_obj->setDuration(0);
3777 $this->booking_obj->setAccessStartdate($price['duration_from']);
3778 $this->booking_obj->setAccessEnddate($price['duration_until']);
3779 break;
3781 $this->booking_obj->setDuration(0);
3782 $this->booking_obj->setAccessEnddate(NULL);
3783 break;
3784 }
3785
3786 $this->booking_obj->setPriceType($price['price_type']);
3787 $this->booking_obj->setPrice($price['price']);
3788
3789 $this->booking_obj->setAccess((int) $_POST['access']);
3790 $this->booking_obj->setPayed((int) $_POST['payed']);
3791 $this->booking_obj->setVoucher('');
3792
3793 $obj_id = $ilObjDataCache->lookupObjId($obj->getRefId());
3794 $obj_type = $ilObjDataCache->lookupType($obj_id);
3795 $obj_title = $ilObjDataCache->lookupTitle($obj_id);
3796
3797 // include_once 'Services/Payment/classes/class.ilShopVatsList.php';
3798 $oVAT = new ilShopVats((int)$obj->getVatId());
3799 $obj_vat_rate = $oVAT->getRate();
3800 $obj_vat_unit = $obj->getVat($this->booking_obj->getPrice());
3801
3802 $this->booking_obj->setObjectTitle($obj_title);
3803 $this->booking_obj->setVatRate($obj_vat_rate);
3804 $this->booking_obj->setVatUnit($obj_vat_unit);
3805
3807 $this->booking_obj->setCurrencyUnit( $genSet->get('currency_unit'));
3808
3809 include_once './Services/Payment/classes/class.ilPayMethods.php';
3810
3811 $save_user_address_enabled = ilPayMethods::_EnabledSaveUserAddress($this->booking_obj->getPayMethod());
3812 if($save_user_address_enabled == 1)
3813 {
3814 global $ilObjUser;
3815 $user_id[] = $_GET["user_id"];
3816
3817 $cust_obj = ilObjUser::_readUsersProfileData($user_id);
3818
3819 $this->booking_obj->setStreet($cust_obj[$_GET["user_id"]]['street'],'');
3820
3821 $this->booking_obj->setZipcode($cust_obj[$_GET["user_id"]]['zipcode']);
3822 $this->booking_obj->setCity($cust_obj[$_GET["user_id"]]['city']);
3823 $this->booking_obj->setCountry($cust_obj[$_GET["user_id"]]['country']);
3824 }
3825
3826 if($this->booking_obj->add())
3827 {
3828 // add purchased item to desktop
3829 ilShopUtils::_addPurchasedObjToDesktop($obj, $this->booking_obj->getCustomerId());
3830
3831 // autosubscribe user if purchased object is a course
3832 if($obj_type == 'crs')
3833 {
3834 ilShopUtils::_assignPurchasedCourseMemberRole($obj, $this->booking_obj->getCustomerId());
3835 }
3836
3837 ilUtil::sendInfo($this->lng->txt('paya_customer_added_successfully'));
3838 $this->statisticObject();
3839 }
3840 else
3841 {
3842 ilUtil::sendInfo($this->lng->txt('paya_error_adding_customer'));
3843 $this->addCustomerObject();
3844 }
3845 return true;
3846 }
static _readUsersProfileData($a_user_ids)
STATIC METHOD get user data of selected users.
static _EnabledSaveUserAddress($a_id)
static _assignPurchasedCourseMemberRole($oPaymentObject, $a_user_id=0)
static _addPurchasedObjToDesktop($oPaymentObject, $a_user_id=0)

References $_GET, $_POST, $ilUser, ilObjectGUI\$obj_id, __initBookingObject(), ilShopUtils\_addPurchasedObjToDesktop(), ilShopUtils\_assignPurchasedCourseMemberRole(), ilPayMethods\_EnabledSaveUserAddress(), ilInvoiceNumberPlaceholdersPropertyGUI\_generateInvoiceNumber(), ilPaymentSettings\_getInstance(), ilPaymentPrices\_getPrice(), ilPaymentObject\_lookupPobjectId(), ilObjUser\_readUsersProfileData(), addCustomerObject(), searchUserSPObject(), ilUtil\sendInfo(), showObjectSelectorObject(), statisticObject(), ilPaymentPrices\TYPE_DURATION_DATE, ilPaymentPrices\TYPE_DURATION_MONTH, and ilPaymentPrices\TYPE_UNLIMITED_DURATION.

+ Here is the call graph for this function:

◆ saveInvoiceNumberObject()

ilObjPaymentSettingsGUI::saveInvoiceNumberObject ( )

@noinspection PhpVoidFunctionResultUsedInspection

Definition at line 4697 of file class.ilObjPaymentSettingsGUI.php.

4698 {
4699 // check conditions
4700 if($_POST['ud_invoice_number'] == 1)
4701 {
4702 if($_POST['inc_start_value'] <= 0 || $_POST['inc_start_value'] == NULL)
4703 {
4704 $this->error = $this->lng->txt('start_value_cannot_be_null');
4705 ilUtil::sendFailure($this->error);
4707 return $this->InvoiceNumberObject();
4708 }
4709
4710 if($_POST['invoice_number_text'] !== NULL)
4711 {
4712 $check_text = $_POST['invoice_number_text'];
4713
4714 if(strpos($check_text, '[INCREMENTAL_NUMBER]') === FALSE)
4715 {
4716 $this->error = $this->lng->txt('invoice_number_must_contain_incremental_number');
4717 ilUtil::sendFailure($this->error);
4718 $this->InvoiceNumberObject();
4719 return true;
4720 }
4721 else
4722 {
4723 if($_POST['inc_reset_period'] == 1) // yearly
4724 {
4725 if(strpos($check_text, '[YEAR]') === FALSE && strpos($check_text, '[CURRENT_TIMESTAMP]') === FALSE)
4726 {
4727 $this->error = $this->lng->txt('invoice_number_must_contain_year_ct');
4728 ilUtil::sendFailure($this->error);
4729 $this->InvoiceNumberObject();
4730 return true;
4731 }
4732 }
4733 else if($_POST['inc_reset_period'] == 2) // monthly
4734 {
4735 if((strpos($check_text, '[YEAR]') === FALSE || strpos($check_text, '[MONTH]') === FALSE )
4736 && (strpos($check_text, '[CURRENT_TIMESTAMP]') === FALSE))
4737 {
4738 $this->error = $this->lng->txt('invoice_number_must_contain_year_month_ct');
4739 ilUtil::sendFailure($this->error);
4740 $this->InvoiceNumberObject();
4741 return true;
4742 }
4743 }
4744 }
4745 }
4746 else
4747 {
4748 ilUtil::sendFailure($this->lng->txt('invoice_number_text_cannot_be_null'));
4749 $this->InvoiceNumberObject();
4750 return true;
4751 }
4752 }
4753 // everythink ok .... update settings
4754 $invObj = new ilUserDefinedInvoiceNumber();
4755 $invObj->setUDInvoiceNumberActive($_POST['ud_invoice_number']);
4756 $invObj->setIncStartValue($_POST['inc_start_value']);
4757 $invObj->setIncResetPeriod($_POST['inc_reset_period']);
4758 $invObj->setInvoiceNumberText($_POST['invoice_number_text']);
4759 $invObj->update();
4760
4761 $this->InvoiceNumberObject();
4762 ilUtil::sendSuccess($this->lng->txt('pays_updated_general_settings'));
4763
4764 return true;
4765 }

References $_POST, error(), InvoiceNumberObject(), ilUtil\sendFailure(), and ilUtil\sendSuccess().

+ Here is the call graph for this function:

◆ savePayMethodsObject()

ilObjPaymentSettingsGUI::savePayMethodsObject ( )

Definition at line 3048 of file class.ilObjPaymentSettingsGUI.php.

3049 {
3050 include_once './Services/Payment/classes/class.ilPayMethods.php';
3051
3052 global $rbacsystem;
3053
3054 if(!$rbacsystem->checkAccess('read', $this->object->getRefId()))
3055 {
3056 $this->ilErr->raiseError($this->lng->txt('msg_no_perm_read'),$this->ilErr->MESSAGE);
3057 }
3058
3059 $obj_paymethods = new ilPayMethods();
3060 $paymethods = $obj_paymethods->readAll();
3061
3062 $askForDeletingAddresses = array();
3063
3064 $pm_enabled = (array)$_POST['pm_enabled'];
3065 $pm_addr = (array)$_POST['save_usr_adr'];
3066
3067 if(!$pm_enabled)
3068 {
3069 ilUtil::sendInfo($this->lng->txt('shop_disabled_no_paymethods'));
3070 $this->genSetData->set('shop_enabled', 0, 'common');
3071 $_SESSION['disable_shop'] = false;
3072 }
3073
3074 $info_msg = array();
3075 foreach($paymethods as $paymethod)
3076 {
3077 if(
3078 (!isset($pm_enabled[$paymethod['pm_id']]) || !$pm_enabled[$paymethod['pm_id']]) &&
3079 $paymethod['pm_enabled']
3080 )
3081 {
3082 if(ilPaymentObject::_getCountObjectsByPayMethod($paymethod['pm_id']))
3083 {
3084 $info_msg[] = $this->lng->txt('pays_objects_'.$paymethod['pm_title'].'_exist');
3085 }
3086 }
3087 }
3088 if($info_msg)
3089 {
3090 ilUtil::sendInfo(implode('<br />', $info_msg));
3091 $this->payMethodsObject();
3092 return;
3093 }
3094
3095 $num_changed = 0;
3096 foreach($paymethods as $paymethod)
3097 {
3098 if(
3099 (!isset($pm_enabled[$paymethod['pm_id']]) || !$pm_enabled[$paymethod['pm_id']]) &&
3100 $paymethod['pm_enabled']
3101 )
3102 {
3103 ilPayMethods::_PMdisable($paymethod['pm_id']);
3104 ++$num_changed;
3105 }
3106 else if(isset($pm_enabled[$paymethod['pm_id']]) && $pm_enabled[$paymethod['pm_id']] && !$paymethod['pm_enabled'])
3107 {
3108 ilPayMethods::_PMenable($paymethod['pm_id']);
3109 ++$num_changed;
3110 }
3111
3112 if(
3113 (!isset($pm_addr[$paymethod['pm_id']]) || !$pm_addr[$paymethod['pm_id']]) &&
3114 $paymethod['save_usr_adr'])
3115 {
3116 $askForDeletingAddresses[] = $paymethod['pm_id'];
3117 }
3118 else if(
3119 (!isset($pm_addr[$paymethod['pm_id']]) || !$pm_addr[$paymethod['pm_id']]) &&
3120 !$paymethod['save_usr_adr']
3121 )
3122 {
3123 continue;
3124 }
3125 else
3126 {
3127 ilPayMethods::_enableSaveUserAddress($paymethod['pm_id']);
3128 ++$num_changed;
3129 }
3130 }
3131 if($num_changed && !$askForDeletingAddresses)
3132 {
3133 ilUtil::sendSuccess($this->lng->txt('pays_updated_pay_method'));
3134 }
3135 $this->payMethodsObject($askForDeletingAddresses);
3136
3137 return true;
3138 }
static _PMdisable($a_id)
static _PMenable($a_id)
static _enableSaveUserAddress($a_id)
static _getCountObjectsByPayMethod($a_id)

References $_POST, $_SESSION, ilPayMethods\_enableSaveUserAddress(), ilPaymentObject\_getCountObjectsByPayMethod(), ilPayMethods\_PMdisable(), ilPayMethods\_PMenable(), payMethodsObject(), ilUtil\sendInfo(), and ilUtil\sendSuccess().

+ Here is the call graph for this function:

◆ savePaypalSettingsObject()

ilObjPaymentSettingsGUI::savePaypalSettingsObject ( )

Definition at line 2654 of file class.ilObjPaymentSettingsGUI.php.

2655 {
2656 include_once './Services/Payment/classes/class.ilPaypalSettings.php';
2657
2658 global $rbacsystem;
2659
2660 // MINIMUM ACCESS LEVEL = 'read'
2661 if(!$rbacsystem->checkAccess('read', $this->object->getRefId()))
2662 {
2663 $this->ilErr->raiseError($this->lng->txt('msg_no_perm_read'),$this->ilErr->MESSAGE);
2664 }
2665
2667
2668 $ppSet->setServerHost(ilUtil::stripSlashes($_POST['server_host']));
2669 $ppSet->setServerPath(ilUtil::stripSlashes($_POST['server_path']));
2670 $ppSet->setVendor(ilUtil::stripSlashes($_POST['vendor']));
2671// $ppSet->setVendorPassword(ilUtil::stripSlashes($_POST['vendor_password']));
2672 $ppSet->setAuthToken(ilUtil::stripSlashes($_POST['auth_token']));
2673 $ppSet->setPageStyle(ilUtil::stripSlashes($_POST['page_style']));
2674 $ppSet->setSsl(ilUtil::stripSlashes($_POST['ssl']));
2675
2676 if ($_POST['server_host'] == '' ||
2677 $_POST['server_path'] == '' ||
2678 $_POST['vendor'] == '' ||
2679// $_POST['vendor_password'] == '' ||
2680 $_POST['auth_token'] == '')
2681 {
2682 $this->error = $this->lng->txt('pays_paypal_settings_not_valid');
2683 ilUtil::sendFailure($this->error);
2684 $this->paypalSettingsObject();
2685 return true;
2686
2687 }
2688
2689 $ppSet->save();
2690
2691 $this->paypalSettingsObject();
2692
2693 ilUtil::sendSuccess($this->lng->txt('pays_updated_paypal_settings'));
2694
2695 return true;
2696 }
static getInstance()
Static method to get the singleton instance.

References $_POST, error(), ilPaypalSettings\getInstance(), ilUtil\sendFailure(), ilUtil\sendSuccess(), and ilUtil\stripSlashes().

+ Here is the call graph for this function:

◆ saveStatutoryRegulationsObject()

ilObjPaymentSettingsGUI::saveStatutoryRegulationsObject ( )

Definition at line 4833 of file class.ilObjPaymentSettingsGUI.php.

4834 {
4835 require_once 'Services/RTE/classes/class.ilRTE.php';
4836
4837 if(isset($_POST['statutory_regulations']) && $_POST['statutory_regulations'] != NULL)
4838 {
4839 $this->genSetData->set('statutory_regulations', ilRTE::_replaceMediaObjectImageSrc($_POST['statutory_regulations'], 0), 'regulations');
4840
4841 // copy temporary media objects (frm~)
4842 include_once 'Services/MediaObjects/classes/class.ilObjMediaObject.php';
4843 $mediaObjects = ilRTE::_getMediaObjects($_POST['statutory_regulations'], 0);
4844 $myMediaObjects = ilObjMediaObject::_getMobsOfObject('pays~:html', ilObject::_lookupObjId($this->ref_id));
4845 foreach($mediaObjects as $mob)
4846 {
4847 foreach($myMediaObjects as $myMob)
4848 {
4849 if($mob == $myMob)
4850 {
4851 // change usage
4852 ilObjMediaObject::_removeUsage($mob, 'pays~:html', ilObject::_lookupObjId($this->ref_id));
4853 break;
4854 }
4855 }
4856 ilObjMediaObject::_saveUsage($mob, 'pays~:html',ilObject::_lookupObjId($this->ref_id));
4857 }
4858 }
4859 else
4860 {
4861 $this->genSetData->set('statutory_regulations', NULL, 'regulations');
4862 }
4863
4864 // remove usage of deleted media objects
4865 include_once 'Services/MediaObjects/classes/class.ilObjMediaObject.php';
4866 $oldMediaObjects = ilObjMediaObject::_getMobsOfObject('pays~:html', ilObject::_lookupObjId($this->ref_id));
4867 $curMediaObjects = ilRTE::_getMediaObjects($_POST['statutory_regulations'], 0);
4868 foreach($oldMediaObjects as $oldMob)
4869 {
4870 $found = false;
4871 foreach($curMediaObjects as $curMob)
4872 {
4873 if($oldMob == $curMob)
4874 {
4875 $found = true;
4876 break;
4877 }
4878 }
4879 if(!$found)
4880 {
4881 if(ilObjMediaObject::_exists($oldMob))
4882 {
4883 ilObjMediaObject::_removeUsage($oldMob, 'pays~:html', ilObject::_lookupObjId($this->ref_id));
4884 $mob_obj = new ilObjMediaObject($oldMob);
4885 $mob_obj->delete();
4886 }
4887 }
4888 }
4889
4890 $this->genSetData->set('show_sr_shoppingcart', isset($_POST['show_sr_shoppingcart']) ? 1 : 0, 'regulations');
4891 $this->genSetData->set('attach_sr_invoice', isset($_POST['attach_sr_invoice']) ? 1 : 0, 'regulations');
4892
4894 ilUtil::sendSuccess($this->lng->txt('pays_updated_general_settings'));
4895 return true;
4896 }
Class ilObjMediaObject.
_saveUsage($a_mob_id, $a_type, $a_id, $a_usage_hist_nr=0, $a_lang="-")
Save usage of mob within another container (e.g.
_getMobsOfObject($a_type, $a_id, $a_usage_hist_nr=0, $a_lang="-")
get mobs of object
static _exists($a_id)
checks wether a lm content object with specified id exists or not
_removeUsage($a_mob_id, $a_type, $a_id, $a_usage_hist_nr=0, $a_lang="-")
Remove usage of mob in another container.
static _replaceMediaObjectImageSrc($a_text, $a_direction=0, $nic=IL_INST_ID)
replaces image source from mob image urls with the mob id or replaces mob id with the correct image s...
static _getMediaObjects($a_text, $a_direction=0)
Returns all media objects found in the passed string.

References $_POST, ilObjMediaObject\_exists(), ilRTE\_getMediaObjects(), ilObjMediaObject\_getMobsOfObject(), ilObject\_lookupObjId(), ilObjMediaObject\_removeUsage(), ilRTE\_replaceMediaObjectImageSrc(), ilObjMediaObject\_saveUsage(), ilUtil\sendSuccess(), and StatutoryRegulationsObject().

+ Here is the call graph for this function:

◆ saveVatObject()

ilObjPaymentSettingsGUI::saveVatObject ( )

Definition at line 4253 of file class.ilObjPaymentSettingsGUI.php.

4254 {
4255 $this->initVatForm('create');
4256 if(!$this->form->checkInput())
4257 {
4258 $this->form->setValuesByPost();
4259 $this->tpl->setContent($this->form->getHtml());
4260 return true;
4261 }
4262
4263 if(!ilShopUtils::_checkVATRate($this->form->getInput('vat_rate')))
4264 {
4265 $this->form->getItemByPostVar('vat_rate')->setAlert($this->lng->txt('payment_vat_input_invalid'));
4266 $this->form->setValuesByPost();
4267 $this->tpl->setContent($this->form->getHtml());
4268 return true;
4269 }
4270
4271 try
4272 {
4273 $oVAT = new ilShopVats();
4274 $oVAT->setTitle($this->form->getInput('vat_title'));
4275 $oVAT->setRate((float)str_replace(',', '.', $this->form->getInput('vat_rate')));
4276 $oVAT->save();
4277 }
4278 catch(ilShopException $e)
4279 {
4280 ilUtil::sendInfo($e->getMessage());
4281 $this->form->setValuesByPost();
4282 $this->tpl->setContent($this->form->getHtml());
4283 return true;
4284
4285 }
4286
4287 ilUtil::sendInfo($this->lng->txt('saved'));
4288 $this->vatsObject();
4289 return true;
4290
4291 }
static _checkVATRate($a_vat_rate)
Checks if the passed vat rate is valid.

References ilShopUtils\_checkVATRate(), initVatForm(), ilUtil\sendInfo(), and vatsObject().

+ Here is the call graph for this function:

◆ searchObject()

ilObjPaymentSettingsGUI::searchObject ( )

Definition at line 3339 of file class.ilObjPaymentSettingsGUI.php.

3340 {
3341 global $rbacsystem;
3342
3343 if(!$rbacsystem->checkAccess('read', $this->object->getRefId()))
3344 {
3345 $this->ilErr->raiseError($this->lng->txt('msg_no_perm_read'),$this->ilErr->MESSAGE);
3346 }
3347
3348 $_SESSION['pays_search_str'] = $_POST['search_str'] = $_POST['search_str'] ? $_POST['search_str'] : $_SESSION['pays_search_str'];
3349
3350 if(!isset($_POST['search_str']))
3351 {
3352 ilUtil::sendInfo($this->lng->txt('crs_search_enter_search_string'));
3353 $this->searchUserObject();
3354
3355 return false;
3356 }
3357 if(!count($result = $this->__search(ilUtil::stripSlashes($_POST['search_str']))))
3358 {
3359 ilUtil::sendInfo($this->lng->txt('crs_no_results_found'));
3360 $this->searchUserObject();
3361
3362 return false;
3363 }
3364
3365 $this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.main_view.html','Services/Payment');
3366
3367 $counter = 0;
3368 $f_result = array();
3369 foreach($result as $user)
3370 {
3371 if(!$tmp_obj = ilObjectFactory::getInstanceByObjId($user['id'],false))
3372 {
3373 continue;
3374 }
3375 $f_result[$counter]['vendor_id'] = ilUtil::formCheckbox(0,'user[]',$user['id']);
3376 $f_result[$counter]['login'] = $tmp_obj->getLogin();
3377 $f_result[$counter]['lastname'] = $tmp_obj->getLastname();
3378 $f_result[$counter]['firstname'] = $tmp_obj->getFirstname();
3379
3380 unset($tmp_obj);
3381 ++$counter;
3382 }
3383 $this->__showSearchUserTable($f_result);
3384
3385 return true;
3386 }

References $_POST, $_SESSION, $result, __search(), __showSearchUserTable(), ilUtil\formCheckbox(), ilObjectFactory\getInstanceByObjId(), ilUtil\sendInfo(), and ilUtil\stripSlashes().

Referenced by addUserObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ searchUserSPObject()

ilObjPaymentSettingsGUI::searchUserSPObject ( )

Definition at line 3475 of file class.ilObjPaymentSettingsGUI.php.

3476 {
3477 global $ilToolbar;
3478
3479 if(!isset($_GET['sell_id']))
3480 {
3481 ilUtil::sendFailiure($this->lng->txt('paya_no_booking_id_given'));
3482 $this->showObjectSelectorObject();
3483
3484 return false;
3485 }
3486
3487 $ilToolbar->addButton($this->lng->txt('back'), $this->ctrl->getLinkTarget($this, 'showObjectSelector'));
3488 $this->tpl->addBlockFile('ADM_CONTENT','adm_content','tpl.main_view.html','Services/Payment');
3489
3490 $this->lng->loadLanguageModule('search');
3491 $this->ctrl->setParameter($this, 'sell_id', $_GET['sell_id']);
3492
3493 $form_gui = new ilPropertyFormGUI();
3494 $form_gui->setFormAction($this->ctrl->getFormAction($this));
3495 $form_gui->setTitle($this->lng->txt('search_user'));
3496 $form_gui->setId('search_form');
3497
3498 $oTitle = new ilTextInputGUI($this->lng->txt('search_search_term'), 'search_str');
3499 $oTitle->setMaxLength(255);
3500 $oTitle->setSize(40);
3501 $oTitle->setValue($_POST['search_str']);
3502 $form_gui->addItem($oTitle);
3503
3504 // buttons
3505 $form_gui->addCommandButton('performSearchSP', $this->lng->txt('search'));
3506 $form_gui->addCommandButton('bookings', $this->lng->txt('cancel'));
3507
3508 $this->tpl->setVariable('FORM',$form_gui->getHTML());
3509 return true;
3510 }

References $_GET, $_POST, and showObjectSelectorObject().

Referenced by addCustomerObject(), performSearchSPObject(), and saveCustomerObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showObjectSelectorObject()

ilObjPaymentSettingsGUI::showObjectSelectorObject ( )

Definition at line 3314 of file class.ilObjPaymentSettingsGUI.php.

3315 {
3316 global $rbacsystem, $ilToolbar;
3317
3318 // MINIMUM ACCESS LEVEL = 'read'
3319 if(!$rbacsystem->checkAccess('read', $this->object->getRefId()))
3320 {
3321 $this->ilErr->raiseError($this->lng->txt('msg_no_perm_read'),$this->ilErr->MESSAGE);
3322 }
3323
3324 $ilToolbar->addButton($this->lng->txt('back'), $this->ctrl->getLinkTarget($this, 'statistic'));
3325
3326 ilUtil::sendInfo($this->lng->txt('paya_select_object_to_sell'));
3327
3328 include_once("./Services/Payment/classes/class.ilPaymentObjectSelector.php");
3329 $exp = new ilPaymentObjectSelector($this, "showObjectSelector");
3330 if (!$exp->handleCommand())
3331 {
3332 $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.paya_object_selector.html",'Services/Payment');
3333 $this->tpl->setVariable("EXPLORER",$exp->getHTML());
3334 }
3335
3336 return true;
3337 }

References ilUtil\sendInfo().

Referenced by addCustomerObject(), performSearchSPObject(), saveCustomerObject(), and searchUserSPObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ statisticObject()

ilObjPaymentSettingsGUI::statisticObject ( )

Definition at line 1679 of file class.ilObjPaymentSettingsGUI.php.

1680 {
1681 global $rbacsystem, $ilToolbar,$ilObjDataCache;
1682
1683 include_once './Services/Payment/classes/class.ilPayMethods.php';
1684
1685 // MINIMUM ACCESS LEVEL = 'read'
1686 if(!$rbacsystem->checkAccess('read', $this->object->getRefId()))
1687 {
1688 $this->ilErr->raiseError($this->lng->txt('msg_no_perm_read'),$this->ilErr->MESSAGE);
1689 }
1690
1691 $ilToolbar->addButton($this->lng->txt('paya_add_customer'), $this->ctrl->getLinkTarget($this, 'showObjectSelector'));
1692
1693 if ($_POST['updateView'] == 1)
1694 {
1695 $_SESSION['pay_statistics']['show_filter']= $_POST['show_filter'];
1696 $_SESSION['pay_statistics']['updateView'] = true;
1697 $_SESSION['pay_statistics']['until_check'] = $_POST['until_check'];
1698 $_SESSION['pay_statistics']['from_check'] = $_POST['from_check'];
1699 $_SESSION['pay_statistics']['transaction_type'] = isset($_POST['transaction_type']) ? $_POST['transaction_type'] : '' ;
1700 $_SESSION['pay_statistics']['transaction_value'] = isset($_POST['transaction_value']) ? $_POST['transaction_value'] : '';
1701 $_SESSION['pay_statistics']['adm_filter_title_id'] = (int)$_POST['adm_filter_title_id'];
1702
1703 if($_SESSION['pay_statistics']['from_check'] == '1')
1704 {
1705 $_SESSION['pay_statistics']['from']['date']['d'] = $_POST['from']['date']['d'];
1706 $_SESSION['pay_statistics']['from']['date']['m'] = $_POST['from']['date']['m'];
1707 $_SESSION['pay_statistics']['from']['date']['y'] = $_POST['from']['date']['y'];
1708 }
1709 else
1710 {
1711 $_SESSION['pay_statistics']['from']['date']['d'] = '';
1712 $_SESSION['pay_statistics']['from']['date']['m'] = '';
1713 $_SESSION['pay_statistics']['from']['date']['y'] = '';
1714 }
1715
1716 if($_SESSION['pay_statistics']['until_check']== '1')
1717 {
1718 $_SESSION['pay_statistics']['til']['date']['d'] = $_POST['til']['date']['d'];
1719 $_SESSION['pay_statistics']['til']['date']['m'] = $_POST['til']['date']['m'];
1720 $_SESSION['pay_statistics']['til']['date']['y'] = $_POST['til']['date']['y'];
1721 }
1722 else
1723 {
1724 $_SESSION['pay_statistics']['til']['date']['d'] = '';
1725 $_SESSION['pay_statistics']['til']['date']['m'] = '';
1726 $_SESSION['pay_statistics']['til']['date']['y'] = '';
1727 }
1728
1729 $_SESSION['pay_statistics']['payed'] = $_POST['payed'];
1730 $_SESSION['pay_statistics']['access'] = $_POST['access'];
1731 $_SESSION['pay_statistics']['pay_method'] = $_POST['pay_method'];
1732 $_SESSION['pay_statistics']['customer'] = isset ($_POST['customer']) ? $_POST['customer'] : '';
1733 $_SESSION['pay_statistics']['vendor'] = isset ($_POST['vendor']) ? $_POST['vendor']: '';
1734
1735 }
1736
1737 $this->tpl->addBlockfile('ADM_CONTENT','adm_content','tpl.main_view.html','Services/Payment');
1738
1739 $filter_form = new ilPropertyFormGUI();
1740 $filter_form->setFormAction($this->ctrl->getFormAction($this));
1741 $filter_form->setTitle($this->lng->txt('pay_filter'));
1742 $filter_form->setId('formular');
1743 $filter_form->setTableWidth('100 %');
1744 //filter
1745 $o_hide_check = new ilCheckBoxInputGUI($this->lng->txt('show_filter'),'show_filter');
1746 $o_hide_check->setValue(1);
1747 $o_hide_check->setChecked($_POST['show_filter'] ? 1 : 0);
1748
1749 $o_hidden = new ilHiddenInputGUI('updateView');
1750 $o_hidden->setValue(1);
1751 $o_hidden->setPostVar('updateView');
1752 $o_hide_check->addSubItem($o_hidden);
1753
1754 $o_transaction_type = new ilSelectInputGUI();
1755 $trans_option = array($this->lng->txt('pay_starting'),$this->lng->txt('pay_ending'));
1756 $trans_value = array('0','1');
1757 $o_transaction_type->setTitle($this->lng->txt('paya_transaction'));
1758 $o_transaction_type->setOptions($trans_option);
1759 $o_transaction_type->setValue($_SESSION['pay_statistics']['transaction_type']);
1760 $o_transaction_type->setPostVar('transaction_type');
1761 $o_hide_check->addSubItem($o_transaction_type);
1762
1763 $o_transaction_val = new ilTextInputGUI();
1764 $o_transaction_val->setValue($_SESSION['pay_statistics']['transaction_value']);
1765 $o_transaction_val->setPostVar('transaction_value');
1766 $o_hide_check->addSubItem($o_transaction_val);
1767
1768 $o_customer = new ilTextInputGUI();
1769 $o_customer->setTitle($this->lng->txt('paya_customer'));
1770 $o_customer->setValue($_SESSION['pay_statistics']['customer']);
1771 $o_customer->setPostVar('customer');
1772 $o_hide_check->addSubItem($o_customer);
1773
1774 $o_vendor = new ilTextInputGUI();
1775 $o_vendor->setTitle($this->lng->txt('paya_vendor'));
1776 $o_vendor->setValue($_SESSION['pay_statistics']['vendor']);
1777 $o_vendor->setPostVar('vendor');
1778 $o_hide_check->addSubItem($o_vendor);
1779
1780 $o_from_check = new ilCheckBoxInputGUI($this->lng->txt('pay_order_date_from'),'from_check');
1781 $o_from_check->setValue(1);
1782 $o_from_check->setChecked($_SESSION['pay_statistics']['from_check'] ? 1 : 0);
1783
1784 $o_date_from = new ilDateTimeInputGUI();
1785 $o_date_from->setPostVar('from');
1786
1787 if($_SESSION['pay_statistics']['from_check'] == '1')
1788 {
1789 $o_date_from->setValueByArray($_SESSION['pay_statistics']['from']);
1790 $o_date_from->checkInput();
1791 }
1792
1793 $o_from_check->addSubItem($o_date_from);
1794 $o_hide_check->addSubItem($o_from_check);
1795
1796 $o_until_check = new ilCheckBoxInputGUI($this->lng->txt('pay_order_date_til'), 'until_check');
1797 $o_until_check->setValue(1);
1798 $o_until_check->setChecked($_SESSION['pay_statistics']['until_check'] ? 1 : 0);
1799
1800 $o_date_until = new ilDateTimeInputGUI();
1801 $o_date_until->setPostVar('til');
1802
1803 if($_SESSION['pay_statistics']['until_check'] == '1')
1804 {
1805 $o_date_until->setValueByArray($_SESSION['pay_statistics']['til']);
1806 $o_date_until->checkInput();
1807 }
1808
1809 $o_until_check->addSubItem($o_date_until);
1810 $o_hide_check->addSubItem($o_until_check);
1811
1812 // title filter
1813 $this->__initBookingObject();
1814 $title_options['all']=$this->lng->txt('pay_all');
1815 $unique_titles = $this->booking_obj->getUniqueTitles();
1816
1817 if(is_array($unique_titles) && count($unique_titles))
1818 {
1819 foreach($unique_titles as $ref_id)
1820 {
1821 $title_options[$ref_id] = $ilObjDataCache->lookupTitle($ilObjDataCache->lookupObjId($ref_id));
1822 }
1823 }
1824
1825 $o_object_title = new ilSelectInputGUI();
1826 $o_object_title->setTitle($this->lng->txt('title'));
1827 $o_object_title->setOptions($title_options);
1828 $o_object_title->setValue($_SESSION["pay_statistics"]["adm_filter_title_id"]);
1829 $o_object_title->setPostVar('adm_filter_title_id');
1830 $o_hide_check->addSubItem($o_object_title);
1831
1832 $o_payed = new ilSelectInputGUI();
1833 $payed_option = array('all'=>$this->lng->txt('pay_all'),'1'=>$this->lng->txt('yes'),'0'=>$this->lng->txt('no'));
1834
1835 $o_payed->setTitle($this->lng->txt('paya_payed'));
1836 $o_payed->setOptions($payed_option);
1837 $o_payed->setValue($_SESSION['pay_statistics']['payed']);
1838 $o_payed->setPostVar('payed');
1839
1840 $o_hide_check->addSubItem($o_payed);
1841
1842 $o_access = new ilSelectInputGUI();
1843 $access_option = array('all'=>$this->lng->txt('pay_all'),'1'=>$this->lng->txt('yes'),'0'=>$this->lng->txt('no'));
1844
1845 $o_access->setTitle($this->lng->txt('paya_access'));
1846 $o_access->setOptions($access_option);
1847 $o_access->setValue($_SESSION['pay_statistics']['access']);
1848 $o_access->setPostVar('access');
1849 $o_hide_check->addSubItem($o_access);
1850
1851 $o_paymethod = new ilSelectInputGUI();
1852 $o_paymethod->setTitle($this->lng->txt('payment_system'));
1853 $o_paymethod->setOptions(ilPaymethods::getPayMethodsOptions('all'));
1854 $o_paymethod->setValue($_SESSION['pay_statistics']['pay_method']);
1855 $o_paymethod->setPostVar('pay_method');
1856 $o_hide_check->addSubItem($o_paymethod);
1857
1858 $filter_form->addCommandButton('statistic', $this->lng->txt('pay_update_view'));
1859 $filter_form->addCommandButton('resetFilter', $this->lng->txt('pay_reset_filter'));
1860
1861 $filter_form->addItem($o_hide_check);
1862
1863 $this->tpl->setVariable('FORM', $filter_form->getHTML());
1864 //else $filter_form->checkInput();
1865
1866 // STATISTICS TABLE
1867 $this->__initBookingObject();
1868
1869 if(!count($bookings = $this->booking_obj->getBookings()))
1870 {
1871 ilUtil::sendInfo($this->lng->txt('paya_no_bookings'));
1872
1873 return true;
1874 }
1875# else
1876# {
1877# $this->__showButton('exportVendors',$this->lng->txt('excel_export'));
1878# }
1879
1880 include_once 'Services/User/classes/class.ilObjUser.php';
1881 $object_title_cache = array();
1882 $user_title_cache = array();
1883
1884 $counter = 0;
1885 foreach($bookings as $booking)
1886 {
1887 if(array_key_exists($booking['ref_id'], $object_title_cache))
1888 {
1889 $tmp_obj = $object_title_cache[$booking['ref_id']];
1890 }
1891 else
1892 {
1893 $tmp_obj = ilObject::_lookupTitle(ilObject::_lookupObjId($booking['ref_id']));
1894 $object_title_cache[$booking['ref_id']] = $tmp_obj;
1895 }
1896
1897
1898 if(array_key_exists($booking['b_vendor_id'], $user_title_cache))
1899 {
1900 $tmp_vendor = $user_title_cache[$booking['b_vendor_id']];
1901 }
1902 else
1903 {
1904 $tmp_vendor = ilObjUser::_lookupLogin($booking['b_vendor_id']);
1905 $user_title_cache[$booking['b_vendor_id']] = $tmp_vendor;
1906 }
1907 if(array_key_exists($booking['customer_id'], $user_title_cache))
1908 {
1909 $tmp_purchaser = $user_title_cache[$booking['customer_id']];
1910 }
1911 else
1912 {
1913 if(ANONYMOUS_USER_ID == $booking['customer_id'])
1914 {
1915 $tmp_purchaser = ilObjUser::_lookupLogin($booking['customer_id']);
1916 $purchaser_name = $booking['name_extern'];
1917 $tmp_purchaser_email = $booking['email_extern'];
1918 }
1919 else
1920 {
1921 $tmp_purchaser = ilObjUser::_lookupLogin($booking['customer_id']);
1922 $tmp_purchaser_name = ilObjUser::_lookupName($booking['customer_id']);
1923 $purchaser_name = $tmp_purchaser_name['firstname'].' '.$tmp_purchaser_name['lastname'];
1924 $tmp_purchaser_email = ilObjUser::_lookupEmail($booking['customer_id']);
1925 }
1926 $user_title_cache[$booking['customer_id']] = $tmp_purchaser;
1927 }
1928
1929 $transaction = $booking['transaction_extern'];
1930 $str_paymethod = ilPayMethods::getStringByPaymethod($booking['b_pay_method']);
1931 $transaction .= $booking['transaction']."<br> (" . $str_paymethod . ")";
1932
1933 $f_result[$counter]['transaction'] = $transaction;
1934 $f_result[$counter]['object_title'] = ($tmp_obj != '' ? $tmp_obj : $this->lng->txt('object_deleted'));
1935 $f_result[$counter]['vendor'] = ($tmp_vendor != '' ? '['.$tmp_vendor.']' : $this->lng->txt('user_deleted'));
1936 $f_result[$counter]['customer'] = ($tmp_purchaser != '' ?
1937 $purchaser_name. ' ['.$tmp_purchaser.']<br>'
1938 .$tmp_purchaser_email
1939 : $this->lng->txt('user_deleted'));
1940 $f_result[$counter]['order_date'] = ilDatePresentation::formatDate(new ilDate($booking['order_date'], IL_CAL_UNIX));
1941
1942
1943 if($booking['duration'] == 0 && $booking['access_enddate'] == NULL)
1944 {
1945 $f_result[$counter]['duration'] = $this->lng->txt("unlimited_duration");
1946 }
1947 else
1948 {
1949// if($booking['duration'] > 0 )
1950// {
1951// $f_result[$counter]['duration'] = $booking['duration'].' '.$this->lng->txt('paya_months').' / </br>';
1952// }
1953 $f_result[$counter]['duration'] .= ilDatePresentation::formatDate(new ilDate($booking['access_startdate'], IL_CAL_DATETIME))
1954 .' - '.ilDatePresentation::formatDate(new ilDate($booking['access_enddate'], IL_CAL_DATETIME));
1955 }
1956
1957 $f_result[$counter]['price'] = $booking['price'].' '.$booking['currency_unit'];
1958 $f_result[$counter]['discount'] = ($booking['discount'] != '' ? ($booking['discount'].' '.$booking['currency_unit']) : '&nbsp;');
1959
1960 $payed_access = $booking['payed'] ?
1961 $this->lng->txt('yes') :
1962 $this->lng->txt('no');
1963
1964 $payed_access .= '/';
1965 $payed_access .= $booking['access_granted'] ?
1966 $this->lng->txt('yes') :
1967 $this->lng->txt('no');
1968
1969 $f_result[$counter]['payed_access'] = $payed_access;
1970
1971 $this->ctrl->setParameter($this,"booking_id",$booking['booking_id']);
1972 $link_change = "<div class=\"il_ContainerItemCommands\"><a class=\"il_ContainerItemCommand\" href=\"".$this->ctrl->getLinkTarget($this,"editStatistic")."\">".$this->lng->txt("edit")."</a></div>";
1973
1974 $f_result[$counter]['edit'] = $link_change;
1975
1976 unset($tmp_obj);
1977 unset($tmp_vendor);
1978 unset($tmp_purchaser);
1979
1980 ++$counter;
1981 }
1982 return $this->__showStatisticTable($f_result);
1983 }

References $_POST, $_SESSION, ilObjectGUI\$ref_id, __initBookingObject(), __showStatisticTable(), ilObjUser\_lookupEmail(), ilObjUser\_lookupLogin(), ilObjUser\_lookupName(), ilObject\_lookupObjId(), ilObject\_lookupTitle(), ilDatePresentation\formatDate(), ilPayMethods\getStringByPaymethod(), IL_CAL_DATETIME, IL_CAL_UNIX, and ilUtil\sendInfo().

Referenced by deleteStatisticObject(), performDeleteObject(), resetFilterObject(), saveCustomerObject(), and updateStatisticObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ StatutoryRegulationsObject()

ilObjPaymentSettingsGUI::StatutoryRegulationsObject ( )

Definition at line 4767 of file class.ilObjPaymentSettingsGUI.php.

4768 {
4769 $this->tpl->addBlockfile('ADM_CONTENT','adm_content','tpl.main_view.html','Services/Payment');
4770 $form = new ilPropertyFormGUI();
4771 $form->setFormAction($this->ctrl->getFormAction($this, 'saveStatutoryRegulations'));
4772 $form->setTitle($this->lng->txt('statutory_regulations'));
4773 $form->setTableWidth('100%');
4774 // message
4775 $post_gui = new ilTextAreaInputGUI($this->lng->txt('content'), 'statutory_regulations');
4776 $post_gui->setCols(50);
4777 $post_gui->setRows(15);
4778 $post_gui->setUseRte(true);
4779 $post_gui->addPlugin('latex');
4780 $post_gui->addButton('latex');
4781 $post_gui->addButton('pastelatex');
4782 $post_gui->addPlugin('ilimgupload');
4783 $post_gui->addButton('ilimgupload');
4784 $post_gui->removePlugin('advlink');
4785 $post_gui->removePlugin(ilRTE::ILIAS_IMG_MANAGER_PLUGIN);
4786 $post_gui->removePlugin('image');
4787 $post_gui->usePurifier(true);
4788 $post_gui->setRTERootBlockElement('');
4789 $post_gui->setRTESupport(ilObject::_lookupObjId($this->ref_id), 'pays~', 'frm_post', 'tpl.tinymce_frm_post.html', false, '3.4.7');
4790 $post_gui->disableButtons(array(
4791 'charmap',
4792 'undo',
4793 'redo',
4794 'justifyleft',
4795 'justifycenter',
4796 'justifyright',
4797 'justifyfull',
4798 'anchor',
4799 'fullscreen',
4800 'cut',
4801 'copy',
4802 'paste',
4803 'pastetext',
4804 'formatselect',
4805 'image'
4806 ));
4807 // purifier
4808 require_once 'Services/Html/classes/class.ilHtmlPurifierFactory.php';
4809 require_once 'Services/RTE/classes/class.ilRTE.php';
4810 $post_gui->setPurifier(ilHtmlPurifierFactory::_getInstanceByType('frm_post'));
4811 $post_gui->setValue(ilRTE::_replaceMediaObjectImageSrc($this->genSetData->get('statutory_regulations'),1));
4812 $form->addItem($post_gui);
4813
4814 // show staturaltyio regulations in shoppingcart
4815 $cb_showShoppingCart = new ilCheckboxInputGUI($this->lng->txt('show_sr_shoppingcart'), 'show_sr_shoppingcart');
4816 $cb_showShoppingCart->setInfo($this->lng->txt('show_sr_shoppingcart_info'));
4817 $cb_showShoppingCart->setValue(1);
4818 $cb_showShoppingCart->setChecked($this->genSetData->get('show_sr_shoppingcart'));
4819 $form->addItem($cb_showShoppingCart);
4820
4821 // attach staturaltyio regulations at invoice
4822 $cb_attachInvoice = new ilCheckboxInputGUI($this->lng->txt('attach_sr_invoice'), 'attach_sr_invoice');
4823 $cb_attachInvoice->setInfo($this->lng->txt('attach_sr_invoice_info'));
4824 $cb_attachInvoice->setValue(1);
4825 $cb_attachInvoice->setChecked($this->genSetData->get('attach_sr_invoice'));
4826 $form->addItem($cb_attachInvoice);
4827
4828 $form->addCommandButton('saveStatutoryRegulations', $this->lng->txt('save'));
4829 $this->tpl->setVariable('FORM', $form->getHTML());
4830
4831 }
static _getInstanceByType($a_type)
Factory method for creating purifier instances.
const ILIAS_IMG_MANAGER_PLUGIN
Definition: class.ilRTE.php:36

References $form, ilHtmlPurifierFactory\_getInstanceByType(), ilObject\_lookupObjId(), ilRTE\_replaceMediaObjectImageSrc(), and ilRTE\ILIAS_IMG_MANAGER_PLUGIN.

Referenced by saveStatutoryRegulationsObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ TermsConditionsObject()

ilObjPaymentSettingsGUI::TermsConditionsObject ( )

Definition at line 4507 of file class.ilObjPaymentSettingsGUI.php.

4508 {
4509 global $ilToolbar;
4510
4511 $ilToolbar->addButton($this->lng->txt('edit_page'), $this->ctrl->getLinkTargetByClass(array('ilshoppagegui'), 'edit'));
4512
4513 $this->tpl->addBlockfile('ADM_CONTENT','adm_content','tpl.main_view.html','Services/Payment');
4514 $this->tpl->setVariable('FORM', $this->getDocumentsPageHTML(self::CONDITIONS_EDITOR_PAGE_ID));
4515
4516 return true;
4517 }

References getDocumentsPageHTML().

+ Here is the call graph for this function:

◆ updateCurrencyObject()

ilObjPaymentSettingsGUI::updateCurrencyObject ( )

Definition at line 4490 of file class.ilObjPaymentSettingsGUI.php.

4491 {
4492 if(!$_POST['currency_id']) return false;
4493
4494 $obj_currency = new ilPaymentCurrency($_POST['currency_id']);
4495 $obj_currency->setUnit($_POST['currency_unit']);
4496 $obj_currency->setIsoCode($_POST['iso_code']);
4497 $obj_currency->setSymbol($_POST['symbol']);
4498 $obj_currency->setConversionRate($_POST['conversion_rate']);
4499
4500 $obj_currency->updateCurrency();
4501
4502 $this->currenciesObject();
4503
4504 return true;
4505 }

References $_POST, and currenciesObject().

+ Here is the call graph for this function:

◆ updateDefaultCurrencyObject()

ilObjPaymentSettingsGUI::updateDefaultCurrencyObject ( )

Definition at line 4353 of file class.ilObjPaymentSettingsGUI.php.

4354 {
4355 if(isset($_POST['currency_id'] ))
4356 {
4358 }
4359 else ilUtil::sendFailure($this->lng->txt('please_select_currency'));
4360
4361 $this->currenciesObject();
4362 }
static _updateIsDefault($a_currency_id)

References $_POST, ilPaymentCurrency\_updateIsDefault(), currenciesObject(), and ilUtil\sendFailure().

+ Here is the call graph for this function:

◆ updateDetailsObject()

ilObjPaymentSettingsGUI::updateDetailsObject ( )

Definition at line 571 of file class.ilObjPaymentSettingsGUI.php.

572 {
573 if(!$_GET['pobject_id'])
574 {
575 ilUtil::sendInfo($this->lng->txt('paya_no_object_selected'));
576
577 $this->objectObjects();
578 return true;
579 }
580
581 $this->__initPaymentObject((int) $_GET['pobject_id']);
582 $this->ctrl->setParameter($this,'pobject_id',(int) $_GET['pobject_id']);
583
584 // read old settings
585 $old_status = $this->pobject->getStatus();
586
587 // check status changed from not_buyable
588 if($old_status == $this->pobject->STATUS_NOT_BUYABLE and
589 (int) $_POST['status'] != $old_status)
590 {
591 // check pay_method edited
592 switch((int) $_POST['pay_method'])
593 {
594 case $this->pobject->PAY_METHOD_NOT_SPECIFIED:
595 ilUtil::sendInfo($this->lng->txt('paya_select_pay_method_first'));
596 $this->editDetailsObject();
597
598 return false;
599 default:
600 ;
601 }
602 // check minimum one price
603 $prices_obj = new ilPaymentPrices((int) $_GET['pobject_id']);
604 $standard_prices = array();
605 $standard_prices = $prices_obj->getPrices();
606
607 if(!count($standard_prices))
608 {
609 ilUtil::sendInfo($this->lng->txt('paya_edit_prices_first'));
610 $this->editDetailsObject();
611
612 return false;
613 }
614 }
615
616 $this->pobject->setStatus((int) $_POST['status']);
617 $this->pobject->setVendorId((int) $_POST['vendor']);
618 $this->pobject->setPayMethod((int) $_POST['pay_method']);
619 $this->pobject->setTopicId((int) $_POST['topic_id']);
620 $this->pobject->setVatId((int) $_POST['vat_id']);
621
622 $this->pobject->update();
623
624 ilUtil::sendInfo($this->lng->txt('paya_details_updated'));
625 $this->editDetailsObject();
626
627 return true;
628 }

References $_GET, $_POST, __initPaymentObject(), editDetailsObject(), and ilUtil\sendInfo().

+ Here is the call graph for this function:

◆ updatePriceObject()

ilObjPaymentSettingsGUI::updatePriceObject ( )

Definition at line 1085 of file class.ilObjPaymentSettingsGUI.php.

1086 {
1087 if(!$_GET['pobject_id'] && !$_POST['pobject_id'])
1088 {
1089 ilUtil::sendInfo($this->lng->txt('paya_no_object_selected'));
1090
1091 $this->objectsObject();
1092 return true;
1093 }
1094 if(isset($_GET['pobject_id']))
1095 {
1096 $pobject_id = (int)$_GET['pobject_id'];
1097 }
1098 else
1099 {
1100 $pobject_id = (int)$_POST['pobject_id'];
1101 }
1102
1103 if(!(int)$_GET['price_id'] && !$_POST['price_id'])
1104 {
1105 ilUtil::sendInfo($this->lng->txt('payment_no_price_selected'));
1106 return $this->editPricesObject();
1107 }
1108 if(isset($_GET['price_id']))
1109 {
1110 $price_id = (int)$_GET['price_id'];
1111 }
1112 else
1113 {
1114 $price_id = (int)$_POST['price_id'];
1115 }
1116
1117 $po = new ilPaymentPrices((int)$pobject_id);
1118 switch($_POST['price_type'])
1119 {
1122 $po->setDuration(NULL);
1123 $po->setDurationFrom(NULL);
1124 $po->setDurationUntil(NULL);
1125 $po->setUnlimitedDuration(1);
1126
1127 break;
1128
1131 $po->setDuration(NULL);
1132 $po->setDurationFrom(ilUtil::stripSlashes(
1133 $_POST['duration_date_from']['date']['y'].'-'.
1134 $_POST['duration_date_from']['date']['m'].'-'.
1135 $_POST['duration_date_from']['date']['d']));
1136 $po->setDurationUntil(ilUtil::stripSlashes(
1137 $_POST['duration_date_until']['date']['y'].'-'.
1138 $_POST['duration_date_until']['date']['m'].'-'.
1139 $_POST['duration_date_until']['date']['d']));
1140 break;
1141
1142 default:
1145 $po->setDuration($_POST['duration_month']);
1146 $po->setDurationFrom(NULL);
1147 $po->setDurationUntil(NULL);
1148 break;
1149 }
1150
1151 $po->setDescription($_POST['description'] ? ilUtil::stripSlashes($_POST['description']) : NULL);
1152 $po->setPrice(ilUtil::stripSlashes($_POST['price']));
1153 $po->setCurrency(ilUtil::stripSlashes($_POST['currency']));
1154 if($_POST['extension_price'])
1155 {
1156 $po->setExtension(1);
1157 }
1158 else
1159 {
1160 $po->setExtension(0);
1161 }
1162 try
1163 {
1164 $po->validate();
1165 $po->update($price_id);
1166 ilUtil::sendInfo($this->lng->txt('paya_updated_price'));
1167 return $this->editPricesObject();
1168 }
1169 catch(ilShopException $e)
1170 {
1171 ilUtil::sendInfo($e->getMessage());
1172 $this->editPriceObject();
1173 return true;
1174 }
1175 }

References $_GET, $_POST, editPriceObject(), objectsObject(), ilUtil\sendInfo(), ilUtil\stripSlashes(), ilPaymentPrices\TYPE_DURATION_DATE, ilPaymentPrices\TYPE_DURATION_MONTH, and ilPaymentPrices\TYPE_UNLIMITED_DURATION.

+ Here is the call graph for this function:

◆ updateStatisticObject()

ilObjPaymentSettingsGUI::updateStatisticObject ( )

Definition at line 2176 of file class.ilObjPaymentSettingsGUI.php.

2177 {
2178 if(!isset($_GET['booking_id']))
2179 {
2180 ilUtil::sendInfo($this->lng->txt('paya_no_booking_id_given'));
2181 $this->statisticObject();
2182
2183 return true;
2184 }
2185 $this->__initBookingObject();
2186
2187 $this->booking_obj->setBookingId((int) $_GET['booking_id']);
2188 $this->booking_obj->setAccess((int) $_POST['access']);
2189 $this->booking_obj->setPayed((int) $_POST['payed']);
2190
2191 if($this->booking_obj->update())
2192 {
2193 ilUtil::sendSuccess($this->lng->txt('paya_updated_booking'));
2194
2195 $this->statisticObject();
2196 return true;
2197 }
2198 else
2199 {
2200 ilUtil::sendInfo($this->lng->txt('paya_error_update_booking'));
2201 $this->statisticObject();
2202
2203 return true;
2204 }
2205 }

References $_GET, $_POST, __initBookingObject(), ilUtil\sendInfo(), ilUtil\sendSuccess(), and statisticObject().

+ Here is the call graph for this function:

◆ updateVatObject()

ilObjPaymentSettingsGUI::updateVatObject ( )

Definition at line 4216 of file class.ilObjPaymentSettingsGUI.php.

4217 {
4218 $this->initVatForm('edit');
4219 if(!$this->form->checkInput())
4220 {
4221 $this->form->setValuesByPost();
4222 $this->tpl->setContent($this->form->getHtml());
4223 return true;
4224 }
4225
4226 if(!ilShopUtils::_checkVATRate($this->form->getInput('vat_rate')))
4227 {
4228 $this->form->getItemByPostVar('vat_rate')->setAlert($this->lng->txt('payment_vat_input_invalid'));
4229 $this->form->setValuesByPost();
4230 $this->tpl->setContent($this->form->getHtml());
4231 return true;
4232 }
4233
4234 try
4235 {
4236 $oVAT = new ilShopVats((int)$_GET['vat_id']);
4237 $oVAT->setTitle($this->form->getInput('vat_title'));
4238 $oVAT->setRate((float)str_replace(',', '.', $this->form->getInput('vat_rate')));
4239 $oVAT->update();
4240 }
4241 catch(ilShopException $e)
4242 {
4243 ilUtil::sendInfo($e->getMessage());
4244 $this->form->setValuesByPost();
4245 $this->tpl->setContent($this->form->getHtml());
4246 return true;
4247 }
4248
4249 ilUtil::sendInfo($this->lng->txt('saved_successfully'));
4250 return $this->vatsObject();
4251 }

References $_GET, ilShopUtils\_checkVATRate(), initVatForm(), ilUtil\sendInfo(), and vatsObject().

+ Here is the call graph for this function:

◆ vatsObject()

ilObjPaymentSettingsGUI::vatsObject ( )

Definition at line 4006 of file class.ilObjPaymentSettingsGUI.php.

4007 {
4008 global $ilAccess;
4009
4010 if(!$ilAccess->checkAccess('read', '', $this->object->getRefId()))
4011 {
4012 $this->ilErr->raiseError($this->lng->txt('msg_no_perm_read'), $this->ilErr->MESSAGE);
4013 }
4014
4015 include_once 'Services/Table/classes/class.ilTable2GUI.php';
4016 $tbl = new ilTable2GUI($this, 'vats');
4017 $tbl->setId('pay_vats_tbl');
4018 $tbl->setFormAction($this->ctrl->getFormAction($this), 'createVat');
4019 $tbl->setTitle($this->lng->txt('payment_tax_rates'));
4020 $tbl->setRowTemplate('tpl.shop_vats_list_row.html', 'Services/Payment');
4021
4022 $tbl->setDefaultOrderField('title');
4023
4024 $tbl->addColumn('', 'check', '1%');
4025 $tbl->addColumn($this->lng->txt('vat_title'), 'vat_title', '33%');
4026 $tbl->addColumn($this->lng->txt('vat_rate'), 'vat_rate', '33%');
4027 $tbl->addColumn('', 'commands', '33%');
4028
4029 $oShopVatsList = new ilShopVatsList();
4030 $oShopVatsList->read();
4031
4032 $result = array();
4033
4034 $_SESSION['count_vats'] = $oShopVatsList->getNumItems();
4035
4036 if($oShopVatsList->hasItems())
4037 {
4038 $tbl->enable('select_all');
4039 $tbl->setSelectAllCheckbox('vat_id');
4040
4041 $counter = 0;
4042 foreach($oShopVatsList as $oVAT)
4043 {
4044 $result[$counter]['check'] = ilUtil::formCheckbox(0, 'vat_id[]', $oVAT->getId());
4045 $result[$counter]['vat_title'] = $oVAT->getTitle();
4046 $result[$counter]['vat_rate'] = ilShopUtils::_formatVAT((float)$oVAT->getRate());
4047 $this->ctrl->setParameter($this, 'vat_id', $oVAT->getId());
4048 $result[$counter]['edit_text'] = $this->lng->txt('edit');
4049 $result[$counter]['edit_url'] = $this->ctrl->getLinkTarget($this, 'editVat');
4050 $result[$counter]['delete_text'] = $this->lng->txt('delete');
4051 $result[$counter]['delete_url'] = $this->ctrl->getLinkTarget($this, 'confirmDeleteVat');
4052 $this->ctrl->clearParameters($this);
4053 ++$counter;
4054 }
4055
4056 $tbl->addMultiCommand('confirmDeleteVat', $this->lng->txt('delete'));
4057 }
4058 else
4059 {
4060 $tbl->disable('header');
4061 $tbl->disable('footer');
4062
4063 $tbl->setNoEntriesText($this->lng->txt('paya_no_vats_assigned'));
4064 }
4065
4066 $tbl->setData($result);
4067
4068 $tbl->addCommandButton('createVat', $this->lng->txt('paya_insert_vats'));
4069
4070 $this->tpl->setContent($tbl->getHTML());
4071
4072 return true;
4073 }
Class ilTable2GUI.

References $_SESSION, $result, $tbl, ilShopUtils\_formatVAT(), and ilUtil\formCheckbox().

Referenced by checkShopActivationObject(), confirmDeleteVatObject(), performDeleteVatObject(), saveVatObject(), and updateVatObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vendorsObject()

ilObjPaymentSettingsGUI::vendorsObject (   $a_show_confirm = false)

Definition at line 2699 of file class.ilObjPaymentSettingsGUI.php.

2700 {
2701 // include_once './Services/Payment/classes/class.ilPaymentBookings.php';
2702 #include_once './Services/Table/classes/class.ilTable2GUI.php';
2703
2704 global $rbacsystem, $ilToolbar;
2705
2706 // MINIMUM ACCESS LEVEL = 'read'
2707 if(!$rbacsystem->checkAccess('read', $this->object->getRefId()))
2708 {
2709 $this->ilErr->raiseError($this->lng->txt('msg_no_perm_read'),$this->ilErr->MESSAGE);
2710 }
2711
2712 $_SESSION['pays_vendor'] = is_array($_SESSION['pays_vendor']) ? $_SESSION['pays_vendor'] : array();
2713
2714 $this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.main_view.html','Services/Payment');
2715
2716 // add vendors
2718 $this,
2719 $ilToolbar,
2720 array(
2721 'auto_complete_name' => $this->lng->txt('user'),
2722 'user_type' => null,
2723 'submit_name' => $this->lng->txt('add')
2724 ));
2725
2726 if(!count($vendors = $this->vendors_obj->getVendors()))
2727 {
2728 ilUtil::sendInfo($this->lng->txt('pay_no_vendors_created'));
2729 }
2730
2731 if($a_show_confirm)
2732 {
2733 $oConfirmationGUI = new ilConfirmationGUI();
2734
2735 // set confirm/cancel commands
2736 $oConfirmationGUI->setFormAction($this->ctrl->getFormAction($this,"performDeleteVendors"));
2737 $oConfirmationGUI->setHeaderText($this->lng->txt("pays_sure_delete_selected_vendors"));
2738 $oConfirmationGUI->setCancel($this->lng->txt("cancel"), "vendors");
2739 $oConfirmationGUI->setConfirm($this->lng->txt("confirm"), "performDeleteVendors");
2740
2741 foreach($vendors as $vendor)
2742 {
2743 if(in_array($vendor['vendor_id'],$_SESSION['pays_vendor']))
2744 {
2745 // GET USER OBJ
2746 if($tmp_obj = ilObjectFactory::getInstanceByObjId($vendor['vendor_id'],false))
2747 {
2748 $delete_row = '';
2749 $delete_row = $tmp_obj->getLogin().' '.
2750 $vendor['cost_center'].' '.
2752 $oConfirmationGUI->addItem('',$delete_row, $delete_row);
2753 unset($tmp_obj);
2754 }
2755 }
2756 } // END VENDORS TABLE
2757
2758 if(count($vendors) == count($_SESSION['pays_vendor']))
2759 {
2760 ilUtil::sendInfo($this->lng->txt('shop_disabled_no_vendors'));
2761 $_SESSION['disable_shop'] = true;
2762 }
2763 $this->tpl->setVariable('CONFIRMATION', $oConfirmationGUI->getHTML()); #
2764 return true;
2765 }
2766
2767 $counter = 0;
2768 $f_result = array();
2769 foreach($vendors as $vendor)
2770 {
2771 // GET USER OBJ
2772 if($tmp_obj = ilObjectFactory::getInstanceByObjId($vendor['vendor_id'],false))
2773 {
2774 $f_result[$counter]['vendor_id'] = ilUtil::formCheckbox(in_array($vendor['vendor_id'],
2775 $_SESSION['pays_vendor']) ? 1 : 0, "vendor[]", $vendor['vendor_id']);
2776 $f_result[$counter]['login'] = $tmp_obj->getLogin();
2777 $f_result[$counter]['cost_center'] = $vendor['cost_center'];
2778 $f_result[$counter]['number_bookings'] = ilPaymentBookings::_getCountBookingsByVendor($vendor['vendor_id']);
2779
2780 unset($tmp_obj);
2781 ++$counter;
2782 }
2783 } // END VENDORS TABLE
2784 $this->__showVendorsTable($f_result);
2785
2786 return true;
2787 }
static fillAutoCompleteToolbar($parent_object, ilToolbarGUI $toolbar=null, $a_options=array(), $a_sticky=false)
fill toolbar with

References $_SESSION, __showVendorsTable(), ilPaymentBookings\_getCountBookingsByVendor(), ilRepositorySearchGUI\fillAutoCompleteToolbar(), ilUtil\formCheckbox(), ilObjectFactory\getInstanceByObjId(), and ilUtil\sendInfo().

Referenced by addUserObject(), addVendorObject(), cancelDeleteVendorsObject(), checkShopActivationObject(), deleteVendorsObject(), editVendorObject(), gatewayObject(), performDeleteVendorsObject(), and performEditVendorObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $active_sub_tab

ilObjPaymentSettingsGUI::$active_sub_tab

Definition at line 50 of file class.ilObjPaymentSettingsGUI.php.

◆ $booking_obj

ilObjPaymentSettingsGUI::$booking_obj = null

Definition at line 54 of file class.ilObjPaymentSettingsGUI.php.

◆ $ctrl

ilObjPaymentSettingsGUI::$ctrl = null

Definition at line 66 of file class.ilObjPaymentSettingsGUI.php.

◆ $error

ilObjPaymentSettingsGUI::$error = false

Definition at line 52 of file class.ilObjPaymentSettingsGUI.php.

◆ $form

ilObjPaymentSettingsGUI::$form = null

◆ $genSetData

ilObjPaymentSettingsGUI::$genSetData = null

Definition at line 48 of file class.ilObjPaymentSettingsGUI.php.

◆ $ilErr

ilObjPaymentSettingsGUI::$ilErr = null

Definition at line 57 of file class.ilObjPaymentSettingsGUI.php.

Referenced by __construct().

◆ $pobject

ilObjPaymentSettingsGUI::$pobject = null

Definition at line 44 of file class.ilObjPaymentSettingsGUI.php.

◆ $tabs_gui

ilObjPaymentSettingsGUI::$tabs_gui = null

Definition at line 71 of file class.ilObjPaymentSettingsGUI.php.

Referenced by getTabs().

◆ $user_obj

ilObjPaymentSettingsGUI::$user_obj = null

Definition at line 41 of file class.ilObjPaymentSettingsGUI.php.

◆ $vendors_obj

ilObjPaymentSettingsGUI::$vendors_obj = null

Definition at line 61 of file class.ilObjPaymentSettingsGUI.php.

◆ CONDITIONS_EDITOR_PAGE_ID

const ilObjPaymentSettingsGUI::CONDITIONS_EDITOR_PAGE_ID = 99999997

Definition at line 37 of file class.ilObjPaymentSettingsGUI.php.


The documentation for this class was generated from the following file: