Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F81494764
viewEditSubmissionEDS.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
Fri, Sep 6, 09:07
Size
62 KB
Mime Type
text/x-c
Expires
Sun, Sep 8, 09:07 (2 d)
Engine
blob
Format
Raw Data
Handle
20584969
Attached To
R3600 invenio-infoscience
viewEditSubmissionEDS.php.wml
View Options
## $Id$
## This file is part of the CERN Document Server Software (CDSware).
## Copyright (C) 2002, 2003, 2004, 2005, 2006 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.
<?
require("commonPhpFunctions.php");
?>
#include "cdspage.wml" \
title="Submission Pages of <protect><?print "$subname";?></protect>" \
navtrail_previous_links="<a class=navtrail href=<WEBURL>/admin/<lang:star: index.*.html>>_(Admin Area)_</a> > <a class=navtrail href=<WEBURL>/admin/websubmit/>_(WebSubmit Administration)_</a>" \
navbar_name="admin" \
navbar_select="websubmit"
<?
<protect>
## $Id$
## DO NOT EDIT THIS FILE! IT WAS AUTOMATICALLY GENERATED FROM CDSware WML SOURCES.
?>
<SCRIPT LANGUAGE="JavaScript">
<!-- hide
function checkRequired(param)
// This is a function to ensure that the user enters the required
// parameter for the action.
{
// If the field is left blank by the user...
if((param == "") || ((param.toUpperCase() != "Y") &&
(param.toUpperCase() != "N") && (param.toUpperCase() != "O")))
{ // Alert them, and return false.
alert("You must enter a value of Y, N, or O in the displayed field.");
return false;
} // End if
else // If displayed has been filled by the user...
{
return true;
} // End else
} // End function checkRequired(param)<
function verifyChanges(curLevel, sugLevel, curButtonorder, sugButtonorder,
curStatustext, sugStatustext)
// Function to test whether the values for the parameters to be changed
// have actually been changed by the user when they submit them to the
// database for update. If not, the function returns false. If so, the
// function returns true.
{
if(((curLevel == sugLevel) || (sugLevel == curLevel.toLowerCase())) &&
(curButtonorder == sugButtonorder) &&
(curStatustext == sugStatustext))
{
alert("No Change In The Data Has Been Made! Cannot Submit.");
return false;
} // End if
else
{
return true;
} // End else
} // End function verifyChanges()
// -->
</SCRIPT>
<?php
/*********************Function Descriptions***************************/
function displayEDSsubDetsForm($subname, $doctype)
{
/*******************************************************************
This function has the task of actually creating the main page
that shows the details of a submission. It conducts the query,
and from this data, builds an HTML form containing the details of
the given submission type. The user can then alter these details
as they see fit. Links to the pages that the submission is
composed of are also provided. The user can follow these links
to see the details of each of these pages.
*******************************************************************/
global $IMAGES;
// Execute a select query top get the data for the given submission
$queryResult = mysql_query("SELECT * FROM sbmIMPLEMENT WHERE subname ="
. " '$subname'");
if($queryResult)
{
if(mysql_num_rows($queryResult) == 1)
{
// Now, display a quick set of page instructions for the user..
print("<TABLE WIDTH=\"90%\" BGCOLOR=\"#D3DCE3\" ALIGN=\"center\" "
. "CELLSPACING=0 CELLPADDING=0 BORDER=1>\n<TR><TD "
. "ALIGN=\"center\">\n<P STYLE=\"color: blue; text-align: "
. "center; font-size: small; font-weight: bold\">Shown below,"
. " are the details of the \"$subname\" EDS submission.<BR>"
. "Each page number is a link that when clicked, allows you "
. " to further view and or edit the details of that page.<BR>"
. "<BR><BR>It is "
. "also possible to add another page to this submission. "
. "Click \"ADD PAGE\" to do this.</P>\n"
. "</TD>\n</TR>\n</TABLE>\n");
drawSeparator();
print("<FORM ACTION=\"viewEditSubmissionEDS.php\" METHOD=\"post\""
. ">\n<INPUT TYPE=\"hidden\" NAME=\"update\" VALUE=\"true\">\n"
. "<INPUT TYPE=\"hidden\" NAME=\"doctype\" VALUE=\"$doctype\">"
. "<TABLE BORDER=1 CELLSPACING=0 CELLPADDING=0 ALIGN=\"center"
. "\" WIDTH=\"100%\">\n");
// Now make the table: names & fields...
// Get a list of the columns in the sbmIMPLEMENT table...
$columns = mysql_list_fields(DOCS_DATABASE, "sbmIMPLEMENT");
$numTblFlds = mysql_num_fields($columns);
$dataRow = mysql_fetch_array($queryResult);
// Before we display most of the table, we can first display
// the upper part of the table, which will contain fields
// should be seen, but not be modifiable
print("<TABLE WIDTH=\"100%\" ALIGN=\"center\" CELLSPACING=0 "
. "CELLPADDING=0 BORDER=0>\n<TR>\n<TH BGCOLOR=\"#D3DCE3\" ALIGN"
. "=\"right\" WIDTH=\"20%\">\nSubmission Code: </TH>\n<TD "
. "ALIGN=\"left\" BGCOLOR=\"#FFFFCC\" WIDTH=\"80%\"><INPUT "
. "TYPE=\"readonly\" NAME=\"subname\" VALUE=\""
. $dataRow["subname"] . "\">\n</TD>\n</TR>\n<TR>\n<TH "
. "BGCOLOR=\"#D3DCE3\" ALIGN=\"right\" WIDTH=\"20%\">\nNumber of "
. "Pages: </TH>\n<TD WIDTH=\"80%\" ALIGN=\"left\" BGCOLOR="
. "\"#FFFFCC\"><INPUT TYPE=\"readonly\" NAME=\"nbpg\" VALUE=\""
. $dataRow["nbpg"] . "\">\n</TD>\n</TR>\n<TR>\n<TH "
. "BGCOLOR=\"#D3DCE3\" ALIGN=\"right\" WIDTH=\"20%\">\nCreation "
. "Date: </TH>\n<TD WIDTH=\"80%\" ALIGN=\"left\" BGCOLOR="
. "\"#FFFFCC\"><INPUT TYPE=\"readonly\" NAME=\"cd\" VALUE=\""
. $dataRow["cd"] . "\">\n</TD>\n</TR>\n<TR>\n<TH WIDTH=\"20%\""
. " BGCOLOR=\"#D3DCE3\" ALIGN=\"right\">\nModification "
. "Date: </TH>\n<TD WIDTH=\"80%\" ALIGN=\"left\" "
. "BGCOLOR=\"#FFFFCC\"><INPUT TYPE=\"readonly\" NAME=\"md\" "
. "VALUE=\"" . $dataRow["md"] . "\">\n</TD>\n</TR>\n");
for($indx = 0; $indx < $numTblFlds; $indx++)
{
$currentField = mysql_field_name($columns, $indx);
} // END for
// Now add the list of pages
print("<TR>\n<TH BGCOLOR=\"#87CEFA\" ALIGN=\"right\" WIDTH=\"20%\">"
. "\nSubmission Pages: </TH>\n<TD ALIGN=\"left\" WIDTH="
. "\"80%\" BGCOLOR=\"#FFFFCC\">\n");
print("<TABLE BORDER=0 ALIGN=\"left\" CELLPADDING=0 CELLSPACING"
. "=0><TR>");
for($count = 1; $count <= $dataRow["nbpg"]; $count++)
{
print("<TD ALIGN=\"center\">[<A HREF=\"pageDetsEDS.php?subna"
. "me=" . $dataRow["subname"] . "&pageNumber=$count&nPgs="
. $dataRow["nbpg"] . "&doctype=$doctype\">"
. $dataRow["subname"] . " Page $count</A>] </TD>");
} // END for
print("</TR>\n<TR>\n");
// Now add "move a page higher in the order" and "move a page
// lower in the order" buttons
for($count = 1; $count <= $dataRow["nbpg"]; $count++)
{
print("<TD ALIGN=\"center\"><TABLE BORDER=0 CELLSPACING=0 "
. "CELLPADDING=0 ALIGN=\"center\"><TR><TD ALIGN=\"center\">");
// Test to see if this is the first page or the last page.
// If so, then we must only print an image <IMG> of an
// arrow, as opposed to an <A><IMG></A> arrow, as we don't
// want the page to be moved beyond the page 1, or page x
// (at the end) boundaries.
// Add the "left" arrow
if($count == 1)
{
print("<IMG SRC=\"".$IMAGES."/forbidden_left.gif\" ALT=\""
. "Unable To Increase Page Order Weighting: Already "
. "First Page!\" HEIGHT=14 WIDTH=14>");
}
else
{
print("<A HREF=\"viewEditSubmissionEDS.php?doctype="
. "$doctype&pageNumber=$count&nPgs=" . $dataRow["nbpg"]
. "&subname=" . $dataRow["subname"] . "&pageLeft=true'"
. " onClick=\"if(confirm('Taking this action will move "
. "a page and all of its elements one page sooner in "
. "the page order sequence.\\nAre you sure you want to "
. "do this?')) { return true; } else { return false; "
. "}\"><IMG BORDER=0 SRC=\"".$IMAGES."/left.gif\" ALT=\"Incre"
. "ase Page Weighting Order\" HEIGHT=14 WIDTH=14>"
. "</A>");
}
print("</TD><TD ALIGN=\"center\">");
// Add the "right" arrow
if($count == $dataRow["nbpg"])
{
print("<IMG SRC=\"".$IMAGES."/forbidden_right.gif\" ALT=\""
. "Unable To Decrease Page Order Weighting: Already "
. "Last Page!\" HEIGHT=14 WIDTH=14>");
}
else
{
print("<A HREF=\"viewEditSubmissionEDS.php?doctype="
. "$doctype&pageNumber=$count&nPgs=" . $dataRow["nbpg"]
. "&subname=" . $dataRow["subname"] . "&pageRight=true'"
. " onClick=\"if(confirm('Taking this action will move "
. "a page and all of its elements one page later in the"
. " page order sequence.\\nAre you sure you want to do "
. "this?')) { return true; } else { return false; }\">"
. "<IMG BORDER=0 SRC=\"".$IMAGES."/right.gif\" ALT=\"Decreas"
. "e Page Weighting Order\" HEIGHT=14 WIDTH=14></A>");
}
print("</TD></TR></TABLE></TD>\n");
}
print("</TR>\n<TR>\n");
// Now add a delete button for each page of the submission
for($count = 1; $count <= $dataRow["nbpg"]; $count++)
{
print("<TD ALIGN=\"center\"><A HREF=\"viewEditSubmissionEDS."
. "php?doctype=$doctype&pageNumber=$count&nPgs="
. $dataRow["nbpg"] . "&subname=" . $dataRow["subname"]
. "&deletePage=true' onClick=\"if(confirm('Warning: Taking"
. " this action will delete this submission page and all "
. "of the elements on it.\\nThis action is irreversable!"
. "\\nAre you sure you want to do this?'))"
. "{ return true; } else { return false; }\"><IMAGE "
. "SRC=\"".$IMAGES."/answer_bad.gif\" BORDER=0 WIDTH=12 HEIGHT="
. "12 ALT=\"Delete Page And All Elements\"></A></TD>");
}
print("</TR>\n</TABLE>");
print(" </TD>\n</TR>\n</TABLE>\n</TABLE>\n");
print("<TABLE ALIGN=\"center\" CELLSPACING=2 CELLPADDING=0 "
. "BORDER=0><TR><TD ALIGN=\"center\"></TD></FORM>"
. "<FORM ACTION=\"viewEditSubmissionEDS.php\" METHOD=\"post\">"
. "<INPUT TYPE=\"hidden\" NAME=\"nPgs\" VALUE=\""
. $dataRow["nbpg"] . "\">"
. "<INPUT TYPE=\"hidden\" NAME=\"addPage\" VALUE=\"true\"><INPUT "
. "TYPE=\"hidden\" NAME=\"subname\" VALUE=\"$subname\"><INPUT TYPE="
. "\"hidden\" NAME=\"doctype\" VALUE=\"$doctype\"><TD><INPUT "
. "TYPE=\"button\" VALUE=\"ADD A PAGE\" onClick=\"if(confirm('Are"
. " You Certain You Wish To Add Another Page To This "
. "Submission?')) { submit(); } else { return false; }\">"
. "</TD></FORM><FORM ACTION=\"documentEDS.php\" METHOD=\"post\">"
. "<INPUT TYPE=\"hidden\" NAME=\"doctype\" VALUE=\"$doctype\"><TD>"
. "<INPUT TYPE=\"button\" VALUE=\"FINISHED\" onClick=\"submit();"
. "\"></TD></FORM></TR></TABLE>");
}
elseif(mysql_num_rows($queryResult) > 1)
{
// too many rows in the result set. This
// indicates some sort of key duplication in the sbmIMPLEMENT
// table.
print("<P CLASS=\"errorMsg\"><SPAN STYLE=\"color: red\">"
. "ERROR:</SPAN> More "
. "than one row of data concerning the <EM>$subname</EM> "
. "action was returned from the <EM>sbmIMPLEMENT</EM> table of "
. "the" . DOCS_DATABASE . " database.<BR>This indicates "
. "primary key duplication in this table.<BR>Please inform "
. "system administrator.</P>\n");
// warn admin
$msgTxt = "When a user attempted to look further into the "
. "details of the $subname submission using the EDS "
. "Administrator, several rows were returned for this "
. "submission from the sbmIMPLEMENT table."
. " The query was made using the \"subname\" as the search"
. " key. As the \"subname\" field is the primary key for "
. "the sbmIMPLEMENT table, this means that there must be key "
. "violations in this table.\n\nThis problem should be "
. "corrected immediately.\n\nWebSubmit Administrator (";
$msgTxt .= makeDate();
$msgTxt .= ")";
mail(ADMIN_EMAIL, "sbmIMPLEMENT Table Key Violation!", $msgTxt,
"From: WebSubmit_Administrator");
}
elseif(mysql_num_rows($queryResult) == 0)
{
// no rows returned
print("<P CLASS=\"errorMsg\"><SPAN STYLE=\"color: red\">"
. "ERROR:</SPAN> No data concerning the <EM>$subname</EM> "
. "submission was found in the <EM>sbmIMPLEMENT</EM> table.<BR>"
. "This suggests a data consistency error in the "
. DOCS_DATABASE . " database.<BR>Please inform the system "
. "administrator.</P>\n");
// warn admin
$msgTxt = "When a user attempted to look further into the "
. "details of the $subname submission using the EDS "
. "Administrator, no rows were returned from the sbmIMPLEMENT "
. "table for this submission.\n\nBecause the user had to "
. "click a link to view the details of this submission, it "
. "must be referred to in other tables of EDS. This suggests"
. " that there are data inconsistencies within EDS.\n\nThis "
. "should be investigated and corrected ASAP.\n\nEDS "
. "Administrator (";
$msgTxt .= makeDate();
$msgTxt .= ")";
mail(ADMIN_EMAIL, "Possible Data Inconsistency Error!",
$msgTxt, "From: WebSubmit_Administrator");
}
else
{
print("<P CLASS=\"errorMsg\"><SPAN STYLE=\"color: red\">"
. "ERROR:</SPAN> Unable to correctly retrieve data from the "
. "<EM>sbmIMPLEMENT</EM> table of " . DOCS_DATABASE
. ".<BR>Please inform system administrator.</P>\n");
}
}
else
{
print("<P CLASS=\"errorMsg\"><SPAN STYLE=\"color: red\">ERROR:"
. "</SPAN> Unable to query the <EM>sbmIMPLEMENT</EM> table.<BR>"
. "Please inform system administrator.</P>\n");
}
} // END function displayEDSsubDetsForm($subname, $doctype)
//**************
function moveSubPage($doctype, $pageNumber, $nPgs, $subname,
$page2move2)
{
/*****************************************************************
This function has the task of moving a page either to the left,
or to the right, depending upon which direction button the user
has pressed for the movement. The function is passed a variable
$page2move2, which holds the value of the page that the current
page is to be moved to. This must always be either $pageNumber
+ 1, or $pageNumber - 1. This is important, and the way that I
have written this script will only call this function in the
correct manner. This function should not be used for swapping
pages that are separated by other pages, as that should not be
done. If a page is ever to be moved to a location several pages
away, the other pages should be displaced like dominos into the
position to fill the gap!
This function saves a lot of code duplication, as there are many
errors that could happen during the execution of a page movement.
Some of these errors could be rather serious, and so it is
necessary to give both the user amd the system administrator a
detailed explanation of what has happened in each case. This
means big error message sections.
In the EDS database, there is no such entity as a "submission
page". Instead, there are elements, which have a page number and
a submission name. This means that when we move a page, we must
first move all of the elements on it to a temporary page. In
this case, the chosen temporary page number is 0. Next, all
elements on the page whose position our page is being moved to
are given a page number of that of the page that we are moving.
Finally, all of the elements with a page number of 0 are given a
page number of the position that we wanted to move the page to.
This is how this function works - a simple "swap" algorithm.
In the even of an error occurring, the function attempts to put
everything back to the way it was when it started the movement.
Of course this may not be possible. The function gives error
message feedback at all stages possible, letting the admin/user
know whether or not recovery succeeded etc, or where it failed,
and offers suggestions on how to correct the problems.
*****************************************************************/
// Get the current date for the "md" field...
$modifiedDate = makeEDSmdDate();
// Make a query string to set the 'pagenb' field of all elements on
// the current page to '0' (zero). Done as a temporary measure for
// swapping pages around.
$qStr1 = "UPDATE sbmFIELD SET pagenb = '0' WHERE subname = '$subname'"
. " AND pagenb = '$pageNumber'";
$qRes1 = mysql_query($qStr1);
if($qRes1)
{
// Set the value of the pagenb field for all elements of the page
// before the page to be moved to have a pagenb value of the
// current page (that which we are moving).
$qStr2 = "UPDATE sbmFIELD SET pagenb = '$pageNumber', md = '"
. "$modifiedDate' WHERE subname = '$subname' AND pagenb = '"
. "$page2move2'";
$qRes2 = mysql_query($qStr2);
if($qRes2)
{
// have moved all elements of the page that was before the page we are moving
// to effectively be in the place of the page that we are
// moving. i.e. the page before it now sits in its place.
// Now make a query string to move the elements that are on
// "page zero" to their final position...
$qStr3 = "UPDATE sbmFIELD SET pagenb = '$page2move2"
. "', md = '$modifiedDate' WHERE subname = '$subname' AND "
. "pagenb = '0'";
$qRes3 = mysql_query($qStr3);
if($qRes3)
{
// we should now have fully switched our pages around. We
// should now update the md field of the submission in
// sbmIMPLEMENT, and the doctype in sbmDOCTYPE...
$mdResult = mysql_query("UPDATE sbmIMPLEMENT SET md = "
. "'$modifiedDate' WHERE subname = '$subname'");
if($mdResult)
{
mysql_free_result($mdResult);
}
else
{
// The update the date query failed
print("<SCRIPT LANGUAGE=\"JavaScript\">alert('Error: "
. "Couldn't update the md in sbmIMPLEMENT!');</SCRIPT>\n");
}
// We must also modify the md field of the doctype record to
// which this submission belongs
updateEDSDOCTYPEmd($doctype, $modifiedDate);
}
else
{
// Failure. Attempt to recover by moving things back to their
// original positions:
$majorRecoveryStr1 = "UPDATE sbmFIELD SET pagenb = '"
. "$page2move2' WHERE subname = '$subname' AND "
. "pagenb = '$pageNumber'";
$majorRecoveryRes1 = mysql_query($majorRecoveryStr1);
if($majorRecoveryRes1)
{
// first step recovered. Now attempt to return
// the elements on page 0 to their original page...
$majorRecoveryStr2 = "UPDATE sbmFIELD SET pagenb = '"
. "$pageNumber' WHERE subname = '$subname' AND pagenb ="
. " '0'";
$majorRecoveryRes2 = mysql_query($majorRecoveryStr2);
if($majorRecoveryRes2)
{
// completely recovered
print("<SCRIPT TYPE=\"text/javascript\">\nalert('An "
. "error occurred when an attempt was made to move "
. "the requested submission page.\\nWhen a "
. "submission page is moved, all of "
. "the elements on the page to be moved are given a"
. " temporary page number of 0.\\nThe elements of "
. "the page whose position it is to be moved to are"
. " then given a page number of the current page\\n"
. "and then the elements with a page number of 0 are"
. " then given a page number of the page that they "
. "are to be moved to.\\n\\nWhen this page movent "
. "was carried out however, the elements of page to"
. " be moved were moved to\\npage 0 without trouble."
. " The elements of the page whose position the "
. "page to be moved to was to be moved to\\nwere "
. "moved to the position of the page to be moved "
. "without any problem.\\nHowever, when an attempt "
. "was made to move the elements of the temporary "
. "page 0\\nto their new location, this was not "
. "possible.\\n\\nTo rectify this situation, an "
. "attempt was made to return the elements that were"
. " moved to page $pageNumber\\nback to page "
. "$page2move2, which suceeded. An attempt"
. " was then made to move all elements from\\nthe "
. "temporary page 0 back to page $pageNumber (the "
. "page on which they were originally positioned)."
. "\\nThis attempt succeeded.\\n\\nThis means that "
. "the $subname submission should appear as if it "
. "were never changed.\\nYou should however ensure "
. "that the pages of this submission are "
. "un-corrupted by checking each page manually.\\n"
. "\\nYou should inform the system administrator of "
. "this problem.');\n</SCRIPT>\n");
// email the administrator
$msgTxt = "A major problem has ocurred with the data"
. " for the $subname submission. An attempt was "
. "made to move page $pageNumber to another position"
. ".\n\nWhen a page is moved, all of the elements on"
. " the page to be moved are given a temporary page "
. "number of 0. The elements of the page whose "
. "position it is to be moved to are then given a "
. "page number of the current page and then the "
. "elements with a page number of 0 are then given a"
. " page number of the page that they are to be "
. "moved to.\n\nWhen this page movent was carried "
. "out for page $pageNumber however, the "
. "elements of page to be moved were moved to page 0"
. " without trouble. The elements of the page whose"
. "position page $pageNumber was to be moved to were"
. " moved to the position of page $pageNumber "
. "without any problem. However, when an attempt "
. "was made to move the elements of the temporary "
. "page 0 to their new location, this was not "
. "possible.\n\nTo rectify this situation, an "
. "attempt was made to return the "
. "elements that were moved to page $pageNumber back"
. " to page $page2move2, which suceeded. "
. " When an attempt was made to move the elements of"
. " the temporary page 0 back to page $pageNumber, "
. "this also succeeded.\n\nThis all means that the "
. "submission SHOULD look as though it were never "
. "altered, and the pages should appear as normal, "
. "as the system correction of the problem appears "
. "to have succeeded. However, you should manually"
. " check this submission to ensure that this is the"
. " case, as it is possible that some elements from "
. "the pages may have been lost.\n\nEDS "
. "Administrator (";
$msgTxt .= makeDate();
$msgTxt .= ")";
mail(ADMIN_EMAIL, "$subname Submission Page Movement"
. " Error", $msgTxt, "From: WebSubmit_Administrator");
}
else
{
// Couldnt return our page 0 elements to their original page
print("<SCRIPT TYPE=\"text/javascript\">\nalert('ERROR"
. ": A major problem has ocurred with the data for "
. "this submission.\\nWhen a page is moved, all of "
. "the elements on the page to be moved are given a"
. " temporary page number of 0.\\nThe elements of "
. "the page whose position it is to be moved to are"
. " then given a page number of the current page\\n"
. "and then the elements with a page number of 0 are"
. " then given a page number of the page that they "
. "are to be moved to.\\n\\nWhen this page movent "
. "was carried out however, the elements of page to"
. " be moved were moved to\\npage 0 without trouble."
. " The elements of the page whose position the "
. "page to be moved to was to be moved to\\nwere "
. "moved to the position of the page to be moved "
. "without any problem.\\nHowever, when an attempt "
. "was made to move the elements of the temporary "
. "page 0\\nto their new location, this was not "
. "possible.\\n\\nTo rectify this situation, an "
. "attempt was made to return the elements that were"
. " moved to page $pageNumber\\nback to page "
. "$page2move2, which suceeded. When an "
. " attempt was made to move the elements of the "
. "temporary page 0 back to page $pageNumber,\\nthis"
. " failed, therefore the elements that were "
. "origionally on page $pageNumber before the move "
. "was attempted\\nare now sitting on the temporary"
. " page 0. This means that when an attempt is made "
. "to view the elements of page $pageNumber,\\nthere"
. " will be nothing there.\\n\\nPlease inform the "
. "system administrator of this problem immediately "
. "so that it can be corrected.');\n</SCRIPT>\n");
$msgTxt = "A major problem has ocurred with the data"
. " for the $subname submission. An attempt was "
. "made to move page $pageNumber to another position"
. ".\n\nWhen a page is moved, all of the elements on"
. " the page to be moved are given a temporary page "
. "number of 0. The elements of the page whose "
. "position it is to be moved to are then given a "
. "page number of the current page and then the "
. "elements with a page number of 0 are then given a"
. " page number of the page that they are to be "
. "moved to.\n\nWhen this page movent was carried "
. "out for page $pageNumber however, the "
. "elements of page to be moved were moved to page 0"
. " without trouble. The elements of the page whose"
. "position page $pageNumber was to be moved to were"
. " moved to the position of page $pageNumber "
. "without any problem. However, when an attempt "
. "was made to move the elements of the temporary "
. "page 0 to their new location, this was not "
. "possible.\n\nTo rectify this situation, an "
. "attempt was made to return the "
. "elements that were moved to page $pageNumber back"
. " to page $page2move2, which suceeded. "
. " When an attempt was made to move the elements of"
. " the temporary page 0 back to page $pageNumber, "
. "this failed, therefore the elements that were "
. "origionally on page $pageNumber before the move "
. "was attempted are now sitting on the temporary "
. "page 0.\n\nYou can probably correct this problem "
. "by using the following query. However, you "
. "should investigate first, as this is only a "
. "suggestion.\n\nUPDATE sbmFIELD SET pagenb = '"
. "$pageNumber' WHERE pagenb = '0' AND subname = '"
. "$subname';\n\nWebSubmit Administrator (";
$msgTxt .= makeDate();
$msgTxt .= ")";
mail(ADMIN_EMAIL, "$subname Submission Page Movement"
. " Error", $msgTxt, "From: WebSubmit_Administrator");
}
}
else
{
// could not recover from error
print("<SCRIPT TYPE=\"text/javascript\">\nalert('ERROR: "
. "A major problem has ocurred with the data for "
. "this submission.\\nWhen a page is moved, all of "
. "the elements on the page to be moved are given a"
. " temporary page number of 0.\\nThe elements of "
. "the page whose position it is to be moved to are"
. " then given a page number of the current page\\n"
. "and then the elements with a page number of 0 are"
. " then given a page number of the page that they "
. "are to be moved to.\\n\\nWhen this page movent "
. "was carried out however, the elements of page to"
. " be moved were moved to\\npage 0 without trouble."
. " The elements of the page whose position the "
. "page to be moved to was to be moved to\\nwere "
. "moved to the position of the page to be moved "
. "without any problem.\\nHowever, when an attempt "
. "was made to move the elements of the temporary "
. "page 0\\nto their new location, this was not "
. "possible.\\n\\nTo rectify this situation, an "
. "attempt was made to return the elements that were"
. " moved to page $pageNumber\\nback to page "
. "$page2move2.\\nThis attempt failed, "
. "which meant that the elements on page 0 could not"
. " be moved to page $pageNumber\\nas there are "
. "already elements belonging to another page on "
. "there.\\n\\nThe system can do no more to fix this"
. " problem, and you should contact the system "
. "administrator immediately\\nto ensure that this "
. "situation is rectified.');\n</SCRIPT>\n");
$msgTxt = "A major problem has ocurred with the data"
. " for the $subname submission. An attempt was "
. "made to move page $pageNumber to another position"
. ".\n\nWhen a page is moved, all of the elements on"
. " the page to be moved are given a temporary page "
. "number of 0. The elements of the page whose "
. "position it is to be moved to are then given a "
. "page number of the current page and then the "
. "elements with a page number of 0 are then given a"
. " page number of the page that they are to be "
. "moved to.\n\nWhen this page movent was carried "
. "out for page $pageNumber however, the "
. "elements of page to be moved were moved to page 0"
. " without trouble. The elements of the page whose"
. "position page $pageNumber was to be moved to were"
. " moved to the position of page $pageNumber "
. "without any problem. However, when an attempt "
. "was made to move the elements of the temporary "
. "page 0 to their new location, this was not "
. "possible.\n\nTo rectify this situation, an "
. "attempt was made to return the "
. "elements that were moved to page $pageNumber back"
. " to page $page2move2. This however"
. " failed, which meant that the elements on page 0 "
. "had to remain on page 0.\n\nThis means that there"
. " is a situation where by the elements that belong"
. " on page $pageNumber are now on page 0, and the "
. "elements that belong on page $page2move2"
. " are now on page $pageNumber.\n\nYou should "
. "ensure that this situation is corrected ASAP.\n\n"
. "WebSubmit Administrator (";
$msgTxt .= makeDate();
$msgTxt .= ")";
mail(ADMIN_EMAIL, "$subname Submission Page Movement "
. "Error", $msgTxt, "From: WebSubmit_Administrator");
}
}
}
else
{
// have altered the current pages
// elements to be on page zero, but can't seem to alter the
// position of the elements on the page before current
// page. put back our page zero elements to
// the current page, and leave the whole
// thing unchenged.
$errorCorrect = mysql_query("UPDATE sbmFIELD SET pagenb = '"
. "$pageNumber' WHERE subname = '$subname' AND pagenb = '"
. "0'");
if($errorCorrect)
{
print("<SCRIPT TYPE=\"text/javascript\">\nalert('ERROR: It"
. " was not possible to move the elements of the page that"
. "\\nwhose position page $pageNumber is to be moved to."
. "\\nThis has meant that it is not possible to move page "
. "$pageNumber.\\n\\nPlease inform the system "
. "administrator of this problem.');\n</SCRIPT>\n");
}
else
{
// failed to recover
print("<SCRIPT TYPE=\"text/javascript\">\nalert('ERROR: A "
. "major problem has ocurred with the data for this "
. "submission.\\nWhen a page is moved, all of the elements"
. " on the page to be moved are given a temporary page "
. "number of 0.\\nThe elements of the page whose position "
. "it is to be moved to are then given a page number of "
. "the current page\\nand then the elements with a page "
. "number of 0 are then given a page number of the page "
. "that they are to be moved to.\\n\\nHowever, in this "
. "case we moved the current pages elements to page 0, but"
. " when we attempted to move the elements\\nof the page, "
. "whose sequence number is the destination of the current"
. " page, to the current page\\nwe were unable to do this."
. " Then when we recognised this error, and attempted "
. "to\\ncorrect it by moving the page 0 elements back to "
. "their original page, we were\\nunable to do this!\\n\\n"
. "This means that the page that you have tried to move "
. "will now have no elements, as they are all on page 0!"
. "\\n\\nThe administrator should be informed of this "
. "immediately!');\n</SCRIPT>\n");
$msgTxt = "A serious error has ocurred while trying to "
. "move a page of a submission to another position.\n\n"
. "When a page is moved, all of the elements on the page "
. "to be moved are given a temporary page number of 0. "
. "The elements of the page whose position it is to be "
. "moved to are then given a page number of that of the "
. "page that we are actually moving, and then the elements"
. " with a page number of 0 are then given a page number "
. "of the page that they are to be moved to.\n\nHowever, "
. "when an attempt was made to move page $pageNumber of "
. "the $subname submission of the $doctype document type "
. "to another position, the elements of page $pageNumber "
. "were moved to 'page 0', but when an attempt was made "
. "to move the elements of the page whose sequence number "
. "is the destination of the current page to the current "
. "page, it was not possible to do this. When this error "
. "was reconised, an attempt was made to correct the "
. "problem by moving all elements of page 0 of the "
. "$subname submission (the temporary page) back to page "
. "$pageNumber. The query to do this also failed, which "
. "effectively left the elements of page $pageNumber of "
. "the $subname submission stranded on page 0.\n\nThis is "
. "a serious problem, but can be corrected by running an "
. "update query to move the elements back to the correct "
. "page. Use the following query to do this manually:\n\n"
. "UPDATE sbmFIELD SET pagenb = '$pageNumber' WHERE subname ="
. " '$subname' and pagenb = '0';\n\nWebSubmit Administrator (";
$msgTxt .= makeDate();
$msgTxt .= ")";
mail(ADMIN_EMAIL, "$subname Submission Page Movement "
. "Error", $msgTxt, "From: WebSubmit_Administrator");
}
}
}
else
{
// couldn't change the pagenb field for the elements on the
// current field
print("<SCRIPT TYPE=\"text/javascript\">\nalert('ERROR: It was not"
. " possible to alter the page numbers for the elements on the "
. "page to be moved.\\nThis error ocurred in the sbmFIELD table.\\n"
. "Unable to carry out page movement - inform system "
. "administrator.');\n</SCRIPT>\n");
$msgTxt = "An error has ocurred while attempting to move a "
. "submission page. The submission was the $subname submission "
. "of the $doctype document type, and an attempt was made to "
. "move page $pageNumber.\n\nIt was not possible to assign a "
. "temporary value of 0 (zero) to the 'pagenb' field of the "
. "elements belonging to this page in the sbmFIELD table. This "
. "meant that it was not possible to carry out the movement of "
. "the page.\n\nThis problem should be investigated as soon as "
. "possible.\n\nWebSubmit Administrator (";
$msgTxt .= makeDate();
$msgTxt .= ")";
mail(ADMIN_EMAIL, "$subname Submission Page Movement Error",
$msgTxt, "From: WebSubmit_Administrator");
}
} // END function moveSubPage()
//*************
function deleteSubmissionPage($subname, $pageNumber, $nPgs, $doctype)
{
/******************************************************************
The task of this function is to delete a page from a given
submission of a given doctype. The function is passed several
variables which allow it to do this.
The function deletes the given page, and then renumbers all
elements for each page after the deleted page. It then the value
for the number of pages that the submission has by 1. It also
updates all relevant modified date fields (elements, submission
and doctype).
In the event of an error occurring, the relevant people are
informed. If an error ocurrs during the renumberring, the
renumberring is terminated to avoid further data corruption. The
admin is informed of this situation, and told what actions should
be taken.
******************************************************************/
$updStr = "DELETE FROM sbmFIELD WHERE subname = '$subname' AND "
. "pagenb = '$pageNumber'";
$updRes = mysql_query($updStr);
if($updRes)
{
$modifiedDate = makeEDSmdDate();
$errorOn = 0;
for($i = $pageNumber + 1; $i <= $nPgs; $i++)
{
$reorderStr = "UPDATE sbmFIELD SET pagenb = '" . ($i - 1)
. "', md = '$modifiedDate' WHERE subname = '$subname' AND"
. " pagenb = '$i'";
$reorderRes = mysql_query($reorderStr);
if($reorderRes)
{
mysql_free_result($reorderRes);
}
else
{
// could not reorder the elements of this page to
// appear on another.
print("<SCRIPT TYPE=\"text/javascript\">\nalert('Error: "
. "During the process of deleting the page, it is "
. "necessary to first delete the elements of the current"
. "\\npage, and then move the elements of all pages after"
. " the deleted page down one page in turn in order to "
. "fill\\nin the gap left by the deleted page. When page"
. " $pageNumber was deleted however, during the process "
. "of moving the pages after it down into the gaps,\\nit "
. "was not possible to move the elements of page $i onto "
. "page " . ($i - 1) . ".\\nThis meant that it was "
. "necessary to stop the process of reordering, as it "
. "would have resulted in further corruption if the "
. "process had been continued.\\n\\nThis problem should "
. "be corrected manually, and you should inform the system"
. " administrator ASAP.');\n</SCRIPT>\n");
$msgTxt = "An error has ocurred during the deletion of a "
. "page from the $subname submission of the $doctype "
. "document type. When a page is deleted from a "
. "submission, the first step is to delete the page to "
. "be deleted. The next step is to move any pages, after"
. " the deleted page, down by 1 position. This involves "
. "renumberring any elements of these pages to have a "
. "value of pagenb - 1.\n\nDuring the renumberring of "
. "elements after the deletion of page $pageNumber from "
. "the $subname submission however, an error ocurred which"
. " meant it was not possible to give the elements that "
. " currently lie on page $i a value of pagenb = "
. ($i - 1) . ".\n\nTo avoid further data corruption, the "
. "re-numberring was terminated after this error, so it "
. "will be necessary to manually decrement by 1 the "
. "'pagenb field for all elements on page $i and each page"
. " after this. It will then be necessary to decrement "
. "the value of the 'nbpg' field in the 'sbmIMPLEMENT' table "
. "for the '$subname' submission.\n\nBEFORE TAKING THESE "
. "ACTIONS, EXAMINE THE DATA TO ENSURE THAT THE USER HAS "
. "NOT ALREADY DONE THIS.\n\nWebSubmit Administrator (";
$msgTxt .= makeDate();
$msgTxt .= ")";
mail(ADMIN_EMAIL, "$subname Page Deletion Error",
$msgTxt, "From: WebSubmit_Administrator");
$errorOn = 1;
break;
}
}
// if $errorOn has not been set, decrement the value of the
// nbpg field in sbmIMPLEMENT for the current submission, and update
// the md field of the current doctype & submission
if(!$errorOn)
{
// Update the number of pages for this submission
$nmPgUpdtStr = "UPDATE sbmIMPLEMENT SET nbpg = '" . ($nPgs - 1)
. "', md = '$modifiedDate' WHERE subname = '$subname'";
$nmPgUpdtRes = mysql_query($nmPgUpdtStr);
if(!$nmPgUpdtRes)
{
// In this case, the query has failed, so we must inform the
// administrator that they must decrement the number of
// pages for the submission by 1
print("<SCRIPT TYPE=\"text/javascript\">\nalert('ERROR: The"
. " page has been deleted successfully, but it was not "
. "possible\\nto decrement the number of submission pages "
. "for this submission.\\n\\nPlease inform the system "
. "administrator of this.');\n</SCRIPT>\n");
$msgTxt = "An error has ocurred during the deletion of "
. "page $pageNumber of the $subname submission. The page"
. " was successfully deleted, but it was not possible to "
. "decrement the value of the 'nbpg' field for this "
. "submission in the sbmIMPLEMENT table.\n\nThis should be "
. "done manually as soon as possible, as there is now a "
. "blank page in the submission.\n\nWebSubmit Administrator (";
$msgTxt .= makeDate();
$msgTxt .= ")";
mail(ADMIN_EMAIL, "$subname Page Deletion Error",
$msgTxt, "From: WebSubmit_Administrator");
}
updateEDSDOCTYPEmd($doctype, $modifiedDate);
}
}
else
{
# unable to delete page
print("<SCRIPT TYPE=\"text/javascript\">\nalert('An error ocurred"
. " when trying to delete this page, which meant that its "
. "deletion was impossible.\\nNo change to the submission data "
. "has been made.\\n\\nTry again, or inform the system "
. "administrator.');\n</SCRIPT>\n");
}
} // END function deleteSubmissionPage()
function displayPage($update)
{
global $buttonorder,$displayed,$statustext,$subname,$doctype,$addPage,$nPgs,$pageNumber,$pageLeft,$pageRight,$deletePage;
if(isset($update))
{
// If this variable has been set, it means that this call to the
// page is a call to update the detials of a submission type.
// Ensure that "displayed" is storedin the database in uppercase...
$displayed = strtoupper($displayed);
// Get the data, so that it can be committed for the modification
// date field (md)...
$modifiedDate = makeEDSmdDate();
$updStr = "UPDATE sbmIMPLEMENT SET displayed = '$displayed', buttonorder =";
// Ensure that we don't accidentally put the value '0' into the
// buttonorder field, when we actually want to put a NULL into it
// (and vice- versa)...
if(!$buttonorder)
{
if($buttonorder == '0')
$updStr .= " '$buttonorder', ";
else
$updStr .= " NULL, ";
}
else
{
$updStr .= " '$buttonorder', ";
}
$updStr .= "statustext = '$statustext', md = "
. "'$modifiedDate' WHERE subname = '$subname'";
$updateRs = mysql_query($updStr);
if($updateRs)
{
if(mysql_affected_rows() == 1)
{
updateEDSDOCTYPEmd($doctype, $modifiedDate);
print("<SMALL STYLE=\"color: green; font-weight: bold; "
. "text-align: center\">Update Complete</SMALL>\n<BR>\n");
$msgTxt = "An update has been carried out on the $subname "
. "submission type in the " . DOCS_DATABASE
. " database.\n\nWebSubmit Administrator (";
$msgTxt .= makeDate();
$msgTxt .= ")";
mail(ADMIN_EMAIL, "$subname Submission Type Updated",
$msgTxt, "From: WebSubmit_Administrator");
displayEDSsubDetsForm($subname, $doctype);
}
elseif(mysql_affected_rows() > 1)
{
// More than 1 row was updated
print("<P CLASS=\"errorMsg\"><SPAN STYLE=\"color: red\">"
. "ERROR:</SPAN> Multiple rows have been updated in the "
. "<EM>sbmIMPLEMENT</EM> table.<BR>This has resulted from an "
. "attempt to update the <EM>$subname</EM> submission "
. "type.<BR>Please inform the system administrator."
. "</P>\n");
updateEDSDOCTYPEmd($doctype, $modifiedDate);
$msgTxt = "When a user updated the details of "
. "the $subname submission type using the EDS Administra"
. "tor, several rows were affected in the sbmIMPLEMENT table."
. " The update was conducted using the \"subname\" field "
. "as the key. As the \"subname\" field is the primary "
. "key for the sbmIMPLEMENT table, this means that there must"
. " be key violations in this table. There should only "
. "have been 1 row affected by this update.\n\nThis proble"
. "m should be investigated and corrected immediately.\n\n"
. "WebSubmit Administrator (";
$msgTxt .= makeDate();
$msgTxt .= ")";
mail(ADMIN_EMAIL, "ERROR: sbmIMPLEMENT Table Multiple Row "
. "Update!", $msgTxt, "From: WebSubmit_Administrator");
}
else
{
// No rows were updated
print("<P CLASS=\"errorMsg\"><SPAN STYLE=\"color: red\">"
. "ERROR:</SPAN> No rows have been updated in the <EM>"
. "sbmIMPLEMENT</EM> table.<BR>This suggests that there could"
. " be data inconsistencies or concurrency problems.<BR>"
. "Please inform the system administrator.</P>\n");
$msgTxt = "When a user attempted to update the details of "
. "the $subname submission type using the EDS Administrat"
. "or, no rows were affected in the sbmIMPLEMENT table by "
. "this update.\n\nBecause the user must have altered a "
. "submission types details to submit an update on it, it "
. "must have been present at around the time that the user"
. " submitted their update.\n\nThis suggests the possibili"
. "ty of concurrency or data inconsistency problems in thi"
. "s table.\n\nThis should be investigated and corrected "
. "ASAP.\n\nWebSubmit Administrator (";
$msgTxt .= makeDate();
$msgTxt .= ")";
mail(ADMIN_EMAIL, "Error: Possible Concurrency Problems",
$msgTxt, "From: WebSubmit_Administrator");
}
}
else
{
print("<P CLASS=\"errorMsg\"><SPAN STYLE=\"color: red\">"
. "ERROR:</SPAN> No rows have been updated in the <EM>"
. "sbmIMPLEMENT</EM> table.<BR>This suggests that there could"
. " be data inconsistencies or concurrency problems.<BR>Plea"
. "se inform the system administrator.</P>\n");
}
}
elseif($addPage)
{
// add page to submission. get the current
// number of pages in the document, increment it by 1, and then
// redirect the browser focus to the "pageDetsEDS.php" for the new page
$nPgs++;
$modifiedDate = makeEDSmdDate();
// Now, we can update the "nbpg" field in the sbmIMPLEMENT table to
// the value of this "$nPgs" variable, to reflect the addition of
// the new page.
$updRes = mysql_query("UPDATE sbmIMPLEMENT SET nbpg = '$nPgs', md ="
. " '$modifiedDate' WHERE subname = '$subname'");
if($updRes)
{
// query executed without error
// ensure that it has only updated one row.
if(mysql_affected_rows() > 1)
{
// too many rows have been updated
updateEDSDOCTYPEmd($doctype, $modifiedDate);
print("<SCRIPT TYPE=\"text/javascript\">\nalert('ERROR: "
. "Several rows were updated in the sbmIMPLEMENT table for "
. "the $subname submission when we added a page to "
. "it.\\nBecause the \"subname\" field is the primary key"
. "for the sbmIMPLEMENT table, this suggests a primary key "
. "violation.\\n\\nPlease inform the system administrator "
. "administrator');</SCRIPT>\n");
$msgTxt = "An error has ocurred when a new page was added "
. "to the $subname submission. When this action was under"
. "taken, more than 1 rows was updated in the sbmIMPLEMENT "
. "table. This means that there must be more than 1 "
. "instance of this submission in this table.\n\nBecause "
. "the \"subname\" field is the primary key for the "
. "sbmIMPLEMENT table, this it is illegal to have more than "
. "one row for the same submission, and this is therefore "
. "a primary key violation.\n\nYou should look into this "
. "situation immediately, as it is a serious error, and "
. "could cause system problems.\n\nWebSubmit Administrator (";
$msgTxt .= makeDate();
$msgTxt .= ")";
mail(ADMIN_EMAIL, "Error - $subname Submission "
. "Duplication",
$msgTxt, "From: WebSubmit_Administrator");
displayEDSsubDetsForm($subname, $doctype);
}
elseif(mysql_affected_rows() <= 0)
{
print("<P CLASS=\"errorMsg\"><SPAN STYLE=\"color: red\">"
. "ERROR:</SPAN> Unable to update $subname submission det"
. "ails. No page added.</P>");
$msgTxt = "An error has ocurred when trying to add a new "
. "page to the $subname submission of the $doctype documen"
. "t type. When an attempt was made to increment the valu"
. "e of the nbpg field in the sbmIMPLEMENT table by 1 for "
. "this submission, no rows were affected by the update.\n"
. "\nThis suggests that the submission does not exist in "
. "this table. There could be concurrency problems, as it"
. " is possible that during the time between the details "
. "of the submission being displayed, and the 'ADD PAGE' "
. "button being pressed by the user, the submission was "
. "deleted by another user.\n\nThis situation should be "
. "investigated.\n\nWebSubmit Administrator (";
$msgTxt .= makeDate();
$msgTxt .= ")";
mail(ADMIN_EMAIL, "EDS Error - $subname Not Found",
$msgTxt, "From: WebSubmit_Administrator");
// instead of redisplaying the details of this
// submission, redirect the browser to the
// "documentEDS.php" page, as there is no point in
// redisplaying the submission details if it is possible
// that another user has deleted it. If it still exists,
// the user can simply look at the submission again.
print("<FORM NAME=\"referForm\" ACTION=\"documentEDS.php\" "
. "METHOD=\"post\">\n<INPUT TYPE=\"hidden\" NAME=\"doctype\" "
. "VALUE=\"$doctype\">\n</FORM>\n<SCRIPT TYPE=\"text/javas"
. "cript\">\nsetTimeout(\"document.referForm.submit();\","
. " 1000);\n</SCRIPT>\n");
}
else
{
updateEDSDOCTYPEmd($doctype, $modifiedDate);
print("<P STYLE=\"color: green; text-align: center; font-"
. "size: large\">New Page Added To <EM>$subname</EM> "
. "Submission.</P>\n");
$msgTxt = "A new page has been added to the $subname "
. "submission of the $doctype document type. This new "
. "page has been inserted as the last page in the "
. "submission and therefore is page number $nPgs.\n\nEDS"
. " Administrator (";
$msgTxt .= makeDate();
$msgTxt .= ")";
mail(ADMIN_EMAIL, "Page $nPgs Added To $subname "
. "Submission", $msgTxt, "From: WebSubmit_Administrator");
// Now redirect the browser to "pageDetsEDS.php"
sendToPageDets($subname, $nPgs, $nPgs, $doctype);
}
}
else
{
// query failed
print("<SCRIPT TYPE=\"text/javascript\">\nalert('ERROR: It was "
. "not possible to add a page to the $subname submission of "
. "the $doctype document type.\\nThe system administrator "
. "should be informed of this problem.');\n</SCRIPT>\n");
displayEDSsubDetsForm($subname, $doctype);
}
}
elseif(isset($pageLeft))
{
// move submission page to the left
// i.e. give it a lower page number, and hence give it a higher priority in
// the page order sequence.
moveSubPage($doctype, $pageNumber, $nPgs, $subname,
$pageNumber - 1);
displayEDSsubDetsForm($subname, $doctype);
}
elseif(isset($pageRight))
{
// move a page to the right
// i.e. give it a higher page number, and hence a lower priority in the order sequence)
moveSubPage($doctype, $pageNumber, $nPgs, $subname,
$pageNumber + 1);
displayEDSsubDetsForm($subname, $doctype);
}
elseif(isset($deletePage))
{
// delete a page and its contents
deleteSubmissionPage($subname, $pageNumber, $nPgs, $doctype);
displayEDSsubDetsForm($subname, $doctype);
}
else
{
displayEDSsubDetsForm($subname, $doctype);
}
}
/**********************Start of main script***************************/
// Connect to the MySQL server
serverConnect(MYSQLDOCMACHINE, MYSQLDOCUSERID, MYSQLDOCPASSWORD);
// Select the Search database
dbSelect(DOCS_DATABASE);
$auth = canUseWebSubmitAdmin($uid,$doctype);
if (!$auth[0])
outWarning($auth[1][1] . "<br><br>" . "You are not allowed to access WebSubmit Admin for this type of documents");
else
displayPage($update);
/************************End of main script***************************/
</protect>
?>
Event Timeline
Log In to Comment