nBill Community nBill Home Page
23/May/2012, 12:30:16 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Click Here for the nBill home page, or take a tour.  
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: log file, or notification of event - deleted invoice  (Read 57 times)
ukdub
Jr. Member
**
Offline Offline

Posts: 12


View Profile
« on: 30/January/2012, 03:34:00 PM »

Firstly, apologies in advance if this is too custom I would like to keep track of deleted invoices. Is there any specific event that would allow me to do this, perhaps using a log file, or a database entry, or ideally an email notification? It doesn't have to be pretty.

I've looked at the development section of the documentation which includes an idea of how an audit trail feature could be developed: http://www.nbill.co.uk/help/index.php?page=extending-nbill.html

... but I'm looking for something a bit cruder, just a list of deletions in any format at all, so perhaps there is a quicker way to do it.

Many thanks in advance, and congrats on a great product
« Last Edit: 30/January/2012, 03:36:46 PM by ukdub » Logged
netshine
Administrator
Hero Member
*****
Offline Offline

Posts: 4,563


View Profile
« Reply #1 on: 30/January/2012, 03:41:53 PM »

The simplest way would be to add a .php file to the /administrator/components/com_nbill/events/invoice_deleted folder containing the following code:

<?php
$nb_database = nbf_cms::$interop->database;
$sql = "SELECT * FROM #__nbill_document WHERE id IN (" . $params['ids'] . ")";
$nb_database->setQuery($sql);
$invoices = $nb_database->loadObjectList();
mail("youremail@address.com", "Deleted Invoice Notification", print_r($invoices, true));
Logged
ukdub
Jr. Member
**
Offline Offline

Posts: 12


View Profile
« Reply #2 on: 30/January/2012, 04:19:22 PM »

Perfect! That's amazing. Thanks again
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!