From 040d34bc264347aef25a6aadde6b91da79c0f975 Mon Sep 17 00:00:00 2001 From: Gregor Gawol <gawol@ub.uni-leipzig.de> Date: Mon, 17 Jun 2019 18:02:12 +0200 Subject: [PATCH] refs #15405 [fid] changes user data * display only ils user data * modified update template * added link to edit data * added translations --- themes/fid/languages/fid/de.ini | 1 + themes/fid/languages/fid/en.ini | 1 + themes/fid/templates/fid/user/update.phtml | 9 ++-- themes/fid/templates/myresearch/profile.phtml | 49 +------------------ 4 files changed, 8 insertions(+), 52 deletions(-) diff --git a/themes/fid/languages/fid/de.ini b/themes/fid/languages/fid/de.ini index 80a2527f6e7..e8d9cff11b8 100644 --- a/themes/fid/languages/fid/de.ini +++ b/themes/fid/languages/fid/de.ini @@ -68,3 +68,4 @@ password_change_error_expired = "Der Link ist abgelaufen." password_change_error_autologon = "Ihr Passwort wurde gespeichert. Jedoch ist ein unerwarteteter Fehler bei der automatischen Anmeldung aufgetreten." password_change_success = "Passwort erfolgreich gespeichert." +Edit Account = "Profildaten ändern" diff --git a/themes/fid/languages/fid/en.ini b/themes/fid/languages/fid/en.ini index 20c8bb8772b..865c3ab2300 100644 --- a/themes/fid/languages/fid/en.ini +++ b/themes/fid/languages/fid/en.ini @@ -68,3 +68,4 @@ password_change_error = "An unexpected error has occurred." password_change_error_expired = "The link has already expired." password_change_error_autologon = "You password has been update. However, an unexpected error has occurred during the process of logging on." +Edit Account = "Edit Account" diff --git a/themes/fid/templates/fid/user/update.phtml b/themes/fid/templates/fid/user/update.phtml index 95e3c1c3713..9b2c8b78fe5 100644 --- a/themes/fid/templates/fid/user/update.phtml +++ b/themes/fid/templates/fid/user/update.phtml @@ -186,12 +186,13 @@ $elemJobTitle->setValue($user->getJobTitle()); <?php /** @var Submit $elemSubmit */ $elemSubmit = $form->get('submit'); -$elemSubmit->setAttributes(['class' => 'btn btn-primary right']); +$elemSubmit->setAttributes(['class' => 'btn btn-primary']); ?> <div class="form-group"> - <div class="col-lg-11 col-md-9 col-sm-11 col-xs-12"> - <?= $this->formSubmit($elemSubmit) ?> - </div> + <div class="col-lg-11 col-md-9 col-sm-11 col-xs-12"> + <?= $this->formSubmit($elemSubmit) ?> + <a href="<?=$this->url('myresearch-profile')?>" class="btn btn-primary"><?=$this->transEsc('Cancel')?></a> + </div> </div> <?= $this->form()->closeTag($form) ?> \ No newline at end of file diff --git a/themes/fid/templates/myresearch/profile.phtml b/themes/fid/templates/myresearch/profile.phtml index 23a563176f2..71e70016573 100644 --- a/themes/fid/templates/myresearch/profile.phtml +++ b/themes/fid/templates/myresearch/profile.phtml @@ -14,55 +14,7 @@ $arrTemplate = '<tr><th>%%LABEL%%:</th><td> %%VALUE%%</td></tr>'; <h2><?=$this->transEsc('Your Profile')?></h2> <?=$this->flashmessages();?> - <table class="table table-striped"> - <?=$this->renderArray( - $arrTemplate, $this->user, - [ - $this->transEsc('First Name') => 'firstname', - $this->transEsc('Last Name') => 'lastname', - // finc: show e-mail in table below - // $this->transEsc('Email') => 'email', - ] - )?> - <?php if (count($this->pickup ?? []) > 1): // Skip form if only one location: ?> - <tr><th><?=$this->transEsc('Preferred Library')?>:</th> - <?php - $selected = (strlen($this->profile['home_library'] ?? '') > 0) - ? $this->profile['home_library'] : $this->defaultPickupLocation - ?> - <td> - <form id="profile_form" class="form-inline" method="post"> - <select id="home_library" name="home_library" class="form-control"> - <?php foreach ($this->pickup as $lib): ?> - <option - value="<?=$this->escapeHtmlAttr($lib['locationID'])?>"<?=($selected == $lib['locationID']) ? ' selected="selected"' : ''?>><?=$this->transEsc('location_' . $lib['locationDisplay'], null, $lib['locationDisplay'])?></option> - <?php endforeach; ?> - </select> - <input class="btn btn-default" type="submit" value="<?=$this->transEsc('Save')?>"/> - </form> - </td> - <?php endif; ?> - </table> - - <div id="account-actions"> - <?php if ($this->auth()->getManager()->supportsPasswordChange()): ?> - <a class="btn btn-default" href="<?=$this->url('myresearch-changepassword') ?>"> - <i class="fa fa-fw fa-lock" aria-hidden="true"></i> <?=$this->transEsc('Change Password') ?> - </a> - <?php endif; ?> - - <?php if ($this->accountDeletion): ?> - <a class="btn btn-default" href="<?=$this->url('myresearch-deleteaccount') ?>" data-lightbox> - <i class="fa fa-times"></i> <?=$this->transEsc('delete_account_title') ?> - </a> - <?php endif; ?> - </div> - <?php if (is_array($this->profile)): ?> - <h3><?=$this->transEsc('Library Catalog Profile')?></h3> - <p> - <?=$this->context($this)->renderInContext('librarycards/selectcard.phtml', ['user' => $this->user]); ?> - </p> <table class="table table-striped"> <?=$this->renderArray( $arrTemplate, $this->profile, @@ -83,6 +35,7 @@ $arrTemplate = '<tr><th>%%LABEL%%:</th><td> %%VALUE%%</td></tr>'; ] )?> </table> + <a href="<?=$this->url('fid/user/update')?>" class="btn btn-primary"><?=$this->transEsc('fid::Edit Account')?></a> <?php elseif ('ils-none' !== $this->ils()->getOfflineMode() && $this->patronLoginView && !empty($this->patronLoginView->getTemplate())): ?> <?=$this->partial($this->patronLoginView);?> <?php endif; ?> -- GitLab