This commit is contained in:
Dobie Wollert
2015-11-25 01:06:03 -05:00
parent 0e5db1c9ee
commit 3a928400c5
5 changed files with 22 additions and 5 deletions

View File

@ -179,10 +179,27 @@ exports.update = function(req, res, next) {
return Client.findById(id, function(err, client) {
client.name = req.body.name;
client.identifier = req.body.identifier.toUpperCase();
client.contacts = req.body.contacts;
client.address = req.body.address;
client.frequencies = req.body.frequencies;
client.notes = req.body.notes;
// name phone email
for (var i = 0; i < 2; i++) {
if (req.body.contacts[i]) {
client.contacts.set(i, {});
client.contacts[i].name = req.body.contacts[i].name;
client.contacts[i].phone = req.body.contacts[i].phone;
client.contacts[i].email = req.body.contacts[i].email;
} else {
client.contacts[i] = null;
}
}
client.markModified('contacts');
console.log(client);
return client.save(function(err) {
if (err)

View File

@ -253,7 +253,7 @@
</tr>
<tr ng-repeat="workorder in workorders">
<td>
<a ng-href="/workorders/{{workorder._id}}">{{workorder.reason}}</a><br>
<a ng-href="/workorders/{{workorder._id}}"><span ng-if="workorder.reason">{{workorder.reason}}</span><i ng-if="!workorder.reason">-- No Reason --</i></a><br>
<strong>Techs:</strong> {{ workorder.techs | techs }}<br>
{{workorder.remarks}}
</td>

View File

@ -28,7 +28,7 @@
<option value="Ice Maker">Ice Maker</option>
<option value="Imaging">Imaging</option>
<option value="Medical Device">Medical Device</option>
<option value="Medical Gas Systems">Medical Gas Systems</option>
<option value="Medical Gas System">Medical Gas Systems</option>
<option value="N2O Trace Gas">N2O Trace Gas</option>
<option value="Quarterly">Quarterly</option>
<option value="RAE">RAE</option>

View File

@ -18,7 +18,7 @@
<option value="Ice Maker">Ice Maker</option>
<option value="Imaging">Imaging</option>
<option value="Medical Device">Medical Device</option>
<option value="Medical Gas Systems">Medical Gas Systems</option>
<option value="Medical Gas System">Medical Gas Systems</option>
<option value="N2O Trace Gas">N2O Trace Gas</option>
<option value="Quarterly">Quarterly</option>
<option value="RAE">RAE</option>

View File

@ -15,7 +15,7 @@
<form name="form" class="form-section" style="margin-bottom: 0">
<div class="section-label">Status</div>
<div class="section-container">
<div ng-hide="status.visible" class="form-preview">
<div class="form-preview">
<b>{{master.status}}</b><br>
</div>
</div>