diff options
| author | fisharebest <fisharebest@gmail.com> | 2012-07-08 07:49:02 +0000 |
|---|---|---|
| committer | fisharebest <fisharebest@gmail.com> | 2012-07-08 07:49:02 +0000 |
| commit | acbaaf3cf07f3882988144179e03161411054d6e (patch) | |
| tree | 06ca3998847287641b01763596e05acec3164405 /placelist.php | |
| parent | 9cf004719dd263fb0e09c96737bdbd9676368463 (diff) | |
| download | webtrees-acbaaf3cf07f3882988144179e03161411054d6e.tar.gz webtrees-acbaaf3cf07f3882988144179e03161411054d6e.tar.bz2 webtrees-acbaaf3cf07f3882988144179e03161411054d6e.zip | |
Make more use of new WT_Place class. Update indexes for wt_place table.
Diffstat (limited to 'placelist.php')
| -rw-r--r-- | placelist.php | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/placelist.php b/placelist.php index 604bd6d9a5..2bccd78ce5 100644 --- a/placelist.php +++ b/placelist.php @@ -146,7 +146,7 @@ if ($display=='hierarchy') { echo '</ul></td><td class="list_value"><ul>'; } } - if ($n>0) { + if ($child_places) { echo '</ul></td></tr>'; if ($action=='find' && $place_id) { echo '<tr><td class="list_label" '; @@ -176,19 +176,20 @@ if ($display=='hierarchy') { if ($place_id && $action=='show') { // -- array of names $myindilist = array(); - $mysourcelist = array(); $myfamlist = array(); - $positions = get_place_positions($parent, $level); + + $positions= + WT_DB::prepare("SELECT DISTINCT pl_gid FROM `##placelinks` WHERE pl_p_id=? AND pl_file=?") + ->execute(array($place_id, WT_GED_ID)) + ->fetchOneColumn(); + foreach ($positions as $position) { $record=WT_GedcomRecord::getInstance($position); - if ($record->canDisplayDetails()) { + if ($record && $record->canDisplayDetails()) { switch ($record->getType()) { case 'INDI': $myindilist[]=$record; break; - case 'SOUR': - $mysourcelist[]=$record; - break; case 'FAM': $myfamlist[]=$record; break; @@ -211,9 +212,6 @@ if ($place_id && $action=='show') { if ($myfamlist) { echo '<li><a href="#places-fam"><span id="famsource">', WT_I18N::translate('Families'), '</span></a></li>'; } - if ($mysourcelist) { - echo '<li><a href="#places-source"><span id="mediasource">', WT_I18N::translate('Sources'), '</span></a></li>'; - } echo '</ul>'; if ($myindilist) { echo '<div id="places-indi">', format_indi_table($myindilist), '</div>'; @@ -221,10 +219,7 @@ if ($place_id && $action=='show') { if ($myfamlist) { echo '<div id="places-fam">', format_fam_table($myfamlist), '</div>'; } - if ($mysourcelist) { - echo '<div id="places-source">', format_sour_table($mysourcelist), '</div>'; - } - if (!$myindilist && !$myfamlist && !$mysourcelist) { + if (!$myindilist && !$myfamlist) { echo '<div id="places-indi">', format_indi_table(array()), '</div>'; } echo '</div>'; // <div id="places-tabs"> |
