Commit 425c4b89 authored by Kevin Atkinson's avatar Kevin Atkinson

Set the charset for all emulab pages to utf-8 which is needed to
display foreign names correctly.  Also added three rows to table_regex:
tinytext_utf8, text_utf8, fulltext_utf8

Enhanced form_defs.php:

  - Add Support for Textarea

  - Add Support for a vertical list, for example see Category in
    submitpub.php

  - Add support for dumping the form values in plain text, used in the
    email I send to testbed-ops.

  - Change Error Reporting text for subfields such as in a list so
    they also include the text from the outer field, for example in
    newosid "ping" will become "OS Features, ping".  I needed this
    since some of my subfields didn't have labels and it seamed like
    the right thing to do.

  - Set #return_value to 1 in FormRenderCheckBox if it not already
    specified

  - In FormRenderSelect, if the #value is not in the list add it to
    the end.

  - Add support for "display" type, to just display some text in the
    table

  - Possibly some other little things I forgot about.

New site variable PUBSUPPORT.

Implement FS#201: Provide users a way to add a paper that used Emulab
see (https://users.emulab.net/flyspray/?do=details&id=201), summary of
changes:

  - Controlled via the new site variable PUBSUPPORT.

  - The emulab_papers spread sheet is now frozen all new changes
    should be made using the new system.

  - New pages submitpub.php for users to submit a new publication
    with different views for admins and non-admins.

  - New page expubs.php to replace doc/expubs.html, lists publications
    in database.  Also allows admins to edit publications.

  - Project members can edit papers associated with the project as
    long as they have local_root or higher privileges. Papers for a
    project are listed under a new tab in the showproject page. I keep
    track of the last person to edit the paper submission in addition
    to who initially submitted it.

  - Users can modify papers they submitted which is needed if the
    project was N/A. Papers users submitted now appear in a new tab in
    the showuser page.

  - Script to import spreadsheet to the database is in
    utah/bibliography/emulab_pubs-import.pl.

  - Changes web pages that point to doc/expubs.html to instead point
    to expubs.php
parent 357df448
......@@ -1448,6 +1448,8 @@ done
......@@ -1502,13 +1504,14 @@ OUTERBOSS_NODENAME=""
OUTERBOSS_XMLRPCPORT=3069
OUTERBOSS_SSLCERTNAME="/etc/outer_emulab.pem"
PLABSUPPORT=0
PUBSUPPORT=0
WIKISUPPORT=0
TRACSUPPORT=0
BUGDBSUPPORT=0
OPSDBSUPPORT=0
MAILMANSUPPORT=0
WINSUPPORT=0
CVSSUPPORT=0
TRACSUPPORT=0
CHATSUPPORT=0
STAMPS=0
ARCHIVESUPPORT=0
......@@ -1740,7 +1743,6 @@ if test $ISOLATEADMINS -eq 1; then
EOF
fi
if test $DYNAMICROOTPASSWORDS -eq 1; then
cat >> confdefs.h <<EOF
#define DYNAMICROOTPASSWORDS 1
......@@ -1866,6 +1868,8 @@ fi
cat >> confdefs.h <<EOF
#define TBBASE "$TBBASE"
EOF
if test -z "$THISHOMEBASE"; then
THISHOMEBASE="Emulab.Net"
fi
......@@ -2122,17 +2126,17 @@ for ac_hdr in ulxmlrpcpp/ulxr_config.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:2114: checking for $ac_hdr" >&5
echo "configure:2130: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 2119 "configure"
#line 2135 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:2124: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
{ (eval echo configure:2140: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
......@@ -2171,17 +2175,17 @@ for ac_hdr in linux/videodev.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:2163: checking for $ac_hdr" >&5
echo "configure:2179: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 2168 "configure"
#line 2184 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:2173: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
{ (eval echo configure:2189: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
......@@ -2214,7 +2218,7 @@ done
# Extract the first word of "gtk-config", so it can be a program name with args.
set dummy gtk-config; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:2206: checking for $ac_word" >&5
echo "configure:2222: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_GTK_CONFIG'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
......@@ -2293,7 +2297,7 @@ fi
# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
# ./install, which can be erroneously created by make from ./install.sh.
echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
echo "configure:2285: checking for a BSD compatible install" >&5
echo "configure:2301: checking for a BSD compatible install" >&5
if test -z "$INSTALL"; then
if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
......@@ -2354,7 +2358,7 @@ esac
# Extract the first word of "rsync", so it can be a program name with args.
set dummy rsync; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:2346: checking for $ac_word" >&5
echo "configure:2362: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_RSYNC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
......@@ -2811,8 +2815,8 @@ s%@OUTERBOSS_NODENAME@%$OUTERBOSS_NODENAME%g
s%@OUTERBOSS_XMLRPCPORT@%$OUTERBOSS_XMLRPCPORT%g
s%@OUTERBOSS_SSLCERTNAME@%$OUTERBOSS_SSLCERTNAME%g
s%@PLABSUPPORT@%$PLABSUPPORT%g
s%@PUBSUPPORT@%$PUBSUPPORT%g
s%@WIKISUPPORT@%$WIKISUPPORT%g
s%@TRACSUPPORT@%$TRACSUPPORT%g
s%@MAILMANSUPPORT@%$MAILMANSUPPORT%g
s%@BUGDBSUPPORT@%$BUGDBSUPPORT%g
s%@OPSDBSUPPORT@%$OPSDBSUPPORT%g
......@@ -2850,9 +2854,8 @@ s%@FRISEBEEMCASTADDR@%$FRISEBEEMCASTADDR%g
s%@FRISEBEEMCASTPORT@%$FRISEBEEMCASTPORT%g
s%@WINSUPPORT@%$WINSUPPORT%g
s%@CVSSUPPORT@%$CVSSUPPORT%g
s%@TRACSUPPORT@%$TRACSUPPORT%g
s%@CHATSUPPORT@%$CHATSUPPORT%g
s%@ISOLATEADMINS@%$ISOLATEADMINS%g
s%@DYNAMICROOTPASSWORDS@%$DYNAMICROOTPASSWORDS%g
s%@STAMPS@%$STAMPS%g
s%@ARCHIVESUPPORT@%$ARCHIVESUPPORT%g
s%@MIN_UNIX_UID@%$MIN_UNIX_UID%g
......@@ -2860,6 +2863,8 @@ s%@MIN_UNIX_GID@%$MIN_UNIX_GID%g
s%@DELAYTHRESH@%$DELAYTHRESH%g
s%@PELABSUPPORT@%$PELABSUPPORT%g
s%@ELVIN_COMPAT@%$ELVIN_COMPAT%g
s%@ISOLATEADMINS@%$ISOLATEADMINS%g
s%@DYNAMICROOTPASSWORDS@%$DYNAMICROOTPASSWORDS%g
s%@TBOPSEMAIL@%$TBOPSEMAIL%g
s%@TBOPSEMAIL_NOSLASH@%$TBOPSEMAIL_NOSLASH%g
s%@TBROBOCOPSEMAIL@%$TBROBOCOPSEMAIL%g
......
......@@ -155,6 +155,7 @@ AC_SUBST(OUTERBOSS_NODENAME)
AC_SUBST(OUTERBOSS_XMLRPCPORT)
AC_SUBST(OUTERBOSS_SSLCERTNAME)
AC_SUBST(PLABSUPPORT)
AC_SUBST(PUBSUPPORT)
AC_SUBST(WIKISUPPORT)
AC_SUBST(MAILMANSUPPORT)
AC_SUBST(BUGDBSUPPORT)
......@@ -256,6 +257,7 @@ OUTERBOSS_NODENAME=""
OUTERBOSS_XMLRPCPORT=3069
OUTERBOSS_SSLCERTNAME="/etc/outer_emulab.pem"
PLABSUPPORT=0
PUBSUPPORT=0
WIKISUPPORT=0
BUGDBSUPPORT=0
OPSDBSUPPORT=0
......
......@@ -43,6 +43,7 @@ ELVIN_COMPAT=1
#
# This next group will not work outside of Utah (yet).
#
PUBSUPPORT=1
WIKISUPPORT=1
TRACSUPPORT=1
BUGDBSUPPORT=1
......
......@@ -147,6 +147,8 @@ REPLACE INTO exported_tables VALUES ('state_triggers');
REPLACE INTO exported_tables VALUES ('table_regex');
REPLACE INTO exported_tables VALUES ('testsuite_preentables');
REPLACE INTO exported_tables VALUES ('webdb_table_permissions');
REPLACE INTO exported_tables VALUES ('emulab_pubs_month_map');
--
-- Dumping data for table `foreign_keys`
......@@ -944,6 +946,10 @@ REPLACE INTO table_regex VALUES ('user_pubkeys','verify','text','redirect','defa
REPLACE INTO table_regex VALUES ('user_pubkeys','user','text','redirect','users:uid',0,0,NULL);
REPLACE INTO table_regex VALUES ('user_pubkeys','keyfile','text','regex','^[-_\\w\\.\\/:+]*$',1,256,NULL);
REPLACE INTO table_regex VALUES ('default','tinytext_utf8','text','regex','^(?:[\\x20-\\x7E]|[\\xC2-\\xDF][\\x80-\\xBF]|\\xE0[\\xA0-\\xBF][\\x80-\\xBF]|[\\xE1-\\xEC\\xEE\\xEF][\\x80-\\xBF]{2}|\\xED[\\x80-\\x9F][\\x80-\\xBF])*$',0,256,'adopted from http://www.w3.org/International/questions/qa-forms-utf-8.en.php');
REPLACE INTO table_regex VALUES ('default','text_utf8','text','regex','^(?:[\\x20-\\x7E]|[\\xC2-\\xDF][\\x80-\\xBF]|\\xE0[\\xA0-\\xBF][\\x80-\\xBF]|[\\xE1-\\xEC\\xEE\\xEF][\\x80-\\xBF]{2}|\\xED[\\x80-\\x9F][\\x80-\\xBF])*$',0,65535,'adopted from http://www.w3.org/International/questions/qa-forms-utf-8.en.php');
REPLACE INTO table_regex VALUES ('default','fulltext_utf8','text','regex','^(?:[\\x09\\x0A\\x0D\\x20-\\x7E]|[\\xC2-\\xDF][\\x80-\\xBF]|\\xE0[\\xA0-\\xBF][\\x80-\\xBF]|[\\xE1-\\xEC\\xEE\\xEF][\\x80-\\xBF]{2}|\\xED[\\x80-\\x9F][\\x80-\\xBF])*$',0,65535,'adopted from http://www.w3.org/International/questions/qa-forms-utf-8.en.php');
--
-- Dumping data for table `testsuite_preentables`
--
......@@ -1002,3 +1008,34 @@ REPLACE INTO webdb_table_permissions VALUES ('projects',1,1,0);
REPLACE INTO webdb_table_permissions VALUES ('osidtoimageid',1,0,1);
REPLACE INTO webdb_table_permissions VALUES ('table_regex',1,1,1);
--
-- Dumping data for table `emulab_pubs_month_map`
--
REPLACE INTO `emulab_pubs_month_map` VALUES (1,0.0,'');
REPLACE INTO `emulab_pubs_month_map` VALUES (2,1.0,'Jan');
REPLACE INTO `emulab_pubs_month_map` VALUES (3,2.0,'Feb');
REPLACE INTO `emulab_pubs_month_map` VALUES (4,3.0,'Mar');
REPLACE INTO `emulab_pubs_month_map` VALUES (5,4.0,'Apr');
REPLACE INTO `emulab_pubs_month_map` VALUES (6,5.0,'May');
REPLACE INTO `emulab_pubs_month_map` VALUES (7,6.0,'Jun');
REPLACE INTO `emulab_pubs_month_map` VALUES (8,7.0,'Jul');
REPLACE INTO `emulab_pubs_month_map` VALUES (9,8.0,'Aug');
REPLACE INTO `emulab_pubs_month_map` VALUES (10,9.0,'Sep');
REPLACE INTO `emulab_pubs_month_map` VALUES (11,10.0,'Oct');
REPLACE INTO `emulab_pubs_month_map` VALUES (12,11.0,'Nov');
REPLACE INTO `emulab_pubs_month_map` VALUES (13,12.0,'Dec');
REPLACE INTO `emulab_pubs_month_map` VALUES (14,1.5,'Jan-Feb');
REPLACE INTO `emulab_pubs_month_map` VALUES (15,2.5,'Feb-Mar');
REPLACE INTO `emulab_pubs_month_map` VALUES (16,3.5,'Mar-Apr');
REPLACE INTO `emulab_pubs_month_map` VALUES (17,4.5,'Apr-May');
REPLACE INTO `emulab_pubs_month_map` VALUES (18,5.5,'May-Jun');
REPLACE INTO `emulab_pubs_month_map` VALUES (19,6.5,'Jun-Jul');
REPLACE INTO `emulab_pubs_month_map` VALUES (20,7.5,'Jul-Aug');
REPLACE INTO `emulab_pubs_month_map` VALUES (21,8.5,'Aug-Sep');
REPLACE INTO `emulab_pubs_month_map` VALUES (22,9.5,'Sep-Oct');
REPLACE INTO `emulab_pubs_month_map` VALUES (23,10.5,'Oct-Nov');
REPLACE INTO `emulab_pubs_month_map` VALUES (24,11.5,'Nov-Dec');
REPLACE INTO `emulab_pubs_month_map` VALUES (25,12.5,'Dec-Jan');
......@@ -4545,3 +4545,8 @@ last_net_act,last_cpu_act,last_ext_act);
alter table interfaces add `uuid` varchar(40) NOT NULL default '';
alter table interfaces add KEY `uuid` (`uuid`);
update interfaces set uuid=UUID();
4.156: Create emulab_pubs and related tables.
Add support for UTF-8 fields in table_regex.
mysql tbdb < emulab_pubs.sql
drop table if exists emulab_pubs;
create table `emulab_pubs` (
`idx` int unsigned not null primary key auto_increment,
`uuid` varchar(40) not null unique,
`created` datetime not null,
`owner` mediumint(8) unsigned not null,
`submitted_by` mediumint(8) unsigned not null,
`last_edit` datetime not null,
`last_edit_by` mediumint(8) unsigned not null,
`type` tinytext not null,
`authors` tinytext not null,
`affil` tinytext not null,
`title` tinytext not null,
`conf` tinytext not null,
`conf_url` tinytext not null,
`where` tinytext not null,
`year` tinytext not null,
`month` float(3,1) not null,
`volume` tinytext not null,
`number` tinytext not null,
`pages` tinytext not null,
`url` tinytext not null,
`evaluated_on_emulab` tinytext not null,
`category` tinytext not null,
`project` tinytext not null,
`cite_osdi02` tinyint(1),
`no_cite_why` tinytext not null,
`notes` text not null,
`visible` tinyint(1) default 1 not null,
`deleted` tinyint(1) default 0 not null,
`editable_owner` tinyint(1) default 1 not null,
`editable_proj` tinyint(1) default 1 not null
);
drop table if exists emulab_pubs_month_map;
create table `emulab_pubs_month_map` (
`display_order` int unsigned not null unique auto_increment,
`month` float(3,1) not null primary key,
`month_name` char(8) not null
);
insert into emulab_pubs_month_map (`month`, `month_name`) values
(0, ''),
(1, 'Jan'),
(2, 'Feb'),
(3, 'Mar'),
(4, 'Apr'),
(5, 'May'),
(6, 'Jun'),
(7, 'Jul'),
(8, 'Aug'),
(9, 'Sep'),
(10, 'Oct'),
(11, 'Nov'),
(12, 'Dec'),
(1.5, 'Jan-Feb'),
(2.5, 'Feb-Mar'),
(3.5, 'Mar-Apr'),
(4.5, 'Apr-May'),
(5.5, 'May-Jun'),
(6.5, 'Jun-Jul'),
(7.5, 'Jul-Aug'),
(8.5, 'Aug-Sep'),
(9.5, 'Sep-Oct'),
(10.5, 'Oct-Nov'),
(11.5, 'Nov-Dec'),
(12.5, 'Dec-Jan');
REPLACE INTO table_regex VALUES ('default','tinytext_utf8','text','regex','^(?:[\\x20-\\x7E]|[\\xC2-\\xDF][\\x80-\\xBF]|\\xE0[\\xA0-\\xBF][\\x80-\\xBF]|[\\xE1-\\xEC\\xEE\\xEF][\\x80-\\xBF]{2}|\\xED[\\x80-\\x9F][\\x80-\\xBF])*$',0,256,'adopted from http://www.w3.org/International/questions/qa-forms-utf-8.en.php');
REPLACE INTO table_regex VALUES ('default','text_utf8','text','regex','^(?:[\\x20-\\x7E]|[\\xC2-\\xDF][\\x80-\\xBF]|\\xE0[\\xA0-\\xBF][\\x80-\\xBF]|[\\xE1-\\xEC\\xEE\\xEF][\\x80-\\xBF]{2}|\\xED[\\x80-\\x9F][\\x80-\\xBF])*$',0,65535,'adopted from http://www.w3.org/International/questions/qa-forms-utf-8.en.php');
REPLACE INTO table_regex VALUES ('default','fulltext_utf8','text','regex','^(?:[\\x09\\x0A\\x0D\\x20-\\x7E]|[\\xC2-\\xDF][\\x80-\\xBF]|\\xE0[\\xA0-\\xBF][\\x80-\\xBF]|[\\xE1-\\xEC\\xEE\\xEF][\\x80-\\xBF]{2}|\\xED[\\x80-\\x9F][\\x80-\\xBF])*$',0,65535,'adopted from http://www.w3.org/International/questions/qa-forms-utf-8.en.php');
......@@ -25,6 +25,7 @@ $TBWWW = "@TBWWW@";
$THISHOMEBASE = "@THISHOMEBASE@";
$ELABINELAB = @ELABINELAB@;
$PLABSUPPORT = @PLABSUPPORT@;
$PUBSUPPORT = @PUBSUPPORT@;
$WIKISUPPORT = @WIKISUPPORT@;
$TRACSUPPORT = @TRACSUPPORT@;
$BUGDBSUPPORT = @BUGDBSUPPORT@;
......
......@@ -88,3 +88,8 @@ else {
}
?>
This diff is collapsed.
......@@ -19,7 +19,7 @@
<br>
<li>
<font size="+1">
<a href="docwrapper.php3?docname=expubs.html"
<a href="../expubs.php"
>Published papers that have used Emulab</a>
</font>
</li>
......@@ -30,4 +30,5 @@
>Classes that have used Emulab</a>
</font>
</li>
</ul>
\ No newline at end of file
</ul>
<?php
include("pub_defs.php");
$optargs = OptionalPageArguments("printable", PAGEARG_BOOLEAN);
if (!isset($printable))
$printable = 0;
$this_user = null;
$isadmin = null;
if (!$printable && LoginStatus()) {
if (!$HTTPS) {
# redirect to secure site, otherwise CheckLoginOrDie will die
$new_url = "https://$WWWHOST$REQUEST_URI";
header("Location: $new_url");
PAGEHEADER("Bibliography");
echo "<p>Please use $new_url when logged in.</p>";
PAGEFOOTER();
return;
} else {
$this_user = CheckLoginOrDie();
$isadmin = ISADMIN();
}
}
#
# Standard Testbed Header
#
if ($printable) {
#
# Need to spit out some header stuff.
#
echo "<html>
<head>
<link rel='stylesheet' href='../tbstyle-plain.css' type='text/css'>
</head>
<body>\n";
} else {
PAGEHEADER("Bibliography");
echo "<b><a href=$REQUEST_URI?printable=1>
Printable version of this document</a></b><br>\n";
}
?>
<p>
This page summarizes publications about Emulab as well as publications
that used Emulab to validate research they present. For additional publications
see <a href="http://www.isi.edu/deter/publications.php"
>Publications Made Possible By DETERlab</a>.
<p>
If you have a publications that used Utah's Emulab to validate your
research please use <a href="submitpub.php">this form</a> to add it.
For other updates or corrections please email
<a href="mailto:papers@emulab.net">papers@emulab.net</a>.
</p>
<?php
$query_result = GetPubs("`visible`");
echo MakeBibList($this_user, $isadmin, $query_result);
if ($isadmin) {
echo '<p><a href="deleted_pubs.php">Show Deleted Publications</a></p>';
}
#
# Standard Testbed Footer
#
if ($printable) {
echo "</body>
</html>\n";
}
else {
PAGEFOOTER();
}
?>
This diff is collapsed.
......@@ -74,7 +74,7 @@ if ($message != "") {
<a href="http://www.emulab.net/docwrapper.php3?docname=otheremulabs.html">two
dozen sites</a> around the world, ranging from testbeds with a handful
of nodes up to testbeds with hundreds of nodes.
Emulab is <a href="http://www.emulab.net/doc/docwrapper.php3?docname=expubs.html">widely used</a>
Emulab is <a href="http://www.emulab.net/expubs.php">widely used</a>
by computer science researchers in the fields of networking and
distributed systems.
It is also used to <a href="http://www.emulab.net/doc/docwrapper.php3?docname=exclasses.html">teach
......
......@@ -1027,6 +1027,7 @@ function PAGEHEADER($title, $view = NULL, $extra_headers = NULL,
$login_user = null;
}
header('Content-type: text/html; charset=utf-8');
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
if (1) {
......
......@@ -55,7 +55,7 @@ Many development-oriented commercial experiments and evaluations will
be allowed, but with lower priority.
</p>
<h3>Reporting</h3>
<a name="reporting"></a><h3>Reporting</h3>
<p>
In order to assess the testbed's impact and report to our sponsors, we
simply require notice of all publications or patents to which the testbed
......
<?php
include_once("defs.php3");
function MayEditPub($user, $isadmin, $row) {
global $TBDB_TRUST_LOCALROOT;
if ($isadmin)
return true;
if (!$user)
return false;
$uid_idx = $user->uid_idx();
if ($uid_idx == $row['owner'] && $row['editable_owner'])
return true;
$pid = $row['project'];
if ($pid == '')
return false;
$proj = Project::LookupByPid($pid);
return TBMinTrust($proj->UserTrust($user), $TBDB_TRUST_LOCALROOT);
}
function MakeBib($user, $isadmin, $r) {
$res = '';
if ($r['url'] != '')
$res .= "<a href=\"" . $r['url'] . "\">";
$res .= $r['title'];
#if row[3][-1] != '.' and row[3][-1] != '?' and row[3][-1] != '!':
$res .= ".";
if ($r['url'] != '')
$res .= "</a>";
$res .= "\n";
$res .= ' ' . $r['authors'];
$res .= '.';
$type = $r['type'];
if ($type == "article") {
$res .= ' <em>' . $r['conf'] . '</em>';
if ($r['volume'] != '')
$res .= ', Vol. ' . $r['volume'];
if ($r['number'] != '') {
if ($r['volume'] != '')
$res .= ' No.';
$res .= ' ' . $r['number'];
}
if ($r['pages'] != '')
$res .= ', pages ' . $r['pages'];
if ($r['where'] != '')
$res .= ', ' . $r['where'];
# if Tech report
} else if ($type == 'techreport') {
$res .= ' Technical Report '. $r['number'];
# Affiliation here, but can't for techreports because of our data
# if Thesis
} else if ($type == 'thesis' || $type == 'ms thesis' ||
$type = 'phd thesis' || $type = 'bs thesis') {
$res .= ' Thesis';
if ($r['where'] != '')
$res .= ', ' . $r['where'];
}
# Not an Article/Tech report/Thesis? Add nothing special (for now)
if ($r['month_name'] != '' || $r['year'] != '')
$res .= ', ';
if ($r['month_name'] != '')
$res .= $r['month_name'] . ' ';
$res .= $r['year'];
if (MayEditPub($user, $isadmin, $r)) {
# $res .= " <a href=\"submitpub.php?idx=". $r['idx'] . "\" style=\"background:#ffffaa \">Edit</a>";
$res .= " <a href=\"submitpub.php?idx=". $r['idx'] . "\" style=\"background:yellow\">Edit</a>";
}
return $res;
}
function MakeBibList($user, $isadmin, $query_result) {
$res = '';
$number = 1;
$category = "\n\t xyz";
while ($r = mysql_fetch_array($query_result)) {
if ($category != $r['category']) {
if ($category != "\n\t xyz") {
$res .= "</ol>\n";
}
$category = $r['category'];
if ($category == '')
$category = 'Uncategorized';
$res .= "<h2>" . $category . "</h2>\n";
$res .= "<ol>\n";
$category = $r['category'];
}
$res .= "<li style=\"margin-bottom: 10pt\" value=$number>";
$res .= MakeBib($user, $isadmin, $r);
$res .= "</li>\n";
$number++;
}
$res .= "</ol>\n";
return $res;
}
function GetPubs($where_clause, $deleted_clause = '!`deleted`') {
return DBQueryFatal("select p.*,m.month_name,if(category = '',1,0) as category_sort from emulab_pubs as p natural join emulab_pubs_month_map as m where $where_clause and $deleted_clause order by category_sort,category,year desc,month desc,title");
}
?>
......@@ -6,6 +6,8 @@
#
include("defs.php3");
include_once("template_defs.php");
if ($PAPERSUPPORT)
include_once("paper_defs.php");
#
# Note the difference with which this page gets it arguments!
......@@ -97,6 +99,17 @@ if ($isadmin) {
ob_end_clean();
}
$papers_html = null;
if ($PAPERSUPPORT) {
#
# List papers for this project if any
#
$query_result = GetPapers("`project` = \"$pid\"");
if (mysql_num_rows($query_result)) {
$papers_html = MakeBibList($this_user, $isadmin, $query_result);
}
}
#
# Show number of PCS
#
......@@ -182,6 +195,12 @@ if ($isadmin && $stats_html) {
"id=\"li_stats\" onclick=\"Show('stats');\">".
"Project Stats</a></li>\n";
}
if ($papers_html) {
echo "<li>
<a href=\"#G\" class=topnavbar onfocus=\"this.hideFocus=true;\" ".
"id=\"li_papers\" onclick=\"Show('papers');\">".
"Publications</a></li>\n";
}
echo "</ul>\n";
echo "</div>\n";
echo "<div align=center id=topnavbarbottom>&nbsp</div>\n";
......@@ -202,6 +221,9 @@ echo "<div class=invisible id=\"div_profile\">$profile_html</div>";
if ($isadmin && $stats_html) {
echo "<div class=invisible id=\"div_stats\">$stats_html</div>";
}
if ($papers_html) {
echo "<div class=invisible id=\"div_papers\">$papers_html</div>";
}
SUBPAGEEND();
#
......
......@@ -8,6 +8,7 @@ include("defs.php3");
include("showstuff.php3");
include_once("template_defs.php");
include_once("table_defs.php");
include_once("pub_defs.php");
#
# Only known and logged in users can do this.
......@@ -15,6 +16,7 @@ include_once("table_defs.php");
$this_user = CheckLoginOrDie(CHECKLOGIN_USERSTATUS|
CHECKLOGIN_WEBONLY|CHECKLOGIN_WIKIONLY);
$uid = $this_user->uid();
$uid_idx = $this_user->uid_idx();
$isadmin = ISADMIN();
#
......@@ -66,6 +68,7 @@ else {
$html_groups = null;
$html_stats = null;
$html_templates = null;
$html_pubs = null;
#
# See if any mailman lists owned by the user. If so we add a menu item.
......@@ -291,6 +294,21 @@ if ($isadmin) {
"'>Experiment History</a>";
}
if ($PUBSUPPORT) {
#
# List pubs owned by user if any
#
$query_result = GetPubs("`owner` = $uid_idx");
if (mysql_num_rows($query_result)) {
$html_pubs = MakeBibList($this_user, $isadmin, $query_result);
$html_pubs .= '<p><a href="deleted_pubs.php">Show Deleted Publications</a></p>';
$html_pubs .= "\n";
list ($html_pubs, $button_pubs) =
TableWrapUp($html_pubs, FALSE, FALSE,
"pubs_table", "pubs_button");
}
}
#
# Special banner message.
#
......@@ -376,6 +394,12 @@ if ($isadmin && $html_stats) {
"id=\"li_stats\" onclick=\"Show('stats');\">".
"User Stats</a></li>\n";
}
if ($html_pubs) {
echo "<li>
<a href=\"#G\" class=topnavbar onfocus=\"this.hideFocus=true;\" ".
"id=\"li_pubs\" onclick=\"Show('pubs');\">".
"Publications</a></li>\n";
}
echo "</ul>\n";
echo "</div>\n";
echo "<div align=center id=topnavbarbottom>&nbsp</div>\n";
......@@ -393,6 +417,9 @@ echo $html_profile;
if ($isadmin && $html_stats) {
echo $html_stats;
}
if ($html_pubs) {
echo $html_pubs;
}
if ($html_experiments) {
echo $html_experiments;
}
......
This diff is collapsed.
......@@ -112,6 +112,7 @@ $url_mapping["experimentrun_show"] = "experimentrun_show.php";
$url_mapping["instance_show"] = "instance_show.php";
$url_mapping["cvswebwrap"] = "cvsweb/cvswebwrap.php3";
$url_mapping["profile"] = "profile.php";
$url_mapping["submitpub"] = "submitpub.php";
#
# The caller will pass in a page id, and a list of things. If the thing
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment