View | Details | Raw Unified | Return to bug 9401
Collapse All | Expand All

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tags/review.tt (-12 / +2 lines)
Lines 73-88 td input,td input[type="submit"] { font-size: 85%; padding: 1px; } Link Here
73
		$('#test_button').removeAttr("disabled");
73
		$('#test_button').removeAttr("disabled");
74
		$('#test_button').attr("value","test");
74
		$('#test_button').attr("value","test");
75
	};
75
	};
76
	function readCookie(name) { // from http://www.quirksmode.org/js/cookies.html
77
		var nameEQ = name + "=";
78
		var ca = document.cookie.split(';');
79
			for(var i=0;i < ca.length;i++) {
80
				var c = ca[i];
81
				while (c.charAt(0)==' '){ c = c.substring(1,c.length); }
82
				if (c.indexOf(nameEQ) == 0){ return c.substring(nameEQ.length,c.length); }
83
			}
84
		return null;
85
	}
86
	$(document).ready(function() {
76
	$(document).ready(function() {
87
		$('.ajax_buttons' ).css({visibility:"visible"});
77
		$('.ajax_buttons' ).css({visibility:"visible"});
88
		$("p.check").html("<strong>"+_("Select:")+" <\/strong><a id=\"CheckAll\" href=\"/cgi-bin/koha/tags/review.pl\">"+_("All")+"<\/a> <a id=\"CheckPending\" href=\"/cgi-bin/koha/tags/review.pl\">"+_("Pending")+"<\/a> <a id=\"CheckNone\" href=\"/cgi-bin/koha/tags/review.pl\">"+_("None")+"<\/a>");
78
		$("p.check").html("<strong>"+_("Select:")+" <\/strong><a id=\"CheckAll\" href=\"/cgi-bin/koha/tags/review.pl\">"+_("All")+"<\/a> <a id=\"CheckPending\" href=\"/cgi-bin/koha/tags/review.pl\">"+_("Pending")+"<\/a> <a id=\"CheckNone\" href=\"/cgi-bin/koha/tags/review.pl\">"+_("None")+"<\/a>");
Lines 103-109 td input,td input[type="submit"] { font-size: 85%; padding: 1px; } Link Here
103
			// window.alert(_("Click detected on ") + event.target + ": " + $(event.target).html);
93
			// window.alert(_("Click detected on ") + event.target + ": " + $(event.target).html);
104
			if ($(event.target).is('.ok')) {
94
			if ($(event.target).is('.ok')) {
105
				$.ajax({
95
				$.ajax({
106
					"data": {ok: $(event.target).attr("title"), CGISESSID: readCookie('CGISESSID')},
96
					"data": {ok: $(event.target).attr("title")},
107
					"success": count_approve // success_approve
97
					"success": count_approve // success_approve
108
				});
98
				});
109
				$(event.target).next(".rej").removeAttr("disabled").attr("value","Reject").css("color","#000");
99
				$(event.target).next(".rej").removeAttr("disabled").attr("value","Reject").css("color","#000");
Lines 112-118 td input,td input[type="submit"] { font-size: 85%; padding: 1px; } Link Here
112
			}
102
			}
113
			if ($(event.target).is('.rej')) {
103
			if ($(event.target).is('.rej')) {
114
				$.ajax({
104
				$.ajax({
115
					"data": {rej: $(event.target).attr("title"), CGISESSID: readCookie('CGISESSID')},
105
					"data": {rej: $(event.target).attr("title")},
116
					"success": count_reject // success_reject
106
					"success": count_reject // success_reject
117
				});
107
				});
118
				$(event.target).prev(".ok").removeAttr("disabled").attr("value","Approve").css("color","#000");
108
				$(event.target).prev(".ok").removeAttr("disabled").attr("value","Approve").css("color","#000");
(-)a/koha-tmpl/opac-tmpl/ccsr/en/js/tags.js (-17 / +3 lines)
Lines 4-11 if (typeof KOHA == "undefined" || !KOHA) { Link Here
4
4
5
/**
5
/**
6
* A namespace for Tags related functions.
6
* A namespace for Tags related functions.
7
* readCookie is expected to already be declared.  That's why the assignment below is unscoped.
8
* readCookie should be from basket.js or undefined.
9
7
10
$.ajaxSetup({
8
$.ajaxSetup({
11
       url: "/cgi-bin/koha/opac-tags.pl",
9
       url: "/cgi-bin/koha/opac-tags.pl",
Lines 13-36 $.ajaxSetup({ Link Here
13
  dataType: "script"
11
  dataType: "script"
14
});
12
});
15
*/
13
*/
16
if (typeof(readCookie) == "undefined") {
17
     readCookie = function (name) { // from http://www.quirksmode.org/js/cookies.html
18
               var nameEQ = name + "=";
19
               var ca = document.cookie.split(';');
20
           for (var i=0;i < ca.length;i++) {
21
                      var c = ca[i];
22
                 while (c.charAt(0)==' '){ c = c.substring(1,c.length); }
23
                       if (c.indexOf(nameEQ) == 0){ return c.substring(nameEQ.length,c.length); }
24
             }
25
              return null;
26
   }
27
}
28
KOHA.Tags = {
14
KOHA.Tags = {
29
      add_tag_button: function(bibnum, tag){
15
      add_tag_button: function(bibnum, tag){
30
          var mynewtag = "newtag" + bibnum;
16
          var mynewtag = "newtag" + bibnum;
31
            var mytagid = "#" + mynewtag;
17
            var mytagid = "#" + mynewtag;
32
          var mydata = {CGISESSID: readCookie('CGISESSID')};	// Someday this should be OPACSESSID
18
          var mydata = {};
33
                mydata[mynewtag] = tag;	// need [bracket] for variable property id
19
                mydata[mynewtag] = tag;
34
                var response;	// AJAX from server will assign value to response.
20
                var response;	// AJAX from server will assign value to response.
35
               $.post(
21
               $.post(
36
                        "/cgi-bin/koha/opac-tags.pl",
22
                        "/cgi-bin/koha/opac-tags.pl",
Lines 83-89 KOHA.Tags = { Link Here
83
    // Used to tag multiple items at once.  The main difference
69
    // Used to tag multiple items at once.  The main difference
84
    // is that status is displayed on a per item basis.
70
    // is that status is displayed on a per item basis.
85
    add_multitags_button : function(bibarray, tag){
71
    add_multitags_button : function(bibarray, tag){
86
                var mydata = {CGISESSID: readCookie('CGISESSID')};	// Someday this should be OPACSESSID
72
                var mydata = {};
87
        for (var i = 0; i < bibarray.length; i++) {
73
        for (var i = 0; i < bibarray.length; i++) {
88
            var mynewtag = "newtag" + bibarray[i];
74
            var mynewtag = "newtag" + bibarray[i];
89
            mydata[mynewtag] = tag;
75
            mydata[mynewtag] = tag;
(-)a/koha-tmpl/opac-tmpl/prog/en/js/tags.js (-17 / +3 lines)
Lines 4-11 if (typeof KOHA == "undefined" || !KOHA) { Link Here
4
4
5
/**
5
/**
6
* A namespace for Tags related functions.
6
* A namespace for Tags related functions.
7
* readCookie is expected to already be declared.  That's why the assignment below is unscoped.
8
* readCookie should be from basket.js or undefined.
9
7
10
$.ajaxSetup({
8
$.ajaxSetup({
11
	url: "/cgi-bin/koha/opac-tags.pl",
9
	url: "/cgi-bin/koha/opac-tags.pl",
Lines 13-36 $.ajaxSetup({ Link Here
13
	dataType: "script"
11
	dataType: "script"
14
});
12
});
15
*/
13
*/
16
if (typeof(readCookie) == "undefined") {
17
	readCookie = function (name) { // from http://www.quirksmode.org/js/cookies.html
18
		var nameEQ = name + "=";
19
		var ca = document.cookie.split(';');
20
		for (var i=0;i < ca.length;i++) {
21
			var c = ca[i];
22
			while (c.charAt(0)==' '){ c = c.substring(1,c.length); }
23
			if (c.indexOf(nameEQ) == 0){ return c.substring(nameEQ.length,c.length); }
24
		}
25
		return null;
26
	}
27
}
28
KOHA.Tags = {
14
KOHA.Tags = {
29
    add_tag_button: function(bibnum, tag){
15
    add_tag_button: function(bibnum, tag){
30
        var mynewtag = "newtag" + bibnum;
16
        var mynewtag = "newtag" + bibnum;
31
		var mytagid = "#" + mynewtag;
17
		var mytagid = "#" + mynewtag;
32
		var mydata = {CGISESSID: readCookie('CGISESSID')};	// Someday this should be OPACSESSID
18
		var mydata = {};
33
        mydata[mynewtag] = tag;	// need [bracket] for variable property id
19
		mydata[mynewtag] = tag; 
34
		var response;	// AJAX from server will assign value to response.
20
		var response;	// AJAX from server will assign value to response.
35
		$.post(
21
		$.post(
36
			"/cgi-bin/koha/opac-tags.pl",
22
			"/cgi-bin/koha/opac-tags.pl",
Lines 83-89 KOHA.Tags = { Link Here
83
    // Used to tag multiple items at once.  The main difference
69
    // Used to tag multiple items at once.  The main difference
84
    // is that status is displayed on a per item basis.
70
    // is that status is displayed on a per item basis.
85
    add_multitags_button : function(bibarray, tag){
71
    add_multitags_button : function(bibarray, tag){
86
		var mydata = {CGISESSID: readCookie('CGISESSID')};	// Someday this should be OPACSESSID
72
		var mydata = {};
87
        for (var i = 0; i < bibarray.length; i++) {
73
        for (var i = 0; i < bibarray.length; i++) {
88
            var mynewtag = "newtag" + bibarray[i];
74
            var mynewtag = "newtag" + bibarray[i];
89
            mydata[mynewtag] = tag;
75
            mydata[mynewtag] = tag;
(-)a/opac/opac-tags.pl (-1 / +1 lines)
Lines 58-64 sub ajax_auth_cgi { # returns CGI object Link Here
58
	my $needed_flags = shift;
58
	my $needed_flags = shift;
59
	my %cookies = fetch CGI::Cookie;
59
	my %cookies = fetch CGI::Cookie;
60
	my $input = CGI->new;
60
	my $input = CGI->new;
61
	my $sessid = $cookies{'CGISESSID'}->value || $input->param('CGISESSID');
61
	my $sessid = $cookies{'CGISESSID'}->value;
62
	my ($auth_status, $auth_sessid) = check_cookie_auth($sessid, $needed_flags);
62
	my ($auth_status, $auth_sessid) = check_cookie_auth($sessid, $needed_flags);
63
	$debug and
63
	$debug and
64
	print STDERR "($auth_status, $auth_sessid) = check_cookie_auth($sessid," . Dumper($needed_flags) . ")\n";
64
	print STDERR "($auth_status, $auth_sessid) = check_cookie_auth($sessid," . Dumper($needed_flags) . ")\n";
(-)a/tags/review.pl (-2 / +1 lines)
Lines 41-47 sub ajax_auth_cgi ($) { # returns CGI object Link Here
41
	my $needed_flags = shift;
41
	my $needed_flags = shift;
42
	my %cookies = fetch CGI::Cookie;
42
	my %cookies = fetch CGI::Cookie;
43
	my $input = CGI->new;
43
	my $input = CGI->new;
44
	my $sessid = $cookies{'CGISESSID'}->value || $input->param('CGISESSID');
44
	my $sessid = $cookies{'CGISESSID'}->value;
45
	my ($auth_status, $auth_sessid) = check_cookie_auth($sessid, $needed_flags);
45
	my ($auth_status, $auth_sessid) = check_cookie_auth($sessid, $needed_flags);
46
	$debug and
46
	$debug and
47
	print STDERR "($auth_status, $auth_sessid) = check_cookie_auth($sessid," . Dumper($needed_flags) . ")\n";
47
	print STDERR "($auth_status, $auth_sessid) = check_cookie_auth($sessid," . Dumper($needed_flags) . ")\n";
48
- 

Return to bug 9401