BxPaymentGridSbsList.php 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <?php defined('BX_DOL') or die('hack attempt');
  2. /**
  3. * Copyright (c) UNA, Inc - https://una.io
  4. * MIT License - https://opensource.org/licenses/MIT
  5. *
  6. * @defgroup Payment Payment
  7. * @ingroup UnaModules
  8. *
  9. * @{
  10. */
  11. class BxPaymentGridSbsList extends BxBaseModPaymentGridOrders
  12. {
  13. public function __construct ($aOptions, $oTemplate = false)
  14. {
  15. $this->MODULE = 'bx_payment';
  16. parent::__construct ($aOptions, $oTemplate);
  17. $this->_sOrdersType = BX_PAYMENT_ORDERS_TYPE_SUBSCRIPTION;
  18. }
  19. protected function _getCellProvider($mixedValue, $sKey, $aField, $aRow)
  20. {
  21. return parent::_getCellDefault(_t('_bx_payment_txt_name_' . $mixedValue), $sKey, $aField, $aRow);
  22. }
  23. protected function _getActionActions ($sType, $sKey, $a, $isSmall = false, $isDisabled = false, $aRow = array())
  24. {
  25. unset($a['attr']['bx_grid_action_single']);
  26. $a['attr'] = array_merge($a['attr'], array(
  27. "onclick" => "bx_menu_popup('" . $this->_oModule->_oConfig->getObject('menu_sbs_actions') . "', this, {id: 'bx-payment-subscription-" . $aRow['id'] . "'}, {id: " . $aRow['id'] . "});"
  28. ));
  29. return parent::_getActionDefault($sType, $sKey, $a, false, $isDisabled, $aRow);
  30. }
  31. protected function _getDataSql($sFilter, $sOrderField, $sOrderDir, $iStart, $iPerPage)
  32. {
  33. if(empty($this->_aQueryAppend['client_id']))
  34. return array();
  35. $this->_aOptions['source'] .= $this->_oModule->_oDb->prepareAsString(" AND `client_id`=?", $this->_aQueryAppend['client_id']);
  36. return parent::_getDataSql($sFilter, $sOrderField, $sOrderDir, $iStart, $iPerPage);
  37. }
  38. }
  39. /** @} */