circmod = sort_circmod
alldues = sort_alldues
try:
- callprefix = ''
- callsuffix = ''
- if len(callno) == 0:
- callno = callnum
-
- if prefix:
- callno = prefix + callno
- if suffix:
- callno = callno + suffix
- avail_here = stats.get(self.AVAILABLE, 0)
- avail_here += stats.get(self.RESHELVING, 0)
- anystatus_here = sum(stats.values())
- lib += anystatus_here
-
- # volume check - based on v.1, etc. in call number
- voltest = re.search(r'\w*v\.\s?(\d+)', callnum)
-
- # attachment test
- attachtest = re.search(self.IS_ATTACHMENT, callnum)
-
if loc in self.RESERVES_DESK_NAME:
+ callprefix = ''
+ callsuffix = ''
+ if len(callno) == 0:
+ callno = callnum
+
+ if prefix:
+ callno = prefix + callno
+ if suffix:
+ callno = callno + suffix
+ avail_here = stats.get(self.AVAILABLE, 0)
+ avail_here += stats.get(self.RESHELVING, 0)
+ anystatus_here = sum(stats.values())
+ lib += anystatus_here
+
+ # volume check - based on v.1, etc. in call number
+ voltest = re.search(r'\w*v\.\s?(\d+)', callnum)
+
+ # attachment test
+ attachtest = re.search(self.IS_ATTACHMENT, callnum)
+
desk += anystatus_here
avail += avail_here
dueinfo = ''
else:
callno = prefix + callnum + suffix
- # Another MassLNC variation, needs same refactoring as above
if version >= 2.1:
copyids = E1(OPENSRF_CN_CALL, bib_id, [prefix,callnum,suffix], org)
else:
barcode = ''
bibid = ''
is_barcode = re.search('\d{14}', query)
-
if query.startswith(self.OPAC_URL):
+ results = []
# query is an Evergreen URL
# snag the bibid at this point
- params = dict([x.split("=") for x in query.split("&")])
- for key in params.keys():
- if key.find('?r') != -1:
- bibid = params[key]
+ if "=" in query and "&" in query:
+ params = dict([x.split("=") for x in query.split("&")])
+ for key in params.keys():
+ if key.find('?r') != -1:
+ bibid = params[key]
+ results = M.marcxml_to_records(I.url_to_marcxml(query))
+ else:
+ # likely template opac
+ url_nums = [int(s) for s in query.split('/') if s.isdigit()]
+ if len(url_nums) > 0:
+ bib_id = url_nums[len(url_nums) - 1]
+ results = M.marcxml_to_records(self.bib_id_to_marcxml(bib_id))
- results = M.marcxml_to_records(I.url_to_marcxml(query))
numhits = len(results)
elif is_barcode:
results = []
codes and $u holds the URLs.
"""
# TODO: move this to local_settings
- LIBCODE = 'OWA' # Leddy
+ LIBCODE = 'OWA'
+ if hasattr(settings, 'EVERGREEN_LIBCODE'):
+ LIBCODE = settings.EVERGREEN_OPAC_URL
try:
dct = M.marcxml_to_dictionary(marc_string)
words = lambda string: re.findall(r'\S+', string)
DATABASE_HOST = '' # Set to empty string for localhost. Not used with sqlite3.
DATABASE_PORT = '' # Set to empty string for default. Not used with sqlite3.
+# changes in Django 1.4+ to this syntax:
+# DATABASES = {
+# 'default': {
+# 'ENGINE': 'django.db.backends.sqlite3',
+# 'NAME': '/home/tesseract/src/syrup/git/Syrup/conifer/db/syrup'
+# }
+# }
+
+
#----------------------------------------------------------------------
ADMINS = (
EVERGREEN_SERVER = 'www.concat.ca'
EVERGREEN_VERSION = 2.1
+EVERGREEN_LIBCODE = 'OWA'
# list of locations
RESERVES_DESK_NAME = ['Leddy: Course Reserves - Main Bldng - 1st Flr - Reserve Counter at Circulation Desk', 'Leddy: Reserves 2']
DATABASE_HOST = '' # Set to empty string for localhost. Not used with sqlite3.
DATABASE_PORT = '' # Set to empty string for default. Not used with sqlite3.
+# see local_settings.py.example for Django 1.4+ example
+
# Local time zone for this installation. Choices can be found here:
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
# although not all choices may be available on all operating systems.
# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
# trailing slash.
# Examples: "http://foo.com/media/", "/media/".
+
+# use STATIC_URL for Django 1.4+ and comment out ADMIN_MEDIA_PREFIX
+#STATIC_URL = '/syrup/djmedia/'
ADMIN_MEDIA_PREFIX = '/syrup/djmedia/'
# Make this unique, and don't share it with anybody.
'django.template.loaders.app_directories.load_template_source',
)
+# for Django 1.4+, use this
+#TEMPLATE_LOADERS = (
+# 'django.template.loaders.app_directories.Loader',
+# 'django.template.loaders.filesystem.Loader',
+#)
+
+
MIDDLEWARE_CLASSES = (
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.locale.LocaleMiddleware',
'babeldjango.middleware.LocaleMiddleware',
'django.middleware.transaction.TransactionMiddleware',
+ # uncomment this for Django 1.4+
+ # 'django.contrib.messages.middleware.MessageMiddleware',
)
ROOT_URLCONF = 'conifer.urls'
INSTALLED_APPS = [
'django.contrib.auth',
'django.contrib.contenttypes',
+ # uncomment this for Django 1.4+
+ # 'django.contrib.messages',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.admin',
return _access_denied(_('You are not an editor.'))
if gethook('get_better_copy_of_marc'):
+ print "pick"
pickitem_xml = callhook('get_better_copy_of_marc', raw_pickitem)
+ print "picked"
raw_pickitem = unicode(ET.tostring(pickitem_xml))
+ print "raw"
pickitem = marcxml_to_dictionary(pickitem_xml)
+ print "dict"
else:
pickitem = marcxml_to_dictionary(raw_pickitem)
dublin = marcxml_dictionary_to_dc(pickitem)
del data['author2']
[setattr(item, k, v) for (k,v) in data.items()]
+
+ suppress_option = request.POST.get('suppress_item')
+ # this is not always a problem but force just in case
+ if suppress_option is None:
+ item.suppress_item = False
+
if item.barcode and item.item_type == 'PHYS' and hasattr(settings, 'OPENSRF_STAFF_USERID'): # TODO: we need an explicit 'we do updates' flag
update_option = request.POST.get('update_option')
location_option = request.POST.get('location_option')
prefix_option = request.POST.get('orig_prefix')
callno_option = request.POST.get('orig_callno')
suffix_option = request.POST.get('orig_suffix')
- suppress_option = request.POST.get('suppress_item')
update_status = False
#only update the Catalogue