From a2b2adeee9c3e435face6c9bca35f0d6ca8c28eb Mon Sep 17 00:00:00 2001 From: Mike Taylor Date: Thu, 16 Nov 2006 11:50:03 +0000 Subject: [PATCH] DOn't use ZOOM -- layout.mc does that. Refactor to make only a single call to form.mc --- web/htdocs/details/edit.mc | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/web/htdocs/details/edit.mc b/web/htdocs/details/edit.mc index 28f46db..e66684d 100644 --- a/web/htdocs/details/edit.mc +++ b/web/htdocs/details/edit.mc @@ -1,17 +1,12 @@ -%# $Id: edit.mc,v 1.11 2006-11-15 17:56:23 mike Exp $ +%# $Id: edit.mc,v 1.12 2006-11-16 11:50:03 mike Exp $ <%args> $id => undef -<%once> -use ZOOM; - <%perl> my $conn = new ZOOM::Connection("localhost:3313/IR-Explain---1", 0, user => "admin", password => "fruitbat"); -if (!defined $id || $id eq "") { - $m->comp("/details/form.mc", id => undef, conn => $conn, - rec => ''); -} else { +my $rec = ''; +if (defined $id && $id ne "") { $conn->option(elementSetName => "zeerex"); my $qid = $id; $qid =~ s/"/\\"/g; @@ -19,11 +14,10 @@ if (!defined $id || $id eq "") { my $rs = $conn->search(new ZOOM::Query::CQL($query)); my $n = $rs->size(); if ($n == 0) { - $m->comp("/details/form.mc", id => undef, conn => $conn, - rec => ''); + $id = undef; } else { - my $rec = $rs->record(0); - $m->comp("/details/form.mc", id => $id, conn => $conn, rec => $rec); + $rec = $rs->record(0); } } +<& /details/form.mc, id => $id, conn => $conn, rec => $rec &> -- 1.7.10.4