<!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->Koha -- 編目: 館藏的書目資料 <!-- TMPL_VAR name="biblionumber" --><!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
<!-- TMPL_INCLUDE NAME="masthead.inc" -->
<!-- TMPL_INCLUDE NAME="intranet-nav-brief.inc" -->

<div id="main">

<h1>館藏 <em><!-- TMPL_VAR name="title" --></em> <!-- TMPL_IF NAME="author" --> 依照 <!-- TMPL_VAR name="author" --><!-- /TMPL_IF --> (Record #<!-- TMPL_VAR NAME="biblionumber" -->)</h1>

		<div class="tabitem"><form action="/cgi-bin/koha/acqui.simple/addbiblio.pl" method="get"><input type="hidden" name="oldbiblionumber" value="<!-- TMPL_VAR name="biblionumber" -->"><input type="submit" class="submit" value="編輯書目記錄"></form></div> <div class="tabitem"><form action="/cgi-bin/koha/detail.pl" method="get"><input type="hidden" name="bib" value="<!-- TMPL_VAR name="biblionumber" -->"> <input type="submit" class="submit" value="目錄"></form> <form action="/cgi-bin/koha/MARCdetail.pl" method="get"><input type="hidden" name="bib" value="<!-- TMPL_VAR name="biblionumber" -->"> <input type="submit" class="submit" value="MARC"></form>  <form action="/cgi-bin/koha/ISBDdetail.pl" method="get"><input type="hidden" name="bib" value="<!-- TMPL_VAR name="biblionumber" -->"> <input type="submit" class="submit" value="ISBD"></form></div>

	<form method="post" action="additem.pl" name="f">
	<input type="hidden" name="op" value="<!-- TMPL_VAR NAME="op" -->" />
	<input type="hidden" name="bibid" value="<!-- TMPL_VAR NAME="bibid" -->">
	<!-- TMPL_IF name="item_loop" -->
			<div name="10XX" id="10XX">
			<table class="editing">
			<caption>存在的館藏</caption>
				<tr>
					<!-- TMPL_LOOP NAME="item_header_loop" -->
						<th>
							<!-- TMPL_VAR NAME="header_value" -->
						</th>
					<!-- /TMPL_LOOP -->
					<th colspan="2">&nbsp;</th>
				</tr>
					<!-- TMPL_LOOP NAME="item_loop" -->
					<tr>
						<!-- TMPL_VAR NAME="item_value" -->
							<!-- TMPL_IF Name="nomod" -->
							<td>&nbsp;</td>
							<td>&nbsp;</td>
						<!-- TMPL_ELSE -->
						<td><a href="additem.pl?op=edititem&amp;bibid=<!-- TMPL_VAR NAME="bibid" -->&amp;itemnum=<!-- TMPL_VAR NAME="itemnum" -->">編輯</a></td>
						<td><a href="javascript:confirm_deletion(<!-- TMPL_VAR NAME="bibid" -->,<!-- TMPL_VAR NAME="itemnum" -->)">刪除</a></td>
<!-- /TMPL_IF -->
					</tr>
					<!-- /TMPL_LOOP -->
			</table>
			</div>
<!-- /TMPL_IF -->	

<div class="data">
	<table>
	<!-- TMPL_IF name="opisadd" -->
		<caption>新增館藏</caption>
	<!-- TMPL_ELSE -->
		<caption>編輯館藏</caption>
	<!-- /TMPL_IF -->	
		<!-- TMPL_LOOP NAME="item" -->
			<tr>
					<th><label><!-- TMPL_VAR NAME="subfield" --> - <!-- TMPL_IF name="mandatory" --><b><!-- /TMPL_IF --><!-- TMPL_VAR NAME="marc_lib" --><!-- TMPL_IF name="mandatory" --> *</b><!-- /TMPL_IF --></label></th>
					<td><!-- TMPL_VAR NAME="marc_value" -->
					<input type="hidden" name="tag" value="<!-- TMPL_VAR NAME="tag" -->">
					<input type="hidden" name="subfield" value="<!-- TMPL_VAR NAME="subfield" -->">
					<input type="hidden" name="mandatory" value="<!-- TMPL_VAR NAME="mandatory" -->"></td>
		</tr>
		<!-- /tmpl_loop -->
		</table>
	<input type="hidden" name="itemnum" value="<!-- TMPL_VAR NAME="itemnum" -->">
	<!-- TMPL_IF name="barcode_not_unique" -->
		<div class="error"><b>錯誤 : 條碼 (Barcode) 已經存在 !<b></div>
	<!-- /TMPL_IF -->
	<!-- TMPL_IF name="opisadd" -->
	<input type="button" value="新增館藏" class="submit"  onClick="Check(this.form)" accesskey="w">
	<!-- TMPL_ELSE -->
	<input type="hidden" name="tag" value="<!-- TMPL_VAR NAME="itemtagfield" -->">
	<input type="hidden" name="subfield" value="<!-- TMPL_VAR NAME="itemtagsubfield" -->">
	<input type="hidden" name="field_value" value="<!-- TMPL_VAR NAME="itemnum" -->">
	<input type="button" value="儲存改變" class="submit" onClick="Check(this.form)" accesskey="w">
	<!-- /TMPL_IF -->
	</form>
</div>
<script language="JavaScript" type="text/javascript">
function _(s) { return s } // dummy function for gettext
function active(numlayer)
{
	for (i=10; i < 11 ; i++ ) {
		ong = i+"XX";
			link = "link"+i;
		if (numlayer==i) {
			document.getElementById(ong).style.visibility="visible";
			document.getElementById(link).style.backgroundColor="#11AA11";
			document.getElementById(link).style.backgroundImage="url(<!-- TMPL_VAR NAME="themelang" -->/images/background-mem.gif)";
		} else {
			document.getElementById(ong).style.visibility="hidden";
			document.getElementById(link).style.backgroundColor="#FFFFFF";
			document.getElementById(link).style.backgroundImage="";
		}
	}
}
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";
			total_errors++;
		} else {
//			document.getElementById("error"+i).style.backgroundColor="#FFFFFF";
		}
	}
	var alertString2;
	if (total_errors==0) {
		document.f.submit();
	} else {
		alertString2  = _("表格無法寄送，因為接下來的問題");
		alertString2 += "\n------------------------------------------------------------------------------------\n";
		alertString2 += "\n- "+ total_errors+_("必要欄位是空的 (請看粗體顯示的分欄)");
		alert(alertString2);
	}
}
function Dopop(link,i) {
	defaultvalue=document.forms['f'].field_value[i].value;
	newin=window.open(link+"&result="+defaultvalue,"value builder",'width=500,height=400,toolbar=false,scrollbars=yes');
}
function confirm_deletion(bibid,itemnum) {
	var is_confirmed = confirm(_('你確定要刪除館藏嗎？'));
	if (is_confirmed) {
	window.location = "additem.pl?op=delitem&bibid="+bibid+"&itemnum="+itemnum;
	}
}
</script>
<!-- TMPL_INCLUDE NAME="intranet-bottom.inc" -->
