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

refs #16941 [fid_bbi] modified profile view

* added values
* set order
* fixed college bug/notice
* fixed academic title bug
* set address
parent 6260fd18
Branches
Tags
No related merge requests found
<!-- fid_bbi: myresearch - profile -->
<?php
// Set up page title:
$this->headTitle($this->translate('My Profile'));
// Set up breadcrumbs:
$this->layout()->breadcrumbs = '<li><a href="' . $this->url('myresearch-home') . '">' . $this->transEsc('Your Account') . '</a></li> <li class="active">' . $this->transEsc('Profile') . '</li>';
// Template for use by the renderArray helper:
$arrTemplate = '<tr><th>%%LABEL%%:</th><td> %%VALUE%%</td></tr>';
$profile = $this->profile;
if (is_array($profile)) {
$groups = $this->UserGroups($profile['user']->getPermissions());
$profile['group'] = $groups->granted();
$profile['job_title'] = $this->translate('fid::job_title_' . $profile['user']->getJobTitle());
$profile['salutation'] = !empty($profile['user']->getSalutation()) ?
$this->translate('fid::label_salutation_' . $profile['user']->getSalutation()) : '';
$profile['academic_title'] = !empty($profile['user']->getAcademicTitle()) ?
$profile['user']->getAcademicTitle() : '';
$profile['home_library'] = $profile['libs'][$profile['user']->getHomeLibrary()]->getLabel();
$profile['college'] = $profile['user']->getCollege();
}
?>
<div class="<?=$this->layoutClass('mainbody')?>">
<?php /* finc V5: adds offcanvas-toggler missing in VF5, compare with finc/fid themes during update - CK */ ?>
<?=$this->render('RecordDriver/DefaultRecord/offcanvas-toggler-myresearch'); ?>
<h2><?=$this->transEsc('Your Profile')?></h2>
<?=$this->flashmessages();?>
<?php if (is_array($this->profile)): ?>
<div class="table-responsive"><table class="table table-striped">
<?=$this->renderArray(
$arrTemplate,
$profile,
array_merge(
[
$this->transEsc('fid::label_username') => 'email',
$this->transEsc('fid::label_home_library') => 'home_library'
],
$profile['academic_title'] ? [$this->transEsc('fid::label_academic_title') => 'academic_title'] : [],
$profile['salutation'] ? [$this->transEsc('fid::label_salutation') => 'salutation'] : [],
$profile['firstname'] ? [$this->transEsc('fid::label_firstname') => 'firstname'] : [],
$profile['lastname'] ? [$this->transEsc('fid::label_lastname') => 'lastname'] : [],
$profile['college'] ? [$this->transEsc('fid::label_college') => 'college'] : [],
[
$this->transEsc('fid::label_job_title') => 'job_title'
],
$profile['address1'] ?? '' ? [$this->transEsc('Address') => 'address1'] : []
)
)?>
</table></div>
<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; ?>
</div>
<div class="<?=$this->layoutClass('sidebar')?>">
<?=$this->context($this)->renderInContext("myresearch/menu.phtml", ['active' => 'profile'])?>
</div>
<!-- fid_bbi: myresearch - profile - END -->
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