Removed project_url from parameters in favour of ProjectUtils
This commit is contained in:
@@ -119,8 +119,10 @@ function shot_create(project_url)
|
||||
/**
|
||||
* 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;
|
||||
|
||||
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.
|
||||
*/
|
||||
function task_create(shot_id, project_url, task_type)
|
||||
function task_create(shot_id, task_type)
|
||||
{
|
||||
if (project_url === undefined || task_type === undefined) {
|
||||
throw new ReferenceError("task_create(" + project_url+ ", " + task_type + ") called.");
|
||||
if (shot_id === undefined || task_type === undefined) {
|
||||
throw new ReferenceError("task_create(" + shot_id + ", " + task_type + ") called.");
|
||||
}
|
||||
|
||||
var project_url = ProjectUtils.projectUrl();
|
||||
var url = '/attract/' + project_url + '/tasks/create';
|
||||
|
||||
data = {
|
||||
@@ -168,8 +171,8 @@ function task_create(shot_id, project_url, task_type)
|
||||
};
|
||||
|
||||
$.post(url, data, function(task_data) {
|
||||
task_open(task_data.task_id, project_url);
|
||||
task_add(shot_id, task_data.task_id, project_url, task_type);
|
||||
task_open(task_data.task_id);
|
||||
task_add(shot_id, task_data.task_id, task_type);
|
||||
})
|
||||
.fail(function(xhr) {
|
||||
if (console) {
|
||||
|
Reference in New Issue
Block a user