<?php /** * Copyright (C) 2020 Leipzig University Library * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * * @author Sebastian Kehr <kehr@ub.uni-leipzig.de> * @license http://opensource.org/licenses/gpl-2.0.php GNU GPLv2 */ use Zend\Filter\Boolean; use Zend\Form\Element\Checkbox; use Zend\Form\Element\Hidden; use Zend\Form\Element\Select; use Zend\Form\Element\Text; use Zend\Form\Fieldset; use Zend\Validator\NotEmpty; return [ 'validation_group' => [ 'data' => [ 'newsletter', 'deleted' ], ], 'elements' => [ 'job_title' => [ 'spec' => [ 'type' => Select::class, 'options' => [ 'value_options' => [ 'job_title_2', 'job_title_3', 'job_title_4', 'job_title_5', 'job_title_6', 'job_title_7', 'job_title_8', 'job_title_9', ], ], ], ], 'addresses' => [ 'spec' => [ 'elements' => [ 'address_0' => [ 'spec' => [ 'options' => [ 'label' => 'label_address_0', 'template' => 'fid/user/office-address-fieldset.phtml', ], ], ], 'address_1' => [ 'spec' => [ 'name' => 1, 'type' => Fieldset::class, 'options' => [ 'label' => 'label_address_1', 'template' => 'fid/user/home-address-fieldset.phtml', ], 'elements' => [ 'id' => [ 'spec' => [ 'name' => 'id', 'type' => Hidden::class, ], ], 'line1' => [ 'spec' => [ 'name' => 'line1', 'options' => [ 'label' => 'label_address_1_line_1', ], 'attributes' => [ 'readonly' => true, ], ], ], 'line2' => [ 'spec' => [ 'name' => 'line2', 'options' => [ 'label' => 'label_address_1_line_2', ], 'attributes' => [ 'readonly' => true, ], ], ], 'zip' => [ 'spec' => [ 'name' => 'zip', 'options' => [ 'label' => 'label_address_1_zip', ], 'attributes' => [ 'readonly' => true, ], ], ], 'city' => [ 'spec' => [ 'name' => 'city', 'options' => [ 'label' => 'label_address_1_city', ], 'attributes' => [ 'readonly' => true, ], ], ], 'country' => [ 'spec' => [ 'name' => 'country', 'options' => [ 'label' => 'label_address_1_country', ], 'attributes' => [ 'readonly' => true, ], ], ], ], ], ], ], ], ], 'data' => [ 'spec' => [ 'elements' => [ 'phone' => [ 'spec' => [ 'name' => 'phone', 'type' => Text::class, 'options' => [ 'label' => 'label_phone', ], 'attributes' => [ 'readonly' => true, ], ], ], 'newsletter' => [ 'spec' => [ 'name' => 'newsletter', 'type' => Checkbox::class, 'options' => [ 'label' => 'label_newsletter', ], ], ], 'deleted' => [ 'spec' => [ 'name' => 'deleted', 'type' => Checkbox::class, 'options' => [ 'label' => 'label_deleted', ], ], ], 'delivery_address' => [ 'spec' => [ 'name' => 'delivery_address', 'type' => Checkbox::class, 'options' => [ 'label' => 'label_delivery_address', ], 'attributes' => [ 'disabled' => true, ], ], ], ], 'options' => [ 'input_filter_spec' => [ 'newsletter' => [ 'name' => 'newsletter', 'filters' => [ Boolean::class => [ 'name' => Boolean::class, ], ], 'validators' => [ NotEmpty::class => [ 'name' => NotEmpty::class, 'options' => [ 'type' => NotEmpty::NULL, ], ], ], ], 'deleted' => [ 'name' => 'deleted', 'filters' => [ Boolean::class => [ 'name' => Boolean::class, ], ], 'validators' => [ NotEmpty::class => [ 'name' => NotEmpty::class, 'options' => [ 'type' => NotEmpty::NULL, ], ], ], ], ], ], ], ], ], ];