"""Create an interface for the modification of a document, based on the fields that the user has
chosen to modify
"""
globalsysno,rn
t=""
# variables declaration
fieldname=parameters['fieldnameMBI']
# Path of file containing fields to modify
ifos.path.exists("%s/%s"%(curdir,fieldname)):
fp=open("%s/%s"%(curdir,fieldname),"r")
fieldstext=fp.read()
fp.close()
else:
raisefunctionError("cannot find fields to modify")
fieldstext=re.sub("\+","\n",fieldstext)
fields=fieldstext.split("\n")
#output some text
t=t+"<CENTER bgcolor=\"white\">The document <B>%s</B> has been found in the database.</CENTER><BR>Please modify the following fields:<BR>Then press the 'END' button at the bottom of the page<BR>\n"%rn
forfieldinfields:
subfield=""
value=""
marccode=""
text=""
# retrieve and display the modification text
t=t+"<FONT color=\"darkblue\">\n"
res=run_sql("SELECT modifytext FROM sbmFIELDDESC WHERE name=%s",(field,))
iflen(res)>0:
t=t+"<small>%s</small> </FONT>\n"%res[0][0]
# retrieve the marc code associated with the field
res=run_sql("SELECT marccode FROM sbmFIELDDESC WHERE name=%s",(field,))