Example #1
0
function get_edit_form($search)
{
    global $strYear, $strSource, $strSchedule;
    global $strSubmit, $strReset;
    ?>



<!--Fill out the form-->
<form method="post" action="passthru.php?area=census">

	<input type="hidden" name="person" value="<?php 
    echo $search->event->person->person_id;
    ?>
"/>
	<input type="hidden" name="d1type" value="8" size="30" />
	<input type="hidden" name="date1" id="date1" value="<?php 
    echo $search->event->date1;
    ?>
" size="30" />
	<input type="hidden" name="etype" value="<?php 
    echo CENSUS_EVENT;
    ?>
" />
	<table>
		<tr><td><table><tr><th></th><?php 
    showEventHeaderFields(CENSUS_EVENT);
    ?>
<th><?php 
    echo $strSchedule;
    ?>
</th></tr>
		<tr><td class="tbl_even"><?php 
    list_censuses("frmYear", $search->census);
    ?>
</td>
		<?php 
    showEventEditCols($search->event, CENSUS_EVENT);
    ?>
		<td class="tbl_even"><input type="text" name="schedule" value="<?php 
    echo $search->schedule;
    ?>
"/></td>
		</tr>
		</table>
		</td></tr>
		<tr>
		<td class="tbl_even">
		<?php 
    $sp = $search->event->person;
    $sp = $search->person;
    $people = array($sp);
    $rel = new Relationship();
    $rel->person = $sp;
    $dao = getRelationsDAO();
    $dao->getRelationshipDetails($rel);
    if ($rel->numResults > 0) {
        $spouses = $rel->results;
        foreach ($spouses as $partner) {
            $relation = $partner->relation;
            if (isset($relation) && $relation->person_id > 0 && $relation->isEditable()) {
                $people[] = $relation;
            }
        }
    }
    $dao = getPeopleDAO();
    $per = $sp;
    if ($dao->getChildren($per) > 0) {
        foreach ($per->children as $child) {
            if ($child->isEditable()) {
                $people[] = $child;
            }
        }
    }
    attendeeEditTable($search->event, CENSUS_EVENT, $people);
    ?>
</table></td>
		</tr>
		<tr>
			<td class="tbl_even"><input type="submit" name="Submit1" value="<?php 
    echo $strSubmit;
    ?>
" /></td>
			<td class="tbl_even"><input type="reset" name="Reset1" value="<?php 
    echo $strReset;
    ?>
" /></td>
		</tr>
	</table>
</form>
<?php 
}
Example #2
0
function get_edit_form($per)
{
    global $strNewMsg, $strTitle, $strName, $strFirstNames, $strLinkNames, $strLastName, $strAKA, $strSuffix, $strEvent, $strCauseDeath, $strGender, $strFaB, $strMale, $strFemale, $strMother, $strFather, $strNotes, $strSubmit, $strReset;
    $config = Config::getInstance();
    if ($config->dojo) {
        ?>
<script  type="text/javascript">
	dojo.addOnLoad(function() {
                        var widget = dijit.byId('notes');
                        widget.name = 'frmNarrative';
                        dojo.connect(widget, 'onChange', function(){
                        widget.endEditing();
                        var desc = widget.getValue();
                        var stext = dojo.byId('frmNarrative');
                        stext.value = desc;
                        });
                });
	</script><?php 
    }
    $mid = 0;
    $fid = 0;
    $gender = "M";
    if (isset($_REQUEST["fid"])) {
        $fid = $_REQUEST["fid"];
    } else {
        $fid = $per->father->person_id;
    }
    if (isset($_REQUEST["mid"])) {
        $mid = $_REQUEST["mid"];
    } else {
        $mid = $per->mother->person_id;
    }
    if (isset($_REQUEST["gender"])) {
        $gender = $_REQUEST["gender"];
    } else {
        $gender = $per->gender;
    }
    if (!isset($per->person_id)) {
        ?>
<b><?php 
        echo $strNewMsg;
        ?>
</b><br />
<?php 
    }
    ?>

<form method="post" action="passthru.php?area=people&func=edit">
<?php 
    if (isset($per->person_id)) {
        ?>
 
<input type="hidden" name="person" value="<?php 
        echo $per->person_id;
        ?>
" />
<?php 
    }
    if (isset($_REQUEST["cid"])) {
        $cid = $_REQUEST["cid"];
        ?>
		<input type="hidden" name="frmChild" value="<?php 
        echo $cid;
        ?>
" />
<?php 
    }
    ?>
	<table>
		<tr>
			<td class="tbl_odd"><?php 
    echo $strName;
    ?>
</td>
			<td class="tbl_even">
			<table><tr><th><?php 
    echo $strTitle;
    ?>
</th>
			<th><?php 
    echo $strFirstNames;
    ?>
</th>
			<th><?php 
    echo $strLinkNames;
    ?>
</th>
			<th><?php 
    echo $strLastName;
    ?>
</th>
			<th><?php 
    echo $strSuffix;
    ?>
</th></tr>
			<tr>
			<td><input type="text" name="frmTitle" value="<?php 
    echo $per->name->title;
    ?>
" size="5" maxlength="20" /></td>
			<td><input type="text" name="frmForenames" value="<?php 
    echo $per->name->forenames;
    ?>
" size="30" maxlength="50" /></td>
			<td><input type="text" name="frmLink" value="<?php 
    echo $per->name->link;
    ?>
" size="5" maxlength="10" /></td>
			<td><input type="text" name="frmSurname" value="<?php 
    echo $per->name->surname;
    ?>
" size="20" maxlength="20" /></td>
			<td><input type="text" name="frmSuffix" value="<?php 
    echo $per->name->suffix;
    ?>
" size="10" maxlength="20" /></td>
			</tr></table>
			</td>
			
		</tr>
		<tr>
			<td class="tbl_odd"><?php 
    echo $strAKA;
    ?>
</td>
			<td class="tbl_even"><input type="text" name="frmAKA" value="<?php 
    echo $per->name->knownas;
    ?>
" size="30" maxlength="10" /></td>
		</tr>
		<tr>
			<td class="tbl_odd"><?php 
    echo $strCauseDeath;
    ?>
</td>
			<td class="tbl_even" colspan="2"><input type="text" name="frmDeathReason" value="<?php 
    echo $per->death_reason;
    ?>
" size="30" maxlength="50" /></td>
		</tr>
		<tr>
			<td class="tbl_odd"><?php 
    echo $strGender;
    ?>
</td>
			<td class="tbl_even" colspan="2"><input type="radio" name="frmGender" value="M" <?php 
    if ($gender != "F") {
        echo 'checked="checked" ';
    }
    ?>
 /><?php 
    echo $strMale;
    ?>
<input type="radio" name="frmGender" value="F" <?php 
    if ($gender == "F") {
        echo 'checked="checked" ';
    }
    ?>
/><?php 
    echo $strFemale;
    ?>
</td>
		</tr>
		<?php 
    $bDate = '0000-00-00';
    if (isset($per->date_of_birth)) {
        $bDate = $per->date_of_birth;
    }
    ?>
		<tr>
			<td class="tbl_odd"><?php 
    echo $strMother;
    ?>
</td>
			<td class="tbl_even" colspan="2"><?php 
    selectPeople("frmMother", $per->person_id, "F", $mid, 0, $bDate);
    ?>
</td>
		</tr>
		<tr>
			<td class="tbl_odd"><?php 
    echo $strFather;
    ?>
</td>
			<td class="tbl_even" colspan="2"><?php 
    selectPeople("frmFather", $per->person_id, "M", $fid, 0, $bDate);
    ?>
</td>
		</tr>
		<tr>
			<td class="tbl_odd"><?php 
    echo $strFaB;
    ?>
</td>
			<td class="tbl_even" colspan="2">
			<table><tr><?php 
    showAttendeeHeaderFields(BIRTH_EVENT);
    ?>
</tr><tr><?php 
    $birthEvent = null;
    if ($per->events) {
        foreach ($per->events as $e) {
            if ($e->type == BIRTH_EVENT) {
                $birthEvent = $e;
            }
        }
    }
    if ($birthEvent != null) {
        if (count($birthEvent->attendees) == 0) {
            $birthEvent->attendees = array();
            $birthEvent->attendees[] = new Attendee();
            $birthEvent->attendees[0]->person->person_id = $fid;
        }
        foreach ($birthEvent->attendees as $a) {
            if ($a->person->person_id == $fid) {
                showAttendeeEditCols($a, BIRTH_EVENT);
            }
        }
    } else {
        $a = new Attendee();
        showAttendeeEditCols($a, BIRTH_EVENT);
    }
    ?>
</tr></table></td>
		</tr>
		<tr>
			<td class="tbl_odd" valign="top"><?php 
    echo $strNotes;
    ?>
</td>
			<td colspan="2" class="tbl_even"><?php 
    if ($config->dojo) {
        ?>
			<input type="hidden" name="frmNarrative" id="frmNarrative"/>
			<div id="notes" dojoType="dijit.Editor" minHeight="5em" 
			plugins="['undo', 'redo', 'cut', 'copy', 'paste', '|', 'bold', 'italic', 'underline', 'strikethrough', 'subscript', 'superscript', '|', 'removeFormat', 'indent', 'outdent', 'justifyCenter', 'justifyFull', 'justifyLeft', 'justifyRight', 'delete', 'insertOrderedList', 'insertUnorderedList', 'createLink', 'foreColor','hiliteColor']">
			<?php 
        echo $per->narrative;
        ?>
</div>
			<?php 
    } else {
        ?>
			<textarea name="frmNarrative" id="frmNarrative" rows="10" cols="80"><?php 
        echo $per->narrative;
        ?>
</textarea>
			<?php 
    }
    ?>
</td>
		</tr>
		<tr>
		<td colspan="3">
		<table>
		<tr><th></th><?php 
    showEventHeaderFields();
    ?>
</tr>
		<?php 
    $events = array($birthEvent, null, null, null);
    if ($per->events) {
        foreach ($per->events as $e) {
            $events[$e->type] = $e;
            echo "<tr><td>" . $strEvent[$e->type] . "</td>";
            ?>
<input type="hidden" name="<?php 
            echo $strEvent[$e->type];
            ?>
etype" value="<?php 
            echo $e->type;
            ?>
" /></td><?php 
            showEventEditCols($e, $e->type, $strEvent[$e->type]);
            echo "</tr>";
        }
    }
    for ($i = 0; $i < 4; $i++) {
        if (!isset($events[$i]) && $events[$i] == null) {
            $e = new Event();
            $e->type = $i;
            $e->person->person_id = $per->person_id;
            echo "<tr><td>" . $strEvent[$e->type];
            ?>
<input type="hidden" name="<?php 
            echo $strEvent[$e->type];
            ?>
etype" value="<?php 
            echo $e->type;
            ?>
" /></td><?php 
            showEventEditCols($e, $e->type, $strEvent[$e->type]);
            echo "</tr>";
        }
    }
    ?>
		</table>
		</td>
		</tr>
		<tr>
			<td class="tbl_even"><input type="submit" name="Submit1" value="<?php 
    echo $strSubmit;
    ?>
" /></td>
			<td class="tbl_even"><input type="RESET" name="Reset1" value="<?php 
    echo $strReset;
    ?>
" /></td>
		</tr>
	</table>
</form>
<?php 
}
Example #3
0
function get_edit_form($rel)
{
    global $strSpouse, $strMarriageCert, $strSubmit, $strReset, $strDateFmt;
    global $strDivorce, $strDate, $strEvent, $strEdit, $strDesc;
    ?>
<!--Fill out form -->
<form method="post" action="passthru.php?area=relations">
<input type="hidden" name="person" value="<?php 
    echo $rel->person->person_id;
    ?>
" />
<input type="hidden" name="oldSpouse" value="<?php 
    echo $rel->relation->person_id;
    ?>
" />
<input type="hidden" name="frmGender" value="<?php 
    echo $rel->person->gender;
    ?>
" />
	<table>
		<tr>
			<td class="tbl_odd"><?php 
    echo $strSpouse;
    ?>
</td>
			<td colspan="2" class="tbl_even"><?php 
    if ($rel->person->gender == "M") {
        $gen = "F";
    } else {
        $gen = "M";
    }
    selectPeople("frmSpouse", $rel->person->person_id, $gen, $rel->relation->person_id, 0, $rel->marriage_date);
    ?>
</td>
		</tr>
		<tr>
			<td class="tbl_odd"><?php 
    echo $strDivorce . " " . $strDate;
    ?>
</td>
			<?php 
    $mDate = '0000-00-00';
    if (isset($rel->dissolve_date)) {
        $mDate = $rel->dissolve_date;
    }
    ?>
			<td class="tbl_even"><input type="text" name="frmDissolveDate" value="<?php 
    echo $mDate;
    ?>
" size="15" maxlength="10" />
			<input type="hidden" name="frmDissolveReason" value="0" />
			</td>
			<td><?php 
    echo $strDateFmt;
    ?>
</td>
		</tr>
		<tr>
		<td colspan="3">
		<table>
		<tr><th></th><?php 
    showEventHeaderFields();
    ?>
</tr>
		<tr><td>
		<select name="etype">
		<option value="<?php 
    echo BANNS_EVENT;
    ?>
" <?php 
    if ($rel->event->type == BANNS_EVENT) {
        echo ' selected="selected"';
    }
    ?>
><?php 
    echo $strEvent[BANNS_EVENT];
    ?>
</option>
		<option value="<?php 
    echo MARRIAGE_EVENT;
    ?>
" <?php 
    if ($rel->event->type == MARRIAGE_EVENT) {
        echo ' selected="selected"';
    }
    ?>
><?php 
    echo $strEvent[MARRIAGE_EVENT];
    ?>
</option>
		</select>
		
		</td><?php 
    showEventEditCols($rel->event, '');
    ?>
		</tr></table></td>
		</tr>
		<tr>
			<td class="tbl_even" colspan="3">
			<?php 
    $people = array($rel->person);
    if ($rel->relation->person_id > 0) {
        $people[] = $rel->relation;
    }
    for ($i = 0; $i < 2; $i++) {
        $p = $people[$i];
        if (isset($people[$i])) {
            if (isset($p->father->person_id) && $p->father->person_id > 0 && $p->father->isEditable()) {
                $people[] = $p->father;
            }
            if (isset($p->mother->person_id) && $p->mother->person_id > 0 && $p->father->isEditable()) {
                $people[] = $p->mother;
            }
        }
    }
    attendeeEditTable($rel->event, MARRIAGE_EVENT, $people);
    ?>
</td>
		</tr>
		<tr>
			<td class="tbl_even"><input type="submit" name="Submit1" value="<?php 
    echo $strSubmit;
    ?>
" /></td>
			<td colspan="2" class="tbl_even"><input type="reset" name="Reset1" value="<?php 
    echo $strReset;
    ?>
" /></td>
		</tr>
	</table>
</form>
<?php 
    echo '<div id="image"><a href="edit.php?func=edit&amp;area=event&amp;event=' . $rel->event->event_id . '">' . $strEdit . ' ' . $strDesc . '</a></div>';
}