Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 22 |
|
0.00% |
0 / 3 |
CRAP | |
0.00% |
0 / 1 |
| IrregularitiesExportForm | |
0.00% |
0 / 22 |
|
0.00% |
0 / 3 |
20 | |
0.00% |
0 / 1 |
| __construct | |
0.00% |
0 / 3 |
|
0.00% |
0 / 1 |
2 | |||
| initForm | |
0.00% |
0 / 8 |
|
0.00% |
0 / 1 |
2 | |||
| initElements | |
0.00% |
0 / 11 |
|
0.00% |
0 / 1 |
6 | |||
| 1 | <?php |
| 2 | |
| 3 | /** |
| 4 | * This program is free software; you can redistribute it and/or |
| 5 | * modify it under the terms of the GNU General Public License |
| 6 | * as published by the Free Software Foundation; under version 2 |
| 7 | * of the License (non-upgradable). |
| 8 | * |
| 9 | * This program is distributed in the hope that it will be useful, |
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 | * GNU General Public License for more details. |
| 13 | * |
| 14 | * You should have received a copy of the GNU General Public License |
| 15 | * along with this program; if not, write to the Free Software |
| 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
| 17 | * |
| 18 | * Copyright (c) 2016 (original work) Open Assessment Technologies SA; |
| 19 | * |
| 20 | * |
| 21 | */ |
| 22 | |
| 23 | namespace oat\taoProctoring\controller\form; |
| 24 | |
| 25 | /** |
| 26 | * |
| 27 | * @access public |
| 28 | * @author Antoine Robin, <antoine.robin@vesperiagroup.com> |
| 29 | */ |
| 30 | class IrregularitiesExportForm extends \tao_helpers_form_FormContainer |
| 31 | { |
| 32 | private $instanceUri; |
| 33 | |
| 34 | /** |
| 35 | * IrregularitiesExportForm constructor. |
| 36 | * @param $instanceUri |
| 37 | * @param array $data |
| 38 | * @param array $options |
| 39 | */ |
| 40 | public function __construct($instanceUri, $data = [], $options = []) |
| 41 | { |
| 42 | $this->instanceUri = $instanceUri; |
| 43 | parent::__construct($data, $options); |
| 44 | } |
| 45 | |
| 46 | protected function initForm() |
| 47 | { |
| 48 | $this->form = new \tao_helpers_form_xhtml_Form('export-form'); |
| 49 | $submitElt = \tao_helpers_form_FormFactory::getElement('export', 'Free'); |
| 50 | $submitElt->setValue( |
| 51 | '<a href="#" class="form-submitter btn-success small"><span class="icon-export"></span> ' |
| 52 | . __('Export') . '</a>' |
| 53 | ); |
| 54 | |
| 55 | $this->form->setActions(array($submitElt), 'bottom'); |
| 56 | $this->form->setActions(array(), 'top'); |
| 57 | } |
| 58 | |
| 59 | /** |
| 60 | * Used to create the form elements and bind them to the form instance |
| 61 | * |
| 62 | * @access protected |
| 63 | * @return mixed |
| 64 | */ |
| 65 | protected function initElements() |
| 66 | { |
| 67 | //create date picker elements |
| 68 | $fromDateElt = \tao_helpers_form_FormFactory::getElement('from', 'calendar'); |
| 69 | $fromDateElt->setDescription(__('Start date of the export')); |
| 70 | |
| 71 | |
| 72 | $toDateElt = \tao_helpers_form_FormFactory::getElement('to', 'calendar'); |
| 73 | $toDateElt->setDescription(__('End date of the export')); |
| 74 | $toDateElt->setValue(time()); |
| 75 | |
| 76 | $this->form->addElement($fromDateElt); |
| 77 | $this->form->addElement($toDateElt); |
| 78 | |
| 79 | if (!is_null($this->instanceUri)) { |
| 80 | $instanceElt = \tao_helpers_form_FormFactory::getElement('uri', 'Hidden'); |
| 81 | $instanceElt->setValue($this->instanceUri); |
| 82 | $this->form->addElement($instanceElt); |
| 83 | } |
| 84 | } |
| 85 | } |