mirror of
https://github.com/alextselegidis/easyappointments.git
synced 2024-11-22 07:52:29 +03:00
* Commit final corrections before version 0.7
This commit is contained in:
parent
75a6efb79c
commit
57a3e433eb
3 changed files with 26 additions and 8 deletions
|
@ -187,6 +187,13 @@
|
|||
<input type="text" id="end-datetime" />
|
||||
</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 class="row-fluid">
|
||||
|
@ -257,7 +264,7 @@
|
|||
<div class="control-group">
|
||||
<label for="notes" class="control-label">Notes</label>
|
||||
<div class="controls">
|
||||
<textarea id="notes"></textarea>
|
||||
<textarea id="customer-notes" rows="3"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -165,7 +165,8 @@ var BackendCalendar = {
|
|||
$dialog.find('#address').val(customer['address']);
|
||||
$dialog.find('#city').val(customer['city']);
|
||||
$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');
|
||||
}
|
||||
|
@ -344,7 +345,8 @@ var BackendCalendar = {
|
|||
$dialog.find('#address').val(customer['address']);
|
||||
$dialog.find('#city').val(customer['city']);
|
||||
$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 {
|
||||
var unavailable = BackendCalendar.lastFocusedEventData.data;
|
||||
|
||||
|
@ -491,7 +493,7 @@ var BackendCalendar = {
|
|||
'id_users_provider': $dialog.find('#select-provider').val(),
|
||||
'start_datetime': startDatetime,
|
||||
'end_datetime': endDatetime,
|
||||
'notes': $dialog.find('#notes').val(),
|
||||
'notes': $dialog.find('#appointment-notes').val(),
|
||||
'is_unavailable': false
|
||||
};
|
||||
|
||||
|
@ -507,7 +509,8 @@ var BackendCalendar = {
|
|||
'phone_number': $dialog.find('#phone-number').val(),
|
||||
'address': $dialog.find('#address').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() !== '') {
|
||||
|
@ -837,6 +840,7 @@ var BackendCalendar = {
|
|||
$('#address').val(c.address);
|
||||
$('#city').val(c.city);
|
||||
$('#zip-code').val(c.zip_code);
|
||||
$('#customer-code').val(c.notes);
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
@ -894,7 +898,7 @@ var BackendCalendar = {
|
|||
*/
|
||||
$('#new-customer').click(function() {
|
||||
$('#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('');
|
||||
});
|
||||
},
|
||||
|
||||
|
|
|
@ -171,7 +171,7 @@ var BackendSettings = {
|
|||
var postUrl = GlobalVariables.baseUrl + 'backend_api/ajax_validate_username';
|
||||
var postData = {
|
||||
'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) {
|
||||
|
@ -182,8 +182,10 @@ var BackendSettings = {
|
|||
if (response == false) {
|
||||
$input.css('border', '2px solid red');
|
||||
Backend.displayNotification('Username already exists.');
|
||||
$input.attr('already-exists', 'true');
|
||||
} else {
|
||||
$input.css('border', '');
|
||||
$input.attr('already-exists', 'false');
|
||||
}
|
||||
}, 'json');
|
||||
});
|
||||
|
@ -400,6 +402,11 @@ UserSettings.prototype.validate = function() {
|
|||
throw 'Invalid email address!';
|
||||
}
|
||||
|
||||
if ($('#username').attr('already-exists') === 'true') {
|
||||
$('#username').css('border', '2px solid red');
|
||||
throw 'Username already exists.';
|
||||
}
|
||||
|
||||
return true;
|
||||
} catch(exc) {
|
||||
Backend.displayNotification(exc);
|
||||
|
|
Loading…
Reference in a new issue