A QCodo powered CMS
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

87 lines
2.6 KiB

  1. <?php
  2. if(!defined('QUINTACMS') ) die("No quinta.");
  3. if (!defined("ACCOUNTORDERMODULE.CLASS.PHP")){
  4. define("ACCOUNTORDERMODULE.CLASS.PHP",1);
  5. /**
  6. * Class AccountOrderModule - view/manage orders for a user account
  7. *@author Erik Winn <sidewalksoftware@gmail.com>
  8. *
  9. *@version 0.3
  10. *
  11. *@package Quinta
  12. * @subpackage Modules
  13. */
  14. class AccountOrderModule extends ListModuleBase{
  15. private $intOrderId;
  16. private $objOrderListView = null;
  17. private $objOrderItemView = null;
  18. /**
  19. * Module constructor
  20. *@param ContentBlockController - objParentObject parent controller object.
  21. *@param array - aryParameters, should contain one element with an order id or be empty
  22. */
  23. public function __construct( $objParentObject, $aryParameters){
  24. $this->objParentObject =& $objParentObject;
  25. if(!empty($aryParameters))
  26. $this->intOrderId = array_pop($aryParameters);
  27. try {
  28. parent::__construct($this->objParentObject);
  29. } catch (QCallerException $objExc) {
  30. $objExc->IncrementOffset();
  31. throw $objExc;
  32. }
  33. $this->AutoRenderChildren = true;
  34. // $this->strTemplate = __QUINTA_CORE_VIEWS__ . '/AccountOrderModule.tpl.php';
  35. if($this->objAccount instanceof Account)
  36. $this->InitPanels();
  37. }
  38. protected function InitPanels(){
  39. /* $this->pnlListView->RemoveChildControls(false);
  40. $this->pnlItemView->RemoveChildControls(false);*/
  41. $this->pnlItemView->Visible = false;
  42. $this->pnlListView->Visible = false;
  43. if($this->intOrderId){
  44. $this->objOrderItemView = new AccountOrderViewPanel($this->pnlItemView, $this, 'CloseItemPanel', $this->intOrderId);
  45. $this->pnlItemView->Visible = true;
  46. }else{
  47. $this->objOrderListView = new AccountOrderListPanel($this->pnlListView, $this, 'ShowItemPanel', 'CloseItemPanel');
  48. $this->pnlListView->Visible = true;
  49. }
  50. }
  51. //Overrides the parent to ensure that the list view is populated
  52. public function CloseItemPanel($blnUpdatesMade){
  53. if(!$this->objOrderListView)
  54. $this->objOrderListView = new AccountOrderListPanel( $this->pnlListView, $this, 'ShowItemPanel', 'CloseItemPanel');
  55. parent::CloseItemPanel($blnUpdatesMade);
  56. }
  57. public function __get($strName){
  58. switch ($strName){
  59. default:
  60. try {
  61. return parent::__get($strName);
  62. } catch (QCallerException $objExc) {
  63. $objExc->IncrementOffset();
  64. throw $objExc;
  65. }
  66. }
  67. }
  68. public function __set($strName, $mixValue){
  69. switch ($strName){
  70. default:
  71. try {
  72. return (parent::__set($strName, $mixValue));
  73. } catch (QCallerException $objExc) {
  74. $objExc->IncrementOffset();
  75. throw $objExc;
  76. }
  77. }
  78. }
  79. }//end class
  80. }//end define
  81. ?>