|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace Tkotosz\CommandScheduler\Block\Adminhtml\Schedule\Create\From; |
|
4
|
|
|
|
|
5
|
|
|
use Magento\Backend\Block\Widget\Form\Container as BaseFormContainer; |
|
|
|
|
|
|
6
|
|
|
|
|
7
|
|
|
class Container extends BaseFormContainer |
|
8
|
|
|
{ |
|
9
|
|
|
/** |
|
10
|
|
|
* Core registry |
|
11
|
|
|
* |
|
12
|
|
|
* @var \Magento\Framework\Registry |
|
13
|
|
|
*/ |
|
14
|
|
|
protected $coreRegistry = null; |
|
15
|
|
|
|
|
16
|
|
|
/** |
|
17
|
|
|
* @param \Magento\Backend\Block\Widget\Context $context |
|
18
|
|
|
* @param \Magento\Framework\Registry $registry |
|
19
|
|
|
* @param array $data |
|
20
|
|
|
*/ |
|
21
|
|
|
public function __construct( |
|
22
|
|
|
\Magento\Backend\Block\Widget\Context $context, |
|
|
|
|
|
|
23
|
|
|
\Magento\Framework\Registry $registry, |
|
24
|
|
|
array $data = [] |
|
25
|
|
|
) { |
|
26
|
|
|
$this->coreRegistry = $registry; |
|
27
|
|
|
parent::__construct($context, $data); |
|
28
|
|
|
} |
|
29
|
|
|
|
|
30
|
|
|
/** |
|
31
|
|
|
* Internal constructor |
|
32
|
|
|
* |
|
33
|
|
|
* @return void |
|
34
|
|
|
*/ |
|
35
|
|
|
protected function _construct() |
|
36
|
|
|
{ |
|
37
|
|
|
$this->_objectId = 'schedule_id'; |
|
|
|
|
|
|
38
|
|
|
$this->_blockGroup = 'Tkotosz_CommandScheduler'; |
|
|
|
|
|
|
39
|
|
|
$this->_controller = 'adminhtml_schedule'; |
|
|
|
|
|
|
40
|
|
|
$this->_mode = 'create'; |
|
|
|
|
|
|
41
|
|
|
parent::_construct(); |
|
42
|
|
|
} |
|
43
|
|
|
|
|
44
|
|
|
|
|
45
|
|
|
public function getFromData() |
|
46
|
|
|
{ |
|
47
|
|
|
return $this->coreRegistry->registry('tkotosz_command_scheduler_data_container'); |
|
|
|
|
|
|
48
|
|
|
} |
|
49
|
|
|
|
|
50
|
|
|
/** |
|
51
|
|
|
* Prepare layout. |
|
52
|
|
|
* Adding save_and_continue button |
|
53
|
|
|
* |
|
54
|
|
|
* @return $this |
|
55
|
|
|
*/ |
|
56
|
|
|
protected function _preparelayout() |
|
57
|
|
|
{ |
|
58
|
|
|
if (!$this->getFromData()->getData('command')) { |
|
59
|
|
|
$this->removeButton('save'); |
|
60
|
|
|
} |
|
61
|
|
|
|
|
62
|
|
|
return parent::_prepareLayout(); |
|
63
|
|
|
} |
|
64
|
|
|
|
|
65
|
|
|
/** |
|
66
|
|
|
* Return translated header text depending on creating/editing action |
|
67
|
|
|
* |
|
68
|
|
|
* @return \Magento\Framework\Phrase |
|
69
|
|
|
*/ |
|
70
|
|
|
public function getHeaderText() |
|
71
|
|
|
{ |
|
72
|
|
|
return __('New Schedule'); |
|
73
|
|
|
} |
|
74
|
|
|
|
|
75
|
|
|
/** |
|
76
|
|
|
* Return save url for edit form |
|
77
|
|
|
* |
|
78
|
|
|
* @return string |
|
79
|
|
|
*/ |
|
80
|
|
|
public function getSaveUrl() |
|
81
|
|
|
{ |
|
82
|
|
|
return $this->getUrl('tkotosz_commandscheduler/schedule/save', ['_current' => false, 'back' => null]); |
|
83
|
|
|
} |
|
84
|
|
|
} |
|
85
|
|
|
|
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths