ILIAS  release_4-4 Revision
All Data Structures Namespaces Files Functions Variables Modules Pages
ilPaymentObjectGUI Class Reference
+ Inheritance diagram for ilPaymentObjectGUI:
+ Collaboration diagram for ilPaymentObjectGUI:

Public Member Functions

 __construct ($user_obj)
 
 executeCommand ()
 
 resetObjectFilter ()
 
 deleteObject ()
 
 performDelete ()
 
 editPayMethod ()
 
 performAddPrice ()
 
 performDeletePrice ()
 
 deletePrice ()
 
 ORg_updatePrice ()
 
 updateDetails ()
 
 showSelectedObject ()
 
 addObject ()
 
 updatePrice ()
 
- Public Member Functions inherited from ilShopBaseGUI
 __construct ()
 

Data Fields

 $ctrl
 
 $lng
 
 $user_obj
 
 $pobject = null
 

Private Member Functions

 __getStatus ()
 
 __showObjectsTable ($a_result_set)
 
 __initPaymentObject ($a_pobject_id=0)
 

Additional Inherited Members

- Protected Member Functions inherited from ilShopBaseGUI
 prepareOutput ()
 
 addPager ($result, $a_session_key)
 
 buildSubTabs ()
 
 setSection ($a_section)
 
 getSection ()
 
 setSubSection ($a_sub_section)
 
 getSubSection ()
 
 showButton ($a_cmd, $a_text, $a_target='')
 
 initTableGUI ()
 
 setTableGUIBasicData ($tbl, $result_set, $a_default_order_column='')
 
- Protected Attributes inherited from ilShopBaseGUI
 $ctrl = null
 
 $lng = null
 
 $tpl = null
 
 $oGeneralSettings = null
 
 $section = 0
 
 $sub_section = 0
 

Detailed Description

Definition at line 20 of file class.ilPaymentObjectGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilPaymentObjectGUI::__construct (   $user_obj)

Definition at line 31 of file class.ilPaymentObjectGUI.php.

References $user_obj, ilShopBaseGUI\prepareOutput(), ilShopBaseGUI\setSection(), and ilDatePresentation\setUseRelativeDates().

32  {
33  parent::__construct();
34 
35  $this->user_obj = $user_obj;
36  $this->lng->loadLanguageModule('crs');
38  }
static setUseRelativeDates($a_status)
set use relative dates
+ Here is the call graph for this function:

Member Function Documentation

◆ __getStatus()

ilPaymentObjectGUI::__getStatus ( )
private

Definition at line 1400 of file class.ilPaymentObjectGUI.php.

Referenced by resetObjectFilter().

1401  {
1402  $option = array();
1403  $option[$this->pobject->STATUS_NOT_BUYABLE] = $this->lng->txt('paya_not_buyable');
1404  $option[$this->pobject->STATUS_BUYABLE] = $this->lng->txt('paya_buyable');
1405  $option[$this->pobject->STATUS_EXPIRES] = $this->lng->txt('paya_expires');
1406 
1407  return $option;
1408  }
+ Here is the caller graph for this function:

◆ __initPaymentObject()

ilPaymentObjectGUI::__initPaymentObject (   $a_pobject_id = 0)
private

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

References $_GET, $_POST, ilPaymentSettings\_getInstance(), ilPaymentPrices\_getPrice(), ilRadioOption\addSubItem(), 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 editPayMethod(), executeCommand(), performDelete(), performDeletePrice(), resetObjectFilter(), and updateDetails().

1452  {
1453  include_once './Services/Payment/classes/class.ilPaymentObject.php';
1454 
1455  $this->pobject = new ilPaymentObject($this->user_obj, $a_pobject_id);
1456 
1457  return true;
1458  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __showObjectsTable()

ilPaymentObjectGUI::__showObjectsTable (   $a_result_set)
private

Definition at line 1410 of file class.ilPaymentObjectGUI.php.

References $data, and $path.

Referenced by resetObjectFilter().

1411  {
1412  $tbl = new ilShopTableGUI($this);
1413  $tbl->setTitle($this->lng->txt('objects'));
1414 
1415  $tbl->setId('tbl_objects');
1416  $tbl->setRowTemplate("tpl.shop_objects_row.html", "Services/Payment");
1417 
1418  $tbl->addColumn($this->lng->txt('title'), 'title', '10%');
1419  $tbl->addColumn($this->lng->txt('status'), 'status', '10%');
1420  $tbl->addColumn($this->lng->txt('paya_pay_method'), 'pay_method', '10%');
1421  $tbl->addColumn($this->lng->txt('vat_rate'), 'vat_rate', '15%');
1422  $tbl->addColumn($this->lng->txt('paya_vendor'), 'vendor', '10%');
1423  $tbl->addColumn($this->lng->txt('paya_count_purchaser'), 'purchasers', '10%');
1424  $tbl->addColumn('', 'options', '10%');
1425 
1426  $tbl->setData($a_result_set);
1427 
1428  $this->tpl->setVariable('TABLE', $tbl->getHTML());
1429 
1430  return true;
1431  }
Class ilShopTableGUI.
+ Here is the caller graph for this function:

◆ addObject()

ilPaymentObjectGUI::addObject ( )

Definition at line 1315 of file class.ilPaymentObjectGUI.php.

References $_GET, $_POST, $options, ilPaymentObject\_checkExcSubtype(), ilPaymentTrustees\_getVendorsForObjects(), ilPaymentObject\_isPurchasable(), ilObjectFactory\getInstanceByObjId(), ilUtil\sendInfo(), and showSelectedObject().

1316  {
1317  if(!$_GET['sell_id'])
1318  {
1319  ilUtil::sendInfo($this->lng->txt('paya_no_object_selected'));
1320 
1321  return $this->showObjectSelector();
1322  }
1323  if(!(int)$_POST['vendor'])
1324  {
1325  ilUtil::sendInfo($this->lng->txt('paya_no_vendor_selected'));
1326 
1327  return $this->showSelectedObject();
1328  }
1329 
1330  include_once 'Services/Payment/classes/class.ilPaymentObject.php';
1331  $p_obj = new ilPaymentObject($this->user_obj);
1332 
1333  if($check_subtypes = ilPaymentObject::_checkExcSubtype($_GET['sell_id']))
1334  {
1335  if(!in_array('download', $check_subtypes))
1336  $p_obj->setSubtype('download');
1337  else
1338  if(!in_array('upload', $check_subtypes))
1339  $p_obj->setSubtype('upload');
1340 
1341 
1342  }
1343  else
1344  if(ilPaymentObject::_isPurchasable($_GET['sell_id']))
1345  {
1346  // means that current object already exits in payment_objects _table ...
1347  ilUtil::sendInfo($this->lng->txt('paya_object_not_purchasable'));
1348 
1349  return $this->showObjectSelector();
1350  }
1351 
1352  $p_obj->setRefId((int)$_GET['sell_id']);
1353  $p_obj->setStatus($p_obj->STATUS_NOT_BUYABLE);
1354  $p_obj->setPayMethod($p_obj->PAY_METHOD_NOT_SPECIFIED);
1355  $p_obj->setVendorId((int)$_POST['vendor']);
1356  $p_obj->setTopicId((int)$_POST['topic_id']);
1357  $p_obj->setVatId((int)$_POST['vat_id']);
1358 
1359  $new_id = $p_obj->add();
1360  if($new_id)
1361  {
1362  ilUtil::sendInfo($this->lng->txt('paya_added_new_object'));
1363  $_GET['pobject_id'] = $new_id;
1364  $this->editPrices();
1365  return true;
1366  }
1367  else
1368  {
1369  ilUtil::sendInfo($this->lng->txt('paya_err_adding_object'));
1370  return $this->showObjects();
1371  }
1372  }
$_POST['username']
Definition: cron.php:12
$_GET["client_id"]
static _isPurchasable($a_ref_id, $a_vendor_id=0, $a_check_trustee=false, $a_check_status=false)
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static _checkExcSubtype($a_ref_id)
+ Here is the call graph for this function:

◆ deleteObject()

ilPaymentObjectGUI::deleteObject ( )

Definition at line 494 of file class.ilPaymentObjectGUI.php.

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

495  {
496  include_once './Services/Payment/classes/class.ilPaymentBookings.php';
497 
498  if(!$_GET['pobject_id'])
499  {
500  ilUtil::sendFailure($this->lng->txt('paya_no_object_selected'));
501 
502  $this->showObjects();
503  return true;
504  }
506  {
507  ilUtil::sendInfo($this->lng->txt('paya_bookings_available'));
508  $this->editDetails();
509 
510  return false;
511  }
512  else
513  {
514 
515  $this->editDetails(true);
516 
517  return true;
518  }
519  }
$_GET["client_id"]
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static _getCountBookingsByObject($a_pobject_id)
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
+ Here is the call graph for this function:

◆ deletePrice()

ilPaymentObjectGUI::deletePrice ( )

Definition at line 1007 of file class.ilPaymentObjectGUI.php.

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

1008  {
1009  if(!$_GET['pobject_id'])
1010  {
1011  ilUtil::sendInfo($this->lng->txt('paya_no_object_selected'));
1012 
1013  $this->showObjects();
1014  return true;
1015  }
1016 
1017  if(!count($_POST['price_ids']))
1018  {
1019  ilUtil::sendInfo($this->lng->txt('paya_no_prices_selected'));
1020 
1021  $this->editPrices();
1022  return true;
1023  }
1024  $_SESSION['price_ids'] = $_POST['price_ids'];
1025 
1026  $this->editPrices(true);
1027  return true;
1028  }
< 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:

◆ editPayMethod()

ilPaymentObjectGUI::editPayMethod ( )

Definition at line 549 of file class.ilPaymentObjectGUI.php.

References $_GET, $_POST, $_SESSION, $data, ilShopBaseGUI\$tpl, __initPaymentObject(), ilPaymentSettings\_getInstance(), ilFormat\_getLocalMoneyFormat(), ilRadioOption\addSubItem(), ilDatePresentation\formatDate(), ilObjectFactory\getInstanceByRefId(), ilNonEditableValueGUI\getTitle(), IL_CAL_DATE, ilUtil\sendFailure(), ilUtil\sendInfo(), ilCheckboxInputGUI\setChecked(), ilTextAreaInputGUI\setRows(), ilRadioOption\setTitle(), ilRadioOption\setValue(), ilPaymentPrices\TYPE_DURATION_DATE, ilPaymentPrices\TYPE_DURATION_MONTH, and ilPaymentPrices\TYPE_UNLIMITED_DURATION.

550  {
551  $this->__initPaymentObject((int)$_GET['pobject_id']);
552 
553  switch($this->pobject->getPayMethod())
554  {
555  case $this->pobject->PAY_METHOD_NOT_SPECIFIED:
556  ilUtil::sendFailure($this->lng->txt('paya_select_pay_method_first'));
557  $this->editDetails();
558  return true;
559 
560  default:
561  ilUtil::sendInfo($this->lng->txt('paya_no_settings_necessary'));
562  $this->editDetails();
563  return true;
564  }
565  }
__initPaymentObject($a_pobject_id=0)
$_GET["client_id"]
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:

◆ executeCommand()

ilPaymentObjectGUI::executeCommand ( )

Definition at line 55 of file class.ilPaymentObjectGUI.php.

References $_GET, $cmd, $ret, __initPaymentObject(), ilPageObject\_exists(), ilObjStyleSheet\getContentStylePath(), ilShopBaseGUI\prepareOutput(), and ilUtil\sendInfo().

56  {
57  $cmd = $this->ctrl->getCmd();
58  switch($this->ctrl->getNextClass($this))
59  {
60  case 'ilshoppagegui':
61  $this->prepareOutput();
62  $ret = $this->forwardToPageObject();
63  if($ret != '')
64  {
65  $this->tpl->setContent($ret);
66  }
67  break;
68 
69  default:
70  if(!$cmd)
71  {
72  $cmd = 'showObjects';
73  }
74  $this->prepareOutput();
75  $this->$cmd();
76  break;
77  }
78  }
$cmd
Definition: sahs_server.php:35
+ Here is the call graph for this function:

◆ ORg_updatePrice()

ilPaymentObjectGUI::ORg_updatePrice ( )

Definition at line 1030 of file class.ilPaymentObjectGUI.php.

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

1031  {
1032  include_once './Services/Payment/classes/class.ilPaymentPrices.php';
1033 
1034  if(!$_GET['pobject_id'] && !$_POST['pobject_id'])
1035  {
1036  ilUtil::sendInfo($this->lng->txt('paya_no_object_selected'));
1037 
1038  $this->showObjects();
1039  return true;
1040  }
1041  if(isset($_GET['pobject_id']))
1042  {
1043  $pobject_id = (int)$_GET['pobject_id'];
1044  }
1045  else
1046  {
1047  $pobject_id = (int)$_POST['pobject_id'];
1048  }
1049  $po = new ilPaymentPrices($pobject_id);
1050 
1051  $this->ctrl->setParameter($this, 'pobject_id', $pobject_id);
1052 
1053  $price_id = (int)$_POST['price_id'];
1054 
1055  // validate
1056  $old_price = $po->getPrice($price_id);
1057 
1058 
1059  $po->setDuration((int)$_POST['duration']);
1060  $po->setUnlimitedDuration($_POST['unlimited_duration']);
1061  $po->setPrice($_POST['price']);
1062  $po->setPriceType($_POST['price_type']);
1063  $po->setCurrency($old_price['currency']);
1064  $po->setExtension((int)$_POST['extension']);
1065 
1066  if(!$po->validate())
1067  {
1068  $error = true;
1069  }
1070  if($error)
1071  {
1072  ilUtil::sendInfo($this->lng->txt('paya_insert_only_numbers'));
1073 
1074  $this->editPrices();
1075  return false;
1076  }
1077 
1078  foreach($_POST['prices'] as $price_id => $price)
1079  {
1080  $old_price = $po->getPrice($price_id);
1081  if(isset($_POST['duration_ids']))
1082  {
1083 // $search = in_array((string)$price_id, $_POST['duration_ids']);
1084  if($_POST['duration_ids'] == NULL)
1085  {
1086  $po->setUnlimitedDuration(0);
1087  $po->setDuration($price['duration']);
1088  }
1089 
1090  else if($search = in_array((string)$price_id, $_POST['duration_ids']))
1091  {
1092  $po->setUnlimitedDuration(1);
1093  $po->setDuration(0);
1094  }
1095  else
1096  {
1097  $po->setUnlimitedDuration(0);
1098  }
1099  }
1100 
1101  if(isset($_POST['extension_ids']))
1102  {
1103 // $search = in_array((string)$price_id, $_POST['extension_ids']);
1104  if($search = in_array((string)$price_id, $_POST['extension_ids']))
1105  {
1106  $po->setExtension(1);
1107  }
1108  else
1109  {
1110  $po->setExtension(0);
1111  }
1112  }
1113 
1114  $po->setDuration($price['duration']);
1115 
1116  $po->setPrice($price['price']);
1117  $po->setCurrency($old_price['currency']);
1118  $po->update($price_id);
1119  }
1120  ilUtil::sendInfo($this->lng->txt('paya_updated_prices'));
1121  $this->editPrices();
1122 
1123  return true;
1124  }
$_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:

◆ performAddPrice()

ilPaymentObjectGUI::performAddPrice ( )

Definition at line 883 of file class.ilPaymentObjectGUI.php.

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

884  {
885  if(!(int)$_GET['pobject_id'])
886  {
887  ilUtil::sendInfo($this->lng->txt('paya_no_object_selected'));
888 
889  $this->showObjects();
890  return true;
891  }
892 
893  include_once './Services/Payment/classes/class.ilPaymentPrices.php';
894  include_once './Services/Payment/classes/class.ilPaymentCurrency.php';
895 
897 
898  $po = new ilPaymentPrices((int)$_GET['pobject_id']);
899 
900  switch($_POST['price_type'])
901  {
902  case 'unlimited_duration':
903  $po->setPriceType(ilPaymentPrices::TYPE_UNLIMITED_DURATION);
904  $po->setDuration(0);
905  $po->setDurationFrom(NULL);
906  $po->setDurationUntil(NULL);
907  $po->setUnlimitedDuration(1);
908 
909  break;
910 
911  case 'duration_date':
912 
913  $po->setPriceType(ilPaymentPrices::TYPE_DURATION_DATE);
914  $po->setDuration(NULL);
915  $po->setDurationFrom(ilUtil::stripSlashes(
916  $_POST['duration_date_from']['date']['y'] . '-' .
917  $_POST['duration_date_from']['date']['m'] . '-' .
918  $_POST['duration_date_from']['date']['d']));
919  $po->setDurationUntil(ilUtil::stripSlashes(
920  $_POST['duration_date_until']['date']['y'] . '-' .
921  $_POST['duration_date_until']['date']['m'] . '-' .
922  $_POST['duration_date_until']['date']['d']));
923  break;
924 
925  default:
926  case 'duration_month':
927  $po->setPriceType(ilPaymentPrices::TYPE_DURATION_MONTH);
928  $po->setDuration($_POST['duration_month']);
929  $po->setDurationFrom(NULL);
930  $po->setDurationUntil(NULL);
931  break;
932  }
933 
934  $po->setDescription($_POST['description'] ? ilUtil::stripSlashes($_POST['description']) : NULL);
935  $po->setPrice(ilUtil::stripSlashes($_POST['price']));
936  $po->setCurrency($currency[1]['currency_id']);
937 
938  if($_POST['extension_price'])
939  {
940  $po->setExtension(1);
941  }
942  else
943  {
944  $po->setExtension(0);
945  }
946 
947  try
948  {
949  $po->validate();
950  $po->add();
951  ilUtil::sendInfo($this->lng->txt('paya_added_new_price'));
952 
953  return $this->editPrices();
954 
955  }
956  catch(ilShopException $e)
957  {
958  ilUtil::sendInfo($e->getMessage());
959  return $this->addPrice();
960  }
961 
962  }
$_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:

◆ performDelete()

ilPaymentObjectGUI::performDelete ( )

Definition at line 521 of file class.ilPaymentObjectGUI.php.

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

522  {
523  include_once './Services/Payment/classes/class.ilPaymentPrices.php';
524 
525  if(!$_GET['pobject_id'])
526  {
527  ilUtil::sendInfo($this->lng->txt('paya_no_object_selected'));
528 
529  $this->showObjects();
530  return true;
531  }
532  $this->__initPaymentObject((int)$_GET['pobject_id']);
533 
534  // delete object data
535  $this->pobject->delete();
536 
537  // delete payment prices
538  $price_obj = new ilPaymentPrices((int)$_GET['pobject_id']);
539  $price_obj->deleteAllPrices();
540  unset($price_obj);
541 
542  ilUtil::sendInfo($this->lng->txt('paya_deleted_object'));
543 
544  $this->showObjects();
545 
546  return true;
547  }
__initPaymentObject($a_pobject_id=0)
$_GET["client_id"]
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
+ Here is the call graph for this function:

◆ performDeletePrice()

ilPaymentObjectGUI::performDeletePrice ( )

Definition at line 964 of file class.ilPaymentObjectGUI.php.

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

965  {
966  if(!$_GET['pobject_id'])
967  {
968  ilUtil::sendInfo($this->lng->txt('paya_no_object_selected'));
969 
970  $this->showObjects();
971  return true;
972  }
973 
974  if(!count($_SESSION['price_ids']))
975  {
976  ilUtil::sendInfo($this->lng->txt('paya_no_prices_selected'));
977 
978  $this->editPrices();
979  return true;
980  }
981  include_once './Services/Payment/classes/class.ilPaymentPrices.php';
982 
983  $prices = new ilPaymentPrices((int)$_GET['pobject_id']);
984 
985  foreach($_SESSION['price_ids'] as $price_id)
986  {
987  $prices->delete($price_id);
988  }
989 
990  // check if it was last price otherwise set status to 'not_buyable'
991  if(!count($prices->getPrices()))
992  {
993  $this->__initPaymentObject((int)$_GET['pobject_id']);
994 
995  $this->pobject->setStatus($this->pobject->STATUS_NOT_BUYABLE);
996  $this->pobject->update();
997 
998  ilUtil::sendInfo($this->lng->txt('paya_deleted_last_price'));
999  }
1000  unset($prices);
1001  unset($_SESSION['price_ids']);
1002 
1003  return $this->editPrices();
1004  }
< 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']
__initPaymentObject($a_pobject_id=0)
$_GET["client_id"]
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
+ Here is the call graph for this function:

◆ resetObjectFilter()

ilPaymentObjectGUI::resetObjectFilter ( )

Definition at line 125 of file class.ilPaymentObjectGUI.php.

References $_GET, $_POST, $_SESSION, $data, __getStatus(), __initPaymentObject(), __showObjectsTable(), ilPaymentObject\_checkExcSubtype(), ilShopUtils\_formatVAT(), ilPaymentBookings\_getCountBookingsByObject(), ilPaymentSettings\_getInstance(), ilShopTopics\_getInstance(), ilPaymentObject\_getObjectsData(), ilObject\_isInTrash(), ilUtil\getImagePath(), ilObjectFactory\getInstanceByObjId(), ilObjectFactory\getInstanceByRefId(), ilPayMethods\getStringByPaymethod(), ilUtil\sendInfo(), ilCheckboxInputGUI\setChecked(), ilSelectInputGUI\setOptions(), ilRadioOption\setValue(), and ilNonEditableValueGUI\setValue().

126  {
127  unset($_SESSION['pay_objects']);
128  unset($_POST['title_type']);
129  unset($_POST['title_value']);
130  unset($_POST['vendor']);
131  unset($_POST['pay_method']);
132  unset($_POST['updateView']);
133  unset($_POST['show_filter']);
134 
135  ilUtil::sendInfo($this->lng->txt('paya_filter_reseted'));
136 
137  return $this->showObjects();
138  }
< 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:

◆ showSelectedObject()

ilPaymentObjectGUI::showSelectedObject ( )

Definition at line 1245 of file class.ilPaymentObjectGUI.php.

References $_GET, ilUtil\getImagePath(), ilObjectFactory\getInstanceByRefId(), ilUtil\sendInfo(), ilSelectInputGUI\setOptions(), and ilNonEditableValueGUI\setValue().

Referenced by addObject().

1246  {
1247  global $ilToolbar;
1248 
1249  if(!(int)$_GET['sell_id'])
1250  {
1251  ilUtil::sendInfo($this->lng->txt('paya_no_object_selected'));
1252  return $this->showObjectSelector();
1253  }
1254 
1255  $ilToolbar->addButton($this->lng->txt('back'), $this->ctrl->getLinkTarget($this, 'showObjectSelector'));
1256 
1257  // save ref_id of selected object
1258  $this->ctrl->setParameter($this, 'sell_id', (int)$_GET['sell_id']);
1259 
1260  include_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
1261  $oForm = new ilPropertyFormGUI();
1262  $oForm->setFormAction($this->ctrl->getFormAction($this, 'updateDetails'));
1263  $oForm->setTitle($this->lng->txt('details'));
1264  $oForm->setTitleIcon(ilUtil::getImagePath('icon_pays.png', false));
1265 
1266  $tmp_obj = ilObjectFactory::getInstanceByRefId($_GET['sell_id'], false);
1267  if(is_object($tmp_obj))
1268  {
1269  $tmp_object['title'] = $tmp_obj->getTitle();
1270  $tmp_object['description'] = $tmp_obj->getDescription();
1271  $tmp_object['owner'] = $tmp_obj->getOwnerName();
1272  $tmp_object['path'] = $this->__getHTMLPath((int)$_GET['sell_id']);
1273  }
1274  else
1275  {
1276  $tmp_object['title'] = $this->lng->txt('object_not_found');
1277  $tmp_object['description'] = '';
1278  $tmp_object['owner'] = '';
1279  $tmp_object['path'] = '';
1280  }
1281 
1282  // title
1283  $oTitleGUI = new ilNonEditableValueGUI($this->lng->txt('title'));
1284  $oTitleGUI->setValue($tmp_object['title']);
1285  $oForm->addItem($oTitleGUI);
1286 
1287  // description
1288  $oDescriptionGUI = new ilNonEditableValueGUI($this->lng->txt('description'));
1289  $oDescriptionGUI->setValue($tmp_object['description']);
1290  $oForm->addItem($oDescriptionGUI);
1291 
1292  // owner
1293  $oOwnerGUI = new ilNonEditableValueGUI($this->lng->txt('owner'));
1294  $oOwnerGUI->setValue($tmp_object['owner']);
1295  $oForm->addItem($oOwnerGUI);
1296 
1297  // repository path
1298  $oPathGUI = new ilNonEditableValueGUI($this->lng->txt('path'));
1299  $oPathGUI->setValue($tmp_object['path']);
1300  $oForm->addItem($oPathGUI);
1301 
1302  // vendors
1303  $oVendorsGUI = new ilSelectInputGUI($this->lng->txt('paya_vendor'), 'vendor');
1304  $oVendorsGUI->setOptions($this->__getVendors());
1305  $oForm->addItem($oVendorsGUI);
1306 
1307  // buttons
1308  $oForm->addCommandButton('addObject', $this->lng->txt('next'));
1309  $oForm->addCommandButton('showObjects', $this->lng->txt('cancel'));
1310 
1311  $this->tpl->setVariable('ADM_CONTENT', $oForm->getHTML());
1312  return true;
1313  }
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 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)
setOptions($a_options)
Set Options.
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:

◆ updateDetails()

ilPaymentObjectGUI::updateDetails ( )

Definition at line 1126 of file class.ilPaymentObjectGUI.php.

References $_GET, $_POST, __initPaymentObject(), ilPaymentShoppingCart\_deleteShoppingCartEntries(), ilFileDataShop\assignFileToPaymentObject(), ilFileDataShop\deassignFileFromPaymentObject(), and ilUtil\sendInfo().

1127  {
1128  if(!$_GET['pobject_id'])
1129  {
1130  ilUtil::sendInfo($this->lng->txt('paya_no_object_selected'));
1131 
1132  $this->showObjects();
1133  return true;
1134  }
1135  $this->__initPaymentObject((int)$_GET['pobject_id']);
1136  $this->ctrl->setParameter($this, 'pobject_id', (int)$_GET['pobject_id']);
1137 
1138  // read old settings
1139  $old_status = $this->pobject->getStatus();
1140 
1141  // check status changed from not_buyable
1142  if($old_status == $this->pobject->STATUS_NOT_BUYABLE and
1143  (int)$_POST['status'] != $old_status
1144  )
1145  {
1146  // check pay_method edited
1147  switch((int)$_POST['pay_method'])
1148  {
1149  case $this->pobject->PAY_METHOD_NOT_SPECIFIED:
1150  ilUtil::sendInfo($this->lng->txt('paya_select_pay_method_first'));
1151  $this->editDetails();
1152 
1153  return false;
1154 
1155  default:
1156  ;
1157  }
1158  // check minimum one price
1159  include_once './Services/Payment/classes/class.ilPaymentPrices.php';
1160 
1161  $prices_obj = new ilPaymentPrices((int)$_GET['pobject_id']);
1162  if(!count($prices_obj->getPrices()))
1163  {
1164  ilUtil::sendInfo($this->lng->txt('paya_edit_prices_first'));
1165  $this->editDetails();
1166 
1167  return false;
1168  }
1169  }
1170 
1171  if((int)$_POST['status'] == 0)
1172  {
1173  // Status: not buyable -> delete depending shoppingcart entries
1174  include_once './Services/Payment/classes/class.ilPaymentShoppingCart.php';
1175  ilPaymentShoppingCart::_deleteShoppingCartEntries($this->pobject->getPobjectId());
1176  }
1177 
1178  $this->pobject->setStatus((int)$_POST['status']);
1179  $this->pobject->setVendorId((int)$_POST['vendor']);
1180  $this->pobject->setPayMethod((int)$_POST['pay_method']);
1181  $this->pobject->setTopicId((int)$_POST['topic_id']);
1182  $this->pobject->setVatId((int)$_POST['vat_id']);
1183  $this->pobject->setSubtype((string)$_POST['exc_subtype']);
1184  $this->pobject->setSpecial((int)$_POST['is_special']);
1185 
1186  if((int)$_POST['thumbnail_delete'])
1187  {
1188  $oFile = new ilFileDataShop($this->pobject->getPobjectId());
1190  }
1191  else if($_FILES['thumbnail']['tmp_name'] != '')
1192  {
1193  $this->lng->loadLanguageModule('form');
1194  include_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
1195  $oThumbnail = new ilImageFileInputGUI($this->lng->txt('pay_thumbnail'), 'thumbnail');
1196  if($oThumbnail->checkInput())
1197  {
1198  $oFile = new ilFileDataShop($this->pobject->getPobjectId());
1199  if(($oFile->storeUploadedFile($_FILES['thumbnail'])) !== false)
1200  {
1201  $oFile->assignFileToPaymentObject();
1202  }
1203  }
1204  else
1205  {
1206  ilUtil::sendInfo($oThumbnail->getAlert());
1207  return $this->editDetails();
1208  }
1209  }
1210 
1211  $this->pobject->update();
1212 
1213  ilUtil::sendInfo($this->lng->txt('paya_details_updated'));
1214  $this->showObjects();
1215 
1216  return true;
1217  }
__initPaymentObject($a_pobject_id=0)
$_POST['username']
Definition: cron.php:12
$_GET["client_id"]
static _deleteShoppingCartEntries($a_pobject_id)
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
This class represents an image file property in a property form.
This class handles all operations on files in directory data/shop.
+ Here is the call graph for this function:

◆ updatePrice()

ilPaymentObjectGUI::updatePrice ( )

Definition at line 1561 of file class.ilPaymentObjectGUI.php.

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

1562  {
1563  include_once './Services/Payment/classes/class.ilPaymentPrices.php';
1564 
1565  if(!$_GET['pobject_id'] && !$_POST['pobject_id'])
1566  {
1567  ilUtil::sendInfo($this->lng->txt('paya_no_object_selected'));
1568 
1569  $this->showObjects();
1570  return true;
1571  }
1572  if(isset($_GET['pobject_id']))
1573  {
1574  $pobject_id = (int)$_GET['pobject_id'];
1575  }
1576  else
1577  {
1578  $pobject_id = (int)$_POST['pobject_id'];
1579  }
1580 
1581  if(!(int)$_GET['price_id'] && !$_POST['price_id'])
1582  {
1583  ilUtil::sendInfo($this->lng->txt('payment_no_price_selected'));
1584  return $this->editPrices();
1585  }
1586  if(isset($_GET['price_id']))
1587  {
1588  $price_id = (int)$_GET['price_id'];
1589  }
1590  else
1591  {
1592  $price_id = (int)$_POST['price_id'];
1593  }
1594 
1595  $po = new ilPaymentPrices((int)$pobject_id);
1596  switch($_POST['price_type'])
1597  {
1599  $po->setPriceType(ilPaymentPrices::TYPE_UNLIMITED_DURATION);
1600  $po->setDuration(NULL);
1601  $po->setDurationFrom(NULL);
1602  $po->setDurationUntil(NULL);
1603  $po->setUnlimitedDuration(1);
1604 
1605  break;
1606 
1608 
1609  $po->setPriceType(ilPaymentPrices::TYPE_DURATION_DATE);
1610  $po->setDuration(NULL);
1611  $po->setDurationFrom(ilUtil::stripSlashes(
1612  $_POST['duration_date_from']['date']['y'] . '-' .
1613  $_POST['duration_date_from']['date']['m'] . '-' .
1614  $_POST['duration_date_from']['date']['d']));
1615  $po->setDurationUntil(ilUtil::stripSlashes(
1616  $_POST['duration_date_until']['date']['y'] . '-' .
1617  $_POST['duration_date_until']['date']['m'] . '-' .
1618  $_POST['duration_date_until']['date']['d']));
1619  break;
1620 
1621  default:
1623  $po->setPriceType(ilPaymentPrices::TYPE_DURATION_MONTH);
1624  $po->setDuration($_POST['duration_month']);
1625  $po->setDurationFrom(NULL);
1626  $po->setDurationUntil(NULL);
1627  break;
1628  }
1629 
1630  $po->setDescription($_POST['description'] ? ilUtil::stripSlashes($_POST['description']) : NULL);
1631  $po->setPrice(ilUtil::stripSlashes($_POST['price']));
1632  $po->setCurrency(ilUtil::stripSlashes($_POST['currency']));
1633  if($_POST['extension'])
1634  {
1635  $po->setExtension(1);
1636  }
1637  else
1638  {
1639  $po->setExtension(0);
1640  }
1641  try
1642  {
1643  $po->validate();
1644  $po->update($price_id);
1645  ilUtil::sendInfo($this->lng->txt('paya_updated_price'));
1646  return $this->editPrices();
1647  }
1648  catch(ilShopException $e)
1649  {
1650  ilUtil::sendInfo($e->getMessage());
1651  return $this->editPrices();
1652  }
1653  }
$_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:

Field Documentation

◆ $ctrl

ilPaymentObjectGUI::$ctrl

Definition at line 23 of file class.ilPaymentObjectGUI.php.

◆ $lng

ilPaymentObjectGUI::$lng

Definition at line 25 of file class.ilPaymentObjectGUI.php.

◆ $pobject

ilPaymentObjectGUI::$pobject = null

Definition at line 29 of file class.ilPaymentObjectGUI.php.

◆ $user_obj

ilPaymentObjectGUI::$user_obj

Definition at line 27 of file class.ilPaymentObjectGUI.php.

Referenced by __construct().


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