Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Display "Locations list" and "Locations map" links for read only users #3755

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 9 additions & 0 deletions app/tools/locations/all-locations-list.php
@@ -1,6 +1,15 @@
<h4><?php print _('List of all locations'); ?></h4>
<hr>

<ul class='nav nav-tabs' style='margin-top:0px;margin-bottom:20px;'>
<li role='presentation' <?php if(!isset($_GET['subnetId'])||is_numeric($_GET['subnetId'])) print " class='active'"; ?>>
<a href='<?php print create_link($_GET['page'], "locations"); ?>'><?php print _("Locations list"); ?></a>
</li>
<li role='presentation' <?php if(@$_GET['subnetId']=="map") print " class='active'"; ?>>
<a href='<?php print create_link($_GET['page'], "locations", "map"); ?>'><?php print _("Locations map"); ?></a>
</li>
</ul>

<?php
if($User->get_module_permissions ("locations")>=User::ACCESS_RW) {
include('menu.php');
Expand Down
9 changes: 9 additions & 0 deletions app/tools/locations/all-locations-map.php
Expand Up @@ -3,6 +3,15 @@
<hr>
<?php } ?>

<ul class='nav nav-tabs' style='margin-top:0px;margin-bottom:20px;'>
<li role='presentation' <?php if(!isset($_GET['subnetId'])||is_numeric($_GET['subnetId'])) print " class='active'"; ?>>
<a href='<?php print create_link($_GET['page'], "locations"); ?>'><?php print _("Locations list"); ?></a>
</li>
<li role='presentation' <?php if(@$_GET['subnetId']=="map") print " class='active'"; ?>>
<a href='<?php print create_link($_GET['page'], "locations", "map"); ?>'><?php print _("Locations map"); ?></a>
</li>
</ul>

<?php if(isset($admin) && ($admin && $User->settings->enableLocations=="1")) { ?>
<?php
if($User->get_module_permissions ("locations")>=User::ACCESS_RW) {
Expand Down
10 changes: 0 additions & 10 deletions app/tools/locations/menu.php
@@ -1,12 +1,2 @@
<ul class='nav nav-tabs' style='margin-top:0px;margin-bottom:20px;'>
<li role='presentation' <?php if(!isset($_GET['subnetId'])||is_numeric($_GET['subnetId'])) print " class='active'"; ?>>
<a href='<?php print create_link($_GET['page'], "locations"); ?>'><?php print _("Locations list"); ?></a>
</li>
<li role='presentation' <?php if(@$_GET['subnetId']=="map") print " class='active'"; ?>>
<a href='<?php print create_link($_GET['page'], "locations", "map"); ?>'><?php print _("Locations map"); ?></a>
</li>
</ul>


<!-- Add link -->
<a href="" class='btn btn-sm btn-success open_popup' data-script='app/admin/locations/edit.php' data-action='add' data-id='' data-action='add' style='margin-bottom:10px;'><i class='fa fa-plus'></i> <?php print _('Add location'); ?></a>