diff --git a/themes/fid_bbi/templates/myresearch/profile.phtml b/themes/fid_bbi/templates/myresearch/profile.phtml new file mode 100644 index 0000000000000000000000000000000000000000..9442c7b367292baa3ab3b79adde8f1090ebae0e8 --- /dev/null +++ b/themes/fid_bbi/templates/myresearch/profile.phtml @@ -0,0 +1,62 @@ +<!-- 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 -->