Removed project_url from parameters in favour of ProjectUtils

This commit is contained in:
2016-10-04 14:37:39 +02:00
parent fe70ee1ce1
commit dcf503c66a

View File

@@ -119,8 +119,10 @@ function shot_create(project_url)
/** /**
* Adds the task item to the shots/tasks list * Adds the task item to the shots/tasks list
*/ */
function task_add(shot_id, task_id, project_url, task_type){ function task_add(shot_id, task_id, task_type)
{
var project_url = ProjectUtils.projectUrl();
var url = '/attract/' + project_url + '/tasks/' + task_id; var url = '/attract/' + project_url + '/tasks/' + task_id;
if (ProjectUtils.context() == 'task'){ if (ProjectUtils.context() == 'task'){
@@ -154,12 +156,13 @@ function task_add(shot_id, task_id, project_url, task_type){
/** /**
* Create a task and show it in the #item-details div. * Create a task and show it in the #item-details div.
*/ */
function task_create(shot_id, project_url, task_type) function task_create(shot_id, task_type)
{ {
if (project_url === undefined || task_type === undefined) { if (shot_id === undefined || task_type === undefined) {
throw new ReferenceError("task_create(" + project_url+ ", " + task_type + ") called."); throw new ReferenceError("task_create(" + shot_id + ", " + task_type + ") called.");
} }
var project_url = ProjectUtils.projectUrl();
var url = '/attract/' + project_url + '/tasks/create'; var url = '/attract/' + project_url + '/tasks/create';
data = { data = {
@@ -168,8 +171,8 @@ function task_create(shot_id, project_url, task_type)
}; };
$.post(url, data, function(task_data) { $.post(url, data, function(task_data) {
task_open(task_data.task_id, project_url); task_open(task_data.task_id);
task_add(shot_id, task_data.task_id, project_url, task_type); task_add(shot_id, task_data.task_id, task_type);
}) })
.fail(function(xhr) { .fail(function(xhr) {
if (console) { if (console) {