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

(-)a/C4/Biblio.pm (-2 / +6 lines)
Lines 953-959 sub GetMarcStructure { Link Here
953
    }
953
    }
954
954
955
    $sth = $dbh->prepare(
955
    $sth = $dbh->prepare(
956
        "SELECT tagfield,tagsubfield,liblibrarian,libopac,tab,mandatory,repeatable,authorised_value,authtypecode,value_builder,kohafield,seealso,hidden,isurl,link,defaultvalue 
956
        "SELECT tagfield,tagsubfield,liblibrarian,libopac,tab,mandatory,repeatable,authorised_value,authtypecode,value_builder,kohafield,seealso,hidden,isurl,link,defaultvalue,punctuation,help 
957
         FROM   marc_subfield_structure 
957
         FROM   marc_subfield_structure 
958
         WHERE  frameworkcode=? 
958
         WHERE  frameworkcode=? 
959
         ORDER BY tagfield,tagsubfield
959
         ORDER BY tagfield,tagsubfield
Lines 972-981 sub GetMarcStructure { Link Here
972
    my $isurl;
972
    my $isurl;
973
    my $link;
973
    my $link;
974
    my $defaultvalue;
974
    my $defaultvalue;
975
    my $punctuation;
976
    my $help;
975
977
976
    while (
978
    while (
977
        (   $tag,          $subfield,      $liblibrarian, $libopac, $tab,    $mandatory, $repeatable, $authorised_value,
979
        (   $tag,          $subfield,      $liblibrarian, $libopac, $tab,    $mandatory, $repeatable, $authorised_value,
978
            $authtypecode, $value_builder, $kohafield,    $seealso, $hidden, $isurl,     $link,       $defaultvalue
980
            $authtypecode, $value_builder, $kohafield,    $seealso, $hidden, $isurl,     $link,       $defaultvalue, $punctuation, $help
979
        )
981
        )
980
        = $sth->fetchrow
982
        = $sth->fetchrow
981
      ) {
983
      ) {
Lines 992-997 sub GetMarcStructure { Link Here
992
        $res->{$tag}->{$subfield}->{isurl}            = $isurl;
994
        $res->{$tag}->{$subfield}->{isurl}            = $isurl;
993
        $res->{$tag}->{$subfield}->{'link'}           = $link;
995
        $res->{$tag}->{$subfield}->{'link'}           = $link;
994
        $res->{$tag}->{$subfield}->{defaultvalue}     = $defaultvalue;
996
        $res->{$tag}->{$subfield}->{defaultvalue}     = $defaultvalue;
997
        $res->{$tag}->{$subfield}->{punctuation}      = $punctuation;
998
        $res->{$tag}->{$subfield}->{help}     		  = $help;
995
    }
999
    }
996
1000
997
    $marc_structure_cache->{$forlibrarian}->{$frameworkcode} = $res;
1001
    $marc_structure_cache->{$forlibrarian}->{$frameworkcode} = $res;
(-)a/admin/marc_subfields_structure.pl (-3 / +13 lines)
Lines 179-184 if ( $op eq 'add_form' ) { Link Here
179
    while ( $data = $sth->fetchrow_hashref ) {
179
    while ( $data = $sth->fetchrow_hashref ) {
180
        my %row_data;    # get a fresh hash for the row data
180
        my %row_data;    # get a fresh hash for the row data
181
        $row_data{defaultvalue} = $data->{defaultvalue};
181
        $row_data{defaultvalue} = $data->{defaultvalue};
182
        $row_data{punctuation} = $data->{'punctuation'};
183
        $row_data{help}        = CGI::escapeHTML( $data->{'help'} );
182
        $row_data{tab} = CGI::scrolling_list(
184
        $row_data{tab} = CGI::scrolling_list(
183
            -name   => 'tab',
185
            -name   => 'tab',
184
            -id     => "tab$i",
186
            -id     => "tab$i",
Lines 386-396 elsif ( $op eq 'add_validate' ) { Link Here
386
#                                     values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"
388
#                                     values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"
387
#     );
389
#     );
388
    my $sth_insert = $dbh->prepare(qq{
390
    my $sth_insert = $dbh->prepare(qq{
389
        insert into marc_subfield_structure (tagfield,tagsubfield,liblibrarian,libopac,repeatable,mandatory,kohafield,tab,seealso,authorised_value,authtypecode,value_builder,hidden,isurl,frameworkcode, link,defaultvalue)
391
        insert into marc_subfield_structure (tagfield,tagsubfield,liblibrarian,libopac,repeatable,mandatory,kohafield,tab,seealso,authorised_value,authtypecode,value_builder,hidden,isurl,frameworkcode, link,defaultvalue,punctuation,help)
390
        values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
392
        values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
391
    });
393
    });
392
    my $sth_update = $dbh->prepare(qq{
394
    my $sth_update = $dbh->prepare(qq{
393
        update marc_subfield_structure set tagfield=?, tagsubfield=?, liblibrarian=?, libopac=?, repeatable=?, mandatory=?, kohafield=?, tab=?, seealso=?, authorised_value=?, authtypecode=?, value_builder=?, hidden=?, isurl=?, frameworkcode=?,  link=?, defaultvalue=?
395
        update marc_subfield_structure set tagfield=?, tagsubfield=?, liblibrarian=?, libopac=?, repeatable=?, mandatory=?, kohafield=?, tab=?, seealso=?, authorised_value=?, authtypecode=?, value_builder=?, hidden=?, isurl=?, frameworkcode=?,  link=?, defaultvalue=?, punctuation=?, help=?
394
        where tagfield=? and tagsubfield=? and frameworkcode=?
396
        where tagfield=? and tagsubfield=? and frameworkcode=?
395
    });
397
    });
396
    my @tagsubfield       = $input->param('tagsubfield');
398
    my @tagsubfield       = $input->param('tagsubfield');
Lines 405-410 elsif ( $op eq 'add_validate' ) { Link Here
405
    my @value_builder     = $input->param('value_builder');
407
    my @value_builder     = $input->param('value_builder');
406
    my @link              = $input->param('link');
408
    my @link              = $input->param('link');
407
    my @defaultvalue      = $input->param('defaultvalue');
409
    my @defaultvalue      = $input->param('defaultvalue');
410
    my @punctuation       = $input->param('punctuation');
411
    my @help              = $input->param('help');
408
    
412
    
409
    for ( my $i = 0 ; $i <= $#tagsubfield ; $i++ ) {
413
    for ( my $i = 0 ; $i <= $#tagsubfield ; $i++ ) {
410
        my $tagfield    = $input->param('tagfield');
414
        my $tagfield    = $input->param('tagfield');
Lines 425-430 elsif ( $op eq 'add_validate' ) { Link Here
425
        my $isurl  = $input->param("isurl$i") ? 1 : 0;
429
        my $isurl  = $input->param("isurl$i") ? 1 : 0;
426
        my $link   = $link[$i];
430
        my $link   = $link[$i];
427
        my $defaultvalue = $defaultvalue[$i];
431
        my $defaultvalue = $defaultvalue[$i];
432
        my $punctuation      = $punctuation[$i];
433
        my $help             = $help[$i];
428
        
434
        
429
        if ($liblibrarian) {
435
        if ($liblibrarian) {
430
            unless ( C4::Context->config('demo') eq 1 ) {
436
            unless ( C4::Context->config('demo') eq 1 ) {
Lines 447-452 elsif ( $op eq 'add_validate' ) { Link Here
447
                        $frameworkcode,
453
                        $frameworkcode,
448
                        $link,
454
                        $link,
449
                        $defaultvalue,
455
                        $defaultvalue,
456
                        $punctuation,
457
                        $help,
450
                        (
458
                        (
451
                            $tagfield,
459
                            $tagfield,
452
                            $tagsubfield,
460
                            $tagsubfield,
Lines 472-477 elsif ( $op eq 'add_validate' ) { Link Here
472
                        $frameworkcode,
480
                        $frameworkcode,
473
                        $link,
481
                        $link,
474
                        $defaultvalue,
482
                        $defaultvalue,
483
                        $punctuation,
484
                        $help,
475
                    );
485
                    );
476
                }
486
                }
477
            }
487
            }
(-)a/cataloguing/addbiblio.pl (+11 lines)
Lines 332-337 sub create_input { Link Here
332
        mandatory      => $tagslib->{$tag}->{$subfield}->{mandatory},
332
        mandatory      => $tagslib->{$tag}->{$subfield}->{mandatory},
333
        repeatable     => $tagslib->{$tag}->{$subfield}->{repeatable},
333
        repeatable     => $tagslib->{$tag}->{$subfield}->{repeatable},
334
        kohafield      => $tagslib->{$tag}->{$subfield}->{kohafield},
334
        kohafield      => $tagslib->{$tag}->{$subfield}->{kohafield},
335
        punctuation    => $tagslib->{$tag}->{$subfield}->{punctuation},
336
        help           => $tagslib->{$tag}->{$subfield}->{help},
335
        index          => $index_tag,
337
        index          => $index_tag,
336
        id             => "tag_".$tag."_subfield_".$id_subfield."_".$index_tag."_".$index_subfield,
338
        id             => "tag_".$tag."_subfield_".$id_subfield."_".$index_tag."_".$index_subfield,
337
        value          => $value,
339
        value          => $value,
Lines 505-515 sub create_input { Link Here
505
                        name=\"".$subfield_data{id}."\"
507
                        name=\"".$subfield_data{id}."\"
506
                        value=\"$value\"
508
                        value=\"$value\"
507
                        tabindex=\"1\"
509
                        tabindex=\"1\"
510
                        punctuation=\"".$subfield_data{punctuation}."\"
508
                        size=\"67\"
511
                        size=\"67\"
509
                        maxlength=\"$max_length\"
512
                        maxlength=\"$max_length\"
510
                        class=\"input_marceditor\"
513
                        class=\"input_marceditor\"
514
                        onfocus=\"javascript:GetPunctuation(this);\"
515
                        onblur=\"javascript:CheckPunctuation(this);\"
511
                \/>
516
                \/>
512
                ";
517
                ";
518
                if ($subfield_data{help}){
519
                	$subfield_data{marc_value} .= "
520
                	&nbsp;<a class=\"showhelp\" href=\"#help_" . $subfield_data{id} . "\">Show help</a>
521
                	<div class=\"divsubfieldhelp\" id=\"help_" . $subfield_data{id} . "\" style=\"display:none; clear: both\">&nbsp;<i>" . $subfield_data{help} . "</i></div>
522
                	";
523
               }
513
        }
524
        }
514
    }
525
    }
515
    $subfield_data{'index_subfield'} = $index_subfield;
526
    $subfield_data{'index_subfield'} = $index_subfield;
(-)a/installer/data/mysql/kohastructure.sql (+2 lines)
Lines 1187-1192 CREATE TABLE `marc_subfield_structure` ( Link Here
1187
  `seealso` varchar(1100) default NULL,
1187
  `seealso` varchar(1100) default NULL,
1188
  `link` varchar(80) default NULL,
1188
  `link` varchar(80) default NULL,
1189
  `defaultvalue` text default NULL,
1189
  `defaultvalue` text default NULL,
1190
  `punctuation` varchar(5) default NULL,
1191
  `help` varchar(255) default NULL,  
1190
  PRIMARY KEY  (`frameworkcode`,`tagfield`,`tagsubfield`),
1192
  PRIMARY KEY  (`frameworkcode`,`tagfield`,`tagsubfield`),
1191
  KEY `kohafield_2` (`kohafield`),
1193
  KEY `kohafield_2` (`kohafield`),
1192
  KEY `tab` (`frameworkcode`,`tab`),
1194
  KEY `tab` (`frameworkcode`,`tab`),
(-)a/installer/data/mysql/updatedatabase.pl (+9 lines)
Lines 4354-4359 if (C4::Context->preference("Version") < TransformToNum($DBversion)) { Link Here
4354
    SetVersion ($DBversion);
4354
    SetVersion ($DBversion);
4355
}
4355
}
4356
4356
4357
$DBversion = '3.05.00.0021';
4358
if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
4359
	$dbh->do("
4360
       ALTER TABLE `marc_subfield_structure` ADD `punctuation` VARCHAR( 5 ) NULL , ADD `help` VARCHAR( 255 ) NULL;
4361
   	");
4362
    print "Upgrade to $DBversion done (Punctuation and cataloguing help)\n";
4363
    SetVersion($DBversion);
4364
}
4365
4357
=head1 FUNCTIONS
4366
=head1 FUNCTIONS
4358
4367
4359
=head2 DropAllForeignKeys($table)
4368
=head2 DropAllForeignKeys($table)
(-)a/koha-tmpl/intranet-tmpl/prog/en/css/addbiblio.css (+5 lines)
Lines 83-88 a.tagnum { Link Here
83
	text-decoration : none;
83
	text-decoration : none;
84
}
84
}
85
85
86
.divsubfieldhelp {
87
       background-color: #F0FFEF; 
88
       border: #EFEFEF 1px solid;
89
}
90
86
.subfield {
91
.subfield {
87
	color : #00698a;
92
	color : #00698a;
88
	float: left;
93
	float: left;
(-)a/koha-tmpl/intranet-tmpl/prog/en/js/staff-global.js (+55 lines)
Lines 89-91 function checkEnter(e){ //e is event object passed from function invocation Link Here
89
		return true;
89
		return true;
90
	}
90
	}
91
}
91
}
92
93
/*
94
 * Place punctuation when cataloguing
95
 */
96
97
function trim(s) {
98
  while (s.length>0 && (s[0]==' '||s[0]=='\n')) s=s.substring(1, s.length);
99
  while (s.length>0 && (s[s.length-1]==' '||s[s.length-1]=='\n')) s=s.substring(0, s.length-1);
100
  while (s.search (" ") != -1){
101
       s = s.replace (" ","");
102
       }
103
  return s; 
104
}
105
106
/*
107
       Place the cursor in a determinate place into a textbox
108
*/
109
110
function placePositionTextbox(elem, myPos) {
111
112
    if(elem != null) {
113
        if(elem.createTextRange) {
114
            var range = elem.createTextRange();
115
            range.move('character', myPos);
116
            range.select();
117
        }
118
        else {
119
            if(elem.selectionStart) {
120
                elem.focus();
121
                elem.setSelectionRange(myPos, myPos);
122
            }
123
            else
124
                elem.focus();
125
        }
126
    }
127
}
128
129
function GetPunctuation(field){
130
       var val = field.value;
131
       if (trim(val) == ""){
132
               field.value = field.getAttribute('punctuation');
133
               placePositionTextbox(field,field.value.length);
134
       }
135
}
136
137
function CheckPunctuation(field){
138
       var val = field.value;
139
       if (val == field.getAttribute('punctuation')){
140
               field.value = "";
141
       }
142
}
143
144
/*
145
 * END - Place punctuation when cataloguing
146
 */
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/marc_subfields_structure.tt (-10 / +15 lines)
Lines 106-127 Link Here
106
            <div id="more[% loo.urisubfieldcode %]" style="display:none; clear: both">
106
            <div id="more[% loo.urisubfieldcode %]" style="display:none; clear: both">
107
             <fieldset class="rows">
107
             <fieldset class="rows">
108
				<legend>Advanced constraints:</legend>
108
				<legend>Advanced constraints:</legend>
109
                <ol><li><label for="defaultvalue[% loo.row %]">Default value:</label>
109
                <ol>
110
                    <input type="text" name="defaultvalue" id="defaultvalue[% loo.row %]" value="[% loo.defaultvalue %]" /></li>
110
                	<li><label for="defaultvalue[% loo.row %]">Default value:</label>
111
                <li><label for="hidden[% loo.row %]">hidden</label><input type="text" id="hidden[% loo.row %]" name="hidden" value="[% loo.hidden %]" size="2" /> (see online help)</li>
111
                    	<input type="text" name="defaultvalue" id="defaultvalue[% loo.row %]" value="[% loo.defaultvalue %]" /></li>
112
                <li><label for="isurl[% loo.row %]">Is a url:</label>[% loo.isurl %] (if checked, it means that the subfield is a url and can be clicked)</li>
112
                    <li><label for="punctuation[% loo.row %]">Punctuation:</label>
113
                <li><label for="link[% loo.row %]">Link:</label><input type="text" id="link[% loo.row %]" name="link" value="[% loo.link %]" size="10" maxlength="80" /> (e.g., Title or Local-Number) <span class="error"><em>NOTE: If you change this value you must ask your administrator to run misc/batchRebuildBiblioTables.pl.</em></span></li>
113
                        <input type="text" name="punctuation" id="punctuation[% loo.row %]" value="[% loo.punctuation %]" /></li>
114
                <li><label for="kohafield[% loo.row %]">Koha link:</label>[% loo.kohafield %]</li>
114
                    <li><label for="help[% loo.row %]">Help:</label><br/>
115
			</ol>
115
                    	<textarea type="text" name="help" id="help[% loo.row %]" cols="40">[% loo.help %]</textarea></li>
116
	</fieldset>
116
                	<li><label for="hidden[% loo.row %]">hidden</label><input type="text" id="hidden[% loo.row %]" name="hidden" value="[% loo.hidden %]" size="2" /> (see online help)</li>
117
	 <fieldset class="rows">
117
                	<li><label for="isurl[% loo.row %]">Is a url:</label>[% loo.isurl %] (if checked, it means that the subfield is a url and can be clicked)</li>
118
                	<li><label for="link[% loo.row %]">Link:</label><input type="text" id="link[% loo.row %]" name="link" value="[% loo.link %]" size="10" maxlength="80" /> (e.g., Title or Local-Number) <span class="error"><em>NOTE: If you change this value you must ask your administrator to run misc/batchRebuildBiblioTables.pl.</em></span></li>
119
                	<li><label for="kohafield[% loo.row %]">Koha link:</label>[% loo.kohafield %]</li>
120
				</ol>
121
			</fieldset>
122
	 		<fieldset class="rows">
118
                <legend>Other Options: (choose one)</legend>
123
                <legend>Other Options: (choose one)</legend>
119
                    	<ol>
124
                    	<ol>
120
                    		<li><label for="authorised_value[% loo.row %]">Authorized value:</label>[% loo.authorised_value %]</li>
125
                    		<li><label for="authorised_value[% loo.row %]">Authorized value:</label>[% loo.authorised_value %]</li>
121
                    		<li><label for="authtypecode[% loo.row %]">Thesaurus:</label>[% loo.authtypes %]</li>
126
                    		<li><label for="authtypecode[% loo.row %]">Thesaurus:</label>[% loo.authtypes %]</li>
122
                    		<li><label for="value_builder[% loo.row %]">Plugin:</label>[% loo.value_builder %]</li>
127
                    		<li><label for="value_builder[% loo.row %]">Plugin:</label>[% loo.value_builder %]</li>
123
                    	</ol>
128
                    	</ol>
124
				</fieldset>
129
			</fieldset>				
125
            </div><br class="clear" /><!-- /more  -->
130
            </div><br class="clear" /><!-- /more  -->
126
        </div><!-- /content_sub -->
131
        </div><!-- /content_sub -->
127
        [% END %]
132
        [% END %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt (-7 / +15 lines)
Lines 9-33 Link Here
9
	 $(document).ready(function() {
9
	 $(document).ready(function() {
10
 		$('#addbibliotabs > ul').tabs().bind('show.ui-tabs', function(e, ui) {
10
 		$('#addbibliotabs > ul').tabs().bind('show.ui-tabs', function(e, ui) {
11
			$("#"+ui.panel.id+" input:eq(0)").focus();
11
			$("#"+ui.panel.id+" input:eq(0)").focus();
12
		});
12
	 });
13
        $('.tag').each(function() {
13
     $('.tag').each(function() {
14
            var field_id = this.getAttribute('id').substring(0, 7);
14
            var field_id = this.getAttribute('id').substring(0, 7);
15
            if (field_id in fields_in_use) {
15
            if (field_id in fields_in_use) {
16
                fields_in_use[field_id]++;
16
                fields_in_use[field_id]++;
17
            } else {
17
            } else {
18
                fields_in_use[field_id] = 1;
18
                fields_in_use[field_id] = 1;
19
            }
19
            }
20
        });
20
     });
21
        $('.subfield_line').each(function() {
21
     $('.subfield_line').each(function() {
22
            var field_id = this.getAttribute('id').substring(0, 12);
22
            var field_id = this.getAttribute('id').substring(0, 12);
23
            if (field_id in fields_in_use) {
23
            if (field_id in fields_in_use) {
24
                fields_in_use[field_id]++;
24
                fields_in_use[field_id]++;
25
            } else {
25
            } else {
26
                fields_in_use[field_id] = 1;
26
                fields_in_use[field_id] = 1;
27
            }
27
            }
28
        });
28
     });               
29
     $("a.showhelp").click(function(){
30
        	$("#"+$(this).attr("href").replace("#","")).toggle();
31
            if($(this).html() == "Show help"){
32
            	$(this).html("Hide help");
33
            } else {
34
                $(this).html("Show help");
35
            }
36
     });        
29
		/* check cookie to hide/show marcdocs*/
37
		/* check cookie to hide/show marcdocs*/
30
		if($.cookie("marcdocs_[% borrowernumber %]") == 'false'){
38
	 if($.cookie("marcdocs_[% borrowernumber %]") == 'false'){
31
			hideMARCdocLinks();
39
			hideMARCdocLinks();
32
			$("#marcDocsSelect").attr('checked',false);
40
			$("#marcDocsSelect").attr('checked',false);
33
		} else {
41
		} else {
Lines 36-42 Link Here
36
						{ path: "/", expires: 365 });
44
						{ path: "/", expires: 365 });
37
		}
45
		}
38
46
39
	});
47
	 });
40
48
41
	$('#header_search > ul').tabs().bind('show.ui-tabs', function(e, ui) { $('#header_search > div:not(.ui-tabs-hide)').find('input').eq(0).focus(); });
49
	$('#header_search > ul').tabs().bind('show.ui-tabs', function(e, ui) { $('#header_search > div:not(.ui-tabs-hide)').find('input').eq(0).focus(); });
42
50
(-)a/kohaversion.pl (-2 / +1 lines)
Lines 16-22 the kohaversion is divided in 4 parts : Link Here
16
use strict;
16
use strict;
17
17
18
sub kohaversion {
18
sub kohaversion {
19
    our $VERSION = '3.05.00.002';
19
    our $VERSION = '3.05.00.0021';
20
    # version needs to be set this way
20
    # version needs to be set this way
21
    # so that it can be picked up by Makefile.PL
21
    # so that it can be picked up by Makefile.PL
22
    # during install
22
    # during install
23
- 

Return to bug 6138