Lines 3-22
Link Here
|
3 |
function mana_increment(mana_id, resource, fieldvalue, stepvalue ) { |
3 |
function mana_increment(mana_id, resource, fieldvalue, stepvalue ) { |
4 |
$("#mana_comment_progress").show(); |
4 |
$("#mana_comment_progress").show(); |
5 |
if( !stepvalue ){ stepvalue = 1; } |
5 |
if( !stepvalue ){ stepvalue = 1; } |
6 |
$.ajax({ |
6 |
$.ajax({ |
7 |
type: "POST", |
7 |
type: "POST", |
8 |
url: "/cgi-bin/koha/svc/mana/increment", |
8 |
url: "/cgi-bin/koha/svc/mana/increment", |
9 |
data: {id: mana_id, resource: resource, field: fieldvalue, step: stepvalue}, |
9 |
data: {id: mana_id, resource: resource, field: fieldvalue, step: stepvalue}, |
10 |
datatype: "json", |
10 |
dataType: "json", |
11 |
}) |
|
|
12 |
.done(function() { |
13 |
$(".mana_comment_status").hide(); |
14 |
$("#mana_comment_success").show(); |
15 |
}) |
11 |
}) |
16 |
.fail(function( error ) { |
12 |
.done(function( data ) { |
17 |
$(".mana_comment_status").hide(); |
13 |
$(".mana_comment_status").hide(); |
18 |
$("#mana_comment_errortext").html( error.status + " " + error.statusText ); |
14 |
if ( data.code == "200" ) { |
19 |
$("#mana_comment_failed").show(); |
15 |
$("#mana_comment_success").show(); |
|
|
16 |
} else { |
17 |
$("#mana_comment_failed").show(); |
18 |
} |
20 |
}) |
19 |
}) |
21 |
.always(function() { |
20 |
.always(function() { |
22 |
mana_comment_close(); |
21 |
mana_comment_close(); |