forked from opendream/hotri
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbiblio_copy_edit_form.php
154 lines (139 loc) · 5.3 KB
/
biblio_copy_edit_form.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
<?php
/* This file is part of a copyrighted work; it is distributed with NO WARRANTY.
* See the file COPYRIGHT.html for more details.
*/
require_once("../shared/common.php");
session_cache_limiter(null);
$tab = "cataloging";
$nav = "editcopy";
$helpPage = "biblioCopyEdit";
$focus_form_name = "editCopyForm";
$focus_form_field = "barcodeNmbr";
require_once("../functions/inputFuncs.php");
require_once("../shared/logincheck.php");
require_once("../classes/BiblioCopy.php");
require_once("../classes/BiblioCopyQuery.php");
require_once("../functions/errorFuncs.php");
require_once("../classes/Localize.php");
$loc = new Localize(OBIB_LOCALE,$tab);
#****************************************************************************
#* Retrieving get var
#****************************************************************************
if (isset($_GET["bibid"])){
unset($_SESSION["postVars"]);
unset($_SESSION["pageErrors"]);
#****************************************************************************
#* Retrieving get var
#****************************************************************************
$bibid = $_GET["bibid"];
$copyid = $_GET["copyid"];
#****************************************************************************
#* Read copy information
#****************************************************************************
$copyQ = new BiblioCopyQuery();
$copyQ->connect();
if ($copyQ->errorOccurred()) {
$copyQ->close();
displayErrorPage($copyQ);
}
if (!$copy = $copyQ->doQuery($bibid,$copyid)) {
$copyQ->close();
displayErrorPage($copyQ);
}
$postVars["bibid"] = $bibid;
$postVars["copyid"] = $copyid;
$postVars["barcodeNmbr"] = $copy->getBarcodeNmbr();
$postVars["copyDesc"] = $copy->getCopyDesc();
$postVars["statusCd"] = $copy->getStatusCd();
} else {
#**************************************************************************
#* load up post vars
#**************************************************************************
require("../shared/get_form_vars.php");
$bibid = $postVars["bibid"];
$copyid = $postVars["copyid"];
}
#**************************************************************************
#* disable status code drop down for shelving cart and out status codes
#**************************************************************************
$statusDisabled = FALSE;
if (($postVars["statusCd"] == OBIB_STATUS_SHELVING_CART) or ($postVars["statusCd"] == OBIB_STATUS_OUT)) {
$statusDisabled = TRUE;
}
require_once("../shared/header.php");
?>
<font class="small">
<?php echo $loc->getText("catalogFootnote",array("symbol"=>"*")); ?>
</font>
<form name="editCopyForm" method="POST" action="../catalog/biblio_copy_edit.php">
<table class="primary">
<tr>
<th colspan="2" nowrap="yes" align="left">
<?php echo $loc->getText("biblioCopyEditFormLabel"); ?>:
</th>
</tr>
<tr>
<td nowrap="true" class="primary" valign="top">
<sup>*</sup> <?php echo $loc->getText("biblioCopyNewBarcode"); ?>:
</td>
<td valign="top" class="primary">
<?php printInputText("barcodeNmbr",20,20,$postVars,$pageErrors); ?>
</td>
</tr>
<tr>
<td nowrap="true" class="primary" valign="top">
<?php echo $loc->getText("biblioCopyNewDesc"); ?>:
</td>
<td valign="top" class="primary">
<?php printInputText("copyDesc",40,40,$postVars,$pageErrors); ?>
</td>
</tr>
<tr>
<td nowrap="true" class="primary" valign="top">
<?php echo $loc->getText("biblioCopyEditFormStatus"); ?>:
</td>
<td valign="top" class="primary">
<?php
#**************************************************************************
#* only show status codes for valid transitions
#**************************************************************************
$dmQ = new DmQuery();
$dmQ->connect();
$dms = $dmQ->get("biblio_status_dm");
$dmQ->close();
echo "<select name=\"statusCd\"";
if ($disabled) {
echo " disabled";
}
echo ">\n";
foreach ($dms as $dm) {
#**************************************************************************
#* tranisitions to out, hold, and shelving cart are not allowed
#**************************************************************************
if (($dm->getCode() != OBIB_STATUS_OUT)
and ($dm->getCode() != OBIB_STATUS_ON_HOLD)
and ($dm->getCode() != OBIB_STATUS_SHELVING_CART)) {
echo "<option value=\"".H($dm->getCode())."\"";
if (($postVars["statusCd"] == "") && ($dm->getDefaultFlg() == 'Y')) {
echo " selected";
} elseif ($postVars["statusCd"] == $dm->getCode()) {
echo " selected";
}
echo ">".H($dm->getDescription())."</option>\n";
}
}
echo "</select>\n";
?>
</td>
</tr>
<tr>
<td align="center" colspan="2" class="primary">
<input type="submit" value="<?php echo $loc->getText("catalogSubmit"); ?>" class="button">
<input type="button" onClick="self.location='../shared/biblio_view.php?bibid=<?php echo HURL($bibid); ?>'" value="<?php echo $loc->getText("catalogCancel"); ?>" class="button" >
</td>
</tr>
</table>
<input type="hidden" name="bibid" value="<?php echo H($bibid);?>">
<input type="hidden" name="copyid" value="<?php echo H($copyid);?>">
</form>
<?php include("../shared/footer.php"); ?>