1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-12 22:22:32 +01:00

Working on time tracker

This commit is contained in:
Hillel Coren 2017-09-25 16:46:02 +03:00
parent 6640978b3c
commit 63d4196cb8
2 changed files with 18 additions and 9 deletions

View File

@ -119,15 +119,13 @@
<div style="height:74px"></div>
<!--
<div data-bind="text: ko.toJSON(model.selectedTask().client_id)"></div>
<div data-bind="text: ko.toJSON(model.selectedTask().project_id)"></div>
<div data-bind="text: ko.toJSON(model.selectedTask().client)"></div>
<div data-bind="text: ko.toJSON(model.selectedTask().project)"></div>
Client: <span data-bind="text: ko.toJSON(model.selectedClient().public_id)"></span>
Project: <span data-bind="text: ko.toJSON(model.selectedProject().public_id)"></span>
<div data-bind="text: ko.toJSON(model.selectedTask().client_id)"></div>
<div data-bind="text: ko.toJSON(model.selectedTask().client)"></div>
<div data-bind="text: ko.toJSON(model.selectedTask().project_id)"></div>
<div data-bind="text: ko.toJSON(model.selectedTask().project)"></div>
-->
<div class="container" style="margin: 0 auto;width: 100%;">
@ -313,7 +311,6 @@
}
var $clientSelect = $('select#client_id');
//$clientSelect.combobox();
$clientSelect.on('change', function(e) {
var clientId = $('input[name=client_id]').val();
var projectId = $('input[name=project_id]').val();
@ -357,6 +354,18 @@
}
});
$projectSelect.on('change', function(e) {
var projectId = $('input[name=project_id]').val();
if (window.model && model.selectedTask() && projectId == -1) {
var project = new ProjectModel();
project.name($('#project_name').val());
model.selectedTask().project_id(-1);
model.selectedTask().project(project);
}
refreshProjectList();
});
Mousetrap.bind('/', function(e) {
event.preventDefault();
$('#search').focus();

View File

@ -698,7 +698,7 @@
function ProjectModel(data) {
var self = this;
self.name = ko.observable('');
self.public_id = ko.observable(0);
self.public_id = ko.observable(-1);
if (data) {
ko.mapping.fromJS(data, {}, this);
@ -707,8 +707,8 @@
function ClientModel(data) {
var self = this;
self.public_id = ko.observable(-1);
self.name = ko.observable('');
self.public_id = ko.observable(-1);
self.contacts = ko.observableArray();
self.mapping = {