The goal would be to somehow limit a search for items so that only "available" ones are shown.

Some strategies:
* Mass-loading (manual?) of availability info.
* Pinging the OPAC (crawl?) and check for availability.

Also, we could think of "available" as "available online" and not just physically. So items with the correct 856 records could be automatically marked as always available...

CommentFileSizeAuthor
#5 millennium-605826-5.png120.75 KBjanusman

Comments

janusman’s picture

Now that availability is fetched during crawls or manual import, we could tag the nodes then.

How to tag?
- simple "is available": Flag.module? Taxonomy term?
- availability using the location from the holdings table; each location is a taxonomy term. On refresh, remove all terms then only add those that are "available".

I like the 2nd best, but Will It Scale? =)

janusman’s picture

Re: Tagging items as "Available online"... See http://roytennant.com/proto/856 and the articles cited there to see some tested methods. It seems the method "007/0 = 'c'" might was the most reliable in the case of Worldcat-extracted records.

janusman’s picture

Thinking that using a tax. term as a location available should, in the long run, allow terms to have parent terms (in order to group them somehow).

As for the actual code, testing this for storing the item availability:

/**
 * Gets the current holdings information for a recnum and converts it to
 * taxonomy terms added to the given node object.
 */
function millennium_add_availability_to_node(&$nodeobject, $recnum) {
  $holdings = millennium_get_holdings_info($recnum);
  #dpm($holdings);
  $locations_available = array();
  foreach ($holdings as $item) {
    if ($item['status'] == "DISPONIBLE") { // TODO
      $locations_available[$item['location']] = $item['location'];
    }
  }
  
  // Add taxonomy
  $location_names = array_keys($locations_available);
  sort($location_names);
  millennium_add_node_taxonomy_terms($nodeobject, variable_get('millennium_availability_vid', -1) , $location_names);
}

... and this function would be called inside millennium_marc_to_nodeobject() right after millennium_add_taxonomy_to_node(). Since millennium_get_holdings_info() is statically cached, this works quite well when doing batch imports.

janusman’s picture

The above code would need the admin to tell the module what strings to accept as "Available" (in the status column in the holdings table). For instance, our OPAC shows them as the spanish word "DISPONIBLE".

Besides the word's translation, it might also be desirable to show items as "available" when the status is something else, like: "just checked in", "in stacks", etc.

janusman’s picture

Status: Active » Fixed
StatusFileSize
new120.75 KB

The above function was committed along with others in #576784: An option to use b-identifiers as an alternative.

The end result is that you can associate a vocabulary with the found item locations in each bib record's holdings.
For instance if your item says it's available in location "General Stacks" and "Reserves", then those two locations get added to the vocabulary (if they don't exist yet) and then associated to the node.

Note: the location term is only added when more or more items for that bib is shown "AVAILABLE".

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.