function searchEvent() { $mySession = IMuConnect(); $terms = new IMuTerms(); $columns = array('SummaryData', 'image.resource{height:100,source:master}'); if (isset($_GET["name"])) { $terms->add('EveEventTitle', trim($_GET["name"])); } if (isset($_GET["evnum"])) { $terms->add('EveEventNumber', trim($_GET["evnum"])); } if (isset($_GET["irn"])) { $terms->add('irn', trim($_GET["irn"])); } $start = 0; if (isset($_GET["start"])) { $start = intval($_GET["start"]); } $number = 15; if (isset($_GET["n"])) { $number = intval($_GET["n"]); } $events = new IMuModule('eevents', $mySession); try { $hits = $events->findTerms($terms); $result = $events->fetch('start', $start, $number, $columns); $result = processResult($result); print json_encode($result); } catch (Exception $e) { var_dump($e); } }
function recordObject($irn) { $mySession = IMuConnect(); $terms = new IMuTerms(); $cat = new IMuModule('ecatalogue', $mySession); $columns = array('irn', 'Creator=CreCreatorRef_tab.(Name=NamFullName)', 'Role=CreRole_tab', 'AccNo=TitAccessionNo', 'Medium=PhyMediumComments', 'Title=TitMainTitle', 'Year=CreDateCreated', 'Location=LocCurrentLocationRef.(LocLocationName,LocBarcode)', 'Children=<ecatalogue:AssParentObjectRef>.(irn, AccNo=TitAccessionNo, Title=TitMainTitle, Location=LocCurrentLocationRef.(LocLocationName, LocBarcode), TitBarcode)', 'MesType=MesMeasurementType_tab', 'H=MesTotalInchFrac_tab', 'W=MesTotWidthInchFrac_tab', 'D=MesTotDepthInchFrac_tab', 'Barcode=TitBarcode', 'image.resource{height:300,source:master}', 'NotesA=ConHandlingInstructions', 'NotesB=InsInstallationNotes'); $terms->add('irn', trim($irn)); $start = 0; $number = 100; try { $hits = $cat->findTerms($terms); $result = $cat->fetch('start', $start, $number, $columns); $result = formatResults($result); createRecords($result); return $result; } catch (Exception $e) { throwError($e); } return null; }