The Gitlab instance will be restarted on Monday April 28th at 2AM. There will be a short interruption of service.

Skip to content
Snippets Groups Projects
Commit 33e9cfb9 authored by Gregor Gawol's avatar Gregor Gawol Committed by Dorian Merz
Browse files

refs #16783 [fid_bbi] registration form

* set firstname and lastname as required false
* set translations
* set hidden field salutation
parent 9499fa04
No related merge requests found
;####################################################################
;##################### DO NOT DELETE THIS HEADER ####################
;################### Leipzig University Library © 2015 ##############
;
; This is an instance-specific default LANGUAGE-file and inherits
; all the settings from the LANGUAGE-file defined in @parent_ini which
; points to the default LANGUAGE-file located in the folder
; vufind2/local/languages
;
@parent_ini = "../../../fid/languages/de.ini"
;
; Add instance-specific customization after this header.
;
;##################### DO NOT DELETE THIS HEADER ####################
;####################################################################
required_fields_note = "* Pflichtfeld"
;####################################################################
;##################### DO NOT DELETE THIS HEADER ####################
;################### Leipzig University Library © 2015 ##############
;
; This is an instance-specific default LANGUAGE-file and inherits
; all the settings from the LANGUAGE-file defined in @parent_ini which
; points to the default LANGUAGE-file located in the folder
; vufind2/local/languages
;
@parent_ini = "../../../fid/languages/en.ini"
;
; Add instance-specific customization after this header.
;
;##################### DO NOT DELETE THIS HEADER ####################
;####################################################################
required_fields_note = "* This field is required"
<?php <?php
/** /**
* Copyright (C) 2019 Leipzig University Library * Copyright (C) 2020 Leipzig University Library
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License version 2 as
...@@ -16,6 +16,8 @@ ...@@ -16,6 +16,8 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
* *
* @author Sebastian Kehr <kehr@ub.uni-leipzig.de> * @author Sebastian Kehr <kehr@ub.uni-leipzig.de>
* @author Gregor Gawol <gawol@ub.uni-leipzig.de>
* @author Alexander Purr <purr@ub.uni-leipzig.de>
* @license http://opensource.org/licenses/gpl-2.0.php GNU GPLv2 * @license http://opensource.org/licenses/gpl-2.0.php GNU GPLv2
*/ */
...@@ -25,7 +27,10 @@ use VuFind\Db\Row\Tags as BaseTagsRow; ...@@ -25,7 +27,10 @@ use VuFind\Db\Row\Tags as BaseTagsRow;
use VuFind\Db\Table\GatewayFactory as TableGatewayFactory; use VuFind\Db\Table\GatewayFactory as TableGatewayFactory;
$config = [ $config = [
'forms' => require_once 'form.config.php', 'forms' => [
'user-init-form' => require 'user-init-form.php',
'user-create-form' => require 'user-create-form.php',
],
'controllers' => [ 'controllers' => [
'factories' => [ 'factories' => [
'fid_bbi\Controller\FeedbackController' => 'VuFind\Controller\AbstractBaseFactory', 'fid_bbi\Controller\FeedbackController' => 'VuFind\Controller\AbstractBaseFactory',
......
<?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>
* @author Gregor Gawol <gawol@ub.uni-leipzig.de>
* @author Alexander Purr <purr@ub.uni-leipzig.de>
* @license http://opensource.org/licenses/gpl-2.0.php GNU GPLv2
*/
return [
'elements' => [
'firstname' => [
'spec' => [
'attributes' => [
'required' => false,
],
],
],
'lastname' => [
'spec' => [
'attributes' => [
'required' => false,
],
],
],
],
'input_filter' => [
'firstname' => [
'required' => false,
],
'lastname' => [
'required' => false,
],
],
];
<?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>
* @author Gregor Gawol <gawol@ub.uni-leipzig.de>
* @author Alexander Purr <purr@ub.uni-leipzig.de>
* @license http://opensource.org/licenses/gpl-2.0.php GNU GPLv2
*/
return [
'elements' => [
'firstname' => [
'spec' => [
'attributes' => [
'required' => false,
],
],
],
'lastname' => [
'spec' => [
'attributes' => [
'required' => false,
],
],
],
],
'input_filter' => [
'firstname' => [
'required' => false,
],
'lastname' => [
'required' => false,
],
],
];
\ No newline at end of file
...@@ -20,56 +20,42 @@ ...@@ -20,56 +20,42 @@
* @license http://opensource.org/licenses/gpl-2.0.php GNU GPLv2 * @license http://opensource.org/licenses/gpl-2.0.php GNU GPLv2
*/ */
use Zend\Form\Element;
use Zend\Form\Element\Checkbox; use Zend\Form\Element\Checkbox;
use Zend\Form\Element\Submit; use Zend\Form\Element\Submit;
use Zend\Form\Form; use Zend\Form\Form;
use Zend\Form\Element as Element;
use Zend\Form\View\Helper\FormElementErrors; use Zend\Form\View\Helper\FormElementErrors;
use Zend\Form\View\Helper\FormLabel; use Zend\Form\View\Helper\FormLabel;
use Zend\Form\View\Helper\FormRadio; use Zend\Form\View\Helper\FormRadio;
use Zend\Form\View\Helper\FormSelect; use Zend\Form\View\Helper\FormSelect;
use Zend\Form\View\Helper\FormSubmit; use Zend\Form\View\Helper\FormSubmit;
use Zend\I18n\Translator\TranslatorInterface;
/** @var Form $form */
/** @var FormLabel $formLabel */ /** @var FormLabel $formLabel */
/** @var FormRadio $formRadio */
/** @var FormSelect $formSelect */
/** @var FormSubmit $formSubmit */
/** @var FormElementErrors $formElementErrors */
$form = $this->form;
$formLabel = $this->formLabel(); $formLabel = $this->formLabel();
/**@var FormRadio $formRadio */
$formRadio = $this->formRadio(); $formRadio = $this->formRadio();
/**@var FormSelect $formSelect */
$formSelect = $this->formSelect(); $formSelect = $this->formSelect();
/**@var FormSubmit $formSubmit */
$formSubmit = $this->formSubmit(); $formSubmit = $this->formSubmit();
/** @var FormElementErrors $formElementErrors */
$formElementErrors = $this->formElementErrors(); $formElementErrors = $this->formElementErrors();
$formLabel->setTranslatorTextDomain('fid'); $formLabel->setTranslatorTextDomain('fid');
$formSelect->setTranslatorTextDomain('fid'); $formSelect->setTranslatorTextDomain('fid');
$formRadio->setTranslatorTextDomain('fid'); $formRadio->setTranslatorTextDomain('fid');
$formSubmit->setTranslatorTextDomain('fid'); $formSubmit->setTranslatorTextDomain('fid');
$formElementErrors->setTranslatorTextDomain('fid'); $formElementErrors->setTranslatorTextDomain('fid');
/** @var TranslatorInterface $translator */ $this->headTitle($title = $this->translate("fid::user_create_form_title"));
$translator = $this->getHelperPluginManager()->get('translate')
->getTranslator();
$formLabel->setTranslator($translator);
$formElementErrors->setTranslator($translator);
/** @var Form $form */
$form = $this->form;
$form->setAttribute('method', 'post');
$form->setAttribute('action', $this->url('fid/user/create'));
$form->setAttribute('class', 'fid-user-create-form registration');
$form->prepare();
$this->headTitle($this->translate('Profile Form'));
$this->headTitle($this->translate("fid::user_create_form_title"));
?> ?>
<h2><?= $title ?></h2>
<div><?= $this->transEsc("fid::required_fields_note") ?></div>
<?= $this->flashmessages() ?> <?= $this->flashmessages() ?>
<?= $this->form()->openTag($form) ?> <?= $this->form()->openTag($form) ?>
<h2><?= $this->translate("fid::user_create_form_title") ?></h2> <br/>
<div class="subito-pg">
* <?= $this->transEsc("This field is required") ?>
</div>
<? /* username */ ?> <? /* username */ ?>
<?php <?php
/** @var Element\Text $elemUsername */ /** @var Element\Text $elemUsername */
...@@ -77,16 +63,16 @@ $elemUsername = $form->get('username'); ...@@ -77,16 +63,16 @@ $elemUsername = $form->get('username');
$elemUsername->setLabelAttributes(['class' => 'col-md-4']); $elemUsername->setLabelAttributes(['class' => 'col-md-4']);
$elemUsername->setAttributes(['class' => 'form-control', 'disabled' => 1]); $elemUsername->setAttributes(['class' => 'form-control', 'disabled' => 1]);
?> ?>
<div class="form-group"> <div class="form-group">
<?= $this->formLabel($elemUsername) ?> <?= $this->formLabel($elemUsername) ?>
<?= $this->formElement($elemUsername) ?> <?= $this->formElement($elemUsername) ?>
<?= $this->formElementErrors($elemUsername) ?> <?= $this->formElementErrors($elemUsername) ?>
<?php <?php
$elemUsername->removeAttribute('disabled'); $elemUsername->removeAttribute('disabled');
$elemUsername->setAttribute('type', 'hidden'); $elemUsername->setAttribute('type', 'hidden');
echo $this->formElement($elemUsername); ?>
?> <?= $this->formElement($elemUsername) ?>
</div> </div>
<? /* password */ ?> <? /* password */ ?>
<?php <?php
...@@ -95,11 +81,11 @@ $elemPassword = $form->get('password'); ...@@ -95,11 +81,11 @@ $elemPassword = $form->get('password');
$elemPassword->setLabelAttributes(['class' => 'col-md-4']); $elemPassword->setLabelAttributes(['class' => 'col-md-4']);
$elemPassword->setAttributes(['class' => 'form-control']); $elemPassword->setAttributes(['class' => 'form-control']);
?> ?>
<div class="form-group"> <div class="form-group">
<?= $this->formLabel($elemPassword) ?> <?= $this->formLabel($elemPassword) ?>
<?= $this->formElement($elemPassword) ?> <?= $this->formElement($elemPassword) ?>
<?= $this->formElementErrors($elemPassword) ?> <?= $this->formElementErrors($elemPassword) ?>
</div> </div>
<? /* password confirmation */ ?> <? /* password confirmation */ ?>
<?php <?php
...@@ -108,11 +94,11 @@ $elemPasswordConfirmation = $form->get('password_confirmation'); ...@@ -108,11 +94,11 @@ $elemPasswordConfirmation = $form->get('password_confirmation');
$elemPasswordConfirmation->setLabelAttributes(['class' => 'col-md-4']); $elemPasswordConfirmation->setLabelAttributes(['class' => 'col-md-4']);
$elemPasswordConfirmation->setAttributes(['class' => 'form-control']); $elemPasswordConfirmation->setAttributes(['class' => 'form-control']);
?> ?>
<div class="form-group"> <div class="form-group">
<?= $this->formLabel($elemPasswordConfirmation) ?> <?= $this->formLabel($elemPasswordConfirmation) ?>
<?= $this->formElement($elemPasswordConfirmation) ?> <?= $this->formElement($elemPasswordConfirmation) ?>
<?= $this->formElementErrors($elemPasswordConfirmation) ?> <?= $this->formElementErrors($elemPasswordConfirmation) ?>
</div> </div>
<? /* home library */ ?> <? /* home library */ ?>
<?php <?php
...@@ -121,19 +107,11 @@ $elemHomeLibrary = $form->get('home_library'); ...@@ -121,19 +107,11 @@ $elemHomeLibrary = $form->get('home_library');
$elemHomeLibrary->setLabelAttributes(['class' => 'col-md-4']); $elemHomeLibrary->setLabelAttributes(['class' => 'col-md-4']);
$elemHomeLibrary->setAttributes(['class' => 'form-control']); $elemHomeLibrary->setAttributes(['class' => 'form-control']);
?> ?>
<div class="form-group"> <div class="form-group">
<?= $this->formLabel($elemHomeLibrary) ?> <?= $this->formLabel($elemHomeLibrary) ?>
<?= $this->formSelect($elemHomeLibrary) ?> <?= $this->formSelect($elemHomeLibrary) ?>
<?= $this->formElementErrors($elemHomeLibrary) ?> <?= $this->formElementErrors($elemHomeLibrary) ?>
</div> </div>
<? /* salutation */ ?>
<?php
/** @var Element\Select $elemSalutation */
$elemSalutation = $form->get('salutation');
$elemSalutation->setAttribute('type', 'hidden');
echo $this->formElement($elemSalutation);
?>
<? /* academic title */ ?> <? /* academic title */ ?>
<?php <?php
...@@ -142,10 +120,18 @@ $elemAcademicTitle = $form->get('academic_title'); ...@@ -142,10 +120,18 @@ $elemAcademicTitle = $form->get('academic_title');
$elemAcademicTitle->setLabelAttributes(['class' => 'col-md-4']); $elemAcademicTitle->setLabelAttributes(['class' => 'col-md-4']);
$elemAcademicTitle->setAttributes(['class' => 'form-control']); $elemAcademicTitle->setAttributes(['class' => 'form-control']);
?> ?>
<div class="form-group"> <div class="form-group">
<?= $this->formLabel($elemAcademicTitle) ?> <?= $this->formLabel($elemAcademicTitle) ?>
<?= $this->formElement($elemAcademicTitle) ?> <?= $this->formElement($elemAcademicTitle) ?>
</div> </div>
<? /* salutation */ ?>
<?php
/** @var Element\Select $elemSalutation */
$elemSalutation = $form->get('salutation');
$elemSalutation->setAttribute('type', 'hidden');
echo $this->formElement($elemSalutation);
?>
<? /* firstname */ ?> <? /* firstname */ ?>
<?php <?php
...@@ -154,11 +140,11 @@ $elemFirstname = $form->get('firstname'); ...@@ -154,11 +140,11 @@ $elemFirstname = $form->get('firstname');
$elemFirstname->setLabelAttributes(['class' => 'col-md-4']); $elemFirstname->setLabelAttributes(['class' => 'col-md-4']);
$elemFirstname->setAttributes(['class' => 'form-control']); $elemFirstname->setAttributes(['class' => 'form-control']);
?> ?>
<div class="form-group"> <div class="form-group">
<?= $this->formLabel($elemFirstname) ?> <?= $this->formLabel($elemFirstname) ?>
<?= $this->formElement($elemFirstname) ?> <?= $this->formElement($elemFirstname) ?>
<?= $this->formElementErrors($elemFirstname) ?> <?= $this->formElementErrors($elemFirstname) ?>
</div> </div>
<? /* lastname */ ?> <? /* lastname */ ?>
<?php <?php
...@@ -167,11 +153,11 @@ $elemLastname = $form->get('lastname'); ...@@ -167,11 +153,11 @@ $elemLastname = $form->get('lastname');
$elemLastname->setLabelAttributes(['class' => 'col-md-4']); $elemLastname->setLabelAttributes(['class' => 'col-md-4']);
$elemLastname->setAttributes(['class' => 'form-control']); $elemLastname->setAttributes(['class' => 'form-control']);
?> ?>
<div class="form-group"> <div class="form-group">
<?= $this->formLabel($elemLastname) ?> <?= $this->formLabel($elemLastname) ?>
<?= $this->formElement($elemLastname) ?> <?= $this->formElement($elemLastname) ?>
<?= $this->formElementErrors($elemLastname) ?> <?= $this->formElementErrors($elemLastname) ?>
</div> </div>
<? /* college */ ?> <? /* college */ ?>
<?php <?php
...@@ -180,11 +166,11 @@ $elemCollege = $form->get('college'); ...@@ -180,11 +166,11 @@ $elemCollege = $form->get('college');
$elemCollege->setLabelAttributes(['class' => 'col-md-4']); $elemCollege->setLabelAttributes(['class' => 'col-md-4']);
$elemCollege->setAttributes(['class' => 'form-control']); $elemCollege->setAttributes(['class' => 'form-control']);
?> ?>
<div class="form-group"> <div class="form-group">
<?= $this->formLabel($elemCollege) ?> <?= $this->formLabel($elemCollege) ?>
<?= $this->formElement($elemCollege) ?> <?= $this->formElement($elemCollege) ?>
<?= $this->formElementErrors($elemCollege) ?> <?= $this->formElementErrors($elemCollege) ?>
</div> </div>
<? /* user group */ ?> <? /* user group */ ?>
<?php <?php
...@@ -193,12 +179,12 @@ $elemJobTitle = $form->get('job_title'); ...@@ -193,12 +179,12 @@ $elemJobTitle = $form->get('job_title');
?> ?>
<div class="form-group"> <div class="form-group">
<div class="col-md-4"> <div class="col-md-4">
<?= $this->formLabel($elemJobTitle) ?> <?= $this->formLabel($elemJobTitle)?>
</div> </div>
<div class="col-md-8"> <div class="col-md-8">
<?= $this->formRadio($elemJobTitle) ?> <?= $this->formRadio($elemJobTitle)?>
</div> </div>
<?= $this->formElementErrors($elemJobTitle) ?> <?= $this->formElementErrors($elemJobTitle)?>
</div> </div>
<? /* addresses */ ?> <? /* addresses */ ?>
...@@ -233,10 +219,6 @@ $elemEulaAccepted->setAttribute('id', 'eula-accepted'); ...@@ -233,10 +219,6 @@ $elemEulaAccepted->setAttribute('id', 'eula-accepted');
$elemSubmit = $form->get('submit'); $elemSubmit = $form->get('submit');
$elemSubmit->setAttributes(['class' => 'btn btn-primary']); $elemSubmit->setAttributes(['class' => 'btn btn-primary']);
?> ?>
<div class="form-group">
<div class="">
<?= $this->formSubmit($elemSubmit) ?>
</div>
</div>
<div class="form-group"><?= $this->formSubmit($elemSubmit) ?></div>
<?= $this->form()->closeTag($form) ?> <?= $this->form()->closeTag($form) ?>
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment