diff --git a/local/languages/LiberoAccount/de.ini b/local/languages/LiberoAccount/de.ini new file mode 100644 index 0000000000000000000000000000000000000000..2607d8ef6eec11a949cfb834357dfb934c5174d5 --- /dev/null +++ b/local/languages/LiberoAccount/de.ini @@ -0,0 +1,8 @@ +# Change pin account action +change_user_pin = "PIN für Selbstverbuchung ändern" +new_pin = "Neue PIN" +confirm_new_pin = "Neue PIN bestätigen" +new_pin_missmatch = "PIN Eingaben stimmen nicht überein" +set_pin_success = "Die PIN wurde erfolgreich geändert" +set_pin_error = "Änderung der PIN gescheitert. Wenden Sie sich bitte an das Bibliothekspersonal." +set_pin_note = "Hinweis: Die PIN muss vierstellig sein und darf nur aus Ziffern bestehen." diff --git a/local/languages/LiberoAccount/en.ini b/local/languages/LiberoAccount/en.ini new file mode 100644 index 0000000000000000000000000000000000000000..7c3213fad165f2815bb9aa2d8c1f84b09cf9ed37 --- /dev/null +++ b/local/languages/LiberoAccount/en.ini @@ -0,0 +1,8 @@ +# Change pin account action +change_user_pin = "Change PIN" +new_pin = "New PIN" +confirm_new_pin = "Confirm new PIN" +new_pin_missmatch = "Confirmation of PIN is not valid. Please try it again" +set_pin_success = "New PIN was set successfully" +set_pin_error = "Errors occurred while changing PIN. Please ask on the service desk." +set_pin_note = "Please note that the PIN must consist of four digits only (no letters, no symbols ...)." diff --git a/themes/finc/templates/myresearch/menu.phtml b/themes/finc/templates/myresearch/menu.phtml index 65978bf3e042238e103e089fd5d9d4765117cd78..5178f89f59527145797307d0384824c85fa92e9b 100644 --- a/themes/finc/templates/myresearch/menu.phtml +++ b/themes/finc/templates/myresearch/menu.phtml @@ -34,9 +34,7 @@ $capabilityParams = $patron ? ['patron' => $patron] : []; <?php endif; ?> <?php if ($this->ils()->checkFunction('getMyTransactionHistory', $capabilityParams)): ?> <li class="facet"> - <a href="<?=$this->url('myresearch-historicloans')?>"<?=$this->active == 'historicloans' ? ' class="active"' : ''?> - <?=$this->active == 'historicloans' ? ' aria-current="page"' : ''?> - > + <a href="<?=$this->url('myresearch-historicloans')?>"<?=$this->active == 'historicloans' ? ' class="active" aria-current="page"' : ''?>> <i class="fa fa-fw fa-history" aria-hidden="true"></i> <?=$this->transEsc('Loan History')?> </a> </li> @@ -45,8 +43,8 @@ $capabilityParams = $patron ? ['patron' => $patron] : []; <li class="facet"> <a href="<?=$this->url('myresearch-holds')?>" class="flex<?=$this->active == 'holds' ? ' active' : ''?>" - <?=$this->active == 'holds' ? ' aria-current="page"' : ''?> - > + <?=$this->active == 'holds' ? ' aria-current="page"' : ''?> + > <span class="flex-col"><i class="fa fa-fw fa-flag" aria-hidden="true"></i> <?=$this->transEsc('Holds and Recalls')?></span> <span class="holds-status status hidden"><i class="fa fa-spin fa-spinner" aria-hidden="true"></i></span> <?php /* nxt line finc specific - CK */ ?> @@ -58,8 +56,8 @@ $capabilityParams = $patron ? ['patron' => $patron] : []; <?php if ($this->ils()->checkFunction('StorageRetrievalRequests', $capabilityParams)): ?> <li class="facet"> <a href="<?=$this->url('myresearch-storageretrievalrequests')?>" class="flex<?=$this->active == 'storageRetrievalRequests' ? ' active' : ''?>" - <?=$this->active == 'storageRetrievalRequests' ? ' aria-current="page"' : ''?> - > + <?=$this->active == 'storageRetrievalRequests' ? ' aria-current="page"' : ''?> + > <span class="flex-col"><i class="fa fa-fw fa-archive" aria-hidden="true"></i> <?=$this->transEsc('Storage Retrieval Requests')?></span> <span class="storageretrievalrequests-status status hidden"><i class="fa fa-spin fa-spinner" aria-hidden="true"></i></span> <?php /* nxt line finc specific - CK */ ?> @@ -71,8 +69,8 @@ $capabilityParams = $patron ? ['patron' => $patron] : []; <?php if ($this->ils()->checkFunction('ILLRequests', $capabilityParams)): ?> <li class="facet"> <a href="<?=$this->url('myresearch-illrequests')?>" class="flex<?=$this->active == 'ILLRequests' ? ' active' : ''?>" - <?=$this->active == 'ILLRequests' ? ' aria-current="page"' : ''?> - > + <?=$this->active == 'ILLRequests' ? ' aria-current="page"' : ''?> + > <span class="flex-col"><i class="fa fa-fw fa-exchange" aria-hidden="true"></i> <?=$this->transEsc('Interlibrary Loan Requests')?></span> <span class="illrequests-status status hidden"><i class="fa fa-spin fa-spinner" aria-hidden="true"></i></span> <?php /* nxt line finc specific - CK */ ?> @@ -84,25 +82,21 @@ $capabilityParams = $patron ? ['patron' => $patron] : []; <?php if ($this->ils()->checkCapability('getMyFines', $capabilityParams)): ?> <li class="facet"> <a href="<?=$this->url('myresearch-fines')?>" class="flex<?=$this->active == 'fines' ? ' active' : ''?>" - <?=$this->active == 'fines' ? ' aria-current="page"' : ''?> - > + <?=$this->active == 'fines' ? ' aria-current="page"' : ''?> + > <span class="flex-col"><i class="fa fa-fw fa-usd" aria-hidden="true"></i> <?=$this->transEsc('Fines')?></span> <span class="fines-status status hidden"><i class="fa fa-spin fa-spinner" aria-hidden="true"></i></span> </a> </li> <?php endif; ?> <li class="facet"> - <a href="<?=$this->url('myresearch-profile')?>"<?=$this->active == 'profile' ? ' class="active"' : ''?> - <?=$this->active == 'profile' ? ' aria-current="page"' : ''?> - > + <a href="<?=$this->url('myresearch-profile')?>"<?=$this->active == 'profile' ? ' class="active" aria-current="page"' : ''?>> <i class="fa fa-fw fa-user" aria-hidden="true"></i> <?=$this->transEsc('Profile')?> </a> </li> <?php if ($user && $user->libraryCardsEnabled()): ?> <li class="facet"> - <a href="<?=$this->url('librarycards-home')?>"<?=$this->active == 'librarycards' ? ' class="active"' : ''?> - <?=$this->active == 'librarycards' ? ' aria-current="page"' : ''?> - > + <a href="<?=$this->url('librarycards-home')?>"<?=$this->active == 'librarycards' ? ' class="active" aria-current="page"' : ''?>> <i class="fa fa-fw fa-barcode" aria-hidden="true"></i> <?=$this->transEsc('Library Cards')?> </a> </li> @@ -110,9 +104,7 @@ $capabilityParams = $patron ? ['patron' => $patron] : []; <?php endif; ?> <?php if ($this->accountCapabilities()->getSavedSearchSetting() === 'enabled'): ?> <li class="facet"> - <a href="<?=$this->url('search-history')?>?require_login"<?=$this->active == 'history' ? ' class="active"' : ''?> - <?=$this->active == 'history' ? ' aria-current="page"' : ''?> - > + <a href="<?=$this->url('search-history')?>?require_login"<?=$this->active == 'history' ? ' class="active" aria-current="page"' : ''?>> <i class="fa fa-fw fa-search" aria-hidden="true"></i> <?=$this->transEsc('history_saved_searches')?> </a> </li> diff --git a/themes/finc/templates/myresearch/setpin.phtml b/themes/finc/templates/myresearch/setpin.phtml new file mode 100644 index 0000000000000000000000000000000000000000..7d57c304752daa033d9e22475f432ca036205df7 --- /dev/null +++ b/themes/finc/templates/myresearch/setpin.phtml @@ -0,0 +1,66 @@ +<!-- finc: myresearch - setpin --> +<?php +// Set up page title: +$this->headTitle($this->translate('LiberoAccount::change_user_pin')); + +// Set up breadcrumbs: +$this->layout()->breadcrumbs = '<li><a href="' . $this->url('myresearch-home') . '">' . $this->transEsc('Your Account') . '</a></li>' + . '<li class="active">' . $this->transEsc('LiberoAccount::change_user_pin') . '</li>'; +?> +<?php if ($this->auth()->isLoggedIn()): ?> + <a class="search-filter-toggle visible-xs" href="#myresearch-sidebar" data-toggle="offcanvas" aria-label="<?=$this->transEsc('sidebar_expand')?>"> + <?=$this->transEsc('Your Account') ?> + </a> + <div class="<?=$this->layoutClass('mainbody')?>"> +<?php endif; ?> + + <h1><?=$this->transEsc('LiberoAccount::change_user_pin')?></h1> + <p class="alert alert-info"><?=$this->transEsc('LiberoAccount::set_pin_note')?></p> + <?=$this->flashmessages()?> + + <?php if (!$this->auth()->getManager()->supportsPasswordChange($this->auth_method)): ?> + <div class="error"><?=$this->transEsc('recovery_new_disabled')?></div> + <?php elseif (!isset($this->hash)): ?> + <div class="error"><?=$this->transEsc('recovery_user_not_found')?></div> + <?php else: ?> + <form id="setpin" class="form-set-pin" action="<?=$this->url('myresearch-setpin')?>" method="post" data-toggle="validator" role="form"> + <input type="hidden" value="<?=$this->escapeHtmlAttr($this->auth()->getManager()->getCsrfHash(true))?>" name="csrf"/> + <input type="hidden" value="<?=$this->escapeHtmlAttr($this->hash)?>" name="hash"/> + <input type="hidden" value="<?=$this->escapeHtmlAttr($this->username)?>" name="username"/> + <input type="hidden" value="<?=$this->escapeHtmlAttr($this->auth_method)?>" name="auth_method"/> + + <?php if (isset($this->cat_username)): ?> + <div class="form-group"> + <label class="control-label"><?=$this->transEsc('Username')?>:</label> + <p class="form-control"><?=$this->cat_username?></p> + </div> + <?php endif; ?> + + <div class="form-group"> + <label for="pin" class="control-label"><?=$this->transEsc('LiberoAccount::new_pin')?>:</label> + <input type="password" id="pin" name="pin" class="form-control" required aria-required="true" aria-describedby="pin-policy-error" + <?=isset($this->passwordPolicy['minLength']) ? ' data-minlength="' . $this->passwordPolicy['minLength'] . '" data-minlength-error="' . $this->escapeHtmlAttr($this->translate('password_minimum_length', array('%%minlength%%' => $this->passwordPolicy['minLength']))) . '"' : ''?> + <?=isset($this->passwordPolicy['maxLength']) ? ' maxlength="' . $this->passwordPolicy['maxLength'] . '"' : ''?> pattern="[0-9]{4}" /> + <div id="pin-policy-error" class="help-block with-errors"></div> + </div> + + <div class="form-group"> + <label for="confirm-pin" class="control-label"><?=$this->transEsc('LiberoAccount::confirm_new_pin')?>:</label> + <input type="password" id="confirm-pin" name="pin2" class="form-control" required aria-required="true" data-match="#pin" data-match-error="<?=$this->escapeHtmlAttr($this->translate('LiberoAccount::new_pin_missmatch'))?>" aria-describedby="pin-confirmation-error"/> + <div id="pin-confirmation-error" class="help-block with-errors"></div> + </div> + + <div class="form-group"> + <input class="btn btn-primary" name="submit" type="submit" value="<?=$this->transEsc('LiberoAccount::change_user_pin')?>"/> + </div> + </form> + <?php endif; ?> + +<?php if ($this->auth()->isLoggedIn()): ?> + </div> + + <div class="<?=$this->layoutClass('sidebar')?>"> + <?=$this->context($this)->renderInContext("myresearch/menu.phtml", ['active' => 'setpin'])?> + </div> +<?php endif; ?> +<!-- finc: myresearch - setpin - END -->