ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilShopPurchaseGUI Class Reference

Class ilShopPurchaseGUI. More...

+ Inheritance diagram for ilShopPurchaseGUI:
+ Collaboration diagram for ilShopPurchaseGUI:

Public Member Functions

 __construct ($a_ref_id)
 executeCommand ()
 execute command
 showDemoVersion ()
 showDetails ()
 addToShoppingCart ()
- Public Member Functions inherited from ilObjectGUI
 ilObjectGUI ($a_data, $a_id=0, $a_call_by_reference=true, $a_prepare_output=true)
 Constructor public.
 withReferences ()
 determines wether objects are referenced or not (got ref ids or not)
 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
 getCreationMode ()
 get creation mode
 getAdminTabs (&$tabs_gui)
 administration tabs show only permissions and trash folder
 getHTML ()
 confirmedDeleteObject ()
 confirmed deletion of object -> objects are moved to trash or deleted immediately, if trash is disabled
 cancelDeleteObject ()
 cancel deletion of object
 cancelObject ($in_rep=false)
 cancel action and go back to previous page public
 createObject ()
 create new object form
 cancelCreation ()
 cancel create action and go back to repository parent
 saveObject ()
 save object
 editObject ()
 edit object
 updateObject ()
 updates object entry in object_data
 getFormAction ($a_cmd, $a_formaction="")
 get form action for command (command is method name without "Object", e.g.
 isVisible ($a_ref_id, $a_type)
 viewObject ()
 list childs of current object
 deleteObject ($a_error=false)
 Display deletion confirmation screen.
 cloneAllObject ()
 Clone single (not container object) Method is overwritten in ilContainerGUI.

Data Fields

 $ctrl
 $lng
 $tpl
 $object = null
 $pobject = null
 $cur_row_type = null
 $price_obj = null
 $sc_obj = 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

 getItemsByObjType ($items, $type_group)
 __getCourseItemsHTML ($container_items)
 resetRowType ()
 addHeaderRow ($a_tpl, $a_type, $a_show_image=true)
 adds a header row to a block template
 addStandardRow (&$a_tpl, $a_html, $a_item_obj_id="", $a_image_type="", $a_related_header="")
 adds a standard row to a block template
 __getAbstractHTML ($a_payment_object_id)
 __initShoppingCartObject ()
 __initPaymentObject ()
 __initPricesObject ()

Additional Inherited Members

- Static Public Member Functions inherited from ilObjectGUI
static _gotoRepositoryRoot ($a_raise_error=false)
 Goto repository root.
static _gotoRepositoryNode ($a_ref_id, $a_cmd="frameset")
 Goto repository root.
- Protected Member Functions inherited from ilObjectGUI
 assignObject ()
 prepareOutput ()
 prepare output
 setTitleAndDescription ()
 called by prepare output
 initHeaderAction ($a_sub_type=null, $a_sub_id=null)
 Add header action menu.
 insertHeaderAction ($a_list_gui)
 Insert header action into main template.
 addHeaderAction ()
 Add header action menu.
 redrawHeaderActionObject ()
 Ajax call: redraw action header only.
 showMountWebfolderIcon ()
 setTabs ()
 set admin tabs public
 setAdminTabs ()
 set admin tabs public
 setLocator ()
 set Locator
 addLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded)
 omitLocator ($a_omit=true)
 addAdminLocatorItems ($a_do_not_add_object=false)
 should be overwritten to add object specific items (repository items are preloaded)
 initCreationForms ($a_new_type)
 Init creation froms.
 getCreationFormsHTML (array $a_forms)
 Get HTML for creation forms (accordion)
 initCreateForm ($a_new_type)
 Init object creation form.
 initDidacticTemplate (ilPropertyFormGUI $form)
 Show didactic template types.
 addDidacticTemplateOptions (array &$a_options)
 Add custom templates.
 getDidacticTemplateVar ($a_type)
 Get didactic template setting from creation screen.
 putObjectInTree (ilObject $a_obj, $a_parent_node_id=null)
 Add object to tree at given position.
 afterSave (ilObject $a_new_object)
 Post (successful) object creation hook.
 initEditForm ()
 Init object edit form.
 initEditCustomForm (ilPropertyFormGUI $a_form)
 Add custom fields to update form.
 getEditFormValues ()
 Get values for edit form.
 getEditFormCustomValues (array &$a_values)
 Add values to custom edit fields.
 validateCustom (ilPropertyFormGUI $a_form)
 Validate custom values (if not possible with checkInput())
 updateCustom (ilPropertyFormGUI $a_form)
 Insert custom update form values into object.
 afterUpdate ()
 Post (successful) object update hook.
 initImportForm ($a_new_type)
 Init object import form.
 importFileObject ($parent_id=null)
 Import.
 afterImport (ilObject $a_new_object)
 Post (successful) object import hook.
 setFormAction ($a_cmd, $a_formaction)
 set specific form action for command
 getReturnLocation ($a_cmd, $a_location="")
 get return location for command (command is method name without "Object", e.g.
 setReturnLocation ($a_cmd, $a_location)
 set specific return location for command
 getTargetFrame ($a_cmd, $a_target_frame="")
 get target frame for command (command is method name without "Object", e.g.
 setTargetFrame ($a_cmd, $a_target_frame)
 set specific target frame for command
 showPossibleSubObjects ()
 show possible subobjects (pulldown menu)
 getTemplateFile ($a_cmd, $a_type="")
 get a template blockfile format: tpl.
 getTitlesByRefId ($a_ref_ids)
 get Titles of objects this method is used for error messages in methods cut/copy/paste
 getTabs (&$tabs_gui)
 get tabs abstract method.
 __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
 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
 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.
 getCenterColumnHTML ()
 Get center column.
 getRightColumnHTML ()
 Display right column.
 setColumnSettings ($column_gui)
 May be overwritten in subclasses.
 checkPermission ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission and redirect on error.
 checkPermissionBool ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission.
 enableDragDropFileUpload ()
 Enables the file upload into this object by dropping files.
 handleAutoRating (ilObject $a_new_obj)
 Activate rating automatically if parent container setting.

Detailed Description

Constructor & Destructor Documentation

ilShopPurchaseGUI::__construct (   $a_ref_id)

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

References $_GET, $ilCtrl, $ilErr, $lng, $tpl, and ilObjectFactory\getInstanceByRefId().

{
global $ilCtrl,$lng,$ilErr,$tpl,$ilTabs;
$this->ctrl = $ilCtrl;
$this->ctrl->saveParameter($this, array("ref_id"));
$this->ilErr = $ilErr;
$this->lng = $lng;
$this->lng->loadLanguageModule('payment');
$this->tpl = $tpl;
$this->ref_id = $a_ref_id;
$this->object = ilObjectFactory::getInstanceByRefId($this->ref_id, false);
$this->tpl->getStandardTemplate();
$ilTabs->clearTargets();
$ilTabs->addTarget('buy', $this->ctrl->getLinkTarget($this, 'showDetails').'&purchasetype=buy');
$ilTabs->addTarget('payment_demo', $this->ctrl->getLinkTarget($this, 'showDemoVersion').'&purchasetype=demo');
$this->ctrl->setParameter($this, 'purchasetype', ($_GET['purchasetype'] == 'demo' ? 'demo' : 'buy'));
}

+ Here is the call graph for this function:

Member Function Documentation

ilShopPurchaseGUI::__getAbstractHTML (   $a_payment_object_id)
private

Definition at line 492 of file class.ilShopPurchaseGUI.php.

References ilPageObject\_exists().

Referenced by showDemoVersion().

{
// page object
include_once 'Services/Payment/classes/class.ilShopPage.php';
include_once 'Services/Payment/classes/class.ilShopPageGUI.php';
// if page does not exist, return nothing
if(!ilShopPage::_exists('shop', $a_payment_object_id))
{
return '';
}
include_once 'Services/Style/classes/class.ilObjStyleSheet.php';
// get page object
$page_gui = new ilShopPageGUI($a_payment_object_id);
return $page_gui->showPage();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilShopPurchaseGUI::__getCourseItemsHTML (   $container_items)
private

Definition at line 162 of file class.ilShopPurchaseGUI.php.

References $ilSetting, ilObjectGUI\$objDefinition, addHeaderRow(), addStandardRow(), getItemsByObjType(), and resetRowType().

Referenced by showDemoVersion().

{
$output = false;
$tpl_sub_items = new ilTemplate('tpl.pay_purchase_demo_list_block.html', true, true, 'Services/Payment');
$objtype_groups = $objDefinition->getGroupedRepositoryObjectTypes(
array('cat', 'crs', 'grp', 'fold')
);
foreach($objtype_groups as $grp => $grpdata)
{
// $title = $this->lng->txt('objs_'.$grp);
$items = $this->getItemsByObjType($container_items, $grp);
$item_html = array();
$rel_header = 'th_'.$grp;
if(count($items) > 0)
{
foreach($items as $item)
{
if($item['title'] != '')
{
$item_html[] = array(
'html' => $item['title'],
'item_ref_id' => $item['ref_id'],
'item_obj_id' => $item['obj_id']
);
}
}
// output block for resource type
if(count($item_html) > 0)
{
$output = true;
// add a header for each resource type
if($ilSetting->get('icon_position_in_lists') == 'item_rows')
{
$this->addHeaderRow($tpl_sub_items, $grp, false);
}
else
{
$this->addHeaderRow($tpl_sub_items, $grp);
}
$this->resetRowType();
// content row
foreach($item_html as $item)
{
if($ilSetting->get('icon_position_in_lists') == 'item_rows')
{
// BEGIN WebDAV: Use $item_list_gui to determine icon image type
$this->addStandardRow($tpl_sub_items, $item['html'], $item['item_obj_id'],
$item['item_icon_image_type'],
$rel_header);
// END WebDAV: Use $item_list_gui to determine icon image type
}
else
{
$this->addStandardRow($tpl_sub_items, $item['html'], $item['item_obj_id'], '', $rel_header);
}
}
}
}
}
if($output == true)
{
$this->tpl->setCurrentBlock('public_content_block');
$this->tpl->setVariable('TXT_CONTENT', $this->lng->txt('content'));
$this->tpl->setVariable('PUBLIC_CONTENT_HTML', $tpl_sub_items->get());
$this->tpl->parseCurrentBlock();
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilShopPurchaseGUI::__initPaymentObject ( )
private

Definition at line 550 of file class.ilShopPurchaseGUI.php.

References $ilUser, and ilPaymentObject\_lookupPobjectId().

Referenced by addToShoppingCart(), executeCommand(), showDemoVersion(), and showDetails().

{
global $ilUser;
$this->pobject = new ilPaymentObject($ilUser ,ilPaymentObject::_lookupPobjectId($this->ref_id));
return true;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilShopPurchaseGUI::__initPricesObject ( )
private

Definition at line 556 of file class.ilShopPurchaseGUI.php.

Referenced by showDemoVersion(), and showDetails().

{
include_once './Services/Payment/classes/class.ilPaymentPrices.php';
$this->price_obj = new ilPaymentPrices($this->pobject->getPobjectId());
return true;
}

+ Here is the caller graph for this function:

ilShopPurchaseGUI::__initShoppingCartObject ( )
private

Definition at line 542 of file class.ilShopPurchaseGUI.php.

References $ilUser.

Referenced by addToShoppingCart(), showDemoVersion(), and showDetails().

{
global $ilUser;
include_once './Services/Payment/classes/class.ilPaymentShoppingCart.php';
$this->sc_obj = new ilPaymentShoppingCart($ilUser);
return true;
}

+ Here is the caller graph for this function:

ilShopPurchaseGUI::addHeaderRow (   $a_tpl,
  $a_type,
  $a_show_image = true 
)
private

adds a header row to a block template

Parameters
object$a_tplblock template
string$a_typeobject type private

Definition at line 253 of file class.ilShopPurchaseGUI.php.

References ilObject\_getIcon().

Referenced by __getCourseItemsHTML().

{
$icon = ilObject::_getIcon($this->object->getId());
$title = $this->lng->txt("objs_".$a_type);
$header_id = "th_".$a_type;
if ($a_show_image)
{
$a_tpl->setCurrentBlock("container_header_row_image");
$a_tpl->setVariable("HEADER_IMG", $icon);
$a_tpl->setVariable("HEADER_ALT", $title);
}
else
{
$a_tpl->setCurrentBlock("container_header_row");
}
$a_tpl->setVariable("BLOCK_HEADER_CONTENT", $title);
$a_tpl->setVariable("BLOCK_HEADER_ID", $header_id);
$a_tpl->parseCurrentBlock();
$a_tpl->touchBlock("container_row");
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilShopPurchaseGUI::addStandardRow ( $a_tpl,
  $a_html,
  $a_item_obj_id = "",
  $a_image_type = "",
  $a_related_header = "" 
)
private

adds a standard row to a block template

Parameters
object$a_tplblock template
string$a_htmlhtml code private

Definition at line 283 of file class.ilShopPurchaseGUI.php.

References $ilSetting, $path, ilObject\_getIcon(), and ilContainer\_lookupIconPath().

Referenced by __getCourseItemsHTML().

{
global $ilSetting;
$this->cur_row_type = ($this->cur_row_type == "row_type_1")
? "row_type_2"
: "row_type_1";
$a_tpl->touchBlock($this->cur_row_type);
if ($a_image_type != "")
{
if (!is_array($a_image_type) && !in_array($a_image_type, array("lm", "dbk", "htlm", "sahs")))
{
$icon = ilObject::_getIcon($this->object->getId());
$title = $this->lng->txt("obj_".$a_image_type);
}
else
{
$icon = ilObject::_getIcon($this->object->getId());
$title = $this->lng->txt("learning_resource");
}
// custom icon
if ($ilSetting->get("custom_icons") &&
in_array($a_image_type, array("cat","grp","crs")))
{
require_once("./Services/Container/classes/class.ilContainer.php");
if (($path = ilContainer::_lookupIconPath($a_item_obj_id, "small")) != "")
{
$icon = $path;
}
}
$a_tpl->setCurrentBlock("block_row_image");
$a_tpl->setVariable("ROW_IMG", $icon);
$a_tpl->setVariable("ROW_ALT", $title);
$a_tpl->parseCurrentBlock();
}
else
{
$a_tpl->setVariable("ROW_NBSP", " ");
}
$a_tpl->setCurrentBlock("container_standard_row");
$a_tpl->setVariable("BLOCK_ROW_CONTENT", $a_html);
$rel_headers = ($a_related_header != "")
? "th_selected_items ".$a_related_header
: "th_selected_items";
$a_tpl->setVariable("BLOCK_ROW_HEADERS", $rel_headers);
$a_tpl->parseCurrentBlock();
$a_tpl->touchBlock("container_row");
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilShopPurchaseGUI::addToShoppingCart ( )

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

References $_POST, __initPaymentObject(), __initShoppingCartObject(), ilUtil\redirect(), ilUtil\sendInfo(), and showDetails().

{
global $ilTabs;
$ilTabs->setTabActive('buy');
if(!isset($_POST['price_id']))
{
ilUtil::sendInfo($this->lng->txt('pay_select_price'));
$this->showDetails();
return true;
}
else
{
$this->sc_obj->setSessionId(session_id());
$this->sc_obj->setPriceId((int) $_POST['price_id']);
$this->sc_obj->setPobjectId($this->pobject->getPobjectId());
$this->sc_obj->add();
ilUtil::redirect('ilias.php?baseClass=ilShopController&cmd=redirect&redirect_class=ilshopshoppingcartgui');
return true;
}
}

+ Here is the call graph for this function:

ilShopPurchaseGUI::executeCommand ( )

execute command

Reimplemented from ilObjectGUI.

Definition at line 58 of file class.ilShopPurchaseGUI.php.

References $_GET, $cmd, and __initPaymentObject().

{
$cmd = $this->ctrl->getCmd();
switch($this->ctrl->getCmdClass())
{
case 'ilshoppagegui':
include_once 'Services/Style/classes/class.ilObjStyleSheet.php';
include_once 'Services/Payment/classes/class.ilShopPageGUI.php';
$page_gui = new ilShopPageGUI($this->pobject->getPobjectId());
$this->ctrl->forwardCommand($page_gui);
return true;
break;
}
switch($cmd)
{
case 'addToShoppingCart':
break;
default:
if(!in_array($cmd, array('showDemoVersion', 'showDetails', 'addToShoppingCart')))
{
$cmd = ($_GET['purchasetype'] == 'demo' ? 'showDemoVersion' : 'showDetails');
}
break;
}
$this->$cmd();
return true;
}

+ Here is the call graph for this function:

ilShopPurchaseGUI::getItemsByObjType (   $items,
  $type_group 
)
private

Definition at line 157 of file class.ilShopPurchaseGUI.php.

Referenced by __getCourseItemsHTML().

{
return is_array($items[$type_group]) ? $items[$type_group] : array();
}

+ Here is the caller graph for this function:

ilShopPurchaseGUI::resetRowType ( )
private

Definition at line 241 of file class.ilShopPurchaseGUI.php.

Referenced by __getCourseItemsHTML().

{
$this->cur_row_type = "";
}

+ Here is the caller graph for this function:

ilShopPurchaseGUI::showDemoVersion ( )

Definition at line 90 of file class.ilShopPurchaseGUI.php.

References __getAbstractHTML(), __getCourseItemsHTML(), __initPaymentObject(), __initPricesObject(), __initShoppingCartObject(), ilObject\_getIcon(), ilObjectFactory\getInstanceByRefId(), and ilShopPublicSectionSelector\getOutput().

{
global $ilMainMenu, $ilTabs, $ilToolbar;
$ilToolbar->addButton($this->lng->txt('payment_back_to_shop'),'ilias.php?baseClass=ilShopController');
$ilTabs->setTabActive('payment_demo');
$ilMainMenu->setActive('shop');
$this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.shop_abstract_details.html', 'Services/Payment');
$this->tpl->setVariable("DETAILS_FORMACTION",$this->ctrl->getFormAction($this));
if($this->object)
{
$icon = ilObject::_getIcon($this->object->getId());
$this->tpl->setVariable("TYPE_IMG", $icon);
$this->tpl->setVariable("ALT_IMG", $this->lng->txt('obj_'.$this->object->getType()));
$this->tpl->setVariable("TITLE", $this->object->getTitle());
}
else
{
$this->tpl->setVariable("TITLE",$this->lng->txt('object_not_found'));
}
// abstracts
if(($abstract_html = $this->__getAbstractHTML($this->pobject->getPobjectId())) != '')
{
$this->tpl->setCurrentBlock('abstract_block');
$this->tpl->setVariable('TXT_ABSTRACT', $this->lng->txt('pay_abstract'));
$this->tpl->setVariable('ABSTRACT_HTML', $abstract_html);
$this->tpl->parseCurrentBlock();
}
// public content ilias lm
global $ilObjDataCache;
if($ilObjDataCache->lookupType($ilObjDataCache->lookupObjId($this->pobject->getRefId())) == 'lm')
{
include_once 'Modules/LearningModule/classes/class.ilShopPublicSectionSelector.php';
$exp = new ilShopPublicSectionSelector($this->ctrl->getLinkTarget($this, 'layout'),
ilObjectFactory::getInstanceByRefId($this->pobject->getRefId()), get_class($this));
$exp->setTargetGet('obj_id');
$exp->setOutput(0);
$output = $exp->getOutput();
if(trim($output) != '')
{
$this->tpl->setCurrentBlock('public_content_block');
$this->tpl->setVariable('TXT_CONTENT', $this->lng->txt('content'));
$this->tpl->setVariable('PUBLIC_CONTENT_HTML', $output);
$this->tpl->parseCurrentBlock();
}
}
else if($ilObjDataCache->lookupType($ilObjDataCache->lookupObjId($this->pobject->getRefId())) == 'crs')
{
$oCourse = ilObjectFactory::getInstanceByRefId($this->pobject->getRefId());
$items = $oCourse->getSubItems();
$this->__getCourseItemsHTML($items);
}
}

+ Here is the call graph for this function:

ilShopPurchaseGUI::showDetails ( )

Definition at line 336 of file class.ilShopPurchaseGUI.php.

References $ilUser, __initPaymentObject(), __initPricesObject(), __initShoppingCartObject(), ilPaymentPrices\_formatPriceToString(), ilObject\_getIcon(), ilPaymentBookings\_hasAccesstoExtensionPrice(), ilDatePresentation\formatDate(), IL_CAL_DATE, ilUtil\sendFailure(), ilUtil\sendInfo(), ilRadioGroupInputGUI\setValue(), ilNonEditableValueGUI\setValue(), ilPaymentPrices\TYPE_DURATION_DATE, ilPaymentPrices\TYPE_DURATION_MONTH, and ilPaymentPrices\TYPE_UNLIMITED_DURATION.

Referenced by addToShoppingCart().

{
global $ilMainMenu, $ilTabs, $ilToolbar, $ilUser;
$ilToolbar->addButton($this->lng->txt('payment_back_to_shop'),'ilias.php?baseClass=ilShopController');
$this->tpl->getStandardTemplate();
$ilTabs->setTabActive('buy');
$ilMainMenu->setActive('shop');
if($this->pobject->getStatus() == $this->pobject->STATUS_EXPIRES)
{
ilUtil::sendInfo($this->lng->txt('pay_expires_info'));
return false;
}
$extension_prices = array();
if($ilUser->getId() != ANONYMOUS_USER_ID)
{
include_once './Services/Payment/classes/class.ilPaymentBookings.php';
$ilUser->getId(), $this->pobject->getPobjectId());
if($has_extension_price)
{
$extension_prices = $this->price_obj->getExtensionPrices();
}
}
$org_prices = $this->price_obj->getPrices();
$tmp_prices = array_merge($org_prices, $extension_prices );
$prices = array();
foreach($tmp_prices as $price)
{
// expired prices must be filtered out
if($price['price_type'] == ilPaymentPrices::TYPE_DURATION_DATE && $price['duration_until'] < date('Y-m-d'))
{
//do nothing
}
else
{
$prices[] = $price;
}
}
include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
$form = new ilPropertyFormGUI();
$form->setFormAction($this->ctrl->getFormAction($this));
$buyedObject = "";
if($this->sc_obj->isInShoppingCart($this->pobject->getPobjectId()))
{
$buyedObject = $this->sc_obj->getEntry($this->pobject->getPobjectId());
if (is_array($prices) &&
count($prices) > 1)
{
ilUtil::sendInfo($this->lng->txt('pay_item_already_in_sc_choose_another'));
}
else
{
ilUtil::sendInfo($this->lng->txt('pay_item_already_in_sc'));
}
}
$this->ctrl->setParameter($this, "ref_id", $this->pobject->getRefId());
$subtype = '';
if($this->object)
{
if($this->object->getType() == 'exc')
{
$subtype = ' ('.$this->lng->txt($this->pobject->getSubtype()).')';
}
$form->setTitle($this->object->getTitle().' '.$subtype);
$form->setTitleIcon(ilObject::_getIcon($this->object->getId()));
}
else
{
ilUtil::sendFailure($this->lng->txt('object_not_found'));
}
// payment infos
$info = new ilNonEditableValueGUI($this->lng->txt('info'));
$info->setValue($this->lng->txt('pay_info'));
$form->addItem($info);
if (is_array($buyedObject))
{
if (is_array($prices) && count($prices) > 1)
{
$button_txt = $this->lng->txt('pay_change_price');
}
else
{
$button_txt = $this->lng->txt('pay_add_to_shopping_cart');
}
}
else
{
$button_txt = $this->lng->txt('pay_add_to_shopping_cart');
}
$rg_prices = new ilRadioGroupInputGUI($this->lng->txt('prices'), 'price_id');
if (is_array($prices))
{
foreach($prices as $price)
{
if (is_array($buyedObject) && $buyedObject["price_id"] == $price['price_id'])
{
$rg_prices->setValue($price['price_id']);
}
else if (count($prices) == 1)
{
$rg_prices->setValue($price['price_id']);
}
switch($price['price_type'])
{
$txt_price = $price['duration'].' '.$this->lng->txt('paya_months').': ';
break;
$txt_price = ilDatePresentation::formatDate(new ilDate($price['duration_from'], IL_CAL_DATE))
.' - '.ilDatePresentation::formatDate(new ilDate($price['duration_until'], IL_CAL_DATE)).': ';
break;
$txt_price = $this->lng->txt('unlimited_duration').': ';
break;
}
$tmp_price = $price['price'];
$extension_txt = '';
if($price['extension'] == 1)
{
$extension_txt = '(' . $this->lng->txt('extension_price') . ')';
}
$price_row = new ilRadioOption($txt_price .' '. ilPaymentPrices::_formatPriceToString((float)$tmp_price).' '.$extension_txt, $price['price_id'] );
$price_row->setInfo($price['description']);
$rg_prices->addOption($price_row);
}
$form->addItem($rg_prices);
}
$form->addCommandButton('addToShoppingCart', $button_txt );
return $this->tpl->setContent($form->getHTML());
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Field Documentation

ilShopPurchaseGUI::$ctrl

Definition at line 17 of file class.ilShopPurchaseGUI.php.

ilShopPurchaseGUI::$cur_row_type = null

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

ilShopPurchaseGUI::$lng

Definition at line 18 of file class.ilShopPurchaseGUI.php.

Referenced by __construct().

ilShopPurchaseGUI::$object = null

Definition at line 21 of file class.ilShopPurchaseGUI.php.

ilShopPurchaseGUI::$pobject = null

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

ilShopPurchaseGUI::$price_obj = null

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

ilShopPurchaseGUI::$sc_obj = null

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

ilShopPurchaseGUI::$tpl

Definition at line 19 of file class.ilShopPurchaseGUI.php.

Referenced by __construct().


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