On 20.07.2012 09:39, Irene Buettner wrote:

Hi!

the most appropriate way to edit records for users is via the
[...]
link to the details page if and only if the user has the necessary
rights. This basically jumps to modify passing on the required record ID
you need for MBI.

this is exactly what I have on my todo list for my users.

Nice to hear that we invented something usefull :)

I tried about
a year ago but did not manage it. Since I am not a programming expert
but just the admin... would you share you solution?

Sure. We're discussing with CERN at the moment anyway how to move the
results of our still ongoing project to the general code base. Anyway,
what you want to construct is an URL that looks like this:

http://juser.fz-juelich.de/submit/direct?sub=MBInotes&rn=FZJ-2012-00078&step=1

So to tell it apart: you have the base url, you need the document type
of your submission or the modify mask you want to use (in the case above
"notes") and you need the "record number" not to be confused with the
record-ID. Finally, we do not want to show the selection dialogue for
fields, so we just jump through it by adding a "step=1".

So, in usual websubmit, everything is already there except the mask type
you used for submission. In our websubmit process we store this
information to 336 7_, ie the marc field for document types. In the case
above this looks like this:

3367_ $0PUB:(DE-HGF)22
      $2PUB:(DE-HGF)
      $aNotes
      $bnotes
      $mnotes
      $s1342602275_8765

So we can read it from the $m subfield. The rest is the quite easy, you
just need to collect the URL

--------------------------------------------------------------------------

    submissionid   = ''
    m037a          = bfo.fields('037__a')
    doctypes       = bfo.fields('3367_')

    # The doctype for modify should be
    for docdef in doctypes:
      if 's' in docdef:
        doctype = docdef['m']

    marc037a     = m037a[0]

    sub     = "sub=MBI"+doctype
    recRN   = 'rn=' + marc037a

    link = baseurl + '?' + sub + '&' + recRN + '&step=1'
    out += create_html_link(link,
           {},
           link_label = "Modify This Record",
           linkattrd=linkattrd)

    return out

--------------------------------------------------------------------------

Put this in a pythonic format element and just add it to
Default_HTML_actions.bft and you're done.

I can also give you our full bfe_modifylnk.py, but it contains some
stuff related to "who is allowed to edit this record", as we trigger the
return to be "" or the link depending on the user. This makes it a bit
more complex to understand. The above is, however, basically all you need.

--

Kind regards,

Alexander Wagner
Subject Specialist
Central Library
52425 Juelich

mail : [email protected]
phone: +49 2461 61-1586
Fax  : +49 2461 61-6103
www.fz-juelich.de/zb/DE/zb-fi


------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------
Forschungszentrum Juelich GmbH
52425 Juelich
Sitz der Gesellschaft: Juelich
Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498
Vorsitzender des Aufsichtsrats: MinDir Dr. Karl Eugen Huthmacher
Geschaeftsfuehrung: Prof. Dr. Achim Bachem (Vorsitzender),
Karsten Beneke (stellv. Vorsitzender), Prof. Dr.-Ing. Harald Bolt,
Prof. Dr. Sebastian M. Schmidt
------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------

Kennen Sie schon unseren neuen Film? http://www.fz-juelich.de/film
Kennen Sie schon unsere app? http://www.fz-juelich.de/app

Reply via email to