Exemplo n.º 1
0
def perform_get_holdings_information(recid,
                                     req,
                                     action="borrowal",
                                     ln=CFG_SITE_LANG):
    """
    Display all the copies of an item. If the parameter action is 'proposal', display
    appropriate information to the user.

    @param recid: identify the record. Primary key of bibrec.
    @type recid: int

    @param action: Specifies whether the current record is put up to solicit acquisition
    proposals(if "proposal") or not("borrowal").
    @type proposal: string

    @return body(html)
    """
    _ = gettext_set_language(ln)

    if action == "proposal":
        tag = AMZ_BOOK_PUBLICATION_DATE_TAG
        publication_date = record_get_field_value(get_record(recid),
                                                  tag[:3],
                                                  ind1=tag[3],
                                                  ind2=tag[4],
                                                  code=tag[5])
        msg = ''
        if publication_date:
            cur_date = datetime.date.today()
            try:
                pub_date = time.strptime(publication_date, '%d %b %Y')
                pub_date = datetime.date(pub_date[0], pub_date[1], pub_date[2])
                if cur_date < pub_date:
                    msg += _("The publication date of this book is %s.") % (
                        publication_date)
                    msg += "<br /><br />"
                else:
                    msg += _("This book has no copies in the library. ")
            except:
                msg += _("This book has no copies in the library. ")

        msg += _(
            "If you think this book is interesting, suggest it and tell us why you consider this \
                  book is important. The library will consider your opinion and if we decide to buy the \
                  book, we will issue a loan for you as soon as it arrives and send it by internal mail."
        )
        msg += "<br \><br \>"
        msg += _(
            "In case we decide not to buy the book, we will offer you an interlibrary loan"
        )

        body = bc_templates.tmpl_book_proposal_information(recid, msg, ln=ln)
    else:
        holdings_information = db.get_holdings_information(recid, False)
        body = bc_templates.tmpl_holdings_information(
            recid=recid, req=req, holdings_info=holdings_information, ln=ln)

    return body
Exemplo n.º 2
0
def perform_get_holdings_information(recid, req, action="borrowal", ln=CFG_SITE_LANG):
    """
    Display all the copies of an item. If the parameter action is 'proposal', display
    appropriate information to the user.

    @param recid: identify the record. Primary key of bibrec.
    @type recid: int

    @param action: Specifies whether the current record is put up to solicit acquisition
    proposals(if "proposal") or not("borrowal").
    @type proposal: string

    @return body(html)
    """
    _ = gettext_set_language(ln)

    if action == "proposal":
        tag = AMZ_BOOK_PUBLICATION_DATE_TAG
        publication_date = record_get_field_value(get_record(recid), tag[:3],
                                                  ind1=tag[3], ind2=tag[4],
                                                  code=tag[5])
        msg = ''
        if publication_date:
            cur_date = datetime.date.today()
            try:
                pub_date = time.strptime(publication_date, '%d %b %Y')
                pub_date = datetime.date(pub_date[0], pub_date[1], pub_date[2])
                if cur_date < pub_date:
                    msg += _("The publication date of this book is %s.") % (publication_date)
                    msg += "<br /><br />"
                else:
                    msg += _("This book has no copies in the library. ")
            except:
                msg += _("This book has no copies in the library. ")

        msg += _("If you think this book is interesting, suggest it and tell us why you consider this \
                  book is important. The library will consider your opinion and if we decide to buy the \
                  book, we will issue a loan for you as soon as it arrives and send it by internal mail.")
        msg += "<br \><br \>"
        msg += _("In case we decide not to buy the book, we will offer you an interlibrary loan")

        body = bc_templates.tmpl_book_proposal_information(recid, msg, ln=ln)
    else:
        holdings_information = db.get_holdings_information(recid, False)
        body = bc_templates.tmpl_holdings_information(recid=recid,
                                            req=req,
                                            holdings_info=holdings_information,
                                            ln=ln)

    return body
Exemplo n.º 3
0
def perform_get_holdings_information(recid, req, ln=CFG_SITE_LANG):
    """
    Display all the copies of an item.

    @param recid: identify the record. Primary key of bibrec.
    @type recid: int

    @return body(html)
    """

    holdings_information = db.get_holdings_information(recid)

    body = bibcirculation_templates.tmpl_holdings_information2(
        recid=recid, req=req, holdings_info=holdings_information, ln=ln)
    return body
Exemplo n.º 4
0
def perform_get_holdings_information(recid, req, ln=CFG_SITE_LANG):
    """
    Display all the copies of an item.

    @param recid: identify the record. Primary key of bibrec.
    @type recid: int

    @return body(html)
    """

    holdings_information = db.get_holdings_information(recid)

    body = bibcirculation_templates.tmpl_holdings_information2(
        recid=recid, req=req, holdings_info=holdings_information, ln=ln
    )
    return body