diff --git a/fid_bbi/languages/fid/de.ini b/fid_bbi/languages/fid/de.ini new file mode 100644 index 0000000000000000000000000000000000000000..9ca42743ba9ffcad3d6004fd7bff1defde58aed7 --- /dev/null +++ b/fid_bbi/languages/fid/de.ini @@ -0,0 +1,19 @@ +;#################################################################### +;##################### 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" diff --git a/fid_bbi/languages/fid/en.ini b/fid_bbi/languages/fid/en.ini new file mode 100644 index 0000000000000000000000000000000000000000..0c1e93770c91a84d8b0149e73d5e677f3ac8a88c --- /dev/null +++ b/fid_bbi/languages/fid/en.ini @@ -0,0 +1,19 @@ +;#################################################################### +;##################### 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" diff --git a/module/fid_bbi/config/module.config.php b/module/fid_bbi/config/module.config.php index f5197d56401c9b03f973512f9594d96dfce8a529..cf5f12dd41cf262f53c873701e9137b1d0bb6686 100644 --- a/module/fid_bbi/config/module.config.php +++ b/module/fid_bbi/config/module.config.php @@ -1,6 +1,6 @@ <?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 * it under the terms of the GNU General Public License version 2 as @@ -16,6 +16,8 @@ * 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 */ @@ -25,7 +27,10 @@ use VuFind\Db\Row\Tags as BaseTagsRow; use VuFind\Db\Table\GatewayFactory as TableGatewayFactory; $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' => [ 'factories' => [ 'fid_bbi\Controller\FeedbackController' => 'VuFind\Controller\AbstractBaseFactory', diff --git a/module/fid_bbi/config/user-create-form.php b/module/fid_bbi/config/user-create-form.php new file mode 100644 index 0000000000000000000000000000000000000000..276eeee4d050b2b18e5de0021322a33ec59f5ee7 --- /dev/null +++ b/module/fid_bbi/config/user-create-form.php @@ -0,0 +1,49 @@ +<?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, + ], + ], +]; diff --git a/module/fid_bbi/config/user-init-form.php b/module/fid_bbi/config/user-init-form.php new file mode 100644 index 0000000000000000000000000000000000000000..c524eec2d07ce7b590648b60f2c788e944aee56f --- /dev/null +++ b/module/fid_bbi/config/user-init-form.php @@ -0,0 +1,49 @@ +<?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 diff --git a/themes/fid_bbi/templates/fid/user/create.phtml b/themes/fid_bbi/templates/fid/user/create.phtml index 31cd631d0426a8ca362d494cf6812ce5cf80aef0..93570c762eca33f0b79bcb3f09fc61cc879a43e7 100644 --- a/themes/fid_bbi/templates/fid/user/create.phtml +++ b/themes/fid_bbi/templates/fid/user/create.phtml @@ -20,56 +20,42 @@ * @license http://opensource.org/licenses/gpl-2.0.php GNU GPLv2 */ +use Zend\Form\Element; use Zend\Form\Element\Checkbox; use Zend\Form\Element\Submit; use Zend\Form\Form; -use Zend\Form\Element as Element; use Zend\Form\View\Helper\FormElementErrors; use Zend\Form\View\Helper\FormLabel; use Zend\Form\View\Helper\FormRadio; use Zend\Form\View\Helper\FormSelect; use Zend\Form\View\Helper\FormSubmit; -use Zend\I18n\Translator\TranslatorInterface; +/** @var Form $form */ /** @var FormLabel $formLabel */ +/** @var FormRadio $formRadio */ +/** @var FormSelect $formSelect */ +/** @var FormSubmit $formSubmit */ +/** @var FormElementErrors $formElementErrors */ +$form = $this->form; $formLabel = $this->formLabel(); -/**@var FormRadio $formRadio */ $formRadio = $this->formRadio(); -/**@var FormSelect $formSelect */ $formSelect = $this->formSelect(); -/**@var FormSubmit $formSubmit */ $formSubmit = $this->formSubmit(); -/** @var FormElementErrors $formElementErrors */ $formElementErrors = $this->formElementErrors(); $formLabel->setTranslatorTextDomain('fid'); $formSelect->setTranslatorTextDomain('fid'); $formRadio->setTranslatorTextDomain('fid'); $formSubmit->setTranslatorTextDomain('fid'); $formElementErrors->setTranslatorTextDomain('fid'); -/** @var TranslatorInterface $translator */ -$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")); +$this->headTitle($title = $this->translate("fid::user_create_form_title")); ?> +<h2><?= $title ?></h2> +<div><?= $this->transEsc("fid::required_fields_note") ?></div> <?= $this->flashmessages() ?> <?= $this->form()->openTag($form) ?> - <h2><?= $this->translate("fid::user_create_form_title") ?></h2> - <div class="subito-pg"> - * <?= $this->transEsc("This field is required") ?> - </div> +<br/> + <? /* username */ ?> <?php /** @var Element\Text $elemUsername */ @@ -77,16 +63,16 @@ $elemUsername = $form->get('username'); $elemUsername->setLabelAttributes(['class' => 'col-md-4']); $elemUsername->setAttributes(['class' => 'form-control', 'disabled' => 1]); ?> - <div class="form-group"> - <?= $this->formLabel($elemUsername) ?> - <?= $this->formElement($elemUsername) ?> - <?= $this->formElementErrors($elemUsername) ?> - <?php - $elemUsername->removeAttribute('disabled'); - $elemUsername->setAttribute('type', 'hidden'); - echo $this->formElement($elemUsername); - ?> - </div> +<div class="form-group"> + <?= $this->formLabel($elemUsername) ?> + <?= $this->formElement($elemUsername) ?> + <?= $this->formElementErrors($elemUsername) ?> + <?php + $elemUsername->removeAttribute('disabled'); + $elemUsername->setAttribute('type', 'hidden'); + ?> + <?= $this->formElement($elemUsername) ?> +</div> <? /* password */ ?> <?php @@ -95,11 +81,11 @@ $elemPassword = $form->get('password'); $elemPassword->setLabelAttributes(['class' => 'col-md-4']); $elemPassword->setAttributes(['class' => 'form-control']); ?> - <div class="form-group"> - <?= $this->formLabel($elemPassword) ?> - <?= $this->formElement($elemPassword) ?> - <?= $this->formElementErrors($elemPassword) ?> - </div> +<div class="form-group"> + <?= $this->formLabel($elemPassword) ?> + <?= $this->formElement($elemPassword) ?> + <?= $this->formElementErrors($elemPassword) ?> +</div> <? /* password confirmation */ ?> <?php @@ -108,11 +94,11 @@ $elemPasswordConfirmation = $form->get('password_confirmation'); $elemPasswordConfirmation->setLabelAttributes(['class' => 'col-md-4']); $elemPasswordConfirmation->setAttributes(['class' => 'form-control']); ?> - <div class="form-group"> - <?= $this->formLabel($elemPasswordConfirmation) ?> - <?= $this->formElement($elemPasswordConfirmation) ?> - <?= $this->formElementErrors($elemPasswordConfirmation) ?> - </div> +<div class="form-group"> + <?= $this->formLabel($elemPasswordConfirmation) ?> + <?= $this->formElement($elemPasswordConfirmation) ?> + <?= $this->formElementErrors($elemPasswordConfirmation) ?> +</div> <? /* home library */ ?> <?php @@ -121,19 +107,11 @@ $elemHomeLibrary = $form->get('home_library'); $elemHomeLibrary->setLabelAttributes(['class' => 'col-md-4']); $elemHomeLibrary->setAttributes(['class' => 'form-control']); ?> - <div class="form-group"> - <?= $this->formLabel($elemHomeLibrary) ?> - <?= $this->formSelect($elemHomeLibrary) ?> - <?= $this->formElementErrors($elemHomeLibrary) ?> - </div> - -<? /* salutation */ ?> -<?php -/** @var Element\Select $elemSalutation */ -$elemSalutation = $form->get('salutation'); -$elemSalutation->setAttribute('type', 'hidden'); -echo $this->formElement($elemSalutation); -?> +<div class="form-group"> + <?= $this->formLabel($elemHomeLibrary) ?> + <?= $this->formSelect($elemHomeLibrary) ?> + <?= $this->formElementErrors($elemHomeLibrary) ?> +</div> <? /* academic title */ ?> <?php @@ -142,10 +120,18 @@ $elemAcademicTitle = $form->get('academic_title'); $elemAcademicTitle->setLabelAttributes(['class' => 'col-md-4']); $elemAcademicTitle->setAttributes(['class' => 'form-control']); ?> - <div class="form-group"> - <?= $this->formLabel($elemAcademicTitle) ?> - <?= $this->formElement($elemAcademicTitle) ?> - </div> +<div class="form-group"> + <?= $this->formLabel($elemAcademicTitle) ?> + <?= $this->formElement($elemAcademicTitle) ?> +</div> + +<? /* salutation */ ?> +<?php +/** @var Element\Select $elemSalutation */ +$elemSalutation = $form->get('salutation'); +$elemSalutation->setAttribute('type', 'hidden'); +echo $this->formElement($elemSalutation); +?> <? /* firstname */ ?> <?php @@ -154,11 +140,11 @@ $elemFirstname = $form->get('firstname'); $elemFirstname->setLabelAttributes(['class' => 'col-md-4']); $elemFirstname->setAttributes(['class' => 'form-control']); ?> - <div class="form-group"> - <?= $this->formLabel($elemFirstname) ?> - <?= $this->formElement($elemFirstname) ?> - <?= $this->formElementErrors($elemFirstname) ?> - </div> +<div class="form-group"> + <?= $this->formLabel($elemFirstname) ?> + <?= $this->formElement($elemFirstname) ?> + <?= $this->formElementErrors($elemFirstname) ?> +</div> <? /* lastname */ ?> <?php @@ -167,11 +153,11 @@ $elemLastname = $form->get('lastname'); $elemLastname->setLabelAttributes(['class' => 'col-md-4']); $elemLastname->setAttributes(['class' => 'form-control']); ?> - <div class="form-group"> - <?= $this->formLabel($elemLastname) ?> - <?= $this->formElement($elemLastname) ?> - <?= $this->formElementErrors($elemLastname) ?> - </div> +<div class="form-group"> + <?= $this->formLabel($elemLastname) ?> + <?= $this->formElement($elemLastname) ?> + <?= $this->formElementErrors($elemLastname) ?> +</div> <? /* college */ ?> <?php @@ -180,11 +166,11 @@ $elemCollege = $form->get('college'); $elemCollege->setLabelAttributes(['class' => 'col-md-4']); $elemCollege->setAttributes(['class' => 'form-control']); ?> - <div class="form-group"> - <?= $this->formLabel($elemCollege) ?> - <?= $this->formElement($elemCollege) ?> - <?= $this->formElementErrors($elemCollege) ?> - </div> +<div class="form-group"> + <?= $this->formLabel($elemCollege) ?> + <?= $this->formElement($elemCollege) ?> + <?= $this->formElementErrors($elemCollege) ?> +</div> <? /* user group */ ?> <?php @@ -193,12 +179,12 @@ $elemJobTitle = $form->get('job_title'); ?> <div class="form-group"> <div class="col-md-4"> - <?= $this->formLabel($elemJobTitle) ?> + <?= $this->formLabel($elemJobTitle)?> </div> <div class="col-md-8"> - <?= $this->formRadio($elemJobTitle) ?> + <?= $this->formRadio($elemJobTitle)?> </div> - <?= $this->formElementErrors($elemJobTitle) ?> + <?= $this->formElementErrors($elemJobTitle)?> </div> <? /* addresses */ ?> @@ -233,10 +219,6 @@ $elemEulaAccepted->setAttribute('id', 'eula-accepted'); $elemSubmit = $form->get('submit'); $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) ?>