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.

104 lines
4.4 KiB

  1. <?php
  2. /**
  3. * This is the abstract Panel class for the List All functionality
  4. * of the PaypalTransaction class. This code-generated class
  5. * contains a datagrid to display an HTML page that can
  6. * list a collection of PaypalTransaction objects. It includes
  7. * functionality to perform pagination and sorting on columns.
  8. *
  9. * To take advantage of some (or all) of these control objects, you
  10. * must create a new QPanel which extends this PaypalTransactionListPanelBase
  11. * class.
  12. *
  13. * Any and all changes to this file will be overwritten with any subsequent re-
  14. * code generation.
  15. *
  16. * @package Quinta
  17. * @subpackage AdminUI
  18. *
  19. */
  20. class PaypalTransactionListPanel extends QPanel {
  21. // Local instance of the Meta DataGrid to list PaypalTransactions
  22. public $dtgPaypalTransactions;
  23. // Other public QControls in this panel
  24. public $btnCreateNew;
  25. public $pxyEdit;
  26. // Callback Method Names
  27. protected $strSetEditPanelMethod;
  28. protected $strCloseEditPanelMethod;
  29. public function __construct($objParentObject, $strSetEditPanelMethod, $strCloseEditPanelMethod, $strControlId = null) {
  30. // Call the Parent
  31. try {
  32. parent::__construct($objParentObject, $strControlId);
  33. } catch (QCallerException $objExc) {
  34. $objExc->IncrementOffset();
  35. throw $objExc;
  36. }
  37. // Record Method Callbacks
  38. $this->strSetEditPanelMethod = $strSetEditPanelMethod;
  39. $this->strCloseEditPanelMethod = $strCloseEditPanelMethod;
  40. // Setup the Template
  41. $this->Template = 'PaypalTransactionListPanel.tpl.php';
  42. // Instantiate the Meta DataGrid
  43. $this->dtgPaypalTransactions = new PaypalTransactionDataGrid($this);
  44. // Style the DataGrid (if desired)
  45. $this->dtgPaypalTransactions->CssClass = 'datagrid';
  46. $this->dtgPaypalTransactions->AlternateRowStyle->CssClass = 'alternate';
  47. // Add Pagination (if desired)
  48. $this->dtgPaypalTransactions->Paginator = new QPaginator($this->dtgPaypalTransactions);
  49. $this->dtgPaypalTransactions->ItemsPerPage = 8;
  50. // Use the MetaDataGrid functionality to add Columns for this datagrid
  51. // Create an Edit Column
  52. $this->pxyEdit = new QControlProxy($this);
  53. $this->pxyEdit->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'pxyEdit_Click'));
  54. $this->dtgPaypalTransactions->MetaAddEditProxyColumn($this->pxyEdit, 'Edit', 'Edit');
  55. // Create the Other Columns (note that you can use strings for paypal_transaction's properties, or you
  56. // can traverse down QQN::paypal_transaction() to display fields that are down the hierarchy)
  57. $this->dtgPaypalTransactions->MetaAddColumn('Id');
  58. $this->dtgPaypalTransactions->MetaAddColumn(QQN::PaypalTransaction()->Order);
  59. $this->dtgPaypalTransactions->MetaAddColumn('CorrelationId');
  60. $this->dtgPaypalTransactions->MetaAddColumn('TransactionId');
  61. $this->dtgPaypalTransactions->MetaAddColumn('PpToken');
  62. $this->dtgPaypalTransactions->MetaAddColumn('PayerId');
  63. $this->dtgPaypalTransactions->MetaAddColumn('PayerStatus');
  64. $this->dtgPaypalTransactions->MetaAddColumn('PaymentStatus');
  65. $this->dtgPaypalTransactions->MetaAddColumn('AckReturned');
  66. $this->dtgPaypalTransactions->MetaAddColumn('ApiAction');
  67. $this->dtgPaypalTransactions->MetaAddColumn('TimeStamp');
  68. $this->dtgPaypalTransactions->MetaAddColumn('ApiVersion');
  69. $this->dtgPaypalTransactions->MetaAddColumn('Messages');
  70. $this->dtgPaypalTransactions->MetaAddColumn('Amount');
  71. $this->dtgPaypalTransactions->MetaAddColumn('PpFee');
  72. $this->dtgPaypalTransactions->MetaAddColumn(QQN::PaypalTransaction()->PaymentMethod);
  73. // Setup the Create New button
  74. $this->btnCreateNew = new QButton($this);
  75. $this->btnCreateNew->Text = QApplication::Translate('Create a New') . ' ' . QApplication::Translate('PaypalTransaction');
  76. $this->btnCreateNew->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'btnCreateNew_Click'));
  77. }
  78. public function pxyEdit_Click($strFormId, $strControlId, $strParameter) {
  79. $strParameterArray = explode(',', $strParameter);
  80. $objEditPanel = new PaypalTransactionEditPanel($this, $this->strCloseEditPanelMethod, $strParameterArray[0]);
  81. $strMethodName = $this->strSetEditPanelMethod;
  82. $this->objForm->$strMethodName($objEditPanel);
  83. }
  84. public function btnCreateNew_Click($strFormId, $strControlId, $strParameter) {
  85. $objEditPanel = new PaypalTransactionEditPanel($this, $this->strCloseEditPanelMethod, null);
  86. $strMethodName = $this->strSetEditPanelMethod;
  87. $this->objForm->$strMethodName($objEditPanel);
  88. }
  89. }
  90. ?>