Skip to content
Snippets Groups Projects
Commit 56c22af9 authored by Robert Lange's avatar Robert Lange Committed by Dorian Merz
Browse files

refs #15215 modify basic bbi registration

* expand FeedbackForms for new registration form - dont use default registration
* send mail to hab
* refactor policy - always required on feedback forms
* get mail subject in FeedbackController.php:sendMail if none configured / found
* copy translations and home libraries from core-package, TODO: remove after backend api is working
* basic registration form
** add info text registration_form_info
** set home library required and add first empty option as default
parent 45205c99
Branches
Tags
No related merge requests found
...@@ -63,6 +63,7 @@ forms: ...@@ -63,6 +63,7 @@ forms:
title: Contact title: Contact
enabled: true enabled: true
useCaptcha: false useCaptcha: false
emailSubject: %%emailSubject%%
recipient: recipient:
name: FID BBI name: FID BBI
...@@ -87,8 +88,370 @@ forms: ...@@ -87,8 +88,370 @@ forms:
label: Message label: Message
required: true required: true
- name: confirmPrivacy # Registration form
RegistrationRequest:
title: registration_form_title
enabled: true
useCaptcha: false
help:
pre: registration_form_info
recipient:
name: FID BBI
email: fid@hab.de
onlyForLoggedUsers: false
response: BBI Welcome
senderInfoRequired: true
fields:
- name: library
type: select
label: label_home_library
options:
-
- AAAAA
- FHBAA
- BTHAC
- FHAA
- HSASI
- FHBAW
- FHBAN
- FHBAB
- FHBA
- SUSBA
- UBA
- UBB
- BAKS
- UBBAY
- ASH
- BBAW
- TFHB
- HTW
- BAB
- MFF
- DIW
- EHBER
- ZMO
- FHW
- UBHUB
- IAI
- MPIBF
- MPIWG
- SBBPK
- SWP
- FUB
- TUBB
- UDK
- WZB
- ZLB
- BFHH
- FHBC
- UBBIE
- EFRWL
- FHBO
- RUBO
- FES
- FHBRS
- CAE
- ULBB
- FHBRB
- HBKBS
- GEI
- TUBS
- VLB
- BABRE
- SUUB
- FHO
- TUCHE
- UBCL
- FHBCO
- LBCO
- TUCB
- TUDA
- FHDA
- FHDEG
- HMD
- LLD
- FHV
- FHBDO
- STLB
- UBDO
- BADD
- HTWDD
- SLUB
- UGHE
- UBDU
- FHD
- AAA
- ULBD
- UBE
- BBE
- FHBEI
- FHOOW
- FHEF
- UBERF
- UBEN
- HBES
- HDFL
- HSFK
- MPIAE
- DIF
- DIPF
- FHF
- UBFM
- EUV
- TUBFR
- ABI
- PHBFR
- EHF
- HMF
- UBFRE
- KUBFR
- THHFR
- FHFD
- WLH
- FHFU
- HBG
- FHBGE
- BBG
- UBGIE
- FHGF
- BAG
- MPIG
- SUBGO
- KNTGR
- UBG
- TUBG
- UBGRW
- FUH
- MFHB
- KDHAL
- IWH
- ULBH
- HCUHH
- HFBK
- TUHH
- HIS
- FAB
- GIGA
- HFMT
- HAWHH
- SUBHH
- UBWH
- HWWA
- HSHL
- HMT
- FHH
- FHHX
- GWLB
- UBTIB
- HFW
- PHHD
- UBHE
- BAH
- FHHN
- UBHI
- HAWK
- FHBHO
- EFF
- UBIL
- FHBIN
- UBI
- FHJ
- THULB
- UBKL
- BLB
- DHBW
- FBHKA
- HSBKA
- KIT
- ZKM
- UBKAS
- FHBKA
- UBK
- ZBW
- FHKI
- FHTK
- UBKLU
- HRW
- ISTAT
- LBZ
- BIBKO
- FHBK
- KHN
- KFM
- MPIFG
- USBK
- ZBSK
- ZUMA
- FHKN
- UBKO
- HSB
- DUK
- BPHT
- FHKTI
- BIBLA
- FHBLA
- HMTL
- SSAL
- UFZ
- HTWK
- GZB
- UBL
- FHLH
- BRUCK
- KTUL
- OOE
- UBLI
- UFG
- BALO
- UBHL
- FHLB
- DFI
- EHLB
- PHLB
- FHLU
- UBLUE
- HSLU
- ZHBLU
- HBMST
- UBMD
- UBMZ
- SBM
- BAMA
- FHMA
- IDS
- PAK
- MUHOM
- UBMAN
- DLA
- UBMA
- FHMQ
- HTWM
- HSNRH
- BAMOS
- HRWMB
- AHM
- BSB
- FHM
- IFZ
- MHMK
- HMTM
- MPISR
- TUM
- UBWM
- UBM
- ZIKG
- DHPOL
- FHBMS
- ULBMS
- FHBNU
- FHNB
- SBND
- EHS
- HMN
- FHN
- HFWU
- FHBOG
- BISOL
- LBO
- FHOS
- UBOS
- UBPB
- UBPA
- FHPF
- BAPL
- ZZFPD
- HFFP
- FHPO
- UBPO
- BARV
- FHBR
- STABI
- UBR
- FHRT
- BARIE
- FHBRO
- HMTRO
- MPIDF
- UBRO
- HTWS
- SULB
- FHSA
- UBMS
- UBSBG
- FHSM
- HFGG
- PHGD
- LBMV
- UBSI
- DHV
- PKHSG
- FHSP
- UBSG
- FHSTR
- BAS
- HDM
- HFTS
- UBS
- UBHOH
- WLB
- BPS
- FHTR
- UBTR
- MHTRO
- UBTUE
- FHUL
- UBU
- UBVE
- BAVS
- FHWEI
- HAAB
- UBBUW
- HSBW
- HBW
- FHOOE
- HSH
- AKW
- FHTWI
- FPFS
- FHCAW
- IHS
- ONB
- UABK
- UBTUW
- UBAKW
- UBWI
- FHWM
- EBS
- HLB
- TFHW
- FHWOE
- ZHAW
- HSHWI
- HAB
- FHWF
- FHWO
- THZW
- UBWUP
- UBW
- FHBWS
- HZG
- EHB
- IHH
- UNIZH
- ZHK
- FHKL
- WHZ
- AAAAA
required: true
- name: firstname
type: text #type needed type: text #type needed
label: label: First Name
required: true required: true
...@@ -63,6 +63,7 @@ forms: ...@@ -63,6 +63,7 @@ forms:
title: Contact title: Contact
enabled: true enabled: true
useCaptcha: false useCaptcha: false
emailSubject: %%emailSubject%%
recipient: recipient:
name: FID BBI name: FID BBI
...@@ -87,8 +88,370 @@ forms: ...@@ -87,8 +88,370 @@ forms:
label: Message label: Message
required: true required: true
- name: confirmPrivacy # Registration form
RegistrationRequest:
title: registration_form_title
enabled: true
useCaptcha: false
help:
pre: registration_form_info
recipient:
name: FID BBI
email: fid@hab.de
onlyForLoggedUsers: false
response: BBI Welcome
senderInfoRequired: true
fields:
- name: library
type: select
label: label_home_library
options:
-
- AAAAA
- FHBAA
- BTHAC
- FHAA
- HSASI
- FHBAW
- FHBAN
- FHBAB
- FHBA
- SUSBA
- UBA
- UBB
- BAKS
- UBBAY
- ASH
- BBAW
- TFHB
- HTW
- BAB
- MFF
- DIW
- EHBER
- ZMO
- FHW
- UBHUB
- IAI
- MPIBF
- MPIWG
- SBBPK
- SWP
- FUB
- TUBB
- UDK
- WZB
- ZLB
- BFHH
- FHBC
- UBBIE
- EFRWL
- FHBO
- RUBO
- FES
- FHBRS
- CAE
- ULBB
- FHBRB
- HBKBS
- GEI
- TUBS
- VLB
- BABRE
- SUUB
- FHO
- TUCHE
- UBCL
- FHBCO
- LBCO
- TUCB
- TUDA
- FHDA
- FHDEG
- HMD
- LLD
- FHV
- FHBDO
- STLB
- UBDO
- BADD
- HTWDD
- SLUB
- UGHE
- UBDU
- FHD
- AAA
- ULBD
- UBE
- BBE
- FHBEI
- FHOOW
- FHEF
- UBERF
- UBEN
- HBES
- HDFL
- HSFK
- MPIAE
- DIF
- DIPF
- FHF
- UBFM
- EUV
- TUBFR
- ABI
- PHBFR
- EHF
- HMF
- UBFRE
- KUBFR
- THHFR
- FHFD
- WLH
- FHFU
- HBG
- FHBGE
- BBG
- UBGIE
- FHGF
- BAG
- MPIG
- SUBGO
- KNTGR
- UBG
- TUBG
- UBGRW
- FUH
- MFHB
- KDHAL
- IWH
- ULBH
- HCUHH
- HFBK
- TUHH
- HIS
- FAB
- GIGA
- HFMT
- HAWHH
- SUBHH
- UBWH
- HWWA
- HSHL
- HMT
- FHH
- FHHX
- GWLB
- UBTIB
- HFW
- PHHD
- UBHE
- BAH
- FHHN
- UBHI
- HAWK
- FHBHO
- EFF
- UBIL
- FHBIN
- UBI
- FHJ
- THULB
- UBKL
- BLB
- DHBW
- FBHKA
- HSBKA
- KIT
- ZKM
- UBKAS
- FHBKA
- UBK
- ZBW
- FHKI
- FHTK
- UBKLU
- HRW
- ISTAT
- LBZ
- BIBKO
- FHBK
- KHN
- KFM
- MPIFG
- USBK
- ZBSK
- ZUMA
- FHKN
- UBKO
- HSB
- DUK
- BPHT
- FHKTI
- BIBLA
- FHBLA
- HMTL
- SSAL
- UFZ
- HTWK
- GZB
- UBL
- FHLH
- BRUCK
- KTUL
- OOE
- UBLI
- UFG
- BALO
- UBHL
- FHLB
- DFI
- EHLB
- PHLB
- FHLU
- UBLUE
- HSLU
- ZHBLU
- HBMST
- UBMD
- UBMZ
- SBM
- BAMA
- FHMA
- IDS
- PAK
- MUHOM
- UBMAN
- DLA
- UBMA
- FHMQ
- HTWM
- HSNRH
- BAMOS
- HRWMB
- AHM
- BSB
- FHM
- IFZ
- MHMK
- HMTM
- MPISR
- TUM
- UBWM
- UBM
- ZIKG
- DHPOL
- FHBMS
- ULBMS
- FHBNU
- FHNB
- SBND
- EHS
- HMN
- FHN
- HFWU
- FHBOG
- BISOL
- LBO
- FHOS
- UBOS
- UBPB
- UBPA
- FHPF
- BAPL
- ZZFPD
- HFFP
- FHPO
- UBPO
- BARV
- FHBR
- STABI
- UBR
- FHRT
- BARIE
- FHBRO
- HMTRO
- MPIDF
- UBRO
- HTWS
- SULB
- FHSA
- UBMS
- UBSBG
- FHSM
- HFGG
- PHGD
- LBMV
- UBSI
- DHV
- PKHSG
- FHSP
- UBSG
- FHSTR
- BAS
- HDM
- HFTS
- UBS
- UBHOH
- WLB
- BPS
- FHTR
- UBTR
- MHTRO
- UBTUE
- FHUL
- UBU
- UBVE
- BAVS
- FHWEI
- HAAB
- UBBUW
- HSBW
- HBW
- FHOOE
- HSH
- AKW
- FHTWI
- FPFS
- FHCAW
- IHS
- ONB
- UABK
- UBTUW
- UBAKW
- UBWI
- FHWM
- EBS
- HLB
- TFHW
- FHWOE
- ZHAW
- HSHWI
- HAB
- FHWF
- FHWO
- THZW
- UBWUP
- UBW
- FHBWS
- HZG
- EHB
- IHH
- UNIZH
- ZHK
- FHKL
- WHZ
- AAAAA
required: true
- name: firstname
type: text #type needed type: text #type needed
label: label: First Name
required: true required: true
This diff is collapsed.
This diff is collapsed.
...@@ -4,9 +4,12 @@ namespace fid_bbi\Module\Configuration; ...@@ -4,9 +4,12 @@ namespace fid_bbi\Module\Configuration;
$config = [ $config = [
'controllers' => [ 'controllers' => [
'factories' => [ 'factories' => [
'fid_bbi\Controller\FeedbackController' => 'VuFind\Controller\AbstractBaseFactory',
'fid_bbi\Controller\SearchController' => 'VuFind\Controller\AbstractBaseFactory', 'fid_bbi\Controller\SearchController' => 'VuFind\Controller\AbstractBaseFactory',
], ],
'aliases' => [ 'aliases' => [
'feedback' => 'fid_bbi\Controller\FeedbackController',
'Feedback' => 'fid_bbi\Controller\FeedbackController',
'Search' => 'fid_bbi\Controller\SearchController', 'Search' => 'fid_bbi\Controller\SearchController',
'search' => 'fid_bbi\Controller\SearchController', 'search' => 'fid_bbi\Controller\SearchController',
], ],
......
...@@ -36,12 +36,47 @@ use VuFind\Controller\FeedbackController as BaseFeedbackController; ...@@ -36,12 +36,47 @@ use VuFind\Controller\FeedbackController as BaseFeedbackController;
class FeedbackController extends BaseFeedbackController class FeedbackController extends BaseFeedbackController
{ {
/** /**
* Display Feedback home form. * Send form data as email.
* *
* @return \Zend\View\Model\ViewModel * @param string $recipientName Recipient name
* @param string $recipientEmail Recipient email
* @param string $senderName Sender name
* @param string $senderEmail Sender email
* @param string $replyToName Reply-to name
* @param string $replyToEmail Reply-to email
* @param string $emailSubject Email subject
* @param string $emailMessage Email message
*
* @return array with elements success:boolean, errorMessage:string (optional)
*/ */
public function emailAction() protected function sendEmail(
{ $recipientName, $recipientEmail, $senderName, $senderEmail,
return $this->forwardTo('Feedback', 'Form'); $replyToName, $replyToEmail, $emailSubject, $emailMessage
) {
if (strpos("emailSubject", $emailSubject) === false) {
$emailSubject = "BBI ";
$formId = $this->params()->fromRoute('id', $this->params()->fromQuery('id'));
if (!empty($formId)) {
switch ($formId) {
case "RegistrationRequest":
$emailSubject .= $this->translate("registration_form_title");
break;
case "FeedbackSite":
$emailSubject .= $this->translate("Contact");
break;
}
}
}
return parent::sendEmail(
$recipientName,
$recipientEmail,
$senderName,
$senderEmail,
$replyToName,
$replyToEmail,
$emailSubject,
$emailMessage
);
} }
} }
<?php $account = $this->auth()->getManager(); ?>
<?php $sessionInitiator = $account->getSessionInitiator($this->serverUrl($this->url('myresearch-home'))); ?>
<?php if (!$sessionInitiator): // display default login form if no login URL provided ?>
<form method="post" action="<?=$this->url('myresearch-home')?>" name="loginForm" class="form-login">
<?=$this->auth()->getLoginFields()?>
<input type="hidden" name="auth_method" value="<?=$account->getAuthMethod()?>">
<input type="hidden" name="csrf" value="<?=$this->escapeHtmlAttr($account->getCsrfHash())?>" />
<div class="form-group">
<input class="btn btn-primary" type="submit" name="processLogin" value="<?=$this->transEsc('Login')?>">
<?php if ($account->supportsCreation()): ?>
<a data-lightbox href="<?=$this->url('feedback-form')?>?id=RegistrationRequest"><?=$this->transEsc('Create New Account')?></a>
<?php endif; ?>
<?php if ($account->supportsRecovery()): ?>
<a class="btn btn-link" href="<?=$this->url('myresearch-recover') ?>?auth_method=<?=$account->getAuthMethod()?>"><?=$this->transEsc('Forgot Password')?></a>
<?php endif; ?>
</div>
</form>
<?php else: ?>
<a href="<?=$this->escapeHtmlAttr($sessionInitiator)?>" class="btn btn-link" data-lightbox-ignore><?=$this->transEsc("Institutional Login")?></a>
<?php endif; ?>
...@@ -39,64 +39,66 @@ ...@@ -39,64 +39,66 @@
<?php endif ?> <?php endif ?>
<?php $currentGroup = null; ?> <?php $currentGroup = null; ?>
<?php $countElements = count($form->getElements()); $counter = 0 ?>
<?php foreach($form->getElements() as $el): ?> <?php foreach($form->getElements() as $el): ?>
<? if($el['name'] == "confirmPrivacy") : ?> <? $counter++; ?>
<? if($counter == $countElements) : ?>
<div class="form-group"> <div class="form-group">
<input id="confirmPrivacy" name="confirmPrivacy" type="checkbox" <?=isset($el['required']) && $el['required'] ? 'required' : ''?>> <input id="confirmPrivacy" name="confirmPrivacy" type="checkbox" required>
<label for="confirmPrivacy"> <label for="confirmPrivacy">
<?php $url = "'" . $this->url('content-page', ['page' => 'privacy']) . "'"; ?>
<?= <?=
$this->translate( $this->translate(
'email_contact_policy', 'email_contact_policy',
['%%policy_link%%' => '<a href="' . $this->url('content-page', ['page' => 'privacy']) . '"">' . $this->transEsc('Privacy Policy') . '</a>'] ['%%policy_link%%' => '<a onclick="window.open(' . $url . ')">' . $this->transEsc('Privacy Policy') . '</a>']
); );
?>* ?>*
</label> </label>
</div> </div>
<?php else: ?> <?php endif ?>
<?php <?php
$formElement = $form->get($el['name']); $formElement = $form->get($el['name']);
// Group form elements into field sets // Group form elements into field sets
$handleGroup = $group = null; $handleGroup = $group = null;
if (isset($el['group']) && !empty($el['group'])) { if (isset($el['group']) && !empty($el['group'])) {
$group = $el['group']; $group = $el['group'];
} }
if ($group && $currentGroup === null) { if ($group && $currentGroup === null) {
$handleGroup = 'open'; $handleGroup = 'open';
$currentGroup = $group; $currentGroup = $group;
} elseif ($currentGroup && !$group) { } elseif ($currentGroup && !$group) {
$handleGroup = 'close'; $handleGroup = 'close';
$currentGroup = null; $currentGroup = null;
} elseif ($currentGroup !== $group) { } elseif ($currentGroup !== $group) {
$handleGroup = 'openAndClose'; $handleGroup = 'openAndClose';
$currentGroup = $group; $currentGroup = $group;
} }
?> ?>
<?php if (in_array($handleGroup, ['close', 'openAndClose'])): ?> <?php if (in_array($handleGroup, ['close', 'openAndClose'])): ?>
</div> </div>
<?php endif ?> <?php endif ?>
<?php if (in_array($handleGroup, ['open', 'openAndClose'])): ?> <?php if (in_array($handleGroup, ['open', 'openAndClose'])): ?>
<div class="field-set"> <div class="field-set">
<?php endif ?> <?php endif ?>
<div class="form-group"> <div class="form-group">
<?php if (!empty($el['help'])): ?> <?php if (!empty($el['help'])): ?>
<p class="info"><?= $this->transEsc($el['help']) ?></p> <p class="info"><?= $this->transEsc($el['help']) ?></p>
<?php endif ?> <?php endif ?>
<?php if ($el['type'] !== 'submit'): ?> <?php if ($el['type'] !== 'submit'): ?>
<label for="<?=$this->escapeHtmlAttr($el['name'])?>" class="control-label<?=!empty($el['required']) ? ' required' : ''?>"><?=$this->transEsc($el['label'])?>:</label> <label for="<?=$this->escapeHtmlAttr($el['name'])?>" class="control-label<?=!empty($el['required']) ? ' required' : ''?>"><?=$this->transEsc($el['label'])?>:</label>
<?php else: ?> <?php else: ?>
<?php if ($helpPost): ?> <?php if ($helpPost): ?>
<div class="form-info post"> <div class="form-info post">
<?=$helpPost?> <?=$helpPost?>
</div>
<?php endif ?>
<?=$this->recaptcha()->html($this->useRecaptcha) ?>
<?php endif ?>
<?= $this->formRow($formElement) ?>
</div> </div>
<?php endif; ?> <?php endif ?>
<?=$this->recaptcha()->html($this->useRecaptcha) ?>
<?php endif ?>
<?= $this->formRow($formElement) ?>
</div>
<?php endforeach ?> <?php endforeach ?>
<?= $this->form()->closeTag() ?> <?= $this->form()->closeTag() ?>
<?php endif ?> <?php endif ?>
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
<li><a href="<?=$this->url('content-page', ['page' => 'faq'])?>"><?=$this->transEsc('FAQs')?></a></li> <li><a href="<?=$this->url('content-page', ['page' => 'faq'])?>"><?=$this->transEsc('FAQs')?></a></li>
<li><a href="<?=$this->url('content-page', ['page' => 'terms'])?>"><?=$this->transEsc('Terms of Use')?></a></li> <li><a href="<?=$this->url('content-page', ['page' => 'terms'])?>"><?=$this->transEsc('Terms of Use')?></a></li>
<li><a href="<?=$this->url('content-page', ['page' => 'privacy'])?>"><?=$this->transEsc('Privacy Policy')?></a></li> <li><a href="<?=$this->url('content-page', ['page' => 'privacy'])?>"><?=$this->transEsc('Privacy Policy')?></a></li>
<li><a data-lightbox href="<?=$this->url('feedback-home')?>"><?=$this->transEsc('Contact')?></a></li>
</ul> </ul>
</div> </div>
<div class="footer-column"> <div class="footer-column">
......
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