BxStripeConnectGridAccounts.php 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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 StripeConnect Stripe Connect
  7. * @ingroup TridentModules
  8. *
  9. * @{
  10. */
  11. class BxStripeConnectGridAccounts extends BxTemplGrid
  12. {
  13. protected $_sModule;
  14. protected $_oModule;
  15. public function __construct ($aOptions, $oTemplate = false)
  16. {
  17. $this->_sModule = 'bx_stripe_connect';
  18. $this->_oModule = BxDolModule::getInstance($this->_sModule);
  19. parent::__construct ($aOptions, $oTemplate);
  20. }
  21. protected function _isVisibleGrid ($a)
  22. {
  23. return isAdmin();
  24. }
  25. protected function _getCellProfileId($mixedValue, $sKey, $aField, $aRow)
  26. {
  27. return parent::_getCellDefault($this->_oModule->_oTemplate->displayProfileLink($mixedValue), $sKey, $aField, $aRow);
  28. }
  29. protected function _getCellLiveDetails($mixedValue, $sKey, $aField, $aRow)
  30. {
  31. return $this->__getCellDetails($mixedValue, $sKey, $aField, $aRow);
  32. }
  33. protected function _getCellTestDetails($mixedValue, $sKey, $aField, $aRow)
  34. {
  35. return $this->__getCellDetails($mixedValue, $sKey, $aField, $aRow);
  36. }
  37. protected function __getCellDetails($mixedValue, $sKey, $aField, $aRow)
  38. {
  39. return parent::_getCellDefault(_t((int)$mixedValue != 0 ? '_Yes' : '_No'), $sKey, $aField, $aRow);
  40. }
  41. protected function _getCellAdded($mixedValue, $sKey, $aField, $aRow)
  42. {
  43. return $this->__getCellDate($mixedValue, $sKey, $aField, $aRow);
  44. }
  45. protected function _getCellChanged($mixedValue, $sKey, $aField, $aRow)
  46. {
  47. return $this->__getCellDate($mixedValue, $sKey, $aField, $aRow);
  48. }
  49. protected function __getCellDate($mixedValue, $sKey, $aField, $aRow)
  50. {
  51. return parent::_getCellDefault(bx_time_js($mixedValue), $sKey, $aField, $aRow);
  52. }
  53. protected function _delete($mixedId)
  54. {
  55. return $this->_oModule->deleteAccount($mixedId);
  56. }
  57. }
  58. /** @} */