ILIAS  Release_4_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilShopBoughtObjectsGUI Class Reference

Class ilShopBoughtObjectsGUI. More...

+ Inheritance diagram for ilShopBoughtObjectsGUI:
+ Collaboration diagram for ilShopBoughtObjectsGUI:

Public Member Functions

 __construct ($user_obj)
 executeCommand ()
 showItems ()
- Public Member Functions inherited from ilShopBaseGUI
 __construct ()

Protected Member Functions

 prepareOutput ()
- Protected Member Functions inherited from ilShopBaseGUI
 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= '')

Private Member Functions

 showStatisticTable ($a_result_set)
 initBookingsObject ()

Private Attributes

 $user_obj
 $psc_obj = null

Additional Inherited Members

- Protected Attributes inherited from ilShopBaseGUI
 $ctrl = null
 $ilias = null
 $lng = null
 $tpl = null
 $oGeneralSettings = null
 $section = 0
 $sub_section = 0

Detailed Description

Class ilShopBoughtObjectsGUI.

Author
Michael Jansen mjans.nosp@m.en@d.nosp@m.ataba.nosp@m.y.de
Version
$Id$

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

Constructor & Destructor Documentation

ilShopBoughtObjectsGUI::__construct (   $user_obj)

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

References $user_obj, and ilShopBaseGUI\__construct().

{
$this->user_obj = $user_obj;
}

+ Here is the call graph for this function:

Member Function Documentation

ilShopBoughtObjectsGUI::executeCommand ( )

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

References $cmd, and prepareOutput().

{
global $ilUser;
if(ANONYMOUS_USER_ID == $ilUser->getId())
{
$this->ilias->raiseError($this->lng->txt('permission_denied'), $this->ilias->error_obj->MESSAGE);
}
$cmd = $this->ctrl->getCmd();
switch ($this->ctrl->getNextClass($this))
{
/* nkrzywon
case 'showBillHistory':
$this->$cmd();
break;
*/
default:
$this->prepareOutput();
if(!$cmd = $this->ctrl->getCmd())
{
$cmd = 'showItems';
}
$this->$cmd();
break;
}
}

+ Here is the call graph for this function:

ilShopBoughtObjectsGUI::initBookingsObject ( )
private

Definition at line 511 of file class.ilShopBoughtObjectsGUI.php.

Referenced by showItems().

{
include_once './payment/classes/class.ilPaymentBookings.php';
$this->bookings_obj =& new ilPaymentBookings();
return true;
}

+ Here is the caller graph for this function:

ilShopBoughtObjectsGUI::prepareOutput ( )
protected

Reimplemented from ilShopBaseGUI.

Definition at line 341 of file class.ilShopBoughtObjectsGUI.php.

Referenced by executeCommand().

{
global $ilTabs;
$ilTabs->setTabActive('paya_buyed_objects');
$ilTabs->setSubTabActive('paya_buyed_objects');
}

+ Here is the caller graph for this function:

ilShopBoughtObjectsGUI::showItems ( )

Definition at line 350 of file class.ilShopBoughtObjectsGUI.php.

References ilRepositoryExplorer\buildFrameTarget(), ilRepositoryExplorer\buildLinkTarget(), ilObjectFactory\getInstanceByObjId(), ilObjectFactory\getInstanceByRefId(), initBookingsObject(), PAY_METHOD_BILL, PAY_METHOD_BMF, PAY_METHOD_EPAY, PAY_METHOD_PAYPAL, ilUtil\sendInfo(), and showStatisticTable().

{
include_once "./Services/Repository/classes/class.ilRepositoryExplorer.php";
$this->tpl->addBlockfile('ADM_CONTENT','adm_content','tpl.pay_personal_statistic.html','payment');
if(!count($bookings = $this->bookings_obj->getBookingsOfCustomer($this->user_obj->getId())))
{
ilUtil::sendInfo($this->lng->txt('pay_not_buyed_any_object'));
return true;
}
$counter = 0;
foreach($bookings as $booking)
{
$tmp_obj =& ilObjectFactory::getInstanceByRefId($booking['ref_id'], false);
$tmp_vendor =& ilObjectFactory::getInstanceByObjId($booking['b_vendor_id']);
$tmp_purchaser =& ilObjectFactory::getInstanceByObjId($booking['customer_id']);
$transaction = $booking['transaction'];
switch ($booking['b_pay_method'])
{
$transaction .= " (" . $this->lng->txt("pays_bill") . ")";
break;
$transaction .= " (" . $this->lng->txt("pays_bmf") . ")";
break;
$transaction .= " (" . $this->lng->txt("pays_paypal") . ")";
break;
$transaction .= " (" . $this->lng->txt("pays_epay") . ")";
break;
}
$f_result[$counter][] = $transaction;
if($tmp_object)
{
$obj_link = ilRepositoryExplorer::buildLinkTarget($booking['ref_id'],$tmp_obj->getType());
$obj_target = ilRepositoryExplorer::buildFrameTarget($tmp_obj->getType(),$booking['ref_id'],$tmp_obj->getId());
$f_result[$counter][] = "<a href=\"".$obj_link."\" target=\"".$obj_target."\">".$tmp_obj->getTitle()."</a>";
}
else
{
$obj_link = '';
$obj_target = '';
$f_result[$counter]['object_title'] = $booking['object_title'].'<br> ('.$this->lng->txt('object_deleted').')';
}
/*
if ($tmp_obj->getType() == "crs")
{
$f_result[$counter][] = "<a href=\"" . ILIAS_HTTP_PATH . "/repository.php?ref_id=" .
$booking["ref_id"] . "\">" . $tmp_obj->getTitle() . "</a>";
}
else if ($tmp_obj->getType() == "lm")
{
$f_result[$counter][] = "<a href=\"" . ILIAS_HTTP_PATH . "/content/lm_presentation.php?ref_id=" .
$booking["ref_id"] . "\" target=\"_blank\">" . $tmp_obj->getTitle() . "</a>";
}
else
{
$f_result[$counter][] = $tmp_obj->getTitle();
}
*/
$f_result[$counter][] = '['.$tmp_vendor->getLogin().']';
$f_result[$counter][] = '['.$tmp_purchaser->getLogin().']';
$f_result[$counter][] = date("Y-m-d H:i:s", $booking['order_date']);
if($booking['duration'] != 0)
{
$f_result[$counter][] = $booking['duration'].' '.$this->lng->txt('paya_months');
}
else
{
$f_result[$counter][] = $this->lng->txt("unlimited_duration");
}
$f_result[$counter][] = $booking['price'];
$f_result[$counter][] = ($booking['discount'] != '' ? $booking['discount'] : '&nbsp;');
$payed_access = $booking['payed'] ?
$this->lng->txt('yes') :
$this->lng->txt('no');
$payed_access .= '/';
$payed_access .= $booking['access'] ?
$this->lng->txt('yes') :
$this->lng->txt('no');
$f_result[$counter][] = $payed_access;
unset($tmp_obj);
unset($tmp_vendor);
unset($tmp_purchaser);
++$counter;
}
return $this->showStatisticTable($f_result);
}

+ Here is the call graph for this function:

ilShopBoughtObjectsGUI::showStatisticTable (   $a_result_set)
private

Definition at line 457 of file class.ilShopBoughtObjectsGUI.php.

References $_GET, and ilShopBaseGUI\$tpl.

Referenced by showItems().

{
include_once('Services/Table/classes/class.ilTableGUI.php');
$tbl = new ilTableGUI(array(), false);
$tpl = $tbl->getTemplateObject();
// SET FORMAACTION
$tpl->setCurrentBlock("tbl_form_header");
$tpl->setVariable("FORMACTION",$this->ctrl->getFormAction($this));
$tpl->parseCurrentBlock();
$tbl->setTitle($this->lng->txt("paya_buyed_objects"),"icon_pays_access.gif",$this->lng->txt("bookings"));
$tbl->setHeaderNames(array($this->lng->txt("paya_transaction"),
$this->lng->txt("title"),
$this->lng->txt("paya_vendor"),
$this->lng->txt("paya_customer"),
$this->lng->txt("paya_order_date"),
$this->lng->txt("duration"),
$this->lng->txt("price_a"),
$this->lng->txt("paya_coupons_coupon"),
$this->lng->txt("paya_payed_access")));
$header_params = $this->ctrl->getParameterArray($this,'');
$tbl->setHeaderVars(array("transaction",
"title",
"vendor",
"customer",
"order_date",
"duration",
"price",
"discount",
"payed_access"), $header_params);
$offset = $_GET["offset"];
$order = $_GET["sort_by"];
$direction = $_GET["sort_order"] ? $_GET['sort_order'] : 'desc';
$tbl->setOrderColumn($order,'order_date');
$tbl->setOrderDirection($direction);
$tbl->setOffset($offset);
$tbl->setLimit($_GET["limit"]);
$tbl->setMaxCount(count($a_result_set));
$tbl->setFooter("tblfooter",$this->lng->txt("previous"),$this->lng->txt("next"));
$tbl->setData($a_result_set);
$tbl->render();
$this->tpl->setVariable("STATISTIC_TABLE",$tbl->tpl->get());
return true;
}

+ Here is the caller graph for this function:

Field Documentation

ilShopBoughtObjectsGUI::$psc_obj = null
private

Definition at line 39 of file class.ilShopBoughtObjectsGUI.php.

ilShopBoughtObjectsGUI::$user_obj
private

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

Referenced by __construct().


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