A Qcodo based CMS/ecommerce framework
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.

120 lines
4.2 KiB

13 years ago
  1. <?php
  2. if(!defined('QUASICMS') ) die("No quasi.");
  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 <erikwinnmail@yahoo.com>
  8. *
  9. *
  10. * $Id: AccountOrderModule.class.php 275 2008-10-09 17:20:14Z erikwinn $
  11. *@version 0.1
  12. *
  13. *@copyright (C) 2008 by Erik Winn
  14. *@license GPL v.2
  15. This program is free software; you can redistribute it and/or modify
  16. it under the terms of the GNU General Public License as published by
  17. the Free Software Foundation; either version 2 of the License, or
  18. (at your option) any later version.
  19. This program is distributed in the hope that it will be useful,
  20. but WITHOUT ANY WARRANTY; without even the implied warranty of
  21. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  22. GNU General Public License for more details.
  23. You should have received a copy of the GNU General Public License
  24. along with this program; if not, write to the Free Software
  25. Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA
  26. *
  27. *@package Quasi
  28. * @subpackage Modules
  29. */
  30. class AccountOrderModule extends ListModuleBase
  31. {
  32. private $intOrderId;
  33. private $objOrderListView = null;
  34. private $objOrderItemView = null;
  35. /**
  36. * Module constructor
  37. *@param ContentBlockView - objParentObject parent controller object.
  38. *@param array - aryParameters, should contain one element with an order id or be empty
  39. */
  40. public function __construct( $objParentObject, $aryParameters)
  41. {
  42. $this->objParentObject =& $objParentObject;
  43. if(!empty($aryParameters))
  44. $this->intOrderId = array_pop($aryParameters);
  45. try {
  46. parent::__construct($this->objParentObject);
  47. } catch (QCallerException $objExc) {
  48. $objExc->IncrementOffset();
  49. throw $objExc;
  50. }
  51. $this->AutoRenderChildren = true;
  52. // $this->strTemplate = __QUASI_CORE_TEMPLATES__ . '/AccountOrderModule.tpl.php';
  53. if($this->objAccount instanceof Account)
  54. $this->InitPanels();
  55. }
  56. protected function InitPanels()
  57. {
  58. /* $this->pnlListView->RemoveChildControls(false);
  59. $this->pnlItemView->RemoveChildControls(false);*/
  60. $this->pnlItemView->Visible = false;
  61. $this->pnlListView->Visible = false;
  62. if($this->intOrderId)
  63. {
  64. $this->objOrderItemView = new AccountOrderViewPanel($this->pnlItemView, $this, 'CloseItemPanel', $this->intOrderId);
  65. $this->pnlItemView->Visible = true;
  66. }
  67. else
  68. {
  69. $this->objOrderListView = new AccountOrderListPanel($this->pnlListView, $this, 'ShowItemPanel', 'CloseItemPanel', $this->Account->Id);
  70. $this->pnlListView->Visible = true;
  71. }
  72. }
  73. //Overrides the parent to ensure that the list view is populated
  74. public function CloseItemPanel($blnUpdatesMade)
  75. {
  76. if(!$this->objOrderListView)
  77. $this->objOrderListView = new AccountOrderListPanel( $this->pnlListView, $this, 'ShowItemPanel', 'CloseItemPanel', $this->Account->Id );
  78. parent::CloseItemPanel($blnUpdatesMade);
  79. }
  80. public function __get($strName)
  81. {
  82. switch ($strName)
  83. {
  84. default:
  85. try {
  86. return parent::__get($strName);
  87. } catch (QCallerException $objExc) {
  88. $objExc->IncrementOffset();
  89. throw $objExc;
  90. }
  91. }
  92. }
  93. public function __set($strName, $mixValue)
  94. {
  95. switch ($strName)
  96. {
  97. default:
  98. try {
  99. return (parent::__set($strName, $mixValue));
  100. } catch (QCallerException $objExc) {
  101. $objExc->IncrementOffset();
  102. throw $objExc;
  103. }
  104. }
  105. }
  106. }//end class
  107. }//end define
  108. ?>