Exemplo n.º 1
0
echo '<div id="repo-edit">';
echo '<table class="facts_table">';
// Fetch the facts
$facts = $controller->record->getFacts();
// Sort the facts
usort($facts, function (WT_Fact $x, WT_Fact $y) {
    static $order = array('NAME' => 0, 'ADDR' => 1, 'NOTE' => 2, 'WWW' => 3, 'REFN' => 4, 'RIN' => 5, '_UID' => 6, 'CHAN' => 7);
    return (array_key_exists($x->getTag(), $order) ? $order[$x->getTag()] : PHP_INT_MAX) - (array_key_exists($y->getTag(), $order) ? $order[$y->getTag()] : PHP_INT_MAX);
});
// Print the facts
foreach ($facts as $fact) {
    print_fact($fact, $controller->record);
}
// new fact link
if ($controller->record->canEdit()) {
    print_add_new_fact($controller->record->getXref(), $facts, 'REPO');
    // new media
    if (get_gedcom_setting(WT_GED_ID, 'MEDIA_UPLOAD') >= WT_USER_ACCESS_LEVEL) {
        echo '<tr><td class="descriptionbox">';
        echo WT_Gedcom_Tag::getLabel('OBJE');
        echo '</td><td class="optionbox">';
        echo '<a href="#" onclick="window.open(\'addmedia.php?action=showmediaform&amp;linktoid=', $controller->record->getXref(), '\', \'_blank\', edit_window_specs); return false;">', WT_I18N::translate('Add a new media object'), '</a>';
        echo help_link('OBJE');
        echo '<br>';
        echo '<a href="#" onclick="window.open(\'inverselink.php?linktoid=', $controller->record->getXref(), '&amp;linkto=repository\', \'_blank\', find_window_specs); return false;">', WT_I18N::translate('Link to an existing media object'), '</a>';
        echo '</td></tr>';
    }
}
echo '</table>
	</div>';
// Sources linked to this repository
Exemplo n.º 2
0
    function print_facts_tab()
    {
        global $FACT_COUNT, $CONTACT_EMAIL, $PGV_IMAGE_DIR, $PGV_IMAGES, $pgv_lang, $EXPAND_RELATIVES_EVENTS;
        global $n_chil, $n_gchi, $n_ggch;
        global $EXPAND_RELATIVES_EVENTS, $LANGUAGE, $lang_short_cut;
        global $Fam_Navigator, $NAV_FACTS;
        /*if (isset($_COOKIE['row_rela'])) $EXPAND_RELATIVES_EVENTS = ($_COOKIE['row_rela']);
        		if (isset($_COOKIE['row_histo'])) $EXPAND_HISTO_EVENTS = ($_COOKIE['row_histo']);
        		else*/
        $EXPAND_HISTO_EVENTS = false;
        //-- only need to add family facts on this tab
        $this->indi->add_family_facts();
        // Use Show or Hide Navigator Cookie -----------
        if (isset($_COOKIE['famnav'])) {
            $Fam_Navigator = $_COOKIE['famnav'];
        } else {
            $Fam_Navigator = "YES";
        }
        // Hide/Show the Family Navigator on this tab =========
        if (isset($NAV_FACTS) && $NAV_FACTS == "SHOW") {
            $Fam_Navigator = "YES";
        } else {
            $Fam_Navigator = "HIDE";
        }
        // ===============================================
        if ($Fam_Navigator == "YES") {
            print "<table cellpadding=\"0\" ><tr><td valign=\"top\" width=\"100%\" >";
        }
        ?>
		<table class="facts_table" style="margin-top:-2px;" cellpadding="0">
		<?php 
        if (!$this->indi->canDisplayDetails()) {
            print "<tr><td class=\"facts_value\" colspan=\"2\">";
            print_privacy_error($CONTACT_EMAIL);
            print "</td></tr>";
        } else {
            $indifacts = $this->getIndiFacts();
            if (count($indifacts) == 0) {
                ?>
				<tr>
					<td id="no_tab1" colspan="2" class="facts_value"><?php 
                echo $pgv_lang["no_tab1"];
                ?>
					</td>
				</tr>
			<?php 
            }
            ?>
			<tr id="row_top">
				<td valign="top"></td>
				<td class="descriptionbox rela">
					<input id="checkbox_rela" type="checkbox" <?php 
            if ($EXPAND_RELATIVES_EVENTS) {
                echo " checked=\"checked\"";
            }
            ?>
 onclick="toggleByClassName('TR', 'row_rela');" />
					<label for="checkbox_rela"><?php 
            echo $pgv_lang["relatives_events"];
            ?>
</label>
					<?php 
            if (file_exists("languages/histo." . $lang_short_cut[$LANGUAGE] . ".php")) {
                ?>
						<input id="checkbox_histo" type="checkbox" <?php 
                if ($EXPAND_HISTO_EVENTS) {
                    echo " checked=\"checked\"";
                }
                ?>
 onclick="toggleByClassName('TR', 'row_histo');" />
						<label for="checkbox_histo"><?php 
                echo $pgv_lang["historical_facts"];
                ?>
</label>
					<?php 
            }
            ?>
				</td>

			</tr>
			<?php 
            $yetdied = false;
            $n_chil = 1;
            $n_gchi = 1;
            $n_ggch = 1;
            foreach ($indifacts as $key => $value) {
                if ($value->getTag() == "DEAT") {
                    $yetdied = true;
                }
                if ($value->getTag() == "CREM") {
                    $yetdied = true;
                }
                if ($value->getTag() == "BURI") {
                    $yetdied = true;
                }
                if (!is_null($value->getFamilyId())) {
                    if (!$yetdied) {
                        print_fact($value);
                    }
                } else {
                    print_fact($value);
                }
                $FACT_COUNT++;
            }
        }
        //-- new fact link
        if (!$this->isPrintPreview() && PGV_USER_CAN_EDIT && $this->indi->canDisplayDetails()) {
            print_add_new_fact($this->pid, $indifacts, "INDI");
        }
        ?>
		</table>
		<?php 
        // ==================== Start Details Tab Navigator ========================================
        if ($Fam_Navigator == "YES") {
            ?>
			</td>
			<td valign="top">
				<table class="optionbox" width="220px" cellpadding="0"><tr><td align="center">
				<b><?php 
            print $pgv_lang["view_fam_nav_details"];
            ?>
</b><br /><br />
				<?php 
            include_once 'includes/family_nav.php';
            ?>
				<br />
				</td></tr></table>
			</td></tr></table>
			<?php 
        }
        // ==================== End Details Tab Navigator ========================================= */
        ?>
		<br />
		<script language="JavaScript" type="text/javascript">
		<!--
		<?php 
        if (!$EXPAND_RELATIVES_EVENTS) {
            print "toggleByClassName('TR', 'row_rela');\n";
        }
        if (!$EXPAND_HISTO_EVENTS) {
            print "toggleByClassName('TR', 'row_histo');\n";
        }
        ?>
		//-->
		</script>
		<?php 
    }
Exemplo n.º 3
0
 public function getTabContent()
 {
     global $EXPAND_RELATIVES_EVENTS, $controller;
     $EXPAND_HISTO_EVENTS = false;
     $indifacts = array();
     // The individual’s own facts
     foreach ($controller->record->getFacts() as $fact) {
         switch ($fact->getTag()) {
             case 'SEX':
             case 'NAME':
             case 'SOUR':
             case 'OBJE':
             case 'NOTE':
             case 'FAMC':
             case 'FAMS':
                 break;
             default:
                 if (!array_key_exists('extra_info', WT_Module::getActiveSidebars()) || !extra_info_WT_Module::showFact($fact)) {
                     $indifacts[] = $fact;
                 }
                 break;
         }
     }
     // Add spouse-family facts
     foreach ($controller->record->getSpouseFamilies() as $family) {
         foreach ($family->getFacts() as $fact) {
             switch ($fact->getTag()) {
                 case 'SOUR':
                 case 'NOTE':
                 case 'OBJE':
                 case 'CHAN':
                 case '_UID':
                 case 'RIN':
                 case 'HUSB':
                 case 'WIFE':
                 case 'CHIL':
                     break;
                 default:
                     $indifacts[] = $fact;
                     break;
             }
         }
         $spouse = $family->getSpouse($controller->record);
         if ($spouse) {
             foreach (self::spouse_facts($controller->record, $spouse) as $fact) {
                 $indifacts[] = $fact;
             }
         }
         foreach (self::child_facts($controller->record, $family, '_CHIL', '') as $fact) {
             $indifacts[] = $fact;
         }
     }
     foreach (self::parent_facts($controller->record, 1) as $fact) {
         $indifacts[] = $fact;
     }
     foreach (self::historical_facts($controller->record) as $fact) {
         $indifacts[] = $fact;
     }
     foreach (self::associate_facts($controller->record) as $fact) {
         $indifacts[] = $fact;
     }
     sort_facts($indifacts);
     ob_start();
     echo '<table class="facts_table">';
     echo '<tbody>';
     if (!$indifacts) {
         echo '<tr><td colspan="2" class="facts_value">', WT_I18N::translate('There are no facts for this individual.'), '</td></tr>';
     }
     echo '<tr><td colspan="2" class="descriptionbox rela"><form action="?"><input id="checkbox_rela_facts" type="checkbox"';
     if ($EXPAND_RELATIVES_EVENTS) {
         echo ' checked="checked"';
     }
     echo ' onclick="jQuery(\'tr.rela\').toggle();"><label for="checkbox_rela_facts">', WT_I18N::translate('Events of close relatives'), '</label>';
     if (file_exists(WT_Site::preference('INDEX_DIRECTORY') . 'histo.' . WT_LOCALE . '.php')) {
         echo ' <input id="checkbox_histo" type="checkbox"';
         if ($EXPAND_HISTO_EVENTS) {
             echo ' checked="checked"';
         }
         echo ' onclick="jQuery(\'tr.histo\').toggle();"><label for="checkbox_histo">', WT_I18N::translate('Historical facts'), '</label>';
     }
     echo '</form></td></tr>';
     foreach ($indifacts as $fact) {
         print_fact($fact, $controller->record);
     }
     //-- new fact link
     if ($controller->record->canEdit()) {
         print_add_new_fact($controller->record->getXref(), $indifacts, 'INDI');
     }
     echo '</tbody>';
     echo '</table>';
     if (!$EXPAND_RELATIVES_EVENTS) {
         echo '<script>jQuery("tr.rela").toggle();</script>';
     }
     if (!$EXPAND_HISTO_EVENTS) {
         echo '<script>jQuery("tr.histo").toggle();</script>';
     }
     return '<div id="' . $this->getName() . '_content">' . ob_get_clean() . '</div>';
 }
Exemplo n.º 4
0
/**
 * print the facts table for a family
 *
 * @param string $famid family gedcom ID
 * @param int $sosa optional child sosa number
 */
function print_family_facts(&$family, $sosa = 0)
{
    global $pgv_lang, $pbwidth, $pbheight, $view;
    global $nonfacts, $factarray;
    global $TEXT_DIRECTION, $GEDCOM, $SHOW_ID_NUMBERS;
    global $show_changes, $pgv_changes;
    global $linkToID;
    $famid = $family->getXref();
    // -- if both parents are displayable then print the marriage facts
    if ($family->canDisplayDetails()) {
        $linkToID = $famid;
        // -- Tell addmedia.php what to link to
        // -- array of GEDCOM elements that will be found but should not be displayed
        $nonfacts = array("FAMS", "FAMC", "MAY", "BLOB", "HUSB", "WIFE", "CHIL", "");
        // -- find all the fact information
        $indifacts = $family->getFacts();
        if (count($indifacts) > 0) {
            sort_facts($indifacts);
            print "\n\t<span class=\"subheaders\">" . $pgv_lang["family_group_info"];
            if ($SHOW_ID_NUMBERS and $famid != "") {
                print "&nbsp;&nbsp;&nbsp;({$famid})";
            }
            print "</span><br />\n\t<table class=\"facts_table\">";
            /* @var $value Event */
            foreach ($indifacts as $key => $value) {
                if ($value->getTag() != "SOUR" && $value->getTag() != "OBJE" && $value->getTag() != "NOTE") {
                    print_fact($value);
                }
            }
            // do not print otheritems for sosa
            if ($sosa == 0) {
                foreach ($indifacts as $key => $value) {
                    $fact = $value->getTag();
                    // -- handle special source fact case
                    if ($fact == "SOUR") {
                        print_main_sources($value->getGedComRecord(), 1, $famid, $value->getLineNumber());
                    } else {
                        if ($fact == "NOTE") {
                            print_main_notes($value->getGedComRecord(), 1, $famid, $value->getLineNumber());
                        }
                    }
                }
                // NOTE: Print the media
                print_main_media($famid);
            }
        } else {
            if ($sosa == 0) {
                print "\n\t<span class=\"subheaders\">" . $pgv_lang["family_group_info"];
                if ($SHOW_ID_NUMBERS and $famid != "") {
                    print "&nbsp;&nbsp;&nbsp;({$famid})";
                }
                print "</span><br />\n\t";
            }
            print "<table class=\"facts_table\">";
            if ($sosa == 0) {
                print "<tr><td class=\"messagebox\" colspan=\"2\">";
                print $pgv_lang["no_family_facts"];
                print "</td></tr>\n";
            }
        }
        // -- new fact link
        if ($view != "preview" && $sosa == 0 && PGV_USER_CAN_EDIT) {
            print_add_new_fact($famid, $indifacts, "FAM");
            // -- new note
            print "<tr><td class=\"descriptionbox\">";
            print_help_link("add_note_help", "qm", "add_note_lbl");
            print $pgv_lang["add_note_lbl"] . "</td>";
            print "<td class=\"optionbox\">";
            print "<a href=\"javascript:;\" onclick=\"return add_new_record('{$famid}','NOTE');\">" . $pgv_lang["add_note"] . "</a>";
            print "<br />\n";
            print "</td></tr>\n";
            // -- new shared note
            print "<tr><td class=\"descriptionbox\">";
            print_help_link("add_shared_note_help", "qm", "add_shared_note_lbl");
            print $pgv_lang["add_shared_note_lbl"] . "</td>";
            print "<td class=\"optionbox\">";
            print "<a href=\"javascript:;\" onclick=\"return add_new_record('{$famid}','SHARED_NOTE');\">" . $pgv_lang["add_shared_note"] . "</a>";
            print "<br />\n";
            print "</td></tr>\n";
            // -- new media
            print "<tr><td class=\"descriptionbox\">";
            print_help_link("add_media_help", "qm", "add_media_lbl");
            print $pgv_lang["add_media_lbl"] . "</td>";
            print "<td class=\"optionbox\">";
            print "<a href=\"javascript: " . $pgv_lang["add_media_lbl"] . "\" onclick=\"window.open('addmedia.php?action=showmediaform&linktoid={$famid}', '_blank', 'top=50,left=50,width=600,height=500,resizable=1,scrollbars=1'); return false;\">" . $pgv_lang["add_media"] . "</a>";
            print "<br />\n";
            print "<a href=\"javascript:;\" onclick=\"window.open('inverselink.php?linktoid={$famid}&linkto=family', '_blank', 'top=50,left=50,width=400,height=300,resizable=1,scrollbars=1'); return false;\">" . $pgv_lang["link_to_existing_media"] . "</a>";
            print "</td></tr>\n";
            // -- new source citation
            print "<tr><td class=\"descriptionbox\">";
            print_help_link("add_source_help", "qm", "add_source_lbl");
            print $pgv_lang["add_source_lbl"] . "</td>";
            print "<td class=\"optionbox\">";
            print "<a href=\"javascript:;\" onclick=\"return add_new_record('{$famid}','SOUR');\">" . $pgv_lang["add_source"] . "</a>";
            print "<br />\n";
            print "</td></tr>\n";
            // -- end new objects
        }
        print "\n\t</table>\n";
    }
}
Exemplo n.º 5
0
 public function printFamilyFacts()
 {
     global $linkToID;
     $linkToID = $this->record->getXref();
     // -- Tell addmedia.php what to link to
     $indifacts = $this->record->getFacts();
     if ($indifacts) {
         sort_facts($indifacts);
         foreach ($indifacts as $fact) {
             print_fact($fact, $this->record);
         }
     } else {
         echo '<tr><td class="messagebox" colspan="2">', WT_I18N::translate('No facts for this family.'), '</td></tr>';
     }
     if (WT_USER_CAN_EDIT) {
         print_add_new_fact($this->record->getXref(), $indifacts, 'FAM');
         echo '<tr><td class="descriptionbox">';
         echo WT_Gedcom_Tag::getLabel('NOTE');
         echo '</td><td class="optionbox">';
         echo "<a href=\"#\" onclick=\"return add_new_record('" . $this->record->getXref() . "','NOTE');\">", WT_I18N::translate('Add a new note'), '</a>';
         echo help_link('add_note');
         echo '</td></tr>';
         echo '<tr><td class="descriptionbox">';
         echo WT_Gedcom_Tag::getLabel('SHARED_NOTE');
         echo '</td><td class="optionbox">';
         echo "<a href=\"#\" onclick=\"return add_new_record('" . $this->record->getXref() . "','SHARED_NOTE');\">", WT_I18N::translate('Add a new shared note'), '</a>';
         echo help_link('add_shared_note');
         echo '</td></tr>';
         if (get_gedcom_setting(WT_GED_ID, 'MEDIA_UPLOAD') >= WT_USER_ACCESS_LEVEL) {
             echo '<tr><td class="descriptionbox">';
             echo WT_Gedcom_Tag::getLabel('OBJE');
             echo '</td><td class="optionbox">';
             echo "<a href=\"#\" onclick=\"window.open('addmedia.php?action=showmediaform&amp;linktoid=" . $this->record->getXref() . "', '_blank', edit_window_specs); return false;\">", WT_I18N::translate('Add a new media object'), '</a>';
             echo help_link('OBJE');
             echo '<br>';
             echo "<a href=\"#\" onclick=\"window.open('inverselink.php?linktoid=" . $this->record->getXref() . "&amp;linkto=family', '_blank', find_window_specs); return false;\">", WT_I18N::translate('Link to an existing media object'), '</a>';
             echo '</td></tr>';
         }
         echo '<tr><td class="descriptionbox">';
         echo WT_Gedcom_Tag::getLabel('SOUR');
         echo '</td><td class="optionbox">';
         echo "<a href=\"#\" onclick=\"return add_new_record('" . $this->record->getXref() . "','SOUR');\">", WT_I18N::translate('Add a new source citation'), '</a>';
         echo help_link('add_source');
         echo '</td></tr>';
     }
 }