This commit is contained in:
Dobie Wollert
2013-09-30 01:47:14 -04:00
parent 790c1ca597
commit cfcafd74ac
7 changed files with 82 additions and 10 deletions

View File

@ -8,7 +8,7 @@ var frequencies = ["annual","semi","quarterly","sterilizer","tg","ert","rae","me
exports.index = function(req, res) {
var query = Client.find({ deleted: false })
.select('name identifier')
.select('name identifier address')
.slice('contacts', 1)
.sort('name')
.exec(function(err, results) {
@ -79,6 +79,7 @@ exports.create = function(req, res, next) {
identifier: req.body.identifier,
contacts: req.body.contacts,
address: req.body.address,
notes: req.body.notes,
frequencies: {}
});
@ -108,6 +109,7 @@ exports.update = function(req, res, next) {
client.contacts = req.body.contacts;
client.address = req.body.address;
client.frequencies = req.body.frequencies;
client.notes = req.body.notes;
return client.save(function(err) {
if (!err) {

View File

@ -134,6 +134,8 @@ module.exports = function(calendar) {
cmd.$inc[key] = 1;
console.log(cmd);
Client.findByIdAndUpdate(req.body.client, cmd, function(err, ignored) { callback(err, result) });
} else {
callback(null, result);
}
},
],

View File

@ -20,7 +20,11 @@ var clientSchema = new Schema({
frequencies: {},
pms: {},
workorders: [{ type: ObjectId, ref: 'Workorder' }],
deleted: { type: Boolean, default: false }
deleted: { type: Boolean, default: false },
notes: {
internal: String,
tech: String
}
});
module.exports = mongoose.model('Client', clientSchema);

View File

@ -131,7 +131,8 @@ biomed.ClientEditCtrl = function($scope, $routeParams, Clients) {
$scope.primaryContact = createContactController(0);
$scope.secondaryContact = createContactController(1);
$scope.other = createOtherController();
$scope.internalNotes = createController();
$scope.techNotes = createController();
function updatePms() {
var currentMonth = new Date().getMonth();

View File

@ -165,6 +165,27 @@
</div>
</div>
</div>
<div class="form-section">
<div class="section-label">Notes</div>
<div class="section-container">
<div class="form-editor">
<div class="control-group">
<label class="control-label">Internal</label>
<div class="controls">
<textarea ng-model="model.notes.internal" type="text" class="input-xlarge"></textarea>
</div>
</div>
<div class="control-group">
<label class="control-label">Tech</label>
<div class="controls">
<textarea ng-model="model.notes.tech" type="text" class="input-xlarge"></textarea>
</div>
</div>
</div>
</div>
</div>
<div class="form-section">
<div class="section-label">&nbsp;</div>

View File

@ -6,6 +6,7 @@
<header ng-hide="loading">
<h1>{{master.name}}</h1>
<p class="lead">{{master.identifier}}</p>
<a href="/workorders/add?clientId={{master._id}}">Create new Workorder</a>
</header>
<div ng-hide="loading" class="tabbable">
<div class="tab-content">
@ -224,9 +225,6 @@
<div class="tab-pane" title="Workorders">
<div class="row-fluid">
<div class="span12">
<div class="toolbelt">
<a href="/workorders/add?clientId={{master._id}}" class="btn btn-primary">Create new Workorder</a>
</div>
<table class="biomed-table">
<thead>
<tr>
@ -312,4 +310,51 @@
</div>
</div>
</div>
<div class="tab-pane form" title="Notes">
<div class="form-section">
<div class="section-label">Internal Notes</div>
<div class="section-container">
<div ng-hide="internalNotes.visible" class="form-preview">
{{master.notes.internal}}<br ng-show="master.notes.internal">
<a ng-click="internalNotes.edit()" ng-class="{disabled: editing}">Edit</a>
</div>
<div ng-show="internalNotes.visible" class="form-editor">
<div class="control-group">
<label class="control-label">Notes</label>
<div class="controls">
<textarea ng-model="internalNotes.model.notes.internal" class="input-xlarge"></textarea>
</div>
</div>
<div class="form-actions">
<button ng-click="internalNotes.save()" type="button" class="btn btn-primary">Save</button>
<button ng-click="internalNotes.reset()" type="button" class="btn">Cancel</button>
</div>
</div>
</div>
</div>
<div class="form-section">
<div class="section-label">Tech Notes</div>
<div class="section-container">
<div ng-hide="techNotes.visible" class="form-preview">
{{master.notes.tech}}<br ng-show="master.notes.tech">
<a ng-click="techNotes.edit()" ng-class="{disabled: editing}">Edit</a>
</div>
<div ng-show="techNotes.visible" class="form-editor">
<div class="control-group">
<label class="control-label">Notes</label>
<div class="controls">
<textarea ng-model="techNotes.model.notes.tech" class="input-xlarge"></textarea>
</div>
</div>
<div class="form-actions">
<button ng-click="techNotes.save()" type="button" class="btn btn-primary">Save</button>
<button ng-click="techNotes.reset()" type="button" class="btn">Cancel</button>
</div>
</div>
</div>
</div>
</div>
</div>

View File

@ -22,6 +22,7 @@
</div>
</div>
</div>
<div class="form-section">
<div class="section-label">Remarks</div>
<div class="section-container">
@ -185,10 +186,6 @@
<div class="form-section">
<div class="section-label">&nbsp;</div>
<div class="section-container">
<p><b>Note:</b></p>
<p>Please only click save once, your work order is being saved the first time you click the button. There is a small bug preventing the page from returning you back to where you came from. This will be fixed after working hours.</p>
<p>If you notice any other issues, or need help with a work order, please feel free to <a href="http://atlanticbiomedical.com/ticket/" target="new"> Open a Ticket</a>
<br><br>
<button ng-click="save()" type="button" class="btn btn-primary">Save</button>
</div>