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

Public Member Functions

 __construct ($user_obj)
 
 executeCommand ()
 
 resetFilter ()
 
 showStatistics ()
 
 excelExport ()
 
 addStatisticWorksheet ($pewa)
 
 editStatistic ($a_show_confirm_delete=false)
 
 updateStatistic ()
 
 deleteStatistic ()
 
 performDelete ()
 
 showObjectSelector ()
 
 searchUser ()
 
 performSearch ()
 
 addCustomer ()
 
 __showStatisticTable ($a_result_set)
 
 __initBookingObject ()
 
 __search ($a_search_string)
 
 __showSearchUserTable ($a_result_set)
 
 performDeleteDeassignCrs ()
 
- Public Member Functions inherited from ilShopBaseGUI
 __construct ()
 

Data Fields

 $booking_obj = null
 

Protected Member Functions

 prepareOutput ()
 
- Protected Member Functions inherited from ilShopBaseGUI
 prepareOutput ()
 
 addPager ($result)
 

Private Attributes

 $pobject = null
 

Additional Inherited Members

- Protected Attributes inherited from ilShopBaseGUI
 $ctrl = null
 
 $lng = null
 
 $tpl = null
 
 $settings = null
 

Detailed Description

Definition at line 22 of file class.ilPaymentStatisticGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilPaymentStatisticGUI::__construct (   $user_obj)

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

28 {
29 parent::__construct();
30
31 $this->ctrl->saveParameter($this, 'baseClass');
32
33 $this->user_obj = $user_obj;
34 $this->pobject = new ilPaymentObject($this->user_obj);
35
36 }

Member Function Documentation

◆ __initBookingObject()

ilPaymentStatisticGUI::__initBookingObject ( )

Definition at line 1171 of file class.ilPaymentStatisticGUI.php.

1172 {
1173 include_once './Services/Payment/classes/class.ilPaymentBookings.php';
1174
1175 $this->booking_obj = new ilPaymentBookings($this->user_obj->getId());
1176 }

Referenced by addStatisticWorksheet(), editStatistic(), performDelete(), performDeleteDeassignCrs(), showStatistics(), and updateStatistic().

+ Here is the caller graph for this function:

◆ __search()

ilPaymentStatisticGUI::__search (   $a_search_string)

Definition at line 1178 of file class.ilPaymentStatisticGUI.php.

1179 {
1180 include_once("./Services/Search/classes/class.ilSearch.php");
1181
1182 $this->lng->loadLanguageModule("content");
1183
1184 $search = new ilSearch($this->user_obj->getId());
1185 $search->setPerformUpdate(false);
1186 $search->setSearchString(ilUtil::stripSlashes($a_search_string));
1187 $search->setCombination("and");
1188 $search->setSearchFor(array(0 => 'usr'));
1189 $search->setSearchType('new');
1190
1191 if($search->validate($message))
1192 {
1193 $search->performSearch();
1194 }
1195 else
1196 {
1197 ilUtil::sendInfo($message,true);
1198 $this->ctrl->redirect($this,"searchUser");
1199 }
1200 return $search->getResultByType('usr');
1201 }
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.

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

Referenced by performSearch().

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

◆ __showSearchUserTable()

ilPaymentStatisticGUI::__showSearchUserTable (   $a_result_set)

Definition at line 1202 of file class.ilPaymentStatisticGUI.php.

1203 {
1204 $this->ctrl->setParameter($this, "sell_id", $_GET["sell_id"]);
1205
1206 $tbl = new ilShopTableGUI($this);
1207 $tbl->setTitle($this->lng->txt("users"));
1208 $tbl->setId('tbl_users_search');
1209 $tbl->setRowTemplate("tpl.shop_users_row.html", "Services/Payment");
1210 $tbl->addColumn('', 'user_id', '1%', true);
1211 $tbl->addColumn($this->lng->txt('login'), 'login', '10%');
1212 $tbl->addColumn($this->lng->txt('firstname'), 'firstname', '10%');
1213 $tbl->addColumn($this->lng->txt('lastname'), 'lastname', '10%');
1214
1215 $tbl->addMultiCommand('addCustomer', $this->lng->txt('add'));
1216 $tbl->setData($a_result_set);
1217
1218 $this->tpl->setVariable('TABLE', $tbl->getHTML());
1219 return true;
1220 }
$_GET["client_id"]
Class ilShopTableGUI.
$tbl
Definition: example_048.php:81

References $_GET, and $tbl.

Referenced by performSearch().

+ Here is the caller graph for this function:

◆ __showStatisticTable()

ilPaymentStatisticGUI::__showStatisticTable (   $a_result_set)

Definition at line 1147 of file class.ilPaymentStatisticGUI.php.

1148 {
1149 $tbl = new ilShopTableGUI($this);
1150 $tbl->setTitle($this->lng->txt("bookings"));
1151 $tbl->setId('tbl_bookings');
1152 $tbl->setRowTemplate("tpl.shop_statistics_row.html", "Services/Payment");
1153
1154 $tbl->addColumn($this->lng->txt('paya_transaction'), 'transaction', '10%');
1155 $tbl->addColumn($this->lng->txt('title'), 'object_title', '10%');
1156 $tbl->addColumn($this->lng->txt('paya_vendor'), 'vendor', '10%');
1157 $tbl->addColumn($this->lng->txt('paya_customer'), 'customer', '10%');
1158 $tbl->addColumn($this->lng->txt('paya_order_date'), 'order_date', '10%');
1159 $tbl->addColumn($this->lng->txt('duration'), 'duration', '10%');
1160 $tbl->addColumn($this->lng->txt('price_a'), 'price', '5%');
1161 $tbl->addColumn($this->lng->txt('paya_coupons_coupon'), 'discount', '5%');
1162 $tbl->addColumn($this->lng->txt('paya_payed_access'), 'payed_access', '5%');
1163 $tbl->addColumn($this->lng->txt('edit'), 'edit', '5%');
1164 $tbl->setData($a_result_set);
1165
1166 $this->tpl->setVariable('TABLE', $tbl->getHTML());
1167
1168 return true;
1169 }

References $tbl.

Referenced by showStatistics().

+ Here is the caller graph for this function:

◆ addCustomer()

ilPaymentStatisticGUI::addCustomer ( )

Definition at line 875 of file class.ilPaymentStatisticGUI.php.

876 {
877 global $ilToolbar,$ilCtrl;
878
879 isset($_POST['sell_id']) ? $sell_id = $_POST['sell_id'] : $sell_id = $_GET['sell_id'];
880 isset($_POST['user_id']) ? $user_id = $_POST['user_id'] : $user_id = $_GET['user_id'];
881
882 $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.main_view.html",'Services/Payment');
883 $ilToolbar->addButton($this->lng->txt('back'), $this->ctrl->getLinkTarget($this, 'searchUser'));
884 $ilCtrl->setParameter($this, "sell_id", $sell_id);
885 $ilCtrl->setParameter($this, "user_id", $user_id);
886
887 $pObjectId = ilPaymentObject::_lookupPobjectId($sell_id);
888 $obj = new ilPaymentObject($this->user_obj, $pObjectId);
889
890 // get obj
891 $tmp_obj = ilObjectFactory::getInstanceByRefId($sell_id, false);
892 if($tmp_obj)
893 {
894 $tmp_object['title'] = $tmp_obj->getTitle();
895 }
896 else
897 {
898 $tmp_object['title'] = $this->lng->txt('object_not_found');
899 }
900
901 // get customer_obj
902 $tmp_user = ilObjectFactory::getInstanceByObjId($user_id);
903 // get vendor_obj
904 $tmp_vendor = ilObjectFactory::getInstanceByObjId($obj->getVendorId());
905
906 $oForm = new ilPropertyFormGUI();
907 $oForm->setFormAction($ilCtrl->getFormAction($this, 'saveCustomer'));
908
909 $oForm->setTitle($this->lng->txt($tmp_user->getFullname().' ['.$tmp_user->getLogin().']'));
910
911 //transaction
912 $oTransaction = new ilTextInputGUI();
913 $oTransaction->setTitle($this->lng->txt('paya_transaction'));
914 $oTransaction->setValue(ilUtil::prepareFormOutput($_POST['transaction'], true));
915 $oTransaction->setPostVar('transaction');
916 $oForm->addItem($oTransaction);
917
918 //object
919 $oObject = new ilNonEditableValueGUI($this->lng->txt('title'));
920 $oObject->setValue($tmp_obj->getTitle());
921 $oForm->addItem($oObject);
922
923 //vendor
924 $oVendor = new ilNonEditableValueGUI($this->lng->txt('paya_vendor'));
925 $oVendor->setValue($tmp_vendor->getFullname().' ['.$tmp_vendor->getLogin().']');
926 $oForm->addItem($oVendor);
927
928 // pay methods
929 $oPayMethods = new ilSelectInputGUI($this->lng->txt('paya_pay_method'), 'pay_method');
930 $payOptions = ilPayMethods::getPayMethodsOptions(false);
931
932 $oPayMethods->setOptions($payOptions);
933 $oPayMethods->setValue($_POST['pay_method']);
934 $oPayMethods->setPostVar('pay_method');
935 $oForm->addItem($oPayMethods);
936
937 //duration
938 $duration_options = array();
939 $price_obj = new ilPaymentPrices($pObjectId);
940
941 $standard_prices = array();
942 $extension_prices = array();
943 $standard_prices = $price_obj->getPrices();
944 $extension_prices = $price_obj->getExtensionPrices();
945
946 $prices = array_merge($standard_prices, $extension_prices );
947
948 if (is_array($prices))
949 {
951 $currency_unit = $genSet->get('currency_unit');
952
953 foreach($prices as $price)
954 {
955 switch($price['price_type'])
956 {
958 $txt_duration =
959 $price['duration'].' '.$this->lng->txt('paya_months').' -> '.$price['price'].' '. $currency_unit;
960 break;
961
963 include_once './Services/Calendar/classes/class.ilDatePresentation.php';
964 $txt_duration =
965 ilDatePresentation::formatDate(new ilDate($price['duration_from'], IL_CAL_DATE))
966 .' - '.ilDatePresentation::formatDate(new ilDate($price['duration_until'], IL_CAL_DATE))
967 ." -> ".ilPaymentPrices::_getPriceString($price["price_id"]) .' '.$currency_unit;
968 break;
969
971 $txt_duration = $this->lng->txt('unlimited_duration').' -> '.$price['price'].' '. $currency_unit;
972 break;
973 }
974 $txt_extension = '';
975 if($price['extension'] == 1)
976 {
977 $txt_extension = ' ('.$this->lng->txt('extension_price').') ';
978 }
979 $duration_options[$price['price_id']] = $txt_duration.''.$txt_extension;
980 }
981 }
982
983 $oDuration = new ilSelectInputGUI($this->lng->txt('duration'), 'duration');
984 $oDuration->setOptions($duration_options);
985 $oDuration->setValue($_POST['duration']);
986 $oForm->addItem($oDuration);
987
988 //payed
989 $o_payed = new ilSelectInputGUI();
990 $payed_option = array('1'=>$this->lng->txt('yes'),'0'=>$this->lng->txt('no'));
991
992 $o_payed->setTitle($this->lng->txt('paya_payed'));
993 $o_payed->setOptions($payed_option);
994 $o_payed->setValue($_POST['payed']);
995 $o_payed->setPostVar('payed');
996 $oForm->addItem($o_payed);
997
998 $o_access = new ilSelectInputGUI();
999 $access_option = array('1'=>$this->lng->txt('yes'),'0'=>$this->lng->txt('no'));
1000
1001 $o_access->setTitle($this->lng->txt('paya_access'));
1002 $o_access->setOptions($access_option);
1003 $o_access->setValue($_POST['access']);
1004 $o_access->setPostVar('access');
1005 $oForm->addItem($o_access);
1006
1007 $oForm->addCommandButton('saveCustomer',$this->lng->txt('save'));
1008 $oForm->addCommandButton('showStatistics', $this->lng->txt('cancel'));
1009
1010 $this->tpl->setVariable('FORM', $oForm->getHTML());
1011 }
const IL_CAL_DATE
static formatDate(ilDateTime $date)
Format a date @access public.
Class for single dates.
This class represents a non editable value in a property form.
getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
getInstanceByRefId($a_ref_id, $stop_on_error=true)
get an instance of an Ilias object by reference id
static getPayMethodsOptions($type=0)
static _lookupPobjectId($a_ref_id)
static _getPriceString($a_price_id)
This class represents a property form user interface.
This class represents a selection list property in a property form.
This class represents a text property in a property form.
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms @access public
$_POST['username']
Definition: cron.php:12
global $ilCtrl
Definition: ilias.php:18

References $_GET, $_POST, $ilCtrl, ilPaymentSettings\_getInstance(), ilPaymentPrices\_getPriceString(), ilPaymentObject\_lookupPobjectId(), ilDatePresentation\formatDate(), ilObjectFactory\getInstanceByObjId(), ilObjectFactory\getInstanceByRefId(), ilPayMethods\getPayMethodsOptions(), IL_CAL_DATE, ilUtil\prepareFormOutput(), ilPaymentPrices\TYPE_DURATION_DATE, ilPaymentPrices\TYPE_DURATION_MONTH, and ilPaymentPrices\TYPE_UNLIMITED_DURATION.

+ Here is the call graph for this function:

◆ addStatisticWorksheet()

ilPaymentStatisticGUI::addStatisticWorksheet (   $pewa)

Definition at line 385 of file class.ilPaymentStatisticGUI.php.

386 {
387 include_once './Services/Payment/classes/class.ilPaymentVendors.php';
388
389 $this->__initBookingObject();
390
391 $workbook = $pewa->getWorkbook();
392 $worksheet = $workbook->addWorksheet($this->lng->txt('bookings'));
393
394 $worksheet->mergeCells(0,0,0,8);
395 $worksheet->setColumn(0,0,16);
396 $worksheet->setColumn(0,1,32);
397 $worksheet->setColumn(0,2,32);
398 $worksheet->setColumn(0,3,16);
399 $worksheet->setColumn(0,4,16);
400 $worksheet->setColumn(0,5,16);
401 $worksheet->setColumn(0,6,24);
402 $worksheet->setColumn(0,7,8);
403 $worksheet->setColumn(0,8,12);
404 $worksheet->setColumn(0,9,16);
405
406 $title = $this->lng->txt('bookings');
407 $title .= ' '.$this->lng->txt('as_of');
408 $title .= strftime('%Y-%m-%d %R',time());
409
410 $worksheet->writeString(0,0,$title,$pewa->getFormatTitle());
411
412 $worksheet->writeString(1,0,$this->lng->txt('payment_system'),$pewa->getFormatHeader());
413 $worksheet->writeString(1,1,$this->lng->txt('paya_transaction'),$pewa->getFormatHeader());
414 $worksheet->writeString(1,2,$this->lng->txt('title'),$pewa->getFormatHeader());
415 $worksheet->writeString(1,3,$this->lng->txt('paya_vendor'),$pewa->getFormatHeader());
416 $worksheet->writeString(1,4,$this->lng->txt('pays_cost_center'),$pewa->getFormatHeader());
417 $worksheet->writeString(1,5,$this->lng->txt('paya_customer'),$pewa->getFormatHeader());
418 $worksheet->writeString(1,6,$this->lng->txt('paya_order_date'),$pewa->getFormatHeader());
419 $worksheet->writeString(1,7,$this->lng->txt('duration'),$pewa->getFormatHeader());
420 $worksheet->writeString(1,8,$this->lng->txt('price_a'),$pewa->getFormatHeader());
421 $worksheet->writeString(1,9,$this->lng->txt('paya_payed_access'),$pewa->getFormatHeader());
422
423 if(!count($bookings = $this->booking_obj->getBookings()))
424 {
425 return false;
426 }
427
428 include_once 'Services/User/classes/class.ilObjUser.php';
429 $object_title_cache = array();
430 $user_title_cache = array();
431
432 $counter = 2;
433 foreach($bookings as $booking)
434 {
435 if(array_key_exists($booking['ref_id'], $object_title_cache))
436 {
437 $tmp_obj = $object_title_cache[$booking['ref_id']];
438 }
439 else
440 {
441 $tmp_obj = ilObject::_lookupTitle(ilObject::_lookupObjId($booking['ref_id']));
442 $object_title_cache[$booking['ref_id']] = $tmp_obj;
443 }
444 if(array_key_exists($booking['b_vendor_id'], $user_title_cache))
445 {
446 $tmp_vendor = $user_title_cache[$booking['b_vendor_id']];
447 }
448 else
449 {
450 $tmp_vendor = ilObjUser::_lookupLogin($booking['b_vendor_id']);
451 $user_title_cache[$booking['b_vendor_id']] = $tmp_vendor;
452 }
453 if(array_key_exists($booking['customer_id'], $user_title_cache))
454 {
455 $tmp_purchaser = $user_title_cache[$booking['customer_id']];
456 }
457 else
458 {
459 $tmp_purchaser = ilObjUser::_lookupLogin($booking['customer_id']);
460 $user_title_cache[$booking['customer_id']] = $tmp_purchaser;
461 }
462
463 $pay_method = ilPayMethods::getStringByPaymethod($booking['b_pay_method']);
464
465 $worksheet->writeString($counter,0,$pay_method);
466 $worksheet->writeString($counter,1,$booking['transaction_extern']);
467 $worksheet->writeString($counter,2,($tmp_obj != '' ? $tmp_obj : $this->lng->txt('object_deleted')));
468 $worksheet->writeString($counter,3,($tmp_vendor != '' ? $tmp_vendor : $this->lng->txt('user_deleted')));
469 $worksheet->writeString($counter,4,ilPaymentVendors::_getCostCenter($booking['b_vendor_id']));
470 $worksheet->writeString($counter,5,($tmp_purchaser != '' ? $tmp_purchaser : $this->lng->txt('user_deleted')));
471 $worksheet->writeString($counter,6,strftime('%Y-%m-%d %R',$booking['order_date']));
472 $worksheet->writeString($counter,7,$booking['duration']);
473 $worksheet->writeString($counter,8,$booking['price']);
474
475 $payed_access = $booking['payed'] ?
476 $this->lng->txt('yes') :
477 $this->lng->txt('no');
478
479 $payed_access .= '/';
480 $payed_access .= $booking['access_granted'] ?
481 $this->lng->txt('yes') :
482 $this->lng->txt('no');
483
484 $worksheet->writeString($counter,9,$payed_access);
485
486 unset($tmp_obj);
487 unset($tmp_vendor);
488 unset($tmp_purchaser);
489
490 ++$counter;
491 }
492 }
static _lookupLogin($a_user_id)
lookup login
static _lookupObjId($a_id)
static _lookupTitle($a_id)
lookup object title
static getStringByPaymethod($a_type)

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

Referenced by excelExport().

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

◆ deleteStatistic()

ilPaymentStatisticGUI::deleteStatistic ( )

Definition at line 725 of file class.ilPaymentStatisticGUI.php.

726 {
727 if(!isset($_GET['booking_id']))
728 {
729 ilUtil::sendInfo($this->lng->txt('paya_no_booking_id_given'));
730 $this->showStatistics();
731
732 return true;
733 }
734
735 $this->editStatistic(true);
736
737 return true;
738 }
editStatistic($a_show_confirm_delete=false)

References $_GET, editStatistic(), ilUtil\sendInfo(), and showStatistics().

+ Here is the call graph for this function:

◆ editStatistic()

ilPaymentStatisticGUI::editStatistic (   $a_show_confirm_delete = false)

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

495 {
496 global $ilToolbar;
497
498 if(!isset($_GET['booking_id']))
499 {
500 ilUtil::sendInfo($this->lng->txt('paya_no_booking_id_given'));
501 $this->showStatistics();
502
503 return true;
504 }
505
506 include_once './Services/Utilities/classes/class.ilConfirmationGUI.php';
507 $ilToolbar->addButton($this->lng->txt('back'), $this->ctrl->getLinkTarget($this, 'showStatistics'));
508
509 $this->tpl->addBlockfile('ADM_CONTENT','adm_content','tpl.main_view.html','Services/Payment');
510
511 $this->ctrl->setParameter($this,'booking_id',(int) $_GET['booking_id']);
512 $this->__initBookingObject();
513 $bookings = $this->booking_obj->getBookings();
514 $booking = $bookings[(int) $_GET['booking_id']];
515
516 // confirm delete
517 if($a_show_confirm_delete)
518 {
519 $pobject_data = ilPaymentObject::_getObjectData($booking['pobject_id']);
520 $tmp_obj = ilObject::_lookupTitle(ilObject::_lookupObjId($pobject_data['ref_id']));
521 $type = ilObject::_lookupType(ilObject::_lookupObjId($pobject_data['ref_id']));
522
523 $oConfirmationGUI = new ilConfirmationGUI();
524
525 // set confirm/cancel commands
526 $oConfirmationGUI->setFormAction($this->ctrl->getFormAction($this,"performDelete"));
527 $oConfirmationGUI->setHeaderText($this->lng->txt("paya_sure_delete_stat"));
528 $oConfirmationGUI->setCancel($this->lng->txt("cancel"), "editStatistic");
529
530 if($type == 'crs')
531 {
532 $oConfirmationGUI->addButton($this->lng->txt("confirm"), "performDeleteDeassignCrs");
533 }
534 else
535 $oConfirmationGUI->setConfirm($this->lng->txt("confirm"), "performDelete");
536
537 $oConfirmationGUI->addItem('booking_id', $_GET['booking_id'], $tmp_obj);
538
539 $this->tpl->setVariable('CONFIRMATION', $oConfirmationGUI->getHTML());
540 return true;
541 }
542
543
544 // get customer_obj
545 $tmp_user = ilObjectFactory::getInstanceByObjId($booking['customer_id'], false);
546 $oForm = new ilPropertyFormGUI();
547 $oForm->setFormAction($this->ctrl->getFormAction($this));
548 $oForm->setId('stat_form');
549 $oForm->setTableWidth('50 %');
550 if(is_object($tmp_user))
551 {
552 $frm_user = $tmp_user->getFullname().' ['.$tmp_user->getLogin().']';
553 }
554 else
555 {
556 $frm_user = $this->lng->txt('user_deleted');
557 }
558 $oForm->setTitle($frm_user);
559
560 $pObj = new ilPaymentObject($this->user_obj, $booking['pobject_id']);
561 $tmp_obj = ilObject::_lookupTitle(ilObject::_lookupObjId($pObj->getRefId()));
562
563 // object_title
564 $oTitleGUI = new ilNonEditableValueGUI($this->lng->txt('title'));
565 $oTitleGUI->setValue($tmp_obj != '' ? $tmp_obj : $this->lng->txt('object_deleted'));
566 $oForm->addItem($oTitleGUI);
567
568 // transaction
569 $oTransactionGUI = new ilNonEditableValueGUI($this->lng->txt('paya_transaction'));
570 $oTransactionGUI->setValue($booking['transaction']);
571 $oForm->addItem($oTransactionGUI);
572
573 //vendor
574 $oVendorGUI = new ilNonEditableValueGUI($this->lng->txt('paya_vendor'));
575 $tmp_vendor = ilObjectFactory::getInstanceByObjId($booking['b_vendor_id'], false);
576 if(is_object($tmp_vendor))
577 {
578 $frm_vendor = $tmp_vendor->getFullname().' ['.$tmp_vendor->getLogin().']';
579 }
580 else
581 {
582 $frm_vendor = $this->lng->txt('user_deleted');
583 }
584 $oVendorGUI->setValue($frm_vendor);
585 $oForm->addItem($oVendorGUI);
586
587 // paymethod
588 $oPaymethodGUI = new ilNonEditableValueGUI($this->lng->txt('paya_pay_method'));
589 $oPaymethodGUI->setValue(ilPayMethods::getStringByPaymethod($booking['b_pay_method']));
590 $oForm->addItem($oPaymethodGUI);
591
592 // order_date
593 $oOrderdateGUI = new ilNonEditableValueGUI($this->lng->txt('paya_order_date'));
594 $oOrderdateGUI->setValue(ilDatePresentation::formatDate(new ilDateTime($booking["order_date"],IL_CAL_UNIX)));
595 $oForm->addItem($oOrderdateGUI);
596
597 // duration
598 $oDurationGUI = new ilNonEditableValueGUI($this->lng->txt('duration'));
599 if(($booking['duration'] == 0) && ($booking['access_enddate'] == NULL))
600 {
601 $frm_duration = $this->lng->txt("unlimited_duration");
602 }
603 else
604 {
605 if($booking['duration'] > 0)
606 {
607 $frm_duration = $booking['duration'].' '.$this->lng->txt('paya_months');
608 }
609 $frm_duration .= ilDatePresentation::formatDate(new ilDate($booking['access_startdate'], IL_CAL_DATETIME))
610 .' - '.ilDatePresentation::formatDate(new ilDate($booking['access_enddate'], IL_CAL_DATETIME));
611 }
612 $oDurationGUI->setValue($frm_duration);
613 $oForm->addItem($oDurationGUI);
614
615 // price
616 $oPriceGUI = new ilNonEditableValueGUI($this->lng->txt('price_a'));
617 $oPriceGUI->setValue($booking['price'].' '.$booking['currency_unit'] );
618 $oForm->addItem($oPriceGUI);
619
620 // payed
621 $oPayedGUI = new ilSelectInputGUI();
622 $payed_option = array(0 => $this->lng->txt('no'),1 => $this->lng->txt('yes'));
623
624 $oPayedGUI->setTitle($this->lng->txt('paya_payed'));
625 $oPayedGUI->setOptions($payed_option);
626 $oPayedGUI->setValue($booking['payed']);
627 $oPayedGUI->setPostVar('payed');
628 $oForm->addItem($oPayedGUI);
629
630 // access
631 $oAccessGUI = new ilSelectInputGUI();
632 $access_option = array(0 => $this->lng->txt('no'),1 => $this->lng->txt('yes'));
633
634 $oAccessGUI->setTitle($this->lng->txt('paya_access'));
635 $oAccessGUI->setOptions($access_option);
636 $oAccessGUI->setValue($booking['access_granted']);
637 $oAccessGUI->setPostVar('access');
638 $oForm->addItem($oAccessGUI);
639
640 $oForm->addCommandButton('updateStatistic',$this->lng->txt('save'));
641 $oForm->addCommandButton('deleteStatistic',$this->lng->txt('delete'));
642
643 $this->tpl->setVariable('FORM',$oForm->getHTML());
644
645
646
647/* //Same output as in ilobjpaymentsettingsgui->statistics
648 // show CUSTOMER_DATA if isset -> setting: save_user_address
649 if(ilPayMethods::isCustomerAddressEnabled($booking['b_pay_method']))
650 {
651 $oForm2 = new ilPropertyFormGUI();
652 $oForm2->setId('cust_form');
653 $oForm2->setTableWidth('50 %');
654 $oForm2->setTitle($frm_user);
655
656 // email
657 $oEmailGUI = new ilNonEditableValueGUI($this->lng->txt('email'));
658 $email = (!isset($tmp_user)) ? $this->lng->txt('user_deleted') : $tmp_user->getEmail();
659 $oEmailGUI->setValue($email);
660 $oForm2->addItem($oEmailGUI);
661
662 // street
663 $oStreetGUI = new ilNonEditableValueGUI($this->lng->txt('street'));
664 $oStreetGUI->setValue($booking['street']);
665 $oForm2->addItem($oStreetGUI);
666
667 // pobox
668 $oPoBoxGUI = new ilNonEditableValueGUI($this->lng->txt('pay_bmf_po_box'));
669 $oPoBoxGUI->setValue($booking['po_box']);
670 $oForm2->addItem($oPoBoxGUI);
671
672 // zipcode
673 $oPoBoxGUI = new ilNonEditableValueGUI($this->lng->txt('zipcode'));
674 $oPoBoxGUI->setValue($booking['zipcode']);
675 $oForm2->addItem($oPoBoxGUI);
676
677 // city
678 $oCityGUI = new ilNonEditableValueGUI($this->lng->txt('city'));
679 $oCityGUI->setValue($booking['city']);
680 $oForm2->addItem($oCityGUI);
681
682 // country
683 $oCountryGUI = new ilNonEditableValueGUI($this->lng->txt('country'));
684 $oCountryGUI->setValue($booking['country']);
685 $oForm2->addItem($oCountryGUI);
686 }
687
688 $this->tpl->setVariable('FORM_2',$oForm2->getHTML());
689*/
690
691 return true;
692 }
const IL_CAL_UNIX
const IL_CAL_DATETIME
Confirmation screen class.
@classDescription Date and time handling
static _lookupType($a_id, $a_reference=false)
lookup object type
static _getObjectData($a_id)

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

Referenced by deleteStatistic().

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

◆ excelExport()

ilPaymentStatisticGUI::excelExport ( )

Definition at line 370 of file class.ilPaymentStatisticGUI.php.

371 {
372 include_once './Services/Payment/classes/class.ilPaymentExcelWriterAdapter.php';
373
374 $pewa = new ilPaymentExcelWriterAdapter('payment_vendors.xls');
375
376 // add/fill worksheet
377 $this->addStatisticWorksheet($pewa);
378
379 // HEADER SENT
380
381 $workbook = $pewa->getWorkbook();
382 @$workbook->close();
383 }

References addStatisticWorksheet().

+ Here is the call graph for this function:

◆ executeCommand()

ilPaymentStatisticGUI::executeCommand ( )

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

49 {
50 $cmd = $this->ctrl->getCmd();
51
52 switch ($this->ctrl->getNextClass($this))
53 {
54 default:
55 if(!$cmd = $this->ctrl->getCmd())
56 {
57 $cmd = 'showStatistics';
58 }
59 $this->prepareOutput();
60 $this->$cmd();
61 break;
62 }
63 }
$cmd
Definition: sahs_server.php:35

References $cmd, and prepareOutput().

+ Here is the call graph for this function:

◆ performDelete()

ilPaymentStatisticGUI::performDelete ( )

Definition at line 740 of file class.ilPaymentStatisticGUI.php.

741 {
742 if(!isset($_GET['booking_id']))
743 {
744 ilUtil::sendInfo($this->lng->txt('paya_no_booking_id_given'));
745 $this->showStatistics();
746
747 return true;
748 }
749
750 $this->__initBookingObject();
751 $this->booking_obj->setBookingId((int) $_GET['booking_id']);
752 if(!$this->booking_obj->delete())
753 {
754 die('Error deleting booking');
755 }
756 ilUtil::sendInfo($this->lng->txt('pay_deleted_booking'));
757
758 $this->showStatistics();
759
760 return true;
761 }

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

+ Here is the call graph for this function:

◆ performDeleteDeassignCrs()

ilPaymentStatisticGUI::performDeleteDeassignCrs ( )

Definition at line 1222 of file class.ilPaymentStatisticGUI.php.

1223 {
1224 include_once './Services/Payment/classes/class.ilShopUtils.php';
1225
1226 if(!isset($_GET['booking_id']))
1227 {
1228 ilUtil::sendInfo($this->lng->txt('paya_no_booking_id_given'));
1229 $this->showStatistics();
1230
1231 return true;
1232 }
1233
1234 $this->__initBookingObject();
1235 $bookings = $this->booking_obj->getBookings();
1236 $booking = $bookings[(int) $_GET['booking_id']];
1237
1238 $pobject_data = ilPaymentObject::_getObjectData($booking['pobject_id']);
1239 ilShopUtils::_deassignPurchasedCourseMemberRole($pobject_data['ref_id'], $booking['customer_id']);
1240
1241 $this->booking_obj->setBookingId((int) $_GET['booking_id']);
1242 if(!$this->booking_obj->delete())
1243 {
1244 die('Error deleting booking');
1245 }
1246 ilUtil::sendInfo($this->lng->txt('pay_deleted_booking'));
1247
1248 $this->showStatistics();
1249
1250 return true;
1251 }
static _deassignPurchasedCourseMemberRole($a_ref_id, $a_user_id)

References $_GET, __initBookingObject(), ilShopUtils\_deassignPurchasedCourseMemberRole(), ilPaymentObject\_getObjectData(), ilUtil\sendInfo(), and showStatistics().

+ Here is the call graph for this function:

◆ performSearch()

ilPaymentStatisticGUI::performSearch ( )

Definition at line 820 of file class.ilPaymentStatisticGUI.php.

821 {
822 global $ilToolbar;
823 // SAVE it to allow sort in tables
824 $_SESSION["pays_search_str_user_sp"] = $_POST["search_str"] = $_POST["search_str"] ? $_POST["search_str"] : $_SESSION["pays_search_str_user_sp"];
825
826
827 if(!trim($_POST["search_str"]))
828 {
829 ilUtil::sendInfo($this->lng->txt("search_no_search_term"));
830 $this->showStatistics();
831
832 return false;
833 }
834 if(!count($result = $this->__search(ilUtil::stripSlashes($_POST["search_str"]))))
835 {
836 ilUtil::sendInfo($this->lng->txt("search_no_match"));
837 $this->searchUser();
838
839 return false;
840 }
841
842 if(!isset($_GET['sell_id']))
843 {
844 ilUtil::sendInfo($this->lng->txt('paya_no_booking_id_given'));
845 $this->showObjectSelector();
846
847 return false;
848 }
849
850 $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.main_view.html",'Services/Payment');
851 $this->ctrl->setParameter($this, "sell_id", $_GET["sell_id"]);
852
853 $ilToolbar->addButton($this->lng->txt('back'), $this->ctrl->getLinkTarget($this, 'searchUser'));
854
855 $counter = 0;
856 $f_result = array();
857 foreach($result as $user)
858 {
859 if(!$tmp_obj = ilObjectFactory::getInstanceByObjId($user["id"],false))
860 {
861 continue;
862 }
863 // $f_result[$counter]['user_id'] = ilUtil::formRadiobutton(0,"user_id",$user["id"]);
864 $f_result[$counter]['user_id'] = $user["id"];
865 $f_result[$counter]['login'] = $tmp_obj->getLogin();
866 $f_result[$counter]['firstname'] = $tmp_obj->getFirstname();
867 $f_result[$counter]['lastname'] = $tmp_obj->getLastname();
868
869 unset($tmp_obj);
870 ++$counter;
871 }
872 $this->__showSearchUserTable($f_result);
873 }
$result
$_SESSION["AccountId"]

References $_GET, $_POST, $_SESSION, $result, __search(), __showSearchUserTable(), ilObjectFactory\getInstanceByObjId(), searchUser(), ilUtil\sendInfo(), showObjectSelector(), showStatistics(), and ilUtil\stripSlashes().

+ Here is the call graph for this function:

◆ prepareOutput()

ilPaymentStatisticGUI::prepareOutput ( )
protected

Reimplemented from ilShopBaseGUI.

Definition at line 38 of file class.ilPaymentStatisticGUI.php.

39 {
40 global $ilTabs;
41
42 parent::prepareOutput();
43
44 $ilTabs->setTabActive('paya_header');
45 $ilTabs->setSubTabActive('bookings');
46 }

Referenced by executeCommand().

+ Here is the caller graph for this function:

◆ resetFilter()

ilPaymentStatisticGUI::resetFilter ( )

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

66 {
67 unset($_SESSION["pay_statistics"]);
68 unset($_POST["transaction_type"]);
69 unset($_POST["transaction_value"]);
70 unset($_POST["from"]["day"]);
71 unset($_POST["from"]["month"]);
72 unset($_POST["from"]["year"]);
73 unset($_POST["til"]["day"]);
74 unset($_POST["til"]["month"]);
75 unset($_POST["til"]["year"]);
76 unset($_POST["payed"]);
77 unset($_POST["access"]);
78 unset($_POST["customer"]);
79 unset($_POST["pay_method"]);
80 unset($_POST["updateView"]);
81 unset($_POST["filter_title_id"]);
82
83 $this->showStatistics();
84 }

References $_POST, $_SESSION, and showStatistics().

Referenced by showStatistics().

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

◆ searchUser()

ilPaymentStatisticGUI::searchUser ( )

Definition at line 782 of file class.ilPaymentStatisticGUI.php.

783 {
784 global $ilToolbar;
785
786 if(!isset($_GET['sell_id']))
787 {
788 ilUtil::sendInfo($this->lng->txt('paya_no_booking_id_given'));
789 $this->showObjectSelector();
790
791 return false;
792 }
793
794 $this->tpl->addBlockFile('ADM_CONTENT','adm_content','tpl.main_view.html','Services/Payment');
795
796 $ilToolbar->addButton($this->lng->txt('back'), $this->ctrl->getLinkTarget($this, 'showObjectSelector'));
797
798 $this->lng->loadLanguageModule('search');
799 $this->ctrl->setParameter($this, "sell_id", $_GET["sell_id"]);
800
801 $form_gui = new ilPropertyFormGUI();
802 $form_gui->setFormAction($this->ctrl->getFormAction($this),'performSearch');
803 $form_gui->setTitle($this->lng->txt('grp_search_members'));
804 $form_gui->setId('search_form');
805
806 $oTitle = new ilTextInputGUI($this->lng->txt('search_search_term'), 'search_str');
807 $oTitle->setMaxLength(255);
808 $oTitle->setSize(40);
809 $oTitle->setValue($_POST['search_str']);
810 $form_gui->addItem($oTitle);
811
812 // buttons
813 $form_gui->addCommandButton('performSearch', $this->lng->txt('search'));
814 $form_gui->addCommandButton('showStatistics', $this->lng->txt('cancel'));
815
816 $this->tpl->setVariable('FORM',$form_gui->getHTML());
817 return true;
818 }

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

Referenced by performSearch().

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

◆ showObjectSelector()

ilPaymentStatisticGUI::showObjectSelector ( )

Definition at line 763 of file class.ilPaymentStatisticGUI.php.

764 {
765 global $ilToolbar;
766
767 $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.paya_object_selector.html",'Services/Payment');
768 $ilToolbar->addButton($this->lng->txt('back'), $this->ctrl->getLinkTarget($this, 'showStatistics'));
769
770 ilUtil::sendInfo($this->lng->txt("paya_select_object_to_sell"));
771
772 $exp = new ilPaymentObjectSelector($this, "showObjectSelector");
773 if (!$exp->handleCommand())
774 {
775 $this->tpl->setVariable("EXPLORER",$exp->getHTML());
776 }
777
778
779 return true;
780 }

References ilUtil\sendInfo().

Referenced by performSearch(), and searchUser().

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

◆ showStatistics()

ilPaymentStatisticGUI::showStatistics ( )

Definition at line 86 of file class.ilPaymentStatisticGUI.php.

87 {
88 global $rbacsystem, $ilToolbar, $ilObjDataCache;
89
90 // MINIMUM ACCESS LEVEL = 'read'
91 /* if(!$rbacsystem->checkAccess('read', $this->getRefId()))
92 {
93 $this->ilias->raiseError($this->lng->txt('msg_no_perm_read'),$this->ilias->error_obj->MESSAGE);
94 }
95 */
96
97
98 $ilToolbar->addButton($this->lng->txt('paya_add_customer'), $this->ctrl->getLinkTarget($this, 'showObjectSelector'));
99 if(!$_POST['show_filter'] && $_POST['updateView'] == '1')
100 {
101 $this->resetFilter();
102 }
103 else
104 if ($_POST['updateView'] == 1)
105 {
106 $_SESSION['pay_statistics']['show_filter']= $_POST['show_filter'];
107 $_SESSION['pay_statistics']['updateView'] = true;
108 $_SESSION['pay_statistics']['until_check'] = $_POST['until_check'];
109 $_SESSION['pay_statistics']['from_check'] = $_POST['from_check'];
110 $_SESSION['pay_statistics']['transaction_type'] = isset($_POST['transaction_type']) ? $_POST['transaction_type'] : '' ;
111 $_SESSION['pay_statistics']['transaction_value'] = isset($_POST['transaction_value']) ? $_POST['transaction_value'] : '';
112 $_SESSION['pay_statistics']['filter_title_id'] = (int)$_POST['filter_title_id'];
113
114 if($_SESSION['pay_statistics']['from_check'] == '1')
115 {
116 $_SESSION['pay_statistics']['from']['date']['d'] = $_POST['from']['date']['d'];
117 $_SESSION['pay_statistics']['from']['date']['m'] = $_POST['from']['date']['m'];
118 $_SESSION['pay_statistics']['from']['date']['y'] = $_POST['from']['date']['y'];
119 }
120 else
121 {
122 $_SESSION['pay_statistics']['from']['date']['d'] = '';
123 $_SESSION['pay_statistics']['from']['date']['m'] = '';
124 $_SESSION['pay_statistics']['from']['date']['y'] = '';
125 }
126
127 if($_SESSION['pay_statistics']['until_check']== '1')
128 {
129 $_SESSION['pay_statistics']['til']['date']['d'] = $_POST['til']['date']['d'];
130 $_SESSION['pay_statistics']['til']['date']['m'] = $_POST['til']['date']['m'];
131 $_SESSION['pay_statistics']['til']['date']['y'] = $_POST['til']['date']['y'];
132 }
133 else
134 {
135 $_SESSION['pay_statistics']['til']['date']['d'] = '';
136 $_SESSION['pay_statistics']['til']['date']['m'] = '';
137 $_SESSION['pay_statistics']['til']['date']['y'] = '';
138 }
139
140 $_SESSION['pay_statistics']['payed'] = $_POST['payed'];
141 $_SESSION['pay_statistics']['access'] = $_POST['access'];
142 $_SESSION['pay_statistics']['pay_method'] = $_POST['pay_method'];
143 $_SESSION['pay_statistics']['customer'] = isset ($_POST['customer']) ? $_POST['customer'] : '';
144 $_SESSION['pay_statistics']['vendor'] = isset ($_POST['vendor']) ? $_POST['vendor']: '';
145 }
146
147 $this->tpl->addBlockfile('ADM_CONTENT','adm_content','tpl.main_view.html','Services/Payment');
148
149 include_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
150 // FILTER FORM
151 $filter_form = new ilPropertyFormGUI();
152 $filter_form->setFormAction($this->ctrl->getFormAction($this));
153 $filter_form->setTitle($this->lng->txt('pay_filter'));
154 $filter_form->setId('formular');
155 $filter_form->setTableWidth('100 %');
156
157
158 $o_hide_check = new ilCheckBoxInputGUI($this->lng->txt('show_filter'),'show_filter');
159 $o_hide_check->setValue(1);
160 $o_hide_check->setChecked($_SESSION['pay_statistics']['show_filter'] ? 1 : 0);
161
162 $o_hidden = new ilHiddenInputGUI('updateView');
163 $o_hidden->setValue(1);
164 $o_hidden->setPostVar('updateView');
165 $o_hide_check->addSubItem($o_hidden);
166
167 $o_transaction_type = new ilSelectInputGUI();
168 $trans_option = array($this->lng->txt('pay_starting'),$this->lng->txt('pay_ending'));
169 $trans_value = array('0','1');
170 $o_transaction_type->setTitle($this->lng->txt('paya_transaction'));
171 $o_transaction_type->setOptions($trans_option);
172 $o_transaction_type->setValue($_SESSION['pay_statistics']['transaction_type']);
173 $o_transaction_type->setPostVar('transaction_type');
174 $o_hide_check->addSubItem($o_transaction_type);
175
176 $o_transaction_val = new ilTextInputGUI();
177 $o_transaction_val->setValue($_SESSION['pay_statistics']['transaction_value']);
178 $o_transaction_val->setPostVar('transaction_value');
179 $o_hide_check->addSubItem($o_transaction_val);
180
181 $o_customer = new ilTextInputGUI();
182 $o_customer->setTitle($this->lng->txt('paya_customer'));
183 $o_customer->setValue($_SESSION['pay_statistics']['customer']);
184 $o_customer->setPostVar('customer');
185 $o_hide_check->addSubItem($o_customer);
186
187 $o_vendor = new ilTextInputGUI();
188 $o_vendor->setTitle($this->lng->txt('paya_vendor'));
189 $o_vendor->setValue($_SESSION['pay_statistics']['vendor']);
190 $o_vendor->setPostVar('vendor');
191 $o_hide_check->addSubItem($o_vendor);
192
193 $o_from_check = new ilCheckBoxInputGUI($this->lng->txt('pay_order_date_from'),'from_check');
194 $o_from_check->setValue(1);
195 $o_from_check->setChecked($_SESSION['pay_statistics']['from_check'] ? 1 : 0);
196
197 $o_date_from = new ilDateTimeInputGUI();
198 $o_date_from->setPostVar('from');
199 $_POST['from'] = $_SESSION['pay_statistics']['from'];
200
201 if($_SESSION['pay_statistics']['from_check'] == '1')
202 {
203 $o_date_from->checkInput();
204 }
205
206 $o_from_check->addSubItem($o_date_from);
207 $o_hide_check->addSubItem($o_from_check);
208
209 $o_until_check = new ilCheckBoxInputGUI($this->lng->txt('pay_order_date_til'), 'until_check');
210 $o_until_check->setValue(1);
211 $o_until_check->setChecked($_SESSION['pay_statistics']['until_check'] ? 1 : 0);
212
213 $o_date_until = new ilDateTimeInputGUI();
214 $o_date_until->setPostVar('til');
215 $_POST['til'] = $_SESSION['pay_statistics']['til'];
216
217 if($_SESSION['pay_statistics']['until_check'] == '1')
218 {
219 $o_date_until->checkInput();
220 }
221
222 $o_until_check->addSubItem($o_date_until);
223 $o_hide_check->addSubItem($o_until_check);
224
225
226 // title filter
227 $this->__initBookingObject();
228 $title_options['all']=$this->lng->txt('pay_all');
229 $unique_titles = $this->booking_obj->getUniqueTitles();
230
231 if(is_array($unique_titles) && count($unique_titles))
232 {
233 foreach($unique_titles as $ref_id)
234 {
235 $title_options[$ref_id] = $ilObjDataCache->lookupTitle($ilObjDataCache->lookupObjId($ref_id));
236 }
237 }
238
239 $o_object_title = new ilSelectInputGUI();
240 $o_object_title->setTitle($this->lng->txt('title'));
241 $o_object_title->setOptions($title_options);
242 $o_object_title->setValue($_SESSION["pay_statistics"]["filter_title_id"]);
243 $o_object_title->setPostVar('filter_title_id');
244 $o_hide_check->addSubItem($o_object_title);
245
246 $o_payed = new ilSelectInputGUI();
247 $payed_option = array('all'=>$this->lng->txt('pay_all'),'1'=>$this->lng->txt('yes'),'0'=>$this->lng->txt('no'));
248
249 $o_payed->setTitle($this->lng->txt('paya_payed'));
250 $o_payed->setOptions($payed_option);
251 $o_payed->setValue($_SESSION['pay_statistics']['payed']);
252 $o_payed->setPostVar('payed');
253
254 $o_hide_check->addSubItem($o_payed);
255
256 $o_access = new ilSelectInputGUI();
257 $access_option = array('all'=>$this->lng->txt('pay_all'),'1'=>$this->lng->txt('yes'),'0'=>$this->lng->txt('no'));
258
259 $o_access->setTitle($this->lng->txt('paya_access'));
260 $o_access->setOptions($access_option);
261 $o_access->setValue($_SESSION['pay_statistics']['access']);
262 $o_access->setPostVar('access');
263 $o_hide_check->addSubItem($o_access);
264
265 $o_paymethod = new ilSelectInputGUI();
266 $o_paymethod->setTitle($this->lng->txt('payment_system'));
267 $o_paymethod->setOptions(ilPayMethods::getPayMethodsOptions('all'));
268 $o_paymethod->setValue($_SESSION['pay_statistics']['pay_method']);
269 $o_paymethod->setPostVar('pay_method');
270 $o_hide_check->addSubItem($o_paymethod);
271
272 $filter_form->addCommandButton('showStatistics', $this->lng->txt('pay_update_view'));
273 $filter_form->addCommandButton('resetFilter', $this->lng->txt('pay_reset_filter'));
274
275 $filter_form->addItem($o_hide_check);
276
277 $this->tpl->setVariable('FORM', $filter_form->getHTML());
278
279
280// STATISTICS TABLE
281 $this->__initBookingObject();
282
283 if(!count($bookings = $this->booking_obj->getBookings()))
284 {
285 ilUtil::sendInfo($this->lng->txt('paya_no_bookings'));
286
287 return true;
288 }
289# $this->__showButton('excelExport',$this->lng->txt('excel_export'));
290
291 include_once 'Services/User/classes/class.ilObjUser.php';
292 $object_title_cache = array();
293 $user_title_cache = array();
294
295 $counter = 0;
296 foreach($bookings as $booking)
297 {
298 if(array_key_exists($booking['ref_id'], $object_title_cache))
299 {
300 $tmp_obj = $object_title_cache[$booking['ref_id']];
301 }
302 else
303 {
304 $tmp_obj = ilObject::_lookupTitle(ilObject::_lookupObjId($booking['ref_id']));
305 $object_title_cache[$booking['ref_id']] = $tmp_obj;
306 }
307 if(array_key_exists($booking['b_vendor_id'], $user_title_cache))
308 {
309 $tmp_vendor = $user_title_cache[$booking['b_vendor_id']];
310 }
311 else
312 {
313 $tmp_vendor = ilObjUser::_lookupLogin($booking['b_vendor_id']);
314 $user_title_cache[$booking['b_vendor_id']] = $tmp_vendor;
315 }
316 if(array_key_exists($booking['customer_id'], $user_title_cache))
317 {
318 $tmp_purchaser = $user_title_cache[$booking['customer_id']];
319 }
320 else
321 {
322 $tmp_purchaser = ilObjUser::_lookupLogin($booking['customer_id']);
323 $user_title_cache[$booking['customer_id']] = $tmp_purchaser;
324 }
325
326 $transaction = $booking['transaction_extern'];
327 $str_paymethod = ilPayMethods::getStringByPaymethod($booking['b_pay_method']);
328 $transaction .= " (" . $str_paymethod . ")";
329
330 $f_result[$counter]['transaction'] = $transaction;
331 $f_result[$counter]['object_title'] = ($tmp_obj != '' ? $tmp_obj : $this->lng->txt('object_deleted'));
332 $f_result[$counter]['vendor'] = ($tmp_vendor != '' ? '['.$tmp_vendor.']' : $this->lng->txt('user_deleted'));
333 $f_result[$counter]['customer'] = ($tmp_purchaser != '' ? '['.$tmp_purchaser.']' : $this->lng->txt('user_deleted'));
334 $f_result[$counter]['order_date'] = ilDatePresentation::formatDate(new ilDateTime($booking['order_date'], IL_CAL_UNIX));
335
336 if($booking['duration'] == 0)
337 {
338 $booking['duration'] = $this->lng->txt('unlimited_duration');
339 }
340
341 $f_result[$counter]['duration'] = $booking['duration'];
342 $f_result[$counter]['price'] = ilFormat::_getLocalMoneyFormat($booking['price']).' '.$booking['currency_unit'];
343 $f_result[$counter]['discount'] = $booking['discount'].' '.$booking['currency_unit'];
344
345 $payed_access = $booking['payed'] ?
346 $this->lng->txt('yes') :
347 $this->lng->txt('no');
348
349 $payed_access .= '/';
350 $payed_access .= $booking['access_granted'] ?
351 $this->lng->txt('yes') :
352 $this->lng->txt('no');
353
354 $f_result[$counter]['payed_access'] = $payed_access;
355
356 $this->ctrl->setParameter($this,"booking_id",$booking['booking_id']);
357 $link_change = "<div class=\"il_ContainerItemCommands\"><a class=\"il_ContainerItemCommand\" href=\"".$this->ctrl->getLinkTarget($this,"editStatistic")."\">".$this->lng->txt("edit")."</a></div>";
358
359 $f_result[$counter]['edit'] = $link_change;
360
361 unset($tmp_obj);
362 unset($tmp_vendor);
363 unset($tmp_purchaser);
364
365 ++$counter;
366 }
367 return $this->__showStatisticTable($f_result);
368 }
This class represents a date/time property in a property form.
static _getLocalMoneyFormat($float_number)
converts a float number to money format, depending on system language
This class represents a hidden form property in a property form.
$ref_id
Definition: sahs_server.php:39

References $_POST, $_SESSION, $ref_id, __initBookingObject(), __showStatisticTable(), ilFormat\_getLocalMoneyFormat(), ilObjUser\_lookupLogin(), ilObject\_lookupObjId(), ilObject\_lookupTitle(), ilDatePresentation\formatDate(), ilPayMethods\getPayMethodsOptions(), ilPayMethods\getStringByPaymethod(), IL_CAL_UNIX, resetFilter(), and ilUtil\sendInfo().

Referenced by deleteStatistic(), editStatistic(), performDelete(), performDeleteDeassignCrs(), performSearch(), resetFilter(), and updateStatistic().

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

◆ updateStatistic()

ilPaymentStatisticGUI::updateStatistic ( )

Definition at line 694 of file class.ilPaymentStatisticGUI.php.

695 {
696 if(!isset($_GET['booking_id']))
697 {
698 ilUtil::sendInfo($this->lng->txt('paya_no_booking_id_given'));
699 $this->showStatistics();
700
701 return true;
702 }
703 $this->__initBookingObject();
704
705 $this->booking_obj->setBookingId((int) $_GET['booking_id']);
706 $this->booking_obj->setAccess((int) $_POST['access']);
707 $this->booking_obj->setPayed((int) $_POST['payed']);
708
709 if($this->booking_obj->update())
710 {
711 ilUtil::sendInfo($this->lng->txt('paya_updated_booking'));
712
713 $this->showStatistics();
714 return true;
715 }
716 else
717 {
718 ilUtil::sendInfo($this->lng->txt('paya_error_update_booking'));
719 $this->showStatistics();
720
721 return true;
722 }
723 }

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

+ Here is the call graph for this function:

Field Documentation

◆ $booking_obj

ilPaymentStatisticGUI::$booking_obj = null

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

◆ $pobject

ilPaymentStatisticGUI::$pobject = null
private

Definition at line 24 of file class.ilPaymentStatisticGUI.php.


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