ILIAS  release_4-4 Revision
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 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 public More...
 
 savePaypalSettingsObject ()
 
 vendorsObject ($a_show_confirm=false)
 
 exportVendorsObject ()
 
 addStatisticWorksheet (&$pewa)
 
 addVendorWorksheet ($pewa)
 
 payMethodsObject ($askForDeletingAddresses=array())
 
 savePayMethodsObject ()
 
 cancelDeleteVendorsObject ()
 
 deleteVendorsObject ()
 
 performDeleteVendorsObject ()
 
 editVendorObject ()
 
 performEditVendorObject ()
 
 showObjectSelectorObject ()
 
 searchUserObject ()
 
 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 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 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...
 
 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 public More...
 
 setAdminTabs ()
 set admin tabs 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...
 
 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)
 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...
 

Detailed Description

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

Constructor & Destructor Documentation

◆ __construct()

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

Constructor public.

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

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

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

Member Function Documentation

◆ __editPricesTable()

ilObjPaymentSettingsGUI::__editPricesTable (   $a_result_set)
private

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

References $_GET, $_POST, $form, __initPaymentObject(), ilPaymentSettings\_getInstance(), ilRadioOption\addSubItem(), ilObjectFactory\getInstanceByRefId(), objectsObject(), ilUtil\sendInfo(), ilCheckboxInputGUI\setChecked(), ilTextAreaInputGUI\setRows(), ilRadioOption\setTitle(), ilRadioOption\setValue(), and ilNonEditableValueGUI\setValue().

Referenced by updateDetailsObject().

795  {
796  $this->ctrl->setParameter($this, 'cmd', 'editprices');
797  $tbl = new ilShopTableGUI($this);
798 
799  $tmp_obj = ilObjectFactory::getInstanceByRefId($this->pobject->getRefId(), false);
800  if($tmp_obj)
801  {
802  $tbl->setTitle($tmp_obj->getTitle());
803  }
804  else
805  {
806  $tbl->setTitle($this->lng->txt('object_not_found'));
807  }
808 
809  $tbl->setId('tbl_bookings');
810  $tbl->setRowTemplate("tpl.shop_prices_row.html", "Services/Payment");
811 
812  $tbl->addColumn(' ', 'price_id', '5%');
813  $tbl->addColumn($this->lng->txt('duration'), 'duration', '40%');
814  $tbl->addColumn($this->lng->txt('price_a'), 'price', '1%');
815  $tbl->addColumn($this->lng->txt('currency'), 'currency_unit', '10%');
816  $tbl->addColumn($this->lng->txt('extension_price'), 'extension', '10%');
817  $tbl->addColumn('', 'edit', '30%' );
818 
819  $tbl->setSelectAllCheckbox('price_id');
820  $tbl->addCommandButton('addPrice',$this->lng->txt('paya_add_price'));
821 
822  $tbl->addMultiCommand("deletePrice", $this->lng->txt("paya_delete_price"));
823  $tbl->fillFooter();
824 
825  $tbl->setData($a_result_set);
826 
827  $this->tpl->setVariable('TABLE', $tbl->getHTML());
828 
829  return true;
830  }
getInstanceByRefId($a_ref_id, $stop_on_error=true)
get an instance of an Ilias object by reference id
Class ilShopTableGUI.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __getHTMLPath()

ilObjPaymentSettingsGUI::__getHTMLPath (   $a_ref_id)
private

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

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

Referenced by editDetailsObject().

1398  {
1399  global $tree;
1400 
1401  $path = $tree->getPathFull($a_ref_id);
1402 
1403  unset($path[0]);
1404  $html = '';
1405  if(is_array($path))
1406  {
1407  foreach($path as $data)
1408  {
1409  $html .= $data['title'].' > ';
1410  }
1411  }
1412  return substr($html,0,-2);
1413  }
$path
Definition: index.php:22
+ Here is the caller graph for this function:

◆ __getStatus()

ilObjPaymentSettingsGUI::__getStatus ( )
private

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

Referenced by editDetailsObject().

1442  {
1443  $option = array();
1444  $option[$this->pobject->STATUS_NOT_BUYABLE] = $this->lng->txt('paya_not_buyable');
1445  $option[$this->pobject->STATUS_BUYABLE] = $this->lng->txt('paya_buyable');
1446  $option[$this->pobject->STATUS_EXPIRES] = $this->lng->txt('paya_expires');
1447 
1448  return $option;
1449  }
+ Here is the caller graph for this function:

◆ __getVendors()

ilObjPaymentSettingsGUI::__getVendors ( )
private

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

References $options, and ilObjectFactory\getInstanceByObjId().

Referenced by editDetailsObject().

1416  {
1417  $options = array();
1418  $vendors = array();
1419 
1420  $all_vendors = $this->vendors_obj->getVendors();
1421  if (is_array($all_vendors))
1422  {
1423  foreach ($all_vendors as $vendor)
1424  {
1425  $vendors[] = $vendor['vendor_id'];
1426  }
1427  }
1428 
1429  foreach($vendors as $vendor)
1430  {
1431  if(!$tmp_obj = ilObjectFactory::getInstanceByObjId($vendor, false))
1432  {
1433  continue;
1434  }
1435 
1436  $options[$vendor] = $tmp_obj->getFullname().' ['.$tmp_obj->getLogin().']';
1437  }
1438  return $options;
1439  }
if(!is_array($argv)) $options
getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __initBookingObject()

ilObjPaymentSettingsGUI::__initBookingObject ( )
private

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

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

3981  {
3982  include_once './Services/Payment/classes/class.ilPaymentBookings.php';
3983 
3984  $this->booking_obj = new ilPaymentBookings($this->user_obj->getId(),true);
3985  }
+ Here is the caller graph for this function:

◆ __initPaymentObject()

ilObjPaymentSettingsGUI::__initPaymentObject (   $a_pobject_id = 0)
private

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

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

1655  {
1656  $this->pobject = new ilPaymentObject($this->user_obj,$a_pobject_id);
1657  return true;
1658  }
+ Here is the caller graph for this function:

◆ __search()

ilObjPaymentSettingsGUI::__search (   $a_search_string)
private

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

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

Referenced by performSearchSPObject(), and searchObject().

4037  {
4038  include_once('./Services/Search/classes/class.ilSearch.php');
4039 
4040  $this->lng->loadLanguageModule('content');
4041 
4042  $search = new ilSearch($_SESSION['AccountId']);
4043  $search->setPerformUpdate(false);
4044  $search->setSearchString(ilUtil::stripSlashes($a_search_string));
4045  $search->setCombination('and');
4046  $search->setSearchFor(array(0 => 'usr'));
4047  $search->setSearchType('new');
4048 
4049  if($search->validate($message))
4050  {
4051  $search->performSearch();
4052  }
4053  else
4054  {
4055  ilUtil::sendInfo($message,true);
4056  $this->ctrl->redirect($this,'searchUser');
4057  }
4058  return $search->getResultByType('usr');
4059  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
+ 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 4061 of file class.ilObjPaymentSettingsGUI.php.

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

4062  {
4063  include_once('./Services/Search/classes/class.ilSearch.php');
4064 
4065  $this->lng->loadLanguageModule('content');
4066 
4067  $search = new ilSearch($this->user_obj->getId());
4068  $search->setPerformUpdate(false);
4069  $search->setSearchString(ilUtil::stripSlashes($a_search_string));
4070  $search->setCombination('and');
4071  $search->setSearchFor(array(0 => 'usr'));
4072  $search->setSearchType('new');
4073 
4074  if($search->validate($message))
4075  {
4076  $search->performSearchSPObject();
4077  }
4078  else
4079  {
4080  ilUtil::sendInfo($message,true);
4081  $this->ctrl->redirect($this,'searchUserSP');
4082  }
4083  return $search->getResultByType('usr');
4084  }
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
setPerformUpdate($a_value)
+ Here is the call graph for this function:

◆ __showObjectsTable()

ilObjPaymentSettingsGUI::__showObjectsTable (   $a_result_set)
private

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

Referenced by objectsObject().

1630  {
1631  $this->ctrl->setParameter($this, 'cmd', 'objects');
1632 
1633  $tbl = new ilShopTableGUI($this);
1634  $tbl->setTitle($this->lng->txt('objects'));
1635 
1636  $tbl->setId('tbl_show_objects');
1637  $tbl->setRowTemplate("tpl.shop_objects_row.html", "Services/Payment");
1638 
1639  $tbl->addColumn($this->lng->txt('title'), 'title', '10%');
1640  $tbl->addColumn($this->lng->txt('status'), 'status', '10%');
1641  $tbl->addColumn($this->lng->txt('paya_pay_method'),'pay_method','10%');
1642  $tbl->addColumn($this->lng->txt('vat_rate'), 'vat_rate', '15%');
1643  $tbl->addColumn($this->lng->txt('paya_vendor'), 'vendor', '10%');
1644  $tbl->addColumn($this->lng->txt('paya_count_purchaser'), 'purchasers', '10%');
1645  $tbl->addColumn('','options','10%');
1646 
1647  $tbl->setData($a_result_set);
1648 
1649  $this->tpl->setVariable('TABLE', $tbl->getHTML());
1650 
1651  return true;
1652  }
Class ilShopTableGUI.
+ Here is the caller graph for this function:

◆ __showSearchUserSPTable()

ilObjPaymentSettingsGUI::__showSearchUserSPTable (   $a_result_set)
private

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

References $_GET.

Referenced by performSearchSPObject().

4086  {
4087  $this->ctrl->setParameter($this, 'sell_id', $_GET['sell_id']);
4088  $tbl = new ilShopTableGUI($this);
4089 
4090  $tbl->setTitle($this->lng->txt('users'));
4091  $tbl->setId('tbl_search_user_vendor');
4092  $tbl->setRowTemplate("tpl.shop_users_row.html", "Services/Payment");
4093 
4094  $tbl->addColumn(' ', 'user_id', '3%', true);
4095  $tbl->addColumn($this->lng->txt('login'), 'login', '32%');
4096  $tbl->addColumn($this->lng->txt('firstname'),'firstname','32%');
4097  $tbl->addColumn($this->lng->txt('lastname'), 'lastname', '32%');
4098 
4099 
4100  $tbl->addMultiCommand("addCustomer", $this->lng->txt("add"));
4101  $tbl->addCommandButton('statistic',$this->lng->txt('cancel'));
4102 
4103  $tbl->fillFooter();
4104  $tbl->setData($a_result_set);
4105  $this->tpl->setVariable('TABLE', $tbl->getHTML());
4106  return true;
4107  }
$_GET["client_id"]
Class ilShopTableGUI.
+ Here is the caller graph for this function:

◆ __showSearchUserTable()

ilObjPaymentSettingsGUI::__showSearchUserTable (   $a_result_set)
private

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

Referenced by searchObject().

4013  {
4014  $tbl = new ilShopTableGUI($this);
4015 
4016  $tbl->setTitle($this->lng->txt("pays_header_select_vendor"));
4017  $tbl->setId('tbl_search_user_vendor');
4018  $tbl->setRowTemplate("tpl.shop_users_row.html", "Services/Payment");
4019 
4020  $tbl->addColumn(' ', 'vendor_id', '3%', true);
4021  $tbl->addColumn($this->lng->txt('login'), 'login', '32%');
4022  $tbl->addColumn($this->lng->txt('firstname'),'firstname','32%');
4023  $tbl->addColumn($this->lng->txt('lastname'), 'lastname', '32%');
4024 
4025  $tbl->setSelectAllCheckbox('vendor_id');
4026  $tbl->addMultiCommand("addUser", $this->lng->txt("add"));
4027  $tbl->addCommandButton('vendors',$this->lng->txt('cancel'));
4028 
4029  $tbl->fillFooter();
4030  $tbl->setData($a_result_set);
4031  $this->tpl->setVariable('TABLE', $tbl->getHTML());
4032 
4033  return true;
4034  }
Class ilShopTableGUI.
+ Here is the caller graph for this function:

◆ __showStatisticTable()

ilObjPaymentSettingsGUI::__showStatisticTable (   $a_result_set)
private

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

Referenced by statisticObject().

3953  {
3954  $this->ctrl->setParameter($this, 'cmd', 'statistic');
3955 
3956  $tbl = new ilShopTableGUI($this);
3957  $tbl->setTitle($this->lng->txt("bookings"));
3958  $tbl->setId('tbl_show_statistics');
3959  $tbl->setRowTemplate("tpl.shop_statistics_row.html", "Services/Payment");
3960 
3961  $tbl->addColumn($this->lng->txt('paya_transaction'), 'transaction', '10%');
3962  $tbl->addColumn($this->lng->txt('title'), 'object_title', '10%');
3963  $tbl->addColumn($this->lng->txt('paya_vendor'), 'vendor', '10%');
3964  $tbl->addColumn($this->lng->txt('paya_customer'), 'customer', '10%');
3965  $tbl->addColumn($this->lng->txt('paya_order_date'), 'order_date', '10%');
3966  $tbl->addColumn($this->lng->txt('duration'), 'duration', '20%');
3967  $tbl->addColumn($this->lng->txt('price_a'), 'price', '5%');
3968  $tbl->addColumn($this->lng->txt('paya_coupons_coupon'), 'discount', '5%');
3969  $tbl->addColumn($this->lng->txt('paya_payed_access'), 'payed_access', '1%');
3970  $tbl->addColumn('','edit', '5%');
3971 
3972  $tbl->addCommandButton('exportVendors',$this->lng->txt('excel_export'));
3973  $tbl->setData($a_result_set);
3974 
3975  $this->tpl->setVariable('TABLE', $tbl->getHTML());
3976 
3977  return true;
3978  }
Class ilShopTableGUI.
+ Here is the caller graph for this function:

◆ __showVendorsTable()

ilObjPaymentSettingsGUI::__showVendorsTable (   $a_result_set)
private

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

Referenced by vendorsObject().

3988  {
3989  $this->ctrl->setParameter($this, 'cmd', 'vendors');
3990 
3991  $tbl = new ilShopTableGUI($this);
3992  $tbl->setTitle($this->lng->txt("vendors"));
3993  $tbl->setId('tbl_show_vendors');
3994  $tbl->setRowTemplate("tpl.shop_users_row.html", "Services/Payment");
3995 
3996  $tbl->addColumn('', 'vendor_id', '1%');
3997  $tbl->addColumn($this->lng->txt('paya_vendor'), 'login', '10%');
3998  $tbl->addColumn($this->lng->txt('pays_cost_center'), 'cost_center', '10%');
3999  $tbl->addColumn($this->lng->txt('pays_number_bookings'), 'number_bookings', '10%');
4000 
4001  $tbl->addMultiCommand("editVendor", $this->lng->txt('pays_edit_vendor'));
4002  $tbl->addMultiCommand("deleteVendors", $this->lng->txt('pays_delete_vendor'));
4003 
4004  $tbl->addCommandButton('exportVendors',$this->lng->txt('excel_export'));
4005 
4006  $tbl->setData($a_result_set);
4007  $this->tpl->setVariable('TABLE', $tbl->getHTML());
4008 
4009  return true;
4010  }
Class ilShopTableGUI.
+ Here is the caller graph for this function:

◆ addCurrencyObject()

ilObjPaymentSettingsGUI::addCurrencyObject ( )

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

References $_POST, $form, and ilTextInputGUI\setValue().

4468  {
4469  $this->tpl->addBlockfile('ADM_CONTENT','adm_content','tpl.main_view.html','Services/Payment');
4470  $form = new ilPropertyFormGUI();
4471  $form->setFormAction($this->ctrl->getFormAction($this));
4472  $form->setTitle($this->lng->txt('paya_add_currency'));
4473 
4474  $o_Unit = new ilTextInputGUI($this->lng->txt('paya_currency_unit'),'currency_unit');
4475  $o_Unit->setValue($_POST['currency_unit']);
4476  $o_Unit->setPostVar('currency_unit');
4477  $o_Unit->setRequired(true);
4478 
4479  $o_Isocode = new ilTextInputGUI($this->lng->txt('iso_code'),'iso_code');
4480  $o_Isocode->setValue($_POST['iso_code']);
4481  $o_Isocode->setPostVar('iso_code');
4482  $o_Isocode->setRequired(true);
4483 
4484  $o_Symbol = new ilTextInputGUI($this->lng->txt('symbol'), 'symbol');
4485  $o_Symbol->setValue($_POST['symbol']);
4486  $o_Symbol->setPostVar('symbol');
4487  $o_Symbol->setRequired(true);
4488 
4489  $o_Conversionrate = new IlTextInputGUI($this->lng->txt('conversion_rate'), 'conversion_rate');
4490  $o_Conversionrate->setValue($_POST['conversion_rate']);
4491  $o_Conversionrate->setPostVar('conversion_rate');
4492  $o_Conversionrate->setRequired(true);
4493 
4494  $form->addItem($o_Unit);
4495  $form->addItem($o_Isocode);
4496  $form->addItem($o_Symbol);
4497  $form->addItem($o_Conversionrate);
4498 
4499  $form->addCommandButton('saveCurrency', $this->lng->txt('save'));
4500  $form->addCommandButton('currencies', $this->lng->txt('cancel'));
4501 
4502  $this->tpl->setVariable('FORM', $form->getHTML());
4503  }
$_POST['username']
Definition: cron.php:12
This class represents a property form user interface.
This class represents a text property in a property form.
setValue($a_value)
Set Value.
+ Here is the call graph for this function:

◆ addCustomerObject()

ilObjPaymentSettingsGUI::addCustomerObject ( )

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

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

Referenced by saveCustomerObject().

3669  {
3670  global $ilToolbar;
3671 
3672  if ($_POST['sell_id'] != '') $_GET['sell_id'] = $_POST['sell_id'];
3673  if ($_GET['user_id'] != '') $_POST['user_id'] = $_GET['user_id'];
3674 
3675  if(!isset($_GET['sell_id']))
3676  {
3677  ilUtil::sendInfo($this->lng->txt('paya_no_booking_id_given'));
3678  $this->showObjectSelectorObject();
3679 
3680  return true;
3681  }
3682 
3683  if(!isset($_POST['user_id']))
3684  {
3685  ilUtil::sendInfo($this->lng->txt('paya_no_user_id_given'));
3686  $this->searchUserSPObject();
3687 
3688  return true;
3689  }
3690  $this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.main_view.html','Services/Payment');
3691  $this->ctrl->setParameter($this, 'sell_id', $_GET['sell_id']);
3692 
3693  $ilToolbar->addButton($this->lng->txt('back'), $this->ctrl->getLinkTarget($this, 'searchUserSP'));
3694 
3695  $this->ctrl->setParameter($this, 'user_id', $_POST['user_id']);
3696 
3697  $pObjectId = ilPaymentObject::_lookupPobjectId($_GET['sell_id']);
3698  $obj = new ilPaymentObject($this->user_obj, $pObjectId);
3699 
3700  // get obj
3701  $tmp_obj = ilObjectFactory::getInstanceByRefId($_GET['sell_id'], false);
3702  if($tmp_obj)
3703  {
3704  $tmp_object['title'] = $tmp_obj->getTitle();
3705  }
3706  else
3707  {
3708  $tmp_object['title'] = $this->lng->txt('object_not_found');
3709  }
3710  // get customer_obj
3711  $tmp_user = ilObjectFactory::getInstanceByObjId($_POST['user_id']);
3712  // get vendor_obj
3713  $tmp_vendor = ilObjectFactory::getInstanceByObjId($obj->getVendorId());
3714 
3715  $oForm = new ilPropertyFormGUI();
3716  $oForm->setFormAction($this->ctrl->getFormAction($this, 'saveCustomer'));
3717  $oForm->setTitle($this->lng->txt($tmp_user->getFullname().' ['.$tmp_user->getLogin().']'));
3718 
3719  //transaction
3720  $oTransaction = new ilTextInputGUI();
3721  $oTransaction->setTitle($this->lng->txt('paya_transaction'));
3722  //$oTransaction->setValue(ilUtil::prepareFormOutut($_POST['transaction'], true));
3723  $oTransaction->setValue($_POST['transaction']);
3724  $oTransaction->setPostVar('transaction');
3725  $oForm->addItem($oTransaction);
3726 
3727  //object
3728  $oObject = new ilNonEditableValueGUI($this->lng->txt('title'));
3729  $oObject->setValue($tmp_obj->getTitle());
3730  $oForm->addItem($oObject);
3731 
3732  //vendor
3733  $oVendor = new ilNonEditableValueGUI($this->lng->txt('paya_vendor'));
3734  $oVendor->setValue($tmp_vendor->getFullname().' ['.$tmp_vendor->getLogin().']');
3735  $oForm->addItem($oVendor);
3736 
3737  // pay methods
3738  $oPayMethods = new ilSelectInputGUI($this->lng->txt('paya_pay_method'), 'pay_method');
3739  $payOptions = ilPaymethods::getPayMethodsOptions(false);
3740  $oPayMethods->setOptions($payOptions);
3741  $oPayMethods->setValue($_POST['pay_method']);
3742  $oPayMethods->setPostVar('pay_method');
3743  $oForm->addItem($oPayMethods);
3744 
3745  //duration
3746  $duration_options = array();
3747  $price_obj = new ilPaymentPrices($pObjectId);
3748 
3749  $standard_prices = array();
3750  $extension_prices = array();
3751  $standard_prices = $price_obj->getPrices();
3752  $extension_prices = $price_obj->getExtensionPrices();
3753 
3754  $prices = array_merge($standard_prices, $extension_prices );
3755 
3756  if (is_array($prices))
3757  {
3758  $genSet = ilPaymentSettings::_getInstance();
3759  $currency_unit = $genSet->get('currency_unit');
3760 
3761  foreach($prices as $price)
3762  {
3763  switch($price['price_type'])
3764  {
3766  $txt_duration =
3767  $price['duration'].' '.$this->lng->txt('paya_months').' -> '.$price['price'].' '. $currency_unit;
3768  break;
3769 
3771  include_once './Services/Calendar/classes/class.ilDatePresentation.php';
3772  $txt_duration = ilDatePresentation::formatDate(new ilDate($price['duration_from'], IL_CAL_DATE))
3773  .' - '.ilDatePresentation::formatDate(new ilDate($price['duration_until'], IL_CAL_DATE))
3774  ." -> ".ilPaymentPrices::_getPriceString($price["price_id"]) .' '.$currency_unit;
3775  break;
3776 
3778  $txt_duration = $this->lng->txt('unlimited_duration').' -> '.$price['price'].' '. $currency_unit;
3779  break;
3780  }
3781  $txt_extension = '';
3782  if($price['extension'] == 1)
3783  {
3784  $txt_extension = ' ('.$this->lng->txt('extension_price').') ';
3785  }
3786  $duration_options[$price['price_id']] .= $txt_duration.''.$txt_extension;
3787  }
3788  }
3789 
3790  $oDuration = new ilSelectInputGUI($this->lng->txt('duration'), 'price_id');
3791  $oDuration->setOptions($duration_options);
3792  $oDuration->setValue($_POST['price_id']);
3793  $oForm->addItem($oDuration);
3794 
3795  //payed
3796  $o_payed = new ilSelectInputGUI();
3797  $payed_option = array('1'=>$this->lng->txt('yes'),'0'=>$this->lng->txt('no'));
3798 
3799  $o_payed->setTitle($this->lng->txt('paya_payed'));
3800  $o_payed->setOptions($payed_option);
3801  $o_payed->setValue($_POST['payed']);
3802  $o_payed->setPostVar('payed');
3803  $oForm->addItem($o_payed);
3804 
3805 
3806  $o_access = new ilSelectInputGUI();
3807  $access_option = array('1'=>$this->lng->txt('yes'),'0'=>$this->lng->txt('no'));
3808 
3809  $o_access->setTitle($this->lng->txt('paya_access'));
3810  $o_access->setOptions($access_option);
3811  $o_access->setValue($_POST['access']);
3812  $o_access->setPostVar('access');
3813 
3814  $oForm->addItem($o_access);
3815 
3816  $oForm->addCommandButton('saveCustomer',$this->lng->txt('save'));
3817  $oForm->addCommandButton('bookings', $this->lng->txt('cancel'));
3818 
3819  $this->tpl->setVariable('FORM',$oForm->getHTML());
3820  return true;
3821  }
$_POST['username']
Definition: cron.php:12
getInstanceByRefId($a_ref_id, $stop_on_error=true)
get an instance of an Ilias object by reference id
This class represents a selection list property in a property form.
This class represents a property form user interface.
static _lookupPobjectId($a_ref_id)
$_GET["client_id"]
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static _getPriceString($a_price_id)
Class for single dates.
This class represents a text property in a property form.
static formatDate(ilDateTime $date)
Format a date public.
getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
setOptions($a_options)
Set Options.
const IL_CAL_DATE
This class represents a non editable value in a property form.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addStatisticWorksheet()

ilObjPaymentSettingsGUI::addStatisticWorksheet ( $pewa)

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

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

Referenced by exportVendorsObject().

2870  {
2871  include_once './Services/Excel/classes/class.ilExcelUtils.php';
2872  include_once './Services/Payment/classes/class.ilPaymentVendors.php';
2873 
2874  $this->__initBookingObject();
2875 
2876  $workbook = $pewa->getWorkbook();
2877  $worksheet = $workbook->addWorksheet(utf8_decode($this->lng->txt('bookings')));
2878 
2879  $worksheet->mergeCells(0,0,0,3);
2880  $worksheet->setColumn(0,0,16);
2881  $worksheet->setColumn(0,1,32);
2882  $worksheet->setColumn(0,2,32);
2883  $worksheet->setColumn(0,3,16);
2884  $worksheet->setColumn(0,4,16);
2885  $worksheet->setColumn(0,5,16);
2886  $worksheet->setColumn(0,6,24);
2887  $worksheet->setColumn(0,7,8);
2888  $worksheet->setColumn(0,8,12);
2889  $worksheet->setColumn(0,9,16);
2890 
2891  $title = $this->lng->txt('bookings');
2892  $title .= ' '.$this->lng->txt('as_of').' ';
2893  $title .= strftime('%Y-%m-%d %R',time());
2894 
2895  $worksheet->writeString(0,0,$title,$pewa->getFormatTitle());
2896 
2897  $worksheet->writeString(1,0,$this->lng->txt('payment_system'),$pewa->getFormatHeader());
2898  $worksheet->writeString(1,1,$this->lng->txt('paya_transaction'),$pewa->getFormatHeader());
2899  $worksheet->writeString(1,2,$this->lng->txt('title'),$pewa->getFormatHeader());
2900  $worksheet->writeString(1,3,$this->lng->txt('paya_vendor'),$pewa->getFormatHeader());
2901  $worksheet->writeString(1,4,$this->lng->txt('pays_cost_center'),$pewa->getFormatHeader());
2902  $worksheet->writeString(1,5,$this->lng->txt('paya_customer'),$pewa->getFormatHeader());
2903  $worksheet->writeString(1,6,$this->lng->txt('email'),$pewa->getFormatHeader());
2904  $worksheet->writeString(1,7,$this->lng->txt('paya_order_date'),$pewa->getFormatHeader());
2905  $worksheet->writeString(1,8,$this->lng->txt('duration'),$pewa->getFormatHeader());
2906  $worksheet->writeString(1,9,$this->lng->txt('price_a'),$pewa->getFormatHeader());
2907  $worksheet->writeString(1,10,$this->lng->txt('paya_payed_access'),$pewa->getFormatHeader());
2908 
2909  $worksheet->writeString(1,11,$this->lng->txt('street'),$pewa->getFormatHeader());
2910  $worksheet->writeString(1,12,$this->lng->txt('pay_bmf_po_box'),$pewa->getFormatHeader());
2911  $worksheet->writeString(1,13,$this->lng->txt('zipcode'),$pewa->getFormatHeader());
2912  $worksheet->writeString(1,14,$this->lng->txt('city'),$pewa->getFormatHeader());
2913  $worksheet->writeString(1,15,$this->lng->txt('country'),$pewa->getFormatHeader());
2914 
2915  if(!count($bookings = $this->booking_obj->getBookings()))
2916  {
2917  return false;
2918  }
2919 
2920  include_once 'Services/User/classes/class.ilObjUser.php';
2921  $object_title_cache = array();
2922  $user_title_cache = array();
2923 
2924  $counter = 2;
2925  foreach($bookings as $booking)
2926  {
2927  if(array_key_exists($booking['ref_id'], $object_title_cache))
2928  {
2929  $tmp_obj = $object_title_cache[$booking['ref_id']];
2930  }
2931  else
2932  {
2933  $tmp_obj = ilObject::_lookupTitle(ilObject::_lookupObjId($booking['ref_id']));
2934  $object_title_cache[$booking['ref_id']] = $tmp_obj;
2935  }
2936  if(array_key_exists($booking['b_vendor_id'], $user_title_cache))
2937  {
2938  $tmp_vendor = $user_title_cache[$booking['b_vendor_id']];
2939  }
2940  else
2941  {
2942  $tmp_vendor = ilObjUser::_lookupLogin($booking['b_vendor_id']);
2943  $user_title_cache[$booking['b_vendor_id']] = $tmp_vendor;
2944  }
2945  if(array_key_exists($booking['customer_id'], $user_title_cache))
2946  {
2947  $tmp_purchaser = $user_title_cache[$booking['customer_id']];
2948  }
2949  else
2950  {
2951  $tmp_purchaser_name = ilObjUser::_lookupName($booking['customer_id']);
2952  $tmp_purchaser_login = ilObjUser::_lookupLogin($booking['customer_id']);
2953  $tmp_purchaser_email = ilObjUser::_lookupEmail($booking['customer_id']);
2954  $tmp_purchaser = ''.$tmp_purchaser_name['firstname'].' '.$tmp_purchaser_name['lastname'].' ['.$tmp_purchaser_login.']';
2955  $user_title_cache[$booking['customer_id']] = $tmp_purchaser;
2956  }
2957 
2958  include_once './Services/Payment/classes/class.ilPayMethods.php';
2959  $str_paymethod = ilPayMethods::getStringByPaymethod($booking['b_pay_method']);
2960 
2961  $worksheet->writeString($counter,0,$str_paymethod);
2962  $worksheet->writeString($counter,1,$booking['transaction']);
2963  $worksheet->writeString($counter,2,($tmp_obj != '' ? $tmp_obj : $this->lng->txt('object_deleted')));
2964  $worksheet->writeString($counter,3,($tmp_vendor != '' ? $tmp_vendor : $this->lng->txt('user_deleted')));
2965  $worksheet->writeString($counter,4,ilPaymentVendors::_getCostCenter($booking['b_vendor_id']));
2966  $worksheet->writeString($counter,5,($tmp_purchaser != '' ? $tmp_purchaser : $this->lng->txt('user_deleted')));
2967  $worksheet->writeString($counter,6,$tmp_purchaser_email);
2968  $worksheet->writeString($counter,7,strftime('%Y-%m-%d %R',$booking['order_date']));
2969  $worksheet->writeString($counter,8,$booking['duration']);
2970  $worksheet->writeString($counter,9,$booking['price']);
2971 
2972  $payed_access = $booking['payed'] ?
2973  $this->lng->txt('yes') :
2974  $this->lng->txt('no');
2975 
2976  $payed_access .= '/';
2977  $payed_access .= $booking['access_granted'] ?
2978  $this->lng->txt('yes') :
2979  $this->lng->txt('no');
2980 
2981  $worksheet->writeString($counter,10,$payed_access);
2982 
2983  $worksheet->writeString($counter,11,$booking['street']);
2984  $worksheet->writeString($counter,12,$booking['po_box']);
2985  $worksheet->writeString($counter,13,$booking['zipcode']);
2986  $worksheet->writeString($counter,14,$booking['city']);
2987  $worksheet->writeString($counter,15,$booking['country']);
2988 
2989  unset($tmp_obj);
2990  unset($tmp_vendor);
2991  unset($tmp_purchaser);
2992 
2993  ++$counter;
2994  }
2995  return true;
2996  }
static _lookupName($a_user_id)
lookup user name
static getStringByPaymethod($a_type)
static _lookupTitle($a_id)
lookup object title
static _lookupObjId($a_id)
_lookupLogin($a_user_id)
lookup login
_lookupEmail($a_user_id)
Lookup email.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addUserObject()

ilObjPaymentSettingsGUI::addUserObject ( )

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

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

3531  {
3532  global $rbacsystem;
3533 
3534  // MINIMUM ACCESS LEVEL = 'administrate'
3535  if(!$rbacsystem->checkAccess('write', $this->object->getRefId()))
3536  {
3537  $this->ilErr->raiseError($this->lng->txt('msg_no_perm_write'),$this->ilErr->MESSAGE);
3538  }
3539 
3540  $this->lng->loadLanguageModule('crs');
3541  if(!is_array($_POST['user']))
3542  {
3543  ilUtil::sendFailure($this->lng->txt('crs_no_users_selected'));
3544  $this->searchObject();
3545 
3546  return false;
3547  }
3548 
3549  $already_assigned = $assigned = 0;
3550  foreach($_POST['user'] as $usr_id)
3551  {
3552  if($this->vendors_obj->isAssigned($usr_id))
3553  {
3554  ++$already_assigned;
3555  continue;
3556  }
3557  $this->vendors_obj->add($usr_id);
3558  ++$assigned;
3559 
3560  // TODO: SEND NOTIFICATION
3561  }
3562  $message = '';
3563  if($assigned)
3564  {
3565  $message .= $this->lng->txt('pays_assigned_vendors').' '.$assigned;
3566  }
3567  if($already_assigned)
3568  {
3569  $message .= '<br />'.$this->lng->txt('pays_already_assigned_vendors').' '.$already_assigned;
3570  }
3571 
3572  ilUtil::sendInfo($message);
3573  $this->vendorsObject();
3574 
3575  return true;
3576  }
$_POST['username']
Definition: cron.php:12
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
+ Here is the call graph for this function:

◆ addVendorObject()

ilObjPaymentSettingsGUI::addVendorObject ( )

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

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

3492  {
3493  global $rbacsystem;
3494 
3495  // MINIMUM ACCESS LEVEL = 'administrate'
3496  if(!$rbacsystem->checkAccess('write', $this->object->getRefId()))
3497  {
3498  $this->ilErr->raiseError($this->lng->txt('msg_no_perm_write'),$this->ilErr->MESSAGE);
3499  }
3500  if(!$_POST['user_login'])
3501  {
3502  ilUtil::sendFailure($this->lng->txt('pays_no_username_given'));
3503  $this->vendorsObject();
3504 
3505  return true;
3506  }
3508  {
3509  ilUtil::sendFailure($this->lng->txt('pays_no_valid_username_given'));
3510  $this->vendorsObject();
3511 
3512  return true;
3513  }
3514 
3515  if($this->vendors_obj->isAssigned($usr_id))
3516  {
3517  ilUtil::sendFailure($this->lng->txt('pays_user_already_assigned'));
3518  $this->vendorsObject();
3519 
3520  return true;
3521  }
3522  $this->vendors_obj->add($usr_id);
3523 
3524  ilUtil::sendSuccess($this->lng->txt('pays_added_vendor'));
3525  $this->vendorsObject();
3526 
3527  return true;
3528  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$_POST['username']
Definition: cron.php:12
getUserIdByLogin($a_login)
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
+ Here is the call graph for this function:

◆ addVendorWorksheet()

ilObjPaymentSettingsGUI::addVendorWorksheet (   $pewa)

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

References ilObjectFactory\getInstanceByObjId().

Referenced by exportVendorsObject().

2999  {
3000  include_once './Services/Excel/classes/class.ilExcelUtils.php';
3001 
3002  $workbook = $pewa->getWorkbook();
3003  $worksheet = $workbook->addWorksheet($this->lng->txt('pays_vendor'));
3004 
3005  // SHOW HEADER
3006  $worksheet->mergeCells(0,0,0,2);
3007  $worksheet->setColumn(1,0,32);
3008  $worksheet->setColumn(1,1,32);
3009  $worksheet->setColumn(1,2,32);
3010 
3011  $title = $this->lng->txt('pays_vendor');
3012  $title .= ' '.$this->lng->txt('as_of').' ';
3013  $title .= strftime('%Y-%m-%d %R',time());
3014 
3015  $worksheet->writeString(0,0,$title,$pewa->getFormatTitle());
3016 
3017  $worksheet->writeString(1,0,$this->lng->txt('login'),$pewa->getFormatHeader());
3018  $worksheet->writeString(1,1,$this->lng->txt('fullname'),$pewa->getFormatHeader());
3019  $worksheet->writeString(1,2,$this->lng->txt('pays_cost_center'),$pewa->getFormatHeader());
3020 
3021  if(!count($vendors = $this->vendors_obj->getVendors()))
3022  {
3023  return false;
3024  }
3025 
3026  $counter = 2;
3027  foreach($vendors as $vendor)
3028  {
3029  // GET USER OBJ
3030  if($tmp_obj = ilObjectFactory::getInstanceByObjId($vendor['vendor_id'],false))
3031  {
3032  $worksheet->writeString($counter,0,$tmp_obj->getLogin());
3033  $worksheet->writeString($counter,1,$tmp_obj->getFullname());
3034  $worksheet->writeString($counter,2,$vendor['cost_center']);
3035  }
3036  unset($tmp_obj);
3037  ++$counter;
3038  }
3039  return true;
3040  }
getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ BillingMailObject()

ilObjPaymentSettingsGUI::BillingMailObject ( )

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

References ilPaymentSettings\getMailBillingText(), ilPaymentSettings\getMailUsePlaceholders(), ilCheckboxInputGUI\setOptionTitle(), and ilTextAreaInputGUI\setValue().

Referenced by saveBillingMailObject().

4623  {
4624  include_once('./Services/Form/classes/class.ilPropertyFormGUI.php');
4625 
4626  $this->tpl->addBlockfile('ADM_CONTENT','adm_content','tpl.main_view.html','Services/Payment');
4627  $this->tpl->addJavaScript('Services/Mail/js/ilMailComposeFunctions.js');
4628 
4629  $form_gui = new ilPropertyFormGUI();
4630  $form_gui->setFormAction($this->ctrl->getFormAction($this, 'savebillingmail'));
4631  $form_gui->setTitle($this->lng->txt('billing_mail'));
4632 
4633 
4634  // MESSAGE
4635  $inp = new ilTextAreaInputGUI($this->lng->txt('message_content'), 'm_message');
4636 
4638  $inp->setRequired(false);
4639  $inp->setCols(60);
4640  $inp->setRows(10);
4641 
4642  // PLACEHOLDERS
4643  $chb = new ilCheckboxInputGUI($this->lng->txt('activate_placeholders'), 'use_placeholders');
4644  $chb->setOptionTitle($this->lng->txt('activate_placeholders'));
4645  $chb->setValue(1);
4646  $chb->setChecked(ilPaymentSettings::getMailUsePlaceholders());
4647  $form_gui->addItem($inp);
4648 
4649  include_once 'Services/Payment/classes/class.ilBillingMailPlaceholdersPropertyGUI.php';
4651 
4652  $chb->addSubItem($prop);
4653  $chb->setChecked(true);
4654 
4655  $form_gui->addItem($chb);
4656 
4657  $form_gui->addCommandButton('saveBillingMail', $this->lng->txt('save'));
4658  $this->tpl->setVariable('FORM', $form_gui->getHTML());
4659 
4660  return true;
4661  }
This class represents a property form user interface.
setValue($a_value)
Set Value.
This class represents a checkbox property in a property form.
This class represents a text area property in a property form.
setOptionTitle($a_optiontitle)
Set Option Title (optional).
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cancelDeleteVendorsObject()

ilObjPaymentSettingsGUI::cancelDeleteVendorsObject ( )

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

References $_SESSION, and vendorsObject().

3205  {
3206  unset($_SESSION['pays_vendor']);
3207  $_SESSION['disable_shop'] = false;
3208  $this->vendorsObject();
3209 
3210  return true;
3211  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
+ Here is the call graph for this function:

◆ checkShopActivationObject()

ilObjPaymentSettingsGUI::checkShopActivationObject ( )

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

References $_GET, $_POST, $cmd, $form, $ilCtrl, ilObjectGUI\$lng, $ret, __initPaymentObject(), ilPageObject\_exists(), ilShopVats\_readAllVats(), ilObjectGUI\executeCommand(), forwardToDocumentsPageObject(), ilObjStyleSheet\getContentStylePath(), ilBMFSettings\getInstance(), getSubTabs(), getTabs(), objectsObject(), payMethodsObject(), ilObjectGUI\prepareOutput(), ilUtil\sendFailure(), ilUtil\sendInfo(), ilUtil\sendSuccess(), ilTextInputGUI\setValue(), ilUtil\stripSlashes(), vatsObject(), and vendorsObject().

Referenced by getSubTabs().

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

◆ confirmDeleteVatObject()

ilObjPaymentSettingsGUI::confirmDeleteVatObject ( )

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

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

4179  {
4180  if((int)$_GET['vat_id'] && !isset($_POST['vat_id']))
4181  {
4182  $_POST['vat_id'][] = $_GET['vat_id'];
4183  }
4184 
4185  if($_SESSION['count_vats'] == count($_POST['vat_id']))
4186  {
4187  ilUtil::sendInfo($this->lng->txt('shop_disabled_no_vats'));
4188  $_SESSION['disable_shop'] = true;
4189  }
4190 
4191  $c_gui = new ilConfirmationGUI();
4192  $c_gui->setFormAction($this->ctrl->getFormAction($this, 'performDeleteVat'));
4193  $c_gui->setHeaderText($this->lng->txt('paya_sure_delete_vats'));
4194  $c_gui->setCancel($this->lng->txt('cancel'), 'vats');
4195  $c_gui->setConfirm($this->lng->txt('confirm'), 'performDeleteVat');
4196 
4197  $counter = 0;
4198  foreach((array)$_POST['vat_id'] as $vat_id)
4199  {
4200  try
4201  {
4202  $oVAT = new ilShopVats((int)$vat_id);
4203  $c_gui->addItem('vat_id[]', $oVAT->getId(), $oVAT->getTitle());
4204  ++$counter;
4205  }
4206  catch(ilShopException $e)
4207  {
4208  ilUtil::sendInfo($e->getMessage());
4209  return $this->vatsObject();
4210  }
4211  }
4212 
4213  if($counter)
4214  {
4215  $this->tpl->setContent($c_gui->getHTML());
4216  return true;
4217  }
4218  else
4219  {
4220  $this->vatsObject();
4221  return true;
4222  }
4223  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
Class ilShopVats.
$_POST['username']
Definition: cron.php:12
$_GET["client_id"]
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
Class for shop related exception handling in ILIAS.
Confirmation screen class.
+ Here is the call graph for this function:

◆ createVatObject()

ilObjPaymentSettingsGUI::createVatObject ( )

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

References initVatForm().

4257  {
4258  $this->initVatForm('create');
4259  $this->tpl->setContent($this->form->getHtml());
4260  }
+ Here is the call graph for this function:

◆ currenciesObject()

ilObjPaymentSettingsGUI::currenciesObject ( )

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

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

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

4413  {
4414  $this->tpl->addBlockfile('ADM_CONTENT','adm_content','tpl.main_view.html','Services/Payment');
4416  // currency table
4417  $counter = 0;
4418  foreach($currency_res as $cur)
4419  {
4420  $f_result[$counter]['currency_id'] = ilUtil::formRadioButton(0,'currency_id',$cur['currency_id']);
4421  $f_result[$counter]['is_default'] = $cur['is_default'] == 1 ? $this->lng->txt('yes') : $this->lng->txt('no');
4422 
4423  $f_result[$counter]['currency_unit'] = $cur['unit'];
4424  $f_result[$counter]['iso_code'] = $cur['iso_code'];
4425  $f_result[$counter]['currency_symbol'] = $cur['symbol'];
4426  $f_result[$counter]['conversion_rate'] = $cur['conversion_rate'];
4427 
4428  $counter++;
4429  }
4430 
4431  $tbl = new ilShopTableGUI($this);
4432 
4433  $tbl->setTitle($this->lng->txt("currencies"));
4434  $tbl->setId('tbl_show_currencies');
4435  $tbl->setRowTemplate("tpl.shop_currencies_row.html", "Services/Payment");
4436 
4437  $tbl->addColumn(' ', 'currency_id', '1%', true);
4438  $tbl->addColumn($this->lng->txt('is_default'), 'is_default', '5%');
4439  $tbl->addColumn($this->lng->txt('currency_unit'), 'currency_unit', '10%');
4440  $tbl->addColumn($this->lng->txt('iso_code'),'iso_code','20%');
4441  $tbl->addColumn($this->lng->txt('currency_symbol'), 'currency_symbol', '20%');
4442  $tbl->addColumn($this->lng->txt('conversion_rate'), 'conversion_rate', '15%');
4443  $tbl->addColumn('', 'options', '5%');
4444 
4445  $this->ctrl->setParameter($this, 'cmd', 'currencies');
4446 
4447  $tbl->addMultiCommand('updateDefaultCurrency', $this->lng->txt('paya_set_default_currency'));
4448  $tbl->addMultiCommand("editCurrency",$this->lng->txt('edit'));
4449  $tbl->addMultiCommand("deleteCurrency", $this->lng->txt('delete'));
4450 
4451  $tbl->addCommandButton('addCurrency',$this->lng->txt('add_currency'));
4452  $tbl->setData($f_result);
4453  $this->tpl->setVariable('TABLE', $tbl->getHTML());
4454  return true;
4455  }
Class ilShopTableGUI.
static formRadioButton($checked, $varname, $value, $onclick=null, $disabled=false)
??? public
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ deleteAddressesForPaymethodsObject()

ilObjPaymentSettingsGUI::deleteAddressesForPaymethodsObject ( )

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

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

4397  {
4398  // delete addresses here
4399  include_once './Services/Payment/classes/class.ilPayMethods.php';
4400  $this->__initBookingObject();
4401 
4402  foreach($_POST['paymethod'] as $pay_method)
4403  {
4405  $del_bookings = $this->booking_obj->deleteAddressesByPaymethod((int)$pay_method);
4406  }
4407  ilUtil::sendSuccess($this->lng->txt('pays_updated_pay_method'));
4408  return $this->payMethodsObject();
4409  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
payMethodsObject($askForDeletingAddresses=array())
$_POST['username']
Definition: cron.php:12
$pay_method
static _disableSaveUserAddress($a_id)
+ Here is the call graph for this function:

◆ deleteCurrencyObject()

ilObjPaymentSettingsGUI::deleteCurrencyObject ( )

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

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

4563  {
4564 
4565  $this->tpl->addBlockfile('ADM_CONTENT','adm_content','tpl.main_view.html','Services/Payment');
4566  if(ilPaymentCurrency::_isDefault($_POST['currency_id'])) return false;
4567  $_SESSION['currency_id'] = $_POST['currency_id'];
4568 
4569  $oConfirmationGUI = new ilConfirmationGUI();
4570  $this->ctrl->setParameter($this,'currency_id',(int) $_POST['currency_id']);
4571  // set confirm/cancel commands
4572  $oConfirmationGUI->setFormAction($this->ctrl->getFormAction($this,"performDeleteCurrency"));
4573 
4574  $oConfirmationGUI->setHeaderText($this->lng->txt("paya_sure_delete_selected_currency"));
4575  $oConfirmationGUI->setCancel($this->lng->txt("cancel"), "currencies");
4576  $oConfirmationGUI->setConfirm($this->lng->txt("confirm"), "performDeleteCurrency");
4577 
4578  $oConfirmationGUI->addItem('currency_id','', ilPaymentCurrency::_getUnit($_POST['currency_id']),'' );
4579 
4580  $this->tpl->setVariable('CONFIRMATION', $oConfirmationGUI->getHtml());
4581  return true;
4582  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
$_POST['username']
Definition: cron.php:12
static _isDefault($a_currency_id)
static _getUnit($a_currency_id)
Confirmation screen class.
+ Here is the call graph for this function:

◆ deleteObjectObject()

ilObjPaymentSettingsGUI::deleteObjectObject ( )

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

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

1344  {
1345  //include_once './Services/Payment/classes/class.ilPaymentBookings.php';
1346 
1347  if(!$_GET['pobject_id'])
1348  {
1349  ilUtil::sendInfo($this->lng->txt('paya_no_object_selected'));
1350 
1351  $this->editDetailsObject();
1352  return true;
1353  }
1354  if(ilPaymentBookings::_getCountBookingsByObject((int) $_GET['pobject_id']))
1355  {
1356  ilUtil::sendInfo($this->lng->txt('paya_bookings_available'));
1357  $this->editDetailsObject();
1358 
1359  return false;
1360  }
1361  else
1362  {
1363  ilUtil::sendQuestion($this->lng->txt('paya_sure_delete_object'));
1364  $this->editDetailsObject(true);
1365 
1366  return true;
1367  }
1368  }
$_GET["client_id"]
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static _getCountBookingsByObject($a_pobject_id)
static sendQuestion($a_info="", $a_keep=false)
Send Question to Screen.
+ Here is the call graph for this function:

◆ deletePriceObject()

ilObjPaymentSettingsGUI::deletePriceObject ( )

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

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

1084  {
1085  if(!$_GET['pobject_id'])
1086  {
1087  ilUtil::sendInfo($this->lng->txt('paya_no_object_selected'));
1088 
1089  $this->objectsObject();
1090  return true;
1091  }
1092 
1093  if(!count($_POST['price_ids']))
1094  {
1095  ilUtil::sendInfo($this->lng->txt('paya_no_prices_selected'));
1096 
1097  $this->editPricesObject();
1098  return true;
1099  }
1100  $_SESSION['price_ids'] = $_POST['price_ids'];
1101 
1102  $this->editPricesObject(true);
1103  return true;
1104  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
$_POST['username']
Definition: cron.php:12
$_GET["client_id"]
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
+ Here is the call graph for this function:

◆ deleteStatisticObject()

ilObjPaymentSettingsGUI::deleteStatisticObject ( )

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

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

2231  {
2232  if(!isset($_GET['booking_id']))
2233  {
2234  ilUtil::sendInfo($this->lng->txt('paya_no_booking_id_given'));
2235  $this->statisticObject();
2236 
2237  return true;
2238  }
2239  ilUtil::sendQuestion($this->lng->txt('paya_sure_delete_stat'));
2240 
2241  $this->editStatisticObject(true);
2242 
2243  return true;
2244  }
$_GET["client_id"]
editStatisticObject($a_show_confirm_delete=false)
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static sendQuestion($a_info="", $a_keep=false)
Send Question to Screen.
+ Here is the call graph for this function:

◆ deleteVendorsObject()

ilObjPaymentSettingsGUI::deleteVendorsObject ( )

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

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

3214  {
3215  //include_once './Services/Payment/classes/class.ilPaymentBookings.php';
3216 
3217  if(!count($_POST['vendor']))
3218  {
3219  ilUtil::sendFailure($this->lng->txt('pays_no_vendor_selected'));
3220  $this->vendorsObject();
3221 
3222  return true;
3223  }
3224  // CHECK BOOKINGS
3225  foreach($_POST['vendor'] as $vendor)
3226  {
3228  {
3229  ilUtil::sendInfo($this->lng->txt('pays_active_bookings'));
3230  $this->vendorsObject();
3231 
3232  return true;
3233  }
3234  }
3235 
3236  $_SESSION['pays_vendor'] = $_POST['vendor'];
3237  ilUtil::sendQuestion($this->lng->txt('pays_sure_delete_selected_vendors'));
3238  $this->vendorsObject(true);
3239 
3240  return true;
3241  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
$_POST['username']
Definition: cron.php:12
static _getCountBookingsByVendor($a_vendor_id)
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static sendQuestion($a_info="", $a_keep=false)
Send Question to Screen.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
+ Here is the call graph for this function:

◆ editCurrencyObject()

ilObjPaymentSettingsGUI::editCurrencyObject ( )

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

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

4517  {
4518  $currency_id = $_POST['currency_id'];
4519  $obj_currency = ilPaymentCurrency::_getCurrency($currency_id);
4520 
4521  $this->tpl->addBlockfile('ADM_CONTENT','adm_content','tpl.main_view.html','Services/Payment');
4522  $form = new ilPropertyFormGUI();
4523  $form->setFormAction($this->ctrl->getFormAction($this));
4524  $form->setTitle($this->lng->txt('paya_edit_currency'));
4525 
4526  $o_Unit = new ilTextInputGUI($this->lng->txt('paya_currency_unit'),'currency_unit');
4527  $o_Unit->setValue($obj_currency[$currency_id]['unit']);
4528  $o_Unit->setPostVar('currency_unit');
4529  $o_Unit->setRequired(true);
4530 
4531  $o_Isocode = new ilTextInputGUI($this->lng->txt('iso_code'),'iso_code');
4532  $o_Isocode->setValue($obj_currency[$currency_id]['iso_code']);
4533  $o_Isocode->setPostVar('iso_code');
4534  $o_Isocode->setRequired(true);
4535 
4536  $o_Symbol = new ilTextInputGUI($this->lng->txt('symbol'), 'symbol');
4537  $o_Symbol->setValue($obj_currency[$currency_id]['symbol']);
4538  $o_Symbol->setPostVar('symbol');
4539  $o_Symbol->setRequired(true);
4540 
4541  $o_Conversionrate = new IlTextInputGUI($this->lng->txt('conversion_rate'), 'conversion_rate');
4542  $o_Conversionrate->setValue($obj_currency[$currency_id]['conversion_rate']);
4543  $o_Conversionrate->setPostVar('conversion_rate');
4544  $o_Conversionrate->setRequired(true);
4545 
4546  $o_hidden = new ilHiddenInputGUI('currency_id');
4547  $o_hidden->setValue($obj_currency[$currency_id]['currency_id']);
4548  $o_hidden->setPostVar('currency_id');
4549  $form->addItem($o_hidden);
4550 
4551  $form->addItem($o_Unit);
4552  $form->addItem($o_Isocode);
4553  $form->addItem($o_Symbol);
4554  $form->addItem($o_Conversionrate);
4555 
4556  $form->addCommandButton('updateCurrency', $this->lng->txt('save'));
4557  $form->addCommandButton('currencies', $this->lng->txt('cancel'));
4558 
4559  $this->tpl->setVariable('FORM', $form->getHTML());
4560  }
$_POST['username']
Definition: cron.php:12
This class represents a property form user interface.
This class represents a hidden form property in a property form.
This class represents a text property in a property form.
static _getCurrency($a_currency_id)
setValue($a_value)
Set Value.
+ Here is the call graph for this function:

◆ editDetailsObject()

ilObjPaymentSettingsGUI::editDetailsObject (   $a_show_confirm = false)

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

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

Referenced by deleteObjectObject(), and updateDetailsObject().

1199  {
1200  global $ilToolbar;
1201 
1202  if(!(int)$_GET['pobject_id'])
1203  {
1204  ilUtil::sendInfo($this->lng->txt('paya_no_object_selected'));
1205  return $this->objectsObject();
1206  }
1207 
1208  $this->__initPaymentObject((int)$_GET['pobject_id']);
1209 
1210  $this->ctrl->setParameter($this,'pobject_id', (int)$_GET['pobject_id']);
1211 
1212  $ilToolbar->addButton($this->lng->txt('paya_edit_details'), $this->ctrl->getLinkTarget($this, 'editDetails'));
1213  $ilToolbar->addButton($this->lng->txt('paya_edit_prices'), $this->ctrl->getLinkTarget($this, 'editPrices'));
1214  $ilToolbar->addButton($this->lng->txt('pay_edit_abstract'), $this->ctrl->getLinkTargetByClass(array('ilshoppagegui'), 'edit'));
1215 
1216  $this->tpl->addBlockfile('ADM_CONTENT','adm_content','tpl.main_view.html','Services/Payment');
1217 
1218  $tmp_obj = ilObjectFactory::getInstanceByRefId($this->pobject->getRefId(),false);
1219  if($tmp_obj)
1220  {
1221  $tmp_object['title'] = $tmp_obj->getTitle();
1222  $tmp_object['type'] = $tmp_obj->getType();
1223  }
1224  else
1225  {
1226  $tmp_object['title'] = $this->lng->txt('object_not_found');
1227  $tmp_object['type'] = '';
1228 
1229  }
1230  if($a_show_confirm)
1231  {
1232  include_once './Services/Utilities/classes/class.ilConfirmationGUI.php';
1233  $oConfirmationGUI = new ilConfirmationGUI();
1234 
1235  // set confirm/cancel commands
1236  $oConfirmationGUI->setFormAction($this->ctrl->getFormAction($this,"performObjectDelete"));
1237  $oConfirmationGUI->setHeaderText($this->lng->txt("paya_sure_delete_object"));
1238  $oConfirmationGUI->setCancel($this->lng->txt("cancel"), "objects");
1239  $oConfirmationGUI->setConfirm($this->lng->txt("confirm"), "performObjectDelete");
1240 
1241  $oConfirmationGUI->addItem('', $tmp_object['title'], $tmp_object['title']);
1242  $this->tpl->setVariable('CONFIRMATION',$oConfirmationGUI->getHTML());
1243 
1244  return true;
1245  }
1246 
1247  $oForm = new ilPropertyFormGUI();
1248  $oForm->setFormAction($this->ctrl->getFormAction($this, 'updateDetails'));
1249  $oForm->setTitle($tmp_object['title']);
1250  $oForm->setTitleIcon(ilUtil::getImagePath('icon_'.$tmp_object['type'].'_b.png'));
1251 
1252  // repository path
1253  $oPathGUI = new ilNonEditableValueGUI($this->lng->txt('path'));
1254  $oPathGUI->setValue($this->__getHTMLPath($this->pobject->getRefId()));
1255  $oForm->addItem($oPathGUI);
1256 
1257  // number of purchasers
1258  $oPurchasersGUI = new ilNonEditableValueGUI($this->lng->txt('paya_count_purchaser'));
1259  $oPurchasersGUI->setValue(ilPaymentBookings::_getCountBookingsByObject((int)$_GET['pobject_id']));
1260  $oForm->addItem($oPurchasersGUI);
1261 
1262  // vendors
1263  $oVendorsGUI = new ilSelectInputGUI($this->lng->txt('paya_vendor'), 'vendor');
1264  $oVendorsGUI->setOptions($this->__getVendors());
1265  $oVendorsGUI->setValue($this->pobject->getVendorId());
1266  $oForm->addItem($oVendorsGUI);
1267 
1268  // status
1269  $oStatusGUI = new ilSelectInputGUI($this->lng->txt('status'), 'status');
1270  $oStatusGUI->setOptions($this->__getStatus());
1271  $oStatusGUI->setValue($this->pobject->getStatus());
1272  $oForm->addItem($oStatusGUI);
1273 
1274  // pay methods
1275  $oPayMethodsGUI = new ilSelectInputGUI($this->lng->txt('paya_pay_method'), 'pay_method');
1276  $oPayMethodsGUI->setOptions(ilPayMethods::getPayMethodsOptions('not_specified'));
1277 
1278  $oPayMethodsGUI->setValue($this->pobject->getPayMethod());
1279  $oForm->addItem($oPayMethodsGUI);
1280 
1281  // topics
1282  include_once './Services/Payment/classes/class.ilShopTopics.php';
1283  ilShopTopics::_getInstance()->read();
1284  if(is_array($topics = ilShopTopics::_getInstance()->getTopics()) && count($topics))
1285  {
1286  $oTopicsGUI = new ilSelectInputGUI($this->lng->txt('topic'), 'topic_id');
1287 
1288  ilShopTopics::_getInstance()->read();
1289  $topic_options = array();
1290  $topic_options[''] = $this->lng->txt('please_choose');
1291 
1292  foreach($topics as $oTopic)
1293  {
1294  $topic_options[$oTopic->getId()] = $oTopic->getTitle();
1295  }
1296 
1297  $oTopicsGUI->setOptions($topic_options);
1298  $oTopicsGUI->setValue($this->pobject->getTopicId());
1299  $oForm->addItem($oTopicsGUI);
1300  }
1301 
1302  // vats
1303  $oShopVatsList = new ilShopVatsList();
1304  $oShopVatsList->read();
1305  if($oShopVatsList->hasItems())
1306  {
1307  $oVatsGUI = new ilSelectInputGUI($this->lng->txt('vat_rate'), 'vat_id');
1308 
1309  $vats_options = array();
1310  foreach($oShopVatsList as $oVAT)
1311  {
1312  $vats_options[$oVAT->getId()] = ilShopUtils::_formatVAT($oVAT->getRate()).' -> '.$oVAT->getTitle();
1313  }
1314 
1315  $oVatsGUI->setOptions($vats_options);
1316  $oVatsGUI->setValue($this->pobject->getVatId());
1317  $oForm->addItem($oVatsGUI);
1318  }
1319  else
1320  {
1321  $oVatsGUI = new ilNonEditableValueGUI($this->lng->txt('vat_rate'));
1322  $oVatsGUI->setValue($this->lng->txt('paya_no_vats_assigned'));
1323  $oForm->addItem($oVatsGUI);
1324  }
1325 
1326  $oThumbnail = new ilImageFileInputGUI($this->lng->txt('pay_thumbnail'), 'thumbnail');
1327  $oFile = new ilFileDataShop($this->pobject->getPobjectId());
1328  if(($webpath_file = $oFile->getCurrentImageWebPath()) !== false)
1329  {
1330  $oThumbnail->setImage($webpath_file);
1331  }
1332  $oForm->addItem($oThumbnail);
1333 
1334  // buttons
1335  $oForm->addCommandButton('updateDetails', $this->lng->txt('save'));
1336  $oForm->addCommandButton('deleteObject', $this->lng->txt('delete'));
1337 
1338  $this->tpl->setVariable('FORM', $oForm->getHTML());
1339  return true;
1340 
1341  }
getInstanceByRefId($a_ref_id, $stop_on_error=true)
get an instance of an Ilias object by reference id
This class represents a selection list property in a property form.
This class represents a property form user interface.
$_GET["client_id"]
static getPayMethodsOptions($type=0)
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
static _getCountBookingsByObject($a_pobject_id)
setOptions($a_options)
Set Options.
static _formatVAT($a_vat)
Formats a vat rate for gui output.
This class represents an image file property in a property form.
This class represents a non editable value in a property form.
This class handles all operations on files in directory data/shop.
Class ilShopVatsList.
Confirmation screen class.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ editPriceObject()

ilObjPaymentSettingsGUI::editPriceObject ( )

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

References $_GET, $_POST, $form, ilPaymentSettings\_getInstance(), ilPaymentObject\_getObjectData(), ilPaymentPrices\_getPrice(), ilRadioOption\addSubItem(), ilObjectFactory\getInstanceByRefId(), IL_CAL_DATE, ilCheckboxInputGUI\setChecked(), ilTextAreaInputGUI\setRows(), ilRadioOption\setTitle(), ilRadioOption\setValue(), ilPaymentPrices\TYPE_DURATION_DATE, ilPaymentPrices\TYPE_DURATION_MONTH, and ilPaymentPrices\TYPE_UNLIMITED_DURATION.

Referenced by performDeletePriceObject(), and updatePriceObject().

5002  {
5003  $this->tpl->addBlockfile('ADM_CONTENT', 'adm_content', 'tpl.main_view.html', 'Services/Payment');
5004 
5005  $price_id = $_GET['price_id']?$_GET['price_id']: $_POST['price_id'];
5006  $price= ilPaymentPrices::_getPrice($price_id);
5007  $this->ctrl->setParameter($this,'pobject_id',(int) $_GET['pobject_id']);
5008  $tmp_pobject = ilPaymentObject::_getObjectData($_GET['pobject_id']);
5009  include_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
5010  $form = new ilPropertyFormGUI();
5011  $form->setFormAction($this->ctrl->getFormAction($this));
5012 
5013  $tmp_obj = ilObjectFactory::getInstanceByRefId($tmp_pobject['ref_id'], false);
5014 
5015  if($tmp_obj)
5016  {
5017  $form->setTitle($tmp_obj->getTitle());
5018  }
5019  else
5020  {
5021  $form->setTitle($this->lng->txt('object_not_found'));
5022  }
5023 
5024  //price_type
5025  $radio_group = new ilRadioGroupInputGUI('','price_type');
5026  $radio_group->setTitle($this->lng->txt('duration'));
5027  $radio_group->setRequired(true);
5028  $radio_group->setValue($price['price_type']);
5029  $radio_group->setPostVar('price_type');
5030 
5031  $radio_option_1 = new ilRadioOption($this->lng->txt('duration_month'), ilPaymentPrices::TYPE_DURATION_MONTH);
5032 
5033  // duration month
5034  $oDuration = new ilNumberInputGUI();
5035  $oDuration->setTitle($this->lng->txt('paya_months'));
5036  $oDuration->setSize('20%');
5037  $oDuration->setValue($price['duration']);
5038  $oDuration->setPostVar('duration_month');
5039  $radio_option_1->addSubItem($oDuration);
5040 
5041  $radio_group->addOption($radio_option_1);
5042 
5043  $radio_option_3 = new ilRadioOption($this->lng->txt('duration_date'), ilPaymentPrices::TYPE_DURATION_DATE);
5044 
5045  // duration_date from
5046  $o_date_from = new ilDateTimeInputGUI();
5047  $o_date_from->setTitle($this->lng->txt('cal_from'));
5048  $o_date_from->setDate(new ilDate($price['duration_from'],IL_CAL_DATE));
5049  $o_date_from->setPostVar('duration_date_from');
5050  $radio_option_3->addSubItem($o_date_from);
5051 
5052  // duration_date until
5053  $o_date_until = new ilDateTimeInputGUI();
5054  $o_date_until->setTitle($this->lng->txt('cal_until'));
5055  $o_date_until->setDate(new ilDate($price['duration_until'],IL_CAL_DATE));
5056  $o_date_until->setPostVar('duration_date_until');
5057  $radio_option_3->addSubItem($o_date_until);
5058 
5059  $radio_group->addOption($radio_option_3);
5060 
5061  $radio_option_2 = new ilRadioOption($this->lng->txt('unlimited_duration'), ilPaymentPrices::TYPE_UNLIMITED_DURATION);
5062  $radio_group->addOption($radio_option_2);
5063 
5064  $form->addItem($radio_group);
5065 
5066  // description
5067  $oDescription = new ilTextAreaInputGUI($this->lng->txt('description'), 'description');
5068  $oDescription->setRows(4);
5069  $oDescription->setCols(35);
5070  $oDescription->setValue($price['description']);
5071  $form->addItem($oDescription);
5072 
5073  // price
5074  $oPrice = new ilNumberInputGUI();
5075  $oPrice->setTitle($this->lng->txt('price_a'));
5076  $oPrice->setSize('20%');
5077  $oPrice->setRequired(true);
5078  $oPrice->setValue($price['price']);
5079  include_once './Services/Payment/classes/class.ilPaymentSettings.php';
5080  $genSet = ilPaymentSettings::_getInstance();
5081  $oPrice->setInfo($genSet->get('currency_unit'));
5082  $oPrice->setPostVar('price');
5083  $oPrice->allowDecimals(true);
5084  $form->addItem($oPrice);
5085 
5086  //extension
5087  $oExtension = new ilCheckboxInputGUI($this->lng->txt('extension_price'), 'extension');
5088 
5089  $oExtension->setChecked($price['extension']);
5090 
5091  $form->addItem($oExtension);
5092 
5093  $o_hidden_1 = new ilHiddenInputGUI('pobject_id');
5094  $o_hidden_1->setValue( (int)$_GET['pobject_id']);
5095  $o_hidden_1->setPostVar('pobject_id');
5096 
5097  $o_hidden_2 = new ilHiddenInputGUI('price_id');
5098  $o_hidden_2->setValue( (int)$_GET['price_id']);
5099  $o_hidden_2->setPostVar('price_id');
5100 
5101  $form->addItem($o_hidden_1);
5102  $form->addItem($o_hidden_2);
5103 
5104  $form->addCommandButton('updatePrice',$this->lng->txt('save'));
5105  $form->addCommandButton('editPrices', $this->lng->txt('cancel'));
5106 
5107  $this->tpl->setVariable('FORM',$form->getHTML());
5108  }
This class represents an option in a radio group.
setTitle($a_title)
Set Title.
$_POST['username']
Definition: cron.php:12
getInstanceByRefId($a_ref_id, $stop_on_error=true)
get an instance of an Ilias object by reference id
This class represents a property form user interface.
static _getPrice($a_price_id)
$_GET["client_id"]
static _getObjectData($a_id)
This class represents a checkbox property in a property form.
This class represents a date/time property in a property form.
setChecked($a_checked)
Set Checked.
This class represents a hidden form property in a property form.
This class represents a property in a property form.
setValue($a_value)
Set Value.
Class for single dates.
addSubItem($a_item)
Add Subitem.
This class represents a number property in a property form.
const IL_CAL_DATE
This class represents a text area property in a property form.
+ 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 2007 of file class.ilObjPaymentSettingsGUI.php.

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

Referenced by deleteStatisticObject().

2008  {
2009  global $ilToolbar;
2010 
2011  include_once './Services/Payment/classes/class.ilPayMethods.php';
2012 
2013  if(!isset($_GET['booking_id']))
2014  {
2015  ilUtil::sendInfo($this->lng->txt('paya_no_booking_id_given'));
2016  $this->showStatistics();
2017 
2018  return true;
2019  }
2020 
2021  $ilToolbar->addButton($this->lng->txt('back'), $this->ctrl->getLinkTarget($this, 'statistic'));
2022 
2023  $this->tpl->addBlockfile('ADM_CONTENT','adm_content','tpl.main_view.html','Services/Payment');
2024  $this->ctrl->setParameter($this,'booking_id',(int) $_GET['booking_id']);
2025 
2026  // confirm delete
2027  if($a_show_confirm_delete)
2028  {
2029  $oConfirmationGUI = new ilConfirmationGUI();
2030 
2031  // set confirm/cancel commands
2032  $oConfirmationGUI->setFormAction($this->ctrl->getFormAction($this,"performDelete"));
2033  $oConfirmationGUI->setHeaderText($this->lng->txt("paya_sure_delete_stat"));
2034  $oConfirmationGUI->setCancel($this->lng->txt("cancel"), "statistic");
2035  $oConfirmationGUI->setConfirm($this->lng->txt("confirm"), "performDelete");
2036 
2037  $this->tpl->setVariable('CONFIRMATION', $oConfirmationGUI->getHTML());
2038  return true;
2039  }
2040 
2041 
2042  $this->__initBookingObject();
2043  $bookings = $this->booking_obj->getBookings();
2044  $booking = $bookings[(int) $_GET['booking_id']];
2045 
2046  // get customer_obj
2047  $tmp_user = ilObjectFactory::getInstanceByObjId($booking['customer_id'], false);
2048 
2049  $oForm = new ilPropertyFormGUI();
2050  $oForm->setFormAction($this->ctrl->getFormAction($this));
2051  $oForm->setId('stat_form');
2052  $oForm->setTableWidth('50 %');
2053  $oForm->setTitleIcon(ilUtil::getImagePath('icon_usr.png'));
2054  if(is_object($tmp_user))
2055  {
2056  $frm_user = $tmp_user->getFullname().' ['.$tmp_user->getLogin().']';
2057  }
2058  else
2059  {
2060  $frm_user = $this->lng->txt('user_deleted');
2061  }
2062  $oForm->setTitle($frm_user);
2063 
2064  $pObj = new ilPaymentObject($this->user_obj, $booking['pobject_id']);
2065  $tmp_obj = ilObject::_lookupTitle(ilObject::_lookupObjId($pObj->getRefId()));
2066 
2067  // object_title
2068  $oTitleGUI = new ilNonEditableValueGUI($this->lng->txt('title'));
2069  $oTitleGUI->setValue($tmp_obj != '' ? $tmp_obj : $this->lng->txt('object_deleted'));
2070  $oForm->addItem($oTitleGUI);
2071 
2072  // transaction
2073  $oTransactionGUI = new ilNonEditableValueGUI($this->lng->txt('paya_transaction'));
2074  $oTransactionGUI->setValue($booking['transaction']);
2075  $oForm->addItem($oTransactionGUI);
2076 
2077  //vendor
2078  $oVendorGUI = new ilNonEditableValueGUI($this->lng->txt('paya_vendor'));
2079  $tmp_vendor = ilObjectFactory::getInstanceByObjId($booking['b_vendor_id'], false);
2080  if(is_object($tmp_vendor))
2081  {
2082  $frm_vendor = $tmp_vendor->getFullname().' ['.$tmp_vendor->getLogin().']';
2083  }
2084  else
2085  {
2086  $frm_vendor = $this->lng->txt('user_deleted');
2087  }
2088  $oVendorGUI->setValue($frm_vendor);
2089  $oForm->addItem($oVendorGUI);
2090 
2091  // paymethod
2092  $oPaymethodGUI = new ilNonEditableValueGUI($this->lng->txt('paya_pay_method'));
2093  $oPaymethodGUI->setValue(ilPayMethods::getStringByPaymethod($booking['b_pay_method']));
2094  $oForm->addItem($oPaymethodGUI);
2095 
2096  // order_date
2097  $oOrderdateGUI = new ilNonEditableValueGUI($this->lng->txt('paya_order_date'));
2098  $oOrderdateGUI->setValue(ilDatePresentation::formatDate(new ilDate($booking['order_date'], IL_CAL_UNIX)));
2099  $oForm->addItem($oOrderdateGUI);
2100 
2101  // duration
2102  $oDurationGUI = new ilNonEditableValueGUI($this->lng->txt('duration'));
2103  if($booking['duration'] == 0 && $booking['access_enddate'] == NULL)
2104  {
2105  $frm_duration = $this->lng->txt("unlimited_duration");
2106 
2107  }
2108  else
2109  {
2110  if($booking['duration'] > 0)
2111  {
2112  $frm_duration = $booking['duration'].' '.$this->lng->txt('paya_months').'</br>';
2113  }
2114  $frm_duration .= ilDatePresentation::formatDate(new ilDate($booking['access_startdate'], IL_CAL_DATETIME))
2115  .' - '.ilDatePresentation::formatDate(new ilDate($booking['access_enddate'], IL_CAL_DATETIME));
2116 
2117  }
2118  $oDurationGUI->setValue($frm_duration);
2119  $oForm->addItem($oDurationGUI);
2120 
2121  // price
2122  $oPriceGUI = new ilNonEditableValueGUI($this->lng->txt('price_a'));
2123  $oPriceGUI->setValue($booking['price'].' '.$booking['currency_unit']);
2124  $oForm->addItem($oPriceGUI);
2125 
2126  //discount
2127  $oDiscountGUI = new ilNonEditableValueGUI($this->lng->txt('paya_coupons_coupon'));
2128  $oDiscountGUI->setValue($booking['discount'].' '.$booking['currency_unit']);
2129  $oForm->addItem($oDiscountGUI);
2130 
2131  // payed
2132  $oPayedGUI = new ilSelectInputGUI();
2133  $payed_option = array(0 => $this->lng->txt('no'),1 => $this->lng->txt('yes'));
2134 
2135  $oPayedGUI->setTitle($this->lng->txt('paya_payed'));
2136  $oPayedGUI->setOptions($payed_option);
2137  $oPayedGUI->setValue($booking['payed']);
2138  $oPayedGUI->setPostVar('payed');
2139  $oForm->addItem($oPayedGUI);
2140 
2141  // access
2142  $oAccessGUI = new ilSelectInputGUI();
2143  $access_option = array(0 => $this->lng->txt('no'),1 => $this->lng->txt('yes'));
2144 
2145  $oAccessGUI->setTitle($this->lng->txt('paya_access'));
2146  $oAccessGUI->setOptions($access_option);
2147  $oAccessGUI->setValue($booking['access_granted']);
2148  $oAccessGUI->setPostVar('access');
2149  $oForm->addItem($oAccessGUI);
2150 
2151  $oForm->addCommandButton('updateStatistic',$this->lng->txt('save'));
2152  $oForm->addCommandButton('deleteStatistic',$this->lng->txt('delete'));
2153 
2154  // show CUSTOMER_DATA if isset -> setting: save_user_address
2155  if(ilPayMethods::_PMEnabled($booking['b_pay_method']))
2156  {
2157  $oForm2 = new ilPropertyFormGUI();
2158  $oForm2->setId('cust_form');
2159  $oForm2->setTableWidth('50%');
2160  $oForm2->setTitle($frm_user);
2161 
2162  // email
2163  $oEmailGUI = new ilNonEditableValueGUI($this->lng->txt('email'));
2164  $email = (!$tmp_user) ? $this->lng->txt('user_deleted') : $tmp_user->getEmail();
2165  $oEmailGUI->setValue($email);
2166  $oForm2->addItem($oEmailGUI);
2167 
2168  // street
2169  $oStreetGUI = new ilNonEditableValueGUI($this->lng->txt('street'));
2170  $oStreetGUI->setValue($booking['street']);
2171  $oForm2->addItem($oStreetGUI);
2172 
2173  // pobox
2174  $oPoBoxGUI = new ilNonEditableValueGUI($this->lng->txt('pay_bmf_po_box'));
2175  $oPoBoxGUI->setValue($booking['po_box']);
2176  $oForm2->addItem($oPoBoxGUI);
2177 
2178  // zipcode
2179  $oPoBoxGUI = new ilNonEditableValueGUI($this->lng->txt('zipcode'));
2180  $oPoBoxGUI->setValue($booking['zipcode']);
2181  $oForm2->addItem($oPoBoxGUI);
2182 
2183  // city
2184  $oCityGUI = new ilNonEditableValueGUI($this->lng->txt('city'));
2185  $oCityGUI->setValue($booking['city']);
2186  $oForm2->addItem($oCityGUI);
2187 
2188  // country
2189  $oCountryGUI = new ilNonEditableValueGUI($this->lng->txt('country'));
2190  $oCountryGUI->setValue($booking['country']);
2191  $oForm2->addItem($oCountryGUI);
2192  }
2193 
2194  $this->tpl->setVariable('FORM',$oForm->getHTML());
2195  $this->tpl->setVariable('FORM_2',$oForm2->getHTML());
2196  return true;
2197 
2198  }
const IL_CAL_DATETIME
This class represents a selection list property in a property form.
This class represents a property form user interface.
$_GET["client_id"]
static getStringByPaymethod($a_type)
static _lookupTitle($a_id)
lookup object title
const IL_CAL_UNIX
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
Class for single dates.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
static _lookupObjId($a_id)
static formatDate(ilDateTime $date)
Format a date public.
getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
static _PMEnabled($a_id)
This class represents a non editable value in a property form.
Confirmation screen class.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ editVatObject()

ilObjPaymentSettingsGUI::editVatObject ( )

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

References fillVATDataIntoVATForm(), and initVatForm().

4263  {
4264  $this->initVatForm('edit');
4265  $this->fillVATDataIntoVATForm();
4266  $this->tpl->setContent($this->form->getHtml());
4267  }
+ Here is the call graph for this function:

◆ editVendorObject()

ilObjPaymentSettingsGUI::editVendorObject ( )

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

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

3275  {
3276  global $rbacsystem;
3277 
3278  // MINIMUM ACCESS LEVEL = 'read'
3279  if(!$rbacsystem->checkAccess("write", $this->object->getRefId()))
3280  {
3281  $this->ilErr->raiseError($this->lng->txt("msg_no_perm_write"),$this->ilErr->MESSAGE);
3282  }
3283 
3284  if(!count($_POST['vendor']))
3285  {
3286  ilUtil::sendInfo($this->lng->txt('pays_no_vendor_selected'));
3287  $this->vendorsObject();
3288 
3289  return true;
3290  }
3291  if(count($_POST['vendor']) > 1)
3292  {
3293  ilUtil::sendInfo($this->lng->txt('pays_too_many_vendors_selected'));
3294  $this->vendorsObject();
3295 
3296  return true;
3297  }
3298 
3299  $_SESSION['pays_vendor'] = $_POST['vendor'][0];
3300 
3301  if (!is_array($this->vendors_obj->vendors[$_SESSION['pays_vendor']]))
3302  {
3303  $this->vendorsObject();
3304 
3305  return true;
3306  }
3307 
3308  $this->tpl->addBlockfile('ADM_CONTENT','adm_content','tpl.main_view.html','Services/Payment');
3309 
3310  $form_gui = new ilPropertyFormGUI();
3311  $form_gui->setFormAction($this->ctrl->getFormAction($this, 'performEditVendor'));
3312  $form_gui->setTitle($this->lng->txt('pays_vendor'));
3313 
3314  $oVendorGUI = new ilNonEditableValueGUI($this->lng->txt('pays_vendor'));
3315  $oVendorGUI->setValue(ilObjUser::getLoginByUserId($this->vendors_obj->vendors[$_SESSION['pays_vendor']]['vendor_id']), true);
3316  $form_gui->addItem($oVendorGUI);
3317 
3318  $oCostcenterGUI = new ilTextInputGUI($this->lng->txt('pays_cost_center'),'cost_center');
3319  $oCostcenterGUI->setValue($this->error != '' && isset($_POST['cost_center'])
3320  ? ilUtil::prepareFormOutput($_POST['cost_center'],true)
3321  : ilUtil::prepareFormOutput($this->vendors_obj->vendors[$_SESSION['pays_vendor']]['cost_center'],true));
3322  $form_gui->addItem($oCostcenterGUI);
3323 
3324  $form_gui->addCommandButton('performEditVendor',$this->lng->txt('save'));
3325  $this->tpl->setVariable('FORM', $form_gui->getHTML());
3326  return true;
3327  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms public
$_POST['username']
Definition: cron.php:12
This class represents a property form user interface.
getLoginByUserId($a_userid)
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
This class represents a text property in a property form.
This class represents a non editable value in a property form.
setValue($a_value)
Set Value.
+ Here is the call graph for this function:

◆ exportVendorsObject()

ilObjPaymentSettingsGUI::exportVendorsObject ( )

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

References addStatisticWorksheet(), and addVendorWorksheet().

2854  {
2855  include_once './Services/Payment/classes/class.ilPaymentExcelWriterAdapter.php';
2856 
2857  $pewa = new ilPaymentExcelWriterAdapter('payment_vendors.xls');
2858 
2859  // add/fill worksheet
2860  $this->addVendorWorksheet($pewa);
2861  $this->addStatisticWorksheet($pewa);
2862 
2863  // HEADER SENT
2864 
2865  $workbook = $pewa->getWorkbook();
2866  @$workbook->close();
2867  }
+ Here is the call graph for this function:

◆ fillVATDataIntoVATForm()

ilObjPaymentSettingsGUI::fillVATDataIntoVATForm ( )
private

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

References $_GET.

Referenced by editVatObject().

4311  {
4312  $oVAT = new ilShopVats((int)$_GET['vat_id']);
4313  $this->form->setValuesByArray(array(
4314  'vat_title' => $oVAT->getTitle(),
4315  'vat_rate' => $oVAT->getRate()
4316  ));
4317  }
Class ilShopVats.
$_GET["client_id"]
+ Here is the caller graph for this function:

◆ forwardToDocumentsPageObject()

ilObjPaymentSettingsGUI::forwardToDocumentsPageObject (   $a_editor_page_id)

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

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

Referenced by checkShopActivationObject().

4701  {
4702  global $ilTabs;
4703 
4704  $ilTabs->clearTargets();
4705  $ilTabs->setBackTarget($this->lng->txt('back'), $this->ctrl->getLinkTarget($this,'documents'), '_self');
4706 
4707  include_once 'Services/Payment/classes/class.ilShopPage.php';
4708  include_once 'Services/Payment/classes/class.ilShopPageGUI.php';
4709  include_once('./Services/Style/classes/class.ilObjStyleSheet.php');
4710 
4711  $this->tpl->setVariable('LOCATION_CONTENT_STYLESHEET', ilObjStyleSheet::getContentStylePath(0));
4712 
4713  if(!ilShopPage::_exists('shop', $a_editor_page_id))
4714  {
4715  // doesn't exist -> create new one
4716  $new_page_object = new ilShopPage();
4717  $new_page_object->setParentId(0);
4718  $new_page_object->setId($a_editor_page_id);
4719  $new_page_object->createFromXML();
4720  }
4721 
4722  $this->ctrl->setReturnByClass('ilshoppagegui', 'edit');
4723 
4724  $page_gui = new ilShopPageGUI(self::CONDITIONS_EDITOR_PAGE_ID);
4725 
4726  return $this->ctrl->forwardCommand($page_gui);
4727  }
static _exists($a_parent_type, $a_id, $a_lang="")
Checks whether page exists.
Shop page object.
getContentStylePath($a_style_id)
get content style path
Shop page GUI class.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gatewayObject()

ilObjPaymentSettingsGUI::gatewayObject ( )

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

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

1661  {
1662  switch($_POST['action'])
1663  {
1664  case 'deleteVendorsObject':
1665  $this->deleteVendors();
1666  break;
1667 
1668  case 'editVendorObject':
1669  $this->editVendor();
1670  break;
1671 
1672  case 'performEditVendorObject':
1673  $this->performEditVendorObject();
1674  break;
1675 
1676  default:
1677  $this->vendorsObject();
1678  break;
1679  }
1680  return true;
1681  }
$_POST['username']
Definition: cron.php:12
+ Here is the call graph for this function:

◆ getDocumentsPageHTML()

ilObjPaymentSettingsGUI::getDocumentsPageHTML (   $a_editor_page_id)

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

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

Referenced by TermsConditionsObject().

4678  {
4679 
4680  // page object
4681 
4682  include_once 'Services/Payment/classes/class.ilShopPage.php';
4683  include_once 'Services/Payment/classes/class.ilShopPageGUI.php';
4684 
4685  // if page does not exist, return nothing
4686  if(!ilShopPage::_exists('shop', $a_editor_page_id))
4687  {
4688  return '';
4689  }
4690 
4691  include_once 'Services/Style/classes/class.ilObjStyleSheet.php';
4692  $this->tpl->setVariable('LOCATION_CONTENT_STYLESHEET', ilObjStyleSheet::getContentStylePath(0));
4693 
4694  // get page object
4695  $page_gui = new ilShopPageGUI($a_editor_page_id);
4696 
4697  return $page_gui->showPage();
4698  }
static _exists($a_parent_type, $a_id, $a_lang="")
Checks whether page exists.
getContentStylePath($a_style_id)
get content style path
Shop page GUI class.
+ 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 2337 of file class.ilObjPaymentSettingsGUI.php.

References $_GET, $_POST, $form, $genSetData, $ilSetting, $options, ilPaymentSettings\_getInstance(), checkShopActivationObject(), ilPaypalSettings\getInstance(), ilUtil\prepareFormOutput(), ilUtil\sendFailure(), ilUtil\sendSuccess(), ilCheckboxInputGUI\setChecked(), ilTextAreaInputGUI\setRows(), ilTextInputGUI\setSize(), ilNumberInputGUI\setSize(), ilTextInputGUI\setValue(), ilCheckboxInputGUI\setValue(), and ilSelectInputGUI\setValue().

Referenced by checkShopActivationObject().

2338  {
2339  switch($a_tab)
2340  {
2341  case 'bookings':
2342  break;
2343  case 'objects':
2344  break;
2345  case 'vendors':
2346  break;
2347  case 'payMethods':
2348 
2349  if(!$a_sub_tab) $a_sub_tab = 'payMethods';
2350  $this->tabs_gui->addSubTabTarget('settings',
2351  $this->ctrl->getLinkTargetByClass('ilobjpaymentsettingsgui', 'payMethods'),
2352  '','', '',$a_sub_tab == 'payMethods' ? true : false);
2353 
2354  $this->tabs_gui->addSubTabTarget('pays_bmf',
2355  $this->ctrl->getLinkTargetByClass('ilobjpaymentsettingsgui', 'bmfSettings'),
2356  '','', '',$a_sub_tab == 'bmfSettings' ? true : false);
2357 
2358  $this->tabs_gui->addSubTabTarget('pays_paypal',
2359  $this->ctrl->getLinkTargetByClass('ilobjpaymentsettingsgui', 'paypalSettings'),
2360  '','', '',$a_sub_tab == 'paypalSettings' ? true : false);
2361 
2362 // $this->tabs_gui->addSubTabTarget('pays_epay',
2363 // $this->ctrl->getLinkTargetByClass('ilobjpaymentsettingsgui', 'epaySettings'),
2364 // '','', '',$a_sub_tab == 'epaySettings' ? true : false);
2365 //
2366 // $this->tabs_gui->addSubTabTarget('pays_erp',
2367 // $this->ctrl->getLinkTargetByClass('ilobjpaymentsettingsgui', 'erpSettings'),
2368 // '','', '',$a_sub_tab == 'erpSettings' ? true : false);
2369  break;
2370  case 'currencies':
2371  break;
2372  case 'vats':
2373  break;
2374  case 'topics':
2375  break;
2376  case 'documents':
2377  if(!$a_sub_tab) $a_sub_tab = 'terms_conditions';
2378  $this->tabs_gui->addSubTabTarget('terms_conditions',
2379  $this->ctrl->getLinkTargetByClass('ilobjpaymentsettingsgui', 'TermsConditions'),
2380  '','', '',$a_sub_tab == 'terms_conditions' ? true : false);
2381 
2382  $this->tabs_gui->addSubTabTarget('billing_mail',
2383  $this->ctrl->getLinkTargetByClass('ilobjpaymentsettingsgui', 'BillingMail'),
2384  '','', '',$a_sub_tab == 'billing_mail' ? true : false);
2385  $this->tabs_gui->addSubTabTarget('invoice_number',
2386  $this->ctrl->getLinkTargetByClass('ilobjpaymentsettingsgui', 'InvoiceNumber'),
2387  '','', '',$a_sub_tab == 'invoice_number' ? true : false);
2388  $this->tabs_gui->addSubTabTarget('statutory_regulations',
2389  $this->ctrl->getLinkTargetByClass('ilobjpaymentsettingsgui', 'StatutoryRegulations'),
2390  '','', '',$a_sub_tab == 'statutory_regulations' ? true : false);
2391  break;
2392 
2393  default:
2394  case 'settings':
2395  if (($_GET['cmd'] == '') || ($_GET['cmd'] == 'view') || ($a_sub_tab == 'generalSettings'))
2396  $a_sub_tab = 'generalSettings';
2397  break;
2398  }
2399  }
$_GET["client_id"]
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getTabs()

ilObjPaymentSettingsGUI::getTabs (   $tabs_gui)

get tabs public

Parameters
objectilTabsGUI gui object

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

References $tabs_gui.

Referenced by checkShopActivationObject().

2274  {
2275  global $rbacsystem, $ilHelp;
2276 
2277  $tabs_gui->clearTargets();
2278  $ilHelp->setScreenIdComponent("pays");
2279  if ($rbacsystem->checkAccess('visible,read',$this->object->getRefId()))
2280  {
2281  // Settings
2282  $tabs_gui->addTarget('settings', $this->ctrl->getLinkTarget($this, 'generalSettings'),
2283  array('saveGeneralSettings','generalSettings ','saveBmfSettings','savePaypalSettings','paypalSettings',
2284 // 'saveEPaySettings','epaySettings','saveERPsettings','delERPpreview','','testERPsettings','erpSettings',
2285  '','view'), '', '');
2286 
2287  // Bookings
2288  $tabs_gui->addTarget('bookings', $this->ctrl->getLinkTarget($this, 'statistic'),
2289  array( 'statistic','editStatistic','updateStatistic','deleteStatistic','performDelete',
2290  'resetFilter','exportVendors','addCustomer', 'saveCustomer','showObjectSelector',
2291  'searchUserSP','performSearchSP'), '', '');
2292  // Objects
2293  $tabs_gui->addTarget('objects', $this->ctrl->getLinkTarget($this, 'objects'),
2294  array('updateObjectDetails','deleteObject','performObjectDelete','objects',
2295  'editPrices','addPrice','editDetails','resetObjectFilter'), '', '');
2296  // Vendors
2297  $tabs_gui->addTarget('vendors', $this->ctrl->getLinkTarget($this, 'vendors'),
2298  array('vendors','searchUser','search','performSearch','addVendor','addUser','exportVendors','deleteVendors','performDeleteVendors',
2299  'cancelDeleteVendors','editVendor','performEditVendor'), '', '');
2300 
2301 #TODO: CURRENCY not finished yet
2302 /*
2303  // Currencies
2304  $tabs_gui->addTarget('currencies',
2305  $this->ctrl->getLinkTarget($this, 'currencies'),
2306  array('currencies','editCurrency','deleteCurrency','performDeleteCurrency','updateCurrency','updateDefaultCurrency'), '','');
2307 /**/
2308  // Paymethods
2309  $tabs_gui->addTarget('pay_methods', $this->ctrl->getLinkTarget($this, 'payMethods'),
2310  #array('payMethods','savePayMethods'), '', '');
2311  array('payMethods','savePayMethods ','saveBmfSettings','savePaypalSettings','paypalSettings',
2312 // 'saveEPaySettings','epaySettings','saveERPsettings','delERPpreview','','testERPsettings','erpSettings',
2313  '','view'), '', '');
2314 
2315  // Topics
2316  $tabs_gui->addTarget('topics',
2317  $this->ctrl->getLinkTargetByClass('ilshoptopicsgui', ''), 'payment_topics', '', '');
2318 
2319  // Vats
2320  $tabs_gui->addTarget('vats',
2321  $this->ctrl->getLinkTarget($this, 'vats'), 'vats', '', '');
2322 
2323  // Documents
2324  $tabs_gui->addTarget('documents', $this->ctrl->getLinkTarget($this, 'documents'),
2325  array('documents','TermsConditions','saveTermsConditions','BillingMail',
2326  'saveBillingMail','InvoiceNumber','saveInvoiceNumber','StatutoryRegulations', 'saveStatutoryRegulations'), '', '');
2327  }
2328 
2329  if ($rbacsystem->checkAccess('edit_permission',$this->object->getRefId()))
2330  {
2331  // Permissions
2332  $tabs_gui->addTarget('perm_settings',
2333  $this->ctrl->getLinkTargetByClass(array(get_class($this),'ilpermissiongui'), 'perm'), array('perm','info','owner'), 'ilpermissiongui');
2334  }
2335  }
+ Here is the caller graph for this function:

◆ initVatForm()

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

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

References $_GET, and ilTextInputGUI\setMaxLength().

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

4270  {
4271  $this->form = new ilPropertyFormGUI();
4272  if($a_type == 'edit')
4273  {
4274  $this->ctrl->setParameter($this, 'vat_id', $_GET['vat_id']);
4275  $this->form->setFormAction($this->ctrl->getFormAction($this, 'updateVat'));
4276  $this->form->setTitle($this->lng->txt('payment_edit_vat'));
4277  }
4278  else
4279  {
4280  $this->form->setFormAction($this->ctrl->getFormAction($this, 'saveVat'));
4281  $this->form->setTitle($this->lng->txt('payment_add_vat'));
4282  }
4283 
4284  $oTitle = new ilTextInputGUI($this->lng->txt('title'), 'vat_title');
4285  $oTitle->setMaxLength(255);
4286  $oTitle->setSize(40);
4287  $oTitle->setRequired(true);
4288  $oTitle->setInfo($this->lng->txt('payment_vat_title_info'));
4289  $this->form->addItem($oTitle);
4290 
4291  $oRate = new ilTextInputGUI($this->lng->txt('vat_rate'), 'vat_rate');
4292  $oRate->setMaxLength(5);
4293  $oRate->setSize(5);
4294  $oRate->setRequired(true);
4295  $oRate->setInfo($this->lng->txt('payment_vat_rate_info'));
4296  $this->form->addItem($oRate);
4297 
4298  if($a_type == 'edit')
4299  {
4300  $this->form->addCommandButton('updateVat', $this->lng->txt('save'));
4301  }
4302  else
4303  {
4304  $this->form->addCommandButton('saveVat', $this->lng->txt('save'));
4305  }
4306 
4307  $this->form->addCommandButton('vats', $this->lng->txt('cancel'));
4308  }
This class represents a property form user interface.
$_GET["client_id"]
This class represents a text property in a property form.
setMaxLength($a_maxlength)
Set Max Length.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ InvoiceNumberObject()

ilObjPaymentSettingsGUI::InvoiceNumberObject ( )

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

References $_POST, ilUserDefinedInvoiceNumber\_getIncCurrentValue(), ilUtil\prepareFormOutput(), ilSelectInputGUI\setValue(), ilNumberInputGUI\setValue(), ilRadioOption\setValue(), ilNonEditableValueGUI\setValue(), and ilTextAreaInputGUI\setValue().

Referenced by saveInvoiceNumberObject().

4730  {
4731  include_once('./Services/Form/classes/class.ilPropertyFormGUI.php');
4732 
4733  $invObj = new ilUserDefinedInvoiceNumber();
4734 
4735  $this->tpl->addBlockfile('ADM_CONTENT','adm_content','tpl.main_view.html','Services/Payment');
4736  $this->tpl->addJavaScript('Services/Mail/js/ilMailComposeFunctions.js');
4737 
4738  $form_gui = new ilPropertyFormGUI();
4739  $form_gui->setFormAction($this->ctrl->getFormAction($this, 'saveInvoiceNumber'));
4740  $form_gui->setTitle($this->lng->txt('invoice_number_setting'));
4741 
4742  // invoice_type
4743  $radio_group = new ilRadioGroupInputGUI($this->lng->txt('invoice_number'), 'ud_invoice_number');
4744  $radio_option_1 = new ilRadioOption($this->lng->txt('ilias_invoice_number'), '0');
4745  $radio_group->addOption($radio_option_1);
4746  $radio_option_2 = new ilRadioOption($this->lng->txt('userdefined_invoice_number'), '1');
4747  $radio_group->addOption($radio_option_2);
4748  $radio_group->setRequired(true);
4749  $radio_group->setValue($invObj->getUDInvoiceNumberActive(),'0');
4750  $radio_group->setPostVar('ud_invoice_number');
4751  $form_gui->addItem($radio_group);
4752 
4753  // incremental current value
4754  $cur_num = new ilNonEditableValueGUI($this->lng->txt('incremental_current_value'), 'inc_current_value');
4756  $radio_option_2->addSubItem($cur_num);
4757 
4758  // incremental start value
4759  $inc_num = new ilNumberInputGUI($this->lng->txt('incremental_start_value'), 'inc_start_value');
4760  $inc_num->setValue($this->error != "" && isset($_POST['incremental_start_value'])
4761  ? ilUtil::prepareFormOutput($_POST['incremental_start_value'],true)
4762  : ilUtil::prepareFormOutput($invObj->getIncStartValue(),true));
4763  $inc_num->setInfo($this->lng->txt('incremental_start_value_info'));
4764  $radio_option_2->addSubItem($inc_num);
4765 
4766  // reset period of current value
4767  $sel_reset = new ilSelectInputGUI($this->lng->txt('invoice_number_reset_period'), 'inc_reset_period');
4768  $sel_reset->setValue($this->error != "" && isset($_POST['inc_reset_period'])
4769  ? $_POST['inc_reset_period']
4770  : $invObj->getIncResetPeriod());
4771 
4772  $reset_options = array(
4773  1 => $this->lng->txt('yearly'),
4774  2 => $this->lng->txt('monthly'));
4775  $sel_reset->setOptions($reset_options);
4776 
4777  $radio_option_2->addSubItem($sel_reset);
4778 
4779  // invoice_number_text
4780  $inp = new ilTextAreaInputGUI($this->lng->txt('invoice_number_text'), 'invoice_number_text');
4781  $inp->setValue( $this->error != "" && isset($_POST['invoice_number_text'])
4782  ? ilUtil::prepareFormOutput($_POST['invoice_number_text'],true)
4783  : ilUtil::prepareFormOutput($invObj->getInvoiceNumberText(),true));
4784 
4785 
4786  $inp->setRequired(false);
4787  $inp->setCols(60);
4788  $inp->setRows(3);
4789  $radio_option_2->addSubItem($inp);
4790 
4791  // PLACEHOLDERS
4792 
4794  $radio_option_2->addSubItem($prop);
4795 
4796  $form_gui->addCommandButton('saveInvoiceNumber', $this->lng->txt('save'));
4797  $this->tpl->setVariable('FORM', $form_gui->getHTML());
4798  }
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms public
This class represents an option in a radio group.
$_POST['username']
Definition: cron.php:12
setValue($a_value)
Set Value.
This class represents a selection list property in a property form.
This class represents a property form user interface.
setValue($a_value)
Set Value.
This class represents a property in a property form.
setValue($a_value)
Set Value.
setValue($a_value)
Set Value.
This class represents a number property in a property form.
This class represents a non editable value in a property form.
This class represents a text area property in a property form.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ objectsObject()

ilObjPaymentSettingsGUI::objectsObject ( )

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

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

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

1465  {
1466  global $rbacsystem;
1467 
1468  // MINIMUM ACCESS LEVEL = 'read'
1469  if(!$rbacsystem->checkAccess('read', $this->object->getRefId()))
1470  {
1471  $this->ilErr->raiseError($this->lng->txt('msg_no_perm_read'),$this->ilErr->MESSAGE);
1472  }
1473 
1474  if ($_POST['updateView'] == 1)
1475  {
1476  $_SESSION['pay_objects']['title_type'] = $_POST['title_type'];
1477  $_SESSION['pay_objects']['title_value'] = $_POST['title_value'];
1478  $_SESSION['pay_objects']['pay_method'] = $_POST['pay_method'];
1479  $_SESSION['pay_objects']['vendor'] = $_POST['vendor'];
1480  }
1481 
1482  $this->tpl->addBlockfile('ADM_CONTENT','adm_content','tpl.main_view.html','Services/Payment');
1483 
1484  $this->__initPaymentObject();
1485  $this->lng->loadLanguageModule('search');
1486 
1487  $filter_form = new ilPropertyFormGUI();
1488  $filter_form->setFormAction($this->ctrl->getFormAction($this));
1489  $filter_form->setTitle($this->lng->txt('pay_filter'));
1490  $filter_form->setId('filter_form');
1491  $filter_form->setTableWidth('100 %');
1492 
1493  //hide_filter
1494  $o_hide_check = new ilCheckBoxInputGUI($this->lng->txt('show_filter'),'show_filter');
1495  $o_hide_check->setValue(1);
1496  $o_hide_check->setChecked($_POST['show_filter'] ? 1 : 0);
1497 
1498  $o_hidden = new ilHiddenInputGUI('updateView');
1499  $o_hidden->setValue(1);
1500  $o_hidden->setPostVar('updateView');
1501  $o_hide_check->addSubItem($o_hidden);
1502 
1503  //title
1504  $radio_group = new ilRadioGroupInputGUI($this->lng->txt('search_in_title'), 'title_type');
1505  $radio_option = new ilRadioOption($this->lng->txt('search_any_word'), 'or');
1506  $radio_group->addOption($radio_option);
1507  $radio_option = new ilRadioOption($this->lng->txt('search_all_words'), 'and');
1508  $radio_group->addOption($radio_option);
1509 
1510  $radio_group->setRequired(false);
1511  $radio_group->setValue('or');
1512  $radio_group->setPostVar('title_type');
1513 
1514  $o_title = new ilTextInputGUI();
1515  $o_title->setValue($_SESSION['pay_objects']['title_value']);
1516  $o_title->setPostVar('title_value');
1517  $o_title->setTitle($this->lng->txt('title'));
1518 
1519  $o_hide_check->addSubItem($radio_group);
1520  $o_hide_check->addSubItem($o_title);
1521 
1522  //vendor
1523  $o_vendor = new ilTextInputGUI();
1524  $o_vendor->setTitle($this->lng->txt('paya_vendor'));
1525  $o_vendor->setValue($_SESSION['pay_objects']['vendor']);
1526  $o_vendor->setPostVar('vendor');
1527  $o_hide_check->addSubItem($o_vendor);
1528 
1529  // paymethod
1530  $o_paymethod = new ilSelectInputGUI();
1531  $o_paymethod->setTitle($this->lng->txt('payment_system'));
1532  $o_paymethod->setOptions(ilPaymethods::getPayMethodsOptions('all'));
1533  $o_paymethod->setValue($_SESSION['pay_objects']['pay_method']);
1534  $o_paymethod->setPostVar('pay_method');
1535  $o_hide_check->addSubItem($o_paymethod);
1536 
1537  $filter_form->addCommandButton('objects', $this->lng->txt('pay_update_view'));
1538  $filter_form->addCommandButton('resetObjectFilter', $this->lng->txt('pay_reset_filter'));
1539 
1540  $filter_form->addItem($o_hide_check);
1541  if(!count($objects = ilPaymentObject::_getAllObjectsData()))
1542  {
1543  ilUtil::sendInfo($this->lng->txt('paya_no_objects_assigned'));
1544 
1545  return true;
1546  }
1547  $this->tpl->setVariable('FORM', $filter_form->getHTML());
1548 
1549  $counter = 0;
1550  foreach($objects as $data)
1551  {
1552  $tmp_obj = ilObjectFactory::getInstanceByRefId($data['ref_id'], false);
1553  if($tmp_obj)
1554  {
1555  $f_result[$counter]['title'] = $tmp_obj->getTitle();
1556  }
1557  else
1558  {
1559  $f_result[$counter]['title'] = $this->lng->txt('object_not_found');
1560  }
1561 
1562  switch($data['status'])
1563  {
1564  case $this->pobject->STATUS_BUYABLE:
1565  $f_result[$counter]['status'] = $this->lng->txt('paya_buyable');
1566  break;
1567 
1568  case $this->pobject->STATUS_NOT_BUYABLE:
1569  $f_result[$counter]['status'] = $this->lng->txt('paya_not_buyable');
1570  break;
1571 
1572  case $this->pobject->STATUS_EXPIRES:
1573  $f_result[$counter]['status'] = $this->lng->txt('paya_expires');
1574  break;
1575  }
1576 
1577  include_once './Services/Payment/classes/class.ilPayMethods.php';
1578  $str_paymethod = ilPayMethods::getStringByPaymethod($data['pay_method']);
1579  $f_result[$counter]['pay_method'] = $str_paymethod;
1580 
1581  if($data['vat_id'] <= 0)
1582  {
1583  $vat_rate = $this->lng->txt('payment_vat_has_to_be_defined_by_administration_short');
1584  }
1585  else
1586  {
1587  try
1588  {
1589  $oVAT = new ilShopVats((int)$data['vat_id']);
1590  $vat_rate = ilShopUtils::_formatVAT((float)$oVAT->getRate());
1591  }
1592  catch(ilShopException $e)
1593  {
1594  $vat_rate = $this->lng->txt('payment_vat_has_to_be_defined_by_administration_short');
1595  }
1596  }
1597 
1598  $f_result[$counter]['vat_rate'] = $vat_rate;
1599 
1600  $tmp_user = ilObjectFactory::getInstanceByObjId($data['vendor_id'], false);
1601  if($tmp_user )
1602  {
1603  $f_result[$counter]['vendor'] = $tmp_user->getFullname().' ['.$tmp_user->getLogin().']';
1604  }
1605  else
1606  {
1607  $f_result[$counter]['vendor'] = $this->lng->txt('user_not_found');
1608  }
1609 
1610  // Get number of purchasers
1611  $f_result[$counter]['purchasers'] = ilPaymentBookings::_getCountBookingsByObject($data['pobject_id']);
1612 
1613  // edit link
1614  $this->ctrl->setParameter($this,'pobject_id',$data['pobject_id']);
1615  $link_change = "<div class=\"il_ContainerItemCommands\"><a class=\"il_ContainerItemCommand\" href=\"".$this->ctrl->getLinkTarget($this,"editDetails")."\">".$this->lng->txt("edit")."</a></div>";
1616 
1617  $f_result[$counter]['options'] = $link_change;
1618  unset($tmp_user);
1619  unset($tmp_obj);
1620 
1621  ++$counter;
1622  }
1623 
1624  return $this->__showObjectsTable($f_result);
1625 
1626  //return true;
1627  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
This class represents an option in a radio group.
Class ilShopVats.
$_POST['username']
Definition: cron.php:12
getInstanceByRefId($a_ref_id, $stop_on_error=true)
get an instance of an Ilias object by reference id
This class represents a selection list property in a property form.
This class represents a property form user interface.
static getStringByPaymethod($a_type)
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
This class represents a hidden form property in a property form.
This class represents a property in a property form.
setValue($a_value)
Set Value.
This class represents a text property in a property form.
static _getCountBookingsByObject($a_pobject_id)
getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
static _formatVAT($a_vat)
Formats a vat rate for gui output.
Class for shop related exception handling in ILIAS.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ payMethodsObject()

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

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

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

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

3043  {
3044  include_once './Services/Payment/classes/class.ilPayMethods.php';
3045 
3046  global $rbacsystem, $ilCtrl;
3047 
3048  $this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.main_view.html','Services/Payment');
3049 
3050  if(!$rbacsystem->checkAccess('read', $this->object->getRefId()))
3051  {
3052  $this->ilErr->raiseError($this->lng->txt('msg_no_perm_read'),$this->ilErr->MESSAGE);
3053  }
3054 
3055  if(count($askForDeletingAddresses))
3056  {
3057  $oConfirmationGUI = new ilConfirmationGUI();
3058 
3059  // set confirm/cancel commands
3060  $oConfirmationGUI->setFormAction($ilCtrl->getFormAction($this, "deleteAddressesForPaymethods"));
3061  $oConfirmationGUI->setHeaderText($this->lng->txt("info_delete_sure"));
3062  $oConfirmationGUI->setCancel($this->lng->txt("cancel"), "payMethods");
3063  $oConfirmationGUI->setConfirm($this->lng->txt("confirm"), "deleteAddressesForPaymethods");
3064 
3065  foreach($askForDeletingAddresses as $pm_id)
3066  {
3067  $pm_obj = new ilPayMethods($pm_id);
3068  $oConfirmationGUI->additem('paymethod['.$pm_obj->getPmId().']',$pm_obj->getPmId(), $this->lng->txt('delete_addresses_bill').' -> '.ilPayMethods::getStringByPaymethod($pm_obj->getPmTitle()));
3069  }
3070 
3071  $this->tpl->setVariable('CONFIRMATION', $oConfirmationGUI->getHtml());
3072  return true;
3073  }
3074 
3075  $obj_paymethods = new ilPayMethods();
3076  $paymethods = $obj_paymethods->readAll();
3077 
3078  $result = array();
3079  $counter = 0;
3080  foreach($paymethods as $paymethod)
3081  {
3082  if($paymethod['pm_title'] != 'epay')
3083  {
3084  $result[$counter]['pm_title'] = ilPayMethods::getStringByPaymethod($paymethod['pm_title']);
3085  $result[$counter]['pm_enabled'] = ilUtil::formCheckbox($paymethod['pm_enabled'] ? 1 : 0,'pm_enabled['.$paymethod['pm_id'].']',1);
3086  $result[$counter]['save_usr_adr'] = ilUtil::formCheckbox($paymethod['save_usr_adr'] ? 1 : 0,'save_usr_adr['.$paymethod['pm_id'].']',1);
3087  $this->ctrl->clearParameters($this);
3088  $counter++;
3089  }
3090  }
3091 
3092  $this->ctrl->setParameter($this, 'cmd', 'savePayMethods');
3093  $tbl = new ilShopTableGUI($this);
3094  $tbl->setTitle($this->lng->txt('pays_pay_methods'));
3095 
3096  $tbl->setId('tbl_paymethods');
3097  $tbl->setRowTemplate("tpl.shop_paymethods_row.html", "Services/Payment");
3098 
3099  $tbl->addColumn($this->lng->txt('title'), 'pm_title', '10%');
3100  $tbl->addColumn($this->lng->txt('enabled'), 'pm_enabled', '10%');
3101  $tbl->addColumn($this->lng->txt('save_customer_address'),'save_usr_adr','10%');
3102  $tbl->addCommandButton('savePayMethods', $this->lng->txt('save'));
3103 
3104  $tbl->disable('sort');
3105  $tbl->setData($result);
3106 
3107  $this->tpl->setVariable('TABLE', $tbl->getHTML());
3108 
3109  return true;
3110  }
$result
static getStringByPaymethod($a_type)
Class ilShopTableGUI.
global $ilCtrl
Definition: ilias.php:18
Class ilObjPaymentSettingsGUI.
static formCheckbox($checked, $varname, $value, $disabled=false)
??? public
Confirmation screen class.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ performAddPriceObject()

ilObjPaymentSettingsGUI::performAddPriceObject ( )

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

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

976  {
977  $po = new ilPaymentPrices((int)$_GET['pobject_id']);
978 
979  switch($_POST['price_type'])
980  {
981  case 'unlimited_duration':
983  $po->setDuration(0);
984  $po->setDurationFrom(NULL);
985  $po->setDurationUntil(NULL);
986  $po->setUnlimitedDuration(1);
987 
988  break;
989 
990  case 'duration_date':
991 
993  $po->setDuration(NULL);
994  $po->setDurationFrom(ilUtil::stripSlashes(
995  $_POST['duration_date_from']['date']['y'].'-'.
996  $_POST['duration_date_from']['date']['m'].'-'.
997  $_POST['duration_date_from']['date']['d']));
998  $po->setDurationUntil(ilUtil::stripSlashes(
999  $_POST['duration_date_until']['date']['y'].'-'.
1000  $_POST['duration_date_until']['date']['m'].'-'.
1001  $_POST['duration_date_until']['date']['d']));
1002  break;
1003 
1004  default:
1005  case 'duration_month':
1007  $po->setDuration($_POST['duration_month']);
1008  $po->setDurationFrom(NULL);
1009  $po->setDurationUntil(NULL);
1010  break;
1011  }
1012 
1013  $po->setDescription($_POST['description'] ? ilUtil::stripSlashes($_POST['description']) : NULL);
1014  $po->setPrice(ilUtil::stripSlashes($_POST['price']));
1015 // $po->setCurrency($currency[1]['currency_id']);
1016 
1017  if($_POST['extension_price'])
1018  {
1019  $po->setExtension(1);
1020  }
1021  else
1022  {
1023  $po->setExtension(0);
1024  }
1025 
1026  try
1027  {
1028  $po->validate();
1029  $po->add();
1030  ilUtil::sendInfo($this->lng->txt('paya_added_new_price'));
1031  return $this->editPricesObject();
1032  }
1033  catch(ilShopException $e)
1034  {
1035  ilUtil::sendInfo($e->getMessage());
1036  return $this->addPriceObject();
1037  }
1038  }
$_POST['username']
Definition: cron.php:12
$_GET["client_id"]
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
Class for shop related exception handling in ILIAS.
+ Here is the call graph for this function:

◆ performDeleteCurrencyObject()

ilObjPaymentSettingsGUI::performDeleteCurrencyObject ( )

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

References $_SESSION, and currenciesObject().

4585  {
4586  if(!$_SESSION['currency_id']) return false;
4587 
4588  $obj_currency = new ilPaymentCurrency((int)$_SESSION['currency_id']);
4589  $obj_currency->deleteCurrency();
4590 
4591  return $this->currenciesObject();
4592  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
+ Here is the call graph for this function:

◆ performDeleteObject()

ilObjPaymentSettingsGUI::performDeleteObject ( )

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

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

2246  {
2247  if(!isset($_GET['booking_id']))
2248  {
2249  ilUtil::sendInfo($this->lng->txt('paya_no_booking_id_given'));
2250  $this->statisticObject();
2251 
2252  return true;
2253  }
2254 
2255  $this->__initBookingObject();
2256  $this->booking_obj->setBookingId((int) $_GET['booking_id']);
2257  if(!$this->booking_obj->delete())
2258  {
2259  die('Error deleting booking');
2260  }
2261  ilUtil::sendInfo($this->lng->txt('pay_deleted_booking'));
2262 
2263  $this->statisticObject();
2264 
2265  return true;
2266  }
$_GET["client_id"]
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
+ Here is the call graph for this function:

◆ performDeletePriceObject()

ilObjPaymentSettingsGUI::performDeletePriceObject ( )

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

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

1041  {
1042  if(!$_GET['pobject_id'])
1043  {
1044  ilUtil::sendInfo($this->lng->txt('paya_no_object_selected'));
1045 
1046  $this->objectsObject();
1047  return true;
1048  }
1049 
1050  if(!count($_SESSION['price_ids']))
1051  {
1052  ilUtil::sendInfo($this->lng->txt('paya_no_prices_selected'));
1053 
1054  $this->editPriceObject();
1055  return true;
1056  }
1057 
1058  $prices = new ilPaymentPrices((int) $_GET['pobject_id']);
1059 
1060  foreach($_SESSION['price_ids'] as $price_id)
1061  {
1062  if($prices->delete($price_id))
1063  ilUtil::sendInfo($this->lng->txt('paya_deleted_selected_prices'));
1064 
1065  }
1066 
1067  // check if it was last price otherwise set status to 'not_buyable'
1068  if(!count($prices->getPrices()))
1069  {
1070  $this->__initPaymentObject((int) $_GET['pobject_id']);
1071 
1072  $this->pobject->setStatus($this->pobject->STATUS_NOT_BUYABLE);
1073  $this->pobject->update();
1074 
1075  ilUtil::sendInfo($this->lng->txt('paya_deleted_last_price'));
1076  }
1077  unset($prices);
1078  unset($_SESSION['price_ids']);
1079 
1080  return $this->editPricesObject();
1081  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
$_GET["client_id"]
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
+ Here is the call graph for this function:

◆ performDeleteVatObject()

ilObjPaymentSettingsGUI::performDeleteVatObject ( )

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

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

4226  {
4227  if(!is_array($_POST['vat_id']))
4228  {
4229  return $this->vatsObject();
4230  }
4231 
4232  foreach($_POST['vat_id'] as $vat_id)
4233  {
4234  try
4235  {
4236  $oVAT = new ilShopVats((int)$vat_id);
4237  $oVAT->delete();
4238 
4239  }
4240  catch(ilShopException $e)
4241  {
4242  ilUtil::sendInfo($e->getMessage());
4243  $_SESSION['disable_shop'] = false;
4244  return $this->vatsObject();
4245  }
4246  }
4247 
4248  if($_SESSION['disable_shop'] == true)
4249  {
4250  $this->genSetData->set('shop_enabled', 0, 'common');
4251  $_SESSION['disable_shop'] = false;
4252  }
4253  ilUtil::sendSuccess($this->lng->txt('payment_vat_deleted_successfully'));
4254  return $this->vatsObject();
4255  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
Class ilShopVats.
$_POST['username']
Definition: cron.php:12
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
Class for shop related exception handling in ILIAS.
+ Here is the call graph for this function:

◆ performDeleteVendorsObject()

ilObjPaymentSettingsGUI::performDeleteVendorsObject ( )

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

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

3244  {
3245  include_once './Services/Payment/classes/class.ilPaymentTrustees.php';
3246 
3247  global $rbacsystem;
3248 
3249  // MINIMUM ACCESS LEVEL = 'read'
3250  if(!$rbacsystem->checkAccess('write', $this->object->getRefId()))
3251  {
3252  $this->ilErr->raiseError($this->lng->txt('msg_no_perm_write'),$this->ilErr->MESSAGE);
3253  }
3254 
3255  foreach($_SESSION['pays_vendor'] as $vendor)
3256  {
3257  $this->vendors_obj->delete($vendor);
3259  }
3260 
3261  ilUtil::sendInfo($this->lng->txt('pays_deleted_number_vendors').' '.count($_SESSION['pays_vendor']));
3262  unset($_SESSION['pays_vendor']);
3263  if($_SESSION['disable_shop'] == true)
3264  {
3265  $this->genSetData->set('shop_enabled', 0, 'common');
3266  $_SESSION['disable_shop'] = false;
3267  }
3268 
3269  $this->vendorsObject();
3270 
3271  return true;
3272  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
static _deleteTrusteesOfVendor($a_vendor_id)
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
+ Here is the call graph for this function:

◆ performEditVendorObject()

ilObjPaymentSettingsGUI::performEditVendorObject ( )

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

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

Referenced by gatewayObject().

3330  {
3331  global $rbacsystem;
3332 
3333  // MINIMUM ACCESS LEVEL = 'read'
3334  if(!$rbacsystem->checkAccess('write', $this->object->getRefId()))
3335  {
3336  $this->ilErr->raiseError($this->lng->txt('msg_no_perm_write'),$this->ilErr->MESSAGE);
3337  }
3338 
3339  if(!count($_SESSION['pays_vendor']))
3340  {
3341  ilUtil::sendInfo($this->lng->txt('pays_no_vendor_selected'));
3342  $this->vendorsObject();
3343 
3344  return true;
3345  }
3346  if(count($_SESSION['pays_vendor']) > 1)
3347  {
3348  ilUtil::sendInfo($this->lng->txt('pays_too_many_vendors_selected'));
3349  $this->vendorsObject();
3350 
3351  return true;
3352  }
3353 
3354  if (!is_array($this->vendors_obj->vendors[$_SESSION['pays_vendor']]))
3355  {
3356  $this->vendorsObject();
3357  return true;
3358  }
3359 
3360  if ($_POST['cost_center'] == '')
3361  {
3362  $this->error = $this->lng->txt('pays_cost_center_not_valid');
3363  ilUtil::sendFailure($this->error);
3364  $_POST['vendor'] = array($_SESSION['pays_vendor']);
3365  return $this->editVendor();
3366 
3367  }
3368 
3369  $this->vendors_obj->update($_SESSION['pays_vendor'], $_POST['cost_center']);
3370 
3371  unset($_SESSION['pays_vendor']);
3372 
3373  $this->vendorsObject();
3374 
3375  return true;
3376  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
$_POST['username']
Definition: cron.php:12
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ performObjectDeleteObject()

ilObjPaymentSettingsGUI::performObjectDeleteObject ( )

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

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

1371  {
1372 
1373  if(!$_GET['pobject_id'])
1374  {
1375  ilUtil::sendInfo($this->lng->txt('paya_no_object_selected'));
1376 
1377  $this->objectsObject();
1378  return true;
1379  }
1380  $this->__initPaymentObject((int) $_GET['pobject_id']);
1381 
1382  // delete object data
1383  $this->pobject->delete();
1384 
1385  // delete payment prices
1386  $price_obj = new ilPaymentPrices((int) $_GET['pobject_id']);
1387  $price_obj->deleteAllPrices();
1388  unset($price_obj);
1389 
1390  ilUtil::sendInfo($this->lng->txt('paya_deleted_object'));
1391 
1392  $this->objectsObject();
1393 
1394  return true;
1395  }
$_GET["client_id"]
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
+ Here is the call graph for this function:

◆ performSearchSPObject()

ilObjPaymentSettingsGUI::performSearchSPObject ( )

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

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

3616  {
3617  global $ilToolbar;
3618  // SAVE it to allow sort in tables
3619  $_SESSION['paya_search_str_user_sp'] = $_POST['search_str'] = $_POST['search_str'] ? $_POST['search_str'] : $_SESSION['paya_search_str_user_sp'];
3620 
3621  if(!trim($_POST['search_str']))
3622  {
3623  ilUtil::sendFailure($this->lng->txt('search_no_search_term'));
3624  $this->statistics();
3625 
3626  return false;
3627  }
3628  if(!count($result = $this->__search(ilUtil::stripSlashes($_POST['search_str']))))
3629  {
3630  ilUtil::sendInfo($this->lng->txt('search_no_match'));
3631  $this->searchUserSPObject();
3632 
3633  return false;
3634  }
3635 
3636  if(!isset($_GET['sell_id']))
3637  {
3638  ilUtil::sendInfo($this->lng->txt('paya_no_booking_id_given'));
3639  $this->showObjectSelectorObject();
3640 
3641  return false;
3642  }
3643 
3644  $this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.main_view.html','Services/Payment');
3645  $this->ctrl->setParameter($this, 'sell_id', $_GET['sell_id']);
3646 
3647  $ilToolbar->addButton($this->lng->txt('back'), $this->ctrl->getLinkTarget($this, 'searchUserSP'));
3648 
3649  $counter = 0;
3650  $f_result = array();
3651  foreach($result as $user)
3652  {
3653  if(!$tmp_obj = ilObjectFactory::getInstanceByObjId($user['id'],false))
3654  {
3655  continue;
3656  }
3657  $f_result[$counter]['user_id'] = $user['id'];
3658  $f_result[$counter]['login'] = $tmp_obj->getLogin();
3659  $f_result[$counter]['firstname'] = $tmp_obj->getFirstname();
3660  $f_result[$counter]['lastname'] = $tmp_obj->getLastname();
3661 
3662  unset($tmp_obj);
3663  ++$counter;
3664  }
3665  return $this->__showSearchUserSPTable($f_result);
3666  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
$_POST['username']
Definition: cron.php:12
$result
$_GET["client_id"]
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
+ Here is the call graph for this function:

◆ resetFilterObject()

ilObjPaymentSettingsGUI::resetFilterObject ( )

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

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

1684  {
1685  unset($_SESSION['pay_statistics']);
1686  unset($_POST['transaction_type']);
1687  unset($_POST['transaction_value']);
1688  unset($_POST['from']);
1689  unset($_POST['til']);
1690  unset($_POST['payed']);
1691  unset($_POST['access']);
1692  unset($_POST['customer']);
1693  unset($_POST['pay_method']);
1694  unset($_POST['updateView']);
1695  unset($_POST["adm_filter_title_id"]);
1696  ilUtil::sendInfo($this->lng->txt('paya_filter_reseted'));
1697 
1698  return $this->statisticObject();
1699  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
$_POST['username']
Definition: cron.php:12
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
+ Here is the call graph for this function:

◆ resetObjectFilterObject()

ilObjPaymentSettingsGUI::resetObjectFilterObject ( )

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

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

1452  {
1453  unset($_SESSION['pay_statistics']);
1454  unset($_POST['title_type']);
1455  unset($_POST['title_value']);
1456  unset($_POST['vendor']);
1457  unset($_POST['pay_method']);
1458 
1459  ilUtil::sendInfo($this->lng->txt('paya_filter_reseted'));
1460 
1461  return $this->objectsObject();
1462  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
$_POST['username']
Definition: cron.php:12
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
+ Here is the call graph for this function:

◆ saveBillingMailObject()

ilObjPaymentSettingsGUI::saveBillingMailObject ( )

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

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

4664  {
4665  if($_POST['m_message'])
4666  {
4668  }
4669 
4670  $_POST['use_placeholders'] ? $placeholders = 1: $placeholders = 0;
4672 
4673  ilUtil::sendSuccess($this->lng->txt('saved_successfully'));
4674  $this->BillingMailObject();
4675  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$_POST['username']
Definition: cron.php:12
static setMailUsePlaceholders($a_mail_use_placeholders)
static setMailBillingText($a_mail_billing_text)
+ Here is the call graph for this function:

◆ saveCurrencyObject()

ilObjPaymentSettingsGUI::saveCurrencyObject ( )

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

References $_POST, and currenciesObject().

4506  {
4507  $obj_currency = new ilPaymentCurrency();
4508  $obj_currency->setUnit($_POST['currency_unit']);
4509  $obj_currency->setIsoCode($_POST['iso_code']);
4510  $obj_currency->setSymbol($_POST['symbol']);
4511  $obj_currency->setConversionRate($_POST['conversion_rate']);
4512  $obj_currency->addCurrency();
4513  $this->currenciesObject();
4514  }
$_POST['username']
Definition: cron.php:12
+ Here is the call graph for this function:

◆ saveCustomerObject()

ilObjPaymentSettingsGUI::saveCustomerObject ( )

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

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(), ilShopVats\getRate(), searchUserSPObject(), ilUtil\sendInfo(), showObjectSelectorObject(), statisticObject(), ilPaymentPrices\TYPE_DURATION_DATE, ilPaymentPrices\TYPE_DURATION_MONTH, and ilPaymentPrices\TYPE_UNLIMITED_DURATION.

3824  {
3825  global $ilUser,$ilObjDataCache;
3826 
3827  if(!isset($_GET['sell_id']))
3828  {
3829  ilUtil::sendInfo($this->lng->txt('paya_error_no_object_id_given'));
3830  $this->showObjectSelectorObject();
3831 
3832  return true;
3833  }
3834 
3835  if(!isset($_GET['user_id']))
3836  {
3837  ilUtil::sendInfo($this->lng->txt('paya_error_no_user_id_given'));
3838  $this->searchUserSPObject();
3839 
3840  return true;
3841  }
3842 
3843  if ($_POST['pay_method'] == '' ||
3844  $_POST['price_id'] == '')
3845  {
3846  ilUtil::sendInfo($this->lng->txt('paya_error_mandatory_fields'));
3847  $this->addCustomerObject();
3848 
3849  return true;
3850  }
3851 
3852  $pObjectId = ilPaymentObject::_lookupPobjectId($_GET['sell_id']);
3853  $obj = new ilPaymentObject($this->user_obj, $pObjectId);
3854 
3855  $this->__initBookingObject();
3856 
3857  $transaction = ilInvoiceNumberPlaceholdersPropertyGUI::_generateInvoiceNumber($ilUser->getId());
3858 
3859  $this->booking_obj->setTransaction($transaction);
3860  $this->booking_obj->setTransactionExtern($_POST['transaction']);
3861  $this->booking_obj->setPobjectId($pObjectId);
3862  $this->booking_obj->setCustomerId($_GET['user_id']);
3863  $this->booking_obj->setVendorId($obj->getVendorId());
3864 
3865  $this->booking_obj->setPayMethod($_POST['pay_method']);
3866  $this->booking_obj->setOrderDate(time());
3867 
3868  $price = ilPaymentPrices::_getPrice($_POST['price_id']);
3869 // $currency = ilPaymentCurrency::_getUnit($price['currency']);
3870 
3871 #@todo check this.
3872  switch($price['price_type'])
3873  {
3875  $this->booking_obj->setDuration($price['duration']);
3876  break;
3877 
3879  $this->booking_obj->setDuration(0);
3880  $this->booking_obj->setAccessStartdate($price['duration_from']);
3881  $this->booking_obj->setAccessEnddate($price['duration_until']);
3882  break;
3884  $this->booking_obj->setDuration(0);
3885  $this->booking_obj->setAccessEnddate(NULL);
3886  break;
3887  }
3888 
3889  $this->booking_obj->setPriceType($price['price_type']);
3890  $this->booking_obj->setPrice($price['price']);
3891 
3892  $this->booking_obj->setAccess((int) $_POST['access']);
3893  $this->booking_obj->setPayed((int) $_POST['payed']);
3894  $this->booking_obj->setVoucher('');
3895 
3896  $obj_id = $ilObjDataCache->lookupObjId($obj->getRefId());
3897  $obj_type = $ilObjDataCache->lookupType($obj_id);
3898  $obj_title = $ilObjDataCache->lookupTitle($obj_id);
3899 
3900  // include_once 'Services/Payment/classes/class.ilShopVatsList.php';
3901  $oVAT = new ilShopVats((int)$obj->getVatId());
3902  $obj_vat_rate = $oVAT->getRate();
3903  $obj_vat_unit = $obj->getVat($this->booking_obj->getPrice());
3904 
3905  $this->booking_obj->setObjectTitle($obj_title);
3906  $this->booking_obj->setVatRate($obj_vat_rate);
3907  $this->booking_obj->setVatUnit($obj_vat_unit);
3908 
3910  $this->booking_obj->setCurrencyUnit( $genSet->get('currency_unit'));
3911 
3912  include_once './Services/Payment/classes/class.ilPayMethods.php';
3913 
3914  $save_user_address_enabled = ilPayMethods::_EnabledSaveUserAddress($this->booking_obj->getPayMethod());
3915  if($save_user_address_enabled == 1)
3916  {
3917  global $ilObjUser;
3918  $user_id[] = $_GET["user_id"];
3919 
3920  $cust_obj = ilObjUser::_readUsersProfileData($user_id);
3921 
3922  $this->booking_obj->setStreet($cust_obj[$_GET["user_id"]]['street'],'');
3923 
3924  $this->booking_obj->setZipcode($cust_obj[$_GET["user_id"]]['zipcode']);
3925  $this->booking_obj->setCity($cust_obj[$_GET["user_id"]]['city']);
3926  $this->booking_obj->setCountry($cust_obj[$_GET["user_id"]]['country']);
3927  }
3928 
3929  if($this->booking_obj->add())
3930  {
3931  // add purchased item to desktop
3932  ilShopUtils::_addPurchasedObjToDesktop($obj, $this->booking_obj->getCustomerId());
3933 
3934  // autosubscribe user if purchased object is a course
3935  if($obj_type == 'crs')
3936  {
3937  ilShopUtils::_assignPurchasedCourseMemberRole($obj, $this->booking_obj->getCustomerId());
3938  }
3939 
3940  ilUtil::sendInfo($this->lng->txt('paya_customer_added_successfully'));
3941  $this->statisticObject();
3942  }
3943  else
3944  {
3945  ilUtil::sendInfo($this->lng->txt('paya_error_adding_customer'));
3946  $this->addCustomerObject();
3947  }
3948  return true;
3949  }
Class ilShopVats.
$_POST['username']
Definition: cron.php:12
static _getPrice($a_price_id)
static _lookupPobjectId($a_ref_id)
$_GET["client_id"]
static _addPurchasedObjToDesktop($oPaymentObject, $a_user_id=0)
static _EnabledSaveUserAddress($a_id)
static _readUsersProfileData($a_user_ids)
STATIC METHOD get user data of selected users.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
global $ilUser
Definition: imgupload.php:15
static _assignPurchasedCourseMemberRole($oPaymentObject, $a_user_id=0)
+ Here is the call graph for this function:

◆ saveInvoiceNumberObject()

ilObjPaymentSettingsGUI::saveInvoiceNumberObject ( )

PhpVoidFunctionResultUsedInspection

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

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

4801  {
4802  // check conditions
4803  if($_POST['ud_invoice_number'] == 1)
4804  {
4805  if($_POST['inc_start_value'] <= 0 || $_POST['inc_start_value'] == NULL)
4806  {
4807  $this->error = $this->lng->txt('start_value_cannot_be_null');
4808  ilUtil::sendFailure($this->error);
4810  return $this->InvoiceNumberObject();
4811  }
4812 
4813  if($_POST['invoice_number_text'] !== NULL)
4814  {
4815  $check_text = $_POST['invoice_number_text'];
4816 
4817  if(strpos($check_text, '[INCREMENTAL_NUMBER]') === FALSE)
4818  {
4819  $this->error = $this->lng->txt('invoice_number_must_contain_incremental_number');
4820  ilUtil::sendFailure($this->error);
4821  $this->InvoiceNumberObject();
4822  return true;
4823  }
4824  else
4825  {
4826  if($_POST['inc_reset_period'] == 1) // yearly
4827  {
4828  if(strpos($check_text, '[YEAR]') === FALSE && strpos($check_text, '[CURRENT_TIMESTAMP]') === FALSE)
4829  {
4830  $this->error = $this->lng->txt('invoice_number_must_contain_year_ct');
4831  ilUtil::sendFailure($this->error);
4832  $this->InvoiceNumberObject();
4833  return true;
4834  }
4835  }
4836  else if($_POST['inc_reset_period'] == 2) // monthly
4837  {
4838  if((strpos($check_text, '[YEAR]') === FALSE || strpos($check_text, '[MONTH]') === FALSE )
4839  && (strpos($check_text, '[CURRENT_TIMESTAMP]') === FALSE))
4840  {
4841  $this->error = $this->lng->txt('invoice_number_must_contain_year_month_ct');
4842  ilUtil::sendFailure($this->error);
4843  $this->InvoiceNumberObject();
4844  return true;
4845  }
4846  }
4847  }
4848  }
4849  else
4850  {
4851  ilUtil::sendFailure($this->lng->txt('invoice_number_text_cannot_be_null'));
4852  $this->InvoiceNumberObject();
4853  return true;
4854  }
4855  }
4856  // everythink ok .... update settings
4857  $invObj = new ilUserDefinedInvoiceNumber();
4858  $invObj->setUDInvoiceNumberActive($_POST['ud_invoice_number']);
4859  $invObj->setIncStartValue($_POST['inc_start_value']);
4860  $invObj->setIncResetPeriod($_POST['inc_reset_period']);
4861  $invObj->setInvoiceNumberText($_POST['invoice_number_text']);
4862  $invObj->update();
4863 
4864  $this->InvoiceNumberObject();
4865  ilUtil::sendSuccess($this->lng->txt('pays_updated_general_settings'));
4866 
4867  return true;
4868  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$_POST['username']
Definition: cron.php:12
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
+ Here is the call graph for this function:

◆ savePayMethodsObject()

ilObjPaymentSettingsGUI::savePayMethodsObject ( )

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

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

3113  {
3114  include_once './Services/Payment/classes/class.ilPayMethods.php';
3115 
3116  global $rbacsystem;
3117 
3118  if(!$rbacsystem->checkAccess('read', $this->object->getRefId()))
3119  {
3120  $this->ilErr->raiseError($this->lng->txt('msg_no_perm_read'),$this->ilErr->MESSAGE);
3121  }
3122 
3123  $obj_paymethods = new ilPayMethods();
3124  $paymethods = $obj_paymethods->readAll();
3125 
3126  $askForDeletingAddresses = array();
3127 
3128  $pm_enabled = (array)$_POST['pm_enabled'];
3129  $pm_addr = (array)$_POST['save_usr_adr'];
3130 
3131  if(!$pm_enabled)
3132  {
3133  ilUtil::sendInfo($this->lng->txt('shop_disabled_no_paymethods'));
3134  $this->genSetData->set('shop_enabled', 0, 'common');
3135  $_SESSION['disable_shop'] = false;
3136  }
3137 
3138  $info_msg = array();
3139  foreach($paymethods as $paymethod)
3140  {
3141  if(
3142  (!isset($pm_enabled[$paymethod['pm_id']]) || !$pm_enabled[$paymethod['pm_id']]) &&
3143  $paymethod['pm_enabled']
3144  )
3145  {
3146  if(ilPaymentObject::_getCountObjectsByPayMethod($paymethod['pm_id']))
3147  {
3148  $info_msg[] = $this->lng->txt('pays_objects_'.$paymethod['pm_title'].'_exist');
3149  }
3150  }
3151  }
3152  if($info_msg)
3153  {
3154  ilUtil::sendInfo(implode('<br />', $info_msg));
3155  $this->payMethodsObject();
3156  return;
3157  }
3158 
3159  $num_changed = 0;
3160  foreach($paymethods as $paymethod)
3161  {
3162  if(
3163  (!isset($pm_enabled[$paymethod['pm_id']]) || !$pm_enabled[$paymethod['pm_id']]) &&
3164  $paymethod['pm_enabled']
3165  )
3166  {
3167  ilPayMethods::_PMdisable($paymethod['pm_id']);
3168  ++$num_changed;
3169  }
3170  else if(isset($pm_enabled[$paymethod['pm_id']]) && $pm_enabled[$paymethod['pm_id']] && !$paymethod['pm_enabled'])
3171  {
3172  ilPayMethods::_PMenable($paymethod['pm_id']);
3173  ++$num_changed;
3174  }
3175 
3176  if(
3177  (!isset($pm_addr[$paymethod['pm_id']]) || !$pm_addr[$paymethod['pm_id']]) &&
3178  $paymethod['save_usr_adr'])
3179  {
3180  $askForDeletingAddresses[] = $paymethod['pm_id'];
3181  }
3182  else if(
3183  (!isset($pm_addr[$paymethod['pm_id']]) || !$pm_addr[$paymethod['pm_id']]) &&
3184  !$paymethod['save_usr_adr']
3185  )
3186  {
3187  continue;
3188  }
3189  else
3190  {
3191  ilPayMethods::_enableSaveUserAddress($paymethod['pm_id']);
3192  ++$num_changed;
3193  }
3194  }
3195  if($num_changed && !$askForDeletingAddresses)
3196  {
3197  ilUtil::sendSuccess($this->lng->txt('pays_updated_pay_method'));
3198  }
3199  $this->payMethodsObject($askForDeletingAddresses);
3200 
3201  return true;
3202  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
payMethodsObject($askForDeletingAddresses=array())
static _PMenable($a_id)
$_POST['username']
Definition: cron.php:12
static _PMdisable($a_id)
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
Class ilObjPaymentSettingsGUI.
static _getCountObjectsByPayMethod($a_id)
static _enableSaveUserAddress($a_id)
+ Here is the call graph for this function:

◆ savePaypalSettingsObject()

ilObjPaymentSettingsGUI::savePaypalSettingsObject ( )

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

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

2719  {
2720  include_once './Services/Payment/classes/class.ilPaypalSettings.php';
2721 
2722  global $rbacsystem;
2723 
2724  // MINIMUM ACCESS LEVEL = 'read'
2725  if(!$rbacsystem->checkAccess('read', $this->object->getRefId()))
2726  {
2727  $this->ilErr->raiseError($this->lng->txt('msg_no_perm_read'),$this->ilErr->MESSAGE);
2728  }
2729 
2730  $ppSet = ilPaypalSettings::getInstance();
2731 
2732  $ppSet->setServerHost(ilUtil::stripSlashes($_POST['server_host']));
2733  $ppSet->setServerPath(ilUtil::stripSlashes($_POST['server_path']));
2734  $ppSet->setVendor(ilUtil::stripSlashes($_POST['vendor']));
2735 // $ppSet->setVendorPassword(ilUtil::stripSlashes($_POST['vendor_password']));
2736  $ppSet->setAuthToken(ilUtil::stripSlashes($_POST['auth_token']));
2737  $ppSet->setPageStyle(ilUtil::stripSlashes($_POST['page_style']));
2738  $ppSet->setSsl(ilUtil::stripSlashes($_POST['ssl']));
2739 
2740  if ($_POST['server_host'] == '' ||
2741  $_POST['server_path'] == '' ||
2742  $_POST['vendor'] == '' ||
2743 // $_POST['vendor_password'] == '' ||
2744  $_POST['auth_token'] == '')
2745  {
2746  $this->error = $this->lng->txt('pays_paypal_settings_not_valid');
2747  ilUtil::sendFailure($this->error);
2748  $this->paypalSettingsObject();
2749  return true;
2750 
2751  }
2752 
2753  $ppSet->save();
2754 
2755  $this->paypalSettingsObject();
2756 
2757  ilUtil::sendSuccess($this->lng->txt('pays_updated_paypal_settings'));
2758 
2759  return true;
2760  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$_POST['username']
Definition: cron.php:12
static getInstance()
Static method to get the singleton instance.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
+ Here is the call graph for this function:

◆ saveStatutoryRegulationsObject()

ilObjPaymentSettingsGUI::saveStatutoryRegulationsObject ( )

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

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

4937  {
4938  require_once 'Services/RTE/classes/class.ilRTE.php';
4939 
4940  if(isset($_POST['statutory_regulations']) && $_POST['statutory_regulations'] != NULL)
4941  {
4942  $this->genSetData->set('statutory_regulations', ilRTE::_replaceMediaObjectImageSrc($_POST['statutory_regulations'], 0), 'regulations');
4943 
4944  // copy temporary media objects (frm~)
4945  include_once 'Services/MediaObjects/classes/class.ilObjMediaObject.php';
4946  $mediaObjects = ilRTE::_getMediaObjects($_POST['statutory_regulations'], 0);
4947  $myMediaObjects = ilObjMediaObject::_getMobsOfObject('pays~:html', ilObject::_lookupObjId($this->ref_id));
4948  foreach($mediaObjects as $mob)
4949  {
4950  foreach($myMediaObjects as $myMob)
4951  {
4952  if($mob == $myMob)
4953  {
4954  // change usage
4955  ilObjMediaObject::_removeUsage($mob, 'pays~:html', ilObject::_lookupObjId($this->ref_id));
4956  break;
4957  }
4958  }
4959  ilObjMediaObject::_saveUsage($mob, 'pays~:html',ilObject::_lookupObjId($this->ref_id));
4960  }
4961  }
4962  else
4963  {
4964  $this->genSetData->set('statutory_regulations', NULL, 'regulations');
4965  }
4966 
4967  // remove usage of deleted media objects
4968  include_once 'Services/MediaObjects/classes/class.ilObjMediaObject.php';
4969  $oldMediaObjects = ilObjMediaObject::_getMobsOfObject('pays~:html', ilObject::_lookupObjId($this->ref_id));
4970  $curMediaObjects = ilRTE::_getMediaObjects($_POST['statutory_regulations'], 0);
4971  foreach($oldMediaObjects as $oldMob)
4972  {
4973  $found = false;
4974  foreach($curMediaObjects as $curMob)
4975  {
4976  if($oldMob == $curMob)
4977  {
4978  $found = true;
4979  break;
4980  }
4981  }
4982  if(!$found)
4983  {
4984  if(ilObjMediaObject::_exists($oldMob))
4985  {
4986  ilObjMediaObject::_removeUsage($oldMob, 'pays~:html', ilObject::_lookupObjId($this->ref_id));
4987  $mob_obj = new ilObjMediaObject($oldMob);
4988  $mob_obj->delete();
4989  }
4990  }
4991  }
4992 
4993  $this->genSetData->set('show_sr_shoppingcart', isset($_POST['show_sr_shoppingcart']) ? 1 : 0, 'regulations');
4994  $this->genSetData->set('attach_sr_invoice', isset($_POST['attach_sr_invoice']) ? 1 : 0, 'regulations');
4995 
4996  $this->StatutoryRegulationsObject();
4997  ilUtil::sendSuccess($this->lng->txt('pays_updated_general_settings'));
4998  return true;
4999  }
static _getMediaObjects($a_text, $a_direction=0)
Returns all media objects found in the passed string.
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$_POST['username']
Definition: cron.php:12
_removeUsage($a_mob_id, $a_type, $a_id, $a_usage_hist_nr=0, $a_lang="-")
Remove usage of mob in another container.
_saveUsage($a_mob_id, $a_type, $a_id, $a_usage_hist_nr=0, $a_lang="-")
Save usage of mob within another container (e.g.
static _exists($a_id)
checks wether a lm content object with specified id exists or not
static _lookupObjId($a_id)
Class ilObjMediaObject.
_getMobsOfObject($a_type, $a_id, $a_usage_hist_nr=0, $a_lang="-")
get mobs of object
static _replaceMediaObjectImageSrc($a_text, $a_direction=0)
replaces image source from mob image urls with the mob id or replaces mob id with the correct image s...
+ Here is the call graph for this function:

◆ saveVatObject()

ilObjPaymentSettingsGUI::saveVatObject ( )

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

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

4357  {
4358  $this->initVatForm('create');
4359  if(!$this->form->checkInput())
4360  {
4361  $this->form->setValuesByPost();
4362  $this->tpl->setContent($this->form->getHtml());
4363  return true;
4364  }
4365 
4366  if(!ilShopUtils::_checkVATRate($this->form->getInput('vat_rate')))
4367  {
4368  $this->form->getItemByPostVar('vat_rate')->setAlert($this->lng->txt('payment_vat_input_invalid'));
4369  $this->form->setValuesByPost();
4370  $this->tpl->setContent($this->form->getHtml());
4371  return true;
4372  }
4373 
4374  try
4375  {
4376  $oVAT = new ilShopVats();
4377  $oVAT->setTitle($this->form->getInput('vat_title'));
4378  $oVAT->setRate((float)str_replace(',', '.', $this->form->getInput('vat_rate')));
4379  $oVAT->save();
4380  }
4381  catch(ilShopException $e)
4382  {
4383  ilUtil::sendInfo($e->getMessage());
4384  $this->form->setValuesByPost();
4385  $this->tpl->setContent($this->form->getHtml());
4386  return true;
4387 
4388  }
4389 
4390  ilUtil::sendInfo($this->lng->txt('saved'));
4391  $this->vatsObject();
4392  return true;
4393 
4394  }
Class ilShopVats.
static _checkVATRate($a_vat_rate)
Checks if the passed vat rate is valid.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
Class for shop related exception handling in ILIAS.
+ Here is the call graph for this function:

◆ searchObject()

ilObjPaymentSettingsGUI::searchObject ( )

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

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

Referenced by addUserObject().

3443  {
3444  global $rbacsystem;
3445 
3446  if(!$rbacsystem->checkAccess('read', $this->object->getRefId()))
3447  {
3448  $this->ilErr->raiseError($this->lng->txt('msg_no_perm_read'),$this->ilErr->MESSAGE);
3449  }
3450 
3451  $_SESSION['pays_search_str'] = $_POST['search_str'] = $_POST['search_str'] ? $_POST['search_str'] : $_SESSION['pays_search_str'];
3452 
3453  if(!isset($_POST['search_str']))
3454  {
3455  ilUtil::sendInfo($this->lng->txt('crs_search_enter_search_string'));
3456  $this->searchUserObject();
3457 
3458  return false;
3459  }
3460  if(!count($result = $this->__search(ilUtil::stripSlashes($_POST['search_str']))))
3461  {
3462  ilUtil::sendInfo($this->lng->txt('crs_no_results_found'));
3463  $this->searchUserObject();
3464 
3465  return false;
3466  }
3467 
3468  $this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.main_view.html','Services/Payment');
3469 
3470  $counter = 0;
3471  $f_result = array();
3472  foreach($result as $user)
3473  {
3474  if(!$tmp_obj = ilObjectFactory::getInstanceByObjId($user['id'],false))
3475  {
3476  continue;
3477  }
3478  $f_result[$counter]['vendor_id'] = ilUtil::formCheckbox(0,'user[]',$user['id']);
3479  $f_result[$counter]['login'] = $tmp_obj->getLogin();
3480  $f_result[$counter]['lastname'] = $tmp_obj->getLastname();
3481  $f_result[$counter]['firstname'] = $tmp_obj->getFirstname();
3482 
3483  unset($tmp_obj);
3484  ++$counter;
3485  }
3486  $this->__showSearchUserTable($f_result);
3487 
3488  return true;
3489  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
$_POST['username']
Definition: cron.php:12
$result
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
static formCheckbox($checked, $varname, $value, $disabled=false)
??? public
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ searchUserObject()

ilObjPaymentSettingsGUI::searchUserObject ( )

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

Referenced by searchObject().

3408  {
3409 /* global $rbacsystem, $ilToolbar;
3410 
3411  // MINIMUM ACCESS LEVEL = 'read'
3412  if(!$rbacsystem->checkAccess('read', $this->object->getRefId()))
3413  {
3414  $this->ilErr->raiseError($this->lng->txt('msg_no_perm_read'),$this->ilErr->MESSAGE);
3415  }
3416 
3417  $this->tpl->addBlockFile('ADM_CONTENT','adm_content','tpl.main_view.html','Services/Payment');
3418 
3419  $ilToolbar->addButton($this->lng->txt('back'), $this->ctrl->getLinkTarget($this, 'vendors'));
3420 
3421  $this->lng->loadLanguageModule('search');
3422 
3423  $form_gui = new ilPropertyFormGUI();
3424  $form_gui->setFormAction($this->ctrl->getFormAction($this));
3425  $form_gui->setTitle($this->lng->txt('crs_search_members'));
3426  $form_gui->setId('search_form');
3427 
3428  $oTitle = new ilTextInputGUI($this->lng->txt('search_search_term'), 'search_str');
3429  $oTitle->setMaxLength(255);
3430  $oTitle->setSize(40);
3431  $oTitle->setValue($_POST['search_str']); // $_SESSION['pays_search_str']
3432  $form_gui->addItem($oTitle);
3433 
3434  // buttons
3435  $form_gui->addCommandButton('search', $this->lng->txt('search'));
3436  $form_gui->addCommandButton('vendors', $this->lng->txt('cancel')); //??vendors
3437 
3438  $this->tpl->setVariable('FORM',$form_gui->getHTML());
3439  return true;*/
3440  }
+ Here is the caller graph for this function:

◆ searchUserSPObject()

ilObjPaymentSettingsGUI::searchUserSPObject ( )

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

References $_GET, $_POST, ilTextInputGUI\setMaxLength(), and showObjectSelectorObject().

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

3579  {
3580  global $ilToolbar;
3581 
3582  if(!isset($_GET['sell_id']))
3583  {
3584  ilUtil::sendFailiure($this->lng->txt('paya_no_booking_id_given'));
3585  $this->showObjectSelectorObject();
3586 
3587  return false;
3588  }
3589 
3590  $ilToolbar->addButton($this->lng->txt('back'), $this->ctrl->getLinkTarget($this, 'showObjectSelector'));
3591  $this->tpl->addBlockFile('ADM_CONTENT','adm_content','tpl.main_view.html','Services/Payment');
3592 
3593  $this->lng->loadLanguageModule('search');
3594  $this->ctrl->setParameter($this, 'sell_id', $_GET['sell_id']);
3595 
3596  $form_gui = new ilPropertyFormGUI();
3597  $form_gui->setFormAction($this->ctrl->getFormAction($this));
3598  $form_gui->setTitle($this->lng->txt('search_user'));
3599  $form_gui->setId('search_form');
3600 
3601  $oTitle = new ilTextInputGUI($this->lng->txt('search_search_term'), 'search_str');
3602  $oTitle->setMaxLength(255);
3603  $oTitle->setSize(40);
3604  $oTitle->setValue($_POST['search_str']);
3605  $form_gui->addItem($oTitle);
3606 
3607  // buttons
3608  $form_gui->addCommandButton('performSearchSP', $this->lng->txt('search'));
3609  $form_gui->addCommandButton('bookings', $this->lng->txt('cancel'));
3610 
3611  $this->tpl->setVariable('FORM',$form_gui->getHTML());
3612  return true;
3613  }
$_POST['username']
Definition: cron.php:12
This class represents a property form user interface.
$_GET["client_id"]
This class represents a text property in a property form.
setMaxLength($a_maxlength)
Set Max Length.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showObjectSelectorObject()

ilObjPaymentSettingsGUI::showObjectSelectorObject ( )

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

References $_GET, ilObjectGUI\$tree, and ilUtil\sendInfo().

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

3379  {
3380  global $rbacsystem, $tree, $ilToolbar;
3381 
3382  // MINIMUM ACCESS LEVEL = 'read'
3383  if(!$rbacsystem->checkAccess('read', $this->object->getRefId()))
3384  {
3385  $this->ilErr->raiseError($this->lng->txt('msg_no_perm_read'),$this->ilErr->MESSAGE);
3386  }
3387 
3388  include_once './Services/Payment/classes/class.ilPaymentObjectSelector.php';
3389 
3390  $this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.paya_object_selector.html','Services/Payment');
3391 
3392  $ilToolbar->addButton($this->lng->txt('back'), $this->ctrl->getLinkTarget($this, 'statistic'));
3393 
3394  ilUtil::sendInfo($this->lng->txt('paya_select_object_to_sell'));
3395 
3396  $exp = new ilPaymentObjectSelector($this->ctrl->getLinkTarget($this,'showObjectSelector'), (string)strtolower(get_class($this)));
3397  $exp->setExpand($_GET['paya_link_expand'] ? $_GET['paya_link_expand'] : $tree->readRootId());
3398  $exp->setExpandTarget($this->ctrl->getLinkTarget($this,'showObjectSelector'));
3399 
3400  $exp->setOutput(0);
3401 
3402  $this->tpl->setVariable('EXPLORER',$exp->getOutput());
3403 
3404  return true;
3405  }
$_GET["client_id"]
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ statisticObject()

ilObjPaymentSettingsGUI::statisticObject ( )

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

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().

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

◆ StatutoryRegulationsObject()

ilObjPaymentSettingsGUI::StatutoryRegulationsObject ( )

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

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

Referenced by saveStatutoryRegulationsObject().

4871  {
4872  $this->tpl->addBlockfile('ADM_CONTENT','adm_content','tpl.main_view.html','Services/Payment');
4873  $form = new ilPropertyFormGUI();
4874  $form->setFormAction($this->ctrl->getFormAction($this, 'saveStatutoryRegulations'));
4875  $form->setTitle($this->lng->txt('statutory_regulations'));
4876  $form->setTableWidth('100%');
4877  // message
4878  $post_gui = new ilTextAreaInputGUI($this->lng->txt('content'), 'statutory_regulations');
4879  $post_gui->setCols(50);
4880  $post_gui->setRows(15);
4881  $post_gui->setUseRte(true);
4882  $post_gui->addPlugin('latex');
4883  $post_gui->addButton('latex');
4884  $post_gui->addButton('pastelatex');
4885  $post_gui->addPlugin('ilimgupload');
4886  $post_gui->addButton('ilimgupload');
4887  $post_gui->removePlugin('advlink');
4888  $post_gui->removePlugin(ilRTE::ILIAS_IMG_MANAGER_PLUGIN);
4889  $post_gui->removePlugin('image');
4890  $post_gui->usePurifier(true);
4891  $post_gui->setRTERootBlockElement('');
4892  $post_gui->setRTESupport(ilObject::_lookupObjId($this->ref_id), 'pays~', 'frm_post', 'tpl.tinymce_frm_post.html', false, '3.4.7');
4893  $post_gui->disableButtons(array(
4894  'charmap',
4895  'undo',
4896  'redo',
4897  'justifyleft',
4898  'justifycenter',
4899  'justifyright',
4900  'justifyfull',
4901  'anchor',
4902  'fullscreen',
4903  'cut',
4904  'copy',
4905  'paste',
4906  'pastetext',
4907  'formatselect',
4908  'image'
4909  ));
4910  // purifier
4911  require_once 'Services/Html/classes/class.ilHtmlPurifierFactory.php';
4912  require_once 'Services/RTE/classes/class.ilRTE.php';
4913  $post_gui->setPurifier(ilHtmlPurifierFactory::_getInstanceByType('frm_post'));
4914  $post_gui->setValue(ilRTE::_replaceMediaObjectImageSrc($this->genSetData->get('statutory_regulations'),1));
4915  $form->addItem($post_gui);
4916 
4917  // show staturaltyio regulations in shoppingcart
4918  $cb_showShoppingCart = new ilCheckboxInputGUI($this->lng->txt('show_sr_shoppingcart'), 'show_sr_shoppingcart');
4919  $cb_showShoppingCart->setInfo($this->lng->txt('show_sr_shoppingcart_info'));
4920  $cb_showShoppingCart->setValue(1);
4921  $cb_showShoppingCart->setChecked($this->genSetData->get('show_sr_shoppingcart'));
4922  $form->addItem($cb_showShoppingCart);
4923 
4924  // attach staturaltyio regulations at invoice
4925  $cb_attachInvoice = new ilCheckboxInputGUI($this->lng->txt('attach_sr_invoice'), 'attach_sr_invoice');
4926  $cb_attachInvoice->setInfo($this->lng->txt('attach_sr_invoice_info'));
4927  $cb_attachInvoice->setValue(1);
4928  $cb_attachInvoice->setChecked($this->genSetData->get('attach_sr_invoice'));
4929  $form->addItem($cb_attachInvoice);
4930 
4931  $form->addCommandButton('saveStatutoryRegulations', $this->lng->txt('save'));
4932  $this->tpl->setVariable('FORM', $form->getHTML());
4933 
4934  }
This class represents a property form user interface.
This class represents a checkbox property in a property form.
setInfo($a_info)
Set Information Text.
const ILIAS_IMG_MANAGER_PLUGIN
Definition: class.ilRTE.php:36
static _lookupObjId($a_id)
static _replaceMediaObjectImageSrc($a_text, $a_direction=0)
replaces image source from mob image urls with the mob id or replaces mob id with the correct image s...
static _getInstanceByType($a_type)
Factory method for creating purifier instances.
This class represents a text area property in a property form.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ TermsConditionsObject()

ilObjPaymentSettingsGUI::TermsConditionsObject ( )

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

References getDocumentsPageHTML().

4611  {
4612  global $ilToolbar;
4613 
4614  $ilToolbar->addButton($this->lng->txt('edit_page'), $this->ctrl->getLinkTargetByClass(array('ilshoppagegui'), 'edit'));
4615 
4616  $this->tpl->addBlockfile('ADM_CONTENT','adm_content','tpl.main_view.html','Services/Payment');
4617  $this->tpl->setVariable('FORM', $this->getDocumentsPageHTML(self::CONDITIONS_EDITOR_PAGE_ID));
4618 
4619  return true;
4620  }
+ Here is the call graph for this function:

◆ updateCurrencyObject()

ilObjPaymentSettingsGUI::updateCurrencyObject ( )

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

References $_POST, and currenciesObject().

4594  {
4595  if(!$_POST['currency_id']) return false;
4596 
4597  $obj_currency = new ilPaymentCurrency($_POST['currency_id']);
4598  $obj_currency->setUnit($_POST['currency_unit']);
4599  $obj_currency->setIsoCode($_POST['iso_code']);
4600  $obj_currency->setSymbol($_POST['symbol']);
4601  $obj_currency->setConversionRate($_POST['conversion_rate']);
4602 
4603  $obj_currency->updateCurrency();
4604 
4605  $this->currenciesObject();
4606 
4607  return true;
4608  }
$_POST['username']
Definition: cron.php:12
+ Here is the call graph for this function:

◆ updateDefaultCurrencyObject()

ilObjPaymentSettingsGUI::updateDefaultCurrencyObject ( )

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

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

4457  {
4458  if(isset($_POST['currency_id'] ))
4459  {
4461  }
4462  else ilUtil::sendFailure($this->lng->txt('please_select_currency'));
4463 
4464  $this->currenciesObject();
4465  }
$_POST['username']
Definition: cron.php:12
static _updateIsDefault($a_currency_id)
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
+ Here is the call graph for this function:

◆ updateDetailsObject()

ilObjPaymentSettingsGUI::updateDetailsObject ( )

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

References $_GET, $_POST, $_SESSION, ilObjectGUI\$data, ilObjectGUI\$tpl, __editPricesTable(), __initPaymentObject(), ilFormat\_getLocalMoneyFormat(), editDetailsObject(), ilDatePresentation\formatDate(), IL_CAL_DATE, objectsObject(), ilUtil\sendInfo(), ilPaymentPrices\TYPE_DURATION_DATE, ilPaymentPrices\TYPE_DURATION_MONTH, and ilPaymentPrices\TYPE_UNLIMITED_DURATION.

593  {
594  if(!$_GET['pobject_id'])
595  {
596  ilUtil::sendInfo($this->lng->txt('paya_no_object_selected'));
597 
598  $this->objectObjects();
599  return true;
600  }
601 
602  $this->__initPaymentObject((int) $_GET['pobject_id']);
603  $this->ctrl->setParameter($this,'pobject_id',(int) $_GET['pobject_id']);
604 
605  // read old settings
606  $old_status = $this->pobject->getStatus();
607 
608  // check status changed from not_buyable
609  if($old_status == $this->pobject->STATUS_NOT_BUYABLE and
610  (int) $_POST['status'] != $old_status)
611  {
612  // check pay_method edited
613  switch((int) $_POST['pay_method'])
614  {
615  case $this->pobject->PAY_METHOD_NOT_SPECIFIED:
616  ilUtil::sendInfo($this->lng->txt('paya_select_pay_method_first'));
617  $this->editDetailsObject();
618 
619  return false;
620  default:
621  ;
622  }
623  // check minimum one price
624  $prices_obj = new ilPaymentPrices((int) $_GET['pobject_id']);
625  $standard_prices = array();
626  $standard_prices = $prices_obj->getPrices();
627 
628  if(!count($standard_prices))
629  {
630  ilUtil::sendInfo($this->lng->txt('paya_edit_prices_first'));
631  $this->editDetailsObject();
632 
633  return false;
634  }
635  }
636 
637  $this->pobject->setStatus((int) $_POST['status']);
638  $this->pobject->setVendorId((int) $_POST['vendor']);
639  $this->pobject->setPayMethod((int) $_POST['pay_method']);
640  $this->pobject->setTopicId((int) $_POST['topic_id']);
641  $this->pobject->setVatId((int) $_POST['vat_id']);
642 
643  $this->pobject->update();
644 
645  ilUtil::sendInfo($this->lng->txt('paya_details_updated'));
646  $this->editDetailsObject();
647 
648  return true;
649  }
$_POST['username']
Definition: cron.php:12
$_GET["client_id"]
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
+ Here is the call graph for this function:

◆ updatePriceObject()

ilObjPaymentSettingsGUI::updatePriceObject ( )

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

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

1107  {
1108  if(!$_GET['pobject_id'] && !$_POST['pobject_id'])
1109  {
1110  ilUtil::sendInfo($this->lng->txt('paya_no_object_selected'));
1111 
1112  $this->objectsObject();
1113  return true;
1114  }
1115  if(isset($_GET['pobject_id']))
1116  {
1117  $pobject_id = (int)$_GET['pobject_id'];
1118  }
1119  else
1120  {
1121  $pobject_id = (int)$_POST['pobject_id'];
1122  }
1123 
1124  if(!(int)$_GET['price_id'] && !$_POST['price_id'])
1125  {
1126  ilUtil::sendInfo($this->lng->txt('payment_no_price_selected'));
1127  return $this->editPricesObject();
1128  }
1129  if(isset($_GET['price_id']))
1130  {
1131  $price_id = (int)$_GET['price_id'];
1132  }
1133  else
1134  {
1135  $price_id = (int)$_POST['price_id'];
1136  }
1137 
1138  $po = new ilPaymentPrices((int)$pobject_id);
1139  switch($_POST['price_type'])
1140  {
1143  $po->setDuration(NULL);
1144  $po->setDurationFrom(NULL);
1145  $po->setDurationUntil(NULL);
1146  $po->setUnlimitedDuration(1);
1147 
1148  break;
1149 
1152  $po->setDuration(NULL);
1153  $po->setDurationFrom(ilUtil::stripSlashes(
1154  $_POST['duration_date_from']['date']['y'].'-'.
1155  $_POST['duration_date_from']['date']['m'].'-'.
1156  $_POST['duration_date_from']['date']['d']));
1157  $po->setDurationUntil(ilUtil::stripSlashes(
1158  $_POST['duration_date_until']['date']['y'].'-'.
1159  $_POST['duration_date_until']['date']['m'].'-'.
1160  $_POST['duration_date_until']['date']['d']));
1161  break;
1162 
1163  default:
1166  $po->setDuration($_POST['duration_month']);
1167  $po->setDurationFrom(NULL);
1168  $po->setDurationUntil(NULL);
1169  break;
1170  }
1171 
1172  $po->setDescription($_POST['description'] ? ilUtil::stripSlashes($_POST['description']) : NULL);
1173  $po->setPrice(ilUtil::stripSlashes($_POST['price']));
1174  $po->setCurrency(ilUtil::stripSlashes($_POST['currency']));
1175  if($_POST['extension_price'])
1176  {
1177  $po->setExtension(1);
1178  }
1179  else
1180  {
1181  $po->setExtension(0);
1182  }
1183  try
1184  {
1185  $po->validate();
1186  $po->update($price_id);
1187  ilUtil::sendInfo($this->lng->txt('paya_updated_price'));
1188  return $this->editPricesObject();
1189  }
1190  catch(ilShopException $e)
1191  {
1192  ilUtil::sendInfo($e->getMessage());
1193  $this->editPriceObject();
1194  return true;
1195  }
1196  }
$_POST['username']
Definition: cron.php:12
$_GET["client_id"]
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
Class for shop related exception handling in ILIAS.
+ Here is the call graph for this function:

◆ updateStatisticObject()

ilObjPaymentSettingsGUI::updateStatisticObject ( )

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

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

2200  {
2201  if(!isset($_GET['booking_id']))
2202  {
2203  ilUtil::sendInfo($this->lng->txt('paya_no_booking_id_given'));
2204  $this->statisticObject();
2205 
2206  return true;
2207  }
2208  $this->__initBookingObject();
2209 
2210  $this->booking_obj->setBookingId((int) $_GET['booking_id']);
2211  $this->booking_obj->setAccess((int) $_POST['access']);
2212  $this->booking_obj->setPayed((int) $_POST['payed']);
2213 
2214  if($this->booking_obj->update())
2215  {
2216  ilUtil::sendSuccess($this->lng->txt('paya_updated_booking'));
2217 
2218  $this->statisticObject();
2219  return true;
2220  }
2221  else
2222  {
2223  ilUtil::sendInfo($this->lng->txt('paya_error_update_booking'));
2224  $this->statisticObject();
2225 
2226  return true;
2227  }
2228  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$_POST['username']
Definition: cron.php:12
$_GET["client_id"]
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
+ Here is the call graph for this function:

◆ updateVatObject()

ilObjPaymentSettingsGUI::updateVatObject ( )

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

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

4320  {
4321  $this->initVatForm('edit');
4322  if(!$this->form->checkInput())
4323  {
4324  $this->form->setValuesByPost();
4325  $this->tpl->setContent($this->form->getHtml());
4326  return true;
4327  }
4328 
4329  if(!ilShopUtils::_checkVATRate($this->form->getInput('vat_rate')))
4330  {
4331  $this->form->getItemByPostVar('vat_rate')->setAlert($this->lng->txt('payment_vat_input_invalid'));
4332  $this->form->setValuesByPost();
4333  $this->tpl->setContent($this->form->getHtml());
4334  return true;
4335  }
4336 
4337  try
4338  {
4339  $oVAT = new ilShopVats((int)$_GET['vat_id']);
4340  $oVAT->setTitle($this->form->getInput('vat_title'));
4341  $oVAT->setRate((float)str_replace(',', '.', $this->form->getInput('vat_rate')));
4342  $oVAT->update();
4343  }
4344  catch(ilShopException $e)
4345  {
4346  ilUtil::sendInfo($e->getMessage());
4347  $this->form->setValuesByPost();
4348  $this->tpl->setContent($this->form->getHtml());
4349  return true;
4350  }
4351 
4352  ilUtil::sendInfo($this->lng->txt('saved_successfully'));
4353  return $this->vatsObject();
4354  }
Class ilShopVats.
$_GET["client_id"]
static _checkVATRate($a_vat_rate)
Checks if the passed vat rate is valid.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
Class for shop related exception handling in ILIAS.
+ Here is the call graph for this function:

◆ vatsObject()

ilObjPaymentSettingsGUI::vatsObject ( )

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

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

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

4110  {
4111  global $ilAccess;
4112 
4113  if(!$ilAccess->checkAccess('read', '', $this->object->getRefId()))
4114  {
4115  $this->ilErr->raiseError($this->lng->txt('msg_no_perm_read'), $this->ilErr->MESSAGE);
4116  }
4117 
4118  include_once 'Services/Table/classes/class.ilTable2GUI.php';
4119  $tbl = new ilTable2GUI($this, 'vats');
4120  $tbl->setId('pay_vats_tbl');
4121  $tbl->setFormAction($this->ctrl->getFormAction($this), 'createVat');
4122  $tbl->setTitle($this->lng->txt('payment_tax_rates'));
4123  $tbl->setRowTemplate('tpl.shop_vats_list_row.html', 'Services/Payment');
4124 
4125  $tbl->setDefaultOrderField('title');
4126 
4127  $tbl->addColumn('', 'check', '1%');
4128  $tbl->addColumn($this->lng->txt('vat_title'), 'vat_title', '33%');
4129  $tbl->addColumn($this->lng->txt('vat_rate'), 'vat_rate', '33%');
4130  $tbl->addColumn('', 'commands', '33%');
4131 
4132  $oShopVatsList = new ilShopVatsList();
4133  $oShopVatsList->read();
4134 
4135  $result = array();
4136 
4137  $_SESSION['count_vats'] = $oShopVatsList->getNumItems();
4138 
4139  if($oShopVatsList->hasItems())
4140  {
4141  $tbl->enable('select_all');
4142  $tbl->setSelectAllCheckbox('vat_id');
4143 
4144  $counter = 0;
4145  foreach($oShopVatsList as $oVAT)
4146  {
4147  $result[$counter]['check'] = ilUtil::formCheckbox(0, 'vat_id[]', $oVAT->getId());
4148  $result[$counter]['vat_title'] = $oVAT->getTitle();
4149  $result[$counter]['vat_rate'] = ilShopUtils::_formatVAT((float)$oVAT->getRate());
4150  $this->ctrl->setParameter($this, 'vat_id', $oVAT->getId());
4151  $result[$counter]['edit_text'] = $this->lng->txt('edit');
4152  $result[$counter]['edit_url'] = $this->ctrl->getLinkTarget($this, 'editVat');
4153  $result[$counter]['delete_text'] = $this->lng->txt('delete');
4154  $result[$counter]['delete_url'] = $this->ctrl->getLinkTarget($this, 'confirmDeleteVat');
4155  $this->ctrl->clearParameters($this);
4156  ++$counter;
4157  }
4158 
4159  $tbl->addMultiCommand('confirmDeleteVat', $this->lng->txt('delete'));
4160  }
4161  else
4162  {
4163  $tbl->disable('header');
4164  $tbl->disable('footer');
4165 
4166  $tbl->setNoEntriesText($this->lng->txt('paya_no_vats_assigned'));
4167  }
4168 
4169  $tbl->setData($result);
4170 
4171  $tbl->addCommandButton('createVat', $this->lng->txt('paya_insert_vats'));
4172 
4173  $this->tpl->setContent($tbl->getHTML());
4174 
4175  return true;
4176  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
$result
Class ilTable2GUI.
static _formatVAT($a_vat)
Formats a vat rate for gui output.
Class ilShopVatsList.
static formCheckbox($checked, $varname, $value, $disabled=false)
??? public
+ 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 2763 of file class.ilObjPaymentSettingsGUI.php.

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().

2764  {
2765  // include_once './Services/Payment/classes/class.ilPaymentBookings.php';
2766  #include_once './Services/Table/classes/class.ilTable2GUI.php';
2767 
2768  global $rbacsystem, $ilToolbar;
2769 
2770  // MINIMUM ACCESS LEVEL = 'read'
2771  if(!$rbacsystem->checkAccess('read', $this->object->getRefId()))
2772  {
2773  $this->ilErr->raiseError($this->lng->txt('msg_no_perm_read'),$this->ilErr->MESSAGE);
2774  }
2775 
2776  $_SESSION['pays_vendor'] = is_array($_SESSION['pays_vendor']) ? $_SESSION['pays_vendor'] : array();
2777 
2778  $this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.main_view.html','Services/Payment');
2779 
2780  // add vendors
2782  $this,
2783  $ilToolbar,
2784  array(
2785  'auto_complete_name' => $this->lng->txt('user'),
2786  'user_type' => null,
2787  'submit_name' => $this->lng->txt('add')
2788  ));
2789 
2790  if(!count($vendors = $this->vendors_obj->getVendors()))
2791  {
2792  ilUtil::sendInfo($this->lng->txt('pay_no_vendors_created'));
2793  }
2794 
2795  if($a_show_confirm)
2796  {
2797  $oConfirmationGUI = new ilConfirmationGUI();
2798 
2799  // set confirm/cancel commands
2800  $oConfirmationGUI->setFormAction($this->ctrl->getFormAction($this,"performDeleteVendors"));
2801  $oConfirmationGUI->setHeaderText($this->lng->txt("pays_sure_delete_selected_vendors"));
2802  $oConfirmationGUI->setCancel($this->lng->txt("cancel"), "vendors");
2803  $oConfirmationGUI->setConfirm($this->lng->txt("confirm"), "performDeleteVendors");
2804 
2805  foreach($vendors as $vendor)
2806  {
2807  if(in_array($vendor['vendor_id'],$_SESSION['pays_vendor']))
2808  {
2809  // GET USER OBJ
2810  if($tmp_obj = ilObjectFactory::getInstanceByObjId($vendor['vendor_id'],false))
2811  {
2812  $delete_row = '';
2813  $delete_row = $tmp_obj->getLogin().' '.
2814  $vendor['cost_center'].' '.
2815  ilPaymentBookings::_getCountBookingsByVendor($vendor['vendor_id']);
2816  $oConfirmationGUI->addItem('',$delete_row, $delete_row);
2817  unset($tmp_obj);
2818  }
2819  }
2820  } // END VENDORS TABLE
2821 
2822  if(count($vendors) == count($_SESSION['pays_vendor']))
2823  {
2824  ilUtil::sendInfo($this->lng->txt('shop_disabled_no_vendors'));
2825  $_SESSION['disable_shop'] = true;
2826  }
2827  $this->tpl->setVariable('CONFIRMATION', $oConfirmationGUI->getHTML()); #
2828  return true;
2829  }
2830 
2831  $counter = 0;
2832  $f_result = array();
2833  foreach($vendors as $vendor)
2834  {
2835  // GET USER OBJ
2836  if($tmp_obj = ilObjectFactory::getInstanceByObjId($vendor['vendor_id'],false))
2837  {
2838  $f_result[$counter]['vendor_id'] = ilUtil::formCheckbox(in_array($vendor['vendor_id'],
2839  $_SESSION['pays_vendor']) ? 1 : 0, "vendor[]", $vendor['vendor_id']);
2840  $f_result[$counter]['login'] = $tmp_obj->getLogin();
2841  $f_result[$counter]['cost_center'] = $vendor['cost_center'];
2842  $f_result[$counter]['number_bookings'] = ilPaymentBookings::_getCountBookingsByVendor($vendor['vendor_id']);
2843 
2844  unset($tmp_obj);
2845  ++$counter;
2846  }
2847  } // END VENDORS TABLE
2848  $this->__showVendorsTable($f_result);
2849 
2850  return true;
2851  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
static _getCountBookingsByVendor($a_vendor_id)
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
static fillAutoCompleteToolbar($parent_object, ilToolbarGUI $toolbar=null, $a_options=array())
fill toolbar with
static formCheckbox($checked, $varname, $value, $disabled=false)
??? public
Confirmation screen class.
+ 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 49 of file class.ilObjPaymentSettingsGUI.php.

◆ $booking_obj

ilObjPaymentSettingsGUI::$booking_obj = null

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

◆ $ctrl

ilObjPaymentSettingsGUI::$ctrl = null

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

◆ $error

ilObjPaymentSettingsGUI::$error = false

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

◆ $form

◆ $genSetData

ilObjPaymentSettingsGUI::$genSetData = null

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

Referenced by getSubTabs().

◆ $ilErr

ilObjPaymentSettingsGUI::$ilErr = null

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

Referenced by __construct().

◆ $pobject

ilObjPaymentSettingsGUI::$pobject = null

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

◆ $tabs_gui

ilObjPaymentSettingsGUI::$tabs_gui = null

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

Referenced by getTabs().

◆ $user_obj

ilObjPaymentSettingsGUI::$user_obj = null

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

◆ $vendors_obj

ilObjPaymentSettingsGUI::$vendors_obj = null

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

◆ CONDITIONS_EDITOR_PAGE_ID

const ilObjPaymentSettingsGUI::CONDITIONS_EDITOR_PAGE_ID = 99999997

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


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