diff --git a/modules/websubmit/web/admin/.cvsignore b/modules/websubmit/web/admin/.cvsignore
new file mode 100644
index 000000000..858ac9ff9
--- /dev/null
+++ b/modules/websubmit/web/admin/.cvsignore
@@ -0,0 +1,9 @@
+Makefile
+Makefile.in
+z_*
+*.O
+*~
+*.py
+*.shtml
+*.html
+*.php
\ No newline at end of file
diff --git a/modules/websubmit/web/admin/Makefile.am b/modules/websubmit/web/admin/Makefile.am
new file mode 100644
index 000000000..2e8d3461a
--- /dev/null
+++ b/modules/websubmit/web/admin/Makefile.am
@@ -0,0 +1,31 @@
+## $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.
+
+webappdir = $(WEBDIR)/admin/websubmit
+
+FILESWML=$(wildcard *.wml)
+webapp_DATA=$(FILESWML:.wml=)
+
+EXTRA_DIST = $(wildcard *.wml)
+
+CLEANFILES = $(webapp_DATA) *~ *.tmp
+
+%.php: %.php.wml ../../../../config/config.wml ../../../../config/configbis.wml \
+ ../../../../config/messages.wml
+ $(WML) -o\(ALL-LANG_*\)+LANG_EN:$@ $<
diff --git a/modules/websubmit/web/admin/actionFunctions.php.wml b/modules/websubmit/web/admin/actionFunctions.php.wml
new file mode 100644
index 000000000..8fb54cf1b
--- /dev/null
+++ b/modules/websubmit/web/admin/actionFunctions.php.wml
@@ -0,0 +1,635 @@
+## $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.
+
+ require("commonPhpFunctions.php");
+?>
+#include "cdspage.wml" \
+ title="List of Functions for on $doctype";?>" \
+ navtrail_previous_links="/admin/> > /admin/websubmit/>" \
+ navbar_name="admin" \
+ navbar_select="websubmit" \
+ cdspageboxlefttopadd=""
+
+
+
+## $Id$
+## DO NOT EDIT THIS FILE! IT WAS AUTOMATICALLY GENERATED FROM CDSware WML SOURCES.
+
+ /***********************Function Declarations************************/
+
+ function displayFunctions($doctype, $action)
+ {
+
+ global $IMAGES;
+
+ $lockStr = "LOCK TABLES sbmFUNCTIONS READ";
+
+ # Apply a read lock to the given functions table...
+ if($lockRes = mysql_query($lockStr))
+ {
+ # Execute a query selecting a listing of the functions that make
+ # up an action for the given document type
+ $queryResult = mysql_query("SELECT * FROM sbmFUNCTIONS WHERE
+ doctype='$doctype' and action='$action' ORDER BY step, score");
+
+ # We must unlock our table...
+ $unlockRes = mysql_query("UNLOCK TABLES");
+
+ # If there were rows returned by this query (i.e. there are
+ # functions composing the given action on the given doctype, we
+ # can display them.
+
+ if(mysql_num_rows($queryResult) > 0)
+ {
+ # We can now create a table to display the query dynaset in...
+ print("
");
+
+ # Open the first table row for the column headings...
+ print("
");
+
+ # Get information about the fields in the table...
+ $columns = mysql_list_fields(DOCS_DATABASE, "sbmFUNCTIONS");
+
+ # Display all of the column headings
+ for($headerIndex = 2; $headerIndex < mysql_num_fields($columns);
+ $headerIndex++)
+ {
+ print("
");
+ }
+ } // END for
+
+ # Now that we have added all of the header columns, we can add
+ # one more column header offering the user the ability to
+ # delete a function from the current action on the current
+ # doctype...
+ print("
Delete
\n");
+
+ print("
");
+
+ # Make a counter for the rows...
+ $rowCount = 0;
+
+ # Put the contents of the query dynaset into a temporary
+ # array...
+ while($dataRow = mysql_fetch_array($queryResult))
+ {
+ $allRows[$rowCount] = $dataRow;
+ $rowCount++;
+ } // End while
+
+ # Reset $rowCount to 0 for use in further processing...
+ $rowCount = 0;
+
+ # Now, we can display the body of the table...
+ for($i = 0; $i < mysql_num_rows($queryResult); $i++)
+ {
+ print("
");
+
+ # For each column...
+ for($colIndex = 2; $colIndex < mysql_num_fields($columns);
+ $colIndex++)
+ {
+ if(mysql_field_name($columns, $colIndex) == "function")
+ # If the column is the function name,
+ # create a link to the description of
+ # that function in the fundesc table.
+ {
+ print("
\n");
+ } // End else
+ } // End for
+
+ # Now, we can fill the contents of the last column with the
+ # "delete button" for removing a function...
+
+ print("\n");
+
+ # We have now completed the current row, and can close it
+ print("
");
+
+ # Increment the value of $rowCount...
+ $rowCount++;
+ } // End for
+
+ # Close the table, as it is now finished...
+ print("
\n");
+
+ # Now, we can display a button to offer the user the chance to
+ # go back to the listing of actions for the given document
+ # type.
+ # This is done using a button.
+
+ print("
\n
\n"
+ . "
\n"
+ . "\n
\n
\n");
+ } // End if
+ else
+ {
+ print("
There Are No Functions "
+ . "Associated With The $action Action For The $doctype "
+ . "Document Type
\n");
+
+ # Now, we can offer the user the chance to add functions to
+ # the given action on the given doctype...
+ # This requires a table with a form in it, with a button to
+ # press in order to add the functions.
+
+ print(" \n \n");
+ print("
"
+ . "
");
+ print("\n
\n");
+ print("
\n");
+ print("
\n");
+ print("
\n");
+
+
+ print("
\n");
+ print("
\n");
+ } // End else
+ } # END if
+ else
+ {
+ # Display error message (couldnt lock tables).
+ print("
\n"
+ . "Error: Unable to retrieve information.
\n ".mysql_error()."\n");
+
+ print("
\n
\n
\n
\n");
+ } # END else
+
+ } // END function displayFunctions()
+
+
+ function displayPage()
+ {
+ global $calledBefore,$doctype,$action,$up,$x,$y,$previousScore,$currentStep,$previousStep,$function,$currentScore,$down,$nextStep,$nextScore,$deleteFunc,$previousFunction,$nextFunction;
+
+ if(!($calledBefore))
+ {
+ displayFunctions($doctype, $action);
+ } // END if
+ else
+ {
+ if(isset($up))
+ {
+ # Destroy memory space associated with x and y coordinates
+ # which were passed from the input image...
+
+ unset($x);
+ unset($y);
+
+ # Destroy $up...
+ unset($up);
+
+ # Make a query string to update the row to move, to its new
+ # score and step values...
+
+ $queryStringA = "UPDATE sbmFUNCTIONS SET score = "
+ . "'$previousScore'";
+
+ if($previousStep < $currentStep)
+ { # If the function aboves step is lower, then we must also
+ # change this...
+ $queryStringA = $queryStringA . ", step = "
+ . "'$previousStep'";
+ } // END if
+
+ $queryStringA = $queryStringA . " WHERE doctype = '$doctype'"
+ . " AND function = '$function' AND score = "
+ . "'$currentScore' AND step = '$currentStep' and action='$action'";
+
+ # Now, make another query string to update the function that
+ # was above the function that we have just updated in the
+ # order. This function should be updated to have the values
+ # that the function that we just updated had!
+
+ $queryStringB = "UPDATE sbmFUNCTIONS SET score = "
+ . "'$currentScore'";
+
+ if($previousStep < $currentStep)
+ { # If the function we are alterring to the one above has a
+ # lower step than the one that came after it in the list,
+ # we must change the steps around...
+
+ $queryStringB = $queryStringB . ", step = '$currentStep'";
+ } // END if
+
+ $queryStringB = $queryStringB . " WHERE doctype = '$doctype'"
+ . " AND function = '$previousFunction' AND "
+ . "score = '$previousScore' AND step = "
+ . "'$previousStep' and action='$action'";
+
+ # Lock our tables...
+ $lockStr = "LOCK TABLES sbmFUNCTIONS WRITE";
+
+ if($lockRes = mysql_query($lockStr))
+ {
+ # Execute the update on the first function...
+ $queryResultA = mysql_query($queryStringA) or
+ die("Could Not Update Table. Error: (A) $queryStringA");
+
+ # Execute the update on the second function...
+ $queryresultB = mysql_query($queryStringB) or
+ die("Could Not Update Table. Error: (B)");
+
+ # Unlock our tables...
+ $unlockRes = mysql_query("UNLOCK TABLES");
+ } # END if
+ else
+ {
+ # Couldn't lock tables, therefore couldn't allow write
+ print("
\nError: Unable to commit movement."
+ . "
\n \n");
+ } # END else
+
+ unset($lockStr);
+
+
+ # Display the table of functions once again...
+ displayFunctions($doctype, $action);
+ } // END if
+ elseif(isset($down))
+ {
+ # Destroy memory space associated with $x and $y coordinates
+ # which were passed from the input image...
+
+ unset($x);
+ unset($y);
+
+ # Destroy $down
+ unset($down);
+
+ # Make a query string to update the row to move, to it's new
+ # score and step values...
+
+ $queryStringA = "UPDATE sbmFUNCTIONS SET score = "
+ . "'$nextScore'";
+
+ if($currentStep < $nextStep)
+ { # If the step requires changing also, change it...
+ $queryStringA = $queryStringA . ", step = '$nextStep'";
+ }
+
+ $queryStringA = $queryStringA . " WHERE doctype = '$doctype'"
+ . " AND function = '$function' AND score = "
+ . "'$currentScore' AND step = '$currentStep' and action='$action'";
+
+
+ # Now make another query string to update the function whose
+ # position in the order the other function is moving to...
+
+ $queryStringB = "UPDATE sbmFUNCTIONS SET score = "
+ . "'$currentScore'";
+
+ if($currentStep < $nextStep)
+ { # If the step requires changing also, change it...
+ $queryStringB = $queryStringB . ", step = '$currentStep'";
+ }
+
+ $queryStringB = $queryStringB . " WHERE doctype = '$doctype'"
+ . "AND function = '$nextFunction' AND score = "
+ . "'$nextScore' AND step = '$nextStep' and action='$action'";
+
+
+ # Lock our tables...
+ $lockStr = "LOCK TABLES sbmFUNCTIONS WRITE";
+
+ if($lockRes = mysql_query($lockStr))
+ {
+ # Execute the query on the first data item...
+ $queryResultA = mysql_query($queryStringA) or
+ die("no query A!");
+
+ # Execute the query on the second data item...
+ $queryresultB = mysql_query($queryStringB) or
+ die("no query B!");
+
+ # Unlock our tables...
+ $unlockRes = mysql_query("UNLOCK TABLES");
+ } # END if
+ else
+ {
+ # Couldn't lock tables, therefore couldn't allow write
+ print("
\nError: Unable to commit movement."
+ . "
\n \n");
+ } # END else
+
+ unset($lockStr);
+
+
+ # Display the table of functions once more...
+ displayFunctions($doctype, $action);
+ } // END elseif
+ elseif(isset($deleteFunc))
+ {
+ # This is a call to delete a function from the current action
+ # of the current doctype.
+
+ # Free some wasted space.
+ unset($deleteFunc);
+
+ $delStr = "DELETE FROM sbmFUNCTIONS WHERE doctype = '$doctype"
+ . "' AND function = '$function' AND score = '$currentScore' "
+ . "AND step = '$currentStep' and action='$action'";
+
+ # Make our LOCK query...
+ $lockStr = "LOCK TABLES sbmFUNCTIONS WRITE";
+
+ if($lockRes = mysql_query($lockStr))
+ {
+ $delRes = mysql_query($delStr);
+
+ if($delRes)
+ {
+ # The deletion query was successful, but did it actually
+ # delete anything?
+
+ if(mysql_affected_rows() == 1)
+ {
+ # Perfect! 1 row deleted as expected.
+
+ # We must unlock our table...
+ $unlockRes = mysql_query("UNLOCK TABLES");
+
+ print("\n");
+ } // END elseif
+ else
+ {
+ # Ahhhhhh! We have deleted no function!
+
+ # We must unlock our table...
+ $unlockRes = mysql_query("UNLOCK TABLES");
+
+ print("\n");
+ } // END else
+ } // END if
+ else
+ {
+ # Deletion query failed.
+
+ # We must unlock our table...
+ $unlockRes = mysql_query("UNLOCK TABLES");
+
+ print("\n");
+ } // END else
+ } # END if
+ else
+ {
+ # Could not lock the table. No display allowed.
+ print("
\nError: Unable to delete function."
+ . "
\n \n");
+ } # END else
+
+ # Display the table of functions once more...
+ displayFunctions($doctype, $action);
+ } // END elseif
+ else
+ {
+ print("
"
+ . "\nERROR IN UPDATE
\n");
+ } // END else
+ } // END else
+ }
+
+
+ /**********************Start of main script***************************/
+
+ # Connect to the MySQL server
+ serverConnect(MYSQLDOCMACHINE, MYSQLDOCUSERID, MYSQLDOCPASSWORD);
+
+ # Select the CDS Search database...
+ dbSelect(DOCS_DATABASE);
+
+ if (!canUseWebSubmitAdmin($uid,$doctype))
+ outWarning("You are not allowed to access WebSubmit Admin for this "
+ . "type of documents");
+ else
+ displayPage($doctype);
+
+ /************************End of main script***************************/
+
+
+?>
diff --git a/modules/websubmit/web/admin/addActionEDS.php.wml b/modules/websubmit/web/admin/addActionEDS.php.wml
new file mode 100644
index 000000000..a861f2cb1
--- /dev/null
+++ b/modules/websubmit/web/admin/addActionEDS.php.wml
@@ -0,0 +1,439 @@
+## $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.
+
+ require("commonPhpFunctions.php");
+?>
+#include "cdspage.wml" \
+ title="Create a new action" \
+ navtrail_previous_links="/admin/> > /admin/websubmit/>" \
+ navbar_name="admin" \
+ navbar_select="websubmit" \
+ cdspageboxlefttopadd=""
+
+
+
+## $Id$
+## DO NOT EDIT THIS FILE! IT WAS AUTOMATICALLY GENERATED FROM CDSware WML SOURCES.
+?>
+
+
+
+
+ /*********************Function Descriptions***************************/
+
+ function enterEDSaction($lactname = "", $dir = "",
+ $actionbutton = "", $statustext = "", $sactname = "")
+ {
+ /*******************************************************************
+ This function has the task of creating a form in which a user can
+ enter a new EDS action.
+
+ Author: Nicholas Robinson
+ Email: Nicholas.Robinson@cern.ch
+ ca8nro@yahoo.co.uk
+ Created: 19/12/2000
+ Last Modified: 17/01/2001
+ *******************************************************************/
+
+ # Now, display a quick set of page instructions for the user..
+ print("
\n
\n
Below, is "
+ . "a form in which you can enter the details of a new action."
+ . "
When you enter a new action, it will not be "
+ . "accepted by the system unless you have given it a unique "
+ . "\"Action Code\". "
+ . " You can commit this new action to the database by "
+ . "clicking on \"SAVE DETAILS\".
\n
\n
\n
"
+ . "\n");
+
+ # Make a horizontal rule to divide the page sections...
+ drawSeparator();
+
+ print("