+ All Categories
Home > Documents > Enhancements, Customizations, and Workarounds Bob Trotter University System of Georgia Developer...

Enhancements, Customizations, and Workarounds Bob Trotter University System of Georgia Developer...

Date post: 04-Jan-2016
Category:
Upload: leslie-russell
View: 215 times
Download: 0 times
Share this document with a friend
22
Enhancements, Customizations, and Workarounds Bob Trotter University System of Georgia Developer Meets Developer February 1 – 2, 2010
Transcript
Page 1: Enhancements, Customizations, and Workarounds Bob Trotter University System of Georgia Developer Meets Developer February 1 – 2, 2010.

Enhancements, Customizations, and Workarounds

Bob TrotterUniversity System of GeorgiaDeveloper Meets Developer

February 1 – 2, 2010

Page 2: Enhancements, Customizations, and Workarounds Bob Trotter University System of Georgia Developer Meets Developer February 1 – 2, 2010.

Discovery Tool Enhancements

• Redesigned Holdings / Status extraction• Added 85x/86x translation• Implemented Journal Title search• Renew Web Service

Page 3: Enhancements, Customizations, and Workarounds Bob Trotter University System of Georgia Developer Meets Developer February 1 – 2, 2010.

Holdings / Status Extraction

select md.mfhd_id, md.seqnum, l.location_display_name, md.record_segment, mm.display_call_no, mm.suppress_in_opac from mfhd_data md, bib_mfhd bm, mfhd_master mm, location l where bm.bib_id = $id and md.mfhd_id = bm.mfhd_id and mm.mfhd_id = bm.mfhd_id and mm.suppress_in_opac <> 'Y' and l.location_id = mm.location_id order by l.location_display_name, md.mfhd_id, md.seqnum

while ($md = $stM->fetch(PDO::FETCH_ASSOC)) { if ($md['SUPPRESS_IN_OPAC'] <> 'Y') { if ($first) { $omid = $md['MFHD_ID']; $first = 0; } $mid = $md['MFHD_ID']; if ($omid != $mid) { $holdings[$i]['items'] = procItems($old_mid); $holdings[$i]['hold] = procHold($omid,$mdata); $holdings[$i]['loc'] = htmlentities($locn); $holdings[$i]['callno'] = $callno; $old_mid = $mid; $mdata = ''; $i++; } $locn = $md['LOCATION_DISPLAY_NAME']; $mdata .= $md['RECORD_SEGMENT']; $callno = $md['DISPLAY_CALL_NO']; }}

Page 4: Enhancements, Customizations, and Workarounds Bob Trotter University System of Georgia Developer Meets Developer February 1 – 2, 2010.

Holdings Data

• We try to get everything Webvoyage displays– Notes from 852– Summary – 866– Supplement Summary 867– Indexes Summary 868– Marc Holdings data 85x/86x pairs

Page 5: Enhancements, Customizations, and Workarounds Bob Trotter University System of Georgia Developer Meets Developer February 1 – 2, 2010.

Code for 85x/86x pairs//****************************************// Get MARC Holdings data// Get 85x/86x pairs - rwt//****************************************$sfs = array('a', 'b', 'c', 'i', 'j', 'k', 'u', 'v', 'w', 'x', 'z');$mon =

array('01'=>'Jan.','02'=>'Feb.','03'=>'Mar.','04'=>'Apr.','05'=>'May','06'=>'Jun.','07'=>'Jul.','08'=>'Aug.','09'=>'Sep.','10'=>'Oct.','11'=>'Nov.','12'=>'Dec.');

$tag_arr = array('853'=>'863','854'=>'864','855'=>'865');while (list($pat,$dat) = each($tag_arr)) {$f = 0;$hd = array();$fields = $record->getFields($pat);foreach ($fields as $field) { if ($subfield = $field->getSubfield('8')) { $d8 = explode('.', $subfield->getData()); $d853['link'] = $d8[0]; foreach ($sfs as $sf) { if ($subfield = $field->getSubfield($sf)) { $d853[$sf] = $subfield->getData(); if ($sf == '8') { $d853['link'] = explode('.', $d853[$sf]); } } } }

Page 6: Enhancements, Customizations, and Workarounds Bob Trotter University System of Georgia Developer Meets Developer February 1 – 2, 2010.

Code for 85x/86x pairs$fields_86x = $record->getFields($dat); foreach ($fields_86x as $field_86x) { $d863 = array(); if ($subfield = $field_86x->getSubfield('8')) { $d = explode('.', $subfield->getData()); $d863['link'] = $d[0]; if ($d863['link'] == $d853['link']) { $d863['seq'] = $d[1]; reset($sfs); foreach ($sfs as $sf) { if ($subfield = $field_86x->getSubfield($sf)) { $d863[$sf] = $subfield->getData(); } } $hd[$f] = ''; if (isset($d863['a'])) { if (preg_match("/-/", $d863['a'])) { $th = explode('-', $d863['a']); $hd[$f] = $d853['a'].' '.$th[0].' - '.$d853['a'].' '.$th[1].' '; } else { $hd[$f] = $d853['a'].' '.$d863['a'].' '; else { $hd[$f] = $d853['a'].' '.$d863['a'].' '; } }

Page 7: Enhancements, Customizations, and Workarounds Bob Trotter University System of Georgia Developer Meets Developer February 1 – 2, 2010.

Code for 85x/86x pairs if (isset($d863['b'])) $hd[$f] .= ', '.$d853['b'].' '.$d863['b'].' '; if (isset($d863['c'])) $hd[$f] .= ', '.$d853['c'].' '.$d863['c'].' '; if (isset($d863['i'])) { if (preg_match("/^\(/", $d853['i'])) { $hd[$f] .= '('.$d863['i']; } if (isset($d863['j'])) { $th = explode('-', $d863['j']); $m1 = $mon[$th[0]]; $m2 = $mon[$th[1]]; if (isset($d853['k']) && isset($d863['k'])) { $dh = explode('-', $d863['k']); $m1 .= ':'.$dh[0]; $m2 .= ':'.$dh[1]; } $hd[$f] .= ':'.$m1; if ($m2 != '') $hd[$f] .= ' - '.$m2; } $hd[$f] .= ')'; } } } $f++; }}if ($f > 0) $holding[$dat] = $hd;}

Page 8: Enhancements, Customizations, and Workarounds Bob Trotter University System of Georgia Developer Meets Developer February 1 – 2, 2010.

Holdings display

Page 9: Enhancements, Customizations, and Workarounds Bob Trotter University System of Georgia Developer Meets Developer February 1 – 2, 2010.

Renew Web Service

• On Checked Out list, we include all Local and UB charges

• Had to be able to Renew item from any UB institution

<input type=checkbox name=rida[0] value="2776166,local,54100"><input type=checkbox name=rida[1] value="42943,BAINDB20010316224456,32917">

<input type=checkbox name=rida[2] value="312886,GASOUTHDB20010803230231,139002">

Page 10: Enhancements, Customizations, and Workarounds Bob Trotter University System of Georgia Developer Meets Developer February 1 – 2, 2010.

Renew Web Service

• Library.ini[BAINDB20010316224456]host=gil1.uga.edudb=pw=nm=Bainbridge Collegeport=1521gfurl=wsport=7114

[GASOUTHDB20010803230231]host=gil2.uga.edudb=pw=nm=Georgia Southern Universityport=1521gfurl=http://gilfind.georgiasouthern.eduwsport=10014

[UGADB20010316230258]host=gil4.uga.edudb=pw=nm=University of Georgia 20port=1521gfurl=http://gilfind.uga.eduwsport=7014

Page 11: Enhancements, Customizations, and Workarounds Bob Trotter University System of Georgia Developer Meets Developer February 1 – 2, 2010.

Renew Web Service

• Renew Code$dbArray = parse_ini_file('/vufind/library.ini',true);…foreach($_POST['rida'] as $item) { list($iId[$i],$iInst[$i],$patid[$i]) = explode(',',$item); if ($iInst[$i] == 'local') { $iInst[$i] = $patronHomeUbId; } $wsport[$i] = $dbArray[$iInst[$i]]['wsport']; $wshost[$i] = $dbArray[$iInst[$i]]['host'];}…for ($j=0;$j<$i;$j++) { $hst = $wshost[$j]; $prt = $wsport[$j]; $url = "http://$hst:$prt/$app/$svc"; $nst = '1@' . $iInst[$j];

$client->setUrl($url); $message = "<?xml version=\"1.0\" encoding=\"UTF-8\"?> …

Page 12: Enhancements, Customizations, and Workarounds Bob Trotter University System of Georgia Developer Meets Developer February 1 – 2, 2010.

Renew Web Service

• Renew Code cont.

$client->clearPostData();header('Content-type: text/xml');$client->setBody($message);

$res = $client->sendRequest();$response = $client->getResponseBody();

if ((substr(trim($response), 0, 5) == '<?xml') || (substr(trim($response), 0, 2) == ‘<r’)) { $unxml = new XML_Unserializer(); $response = $unxml->unserialize($response); $data = $unxml->getUnserializedData();

$itemid = $iId[$j]; $inst = $iInst[$j]; if ($inst == $patronHomeUbId) $inst = 'local'; if (isset($data['ser:serviceData']['myac:messages']['myac:message'])) { $emsg = $data['ser:serviceData']['myac:messages']['myac:message']; $ren_stat[$inst][$itemid]['message'] = $emsg; $ren_stat[$inst][$itemid]['status'] = 'Not Renewed'; } else { $ren_stat[$inst][$itemid]['message'] = ''; $ren_stat[$inst][$itemid]['status'] = 'Renewed'; } $unxml = '';}

Page 13: Enhancements, Customizations, and Workarounds Bob Trotter University System of Georgia Developer Meets Developer February 1 – 2, 2010.

Renew Web Service

• Results

Page 14: Enhancements, Customizations, and Workarounds Bob Trotter University System of Georgia Developer Meets Developer February 1 – 2, 2010.

Implementing Patron PINs

• Populated Patron tables (33) with 5 digit randomly generated numbers.

• Modified Logon page of Classic Webvoyage to link to ‘Get My PIN’ function.

Page 15: Enhancements, Customizations, and Workarounds Bob Trotter University System of Georgia Developer Meets Developer February 1 – 2, 2010.

Implementing Patron PINs

Page 16: Enhancements, Customizations, and Workarounds Bob Trotter University System of Georgia Developer Meets Developer February 1 – 2, 2010.

Implementing Patron PINs

• Opac.ini

• Header.htm

[Logon_Page]…ResetButton=Reset"><span id="inx"></span><script>addText4();</script><p id="xx…

function addText4() { var txt = document.createElement('text'); txt.innerHTML = '<center><div style="padding-top: 5px;"><b><a href="" onClick="getPIN(logonpage);return false;">Get My PIN</a></b></div></center>'; var rnode = document.getElementById('inx'); rnode.parentNode.appendChild(txt); }

function getPIN(f) { f.action = '/getPIN.php'; f.submit(); }

Page 17: Enhancements, Customizations, and Workarounds Bob Trotter University System of Georgia Developer Meets Developer February 1 – 2, 2010.

• Due to Bug in UC, it will accept any valid PIN.

Page 18: Enhancements, Customizations, and Workarounds Bob Trotter University System of Georgia Developer Meets Developer February 1 – 2, 2010.

Implementing Patron PINs

• Opac.ini

• Header.htm

[Logon_Page]…SubmitButton=Logon to My Account" ONCLICK="checkPIN(this.form)"><b id="yy

function checkPIN(f) { Syntax checking from Webvoyage script copied here…. var xhttp=new XMLHttpRequest(); var dbk = f.HLIB.value; var ntyp = f.LGNT.value; var bc = f.BC.value; var ln = f.LN.value; var pin = f.PIN.value; var url = "https://giluc.usg.edu/validatePIN.php?dbk=" + escape(dbk) + "&ntyp=" + ntyp + "&bc=" + bc + "&ln=" + ln + "&pin=" + pin; xhttp.open("GET",url,false); xhttp.send(""); var xmltxt=xhttp.responseText; if (xmltxt == 'failed') { alert("The PIN entered does not match your current PIN."); f.elements[4].value = ""; f.elements[3].select(); f.elements[3].focus(); return; } // All is well. Submit form. f.submit(); }

Page 19: Enhancements, Customizations, and Workarounds Bob Trotter University System of Georgia Developer Meets Developer February 1 – 2, 2010.

Implementing Patron PINs• Codes (0,1,2) for Number Type dropdown changed with

order displayed.

Page 20: Enhancements, Customizations, and Workarounds Bob Trotter University System of Georgia Developer Meets Developer February 1 – 2, 2010.

Implementing Patron PINs

• In both getPIN.php and validatePIN.php, had to read opac.ini to check [Login Types] stanza for order of number types.

[Login Types]

BC=Enter Your Patron Barcode/Library ID from Home Library

#SSN=Enter Your Social Security Number

IID=Enter Your Institution ID from Home Institution

Page 21: Enhancements, Customizations, and Workarounds Bob Trotter University System of Georgia Developer Meets Developer February 1 – 2, 2010.

• Typical [Logon_Page] stanza

[Logon_Page]Background=/images/blank.gifText=000000BGCOLOR=FFFFFFLINK=VLINK=ALINK=SubmitButton=LogonResetButton=Reset"><span id="inx"></span><script>addText4();</script><p id="xxHomeLibrary=<script>addText2();</script>LastName=</span><b>Last Name:PIN=<script>addText();</script>DefaultCluster=CLUSTER1

Page 22: Enhancements, Customizations, and Workarounds Bob Trotter University System of Georgia Developer Meets Developer February 1 – 2, 2010.

Questions?

• gil.usg.edu – GIL Project Homepage• giluc.usg.edu – GIL Universal Catalog• [email protected] - My email


Recommended