Feature Requested: Display Alert When Invalid Invoice Edit Attempted

Display Alert When Invalid Invoice Edit Attempted

When a user attempts to edit an invoice that they did not create, they are simply looped back to the list invoices page. Could you modify this so an alert message is displayed explaining th

SS

Scott Smith

Requested
When a user attempts to edit an invoice that they did not create, they are simply looped back to the list invoices page.

Could you modify this so an alert message is displayed explaining that users can only edit invoices input by them (except for admin, of course.)
  • MS

    Mian Saleem

    Answered
    Hello,

    I have checked. The warning is set but it's not being displayed. You can edit header view file `themes/default/views/header.php` and add the following line at the end of it

    ```php
    <?php if ($warning) {
    echo "<div class=\"alert alert-warning\"><button type=\"button\" class=\"close\" data-dismiss=\"alert\">&times;</button>" . $warning . "</div>";
    } ?>
    ```

    Thank you
  • SS

    Scott Smith

    Answered
    Still not displaying. If I manually set $warning, then it will display the warning message. So it would seem $warning isn't being set.
  • SS

    Scott Smith

    Answered
    I just checked and the reference to $warning only exists in the code you just gave me. Maybe it's a different variable?
  • MS

    Mian Saleem

    Answered
    Hello,

    Please edit `view_rights` of `app/libraries/Sim.php` and change the line 250 `$this->session->set_flashdata('warning', $this->data['access_denied']);` to the following

    ```php
    $this->session->set_flashdata('warning', lang('access_denied'));
    ```

    This will fix the issue.

    Thank you
  • SS

    Scott Smith

    Answered
    That solved it. Thank you!
  • Login to Reply