123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- <?php
- namespace App\Admin\Actions\Grid;
- use Dcat\Admin\Actions\Response;
- use Dcat\Admin\Admin;
- use Dcat\Admin\Grid\BatchAction;
- use Illuminate\Http\Request;
- use App\Admin\Forms\InquiryAssignment as InquiryAssignmentForm;
- use Dcat\Admin\Widgets\Modal;
- class InquiryAssignment extends BatchAction
- {
-
- public function render()
- {
- $assignment = admin_trans_label('assignment');
- $button = '<button type="button" class="btn btn-success">'.$assignment.'</button>';
-
- return Modal::make()
- ->lg()
- ->title(admin_trans_label('inquiry_assignment'))
- ->body(InquiryAssignmentForm::make())
-
- ->onShow($this->getModalScript())
-
- ->button($button);
- }
-
- public function getModalScript(){
- $warning = admin_trans_label('no_selected_data');
- return <<<JS
- try {
- var key = {$this->getSelectedKeysScript()}
- $('#inquiryIds').val(key);
- } catch (e) {
- Dcat.error('{$warning}');
- return false;
- }
- JS;
- }
- public function getSelectedKeysScript()
- {
- return "Dcat.grid.selected('{$this->parent->getName()}')";
- }
- }
|