Skip to content
Snippets Groups Projects
Commit e1420f0d authored by Demian Katz's avatar Demian Katz
Browse files

Smarter capability checking - hide unsupported ILS features.

parent f700eb5b
No related merge requests found
...@@ -5,16 +5,24 @@ ...@@ -5,16 +5,24 @@
<li<?=$this->active == 'favorites' ? ' class="active"' : ''?>><a href="<?=$this->url('myresearch-favorites')?>"><?=$this->transEsc('Favorites')?></a></li> <li<?=$this->active == 'favorites' ? ' class="active"' : ''?>><a href="<?=$this->url('myresearch-favorites')?>"><?=$this->transEsc('Favorites')?></a></li>
<? endif; ?> <? endif; ?>
<? if ('ils-none' !== $this->ils()->getOfflineMode()): ?> <? if ('ils-none' !== $this->ils()->getOfflineMode()): ?>
<li<?=$this->active == 'checkedout' ? ' class="active"' : ''?>><a href="<?=$this->url('myresearch-checkedout')?>"><?=$this->transEsc('Checked Out Items')?></a></li> <? if ($this->ils()->checkCapability('getMyTransactions')): ?>
<li<?=$this->active == 'holds' ? ' class="active"' : ''?>><a href="<?=$this->url('myresearch-holds')?>"><?=$this->transEsc('Holds and Recalls')?></a></li> <li<?=$this->active == 'checkedout' ? ' class="active"' : ''?>><a href="<?=$this->url('myresearch-checkedout')?>"><?=$this->transEsc('Checked Out Items')?></a></li>
<? endif; ?>
<? if ($this->ils()->checkCapability('getMyHolds')): ?>
<li<?=$this->active == 'holds' ? ' class="active"' : ''?>><a href="<?=$this->url('myresearch-holds')?>"><?=$this->transEsc('Holds and Recalls')?></a></li>
<? endif; ?>
<? if ($this->ils()->checkFunction('StorageRetrievalRequests')): ?> <? if ($this->ils()->checkFunction('StorageRetrievalRequests')): ?>
<li<?=$this->active == 'storageRetrievalRequests' ? ' class="active"' : ''?>><a href="<?=$this->url('myresearch-storageretrievalrequests')?>"><?=$this->transEsc('Storage Retrieval Requests')?></a></li> <li<?=$this->active == 'storageRetrievalRequests' ? ' class="active"' : ''?>><a href="<?=$this->url('myresearch-storageretrievalrequests')?>"><?=$this->transEsc('Storage Retrieval Requests')?></a></li>
<? endif; ?> <? endif; ?>
<? if ($this->ils()->checkFunction('ILLRequests')): ?> <? if ($this->ils()->checkFunction('ILLRequests')): ?>
<li<?=$this->active == 'ILLRequests' ? ' class="active"' : ''?>><a href="<?=$this->url('myresearch-illrequests')?>"><?=$this->transEsc('Interlibrary Loan Requests')?></a></li> <li<?=$this->active == 'ILLRequests' ? ' class="active"' : ''?>><a href="<?=$this->url('myresearch-illrequests')?>"><?=$this->transEsc('Interlibrary Loan Requests')?></a></li>
<? endif; ?> <? endif; ?>
<li<?=$this->active == 'fines' ? ' class="active"' : ''?>><a href="<?=$this->url('myresearch-fines')?>"><?=$this->transEsc('Fines')?></a></li> <? if ($this->ils()->checkCapability('getMyFines')): ?>
<li<?=$this->active == 'profile' ? ' class="active"' : ''?>><a href="<?=$this->url('myresearch-profile')?>"><?=$this->transEsc('Profile')?></a></li> <li<?=$this->active == 'fines' ? ' class="active"' : ''?>><a href="<?=$this->url('myresearch-fines')?>"><?=$this->transEsc('Fines')?></a></li>
<? endif; ?>
<? if ($this->ils()->checkCapability('getMyProfile')): ?>
<li<?=$this->active == 'profile' ? ' class="active"' : ''?>><a href="<?=$this->url('myresearch-profile')?>"><?=$this->transEsc('Profile')?></a></li>
<? endif; ?>
<? endif; ?> <? endif; ?>
<li<?=$this->active == 'history' ? ' class="active"' : ''?>><a href="<?=$this->url('search-history')?>?require_login"><?=$this->transEsc('history_saved_searches')?></a></li> <li<?=$this->active == 'history' ? ' class="active"' : ''?>><a href="<?=$this->url('search-history')?>?require_login"><?=$this->transEsc('history_saved_searches')?></a></li>
</ul> </ul>
......
...@@ -7,14 +7,18 @@ ...@@ -7,14 +7,18 @@
</a> </a>
<? endif; ?> <? endif; ?>
<? if ('ils-none' !== $this->ils()->getOfflineMode()): ?> <? if ('ils-none' !== $this->ils()->getOfflineMode()): ?>
<a href="<?=$this->url('myresearch-checkedout')?>" class="list-group-item<?=$this->active == 'checkedout' ? ' active' : ''?>"> <? if ($this->ils()->checkCapability('getMyTransactions')): ?>
<?=$this->transEsc('Checked Out Items')?> <a href="<?=$this->url('myresearch-checkedout')?>" class="list-group-item<?=$this->active == 'checkedout' ? ' active' : ''?>">
<span class="pull-right"><i class="fa fa-book"></i></span> <?=$this->transEsc('Checked Out Items')?>
</a> <span class="pull-right"><i class="fa fa-book"></i></span>
<a href="<?=$this->url('myresearch-holds')?>" class="list-group-item<?=$this->active == 'holds' ? ' active' : ''?>"> </a>
<?=$this->transEsc('Holds and Recalls')?> <? endif; ?>
<span class="pull-right"><i class="fa fa-flag"></i></span> <? if ($this->ils()->checkCapability('getMyHolds')): ?>
</a> <a href="<?=$this->url('myresearch-holds')?>" class="list-group-item<?=$this->active == 'holds' ? ' active' : ''?>">
<?=$this->transEsc('Holds and Recalls')?>
<span class="pull-right"><i class="fa fa-flag"></i></span>
</a>
<? endif; ?>
<? if ($this->ils()->checkFunction('StorageRetrievalRequests')): ?> <? if ($this->ils()->checkFunction('StorageRetrievalRequests')): ?>
<a href="<?=$this->url('myresearch-storageretrievalrequests')?>" class="list-group-item<?=$this->active == 'storageRetrievalRequests' ? ' active' : ''?>"> <a href="<?=$this->url('myresearch-storageretrievalrequests')?>" class="list-group-item<?=$this->active == 'storageRetrievalRequests' ? ' active' : ''?>">
<?=$this->transEsc('Storage Retrieval Requests')?> <?=$this->transEsc('Storage Retrieval Requests')?>
...@@ -27,14 +31,18 @@ ...@@ -27,14 +31,18 @@
<span class="pull-right"><i class="fa fa-exchange"></i></span> <span class="pull-right"><i class="fa fa-exchange"></i></span>
</a> </a>
<? endif; ?> <? endif; ?>
<a href="<?=$this->url('myresearch-fines')?>" class="list-group-item<?=$this->active == 'fines' ? ' active' : ''?>"> <? if ($this->ils()->checkCapability('getMyFines')): ?>
<?=$this->transEsc('Fines')?> <a href="<?=$this->url('myresearch-fines')?>" class="list-group-item<?=$this->active == 'fines' ? ' active' : ''?>">
<span class="pull-right"><i class="fa fa-usd"></i></span> <?=$this->transEsc('Fines')?>
</a> <span class="pull-right"><i class="fa fa-usd"></i></span>
<a href="<?=$this->url('myresearch-profile')?>" class="list-group-item<?=$this->active == 'profile' ? ' active' : ''?>"> </a>
<?=$this->transEsc('Profile')?> <? endif; ?>
<span class="pull-right"><i class="fa fa-user"></i></span> <? if ($this->ils()->checkCapability('getMyProfile')): ?>
</a> <a href="<?=$this->url('myresearch-profile')?>" class="list-group-item<?=$this->active == 'profile' ? ' active' : ''?>">
<?=$this->transEsc('Profile')?>
<span class="pull-right"><i class="fa fa-user"></i></span>
</a>
<? endif; ?>
<? endif; ?> <? endif; ?>
<a href="<?=$this->url('search-history')?>?require_login" class="list-group-item<?=$this->active == 'history' ? ' active' : ''?>"> <a href="<?=$this->url('search-history')?>?require_login" class="list-group-item<?=$this->active == 'history' ? ' active' : ''?>">
<?=$this->transEsc('history_saved_searches')?> <?=$this->transEsc('history_saved_searches')?>
......
<? if ($this->auth()->isLoggedIn() && 'ils-none' !== $this->ils()->getOfflineMode()): ?> <? if ($this->auth()->isLoggedIn() && 'ils-none' !== $this->ils()->getOfflineMode()): ?>
<div data-role="navbar"> <div data-role="navbar">
<ul> <ul>
<li><a rel="external" <?=$this->layout()->templateName=="checkedout" ? ' class="ui-btn-active"' : ''?> href="<?=$this->url('myresearch-checkedout')?>"><?=$this->transEsc('Checked Out')?></a></li> <? if ($this->ils()->checkCapability('getMyTransactions')): ?>
<li><a rel="external" <?=$this->layout()->templateName=="holds" ? ' class="ui-btn-active"' : ''?> href="<?=$this->url('myresearch-holds')?>"><?=$this->transEsc('Holds')?></a></li> <li><a rel="external" <?=$this->layout()->templateName=="checkedout" ? ' class="ui-btn-active"' : ''?> href="<?=$this->url('myresearch-checkedout')?>"><?=$this->transEsc('Checked Out')?></a></li>
<li><a rel="external" <?=$this->layout()->templateName=="fines" ? ' class="ui-btn-active"' : ''?> href="<?=$this->url('myresearch-fines')?>"><?=$this->transEsc('Fines')?></a></li> <? endif; ?>
<? if ($this->ils()->checkCapability('getMyHolds')): ?>
<li><a rel="external" <?=$this->layout()->templateName=="holds" ? ' class="ui-btn-active"' : ''?> href="<?=$this->url('myresearch-holds')?>"><?=$this->transEsc('Holds')?></a></li>
<? endif; ?>
<? if ($this->ils()->checkCapability('getMyFines')): ?>
<li><a rel="external" <?=$this->layout()->templateName=="fines" ? ' class="ui-btn-active"' : ''?> href="<?=$this->url('myresearch-fines')?>"><?=$this->transEsc('Fines')?></a></li>
<? endif; ?>
</ul> </ul>
</div> </div>
<? endif; ?> <? endif; ?>
\ No newline at end of file
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