Jump to content

Recommended Posts

Posted

Hi guys, does anyone know if there is a way so that staff members cannot accept their own PIREPS ? I've had a look around the admin center and can't see a way to be able to do it.

As always any help appreciated :wub:

  • Moderators
Posted

Open pireps_list.tpl in admin/templates and look for the following button:

<?php
   # If there was an error, don't allow the PIREP to go through
   if($error == false)
   {

   ?>
       <button href="<?php echo SITE_URL?>/admin/action.php/pirepadmin/<?php echo $load; ?>?pilotid=<?php echo $pirep->pilotid?>" action="approvepirep"
       id="<?php echo $pirep->pirepid;?>" class="pirepaction {button:{icons:{primary:'ui-icon-check'}}}">Accept</button>

       <?php

   }
   ?>

Now you need to add an if statement to it like this:

<?php
# If there was an error, don't allow the PIREP to go through
if($error == false)
{
if($pirep->pilotid != Auth::$userinfo->pilotid)
{
?>
<button href="<?php echo SITE_URL?>/admin/action.php/pirepadmin/<?php echo $load; ?>?pilotid=<?php echo $pirep->pilotid?>" action="approvepirep"
id="<?php echo $pirep->pirepid;?>" class="pirepaction {button:{icons:{primary:'ui-icon-check'}}}">Accept</button>

<?php
}
}
?>

This will remove the "accept" button if the pirep belongs to the staff. ;):D

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...