ILIAS  Release_4_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilPaymentPurchaseGUI Class Reference
+ Inheritance diagram for ilPaymentPurchaseGUI:
+ Collaboration diagram for ilPaymentPurchaseGUI:

Public Member Functions

 ilPaymentPurchaseGUI ($a_ref_id)
executeCommand ()
 execute command
 showDetails ()
 addToShoppingCart ()
 __initShoppingCartObject ()
 __initPaymentObject ()
 __initPricesObject ()
 __buildHeader ()
 __buildStatusline ()
 __buildLocator ()
 __buildStylesheet ()
 ilPaymentAdminGUI (&$user_obj)
executeCommand ()
 execute command
- 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 ()
 undeleteObject ()
 Get objects back from trash.
 confirmedDeleteObject ()
 confirmed deletion of object -> objects are moved to trash or deleted immediately, if trash is disabled
 cancelDeleteObject ()
 cancel deletion of object
 removeFromSystemObject ()
 remove objects from trash bin and all entries therefore every object needs a specific deleteObject() method
 createObject ()
 create new object form
 cancelObject ($in_rep=false)
 cancel action and go back to previous page public
 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.
 trashObject ()
 Show trash content of object.
 getTemplateFile ($a_cmd, $a_type="")
 get a template blockfile format: tpl.
 cloneAllObject ()
 Clone single (not container object) Method is overwritten in ilContainerGUI.
 copyWizardHasOptions ($a_mode)
 Check if there is any modules specific option.

Data Fields

 $ctrl
 $ilias
 $lng
 $tpl
 $object = null
 $user_obj
- 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

Additional Inherited Members

- Protected Member Functions inherited from ilObjectGUI
 assignObject ()
 prepareOutput ()
 prepare output
 setTitleAndDescription ()
 called by prepare output
 showUpperIcon ()
 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 ()
 should be overwritten to add object specific items (repository items are preloaded)
 displayEditForm ($fields)
 display edit form (usually called by editObject)
 afterUpdate ()
 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)
 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
 __showClipboardTable ($a_result_set, $a_from="")
 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.
 fillCloneSearchTemplate ($a_tpl_varname, $a_type)
 Add an object search in case the number of existing objects is too big to offer a selection list.
 searchCloneSourceObject ()
 Search clone source by title.
 buildCloneSelect ($existing_objs)
 Build a select box for clonable objects (permission write)
 getCenterColumnHTML ()
 Get center column.
 getRightColumnHTML ()
 Display right column.
 setColumnSettings ($column_gui)
 May be overwritten in subclasses.
 checkPermission ($a_perm, $a_cmd="")

Detailed Description

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

Member Function Documentation

ilPaymentPurchaseGUI::__buildHeader ( )

Definition at line 355 of file class.ilPaymentPurchaseGUI.php.

Referenced by executeCommand().

{
$this->tpl->addBlockFile("CONTENT", "content", "tpl.payb_content.html");
$this->tpl->setVariable("HEADER",$this->object->getTitle());
$this->tpl->setVariable("DESCRIPTION",$this->object->getDescription());
# $this->__buildStylesheet();
# $this->__buildStatusline();
}

+ Here is the caller graph for this function:

ilPaymentPurchaseGUI::__buildLocator ( )

Definition at line 372 of file class.ilPaymentPurchaseGUI.php.

References ilUtil\sendInfo().

Referenced by __buildStatusline().

{
$this->tpl->addBlockFile("LOCATOR", "locator", "tpl.locator.html", "Services/Locator");
$this->tpl->setVariable("TXT_LOCATOR",$this->lng->txt("locator"));
$this->tpl->setCurrentBlock("locator_item");
$this->tpl->setVariable("ITEM", $this->lng->txt("repository"));
$this->tpl->setVariable("LINK_ITEM", "../repository.php?getlast=true");
$this->tpl->parseCurrentBlock();
// CHECK for new mail and info
return true;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilPaymentPurchaseGUI::__buildStatusline ( )

Definition at line 366 of file class.ilPaymentPurchaseGUI.php.

References __buildLocator().

{
$this->tpl->addBlockFile("STATUSLINE", "statusline", "tpl.statusline.html");
$this->__buildLocator();
}

+ Here is the call graph for this function:

ilPaymentPurchaseGUI::__buildStylesheet ( )

Definition at line 388 of file class.ilPaymentPurchaseGUI.php.

References ilUtil\getStyleSheetLocation().

{
$this->tpl->setVariable("LOCATION_STYLESHEET",ilUtil::getStyleSheetLocation());
}

+ Here is the call graph for this function:

ilPaymentPurchaseGUI::__initPaymentObject ( )

Definition at line 338 of file class.ilPaymentPurchaseGUI.php.

References ilPaymentObject\_lookupPobjectId().

Referenced by addToShoppingCart(), and showDetails().

{
include_once './payment/classes/class.ilPaymentObject.php';
$this->pobject =& new ilPaymentObject($this->ilias->account,ilPaymentObject::_lookupPobjectId($this->ref_id));
return true;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilPaymentPurchaseGUI::__initPricesObject ( )

Definition at line 346 of file class.ilPaymentPurchaseGUI.php.

Referenced by showDetails().

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

+ Here is the caller graph for this function:

ilPaymentPurchaseGUI::__initShoppingCartObject ( )

Definition at line 329 of file class.ilPaymentPurchaseGUI.php.

Referenced by addToShoppingCart(), and showDetails().

{
include_once './payment/classes/class.ilPaymentShoppingCart.php';
$this->sc_obj =& new ilPaymentShoppingCart($this->ilias->account);
return true;
}

+ Here is the caller graph for this function:

ilPaymentPurchaseGUI::addToShoppingCart ( )

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

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

{
if($this->object->getType() == 'crs' && $this->object->isSubscriptionMembershipLimited())
{
$this->object->initCourseMemberObject();
if($this->object->getSubscriptionMaxMembers() <= $this->object->members_obj->getCountMembers())
{
ilUtil::sendInfo($this->lng->txt('pay_crs_max_members_exceeded'));
return false;
}
}
if(!isset($_POST['price_id']))
{
ilUtil::sendInfo($this->lng->txt('pay_select_price'));
$this->showDetails();
return true;
}
else
{
$this->sc_obj->setPriceId((int) $_POST['price_id']);
$this->sc_obj->setPobjectId($this->pobject->getPobjectId());
$this->sc_obj->add();
# $tmp_obj =& ilObjectFactory::getInstanceByRefId($this->pobject->getRefId());
$this->tpl->addBlockFile('ADM_CONTENT','adm_content','tpl.pay_purchase_details.html','payment');
$this->tpl->setCurrentBlock("shopping_cart");
$this->tpl->setVariable("LINK_GOTO_SHOPPING_CART", "ilias.php?cmdClass=ilpaymentgui&baseClass=ilPersonalDesktopGUI&cmd=showShoppingCart");
$this->tpl->setVariable("TXT_GOTO_SHOPPING_CART", $this->lng->txt('pay_goto_shopping_cart'));
# $this->tpl->setVariable("TXT_BUY", $this->lng->txt('pay_click_to_buy'));
$this->tpl->parseCurrentBlock("shopping_cart");
ilUtil::sendInfo($this->lng->txt('pay_added_to_shopping_cart'));
return true;
}
}

+ Here is the call graph for this function:

& ilPaymentPurchaseGUI::executeCommand ( )

execute command

Reimplemented from ilObjectGUI.

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

References $cmd, and ilObjectGUI\$tree.

{
global $tree;
$cmd = $this->ctrl->getCmd();
switch ($this->ctrl->getNextClass($this))
{
default:
if(!$cmd = $this->ctrl->getCmd())
{
$cmd = 'showBillData';
}
$this->$cmd();
break;
}
}
& ilPaymentPurchaseGUI::executeCommand ( )

execute command

Reimplemented from ilObjectGUI.

Definition at line 69 of file class.ilPaymentPurchaseGUI.php.

References $cmd, and __buildHeader().

{
$cmd = $this->ctrl->getCmd();
if (!$cmd = $this->ctrl->getCmd())
{
$cmd = "showDetails";
}
$this->__buildHeader();
$this->$cmd();
}

+ Here is the call graph for this function:

ilPaymentPurchaseGUI::ilPaymentAdminGUI ( $user_obj)

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

References $ilCtrl, and $user_obj.

{
global $ilCtrl;
$this->ctrl =& $ilCtrl;
// Get user object
$this->user_obj =& $user_obj;
}
ilPaymentPurchaseGUI::ilPaymentPurchaseGUI (   $a_ref_id)

Definition at line 46 of file class.ilPaymentPurchaseGUI.php.

References $ilCtrl, $ilErr, $ilias, $lng, $tpl, ilObjectGUI\$tree, and ilObjectFactory\getInstanceByRefId().

{
$this->ctrl =& $ilCtrl;
$this->ctrl->saveParameter($this,array("ref_id"));
$this->ilErr =& $ilErr;
$this->ilias =& $ilias;
$this->lng =& $lng;
$this->lng->loadLanguageModule('payment');
$this->tpl =& $tpl;
$this->ref_id = $a_ref_id;
$this->object =& ilObjectFactory::getInstanceByRefId($this->ref_id, false);
}

+ Here is the call graph for this function:

ilPaymentPurchaseGUI::showDetails ( )

Definition at line 83 of file class.ilPaymentPurchaseGUI.php.

References __initPaymentObject(), __initPricesObject(), __initShoppingCartObject(), ilPaymentPrices\_getPriceString(), ilUtil\formRadioButton(), ilUtil\getImagePath(), and ilUtil\sendInfo().

Referenced by addToShoppingCart().

{
if($this->object)
{
if($this->object->getType() == 'crs' && $this->object->isSubscriptionMembershipLimited())
{
$this->object->initCourseMemberObject();
if($this->object->getSubscriptionMaxMembers() <= $this->object->members_obj->getCountMembers())
{
ilUtil::sendInfo($this->lng->txt('pay_crs_max_members_exceeded'));
return false;
}
}
}
else
{
ilUtil::sendInfo($this->lng->txt('object_not_found'));
}
$this->tpl->addBlockFile('ADM_CONTENT','adm_content','tpl.pay_purchase_details.html','payment');
if($this->pobject->getStatus() == $this->pobject->STATUS_EXPIRES)
{
ilUtil::sendInfo($this->lng->txt('pay_expires_info'));
return false;
}
$prices = $this->price_obj->getPrices();
$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->tpl->setCurrentBlock("shopping_cart");
$this->tpl->setVariable("LINK_GOTO_SHOPPING_CART", "ilias.php?cmdClass=ilpaymentgui&baseClass=ilPersonalDesktopGUI&cmd=showShoppingCart");
$this->tpl->setVariable("TXT_GOTO_SHOPPING_CART", $this->lng->txt('pay_goto_shopping_cart'));
# $this->tpl->setVariable("TXT_BUY", $this->lng->txt('pay_click_to_buy'));
$this->tpl->parseCurrentBlock("shopping_cart");
}
$this->ctrl->setParameter($this, "ref_id", $this->pobject->getRefId());
# if (!is_array($buyedObject) ||
# (is_array($buyedObject) && is_array($prices) && count($prices) > 1))
# {
$this->tpl->setVariable("DETAILS_FORMACTION",$this->ctrl->getFormAction($this));
if($this->object)
{
$this->tpl->setVariable("TYPE_IMG",ilUtil::getImagePath('icon_'.$this->object->getType().'_b.gif'));
$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'));
}
// payment infos
$this->tpl->setVariable("TXT_INFO",$this->lng->txt('info'));
switch($this->pobject->getPayMethod())
{
/* case $this->pobject->PAY_METHOD_BILL:
$this->tpl->setVariable("INFO_PAY",$this->lng->txt('pay_bill'));
$this->tpl->setVariable("INPUT_CMD",'getBill');
$this->tpl->setVariable("INPUT_VALUE",$this->lng->txt('pay_get_bill'));
break;
*/
case $this->pobject->PAY_METHOD_BILL:
$this->tpl->setVariable("INFO_PAY",$this->lng->txt('pay_info'));
if (is_array($buyedObject))
{
if (is_array($prices) && count($prices) > 1)
{
$this->tpl->setVariable("INPUT_CMD",'addToShoppingCart');
$this->tpl->setVariable("INPUT_VALUE",$this->lng->txt('pay_change_price'));
}
}
else
{
$this->tpl->setVariable("INPUT_CMD",'addToShoppingCart');
$this->tpl->setVariable("INPUT_VALUE",$this->lng->txt('pay_add_to_shopping_cart'));
}
break;
case $this->pobject->PAY_METHOD_BMF:
$this->tpl->setVariable("INFO_PAY",$this->lng->txt('pay_info'));
if (is_array($buyedObject))
{
if (is_array($prices) && count($prices) > 1)
{
$this->tpl->setVariable("INPUT_CMD",'addToShoppingCart');
$this->tpl->setVariable("INPUT_VALUE",$this->lng->txt('pay_change_price'));
}
}
else
{
$this->tpl->setVariable("INPUT_CMD",'addToShoppingCart');
$this->tpl->setVariable("INPUT_VALUE",$this->lng->txt('pay_add_to_shopping_cart'));
}
break;
case $this->pobject->PAY_METHOD_PAYPAL:
$this->tpl->setVariable("INFO_PAY",$this->lng->txt('pay_info'));
if (is_array($buyedObject))
{
if (is_array($prices) && count($prices) > 1)
{
$this->tpl->setVariable("INPUT_CMD",'addToShoppingCart');
$this->tpl->setVariable("INPUT_VALUE",$this->lng->txt('pay_change_price'));
}
}
else
{
$this->tpl->setVariable("INPUT_CMD",'addToShoppingCart');
$this->tpl->setVariable("INPUT_VALUE",$this->lng->txt('pay_add_to_shopping_cart'));
}
break;
case $this->pobject->PAY_METHOD_EPAY:
$this->tpl->setVariable("INFO_PAY",$this->lng->txt('pay_info'));
if (is_array($buyedObject))
{
if (is_array($prices) && count($prices) > 1)
{
$this->tpl->setVariable("INPUT_CMD",'addToShoppingCart');
$this->tpl->setVariable("INPUT_VALUE",$this->lng->txt('pay_change_price'));
}
}
else
{
$this->tpl->setVariable("INPUT_CMD",'addToShoppingCart');
$this->tpl->setVariable("INPUT_VALUE",$this->lng->txt('pay_add_to_shopping_cart'));
}
break;
}
$this->tpl->setVariable("ROWSPAN",count($prices));
$this->tpl->setVariable("TXT_PRICES",$this->lng->txt('prices'));
# }
if (is_array($prices))
{
# if (count($prices) > 1)
# {
$counter = 0;
foreach($prices as $price)
{
if ($counter == 0)
{
$placeholderCheckbox = "CHECKBOX";
$placeholderDuration = "DURATION";
$placeholderPrice = "PRICE";
}
else
{
$placeholderCheckbox = "ROW_CHECKBOX";
$placeholderDuration = "ROW_DURATION";
$placeholderPrice = "ROW_PRICE";
}
$this->tpl->setCurrentBlock("price_row");
if ($buyedObject["price_id"] == $price['price_id'])
{
$this->tpl->setVariable($placeholderCheckbox,ilUtil::formRadioButton(1,'price_id',$price['price_id']));
}
else
{
$this->tpl->setVariable($placeholderCheckbox,ilUtil::formRadioButton(0,'price_id',$price['price_id']));
}
$this->tpl->setVariable($placeholderDuration,$price['duration'].' '.$this->lng->txt('paya_months'));
$this->tpl->setVariable($placeholderPrice,ilPaymentPrices::_getPriceString($price['price_id']));
$this->tpl->parseCurrentBlock();
$counter++;
}
# }
# else if (!is_array($buyedObject))
# {
# foreach($prices as $price)
# {
# $this->tpl->setVariable("CHECKBOX",ilUtil::formRadioButton(0,'price_id',$price['price_id']));
# $this->tpl->setVariable("DURATION",$price['duration'].' '.$this->lng->txt('paya_months'));
# $this->tpl->setVariable("PRICE",ilPaymentPrices::_getPriceString($price['price_id']));
# }
# }
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Field Documentation

ilPaymentPurchaseGUI::$ctrl

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

ilPaymentPurchaseGUI::$ilias

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

Referenced by ilPaymentPurchaseGUI().

ilPaymentPurchaseGUI::$lng

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

Referenced by ilPaymentPurchaseGUI().

ilPaymentPurchaseGUI::$object = null

Definition at line 44 of file class.ilPaymentPurchaseGUI.php.

ilPaymentPurchaseGUI::$tpl

Definition at line 42 of file class.ilPaymentPurchaseGUI.php.

Referenced by ilPaymentPurchaseGUI().

ilPaymentPurchaseGUI::$user_obj

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

Referenced by ilPaymentAdminGUI().


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