* Commit final corrections before version 0.7

This commit is contained in:
alextselegidis@gmail.com 2013-11-24 15:45:44 +00:00
parent 75a6efb79c
commit 57a3e433eb
3 changed files with 26 additions and 8 deletions

View file

@ -187,6 +187,13 @@
<input type="text" id="end-datetime" /> <input type="text" id="end-datetime" />
</div> </div>
</div> </div>
<div class="control-group">
<label for="notes" class="control-label">Notes</label>
<div class="controls">
<textarea id="appointment-notes" class="span4" rows="3"></textarea>
</div>
</div>
</fieldset> </fieldset>
<fieldset class="row-fluid"> <fieldset class="row-fluid">
@ -257,7 +264,7 @@
<div class="control-group"> <div class="control-group">
<label for="notes" class="control-label">Notes</label> <label for="notes" class="control-label">Notes</label>
<div class="controls"> <div class="controls">
<textarea id="notes"></textarea> <textarea id="customer-notes" rows="3"></textarea>
</div> </div>
</div> </div>
</div> </div>

View file

@ -165,7 +165,8 @@ var BackendCalendar = {
$dialog.find('#address').val(customer['address']); $dialog.find('#address').val(customer['address']);
$dialog.find('#city').val(customer['city']); $dialog.find('#city').val(customer['city']);
$dialog.find('#zip-code').val(customer['zip_code']); $dialog.find('#zip-code').val(customer['zip_code']);
$dialog.find('#notes').val(appointment['notes']); $dialog.find('#appointment-notes').val(appointment['notes']);
$dialog.find('#customer-notes').val(customer['notes']);
$dialog.modal('show'); $dialog.modal('show');
} }
@ -344,7 +345,8 @@ var BackendCalendar = {
$dialog.find('#address').val(customer['address']); $dialog.find('#address').val(customer['address']);
$dialog.find('#city').val(customer['city']); $dialog.find('#city').val(customer['city']);
$dialog.find('#zip-code').val(customer['zip_code']); $dialog.find('#zip-code').val(customer['zip_code']);
$dialog.find('#notes').val(appointment['notes']); $dialog.find('#appointment-notes').val(appointment['notes']);
$dialog.find('#customer-notes').val(customer['notes']);
} else { } else {
var unavailable = BackendCalendar.lastFocusedEventData.data; var unavailable = BackendCalendar.lastFocusedEventData.data;
@ -491,7 +493,7 @@ var BackendCalendar = {
'id_users_provider': $dialog.find('#select-provider').val(), 'id_users_provider': $dialog.find('#select-provider').val(),
'start_datetime': startDatetime, 'start_datetime': startDatetime,
'end_datetime': endDatetime, 'end_datetime': endDatetime,
'notes': $dialog.find('#notes').val(), 'notes': $dialog.find('#appointment-notes').val(),
'is_unavailable': false 'is_unavailable': false
}; };
@ -507,7 +509,8 @@ var BackendCalendar = {
'phone_number': $dialog.find('#phone-number').val(), 'phone_number': $dialog.find('#phone-number').val(),
'address': $dialog.find('#address').val(), 'address': $dialog.find('#address').val(),
'city': $dialog.find('#city').val(), 'city': $dialog.find('#city').val(),
'zip_code': $dialog.find('#zip-code').val() 'zip_code': $dialog.find('#zip-code').val(),
'notes': $dialog.find('#customer-notes').val()
}; };
if ($dialog.find('#customer-id').val() !== '') { if ($dialog.find('#customer-id').val() !== '') {
@ -837,6 +840,7 @@ var BackendCalendar = {
$('#address').val(c.address); $('#address').val(c.address);
$('#city').val(c.city); $('#city').val(c.city);
$('#zip-code').val(c.zip_code); $('#zip-code').val(c.zip_code);
$('#customer-code').val(c.notes);
return false; return false;
} }
}); });
@ -894,7 +898,7 @@ var BackendCalendar = {
*/ */
$('#new-customer').click(function() { $('#new-customer').click(function() {
$('#manage-appointment').find('#customer-id, #first-name, #last-name, #email, ' $('#manage-appointment').find('#customer-id, #first-name, #last-name, #email, '
+ '#phone-number, #address, #city, #zip-code').val(''); + '#phone-number, #address, #city, #zip-code, #customer-notes').val('');
}); });
}, },

View file

@ -171,7 +171,7 @@ var BackendSettings = {
var postUrl = GlobalVariables.baseUrl + 'backend_api/ajax_validate_username'; var postUrl = GlobalVariables.baseUrl + 'backend_api/ajax_validate_username';
var postData = { var postData = {
'username': $input.val(), 'username': $input.val(),
'record_exists': ($input.parents().eq(2).find('#user-id').val() != '') ? true : false 'user_id': $input.parents().eq(2).find('#user-id').val()
}; };
$.post(postUrl, postData, function(response) { $.post(postUrl, postData, function(response) {
@ -182,8 +182,10 @@ var BackendSettings = {
if (response == false) { if (response == false) {
$input.css('border', '2px solid red'); $input.css('border', '2px solid red');
Backend.displayNotification('Username already exists.'); Backend.displayNotification('Username already exists.');
$input.attr('already-exists', 'true');
} else { } else {
$input.css('border', ''); $input.css('border', '');
$input.attr('already-exists', 'false');
} }
}, 'json'); }, 'json');
}); });
@ -400,6 +402,11 @@ UserSettings.prototype.validate = function() {
throw 'Invalid email address!'; throw 'Invalid email address!';
} }
if ($('#username').attr('already-exists') === 'true') {
$('#username').css('border', '2px solid red');
throw 'Username already exists.';
}
return true; return true;
} catch(exc) { } catch(exc) {
Backend.displayNotification(exc); Backend.displayNotification(exc);