########################################################################################## VEH-12: Add active flag to vehicles ########################################################################################## Issue Type: Task ----------------------------------------------------------------------------------------- Issue Information ==================== Priority: Major Status: Closed Resolution: Done (2013-11-10 01:55:40) Project: VehMan (VEH) Reported By: btasker Assigned To: btasker Components: - Submodules - Vehicles - Documentation Targeted for fix in version: - 1.0.1 Time Estimate: 0 minutes Time Logged: 0 minutes ----------------------------------------------------------------------------------------- Issue Description ================== Add an 'active' flag to vehicles so that when a vehicle has been sold it can be excluded from dropdown menus (i.e. for adding fuellogs etc) ----------------------------------------------------------------------------------------- Issue Relations ================ - relates to VCL-3: Add Support for marking a vehicle as sold ----------------------------------------------------------------------------------------- Subtasks ========== - VEH-13: Add filter object to vehicles ----------------------------------------------------------------------------------------- Activity ========== ----------------------------------------------------------------------------------------- 2013-11-02 10:38:46 btasker ----------------------------------------------------------------------------------------- Sold indicator added to database scripts in commit 6cf8cd33 on 14 Oct. Ordering was also adjusted within the submodule. Documentation doesn't seem to have been adjusted, therefore we need to update the docs and implement a mechanism for 'selling' the vehicle ----------------------------------------------------------------------------------------- 2013-11-02 10:39:27 ----------------------------------------------------------------------------------------- btasker changed status from 'Open' to 'In Progress' ----------------------------------------------------------------------------------------- 2013-11-02 17:17:34 btasker ----------------------------------------------------------------------------------------- Mechanism is implemented but needs testing. ----------------------------------------------------------------------------------------- 2013-11-10 01:49:25 btasker ----------------------------------------------------------------------------------------- Mechanism doesn't return any errors or output (JSON response is empty). The changes made to the database are invalid though, as all vehicles have been marked as sold. It looks like there's an issue with the SQL query somewhere ----------------------------------------------------------------------------------------- 2013-11-10 01:50:48 btasker ----------------------------------------------------------------------------------------- Might be something to do with having forgotten to add a where clause! -- BEGIN QUOTE -- $sql = "UPDATE `Vehicles` SET `Sold`=1, `SoldDate`='".$this->db->stringEscape($solddate)."', `SoldReason`='".$this->db->stringEscape($request->Reason)."'"; -- END QUOTE -- If ever proof was needed about late night coding.......... ----------------------------------------------------------------------------------------- 2013-11-10 01:55:10 btasker ----------------------------------------------------------------------------------------- Query updated, and now functions correctly. Response is 'true'. ----------------------------------------------------------------------------------------- 2013-11-10 01:55:40 ----------------------------------------------------------------------------------------- btasker changed status from 'In Progress' to 'Resolved' ----------------------------------------------------------------------------------------- 2013-11-10 01:55:40 ----------------------------------------------------------------------------------------- btasker added 'Done' to resolution ----------------------------------------------------------------------------------------- 2013-11-10 01:55:49 ----------------------------------------------------------------------------------------- btasker changed status from 'Resolved' to 'Closed'