Skip to content

Commit

Permalink
Merge pull request #39 from hgq/07_02_pt11414367_1_02
Browse files Browse the repository at this point in the history
07 02 pt11414367 1 02
  • Loading branch information
ctfliblime committed Jul 1, 2011
2 parents d50007e + 5b8554a commit 2398baf
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 13 deletions.
3 changes: 3 additions & 0 deletions cataloguing/additem.pl
Expand Up @@ -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");
Expand Down
Expand Up @@ -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);
Expand Down Expand Up @@ -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 -->

Expand All @@ -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",
Expand All @@ -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);">
Expand Down
21 changes: 12 additions & 9 deletions koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tmpl
Expand Up @@ -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) {
Expand All @@ -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');
}

Expand Down

0 comments on commit 2398baf

Please sign in to comment.