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

(-)a/C4/VirtualShelves/Page.pm (-1 / +2 lines)
Lines 258-264 sub shelfpage ($$$$$) { Link Here
258
        }
258
        }
259
        if ( $query->param('shelves') ) {
259
        if ( $query->param('shelves') ) {
260
            my $stay = 1;
260
            my $stay = 1;
261
            if ( my $newshelf = $query->param('addshelf') ) {
261
			my $newshelf = $query->param('addshelf');
262
            if ($newshelf =~ /^\S.*\S$/ || $newshelf =~ /^\S$/) {
262
263
263
                # note: a user can always add a new shelf
264
                # note: a user can always add a new shelf
264
                my $shelfnumber = AddShelf( $newshelf, $query->param('owner'), $query->param('category'), $query->param('sortfield') );
265
                my $shelfnumber = AddShelf( $newshelf, $query->param('owner'), $query->param('category'), $query->param('sortfield') );
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt (-4 / +5 lines)
Lines 94-105 function placeHold () { Link Here
94
      function Check(f) {
94
      function Check(f) {
95
		var _alertString="";
95
		var _alertString="";
96
		var alertString2;
96
		var alertString2;
97
		var addshelf = $("#addshelf").val();
97
		
98
		
98
	    if($("#addshelf").val() == "0"){
99
	    if ( !(/^\S.*\S$/.test(addshelf)) && !( /^\S$/.test(addshelf)) ) {
99
		alert("The number 0 is not a valid name for a list, please enter another name.");
100
			_alertString += _("The List Name is not valid.");
100
	    }
101
	    }
101
102
102
	    if($("#addshelf").val() == ""){
103
	    if (addshelf == ""){
103
			_alertString += _("- You must enter a List Name") + "\n";
104
			_alertString += _("- You must enter a List Name") + "\n";
104
		}
105
		}
105
106
Lines 133-139 function placeHold () { Link Here
133
[% FOREACH paramsloo IN paramsloop %]
134
[% FOREACH paramsloo IN paramsloop %]
134
<div class="yui-ge">
135
<div class="yui-ge">
135
    <div class="yui-u first">
136
    <div class="yui-u first">
136
        [% IF ( paramsloo.already ) %]<div class="dialog alert">A List named [% paramsloo.already %] already exists!</div>[% END %]
137
        [% IF ( paramsloo.already || paramsloo.already == 0 ) %]<div class="dialog alert">A List named [% paramsloo.already %] already exists!</div>[% END %]
137
		[% IF ( paramsloo.status ) %]<div class="dialog alert">[% paramsloo.string %]</div>[% END %]
138
		[% IF ( paramsloo.status ) %]<div class="dialog alert">[% paramsloo.string %]</div>[% END %]
138
		[% IF ( paramsloo.nobarcode ) %]<div class="dialog alert">ERROR: No barcode given.</div>[% END %] 
139
		[% IF ( paramsloo.nobarcode ) %]<div class="dialog alert">ERROR: No barcode given.</div>[% END %] 
139
		[% IF ( paramsloo.noshelfnumber ) %]<div class="dialog alert">ERROR: No shelfnumber given.</div>[% END %] 
140
		[% IF ( paramsloo.noshelfnumber ) %]<div class="dialog alert">ERROR: No shelfnumber given.</div>[% END %] 
(-)a/koha-tmpl/opac-tmpl/prog/en/modules/opac-shelves.tt (-6 / +8 lines)
Lines 117-129 $(function() { Link Here
117
      function Check(f) {
117
      function Check(f) {
118
		var _alertString="";
118
		var _alertString="";
119
		var alertString2;
119
		var alertString2;
120
		var addshelf = f.addshelf.value;
121
		
122
	    if ( !(/^\S.*\S$/.test(addshelf)) && !( /^\S$/.test(addshelf)) ) {
123
			_alertString += _("The List Name is not valid.");
124
	    }
120
125
121
	    if(f.addshelf.value.length ==0){
126
	    if(addshelf.length ==0){
122
			_alertString += _("- You must enter a List Name") + "\n";
127
			_alertString += _("- You must enter a List Name") + "\n";
123
		}
128
		}
124
	    else if(f.addshelf.value == "0"){
129
125
		alert("The number '0' is not a valid name for a list, please enter another name.");
126
	    }
127
		if (_alertString.length==0) {
130
		if (_alertString.length==0) {
128
			f.submit();
131
			f.submit();
129
		} else {
132
		} else {
Lines 148-154 $(function() { Link Here
148
              [% FOREACH paramsloo IN paramsloop %]
151
              [% FOREACH paramsloo IN paramsloop %]
149
                <div class="yui-ge">
152
                <div class="yui-ge">
150
                  <div class="yui-u first">
153
                  <div class="yui-u first">
151
                    [% IF ( paramsloo.already ) %]<div class="dialog alert">A List named <b>[% paramsloo.already %]</b> already exists!</div>[% END %]
154
                    [% IF ( paramsloo.already || paramsloo.already == 0 ) %]<div class="dialog alert">A List named <b>[% paramsloo.already %]</b> already exists!</div>[% END %]
152
                    [% IF ( paramsloo.status ) %]<div class="dialog alert">[% paramsloo.string %]</div>[% END %]
155
                    [% IF ( paramsloo.status ) %]<div class="dialog alert">[% paramsloo.string %]</div>[% END %]
153
                    [% IF ( paramsloo.nobarcode ) %]<div class="dialog alert">ERROR: No barcode given.</div>[% END %]
156
                    [% IF ( paramsloo.nobarcode ) %]<div class="dialog alert">ERROR: No barcode given.</div>[% END %]
154
                    [% IF ( paramsloo.noshelfnumber ) %]<div class="dialog alert">ERROR: No shelfnumber given.</div>[% END %]
157
                    [% IF ( paramsloo.noshelfnumber ) %]<div class="dialog alert">ERROR: No shelfnumber given.</div>[% END %]
155
- 

Return to bug 4158