예제 #1
0
/***************************************************************************
 *   nolink.php                                                            *
 *   Yggdrasil: Unidentified people mentioned in sources                   *
 *   (Part of the experimental source linkage                              *
 *                                                                         *
 *   Copyright (C) 2009-2011 by Leif B. Kristensen <*****@*****.**>   *
 *   All rights reserved. For terms of use, see LICENSE.txt                *
 ***************************************************************************/
require "./settings/settings.php";
require_once "./langs/{$language}.php";
require "./functions.php";
$title = 'Uidentifiserte personer';
require "./header.php";
echo "<div class=\"normal\">\n";
echo "<h2>Uidentifiserte personer fra lenking:</h2>\n";
$handle = pg_query("\n    SELECT\n        s.source_id AS source,\n        part_ldesc(s.part_type) AS s_type,\n        get_lsurety(l.surety_fk) AS surety,\n        get_lrole(l.role_fk) AS rolle,\n        l.s_name AS name,\n        get_source_text(s.source_id) AS txt,\n        link_expand(l.sl_note) AS note\n    FROM\n        sources s,\n        source_linkage l\n    WHERE\n        l.source_fk = s.source_id\n    AND\n        l.person_fk IS NULL\n    ORDER BY\n        s.source_date,\n        s.sort_order,\n        l.per_id\n");
echo "<ol>\n";
while ($row = pg_fetch_assoc($handle)) {
    $principal = fetch_val("\n        SELECT person_fk FROM source_linkage\n        WHERE source_fk = " . $row['source'] . " AND role_fk = 1\n    ");
    echo "<li>" . bold($row['name']) . '<br />' . $row['surety'] . ' ' . $row['rolle'] . ' ved ' . $row['s_type'];
    if ($principal) {
        echo ' av ' . linked_name($principal, './family.php');
    }
    echo '. ' . $row['txt'];
    echo conc(italic($row['note']));
    echo conc(paren(to_url('./source_manager.php', array('node' => $row['source']), 'Til kildebehandler')));
    echo "</li>\n";
}
echo "</ol>\n";
echo "</div>\n";
include "./footer.php";
예제 #2
0
function list_mentioned($node, $hotlink = 0)
{
    global $app_path, $_edit, $_delete;
    echo "<ol>\n";
    $handle = pg_query("\n        SELECT\n            per_id,\n            get_role(role_fk) AS rolle,\n            person_fk,\n            get_surety(surety_fk) AS surety,\n            s_name,\n            link_expand(sl_note) AS note\n        FROM\n            source_linkage\n        WHERE\n            source_fk = {$node}\n        ORDER BY\n            role_fk,\n            per_id\n    ");
    while ($row = pg_fetch_assoc($handle)) {
        echo '<li>' . $row['rolle'] . ': ';
        echo '«' . $row['s_name'] . '»';
        if ($row['person_fk']) {
            echo conc(curly_brace($row['surety'])) . conc(linked_name($row['person_fk'], "{$app_path}/family.php"));
        }
        if (has_parents($row['person_fk'])) {
            echo conc(child_of($row['person_fk']));
        }
        if ($row['note']) {
            echo ': ' . $row['note'];
        }
        if ($hotlink) {
            echo conc(paren(to_url("{$app_path}/forms/linkage_edit.php", array('node' => $node, 'id' => $row['per_id']), $_edit) . ' / ' . to_url("{$app_path}/forms/linkage_delete.php", array('node' => $node, 'id' => $row['per_id']), $_delete)));
        }
        echo "</li>\n";
    }
    if ($hotlink) {
        echo '<li>' . to_url("{$app_path}/forms/linkage_add.php", array('node' => $node), "Legg til lenke") . "</li>\n";
    }
    echo "</ol>\n";
}
예제 #3
0
$place_id = $_GET['place_id'];
$place_name = fetch_val("SELECT get_place_name({$place_id})");
$title = "Hendelser knyttet til stedsnavn \"{$place_name}\"";
require "./header.php";
echo "<div class=\"normal\">\n";
echo "<h2>{$title}</h2>\n";
echo "<p><a href=\"./place_manager.php\">Alle stedsnavn</a></p>\n";
echo "<table>\n";
echo "<tr><th>ID</th><th>Hendelse</th><th>Dato</th><th>Deltagere</th></tr>\n";
$handle = pg_query("SELECT event_id, event_name, event_date, p1, p2\n                        FROM place_events WHERE place_fk = {$place_id} ORDER BY event_date");
while ($row = pg_fetch_assoc($handle)) {
    unset($participant_list);
    $event = $row['event_id'];
    $p_handle = pg_query("SELECT person_fk FROM participants\n                            WHERE event_fk = {$event} ORDER BY sort_order");
    while ($parts = pg_fetch_row($p_handle)) {
        $participant_list[] = linked_name($parts[0], './family.php');
    }
    echo "<tr>";
    echo "<td>" . $row['event_id'] . "</td>";
    echo "<td>" . $row['event_name'] . "</td>";
    echo "<td>" . fuzzydate($row['event_date']) . "</td>";
    echo '<td>' . join($participant_list, ', ') . '</td>';
    //    echo "<td>" . $row['p1'] . ' ' . linked_name($row['p1'], './family.php') . "</td>";
    //    if ($row['p2'])
    //        echo "<td>" . $row['p2'] . ' ' . linked_name($row['p2'], './family.php') . "</td>";
    echo "</tr>\n";
}
echo "</table>\n";
echo "<p><a href=\"./place_manager.php\">Alle stedsnavn</a></p>\n";
echo "</div>\n";
include "./footer.php";
<?php

/***************************************************************************
 *   get_coprincipal.php                                                   *
 *   Yggdrasil: return person id input field + name for dynamic update     *
 *                                                                         *
 *   Copyright (C) 2006-2011 by Leif B. Kristensen <*****@*****.**>   *
 *   All rights reserved. For terms of use, see LICENSE.txt                *
 ***************************************************************************/
require "../settings/settings.php";
require "../functions.php";
$person = $_GET['person'];
$event = $_GET['event'];
$event_type = $_GET['event_type'];
if (has_coprincipal($event_type)) {
    $coprincipal = get_second_principal($event, $person);
    echo "Med <input type=\"text\" size=\"10\" value=\"{$coprincipal}\" ";
    // dynamic AJAX update of source text
    echo "name=\"coprincipal\" onchange=\" get_name(this.value)\">";
    echo "<span id=\"name\">";
    echo ' ' . linked_name($coprincipal, '../family.php');
    echo "</span>\n";
}
?>

예제 #5
0
function get_principals($e)
{
    global $_and;
    $handle = pg_query("\n        SELECT\n            person_fk\n        FROM\n            participants\n        WHERE\n            event_fk={$e} AND is_principal IS TRUE\n        ORDER BY\n            sort_order\n        ");
    while ($row = pg_fetch_row($handle)) {
        $p[] = linked_name($row[0]);
    }
    return join($p, " {$_and} ");
}
<?php

/***************************************************************************
 *   get_name_string.php                                                   *
 *   Yggdrasil: return person name for dynamic update                      *
 *                                                                         *
 *   Copyright (C) 2006-2011 by Leif B. Kristensen <*****@*****.**>   *
 *   All rights reserved. For terms of use, see LICENSE.txt                *
 ***************************************************************************/
require "../settings/settings.php";
require "../functions.php";
$person_id = $_GET['id'];
if ($person_id) {
    echo ' ' . linked_name($person_id, '../family.php');
} else {
    echo ' [Undefined]';
}
예제 #7
0
function person_id_input($person_id, $fieldname, $prompt = '')
{
    // generalised version of above func
    // input person_id, dynamically updates with linked name
    $person_id ? $pstr = $person_id : ($pstr = '');
    echo "<tr><td>{$prompt}</td><td><input type=\"text\" size=\"10\" value=\"{$pstr}\" ";
    echo "name=\"{$fieldname}\" onchange=\" get_name(this.value)\">";
    echo "<span id=\"name\">";
    echo ' ' . linked_name($person_id, '../family.php');
    echo "</span></td></tr>\n";
}
            echo "</ul>\n";
        }
        echo "</li>\n";
    }
    echo "</ol>\n";
}
// *****************************************************************************
// section II: print list of relations cited by this source
// *****************************************************************************
if ($props['number_of_relations']) {
    $child[1] = $_son;
    $child[2] = $_daughter;
    echo "<h3>{$_Relations}:</h3>\n<ol>";
    $handle = pg_query("\n        SELECT\n            r.relation_id,\n            r.parent_fk,\n            r.child_fk,\n            get_lsurety(r.surety_fk) AS surety\n        FROM\n            relations r,\n            relation_citations c\n        WHERE\n            c.relation_fk = r.relation_id\n        AND\n            c.source_fk = {$self}\n        ORDER BY\n            get_pbdate(r.child_fk),\n            r.child_fk,\n            get_gender(r.parent_fk)\n    ");
    while ($row = pg_fetch_assoc($handle)) {
        echo li(linked_name($row['child_fk'], './family.php') . " {$_is} " . $row['surety'] . ' ' . $child[get_gender($row['child_fk'])] . " {$_of} " . linked_name($row['parent_fk'], './family.php'));
    }
    echo "</ol>\n";
}
// *****************************************************************************
// section III: print list of subsources
// *****************************************************************************
if ($props['number_of_subsources']) {
    echo "<h3>{$_Subsources}:</h3>\n";
    echo "<table>";
    $handle = pg_query("\n        SELECT\n            source_id,\n            link_expand(source_text) AS txt,\n            sort_order,\n            source_date,\n            ecc(source_id) AS e,\n            rcc(source_id) AS r,\n            ssc(source_id) AS s,\n            usc(source_id) AS u,\n            spt.{$label} AS {$label}\n        FROM\n            sources, source_part_types spt\n        WHERE\n            spt.part_type_id = sources.part_type\n        AND\n            parent_id = {$self}\n        AND\n            source_id <> 0\n        ORDER BY\n            sort_order,\n            source_date,\n            source_text\n    ");
    // change between FALSE and TRUE to select terse / informative mode
    $friendly = TRUE;
    while ($row = pg_fetch_assoc($handle)) {
        $id = $row['source_id'];
        echo '<tr>';