This commit is contained in:
Michael Wesemann
2024-05-16 11:27:57 +02:00
parent bccef860dd
commit b7c82845da
12 changed files with 364 additions and 42 deletions

View File

@@ -1,5 +1,6 @@
<?
include_once('init.php');include_once('header.php');
include_once('Parsedown.php');
$mode=getpar('mode');
$docid=getpar('docid');
@@ -69,6 +70,24 @@
<? ///////////////////////////////////////////////////////////////////////////////////// display single entry ?>
<? if ($numrows==1) { ?>
<?
if ($mode==='print') {
exec("/db/bin/qrlabel $id '".$row['user']."' '".$row['f0']."'");
$connection = ssh2_connect('ripley.rz-berlin.mpg.de', 22,array('hostkey' => 'ssh-rsa'));
ssh2_auth_pubkey_file($connection, 'root','/db/ssh/id_rsa.pub','/db/ssh/id_rsa');
ssh2_scp_send($connection, "/db/tmp/$id.png", "/tmp/$id.png", 0644);
ssh2_exec($connection, "/usr/bin/lp -o fit-to-page -d archivzebra /tmp/$id.png");
ssh2_exec($connection, "/bin/rm /tmp/$id.png");
header("Location: /$id");exit;
}
?>
<? subheader(); ?>
<H3>Metadata</H3> <? // metedata table ?>
@@ -79,6 +98,12 @@
<A HREF="/<?=$xid?>/edit" CLASS='icon'>
<IMG HEIGHT=16 TITLE='Edit' SRC="/img/pencil.png"></A>
<? if (isset($LABELPRINTER)) { ?>
<A HREF="/<?=$xid?>/print" CLASS='icon'>
<IMG HEIGHT=16 TITLE='Print Label' SRC="/img/print.png"></A>
<? } ?>
<A HREF="/<?=$xid?>/copy" CLASS='icon'>
<IMG HEIGHT=16 TITLE='Copy' SRC="/img/copy.png"></A>
@@ -97,13 +122,22 @@
<IMG HEIGHT=16 TITLE='Delete' SRC="/img/trash.png"></A>
<? } ?>
<? if ($row['fixed']==1) { ?>
<A HREF="/<?=$xid?>/copy" CLASS='icon'>
<IMG HEIGHT=16 TITLE='Copy' SRC="/img/copy.png"></A>
<A HREF="/<?=$xid?>/clone" CLASS='icon'>
<IMG HEIGHT=16 TITLE='Clone' SRC="/img/clone.png"></A>
&nbsp;&nbsp;&nbsp;
<IMG HEIGHT=11 TITLE='' SRC="/img/lock_grey.png">
<SPAN STYLE='font-size:80%;color:#CCC;'>fixed entry</SPAN>
<? } ?>
</TD></TR>
<? } ?>
<TR><TH ALIGN=left>Id</TH><TD><?= $row['id'] ?><? if ($TAG==='DEV') {?> / <?= $row['catid']?><? } ?></TD></TR>
<TR><TH ALIGN=left>Id</TH><TD><?= $row['id'] ?>
<? if ($TAG==='DEV') {?> / <?= $row['catid']?><? } ?></TD></TR>
<? if (count($gen)) { ?>
<TR><TH ALIGN=left>Ancestry:</TH>
@@ -190,6 +224,19 @@
$tmp=AL($row["f$n"]);
}
?>
<?
if ($f[0]==='Comment' || $f[0]==='Abstract') {
//$tmp=preg_replace('/\n/', "<BR>", $tmp);
$Parsedown = new Parsedown();
$tmp= $Parsedown->text($tmp);
}
?>
<TR><TH ALIGN=left><?= $f[0] ?></TH><TD><?= $tmp ?></TD></TR>
<? } ?>
<? } ?>
@@ -252,8 +299,9 @@
<? } ?>
<? // ----------------------------------------------------------------------------------------- document table
<?= $_SESSION['s_ft'] ?>
<? // ----------------------------------------------------------------------------------------- document table
$fres=mydo($DB,"SELECT count(*) AS c FROM docs WHERE catid=".$row['catid']." AND rm=0",1);
$frow = mysqli_fetch_assoc($fres);
$fnumrows=$frow['c'];
@@ -290,8 +338,16 @@
<? while($row = mysqli_fetch_assoc($res)) { ?>
<TR>
<TD><A HREF="/send/<?= idencode($catid,$row['docid'])?>"><?= $row['docid'] ?></A></TD>
<TD><A HREF="/send/<?= idencode($catid,$row['docid'])?>"><?= $row['filename'] ?></A></TD>
<TD>
<? if (isset($_SESSION['ftres'][$row['docid']])) {?><B><?}?>
<A HREF="/send/<?= idencode($catid,$row['docid'])?>"><?= $row['docid'] ?></A>
<? if (isset($_SESSION['ftres'][$row['docid']])) {?></B><?}?>
</TD>
<TD>
<? if (isset($_SESSION['ftres'][$row['docid']])) {?><B><?}?>
<A HREF="/send/<?= idencode($catid,$row['docid'])?>"><?= $row['filename'] ?></A>
<? if (isset($_SESSION['ftres'][$row['docid']])) {?></B><?}?>
</TD>
<TD><?= $row['ts'] ?></TD>
<TD><?= $row['comment'] ?></TD>
<TD ALIGN=center><?= formsize($row['size']) ?></TD>
@@ -384,7 +440,8 @@
<DIV id=head>
<FORM action="/" method="post">
<TABLE WIDTH=100%>
<TR><TD VALIGN=top><H2>Type:</H2></TD><TD><? if ($TYPE==='ALL') $tmp="button"; else $tmp="ubutton"; ?>
<TR><TD VALIGN=top WIDTH=10><H2>Type:</H2></TD><TD>
<? if ($TYPE==='ALL') $tmp="button"; else $tmp="ubutton"; ?>
<input type="submit" name="type" value="ALL" class="<?=$tmp?>">
<? foreach($TYPES as $t) { ?>
<? if (SU($t)===SU($TYPE)) $tmp="button"; else $tmp="ubutton"; ?>
@@ -400,7 +457,8 @@
</FORM></TD>
</TR>
<TR><TD VALIGN=top><H2>Project:</H2></TD><TD><? if ($PROJECT==='ALL') $tmp="button"; else $tmp="ubutton"; ?>
<TR><TD VALIGN=top WIDTH=10><H2>Project:</H2></TD><TD>
<? if ($PROJECT==='ALL') $tmp="button"; else $tmp="ubutton"; ?>
<input type="submit" name="project" value="ALL" class="<?=$tmp?>">
<? foreach($USERPROJECTS as $pid => $pname) { ?>
<? if (SU($pname)===SU($PROJECT)) $tmp="button"; else $tmp="ubutton"; ?>