Skip to content
Browse files

Merge pull request #39 from hgq/07_02_pt11414367_1_02

07 02 pt11414367 1 02
  • Loading branch information...
2 parents d50007e + 5b8554a commit 2398baf14bfc97df9f244894bf0798be2f9b8ac1 @ctfliblime ctfliblime committed
View
3 cataloguing/additem.pl
@@ -368,6 +368,9 @@ sub set_item_default_location {
my $t = $tmp[0];
my $barcode_id = $t->{id};
unshift( @$item, $t );
+for my $i(0..$#{$item}) { # fix index of error field
+ $$item[$i]{marc_lib} =~ s/^(<span id\=\"error)(\d+)/$1$i/;
+}
# what's the next op ? it's what we are not in : an add if we're editing, otherwise, and edit.
$template->param( title => $record->title() ) if ($record ne "-1");
View
8 koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tmpl
@@ -90,7 +90,7 @@ function AreMandatoriesNotOk(){
<!-- /TMPL_LOOP -->
<!-- /TMPL_LOOP -->
<!-- /TMPL_LOOP -->
- var StrAlert = _("Can't save this record because the following field aren't filled :\n\n");
+ var StrAlert = _("Can't save this record because the following fields aren't filled :\n\n");
for(var i=0,len=mandatories.length; i<len ; i++){
var tag=mandatories[i].substr(4,3);
var subfield=mandatories[i].substr(17,1);
@@ -654,7 +654,7 @@ $(document).ready(function() {
window.close();
</script>
<!--TMPL_ELSE-->
- <form method="post" name="f" id="f" action="/cgi-bin/koha/cataloguing/addbiblio.pl" onsubmit="return Check();">
+ <form method="post" name="f" id="f" action="/cgi-bin/koha/cataloguing/addbiblio.pl">
<input type="hidden" value="0" id="confirm_not_duplicate" name="confirm_not_duplicate" />
<!-- /TMPL_IF -->
@@ -673,7 +673,7 @@ $(document).ready(function() {
// YUI Toolbar Functions
function yuiToolbar() {
- new YAHOO.widget.Button("addbiblio", { onclick: { fn: submitForm } });
+ new YAHOO.widget.Button("addbiblio", { onclick: { fn: Check } });
new YAHOO.widget.Button({
id: "z3950search",
type: "button",
@@ -687,7 +687,7 @@ $(document).ready(function() {
</script>
<ul class="toolbar">
- <li><input id="addbiblio" type="button" value="Save" /></li>
+ <li><input id="addbiblio" type="button" value="Save" onclick="Check()"/></li>
<li id="z3950searchc"><input type="button" id="z3950search" value="z39.50 Search" onclick="PopupZ3950(); return false;" /></li>
<li id="changeframework"><label for="Frameworks">Change framework: </label>
<select name="Frameworks" id="Frameworks" onchange="Changefwk(this);">
View
21 koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tmpl
@@ -34,15 +34,18 @@ function active(numlayer)
function Check(f) {
var total_errors=0;
-// alert(f.field_value.length);
- for (i=0 ; i<f.field_value.length ; i++) {
-// alert (f.field_value[i].value);
- if (f.field_value[i].value.length==0 && f.mandatory[i].value==1) {
- document.getElementById("error"+i).style.backgroundColor="#FF0000";
+ for (i=0 ; i<f.field_value_0.length ; i++) {
+ if (f.mandatory_0[i]) {
+ if (f.mandatory_0[i].value==1 && f.field_value_0[i].value.length==0) {
+ document.getElementById('error'+i).style.backgroundColor='#ff0000';
+ document.getElementById('error'+i).style.color='#ffffff';
total_errors++;
- } else {
-// document.getElementById("error"+i).style.backgroundColor="#FFFFFF";
- }
+ }
+ else {
+ document.getElementById('error'+i).style.backgroundColor='';
+ document.getElementById('error'+i).style.color='#000000';
+ }
+ }
}
var alertString2;
if (total_errors==0) {
@@ -63,7 +66,7 @@ function CheckMultipleAdd(f) {
}
}
function Dopop(link,i) {
- defaultvalue=document.forms[0].field_value[i].value;
+ defaultvalue=document.forms[0].field_value_0[i].value;
newin=window.open(link+"&result="+defaultvalue,"valuebuilder",'width=500,height=400,toolbar=false,scrollbars=yes');
}

0 comments on commit 2398baf

Please sign in to comment.
Something went wrong with that request. Please try again.