Example #1
0
        register_exception(req=req)
        return e.user_box()
    except InvenioWebJournalNoCurrentIssueError, e:
        register_exception(req=req)
        return e.user_box()
    except InvenioWebJournalIssueNumberBadlyFormedError, e:
        register_exception(req=req)
        return e.user_box()

    auth = acc_authorize_action(getUid(req), 'cfgwebjournal',
                                name="%s" % journal_name)
    if auth[0] == 0:
        return page(title=confirmed_p and _("Issue regenerated") or _("Regenerate Issue"),
                    body=wjn.perform_regenerate_issue(ln=ln,
                                                      journal_name=journal_name,
                                                      issue=issue,
                                                      confirmed_p=confirmed_p,
                                                      publish_draft_articles_p=publish_draft_articles_p),
                    uid=uid,
                    language=ln,
                    req=req,
                    navtrail = navtrail_previous_links,
                    lastupdated=__lastupdated__)
    else:
        return page_not_authorized(req=req, text=auth[1], navtrail=navtrail_previous_links)

def issue_control(req, journal_name="", issue=[],
                  ln=CFG_SITE_LANG, action="cfg"):
    """
    Page that allows full control over creating, backtracing, adding to,
    removing from issues.
    except InvenioWebJournalNoNameError, e:
        register_exception(req=req)
        return e.user_box()
    except InvenioWebJournalNoCurrentIssueError, e:
        register_exception(req=req)
        return e.user_box()
    except InvenioWebJournalIssueNumberBadlyFormedError, e:
        register_exception(req=req)
        return e.user_box()

    auth = acc_authorize_action(getUid(req), 'cfgwebjournal',
                                name="%s" % journal_name)
    if auth[0] == 0:
        return page(title=_("Issue regenerated"),
                    body=wjn.perform_regenerate_issue(ln=ln,
                                                      journal_name=journal_name,
                                                      issue=issue),
                    uid=uid,
                    language=ln,
                    req=req,
                    navtrail = navtrail_previous_links,
                    lastupdated=__lastupdated__)
    else:
        return page_not_authorized(req=req, text=auth[1], navtrail=navtrail_previous_links)

def issue_control(req, journal_name="", issue=[],
                  ln=CFG_SITE_LANG, action="cfg"):
    """
    Page that allows full control over creating, backtracing, adding to,
    removing from issues.
    """
    except InvenioWebJournalNoNameError, e:
        register_exception(req=req)
        return e.user_box()
    except InvenioWebJournalNoCurrentIssueError, e:
        register_exception(req=req)
        return e.user_box()
    except InvenioWebJournalIssueNumberBadlyFormedError, e:
        register_exception(req=req)
        return e.user_box()

    auth = acc_authorize_action(getUid(req),
                                'cfgwebjournal',
                                name="%s" % journal_name)
    if auth[0] == 0:
        return page(title=_("Issue regenerated"),
                    body=wjn.perform_regenerate_issue(
                        ln=ln, journal_name=journal_name, issue=issue),
                    uid=uid,
                    language=ln,
                    req=req,
                    navtrail=navtrail_previous_links,
                    lastupdated=__lastupdated__)
    else:
        return page_not_authorized(req=req,
                                   text=auth[1],
                                   navtrail=navtrail_previous_links)


def issue_control(req,
                  journal_name="",
                  issue=[],
                  ln=CFG_SITE_LANG,