DeleteListDataProvider.php 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <?php
  2. namespace ThurData\Servers\KerioEmail\App\UI\Client\DistributionList\Providers;
  3. use ThurData\Servers\KerioEmail\App\Helpers\KerioManager;
  4. use ThurData\Servers\KerioEmail\App\Libs\Product\ProductManager;
  5. use ThurData\Servers\KerioEmail\App\Libs\Kerio\Components\Api\Soap\Services\Create\CreateDistributionList;
  6. use ThurData\Servers\KerioEmail\App\Libs\Kerio\Components\Api\Soap\Services\Delete\DeleteDistributionList;
  7. use ThurData\Servers\KerioEmail\Core\UI\ResponseTemplates\HtmlDataJsonResponse;
  8. use ThurData\Servers\KerioEmail\Core\UI\Widget\Forms\DataProviders\BaseDataProvider;
  9. /**
  10. *
  11. * Created by PhpStorm.
  12. * User: ThurData
  13. * Date: 02.10.19
  14. * Time: 08:21
  15. * Class DeleteListDataProvider
  16. */
  17. class DeleteListDataProvider extends BaseDataProvider
  18. {
  19. public function read()
  20. {
  21. $this->data['id'] = $this->actionElementId;
  22. }
  23. public function update()
  24. {
  25. // TODO: Implement update() method.
  26. }
  27. public function delete()
  28. {
  29. /**
  30. * hosting id
  31. */
  32. $hid = $this->request->get('id');
  33. logModuleCall(
  34. 'kerioEmail',
  35. __FUNCTION__,
  36. $this->data,
  37. 'Debug add ML',
  38. $this
  39. );
  40. return (new HtmlDataJsonResponse())->setMessageAndTranslate('distributionListHasBeenDeleted')->setStatusSuccess();
  41. }
  42. public function massDelete()
  43. {
  44. /**
  45. * hosting id
  46. */
  47. $hid = $this->request->get('id');
  48. /**
  49. *
  50. */
  51. foreach($this->request->get('massActions') as $id)
  52. {
  53. logModuleCall(
  54. 'kerioEmail',
  55. __FUNCTION__,
  56. $id,
  57. 'Debug add ML',
  58. $hid
  59. );
  60. }
  61. return (new HtmlDataJsonResponse())->setMessageAndTranslate('massDistributionListHasBeenDeleted')->setStatusSuccess();
  62. }
  63. }