Beispiel #1
0
function show_transcript($per, $eid = -1, $sid = -1)
{
    $trans = new Transcript();
    $trans->setFromRequest();
    $dao = getTranscriptDAO();
    $dao->getTranscripts($trans, $eid, $sid);
    if ($trans->numResults > 0) {
        foreach ($trans->results as $t) {
            $t->person = $per;
        }
    }
    return show_transcript_details($trans);
}
Beispiel #2
0
function setup_edit()
{
    $trans = new Transcript();
    $trans->setFromRequest();
    if (!isset($trans->transcript_id)) {
        if (isset($_REQUEST["person"]) && $trans->person->person_id > 0) {
            $trans->person->queryType = Q_IND;
            $dao = getPeopleDAO();
            $dao->getPersonDetails($trans->person);
            if ($trans->person->numResults == 0) {
                $trans->person = $trans->person->results[0];
            } else {
                $trans->person = new PersonDetail();
                $trans->person->setFromRequest();
            }
        } else {
            $trans->person = new PersonDetail();
            $trans->person->setFromRequest();
        }
        $trans->source = new Source();
        $trans->source->setFromRequest();
        if ($trans->source->source_id > 0) {
            $sdao = getSourceDAO();
            $sdao->getSources($trans->source);
            if ($trans->source->numResults > 0) {
                $trans->source = $trans->source->results[0];
            }
        }
        $ret = $trans;
    } else {
        $dao = getTranscriptDAO();
        $dao->getTranscripts($trans);
        if ($trans->numResults == 0) {
            if (isset($_REQUEST["event"])) {
                $dao = getEventDAO();
                $event = new Event();
                $event->setFromRequest();
                $dao->getEvents($event, Q_ALL);
                $trans->event = $event->results[0];
                $trans->person = $trans->event->person;
            }
            if ($trans->person->person_id > 0) {
                $trans->person->queryType = Q_IND;
                $dao = getPeopleDAO();
                $dao->getPersonDetails($trans->person);
                $trans->person = $trans->person->results[0];
            } else {
                $trans->person = new PersonDetail();
            }
            $trans->source = new Source();
            $trans->source->setFromRequest();
            if ($trans->source->source_id > 0) {
                $sdao = getSourceDAO();
                $sdao->getSources($trans->source);
                if ($trans->source->numResults > 0) {
                    $trans->source = $trans->source->results[0];
                }
            }
            $ret = $trans;
        } else {
            $ret = $trans->results[0];
        }
    }
    return $ret;
}
Beispiel #3
0
//Copyright (C) 2002 - 2005  Simon E Booth (simon.booth@giric.com)
//This program 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.
//This program 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 this program; if not, write to the Free Software
//Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
// include the configuration parameters and function
include_once "modules/db/DAOFactory.php";
$trans = new Transcript();
$trans->setFromRequest();
$dao = getTranscriptDAO();
$dao->getTranscripts($trans);
foreach ($trans->results as $doc) {
    if (!$doc->person->isViewable()) {
        continue;
    }
    // see if we have mime capabilities
    if (function_exists("mime_content_type")) {
        $type = mime_content_type($doc->getFileName());
    } else {
        $type = "application/unknown";
    }
    // fire off a few headers
    header("Content-Location: " . $doc->getFileName());
    header("Content-Type: " . $type);