OPAC record fixes
authorAdam Dickmeiss <adam@indexdata.dk>
Wed, 30 Jul 2003 08:57:34 +0000 (08:57 +0000)
committerAdam Dickmeiss <adam@indexdata.dk>
Wed, 30 Jul 2003 08:57:34 +0000 (08:57 +0000)
debian/changelog
zutil/opacdisp.c

index 2e1348b..9bb71e2 100644 (file)
@@ -1,3 +1,9 @@
+yaz (2.0.3-5) unstable; urgency=low
+
+  * OPAC record fixes.
+
+ -- Adam Dickmeiss <adam@indexdata.dk>  Wed, 30 Jul 2003 10:56:34 +0200
+
 yaz (2.0.3-4) unstable; urgency=low
 
   * More ZOOM logging.
index aefe98d..8f29c33 100644 (file)
@@ -2,7 +2,7 @@
  * Copyright (c) 2003, Index Data.
  * See the file LICENSE for details.
  *
- * $Id: opacdisp.c,v 1.2 2003-07-14 12:59:23 adam Exp $
+ * $Id: opacdisp.c,v 1.3 2003-07-30 08:57:35 adam Exp $
  */
 
 #include <stdio.h>
@@ -31,12 +31,16 @@ static void opac_element_str(WRBUF wrbuf, int l, const char *elem,
 
 static void opac_element_bool(WRBUF wrbuf, int l, const char *elem, int *data)
 {
-    if (data && *data)
+    if (data)
     {
        while (--l >= 0)
            wrbuf_puts(wrbuf, " ");
        wrbuf_puts(wrbuf, "<");
        wrbuf_puts(wrbuf, elem);
+       if (*data)
+            wrbuf_puts(wrbuf, " value=\"1\"");
+       else
+            wrbuf_puts(wrbuf, " value=\"0\"");
        wrbuf_puts(wrbuf, "/>\n");
     }
 }
@@ -110,9 +114,9 @@ void yaz_display_OPAC(WRBUF wrbuf, Z_OPACRecord *r, int flags)
                                      d->circulationData[j]->restrictions);
                    opac_element_str (wrbuf, 4, "itemId",
                                      d->circulationData[j]->itemId);
-                   opac_element_bool (wrbuf, 4, "renewable: %d\n",
+                   opac_element_bool (wrbuf, 4, "renewable",
                                       d->circulationData[j]->renewable);
-                   opac_element_bool (wrbuf, 4, "onHold: %d\n",
+                   opac_element_bool (wrbuf, 4, "onHold",
                                       d->circulationData[j]->onHold);
                    opac_element_str (wrbuf, 4, "enumAndChron",
                                      d->circulationData[j]->enumAndChron);