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

(-)a/cataloguing/addbiblio.pl (-7 / +34 lines)
Lines 835-841 my $frameworkcode = $input->param('frameworkcode'); Link Here
835
my $redirect      = $input->param('redirect');
835
my $redirect      = $input->param('redirect');
836
my $dbh           = C4::Context->dbh;
836
my $dbh           = C4::Context->dbh;
837
837
838
my $userflags = ($frameworkcode eq 'FA') ? "fast_cataloging" : "edit_catalogue";
838
    
839
my $userflags = 'edit_catalogue';
840
if ($frameworkcode eq 'FA'){
841
    $userflags = 'fast_cataloging';
842
}
839
843
840
$frameworkcode = &GetFrameworkCode($biblionumber)
844
$frameworkcode = &GetFrameworkCode($biblionumber)
841
  if ( $biblionumber and not($frameworkcode) and $op ne 'addbiblio' );
845
  if ( $biblionumber and not($frameworkcode) and $op ne 'addbiblio' );
Lines 843-849 $frameworkcode = &GetFrameworkCode($biblionumber) Link Here
843
$frameworkcode = '' if ( $frameworkcode eq 'Default' );
847
$frameworkcode = '' if ( $frameworkcode eq 'Default' );
844
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
848
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
845
    {
849
    {
846
        template_name   => "cataloguing/addbiblio.tmpl",
850
        template_name   => "cataloguing/addbiblio.tt",
847
        query           => $input,
851
        query           => $input,
848
        type            => "intranet",
852
        type            => "intranet",
849
        authnotrequired => 0,
853
        authnotrequired => 0,
Lines 851-856 my ( $template, $loggedinuser, $cookie ) = get_template_and_user( Link Here
851
    }
855
    }
852
);
856
);
853
857
858
if ($frameworkcode eq 'FA'){
859
    # We need to grab and set some variables in the template for use on the additems screen
860
    $template->{VARS}->{'circborrowernumber'} = $input->param('borrowernumber');
861
    $template->{VARS}->{'barcode'} = $input->param('barcode');
862
    $template->{VARS}->{'branch'} = $input->param('branch');
863
    $template->{VARS}->{'stickyduedate'} = $input->param('stickyduedate');
864
    $template->{VARS}->{'duedatespec'} = $input->param('duedatespec');
865
}
866
854
# Getting the list of all frameworks
867
# Getting the list of all frameworks
855
# get framework list
868
# get framework list
856
my $frameworks = getframeworks;
869
my $frameworks = getframeworks;
Lines 940-951 if ( $op eq "addbiblio" ) { Link Here
940
            ( $biblionumber, $oldbibitemnum ) = AddBiblio( $record, $frameworkcode );
953
            ( $biblionumber, $oldbibitemnum ) = AddBiblio( $record, $frameworkcode );
941
        }
954
        }
942
        if ($redirect eq "items" || ($mode ne "popup" && !$is_a_modif && $redirect ne "view")){
955
        if ($redirect eq "items" || ($mode ne "popup" && !$is_a_modif && $redirect ne "view")){
943
            print $input->redirect(
956
	    if ($frameworkcode eq 'FA'){
957
		my $borrowernumber = $input->param('circborrowernumber');
958
		my $barcode = $input->param('barcode');
959
		my $branch = $input->param('branch');
960
		my $stickyduedate = $input->param('stickyduedate');
961
		my $duedatespec = $input->param('duedatespec');
962
		print $input->redirect(
963
                "/cgi-bin/koha/cataloguing/additem.pl?biblionumber=$biblionumber&frameworkcode=$frameworkcode&borrowernumber=$borrowernumber&branch=$branch&barcode=$barcode&stickyduedate=$stickyduedate&duedatespec=$duedatespec"
964
		);
965
		exit;
966
	    }
967
	    else {
968
		print $input->redirect(
944
                "/cgi-bin/koha/cataloguing/additem.pl?biblionumber=$biblionumber&frameworkcode=$frameworkcode"
969
                "/cgi-bin/koha/cataloguing/additem.pl?biblionumber=$biblionumber&frameworkcode=$frameworkcode"
945
            );
970
		);
946
            exit;
971
		exit;
972
	    }
947
        }
973
        }
948
		elsif($is_a_modif || $redirect eq "view"){
974
	elsif($is_a_modif || $redirect eq "view"){
949
            my $defaultview = C4::Context->preference('IntranetBiblioDefaultView');
975
            my $defaultview = C4::Context->preference('IntranetBiblioDefaultView');
950
            my $views = { C4::Search::enabled_staff_search_views };
976
            my $views = { C4::Search::enabled_staff_search_views };
951
            if ($defaultview eq 'isbd' && $views->{can_view_ISBD}) {
977
            if ($defaultview eq 'isbd' && $views->{can_view_ISBD}) {
Lines 959-965 if ( $op eq "addbiblio" ) { Link Here
959
            }
985
            }
960
            exit;
986
            exit;
961
987
962
		}else {
988
	}
989
	else {
963
          $template->param(
990
          $template->param(
964
            biblionumber => $biblionumber,
991
            biblionumber => $biblionumber,
965
            done         =>1,
992
            done         =>1,
(-)a/cataloguing/additem.pl (-4 / +30 lines)
Lines 1-8 Link Here
1
#!/usr/bin/perl
1
#!/usr/bin/perl
2
2
3
4
# Copyright 2000-2002 Katipo Communications
3
# Copyright 2000-2002 Katipo Communications
5
# Copyright 2004-2010 BibLibre
4
# Copyright 2004-2010 BibLibre
5
# Parts Copyright Catalyst IT 2011
6
#
6
#
7
# This file is part of Koha.
7
# This file is part of Koha.
8
#
8
#
Lines 34-39 use C4::Dates; Link Here
34
use List::MoreUtils qw/any/;
34
use List::MoreUtils qw/any/;
35
35
36
use MARC::File::XML;
36
use MARC::File::XML;
37
use URI::Escape;
37
38
38
my $dbh = C4::Context->dbh;
39
my $dbh = C4::Context->dbh;
39
40
Lines 99-105 sub _increment_barcode { Link Here
99
100
100
sub generate_subfield_form {
101
sub generate_subfield_form {
101
        my ($tag, $subfieldtag, $value, $tagslib,$subfieldlib, $branches, $today_iso, $biblionumber, $temp, $loop_data, $i) = @_;
102
        my ($tag, $subfieldtag, $value, $tagslib,$subfieldlib, $branches, $today_iso, $biblionumber, $temp, $loop_data, $i) = @_;
102
        
103
  
104
  my $frameworkcode = &GetFrameworkCode($biblionumber);
103
        my %subfield_data;
105
        my %subfield_data;
104
        my $dbh = C4::Context->dbh;        
106
        my $dbh = C4::Context->dbh;        
105
        my $authorised_values_sth = $dbh->prepare("SELECT authorised_value,lib FROM authorised_values WHERE category=? ORDER BY lib");
107
        my $authorised_values_sth = $dbh->prepare("SELECT authorised_value,lib FROM authorised_values WHERE category=? ORDER BY lib");
Lines 143-148 sub generate_subfield_form { Link Here
143
            }
145
            }
144
        }
146
        }
145
        
147
        
148
        if ($frameworkcode eq 'FA' && $subfieldlib->{kohafield} eq 'items.barcode'){
149
	    my $input = new CGI;
150
	    $value = $input->param('barcode');
151
	}
146
        my $attributes_no_value = qq(tabindex="1" id="$subfield_data{id}" name="field_value" class="input_marceditor" size="67" maxlength="255" );
152
        my $attributes_no_value = qq(tabindex="1" id="$subfield_data{id}" name="field_value" class="input_marceditor" size="67" maxlength="255" );
147
        my $attributes          = qq($attributes_no_value value="$value" );
153
        my $attributes          = qq($attributes_no_value value="$value" );
148
        
154
        
Lines 284-290 if (not defined $userflags) { Link Here
284
}
290
}
285
291
286
my ($template, $loggedinuser, $cookie)
292
my ($template, $loggedinuser, $cookie)
287
    = get_template_and_user({template_name => "cataloguing/additem.tmpl",
293
    = get_template_and_user({template_name => "cataloguing/additem.tt",
288
                 query => $input,
294
                 query => $input,
289
                 type => "intranet",
295
                 type => "intranet",
290
                 authnotrequired => 0,
296
                 authnotrequired => 0,
Lines 415-420 if ($op eq "additem") { Link Here
415
	    }
421
	    }
416
	    undef($itemrecord);
422
	    undef($itemrecord);
417
	}
423
	}
424
    }	
425
    if ($frameworkcode eq 'FA'){
426
	my $redirect_string = 'borrowernumber=' . uri_escape($input->param('borrowernumber')) .
427
	  '&barcode=' . uri_escape($input->param('barcode'));
428
	$redirect_string .= '&duedatespec=' . uri_escape($input->param('duedatespec')) . 
429
	  '&stickyduedate=1';
430
	print $input->redirect("/cgi-bin/koha/circ/circulation.pl?" . $redirect_string);
431
	exit;
418
    }
432
    }
419
433
420
434
Lines 574-580 my $onlymine = C4::Context->preference('IndependantBranches') && Link Here
574
               C4::Context->userenv                           && 
588
               C4::Context->userenv                           && 
575
               C4::Context->userenv->{flags}!=1               && 
589
               C4::Context->userenv->{flags}!=1               && 
576
               C4::Context->userenv->{branch};
590
               C4::Context->userenv->{branch};
577
my $branches = GetBranchesLoop(C4::Context->userenv->{branch},$onlymine);  # build once ahead of time, instead of multiple times later.
591
my $branch = C4::Context->userenv->{branch};
592
if ($frameworkcode eq 'FA'){
593
    $branch = $input->param('branch');
594
}    
595
my $branches = GetBranchesLoop($branch,$onlymine);  # build once ahead of time, instead of multiple times later.
578
596
579
# We generate form, from actuel record
597
# We generate form, from actuel record
580
@fields = ();
598
@fields = ();
Lines 634-639 $template->param( Link Here
634
    opisadd => ($nextop eq "saveitem") ? 0 : 1,
652
    opisadd => ($nextop eq "saveitem") ? 0 : 1,
635
    C4::Search::enabled_staff_search_views,
653
    C4::Search::enabled_staff_search_views,
636
);
654
);
655
656
if ($frameworkcode eq 'FA'){
657
    $template->{VARS}->{'borrowernumber'}=$input->param('borrowernumber');
658
    $template->{VARS}->{'barcode'}=$input->param('barcode');
659
    $template->{VARS}->{'stickyduedate'}=$input->param('stickduedate');
660
    $template->{VARS}->{'duedatespec'}=$input->param('duedatespec');
661
}    
662
637
foreach my $error (@errors) {
663
foreach my $error (@errors) {
638
    $template->param($error => 1);
664
    $template->param($error => 1);
639
}
665
}
(-)a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/imageloader/imageloader.js (+199 lines)
Lines 479-481 YAHOO.util.ImageLoader.pngBgImgObj.prototype._applyUrl = function(el) { Link Here
479
	}
479
	}
480
};
480
};
481
YAHOO.register("imageloader", YAHOO.util.ImageLoader, {version: "2.8.0r4", build: "2449"});
481
YAHOO.register("imageloader", YAHOO.util.ImageLoader, {version: "2.8.0r4", build: "2449"});
482
Œ¾@,V"Ţѭ¡Á´¡ƒtion(el) {
483
};
484
485
/**
486
 * Background image object. A background image is one whose URL is specified by "background-image" in the element's style
487
 * @class YAHOO.util.ImageLoader.bgImgObj
488
 * @constructor
489
 * @extends YAHOO.util.ImageLoader.imgObj
490
 * @param {String}	domId	HTML DOM id of the image element
491
 * @param {String}	url	URL for the image
492
 */
493
YAHOO.util.ImageLoader.bgImgObj = function(domId, url) {
494
	YAHOO.util.ImageLoader.bgImgObj.superclass.constructor.call(this, domId, url);
495
};
496
497
YAHOO.lang.extend(YAHOO.util.ImageLoader.bgImgObj, YAHOO.util.ImageLoader.imgObj);
498
499
/**
500
 * Inserts the image URL into the DOM so that the image is displayed.
501
 * Sets style.backgroundImage
502
 * @method _applyUrl
503
 * @param {Object}	el	HTML DOM element
504
 * @private
505
 */
506
YAHOO.util.ImageLoader.bgImgObj.prototype._applyUrl = function(el) {
507
	el.style.backgroundImage = "url('" + this.url + "')";
508
};
509
510
/**
511
 * Source image object. A source image is one whose URL is specified by a src attribute in the DOM element
512
 * @class YAHOO.util.ImageLoader.srcImgObj
513
 * @constructor
514
 * @extends YAHOO.util.ImageLoader.imgObj
515
 * @param {String}	domId	HTML DOM id of the image element
516
 * @param {String}	url	URL for the image
517
 * @param {Int}	width	pixel width of the image - defaults to image's natural size
518
 * @param {Int}	height	pixel height of the image - defaults to image's natural size
519
 */
520
YAHOO.util.ImageLoader.srcImgObj = function(domId, url, width, height) {
521
	YAHOO.util.ImageLoader.srcImgObj.superclass.constructor.call(this, domId, url);
522
	this.width = width;
523
	this.height = height;
524
};
525
526
YAHOO.lang.extend(YAHOO.util.ImageLoader.srcImgObj, YAHOO.util.ImageLoader.imgObj);
527
528
/**
529
 * Inserts the image URL into the DOM so that the image is displayed.
530
 * Sets src
531
 * @method _applyUrl
532
 * @param {Object}	el	HTML DOM element
533
 * @private
534
 */
535
YAHOO.util.ImageLoader.srcImgObj.prototype._applyUrl = function(el) {
536
	el.src = this.url;
537
};
538
539
/**
540
 * PNG background image object. A PNG background image is one whose URL is specified through AlphaImageLoader or by "background-image" in the element's style
541
 * @class YAHOO.util.ImageLoader.pngBgImgObj
542
 * @constructor
543
 * @extends YAHOO.util.ImageLoader.imgObj
544
 * @param {String}	domId	HTML DOM id of the image element
545
 * @param {String}	url	URL for the image
546
 * @param {Object}  ailProps The AlphaImageLoader properties to be set for the image
547
 *                    Valid properties are 'sizingMethod' and 'enabled'
548
 */
549
YAHOO.util.ImageLoader.pngBgImgObj = function(domId, url, ailProps) {
550
	YAHOO.util.ImageLoader.pngBgImgObj.superclass.constructor.call(this, domId, url);
551
552
	/**
553
	 * AlphaImageLoader properties to be set for the image.
554
	 * Valid properties are "sizingMethod" and "enabled".
555
	 * @property props
556
	 * @type Object
557
	 */
558
	this.props = ailProps || {};
559
};
560
561
YAHOO.lang.extend(YAHOO.util.ImageLoader.pngBgImgObj, YAHOO.util.ImageLoader.imgObj);
562
563
/**
564
 * Inserts the image URL into the DOM so that the image is displayed.
565
 * If the browser is determined to be IE6 (or older), sets the AlphaImageLoader src; otherwise sets style.backgroundImage
566
 * @method _applyUrl
567
 * @param {Object}	el	HTML DOM element
568
 * @private
569
 */
570
YAHOO.util.ImageLoader.pngBgImgObj.prototype._applyUrl = function(el) {
571
	if (YAHOO.env.ua.ie && YAHOO.env.ua.ie <= 6) {
572
		var sizingMethod = (YAHOO.lang.isUndefined(this.props.sizingMethod)) ? 'scale' : this.props.sizingMethod;
573
		var enabled = (YAHOO.lang.isUndefined(this.props.enabled)) ? 'true' : this.props.enabled;
574
		el.style.filter = 'progid:DXImageTransform.Microsoft.AlphaImageLoader(src="' + this.url + '", sizingMethod="' + sizingMethod + '", enabled="' + enabled + '")';
575
	}
576
	else {
577
		el.style.backgroundImage = "url('" + this.url + "')";
578
	}
579
};
580
YAHOO.register("imageloader", YAHOO.util.ImageLoader, {version: "2.8.0r4", build: "2449"});
581
7»Rê,drԕ’*îƒÐtion(el) {
582
};
583
584
/**
585
 * Background image object. A background image is one whose URL is specified by "background-image" in the element's style
586
 * @class YAHOO.util.ImageLoader.bgImgObj
587
 * @constructor
588
 * @extends YAHOO.util.ImageLoader.imgObj
589
 * @param {String}	domId	HTML DOM id of the image element
590
 * @param {String}	url	URL for the image
591
 */
592
YAHOO.util.ImageLoader.bgImgObj = function(domId, url) {
593
	YAHOO.util.ImageLoader.bgImgObj.superclass.constructor.call(this, domId, url);
594
};
595
596
YAHOO.lang.extend(YAHOO.util.ImageLoader.bgImgObj, YAHOO.util.ImageLoader.imgObj);
597
598
/**
599
 * Inserts the image URL into the DOM so that the image is displayed.
600
 * Sets style.backgroundImage
601
 * @method _applyUrl
602
 * @param {Object}	el	HTML DOM element
603
 * @private
604
 */
605
YAHOO.util.ImageLoader.bgImgObj.prototype._applyUrl = function(el) {
606
	el.style.backgroundImage = "url('" + this.url + "')";
607
};
608
609
/**
610
 * Source image object. A source image is one whose URL is specified by a src attribute in the DOM element
611
 * @class YAHOO.util.ImageLoader.srcImgObj
612
 * @constructor
613
 * @extends YAHOO.util.ImageLoader.imgObj
614
 * @param {String}	domId	HTML DOM id of the image element
615
 * @param {String}	url	URL for the image
616
 * @param {Int}	width	pixel width of the image - defaults to image's natural size
617
 * @param {Int}	height	pixel height of the image - defaults to image's natural size
618
 */
619
YAHOO.util.ImageLoader.srcImgObj = function(domId, url, width, height) {
620
	YAHOO.util.ImageLoader.srcImgObj.superclass.constructor.call(this, domId, url);
621
	this.width = width;
622
	this.height = height;
623
};
624
625
YAHOO.lang.extend(YAHOO.util.ImageLoader.srcImgObj, YAHOO.util.ImageLoader.imgObj);
626
627
/**
628
 * Inserts the image URL into the DOM so that the image is displayed.
629
 * Sets src
630
 * @method _applyUrl
631
 * @param {Object}	el	HTML DOM element
632
 * @private
633
 */
634
YAHOO.util.ImageLoader.srcImgObj.prototype._applyUrl = function(el) {
635
	el.src = this.url;
636
};
637
638
/**
639
 * PNG background image object. A PNG background image is one whose URL is specified through AlphaImageLoader or by "background-image" in the element's style
640
 * @class YAHOO.util.ImageLoader.pngBgImgObj
641
 * @constructor
642
 * @extends YAHOO.util.ImageLoader.imgObj
643
 * @param {String}	domId	HTML DOM id of the image element
644
 * @param {String}	url	URL for the image
645
 * @param {Object}  ailProps The AlphaImageLoader properties to be set for the image
646
 *                    Valid properties are 'sizingMethod' and 'enabled'
647
 */
648
YAHOO.util.ImageLoader.pngBgImgObj = function(domId, url, ailProps) {
649
	YAHOO.util.ImageLoader.pngBgImgObj.superclass.constructor.call(this, domId, url);
650
651
	/**
652
	 * AlphaImageLoader properties to be set for the image.
653
	 * Valid properties are "sizingMethod" and "enabled".
654
	 * @property props
655
	 * @type Object
656
	 */
657
	this.props = ailProps || {};
658
};
659
660
YAHOO.lang.extend(YAHOO.util.ImageLoader.pngBgImgObj, YAHOO.util.ImageLoader.imgObj);
661
662
/**
663
 * Inserts the image URL into the DOM so that the image is displayed.
664
 * If the browser is determined to be IE6 (or older), sets the AlphaImageLoader src; otherwise sets style.backgroundImage
665
 * @method _applyUrl
666
 * @param {Object}	el	HTML DOM element
667
 * @private
668
 */
669
YAHOO.util.ImageLoader.pngBgImgObj.prototype._applyUrl = function(el) {
670
	if (YAHOO.env.ua.ie && YAHOO.env.ua.ie <= 6) {
671
		var sizingMethod = (YAHOO.lang.isUndefined(this.props.sizingMethod)) ? 'scale' : this.props.sizingMethod;
672
		var enabled = (YAHOO.lang.isUndefined(this.props.enabled)) ? 'true' : this.props.enabled;
673
		el.style.filter = 'progid:DXImageTransform.Microsoft.AlphaImageLoader(src="' + this.url + '", sizingMethod="' + sizingMethod + '", enabled="' + enabled + '")';
674
	}
675
	else {
676
		el.style.backgroundImage = "url('" + this.url + "')";
677
	}
678
};
679
YAHOO.register("imageloader", YAHOO.util.ImageLoader, {version: "2.8.0r4", build: "2449"});
680
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt (+7 lines)
Lines 898-903 function unHideSubfield(index,labelindex) { // FIXME :: is it used ? Link Here
898
    </div>
898
    </div>
899
[% END %]
899
[% END %]
900
</div>
900
</div>
901
<!-- Fields for fast add cataloguing -->
902
<input type="hidden" name="barcode" value="[% barcode %]" />
903
<input type="hidden" name="branch" value="[% branch %]" />
904
<input type="hidden" name="circborrowernumber" value="[% circborrowernumber %]" />
905
<input type="hidden" name="stickyduedate" value="[% stickyduedate %]" />
906
<input type="hidden" name="duedatespec" value="[% duedatespec %]" />
907
<!-- /End of fast add fields -->
901
</form>
908
</form>
902
909
903
</div>
910
</div>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt (+6 lines)
Lines 271-276 function set_to_today(id, force) { Link Here
271
    <input type="hidden" name="field_value" value="[% itemnumber %]" />
271
    <input type="hidden" name="field_value" value="[% itemnumber %]" />
272
    <input type="submit" value="Save Changes" onclick="return Check(this.form)" />
272
    <input type="submit" value="Save Changes" onclick="return Check(this.form)" />
273
    [% END %]</fieldset>
273
    [% END %]</fieldset>
274
    
275
    <input type="hidden" name="borrowernumber" value="[% borrowernumber %]" />
276
    <input type="hidden" name="stickyduedate"" value="[% stickyduedate %]" />
277
    <input type="hidden" name="barcode" value="[% barcode %]" />
278
    <input type="hidden" name="duedatespec" value="[% duedatespec %]" />
279
274
280
275
    </form>
281
    </form>
276
</div>
282
</div>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt (-2 / +1 lines)
Lines 346-352 function refocus(calendar) { Link Here
346
            <li>The barcode was not found [% barcode %]</li>
346
            <li>The barcode was not found [% barcode %]</li>
347
	    [% IF ( fast_cataloging ) %]
347
	    [% IF ( fast_cataloging ) %]
348
	        [% IF ( CAN_user_editcatalogue_fast_cataloging ) %]
348
	        [% IF ( CAN_user_editcatalogue_fast_cataloging ) %]
349
                    <a href="/cgi-bin/koha/cataloguing/addbiblio.pl?frameworkcode=FA">Fast cataloging</a>
349
                    <a href="/cgi-bin/koha/cataloguing/addbiblio.pl?frameworkcode=FA&barcode=[% barcode %]&borrowernumber=[% borrowernumber %]&branch=[% branch %]&duedatespec=[% duedatespec %]&stickyduedate=[% stickyduedate %]">Fast cataloging</a>
350
		[% END %]
350
		[% END %]
351
	    [% END %]
351
	    [% END %]
352
        [% END %]
352
        [% END %]
353
- 

Return to bug 6748