/** * Store a newly created resolution in storage. * * @return Response */ public function store() { $validator = Validator::make($data = Input::all(), Resolution::$rules); if ($validator->fails()) { return Redirect::back()->withErrors($validator)->withInput(); } $enquiry = Enquiry::findOrFail(Input::get('enquiry_id')); $resolution = new Resolution(); $resolution->enquiry()->associate($enquiry); $resolution->date = date('Y-m-d'); $resolution->resolution = Input::get('resolution'); $resolution->save(); return Redirect::to('enquiries/show/' . $resolution->enquiry->id); }
/** * @copyright 2012 City of Bloomington, Indiana * @license http://www.gnu.org/licenses/agpl.txt GNU/AGPL, see LICENSE.txt * @author Cliff Ingham <*****@*****.**> */ require_once './config.inc'; // Clear out the lookup tables. We'll import everything from Mongo // The mysql.sql script preloads some generic values for these tables $zend_db->delete('resolutions'); $zend_db->delete('actions'); $result = $mongo->resolutions->find(); foreach ($result as $r) { $o = new Resolution(); $o->handleUpdate($r); $o->save(); echo "Resolution: {$o->getName()}\n"; } $result = $mongo->actions->find(); foreach ($result as $r) { $o = new Action(); $o->handleUpdate($r); $o->save(); echo "Action: {$o->getName()}\n"; } $result = $mongo->lookups->findOne(array('name' => 'contactMethods')); $methods = $result['items']; foreach ($methods as $m) { $o = new ContactMethod(); $o->setName($m); $o->save();
<?php /** * @copyright 2011 City of Bloomington, Indiana * @license http://www.gnu.org/licenses/agpl.txt GNU/AGPL, see LICENSE.txt * @author Cliff Ingham <*****@*****.**> */ include '../../../configuration.inc'; $resolutions = array('Resolved' => 'This ticket has been taken care of', 'Duplicate' => 'This ticket is a duplicate of another ticket', 'Bogus' => 'This ticket is not actually a problem or has already been taken care of'); foreach ($resolutions as $name => $description) { $resolution = new Resolution(); $resolution->setName($name); $resolution->setDescription($description); $resolution->save(); echo "{$resolution}\n"; } $actions = array(array('name' => 'open', 'description' => 'Opened by {actionPerson}', 'type' => 'system'), array('name' => 'assignment', 'description' => '{enteredByPerson} assigned this case to {actionPerson}', 'type' => 'system'), array('name' => 'close', 'description' => 'Closed by {actionPerson}', 'type' => 'system'), array('name' => 'referral', 'description' => '{enteredByPerson} referred this case to {actionPerson}', 'type' => 'system'), array('name' => 'Inspection', 'description' => '{actionPerson} inspected this Location', 'type' => 'department'), array('name' => 'Follow up', 'description' => '{actionPerson} followed up on this ticket', 'type' => 'department')); foreach ($actions as $a) { $action = new Action(); $action->setName($a['name']); $action->setDescription($a['description']); $action->setType($a['type']); $action->save(); echo "{$action->getName()}\n"; }