Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F79737927
Get_Info.php.wml
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Wed, Aug 28, 00:08
Size
4 KB
Mime Type
text/html
Expires
Fri, Aug 30, 00:08 (2 d)
Engine
blob
Format
Raw Data
Handle
20225757
Attached To
R3600 invenio-infoscience
Get_Info.php.wml
View Options
## $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.
<?
<protect>
## $Id$
## DO NOT EDIT THIS FILE! IT WAS AUTOMATICALLY GENERATED FROM CDSware WML SOURCES.
##
## Name: Get_Info.php
## Description: function Get_Info
## This function retrieves some bibliographic data (title,
## submitter email, author and sets global variables with
## the values, so that other functions may use them.
## Author: T.Baron
## PARAMETERS: authorFile: name of the file in which the author is stored
## emailFile: name of the file in which the email is stored
## titleFile: name of the file in which the title is stored
## OUTPUT: HTML
##
require_once ("${HTDOCSDIR}submit/MESS/functions/Retrieve_Data.php");
global $titlevalue,$emailvalue,$authorvalue;
function Get_Info($param_array,$MAINPATH)
{
global $doctypes,$URLPATH,$titlevalue,$emailvalue,$authorvalue;
$repno = $GLOBALS[VARS]->get_report_number();
$titlefile = $param_array["titleFile"];
$emailfile = $param_array["emailFile"];
$authorfile = $param_array["authorFile"];
if (!Get_Info_In_Pending($repno,$titlefile,$emailfile,$authorfile))
if (!Get_Info_In_DB($repno,$param_array,$MAINPATH))
DocumentNotFound($repno);
}
function Get_Info_In_Pending($repno,$titlefile,$emailfile,$authorfile)
{
global $STORAGE,$titlevalue,$emailvalue,$authorvalue,$doctype;
$PENDIR = "$STORAGE/pending/$doctype";
if (!is_dir("$PENDIR/$repno"))
return false;
else
{
if (file_exists("$PENDIR/$repno/$titlefile"))
{
$fp = fopen("$PENDIR/$repno/$titlefile","r");
$titlevalue = fread($fp,filesize("$PENDIR/$repno/$titlefile"));
fclose($fp);
}
else
$titlevalue = "";
if (file_exists("$PENDIR/$repno/$emailfile"))
{
$fp = fopen("$PENDIR/$repno/$emailfile","r");
$emailvalue = fread($fp,filesize("$PENDIR/$repno/$emailfile"));
fclose($fp);
}
else
$emailvalue = "";
if (file_exists("$PENDIR/$repno/$authorfile"))
{
$fp = fopen("$PENDIR/$repno/$authorfile","r");
$authorvalue = fread($fp,filesize("$PENDIR/$repno/$authorfile"));
fclose($fp);
}
else
$authorvalue = "";
if ($titlevalue == "")
$titlevalue = "-";
if ($emailvalue == "")
$emailvalue = "-";
if ($authorvalue == "")
$authorvalue = "-";
return true;
}
}
function Get_Info_In_DB($repno,$param_array,$MAINPATH)
{
global $titlevalue,$emailvalue,$authorvalue,$api_path,$sysno;
$sysno = $GLOBALS[VARS]->get_sysno();
if ($sysno != "")
{
$titlevalue = Get_Field('245__a',$sysno);
$emailvalue = Get_Field('8560_f',$sysno);
$authorvalue = Get_Field('100__a',$sysno);
$authorvalue .= Get_Field('700__a',$sysno);
#save result
$fp = fopen("$MAINPATH/SN","w+");
fwrite($fp,"$sysno");
fclose($fp);
return true;
}
else
{
return false;
}
}
function DocumentNotFound($repno)
{
global $URLPATH;
Request_Print("A", "
<SCRIPT>
document.forms[1].action=\"$URLPATH/Main.php\";
document.forms[1].page.value = 1;
document.forms[1].submit();
alert('The document $repno cannot be found in our database.\\nAnyway, you can still choose another document if you wish.');
</SCRIPT>");
// THE SCRIPT STOPS EXECUTION AT THIS POINT
exit;
}
</protect>
?>
Event Timeline
Log In to Comment