mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-07 13:04:30 -04:00
Working on time tracker
This commit is contained in:
parent
63d4196cb8
commit
b0dabde7cd
@ -13,6 +13,7 @@ class TaskRequest extends EntityRequest
|
|||||||
{
|
{
|
||||||
$input = $this->all();
|
$input = $this->all();
|
||||||
|
|
||||||
|
/*
|
||||||
// check if we're creating a new client
|
// check if we're creating a new client
|
||||||
if ($this->client_id == '-1') {
|
if ($this->client_id == '-1') {
|
||||||
$client = [
|
$client = [
|
||||||
@ -23,6 +24,7 @@ class TaskRequest extends EntityRequest
|
|||||||
$input['client_id'] = $this->client_id = $client->public_id;
|
$input['client_id'] = $this->client_id = $client->public_id;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
// check if we're creating a new project
|
// check if we're creating a new project
|
||||||
if ($this->project_id == '-1') {
|
if ($this->project_id == '-1') {
|
||||||
|
@ -246,7 +246,7 @@
|
|||||||
$clientSelect.append(new Option('', ''));
|
$clientSelect.append(new Option('', ''));
|
||||||
|
|
||||||
@if (Auth::user()->can('create', ENTITY_CLIENT))
|
@if (Auth::user()->can('create', ENTITY_CLIENT))
|
||||||
$clientSelect.append(new Option("{{ trans('texts.create_client')}}: $name", '-1'));
|
//$clientSelect.append(new Option("{{ trans('texts.create_client')}}: $name", '-1'));
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
for (var i=0; i<clients.length; i++) {
|
for (var i=0; i<clients.length; i++) {
|
||||||
@ -320,7 +320,11 @@
|
|||||||
e.preventDefault();return;
|
e.preventDefault();return;
|
||||||
}
|
}
|
||||||
if (window.model && model.selectedTask()) {
|
if (window.model && model.selectedTask()) {
|
||||||
model.selectedTask().client(new ClientModel(client));
|
var clientModel = new ClientModel(client);
|
||||||
|
if (clientId == -1) {
|
||||||
|
clientModel.name($('#client_name').val());
|
||||||
|
}
|
||||||
|
model.selectedTask().client(clientModel);
|
||||||
model.selectedTask().client_id(clientId);
|
model.selectedTask().client_id(clientId);
|
||||||
model.selectedTask().project_id(0);
|
model.selectedTask().project_id(0);
|
||||||
model.selectedTask().project(false);
|
model.selectedTask().project(false);
|
||||||
@ -371,7 +375,6 @@
|
|||||||
$('#search').focus();
|
$('#search').focus();
|
||||||
});
|
});
|
||||||
|
|
||||||
@include('partials/entity_combobox', ['entityType' => ENTITY_CLIENT])
|
|
||||||
@include('partials/entity_combobox', ['entityType' => ENTITY_PROJECT])
|
@include('partials/entity_combobox', ['entityType' => ENTITY_PROJECT])
|
||||||
|
|
||||||
refreshClientList();
|
refreshClientList();
|
||||||
|
@ -394,11 +394,13 @@
|
|||||||
if (project.public_id() != self.project_id()) {
|
if (project.public_id() != self.project_id()) {
|
||||||
return "Project id's don't match " + project.public_id() + " " + self.project_id();
|
return "Project id's don't match " + project.public_id() + " " + self.project_id();
|
||||||
}
|
}
|
||||||
|
if (project.public_id() != -1) {
|
||||||
var client = projectMap[project.public_id()].client;
|
var client = projectMap[project.public_id()].client;
|
||||||
if (client.public_id != self.client_id()) {
|
if (client.public_id != self.client_id()) {
|
||||||
return "Client and project id's don't match " + client.public_id + " " + self.client_id();
|
return "Client and project id's don't match " + client.public_id + " " + self.client_id();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user