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

(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/doc-head-close.inc (-1 / +1 lines)
Lines 62-68 Link Here
62
62
63
<!-- yui js --> 
63
<!-- yui js --> 
64
<script type="text/javascript" src="<!-- TMPL_VAR NAME="yuipath" -->/utilities/utilities.js"></script> 
64
<script type="text/javascript" src="<!-- TMPL_VAR NAME="yuipath" -->/utilities/utilities.js"></script> 
65
<script type="text/javascript" src="<!-- TMPL_VAR NAME="yuipath" -->/datasource/datasource.js"></script> 
65
<script type="text/javascript" src="<!-- TMPL_VAR NAME="yuipath" -->/datasource/datasource-min.js"></script>
66
<!-- TMPL_IF NAME="CircAutocompl" -->
66
<!-- TMPL_IF NAME="CircAutocompl" -->
67
    <script type="text/javascript" src="<!-- TMPL_VAR NAME="yuipath" -->/autocomplete/autocomplete-min.js"></script>
67
    <script type="text/javascript" src="<!-- TMPL_VAR NAME="yuipath" -->/autocomplete/autocomplete-min.js"></script>
68
<!-- /TMPL_IF -->
68
<!-- /TMPL_IF -->
(-)a/koha-tmpl/intranet-tmpl/prog/en/js/pages/batchMod.js (+139 lines)
Line 0 Link Here
1
// Set expiration date for cookies
2
    var date = new Date();
3
    date.setTime(date.getTime()+(365*24*60*60*1000));
4
    var expiration = date.toGMTString();
5
6
7
function hideColumns(){
8
  valCookie = YAHOO.util.Cookie.get("showColumns", function(stringValue){
9
    return stringValue.split("/");
10
  });
11
  if(valCookie){
12
    $("#showall").attr("checked","").parent().removeClass("selected");
13
    for( i=0; i<valCookie.length; i++ ){
14
      if(valCookie[i] != ''){
15
        index = valCookie[i] - 2;
16
        $("#itemst td:nth-child("+valCookie[i]+"),#itemst th:nth-child("+valCookie[i]+")").toggle();
17
        $("#checkheader"+index).attr("checked","").parent().removeClass("selected");
18
      }
19
    }
20
  }
21
}
22
23
function hideColumn(num) {
24
  $("#hideall,#showall").attr("checked","").parent().removeClass("selected");
25
  valCookie = YAHOO.util.Cookie.get("showColumns", function(stringValue){
26
    return stringValue.split("/");
27
  });
28
  // set the index of the table column to hide
29
  $("#"+num).parent().removeClass("selected");
30
  var hide = Number(num.replace("checkheader","")) + 2;
31
  // hide header and cells matching the index
32
  $("#itemst td:nth-child("+hide+"),#itemst th:nth-child("+hide+")").toggle();
33
  // set or modify cookie with the hidden column's index
34
  if(valCookie){
35
    var found = false;
36
    for( $i=0; $i<valCookie.length; $i++ ){
37
        if (hide == valCookie[i]) {
38
            found = true;
39
            break;
40
        }
41
    }
42
    if( !found ){
43
        valCookie.push(hide);
44
        var cookieString = valCookie.join("/");
45
        YAHOO.util.Cookie.set("showColumns", cookieString, {
46
          expires: date
47
        });
48
    }
49
  } else {
50
        YAHOO.util.Cookie.set("showColumns", hide, {
51
          expires: date
52
        });
53
  }
54
}
55
56
// Array Remove - By John Resig (MIT Licensed)
57
// http://ejohn.org/blog/javascript-array-remove/
58
Array.prototype.remove = function(from, to) {
59
  var rest = this.slice((to || from) + 1 || this.length);
60
  this.length = from < 0 ? this.length + from : from;
61
  return this.push.apply(this, rest);
62
};
63
64
function showColumn(num){
65
  $("#hideall").attr("checked","").parent().removeClass("selected");
66
  $("#"+num).parent().addClass("selected");
67
  valCookie = YAHOO.util.Cookie.get("showColumns", function(stringValue){
68
    return stringValue.split("/");
69
  });
70
  // set the index of the table column to hide
71
  show = Number(num.replace("checkheader","")) + 2;
72
  // hide header and cells matching the index
73
  $("#itemst td:nth-child("+show+"),#itemst th:nth-child("+show+")").toggle();
74
  // set or modify cookie with the hidden column's index
75
  if(valCookie){
76
    var found = false;
77
    for( i=0; i<valCookie.length; i++ ){
78
        if (show == valCookie[i]) {
79
          valCookie.remove(i);
80
          found = true;
81
        }
82
    }
83
    if( found ){
84
        var cookieString = valCookie.join("/");
85
        YAHOO.util.Cookie.set("showColumns", cookieString, {
86
          expires: date
87
        });
88
    }
89
  }
90
}
91
function showAllColumns(){
92
    $("#selections").checkCheckboxes();
93
    $("#selections span").addClass("selected");
94
    $("#itemst td:nth-child(2),#itemst tr th:nth-child(2)").nextAll().show();
95
    YAHOO.util.Cookie.remove("showColumns");
96
    $("#hideall").attr("checked","").parent().removeClass("selected");
97
}
98
function hideAllColumns(){
99
    $("#selections").unCheckCheckboxes();
100
    $("#selections span").removeClass("selected");
101
    $("#itemst td:nth-child(2),#itemst th:nth-child(2)").nextAll().hide();
102
    $("#hideall").attr("checked","checked").parent().addClass("selected");
103
    var cookieString = allColumns.join("/");
104
    YAHOO.util.Cookie.set("showColumns", cookieString, {
105
      expires: date
106
    });
107
}
108
109
  $(document).ready(function() {
110
    hideColumns();
111
    $("#itemst").tablesorter({
112
      widgets : ['zebra'],
113
      headers: {0:{sorter: false}}
114
    });
115
    $("#selectallbutton").click(function(){
116
      $("#itemst").checkCheckboxes();
117
      return false;
118
    });
119
    $("#clearallbutton").click(function(){
120
      $("#itemst").unCheckCheckboxes();
121
      return false;
122
    });
123
    $("#selections input").change(function(e){
124
      var num = $(this).attr("id");
125
      if(num == 'showall'){
126
        showAllColumns();
127
        e.stopPropagation();
128
      } else if(num == 'hideall'){
129
        hideAllColumns();
130
        e.stopPropagation();
131
      } else {
132
        if($(this).attr("checked")){
133
          showColumn(num);
134
        } else {
135
          hideColumn(num);
136
        }
137
      }
138
    });
139
  });
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchMod-del.tmpl (-26 / +26 lines)
Lines 2-33 Link Here
2
<title>Koha &rsaquo; Tools &rsaquo; Batch item deletion</title>
2
<title>Koha &rsaquo; Tools &rsaquo; Batch item deletion</title>
3
<!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
3
<!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
4
<!-- TMPL_INCLUDE NAME="background-job.inc" -->
4
<!-- TMPL_INCLUDE NAME="background-job.inc" -->
5
<style type="text/css">
5
<link rel="stylesheet" type="text/css" href="<!-- TMPL_VAR name="themelang" -->/css/pages/batchMod.css" />
6
        #jobpanel,#jobstatus,#jobfailed { display : none; }
7
        #jobstatus { margin:.4em; }
8
        #jobprogress{ width:200px;height:10px;border:1px solid #666;background:url('/intranet-tmpl/prog/img/progress.png') -300px 0px no-repeat; }
9
</style>
10
<script type="text/javascript" src="<!-- TMPL_VAR name="themelang" -->/lib/jquery/plugins/jquery.tablesorter.min.js"></script>
6
<script type="text/javascript" src="<!-- TMPL_VAR name="themelang" -->/lib/jquery/plugins/jquery.tablesorter.min.js"></script>
11
<script type="text/JavaScript" language="JavaScript">
7
<script src="<!-- TMPL_VAR name="themelang" -->/lib/yui/cookie/cookie-min.js"></script>
8
<script type="text/javascript" src="<!-- TMPL_VAR name="themelang" -->/lib/jquery/plugins/jquery.checkboxes.min.js"></script>
9
<script type="text/javascript">
12
//<![CDATA[
10
//<![CDATA[
13
         $(document).ready(function() {
11
14
	    $("#itemst").tablesorter({
12
// Prepare array of all column headers, incrementing each index by
15
            widgets : ['zebra']
13
// two to accomodate control and title columns
16
    });
14
var allColumns = new Array(<!-- TMPL_LOOP NAME="item_header_loop" -->'<!-- TMPL_VAR NAME="__counter__" -->'<!-- TMPL_UNLESS NAME="__last__" -->,<!-- /TMPL_UNLESS --><!-- /TMPL_LOOP -->);
17
	    $("#selectallbutton").click(function() {
15
for( x=0; x<allColumns.length; x++ ){
18
		$("#itemst").find("input:checkbox").each(function() {
16
  allColumns[x] = Number(allColumns[x]) + 2;
19
		    $(this).attr("checked", true);
17
}
20
		});
21
	    });
22
	    $("#clearallbutton").click(function() {
23
		$("#itemst").find("input:checkbox").each(function() {
24
		    $(this).attr("checked", false);
25
		});
26
	    });
27
28
	 });
29
//]]>
18
//]]>
30
</script>
19
</script>
20
<script type="text/javascript" src="<!-- TMPL_VAR name="themelang" -->/js/pages/batchMod.js"></script>
21
<!--[if IE]>
22
<style type="text/css">#selections { display: none; }</style>
23
<![endif]-->
31
</head>
24
</head>
32
<body>
25
<body>
33
<!-- TMPL_INCLUDE NAME="header.inc" -->
26
<!-- TMPL_INCLUDE NAME="header.inc" -->
Lines 81-104 Link Here
81
<!-- TMPL_IF name="item_loop" -->
74
<!-- TMPL_IF name="item_loop" -->
82
	<!-- TMPL_IF NAME="show" --><div id="toolbar"><a id="selectallbutton" href="#">Select All</a> | <a id="clearallbutton" href="#">Clear All</a></div><!-- /TMPL_IF -->
75
	<!-- TMPL_IF NAME="show" --><div id="toolbar"><a id="selectallbutton" href="#">Select All</a> | <a id="clearallbutton" href="#">Clear All</a></div><!-- /TMPL_IF -->
83
	<div id="cataloguing_additem_itemlist">
76
	<div id="cataloguing_additem_itemlist">
84
		<div style="overflow:auto">
77
78
	<p id="selections"><strong>Show/hide columns:</strong> <span class="selected"><input type="checkbox" checked="checked" id="showall"/><label for="showall">Show all columns</label></span> <span><input type="checkbox" id="hideall"/><label for="hideall">Hide all columns</label></span>
79
		<!-- TMPL_LOOP NAME="item_header_loop" -->
80
		<span class="selected"><input id="checkheader<!-- TMPL_VAR NAME="__counter" -->" type="checkbox" checked="checked" /> <label for="checkheader<!-- TMPL_VAR NAME="__counter__" -->"><!-- TMPL_VAR NAME="header_value" --></label> </span>
81
		<!-- /TMPL_LOOP -->
82
	</p>
83
85
		<table id="itemst">
84
		<table id="itemst">
86
		    <thead>
85
		    <thead>
87
			<tr>
86
			<tr>
88
			    <!-- TMPL_IF NAME="show" --><th>&nbsp;</th><!-- /TMPL_IF -->
87
			    <!-- TMPL_IF NAME="show" --><th>&nbsp;</th><!-- /TMPL_IF -->
89
			    <!-- TMPL_LOOP NAME="item_header_loop" --> 
88
		        <th>Title</th>
89
			    <!-- TMPL_LOOP NAME="item_header_loop" -->
90
			    <th> <!-- TMPL_VAR NAME="header_value" --> </th>
90
			    <th> <!-- TMPL_VAR NAME="header_value" --> </th>
91
			    <!-- /TMPL_LOOP --> 
91
			    <!-- /TMPL_LOOP -->
92
			</tr>
92
			</tr>
93
		    </thead>
93
		    </thead>
94
		    <tbody>
94
		    <tbody>
95
		    <!-- TMPL_LOOP NAME="item_loop" --> <tr> <!-- TMPL_IF NAME="show" --><!-- TMPL_IF Name="nomod"--> <td class="error">Cannot Edit</td><!--TMPL_ELSE--><td><input type="checkbox" name="itemnumber" value="<!--TMPL_VAR Name="itemnumber"-->" id="row<!-- TMPL_VAR NAME="itemnumber" -->" checked="checked" /></td><!--/TMPL_IF--><!--/TMPL_IF-->
95
		    <!-- TMPL_LOOP NAME="item_loop" --> <tr> <!-- TMPL_IF NAME="show" --><!-- TMPL_IF Name="nomod"--> <td class="error">Cannot Edit</td><!--TMPL_ELSE--><td><input type="checkbox" name="itemnumber" value="<!--TMPL_VAR Name="itemnumber"-->" id="row<!-- TMPL_VAR NAME="itemnumber" -->" checked="checked" /></td><!--/TMPL_IF--><!--/TMPL_IF-->
96
		    <td><label for="row<!-- TMPL_VAR NAME="itemnumber" -->"><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->"><!-- TMPL_VAR NAME="title" --></a><!-- TMPL_IF NAME="author" -->, by <!-- TMPL_VAR NAME="author" --><!-- /TMPL_IF --></label></td>
96
			<!-- TMPL_LOOP NAME="item_value" --> <td><!-- TMPL_VAR ESCAPE="HTML" NAME="field" --></td> 
97
			<!-- TMPL_LOOP NAME="item_value" --> <td><!-- TMPL_VAR ESCAPE="HTML" NAME="field" --></td> 
97
					<!-- /TMPL_LOOP --> </tr>
98
					<!-- /TMPL_LOOP --> </tr>
98
		    <!-- /TMPL_LOOP -->
99
		    <!-- /TMPL_LOOP -->
99
		    </tbody>
100
		    </tbody>
100
		</table>
101
		</table>
101
		</div>
102
	</div>
102
	</div>
103
<!-- /TMPL_IF -->
103
<!-- /TMPL_IF -->
104
104
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchMod-edit.tmpl (-28 / +26 lines)
Lines 2-33 Link Here
2
<title>Koha &rsaquo; Tools &rsaquo; Batch item modification</title>
2
<title>Koha &rsaquo; Tools &rsaquo; Batch item modification</title>
3
<!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
3
<!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
4
<!-- TMPL_INCLUDE NAME="background-job.inc" -->
4
<!-- TMPL_INCLUDE NAME="background-job.inc" -->
5
<style type="text/css">
5
<link rel="stylesheet" type="text/css" href="<!-- TMPL_VAR name="themelang" -->/css/pages/batchMod.css" />
6
        #jobpanel,#jobstatus,#jobfailed { display : none; }
7
        #jobstatus { margin:.4em; }
8
        #jobprogress{ width:200px;height:10px;border:1px solid #666;background:url('/intranet-tmpl/prog/img/progress.png') -300px 0px no-repeat; }
9
</style>
10
<script type="text/javascript" src="<!-- TMPL_VAR name="themelang" -->/lib/jquery/plugins/jquery.tablesorter.min.js"></script>
6
<script type="text/javascript" src="<!-- TMPL_VAR name="themelang" -->/lib/jquery/plugins/jquery.tablesorter.min.js"></script>
11
<script type="text/JavaScript" language="JavaScript">
7
<script src="<!-- TMPL_VAR name="themelang" -->/lib/yui/cookie/cookie-min.js"></script>
8
<script type="text/javascript" src="<!-- TMPL_VAR name="themelang" -->/lib/jquery/plugins/jquery.checkboxes.min.js"></script>
9
<script type="text/javascript">
12
//<![CDATA[
10
//<![CDATA[
13
         $(document).ready(function() {
11
14
      $("#itemst").tablesorter({
12
// Prepare array of all column headers, incrementing each index by
15
            widgets : ['zebra'],
13
// two to accomodate control and title columns
16
        headers: {0:{sorter: false}}
14
var allColumns = new Array(<!-- TMPL_LOOP NAME="item_header_loop" -->'<!-- TMPL_VAR NAME="__counter__" -->'<!-- TMPL_UNLESS NAME="__last__" -->,<!-- /TMPL_UNLESS --><!-- /TMPL_LOOP -->);
17
    });
15
for( x=0; x<allColumns.length; x++ ){
18
      $("#selectallbutton").click(function() {
16
  allColumns[x] = Number(allColumns[x]) + 2;
19
    $("#itemst").find("input:checkbox").each(function() {
17
}
20
        $(this).attr("checked", true);
21
    });
22
      });
23
      $("#clearallbutton").click(function() {
24
    $("#itemst").find("input:checkbox").each(function() {
25
        $(this).attr("checked", false);
26
    });
27
      });
28
   });
29
//]]>
18
//]]>
30
</script>
19
</script>
20
<script type="text/javascript" src="<!-- TMPL_VAR name="themelang" -->/js/pages/batchMod.js"></script>
21
<!--[if IE]>
22
<style type="text/css">#selections { display: none; }</style>
23
<![endif]-->
24
<link type="text/css" rel="stylesheet" href="<!-- TMPL_VAR NAME="themelang" -->/css/addbiblio.css" />
31
</head>
25
</head>
32
<body>
26
<body>
33
<!-- TMPL_INCLUDE NAME="header.inc" -->
27
<!-- TMPL_INCLUDE NAME="header.inc" -->
Lines 74-99 Link Here
74
<!-- TMPL_IF name="item_loop" -->
68
<!-- TMPL_IF name="item_loop" -->
75
  <!-- TMPL_IF NAME="show" --><div id="toolbar"><a id="selectallbutton" href="#">Select All</a> | <a id="clearallbutton" href="#">Clear All</a></div><!-- TMPL_ELSE --><!-- /TMPL_IF -->
69
  <!-- TMPL_IF NAME="show" --><div id="toolbar"><a id="selectallbutton" href="#">Select All</a> | <a id="clearallbutton" href="#">Clear All</a></div><!-- TMPL_ELSE --><!-- /TMPL_IF -->
76
<div id="cataloguing_additem_itemlist">
70
<div id="cataloguing_additem_itemlist">
77
        <div style="overflow:auto">
71
72
<p id="selections"><strong>Show/hide columns:</strong> <span class="selected"><input type="checkbox" checked="checked" id="showall"/><label for="showall">Show all columns</label></span> <span><input type="checkbox" id="hideall"/><label for="hideall">Hide all columns</label></span> 
73
        <!-- TMPL_LOOP NAME="item_header_loop" -->
74
        <span class="selected"><input id="checkheader<!-- TMPL_VAR NAME="__counter" -->" type="checkbox" checked="checked" /> <label for="checkheader<!-- TMPL_VAR NAME="__counter__" -->"><!-- TMPL_VAR NAME="header_value" --></label> </span>
75
        <!-- /TMPL_LOOP -->
76
</p>
78
        <table id="itemst">
77
        <table id="itemst">
79
      <thead>
78
      <thead>
80
    <tr>
79
    <tr>
81
        <!-- TMPL_IF NAME="show" --><th>&nbsp;</th><!-- /TMPL_IF -->
80
        <th>&nbsp;</th>
82
        <th>Title</th>
81
        <th>Title</th>
83
        <!-- TMPL_LOOP NAME="item_header_loop" --> 
82
        <!-- TMPL_LOOP NAME="item_header_loop" -->
84
        <th> <!-- TMPL_VAR NAME="header_value" --> </th>
83
        <th> <!-- TMPL_VAR NAME="header_value" --> </th>
85
        <!-- /TMPL_LOOP --> 
84
        <!-- /TMPL_LOOP --> 
86
    </tr>
85
    </tr>
87
      </thead>
86
      </thead>
88
      <tbody>
87
      <tbody>
89
            <!-- TMPL_LOOP NAME="item_loop" --> <tr> <!-- TMPL_IF NAME="show" --><!-- TMPL_IF Name="nomod"--> <td class="error">Cannot Edit</td><!--TMPL_ELSE--><td><input type="checkbox" name="itemnumber" value="<!--TMPL_VAR Name="itemnumber"-->" id="row<!-- TMPL_VAR NAME="itemnumber" -->" checked="checked" /></td><!--/TMPL_IF--><!-- /TMPL_IF -->
88
            <!-- TMPL_LOOP NAME="item_loop" --> <tr> <!-- TMPL_IF NAME="show" --><!-- TMPL_IF Name="nomod"--> <td class="error">Cannot Edit</td><!--TMPL_ELSE--><td><input type="checkbox" name="itemnumber" value="<!--TMPL_VAR Name="itemnumber"-->" id="row<!-- TMPL_VAR NAME="itemnumber" -->" checked="checked" /></td><!--/TMPL_IF--><!--TMPL_ELSE--><td>&nbsp;</td><!-- /TMPL_IF -->
90
                <td><!-- TMPL_VAR ESCAPE="HTML" NAME="bibinfo" --></td>
89
                <td><label for="row<!-- TMPL_VAR NAME="itemnumber" -->"><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->"><!-- TMPL_VAR NAME="title" --></a><!-- TMPL_IF NAME="author" -->, by <!-- TMPL_VAR NAME="author" --><!-- /TMPL_IF --></label></td>
91
                <!-- TMPL_LOOP NAME="item_value" --> <td><!-- TMPL_VAR ESCAPE="HTML" NAME="field" --></td> 
90
                <!-- TMPL_LOOP NAME="item_value" --> <td><!-- TMPL_VAR ESCAPE="HTML" NAME="field" --></td> 
92
        <!-- /TMPL_LOOP --> </tr>
91
        <!-- /TMPL_LOOP --> </tr>
93
            <!-- /TMPL_LOOP -->
92
            <!-- /TMPL_LOOP -->
94
      </tbody>
93
      </tbody>
95
        </table>
94
        </table>
96
        </div>
97
</div>
95
</div>
98
<!-- /TMPL_IF --><!-- /item_loop -->
96
<!-- /TMPL_IF --><!-- /item_loop -->
99
97
(-)a/tools/batchMod.pl (-4 / +10 lines)
Lines 456-463 sub BuildItemsData{ Link Here
456
456
457
            # grab title, author, and ISBN to identify bib that the item
457
            # grab title, author, and ISBN to identify bib that the item
458
            # belongs to in the display
458
            # belongs to in the display
459
			my $biblio=GetBiblioData($$itemdata{biblionumber});
459
			 my $biblio=GetBiblioData($$itemdata{biblionumber});
460
            $this_row{bibinfo} = join("\n", @$biblio{qw(title author ISBN)});
460
            $this_row{title} = $biblio->{title};
461
            $this_row{author} = $biblio->{author};
462
            $this_row{isbn} = $biblio->{isbn};
463
            $this_row{biblionumber} = $biblio->{biblionumber};
461
464
462
			if (%this_row) {
465
			if (%this_row) {
463
				push(@big_array, \%this_row);
466
				push(@big_array, \%this_row);
Lines 476-482 sub BuildItemsData{ Link Here
476
			$row_data{itemnumber} = $row->{itemnumber};
479
			$row_data{itemnumber} = $row->{itemnumber};
477
			#reporting this_row values
480
			#reporting this_row values
478
			$row_data{'nomod'} = $row->{'nomod'};
481
			$row_data{'nomod'} = $row->{'nomod'};
479
            $row_data{bibinfo} = $row->{bibinfo};
482
      $row_data{bibinfo} = $row->{bibinfo};
483
      $row_data{author} = $row->{author};
484
      $row_data{title} = $row->{title};
485
      $row_data{isbn} = $row->{isbn};
486
      $row_data{biblionumber} = $row->{biblionumber};
480
			push(@item_value_loop,\%row_data);
487
			push(@item_value_loop,\%row_data);
481
		}
488
		}
482
		my @header_loop=map { { header_value=> $witness{$_}} } @witnesscodessorted;
489
		my @header_loop=map { { header_value=> $witness{$_}} } @witnesscodessorted;
483
- 

Return to bug 5285