3 # grima.php - pass messages to grima minions, display usage 5 # (c) 2017 Kathryn Lybarger. CC-BY-SA 7 require_once(
"grima-setup.php");
9 require_once(
"grima-lib.php");
12 if(!headers_sent()) header(
"Location: $url");
13 $url_html = htmlspecialchars($url);
14 echo
"<!DOCTYPE html><html><head><title>Redirect</title><meta http-equiv=refresh content='1; url=$url'></head><body><a href='$url_html'>Go here: $url_html</a></body></html>\n";
18 $msg = isset($_REQUEST[
"msg"]) ? $_REQUEST[
"msg"] :
"";
23 if (preg_match(
"/^print( .*)/",
$msg,$m)) {
30 if (preg_match(
"/^hierarchy( .*)/",
$msg,$m)) {
31 do_redirect(
"hierarchy.php?mms_id=" . ltrim($m[1]));
35 # filter <mms_id> with <filter> 37 if (preg_match(
"/(norm|normalize|filter) (\d+) (with (.*))/",
$msg,$m)) {
38 if (is_mmsid($m[2])) {
39 do_redirect(
"zf.php?mms_id=" . $m[2] .
"&filter=" . $m[4]);
46 # add mfhd <template> to <mms_id> 49 if (preg_match(
"/^add mfhd(.*)/",
$msg,$m)) {
54 # add tree <template> to <mms_id> with barcode <barcode> 59 # insert oclcnum <number> into <mms_id> 61 if (preg_match(
"/insert oclcnum(.*)/",
$msg,$m)) {
62 do_redirect(
"insert-oclcnum.php?query=" . urlencode(ltrim($m[1])));
66 # overlay <mms_id> with <oclcnum> 67 # maybe more direct, but needs both APIs 71 # unmerge phys/electronic 75 # combine multiple bib/mfhd/item chains 82 <div
class=
'panel panel-default bib'>
83 <div
class=
'panel-heading'>
84 <h1
class=
'panel-title'>Print Record</h1>
86 <div
class=
'panel-body'>
87 <dl
class=
'dl-horizontal'>
88 <form method=
'post' action=
'print.php'>
90 <input name=
'mms_id' size=
'20'/>
91 <input type=
'submit' value=
'submit' />
97 <div
class=
'panel panel-default bib'>
98 <div
class=
'panel-heading'>
99 <h1
class=
'panel-title'>View Hierarchy</h1>
101 <div
class=
'panel-body'>
102 <dl
class=
'dl-horizontal'>
103 <form method=
'post' action=
'hierarchy.php'>
105 <input name=
'mms_id' size=
'20'/>
106 <input type=
'submit' value=
'submit' />
112 <div
class=
'panel panel-default bib'>
113 <div
class=
'panel-heading'>
114 <h1
class=
'panel-title'>
115 <span
class=
'titleproper'>Insert OCLC Number</span>
118 <div
class=
'panel-body'>
119 <dl
class=
'dl-horizontal'>
120 <form method=
'post' action=
'insert-oclcnum.php'>
121 <p>Insert oclcnum <input name=
'oclcnum' size=
'15' /> into
122 <input name=
'mms_id' size=
'20'/>
123 <input type=
'submit' value=
'submit' />