Exemple #1
0
 /**
  * initialize the controller
  */
 function init()
 {
     global $pgv_lang, $CONTACT_EMAIL, $GEDCOM, $pgv_changes;
     $this->nid = safe_GET_xref('nid');
     $noterec = find_other_record($this->nid);
     if (isset($pgv_changes[$this->nid . "_" . $GEDCOM])) {
         $noterec = "0 @" . $this->nid . "@ NOTE\n";
     } else {
         if (!$noterec) {
             return false;
         }
     }
     $this->note = new Note($noterec);
     $this->note->ged_id = PGV_GED_ID;
     // This record is from a file
     if (!$this->note->canDisplayDetails()) {
         print_header($pgv_lang["private"] . " " . $pgv_lang["shared_note_info"]);
         print_privacy_error($CONTACT_EMAIL);
         print_footer();
         exit;
     }
     $this->uname = PGV_USER_NAME;
     //-- perform the desired action
     switch ($this->action) {
         case "addfav":
             $this->addFavorite();
             break;
         case "accept":
             $this->acceptChanges();
             break;
         case "undo":
             $this->note->undoChange();
             break;
     }
     //-- check for the user
     //-- if the user can edit and there are changes then get the new changes
     if ($this->show_changes && PGV_USER_CAN_EDIT && isset($pgv_changes[$this->nid . "_" . $GEDCOM])) {
         $newrec = find_updated_record($this->nid);
         $this->diffnote = new Note($newrec);
         $this->diffnote->setChanged(true);
         $noterec = $newrec;
     }
     if ($this->note->canDisplayDetails()) {
         $this->canedit = PGV_USER_CAN_EDIT;
     }
     if ($this->show_changes && $this->canedit) {
         $this->note->diffMerge($this->diffnote);
     }
 }
Exemple #2
0
$gBitSystem->verifyPackage('phpgedview');
include_once PHPGEDVIEW_PKG_PATH . 'BitGEDCOM.php';
$gGedcom = new BitGEDCOM();
// leave manual config until we can move it to bitweaver table
require_once 'includes/controllers/family_ctrl.php';
$controller = new FamilyController();
$controller->init();
print_header($controller->getPageTitle());
// completely prevent display if privacy dictates so
if (!$controller->family) {
    echo "<b>" . $pgv_lang["unable_to_find_record"] . "</b><br /><br />";
    print_footer();
    exit;
} else {
    if (!$controller->family->canDisplayDetails()) {
        print_privacy_error($CONTACT_EMAIL);
        print_footer();
        exit;
    }
}
// LB added for Lightbox viewer ==============================================================
if ($MULTI_MEDIA && file_exists("modules/lightbox/album.php")) {
    include 'modules/lightbox/lb_defaultconfig.php';
    if (file_exists('modules/lightbox/lb_config.php')) {
        include 'modules/lightbox/lb_config.php';
    }
    include_once 'modules/lightbox/functions/lb_call_js.php';
}
// LB ======================================================================================
$PEDIGREE_FULL_DETAILS = "1";
// Override GEDCOM configuration
 /**
  * check the privacy of the incoming people to make sure they can be shown
  */
 function checkPrivacy()
 {
     global $CONTACT_EMAIL;
     $printed = false;
     for ($i = 0; $i < count($this->people); $i++) {
         if (!is_null($this->people[$i])) {
             if (!$this->people[$i]->canDisplayDetails()) {
                 if ($this->people[$i]->canDisplayName()) {
                     print "&nbsp;<a href=\"" . encode_url($this->people[$i]->getLinkUrl()) . "\">" . PrintReady($this->people[$i]->getFullName()) . "</a>";
                     print_privacy_error($CONTACT_EMAIL);
                     print "<br />";
                     $printed = true;
                 } else {
                     if (!$printed) {
                         print_privacy_error($CONTACT_EMAIL);
                         print "<br />";
                     }
                 }
             }
         }
     }
 }
    /** =================================================
     * print the lightbox tab, ( which = getTab8() )
     */
    function print_lightbox_tab()
    {
        global $MULTI_MEDIA, $SHOW_ID_NUMBERS, $MEDIA_EXTERNAL;
        global $pgv_lang, $pgv_changes, $factarray, $view;
        global $GEDCOM, $MEDIATYPE, $pgv_changes;
        global $WORD_WRAPPED_NOTES, $MEDIA_DIRECTORY, $PGV_IMAGE_DIR, $PGV_IMAGES, $TEXT_DIRECTION, $is_media;
        global $cntm1, $cntm2, $cntm3, $cntm4, $t, $mgedrec;
        global $edit;
        global $CONTACT_EMAIL, $pid, $tabno;
        global $Fam_Navigator, $NAV_ALBUM;
        // 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_ALBUM) && $NAV_ALBUM == "SHOW") {
            $Fam_Navigator = "YES";
        } else {
            $Fam_Navigator = "HIDE";
        }
        // ===============================================
        if ($Fam_Navigator == "YES") {
            print "<table cellpadding=\"0\" ><tr><td valign=\"top\" width=\"100%\" >";
        }
        $media_found = false;
        if (!$this->indi->canDisplayDetails()) {
            print "<table class=\"facts_table\" cellpadding=\"0\">\n";
            print "<tr><td class=\"facts_value\">";
            print_privacy_error($CONTACT_EMAIL);
            print "</td></tr>";
            print "</table>";
        } else {
            if (file_exists("modules/lightbox/album.php")) {
                include_once 'modules/lightbox/album.php';
            }
        }
        // ==================== Start Album 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_album"];
            ?>
</b><br /><br />
				<?php 
            include_once 'includes/family_nav.php';
            ?>
				<br />
				</td></tr></table>
			</td></tr></table>
			<?php 
        }
        // ==================== End Album Tab Navigator ========================================= */
    }
Exemple #5
0
 function init()
 {
     global $Dbwidth, $bwidth, $pbwidth, $pbheight, $bheight, $GEDCOM, $pgv_lang, $CONTACT_EMAIL, $show_famlink, $pgv_changes;
     $bwidth = $Dbwidth;
     $pbwidth = $bwidth + 12;
     $pbheight = $bheight + 14;
     $show_famlink = $this->view != 'preview';
     $this->famid = safe_GET_xref('famid');
     $this->family = Family::getInstance($this->famid);
     if (empty($this->famrec)) {
         $ct = preg_match("/(\\w+):(.+)/", $this->famid, $match);
         if ($ct > 0) {
             $servid = trim($match[1]);
             $remoteid = trim($match[2]);
             include_once 'includes/classes/class_serviceclient.php';
             $service = ServiceClient::getInstance($servid);
             if (!is_null($service)) {
                 $newrec = $service->mergeGedcomRecord($remoteid, "0 @" . $this->famid . "@ FAM\n1 RFN " . $this->famid, false);
                 $this->famrec = $newrec;
             }
         }
         //-- if no record was found create a default empty one
         if (isset($pgv_changes[$this->famid . "_" . $GEDCOM])) {
             $this->famrec = "0 @" . $this->famid . "@ FAM\n";
             $this->family = new Family($this->famrec);
         } else {
             if (empty($this->family)) {
                 return false;
             }
         }
     }
     $this->famrec = $this->family->getGedcomRecord();
     $this->display = displayDetailsById($this->famid, 'FAM');
     //-- if the user can edit and there are changes then get the new changes
     if ($this->show_changes && PGV_USER_CAN_EDIT && isset($pgv_changes[$this->famid . "_" . $GEDCOM])) {
         $newrec = find_updated_record($this->famid);
         if (empty($newrec)) {
             $newrec = find_family_record($this->famid);
         }
         $this->difffam = new Family($newrec);
         $this->difffam->setChanged(true);
         $this->family->diffMerge($this->difffam);
         //$this->famrec = $newrec;
         //$this->family = new Family($this->famrec);
     }
     $this->parents = array('HUSB' => $this->family->getHusbId(), 'WIFE' => $this->family->getWifeId());
     //-- check if we can display both parents
     if ($this->display == false) {
         $this->showLivingHusb = showLivingNameById($this->parents['HUSB']);
         $this->showLivingWife = showLivingNameById($this->parents['WIFE']);
     }
     //-- add favorites action
     if ($this->action == 'addfav' && !empty($_REQUEST['gid']) && PGV_USER_NAME) {
         $_REQUEST['gid'] = strtoupper($_REQUEST['gid']);
         $indirec = find_family_record($_REQUEST['gid']);
         if ($indirec) {
             $favorite = array('username' => PGV_USER_NAME, 'gid' => $_REQUEST['gid'], 'type' => 'FAM', 'file' => $GEDCOM, 'url' => '', 'note' => '', 'title' => '');
             addFavorite($favorite);
         }
     }
     if (PGV_USER_CAN_ACCEPT) {
         if ($this->action == 'accept') {
             if (accept_changes($_REQUEST['famid'] . '_' . $GEDCOM)) {
                 $this->show_changes = false;
                 $this->accept_success = true;
                 //-- check if we just deleted the record and redirect to index
                 $famrec = find_family_record($_REQUEST['famid']);
                 if (empty($famrec)) {
                     header("Location: index.php?ctype=gedcom");
                     exit;
                 }
                 $this->family = new Family($famrec);
                 $this->parents = find_parents($_REQUEST['famid']);
             }
         }
         if ($this->action == 'undo') {
             $this->family->undoChange();
             $this->parents = find_parents($_REQUEST['famid']);
         }
     }
     //-- make sure we have the true id from the record
     $ct = preg_match("/0 @(.*)@/", $this->famrec, $match);
     if ($ct > 0) {
         $this->famid = trim($match[1]);
     }
     if ($this->showLivingHusb == false && $this->showLivingWife == false) {
         print_header($pgv_lang['private'] . " " . $pgv_lang['family_info']);
         print_privacy_error($CONTACT_EMAIL);
         print_footer();
         exit;
     }
     $this->title = $this->family->getFullName();
     if (empty($this->parents['HUSB']) || empty($this->parents['WIFE'])) {
         $this->link_relation = 0;
     } else {
         $this->link_relation = 1;
     }
 }
 /**
  * check the privacy of the incoming people to make sure they can be shown
  */
 function checkPrivacy()
 {
     global $CONTACT_EMAIL;
     $printed = false;
     for ($i = 0; $i < count($this->people); $i++) {
         if (!$this->people[$i]->canDisplayDetails()) {
             if ($this->people[$i]->canDisplayName()) {
                 $indiName = PrintReady(str_replace(array('<span class="starredname">', '</span>'), array('<u>', '</u>'), $this->people[$i]->getFullName()));
                 print "&nbsp;<a href=\"" . encode_url($this->people[$i]->getLinkUrl()) . "\">" . $indiName . "</a>";
                 print_privacy_error($CONTACT_EMAIL);
                 print "<br />";
                 $printed = true;
             } else {
                 if (!$printed) {
                     print_privacy_error($CONTACT_EMAIL);
                     print "<br />";
                 }
             }
         }
     }
 }