Page MenuHomec4science

Test_BI.py.wml
No OneTemporary

File Metadata

Created
Tue, Nov 5, 02:53

Test_BI.py.wml

## $Id$
## This file is part of the CERN Document Server Software (CDSware).
## Copyright (C) 2002 CERN.
##
## The CDSware is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation; either version 2 of the
## License, or (at your option) any later version.
##
## The CDSware is distributed in the hope that it will be useful, but
## WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
## General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with CDSware; if not, write to the Free Software Foundation, Inc.,
## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
## read config variables:
#include "config.wml"
#include "configbis.wml"
## start Python:
<protect>## $Id$</protect>
<protect>## DO NOT EDIT THIS FILE! IT WAS AUTOMATICALLY GENERATED FROM CDSware WML SOURCES.</protect>
"""CDSware Submission Web Interface."""
## Description: function Test_BI
## This function checks whwther the Bibliographic Information
## has already been submitted or not (title file)
## Author: T.Baron
## PARAMETERS: titleFile: name of the file in which the title should be
## found
def Test_BI (parameters,curdir,form):
global doctype,access,act,dir
t=""
titleFile = parameters['titleFile']
if os.path.exists("%s/%s" % (curdir,titleFile)) and os.path.getsize("%s/%s" % (curdir,titleFile)) != 0:
foundTitle = 1
else:
foundTitle= 0
if foundTitle == 0:
res = run_sql("select dir from sbmACTION where sactname='SBI'")
sbidir = res[0][0]
t=t+"It is necessary to submit the bibliographic information for this document"
t=t+Request_Print("S", "</table>")
# output JavaScrit to auto reload return the user to the SBI page
t=t+"""
<BR><SCRIPT LANGUAGE="JavaScript1.1">
alert("Please complete Bibliographic Information first.");
document.forms[0].action = "Main.py";
document.forms[0].act.value = "SBI";
document.forms[0].curpage.value = 1;\n"""
t=t+" document.forms[0].fromdir.value = \"%s\";\n" % dir
t=t+" document.forms[0].indir.value = \"%s\";\n" % sbidir
t=t+"""
document.forms[0].submit();
</SCRIPT>"""
# THE SCRIPT STOPS EXECUTION AT THIS POINT
return t
</protect>

Event Timeline