diff options
| author | fisharebest <fisharebest@gmail.com> | 2013-06-30 09:52:21 +0000 |
|---|---|---|
| committer | fisharebest <fisharebest@gmail.com> | 2013-06-30 09:52:21 +0000 |
| commit | 77c26af2287545f312e491b5f33bc8dc4462c9c8 (patch) | |
| tree | 04cdd015b3b121ef2817d777c9761182b2ad7379 /modules_v3 | |
| parent | 6ad38c2d19e4c7a32474097a56aadadb8d54f04a (diff) | |
| download | webtrees-77c26af2287545f312e491b5f33bc8dc4462c9c8.tar.gz webtrees-77c26af2287545f312e491b5f33bc8dc4462c9c8.tar.bz2 webtrees-77c26af2287545f312e491b5f33bc8dc4462c9c8.zip | |
More refactoring - census assistant
Diffstat (limited to 'modules_v3')
| -rw-r--r-- | modules_v3/GEDFact_assistant/CENS_ctrl.php | 50 | ||||
| -rw-r--r-- | modules_v3/GEDFact_assistant/MEDIA_ctrl.php | 2 | ||||
| -rw-r--r-- | modules_v3/GEDFact_assistant/_CENS/census_1_ctrl.php | 7 | ||||
| -rw-r--r-- | modules_v3/GEDFact_assistant/_CENS/census_3_search_add.php | 10 |
4 files changed, 51 insertions, 18 deletions
diff --git a/modules_v3/GEDFact_assistant/CENS_ctrl.php b/modules_v3/GEDFact_assistant/CENS_ctrl.php index 42ebf7e539..a0ddd829dc 100644 --- a/modules_v3/GEDFact_assistant/CENS_ctrl.php +++ b/modules_v3/GEDFact_assistant/CENS_ctrl.php @@ -25,22 +25,60 @@ // // $Id$ -$controller=new WT_Controller_Individual(); +$xref = safe_GET('xref', WT_REGEX_XREF); + +$person = WT_Individual::getInstance($xref); +check_record_access($person); + +$controller + ->setPageTitle(WT_I18N::translate('Create a new Shared Note using Assistant')) + ->pageHeader(); + +echo '<div id="edit_interface-page">'; +echo '<h3>', $controller->getPageTitle(), ' '; + // When more languages are added to the wiki, we can expand or redesign this + switch (WT_LOCALE) { + case 'fr': + echo wiki_help_link('/fr/Module_Assistant_Recensement'); + break; + case 'en': + default: + echo wiki_help_link('/en/Census_Assistant_module'); + break; + } +echo '</h3>'; + +?> +<div class="center" style="width:100%;"> + <?php + ?> + <form method="post" action="edit_interface.php" onsubmit="return check_form(this);"> + <input type="hidden" name="action" value="addnoteaction_assisted"> + <input type="hidden" name="noteid" value="newnote"> + <input id="pid_array" type="hidden" name="pid_array" value="none"> + <input id="xref" type="hidden" name="xref" value=<?php echo $xref; ?>> + <?php global $tabno, $linkToID, $SEARCH_SPIDER; global $SHOW_AGE_DIFF, $GEDCOM, $ABBREVIATE_CHART_LABELS; global $show_full, $famid; echo '<link type="text/css" href="', WT_STATIC_URL, WT_MODULES_DIR, 'GEDFact_assistant/css/cens_style.css" rel="stylesheet">'; -$summary=$controller->record->format_first_major_fact(WT_EVENTS_BIRT, 2); -if (!($controller->record->isDead())) { +$summary=$person->format_first_major_fact(WT_EVENTS_BIRT, 2); +if (!($person->isDead())) { // If alive display age - $bdate=$controller->record->getBirthDate(); + $bdate=$person->getBirthDate(); $age = WT_Date::GetAgeGedcom($bdate); if ($age!="") { $summary.= "<span class=\"label\">".WT_I18N::translate('Age').":</span><span class=\"field\"> ".get_age_at_event($age, true)."</span>"; } } -$summary.=$controller->record->format_first_major_fact(WT_EVENTS_DEAT, 2); +$summary.=$person->format_first_major_fact(WT_EVENTS_DEAT, 2); + +require WT_ROOT.WT_MODULES_DIR.'GEDFact_assistant/_CENS/census_1_ctrl.php'; -$controller->census_assistant(); +?> + </form> + </div> + <div style="clear:both;"></div> +</div><!-- id="edit_interface-page" --> diff --git a/modules_v3/GEDFact_assistant/MEDIA_ctrl.php b/modules_v3/GEDFact_assistant/MEDIA_ctrl.php index 765a432f2f..e264019641 100644 --- a/modules_v3/GEDFact_assistant/MEDIA_ctrl.php +++ b/modules_v3/GEDFact_assistant/MEDIA_ctrl.php @@ -39,4 +39,4 @@ $summary= $controller->record->format_first_major_fact(WT_EVENTS_BIRT, 2). $controller->record->format_first_major_fact(WT_EVENTS_DEAT, 2); -$controller->medialink_assistant(); +require WT_ROOT.WT_MODULES_DIR.'GEDFact_assistant/_MEDIA/media_1_ctrl.php'; diff --git a/modules_v3/GEDFact_assistant/_CENS/census_1_ctrl.php b/modules_v3/GEDFact_assistant/_CENS/census_1_ctrl.php index 0fa8dfe06f..89b056ffef 100644 --- a/modules_v3/GEDFact_assistant/_CENS/census_1_ctrl.php +++ b/modules_v3/GEDFact_assistant/_CENS/census_1_ctrl.php @@ -32,8 +32,6 @@ global $summary, $censyear, $censdate; -$pid = safe_get('pid'); - $censdate = new WT_Date('31 MAR 1901'); $censyear = $censdate->date1->y; @@ -43,7 +41,6 @@ $ctry = 'UK'; // === Set $married to "Not married as we only want the Birth name here" === $married=-1; -$person=WT_Individual::getInstance($pid); // var_dump($person->getAllNames()); $nam = $person->getAllNames(); if ($person->getDeathYear() == 0) { $DeathYr = ""; } else { $DeathYr = $person->getDeathYear(); } @@ -53,8 +50,6 @@ $fulln = str_replace("@N.N.", "(".WT_I18N::translate('unknown').")", $fulln); $fulln = str_replace("@P.N.", "(".WT_I18N::translate('unknown').")", $fulln); $wholename = $fulln; -$currpid=$pid; - echo '<script src="', WT_STATIC_URL, WT_MODULES_DIR, 'GEDFact_assistant/_CENS/js/dynamicoptionlist.js"></script>'; echo '<script src="', WT_STATIC_URL, WT_MODULES_DIR, 'GEDFact_assistant/_CENS/js/date.js"></script>'; @@ -67,7 +62,7 @@ echo '</script>'; echo '<div class="cens_header">'; echo '<div class="cens_header_left">'; echo WT_I18N::translate('Head of Household:'); -echo ' ', $wholename, ' (', $pid, ')'; +echo ' ', $wholename; echo '</div>'; if ($summary) { echo '<div class="cens_header_right">', $summary, '</div>'; diff --git a/modules_v3/GEDFact_assistant/_CENS/census_3_search_add.php b/modules_v3/GEDFact_assistant/_CENS/census_3_search_add.php index b4b171a09a..d260d611c5 100644 --- a/modules_v3/GEDFact_assistant/_CENS/census_3_search_add.php +++ b/modules_v3/GEDFact_assistant/_CENS/census_3_search_add.php @@ -102,9 +102,9 @@ if (!defined('WT_WEBTREES')) { //-- Build Parents Family -------------------------------------- $personcount=0; - $families = $this->record->getChildFamilies(); + $families = $person->getChildFamilies(); foreach ($families as $family) { - $label = $this->record->getChildFamilyLabel($family); + $label = $person->getChildFamilyLabel($family); $people = $this->buildFamilyList($family, "parents", false); $marrdate = $family->getMarriageDate(); @@ -529,8 +529,8 @@ if (!defined('WT_WEBTREES')) { //-- Step families --------------------------------------------------------- //-- Build step families --------------------------------------------------- - foreach ($this->record->getChildStepFamilies() as $family) { - $label = $this->record->getStepFamilyLabel($family); + foreach ($person->getChildStepFamilies() as $family) { + $label = $person->getStepFamilyLabel($family); $people = $this->buildFamilyList($family, "step-parents", false); if ($people) { echo "<tr><td><br></td><td></td></tr>"; @@ -958,7 +958,7 @@ if (!defined('WT_WEBTREES')) { echo "<tr><td><font size=1><br></font></td></tr>"; //-- Build Spouse Family --------------------------------------------------- - $families = $this->record->getSpouseFamilies(); + $families = $person->getSpouseFamilies(); //$personcount = 0; foreach ($families as $family) { $people = $this->buildFamilyList($family, "spouse", false); |
