Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 21 |
|
0.00% |
0 / 1 |
CRAP | |
0.00% |
0 / 1 |
| DeliveryResultGrid | |
0.00% |
0 / 21 |
|
0.00% |
0 / 1 |
56 | |
0.00% |
0 / 1 |
| initColumns | |
0.00% |
0 / 21 |
|
0.00% |
0 / 1 |
56 | |||
| 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) 2008-2010 (original work) Deutsche Institut für Internationale Pädagogische Forschung |
| 19 | * (under the project TAO-TRANSFER); |
| 20 | * 2009-2012 (update and modification) Public Research Centre Henri Tudor |
| 21 | * (under the project TAO-SUSTAIN & TAO-DEV); |
| 22 | */ |
| 23 | |
| 24 | namespace oat\taoOutcomeUi\helper; |
| 25 | |
| 26 | use oat\taoResultServer\models\classes\ResultService; |
| 27 | use oat\generis\model\OntologyRdf; |
| 28 | use oat\generis\model\OntologyRdfs; |
| 29 | use tao_helpers_grid_Cell_ResourceLabelAdapter; |
| 30 | use tao_helpers_grid_GridContainer; |
| 31 | |
| 32 | /** |
| 33 | * Short description of class oat\taoOutcomeUi\helper\DeliveryResultGrid |
| 34 | * |
| 35 | * @access public |
| 36 | * @author Somsack Sipasseuth, <somsack.sipasseuth@tudor.lu> |
| 37 | * @package wfEngine |
| 38 | |
| 39 | */ |
| 40 | class DeliveryResultGrid extends tao_helpers_grid_GridContainer |
| 41 | { |
| 42 | // --- ASSOCIATIONS --- |
| 43 | |
| 44 | |
| 45 | // --- ATTRIBUTES --- |
| 46 | |
| 47 | /** |
| 48 | * Short description of attribute processExecutions |
| 49 | * |
| 50 | * @access protected |
| 51 | * @var array |
| 52 | */ |
| 53 | protected $processExecutions = []; |
| 54 | |
| 55 | // --- OPERATIONS --- |
| 56 | |
| 57 | /** |
| 58 | * Short description of method initColumns |
| 59 | * |
| 60 | * @access protected |
| 61 | * @author Somsack Sipasseuth, <somsack.sipasseuth@tudor.lu> |
| 62 | * @return boolean |
| 63 | */ |
| 64 | protected function initColumns() |
| 65 | { |
| 66 | $returnValue = (bool) false; |
| 67 | |
| 68 | $excludedProperties = (is_array($this->options) && isset($this->options['excludedProperties'])) |
| 69 | ? $this->options['excludedProperties'] |
| 70 | : []; |
| 71 | $columnNames = (is_array($this->options) && isset($this->options['columnNames'])) |
| 72 | ? $this->options['columnNames'] |
| 73 | : []; |
| 74 | |
| 75 | |
| 76 | $processProperties = [ |
| 77 | OntologyRdfs::RDFS_LABEL => __('Label'), |
| 78 | ResultService::DELIVERY_CLASS_URI => __('Delivery'), |
| 79 | ResultService::SUBJECT_CLASS_URI => __('Test taker'), |
| 80 | OntologyRdf::RDF_TYPE => __('Class') |
| 81 | ]; |
| 82 | |
| 83 | foreach ($processProperties as $processPropertyUri => $label) { |
| 84 | if (!isset($excludedProperties[$processPropertyUri])) { |
| 85 | $column = $this->grid->addColumn($processPropertyUri, $label); |
| 86 | } |
| 87 | } |
| 88 | |
| 89 | $this->grid->setColumnsAdapter( |
| 90 | array_keys($processProperties), |
| 91 | new tao_helpers_grid_Cell_ResourceLabelAdapter() |
| 92 | ); |
| 93 | |
| 94 | return (bool) $returnValue; |
| 95 | } |
| 96 | } |