Skip to content
Snippets Groups Projects
  • Sebastian Kehr's avatar
    refs #15998 [fid_adlr] user management forms related changes · 784a6b9b
    Sebastian Kehr authored and Dorian Merz's avatar Dorian Merz committed
    * mark required fields in registration forms
    * map job title to requested permission
    * account for generalization of user creation form
    * translation fix
    * adjustments needed for hydration
    * build attributes after submit of user creation form
    * added newsletter boolean flag
    * adjust user update form
    * use hydrator for all user forms
    * translation fixes
    * override not-empty validator for newsletter field
    * fixup: adjust newsletter field options
    * adjust translations in user profile view and update form
    * include user group in user update form
    * adjust user update form spec
    * rename property for less confusion
    * rename user property and according form fields
    * fix input filter spec for newsletter field
    * render job_title element as select field
    * remove job_title element from update form
    * grant permissions on user creation
    * display user group as non-editable field in update form
    * changes to job title field in update form
    * display job title upda...
    784a6b9b
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
home-address-fieldset.phtml 3.38 KiB
<?php
/**
 * Copyright (C) 2019 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\Form\Element;
use Zend\Form\Fieldset;

/** @var Fieldset $address */
$address = $this->address;
?>

<h3><?= $this->translate('fid::' . $address->getLabel()) ?></h3>

<? /* id */ ?>
<?php
$elemId = $address->get('id');
if ($elemId->getValue()) {
    echo $this->formElement($elemId);
}
?>

<? /* phone */ ?>
<?php
/** @var Element\Text $elemDeliveryAddress */
$elemDeliveryAddress = $this->form->get('data')->get('delivery_address');
$elemDeliveryAddress->setAttribute('id', 'delivery_address');
?>
<div class="form-group eula">
    <div>
        <?= $this->formElement($elemDeliveryAddress) ?>
        <?= $this->formLabel($elemDeliveryAddress) ?>
    </div>
    <?= $this->formElementErrors($elemDeliveryAddress) ?>
</div>

<? /* first line */ ?>
<?php
/** @var Element\Text $elemLine1 */
$elemLine1 = $address->get('line1');
$elemLine1->setLabelAttributes(['class' => 'col-md-4']);
$elemLine1->setAttributes(['class' => 'form-control']);
?>
<div class="form-group">
    <?= $this->formLabel($elemLine1) ?>
    <?= $this->formElement($elemLine1) ?>
    <?= $this->formElementErrors($elemLine1) ?>
</div>

<? /* second line */ ?>
<?php
/** @var Element\Text $elemLine2 */
$elemLine2 = $address->get('line2');
$elemLine2->setLabelAttributes(['class' => 'col-md-4']);
$elemLine2->setAttributes(['class' => 'form-control']);
?>
<div class="form-group">
    <?= $this->formLabel($elemLine2) ?>
    <?= $this->formElement($elemLine2) ?>
    <?= $this->formElementErrors($elemLine2) ?>
</div>

<? /* address zip */ ?>
<?php
/** @var Element\Text $elemZip */
$elemZip = $address->get('zip');
$elemZip->setLabelAttributes(['class' => 'col-md-4']);
$elemZip->setAttributes(['class' => 'form-control']);
?>
<div class="form-group">
    <?= $this->formLabel($elemZip) ?>
    <?= $this->formElement($elemZip) ?>
    <?= $this->formElementErrors($elemZip) ?>
</div>

<? /* city */ ?>
<?php
/** @var Element\Text $elemCity */
$elemCity = $address->get('city');
$elemCity->setLabelAttributes(['class' => 'col-md-4']);
$elemCity->setAttributes(['class' => 'form-control']);
?>
<div class="form-group">
    <?= $this->formLabel($elemCity) ?>
    <?= $this->formElement($elemCity) ?>
    <?= $this->formElementErrors($elemCity) ?>
</div>

<? /* country */ ?>
<?php
/** @var Element\Text $elemCountry */
$elemCountry = $address->get('country');
$elemCountry->setLabelAttributes(['class' => 'col-md-4']);
$elemCountry->setAttributes(['class' => 'form-control']);
?>
<div class="form-group">
    <?= $this->formLabel($elemCountry) ?>
    <?= $this->formElement($elemCountry) ?>
    <?= $this->formElementErrors($elemCountry) ?>
</div>