|
From: <dai...@us...> - 2013-04-16 08:36:27
|
Revision: 5844
http://sourceforge.net/p/web-erp/reponame/5844
Author: daintree
Date: 2013-04-16 08:36:23 +0000 (Tue, 16 Apr 2013)
Log Message:
-----------
Ricard: audit purge outside DB Maintenance
Modified Paths:
--------------
trunk/Z_ChangeStockCode.php
trunk/doc/Change.log
trunk/includes/session.inc
Modified: trunk/Z_ChangeStockCode.php
===================================================================
--- trunk/Z_ChangeStockCode.php 2013-04-16 03:44:52 UTC (rev 5843)
+++ trunk/Z_ChangeStockCode.php 2013-04-16 08:36:23 UTC (rev 5844)
@@ -248,12 +248,15 @@
echo ' ... ' . _('completed');
echo '<br />' . _('Changing any image files');
-
- if (rename($_SESSION['part_pics_dir'] . '/' .$_POST['OldStockID'].'.jpg',
- $_SESSION['part_pics_dir'] . '/' .$_POST['NewStockID'].'.jpg')) {
- echo ' ... ' . _('completed');
+ if (file_exists($_SESSION['part_pics_dir'] . '/' .$_POST['OldStockID'].'.jpg')){
+ if (rename($_SESSION['part_pics_dir'] . '/' .$_POST['OldStockID'].'.jpg',
+ $_SESSION['part_pics_dir'] . '/' .$_POST['NewStockID'].'.jpg')) {
+ echo ' ... ' . _('completed');
+ } else {
+ echo ' ... ' . _('failed');
+ }
} else {
- echo ' ... ' . _('failed');
+ echo ' .... ' . _('no image to rename');
}
echo '<br />' . _('Changing the item properties table records') . ' - ' . _('parents');
Modified: trunk/doc/Change.log
===================================================================
--- trunk/doc/Change.log 2013-04-16 03:44:52 UTC (rev 5843)
+++ trunk/doc/Change.log 2013-04-16 08:36:23 UTC (rev 5844)
@@ -1,4 +1,6 @@
webERP Change Log
+
+16/4/13 Ricard: Audit trail was not being purged if DB Maintenance was turned off and it should be pruned daily.
16/04/13 Thumb: Fixed the bug of Y-m-d date format error in MiscFunctions.js (this date type is missing) which will display wrong date in Work Order.
6/4/13 Rafael: PDFPriceList.php split long description to maximum of 132 characters long
1/4/13 Kalmer Piiskop: Correct includes/LanguagesArray.php to use correct decimal point and thousands separator
Modified: trunk/includes/session.inc
===================================================================
--- trunk/includes/session.inc 2013-04-16 03:44:52 UTC (rev 5843)
+++ trunk/includes/session.inc 2013-04-16 08:36:23 UTC (rev 5844)
@@ -146,18 +146,17 @@
/*Do the DB maintenance routing for the DB_type selected */
DB_Maintenance($db);
- //purge the audit trail if necessary
- if (isset($_SESSION['MonthsAuditTrail'])){
- $sql = "DELETE FROM audittrail
- WHERE transactiondate <= '" . Date('Y-m-d', mktime(0,0,0, Date('m')-$_SESSION['MonthsAuditTrail'])) . "'";
- $ErrMsg = _('There was a problem deleting expired audit-trail history');
- $result = DB_query($sql,$db);
- }
$_SESSION['DB_Maintenance_LastRun'] = Date('Y-m-d');
}
}
}
-
+//purge the audit trail if necessary
+if (isset($_SESSION['MonthsAuditTrail'])){
+ $sql = "DELETE FROM audittrail
+ WHERE transactiondate <= '" . Date('Y-m-d', mktime(0,0,0, Date('m')-$_SESSION['MonthsAuditTrail'])) . "'";
+ $ErrMsg = _('There was a problem deleting expired audit-trail history');
+ $result = DB_query($sql,$db);
+}
/*Check to see if currency rates need to be updated */
if (isset($_SESSION['UpdateCurrencyRatesDaily'])){
|