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

(-)a/C4/Biblio.pm (-2 / +6 lines)
Lines 958-964 sub GetMarcStructure { Link Here
958
    }
958
    }
959
959
960
    $sth = $dbh->prepare(
960
    $sth = $dbh->prepare(
961
        "SELECT tagfield,tagsubfield,liblibrarian,libopac,tab,mandatory,repeatable,authorised_value,authtypecode,value_builder,kohafield,seealso,hidden,isurl,link,defaultvalue 
961
        "SELECT tagfield,tagsubfield,liblibrarian,libopac,tab,mandatory,repeatable,authorised_value,authtypecode,value_builder,kohafield,seealso,hidden,isurl,link,defaultvalue,punctuation,help 
962
         FROM   marc_subfield_structure 
962
         FROM   marc_subfield_structure 
963
         WHERE  frameworkcode=? 
963
         WHERE  frameworkcode=? 
964
         ORDER BY tagfield,tagsubfield
964
         ORDER BY tagfield,tagsubfield
Lines 977-986 sub GetMarcStructure { Link Here
977
    my $isurl;
977
    my $isurl;
978
    my $link;
978
    my $link;
979
    my $defaultvalue;
979
    my $defaultvalue;
980
    my $punctuation;
981
    my $help;
980
982
981
    while (
983
    while (
982
        (   $tag,          $subfield,      $liblibrarian, $libopac, $tab,    $mandatory, $repeatable, $authorised_value,
984
        (   $tag,          $subfield,      $liblibrarian, $libopac, $tab,    $mandatory, $repeatable, $authorised_value,
983
            $authtypecode, $value_builder, $kohafield,    $seealso, $hidden, $isurl,     $link,       $defaultvalue
985
            $authtypecode, $value_builder, $kohafield,    $seealso, $hidden, $isurl,     $link,       $defaultvalue,     $punctuation,    $help
984
        )
986
        )
985
        = $sth->fetchrow
987
        = $sth->fetchrow
986
      ) {
988
      ) {
Lines 997-1002 sub GetMarcStructure { Link Here
997
        $res->{$tag}->{$subfield}->{isurl}            = $isurl;
999
        $res->{$tag}->{$subfield}->{isurl}            = $isurl;
998
        $res->{$tag}->{$subfield}->{'link'}           = $link;
1000
        $res->{$tag}->{$subfield}->{'link'}           = $link;
999
        $res->{$tag}->{$subfield}->{defaultvalue}     = $defaultvalue;
1001
        $res->{$tag}->{$subfield}->{defaultvalue}     = $defaultvalue;
1002
        $res->{$tag}->{$subfield}->{punctuation}      = $punctuation;
1003
        $res->{$tag}->{$subfield}->{help}     		  = $help;
1000
    }
1004
    }
1001
1005
1002
    $marc_structure_cache->{$forlibrarian}->{$frameworkcode} = $res;
1006
    $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 (defined($liblibrarian) && $liblibrarian ne "") {
435
        if (defined($liblibrarian) && $liblibrarian ne "") {
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 496-506 sub create_input { Link Here
496
                        name=\"".$subfield_data{id}."\"
498
                        name=\"".$subfield_data{id}."\"
497
                        value=\"$value\"
499
                        value=\"$value\"
498
                        tabindex=\"1\"
500
                        tabindex=\"1\"
501
                        punctuation=\"".$subfield_data{punctuation}."\"
499
                        size=\"67\"
502
                        size=\"67\"
500
                        maxlength=\"$max_length\"
503
                        maxlength=\"$max_length\"
501
                        class=\"input_marceditor\"
504
                        class=\"input_marceditor\"
505
                        onfocus=\"javascript:GetPunctuation(this);\"
506
                        onblur=\"javascript:CheckPunctuation(this);\"
502
                \/>
507
                \/>
503
                ";
508
                ";
509
                if ($subfield_data{help}){
510
                	$subfield_data{marc_value} .= "
511
                	&nbsp;<a class=\"showhelp\" href=\"#help_" . $subfield_data{id} . "\">Show help</a>
512
                	<div class=\"divsubfieldhelp\" id=\"help_" . $subfield_data{id} . "\" style=\"display:none; clear: both\">&nbsp;<i>" . $subfield_data{help} . "</i></div>
513
                	";
514
               }
504
        }
515
        }
505
    }
516
    }
506
    $subfield_data{'index_subfield'} = $index_subfield;
517
    $subfield_data{'index_subfield'} = $index_subfield;
(-)a/installer/data/mysql/kohastructure.sql (+2 lines)
Lines 1197-1202 CREATE TABLE `marc_subfield_structure` ( Link Here
1197
  `seealso` varchar(1100) default NULL,
1197
  `seealso` varchar(1100) default NULL,
1198
  `link` varchar(80) default NULL,
1198
  `link` varchar(80) default NULL,
1199
  `defaultvalue` text default NULL,
1199
  `defaultvalue` text default NULL,
1200
  `punctuation` varchar(5) default NULL,
1201
  `help` varchar(255) default NULL,  
1200
  PRIMARY KEY  (`frameworkcode`,`tagfield`,`tagsubfield`),
1202
  PRIMARY KEY  (`frameworkcode`,`tagfield`,`tagsubfield`),
1201
  KEY `kohafield_2` (`kohafield`),
1203
  KEY `kohafield_2` (`kohafield`),
1202
  KEY `tab` (`frameworkcode`,`tab`),
1204
  KEY `tab` (`frameworkcode`,`tab`),
(-)a/installer/data/mysql/updatedatabase.pl (+10 lines)
Lines 4663-4668 ENDOFRENEWAL Link Here
4663
    print "Upgrade to $DBversion done (Added a system preference to allow renewal of Patron account either from todays date or from existing expiry date in the patrons account.)\n";
4663
    print "Upgrade to $DBversion done (Added a system preference to allow renewal of Patron account either from todays date or from existing expiry date in the patrons account.)\n";
4664
    SetVersion($DBversion);
4664
    SetVersion($DBversion);
4665
}
4665
}
4666
4667
$DBversion = "3.07.00.XXX";
4668
if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
4669
	$dbh->do("
4670
       ALTER TABLE `marc_subfield_structure` ADD `punctuation` VARCHAR( 5 ) NULL , ADD `help` VARCHAR( 255 ) NULL;
4671
   	");
4672
    print "Upgrade to $DBversion done (Punctuation and cataloguing help)\n";
4673
    SetVersion($DBversion);
4674
}
4675
4666
=head1 FUNCTIONS
4676
=head1 FUNCTIONS
4667
4677
4668
=head2 DropAllForeignKeys($table)
4678
=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 (-1 / +57 lines)
Lines 92-95 function checkEnter(e){ //e is event object passed from function invocation Link Here
92
92
93
function clearHoldFor(){
93
function clearHoldFor(){
94
	$.cookie("holdfor",null, { path: "/", expires: 0 });
94
	$.cookie("holdfor",null, { path: "/", expires: 0 });
95
}
95
}
96
97
98
/*
99
 * Place punctuation when cataloguing
100
 */
101
102
function trim(s) {
103
  while (s.length>0 && (s[0]==' '||s[0]=='\n')) s=s.substring(1, s.length);
104
  while (s.length>0 && (s[s.length-1]==' '||s[s.length-1]=='\n')) s=s.substring(0, s.length-1);
105
  while (s.search (" ") != -1){
106
       s = s.replace (" ","");
107
       }
108
  return s; 
109
}
110
111
/*
112
       Place the cursor in a determinate place into a textbox
113
*/
114
115
function placePositionTextbox(elem, myPos) {
116
117
    if(elem != null) {
118
        if(elem.createTextRange) {
119
            var range = elem.createTextRange();
120
            range.move('character', myPos);
121
            range.select();
122
        }
123
        else {
124
            if(elem.selectionStart) {
125
                elem.focus();
126
                elem.setSelectionRange(myPos, myPos);
127
            }
128
            else
129
                elem.focus();
130
        }
131
    }
132
}
133
134
function GetPunctuation(field){
135
       var val = field.value;
136
       if (trim(val) == ""){
137
               field.value = field.getAttribute('punctuation');
138
               placePositionTextbox(field,field.value.length);
139
       }
140
}
141
142
function CheckPunctuation(field){
143
       var val = field.value;
144
       if (val == field.getAttribute('punctuation')){
145
               field.value = "";
146
       }
147
}
148
149
/*
150
 * END - Place punctuation when cataloguing
151
 */
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/marc_subfields_structure.tt (-8 / +13 lines)
Lines 106-119 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" style="float:none;">
107
             <fieldset class="rows" style="float:none;">
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
                	<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>
117
	 <fieldset class="rows" style="float:none;">
122
	 <fieldset class="rows" style="float:none;">
118
                <legend>Other Options: (choose one)</legend>
123
                <legend>Other Options: (choose one)</legend>
119
                    	<ol>
124
                    	<ol>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt (-1 / +8 lines)
Lines 27-32 Link Here
27
                fields_in_use[field_id] = 1;
27
                fields_in_use[field_id] = 1;
28
            }
28
            }
29
        });
29
        });
30
     $("a.showhelp").click(function(){
31
        	$("#"+$(this).attr("href").replace("#","")).toggle();
32
            if($(this).html() == "Show help"){
33
            	$(this).html("Hide help");
34
            } else {
35
                $(this).html("Show help");
36
            }
37
     }); 
30
		/* check cookie to hide/show marcdocs*/
38
		/* check cookie to hide/show marcdocs*/
31
		if($.cookie("marcdocs_[% borrowernumber %]") == 'false'){
39
		if($.cookie("marcdocs_[% borrowernumber %]") == 'false'){
32
			hideMARCdocLinks();
40
			hideMARCdocLinks();
33
- 

Return to bug 6138