@@ -31,11 +31,11 @@ discard block |
||
31 | 31 | * {@inhericDoc} |
32 | 32 | * @see \MyArtJaub\Webtrees\Mvc\View\AbstractView::renderContent() |
33 | 33 | */ |
34 | - protected function renderContent() { |
|
34 | + protected function renderContent() { |
|
35 | 35 | |
36 | - if($this->data->get('has_sosa', false)) { |
|
37 | - $table_id = $this->data->get('table_id'); |
|
38 | - ?> |
|
36 | + if($this->data->get('has_sosa', false)) { |
|
37 | + $table_id = $this->data->get('table_id'); |
|
38 | + ?> |
|
39 | 39 | |
40 | 40 | <div id="sosa-indi-list" class="sosa-list"> |
41 | 41 | <table id="<?php echo $table_id;?>"> |
@@ -186,42 +186,42 @@ discard block |
||
186 | 186 | <tbody> |
187 | 187 | |
188 | 188 | <?php foreach($this->data->get('sosa_list') as $sosa => $person) { |
189 | - /** @var \Fisharebest\Webtrees\Individual $person */ |
|
190 | - if ($person->isPendingAddtion()) { |
|
191 | - $class = ' class="new"'; |
|
192 | - } elseif ($person->isPendingDeletion()) { |
|
193 | - $class = ' class="old"'; |
|
194 | - } else { |
|
195 | - $class = ''; |
|
196 | - } |
|
197 | - $dperson = new \MyArtJaub\Webtrees\Individual($person); |
|
198 | - ?> |
|
189 | + /** @var \Fisharebest\Webtrees\Individual $person */ |
|
190 | + if ($person->isPendingAddtion()) { |
|
191 | + $class = ' class="new"'; |
|
192 | + } elseif ($person->isPendingDeletion()) { |
|
193 | + $class = ' class="old"'; |
|
194 | + } else { |
|
195 | + $class = ''; |
|
196 | + } |
|
197 | + $dperson = new \MyArtJaub\Webtrees\Individual($person); |
|
198 | + ?> |
|
199 | 199 | <tr <?php echo $class?>> |
200 | 200 | <td class="transparent"><?php echo $sosa; ?></td> |
201 | 201 | <td class="transparent"><?php echo $person->getXref(); ?></td> |
202 | 202 | <td colspan="2"> |
203 | 203 | <?php foreach ($person->getAllNames() as $num=>$name) { |
204 | - if ($name['type']=='NAME') { |
|
205 | - $title=''; |
|
206 | - } else { |
|
207 | - $title='title="'.strip_tags(GedcomTag::getLabel($name['type'], $person)).'"'; |
|
208 | - } |
|
209 | - if ($num==$person->getPrimaryName()) { |
|
210 | - $class=' class="name2"'; |
|
211 | - $sex_image=$person->getSexImage(); |
|
212 | - list($surn, $givn)=explode(',', $name['sort']); |
|
213 | - } else { |
|
214 | - $class=''; |
|
215 | - $sex_image=''; |
|
216 | - } ?> |
|
204 | + if ($name['type']=='NAME') { |
|
205 | + $title=''; |
|
206 | + } else { |
|
207 | + $title='title="'.strip_tags(GedcomTag::getLabel($name['type'], $person)).'"'; |
|
208 | + } |
|
209 | + if ($num==$person->getPrimaryName()) { |
|
210 | + $class=' class="name2"'; |
|
211 | + $sex_image=$person->getSexImage(); |
|
212 | + list($surn, $givn)=explode(',', $name['sort']); |
|
213 | + } else { |
|
214 | + $class=''; |
|
215 | + $sex_image=''; |
|
216 | + } ?> |
|
217 | 217 | <a <?php echo $title.' '.$class; ?> href="<?php echo $person->getHtmlUrl(); ?>"> |
218 | 218 | <?php echo \Fisharebest\Webtrees\Functions\FunctionsPrint::highlightSearchHits($name['full']); ?> |
219 | 219 | </a> |
220 | 220 | <?php echo $sex_image.FunctionsPrint::formatSosaNumbers($dperson->getSosaNumbers(), 1, 'smaller'); ?> |
221 | 221 | <br/> |
222 | 222 | <?php } |
223 | - echo $person->getPrimaryParentsNames('parents details1', 'none'); |
|
224 | - ?> |
|
223 | + echo $person->getPrimaryParentsNames('parents details1', 'none'); |
|
224 | + ?> |
|
225 | 225 | </td> |
226 | 226 | <td style="display:none;"></td> |
227 | 227 | <td> |
@@ -232,34 +232,34 @@ discard block |
||
232 | 232 | </td> |
233 | 233 | <td> |
234 | 234 | <?php |
235 | - if ($birth_dates=$person->getAllBirthDates()) { |
|
236 | - foreach ($birth_dates as $num=>$birth_date) { |
|
237 | - if ($num) { ?><br/><?php } ?> |
|
235 | + if ($birth_dates=$person->getAllBirthDates()) { |
|
236 | + foreach ($birth_dates as $num=>$birth_date) { |
|
237 | + if ($num) { ?><br/><?php } ?> |
|
238 | 238 | <?php echo $birth_date->display(true); |
239 | - } |
|
240 | - } else { |
|
241 | - $birth_date=$person->getEstimatedBirthDate(); |
|
242 | - if ($person->getTree()->getPreference('SHOW_EST_LIST_DATES')) { |
|
243 | - $birth_date->display(true); |
|
244 | - } else { |
|
245 | - echo ' '; |
|
246 | - } |
|
247 | - $birth_dates[0] = new Date(''); |
|
248 | - } |
|
249 | - ?> |
|
239 | + } |
|
240 | + } else { |
|
241 | + $birth_date=$person->getEstimatedBirthDate(); |
|
242 | + if ($person->getTree()->getPreference('SHOW_EST_LIST_DATES')) { |
|
243 | + $birth_date->display(true); |
|
244 | + } else { |
|
245 | + echo ' '; |
|
246 | + } |
|
247 | + $birth_dates[0] = new Date(''); |
|
248 | + } |
|
249 | + ?> |
|
250 | 250 | </td> |
251 | 251 | <td><?php echo $birth_date->julianDay();?></td> |
252 | 252 | <td> |
253 | 253 | <?php foreach ($person->getAllBirthPlaces() as $n => $birth_place) { |
254 | - $tmp = new \Fisharebest\Webtrees\Place($birth_place, $person->getTree()); |
|
255 | - if ($n) { ?><br><?php } ?> |
|
254 | + $tmp = new \Fisharebest\Webtrees\Place($birth_place, $person->getTree()); |
|
255 | + if ($n) { ?><br><?php } ?> |
|
256 | 256 | <a href="'<?php echo $tmp->getURL(); ?>" title="<?php echo strip_tags($tmp->getFullName()); ?>"> |
257 | 257 | <?php echo \Fisharebest\Webtrees\Functions\FunctionsPrint::highlightSearchHits($tmp->getShortName()); ?> |
258 | 258 | </a> |
259 | 259 | <?php } ?> |
260 | 260 | </td> |
261 | 261 | <?php if (ModuleManager::getInstance()->isOperational(Constants::MODULE_MAJ_ISSOURCED_NAME)) { |
262 | - $isBSourced = $dperson->isBirthSourced(); ?> |
|
262 | + $isBSourced = $dperson->isBirthSourced(); ?> |
|
263 | 263 | <td><?php echo FunctionsPrint::formatIsSourcedIcon('E', $isBSourced, 'BIRT', 1, 'medium'); ?></td> |
264 | 264 | <td><?php echo $isBSourced; ?></td> |
265 | 265 | <?php } else { ?> |
@@ -269,36 +269,36 @@ discard block |
||
269 | 269 | <td> |
270 | 270 | <?php |
271 | 271 | if ($death_dates = $person->getAllDeathDates()) { |
272 | - foreach ($death_dates as $num => $death_date) { |
|
273 | - if ($num) { ?><br/><?php } ?> |
|
272 | + foreach ($death_dates as $num => $death_date) { |
|
273 | + if ($num) { ?><br/><?php } ?> |
|
274 | 274 | <?php echo $death_date->display(true); |
275 | - } |
|
276 | - } else { |
|
277 | - $death_date = $person->getEstimatedDeathDate(); |
|
278 | - if ($person->getTree()->getPreference('SHOW_EST_LIST_DATES') && $death_date->minimumJulianDay() < WT_CLIENT_JD) { |
|
279 | - echo $death_date->display(true); |
|
280 | - } elseif ($person->isDead()) { |
|
281 | - echo I18N::translate('yes'); |
|
282 | - } else { |
|
283 | - echo ' '; |
|
284 | - } |
|
285 | - $death_dates[0] = new Date(''); |
|
286 | - } ?> |
|
275 | + } |
|
276 | + } else { |
|
277 | + $death_date = $person->getEstimatedDeathDate(); |
|
278 | + if ($person->getTree()->getPreference('SHOW_EST_LIST_DATES') && $death_date->minimumJulianDay() < WT_CLIENT_JD) { |
|
279 | + echo $death_date->display(true); |
|
280 | + } elseif ($person->isDead()) { |
|
281 | + echo I18N::translate('yes'); |
|
282 | + } else { |
|
283 | + echo ' '; |
|
284 | + } |
|
285 | + $death_dates[0] = new Date(''); |
|
286 | + } ?> |
|
287 | 287 | </td> |
288 | 288 | <td><?php echo $death_date->julianDay(); ?></td> |
289 | 289 | <td><?php echo Date::getAge($birth_dates[0], $death_dates[0], 2); ?></td> |
290 | 290 | <td><?php echo Date::getAge($birth_dates[0], $death_dates[0], 1); ?></td> |
291 | 291 | <td> |
292 | 292 | <?php foreach ($person->getAllDeathPlaces() as $n => $death_place) { |
293 | - $tmp = new Place($death_place, $person->getTree()); |
|
294 | - if ($n) { ?><br><?php } ?> |
|
293 | + $tmp = new Place($death_place, $person->getTree()); |
|
294 | + if ($n) { ?><br><?php } ?> |
|
295 | 295 | <a href="'<?php echo $tmp->getURL(); ?>" title="<?php echo strip_tags($tmp->getFullName()); ?>"> |
296 | 296 | <?php echo \Fisharebest\Webtrees\Functions\FunctionsPrint::highlightSearchHits($tmp->getShortName()); ?> |
297 | 297 | </a> |
298 | 298 | <?php } ?> |
299 | 299 | </td> |
300 | 300 | <?php if (ModuleManager::getInstance()->isOperational(Constants::MODULE_MAJ_ISSOURCED_NAME)) { |
301 | - $isDSourced = $dperson->isDeathSourced(); ?> |
|
301 | + $isDSourced = $dperson->isDeathSourced(); ?> |
|
302 | 302 | <td><?php echo FunctionsPrint::formatIsSourcedIcon('E', $isDSourced, 'DEAT', 1, 'medium'); ?></td> |
303 | 303 | <td><?php echo $isDSourced; ?></td> |
304 | 304 | <?php } else { ?> |
@@ -308,29 +308,29 @@ discard block |
||
308 | 308 | <td><?php echo $person->getSex(); ?></td> |
309 | 309 | <td> |
310 | 310 | <?php if (!$person->canShow() || Date::compare($birth_date, new Date(date('Y') - 100)) > 0) { |
311 | - echo 'Y100'; |
|
312 | - } else { |
|
313 | - echo 'YES'; |
|
314 | - } ?> |
|
311 | + echo 'Y100'; |
|
312 | + } else { |
|
313 | + echo 'YES'; |
|
314 | + } ?> |
|
315 | 315 | </td> |
316 | 316 | <td> |
317 | 317 | <?php if (Date::compare($death_dates[0], new Date(date('Y') - 100)) > 0) { |
318 | - echo 'Y100'; |
|
319 | - } elseif ($death_dates[0]->minimumJulianDay() || $person->isDead()) { |
|
320 | - echo 'YES'; |
|
321 | - } else { |
|
322 | - echo 'N'; |
|
323 | - } ?> |
|
318 | + echo 'Y100'; |
|
319 | + } elseif ($death_dates[0]->minimumJulianDay() || $person->isDead()) { |
|
320 | + echo 'YES'; |
|
321 | + } else { |
|
322 | + echo 'N'; |
|
323 | + } ?> |
|
324 | 324 | </td> |
325 | 325 | <td> |
326 | 326 | <?php if (!$person->getChildFamilies()) { |
327 | - echo 'R'; |
|
327 | + echo 'R'; |
|
328 | 328 | } // roots |
329 | 329 | elseif (!$person->isDead() && $person->getNumberOfChildren() < 1) { |
330 | - echo 'L'; |
|
330 | + echo 'L'; |
|
331 | 331 | } // leaves |
332 | 332 | else { |
333 | - echo ' '; |
|
333 | + echo ' '; |
|
334 | 334 | } ?> |
335 | 335 | </td> |
336 | 336 | </tr> |
@@ -341,12 +341,12 @@ discard block |
||
341 | 341 | <th class="ui-state-default" colspan="22"> |
342 | 342 | <div class="center"> |
343 | 343 | <?php echo I18N::translate('Number of Sosa ancestors: %1$s known / %2$s theoretical (%3$s)', |
344 | - I18N::number($this->data->get('sosa_count')), |
|
345 | - I18N::number($this->data->get('sosa_theo')), |
|
346 | - I18N::percentage($this->data->get('sosa_ratio'),2) |
|
347 | - ); ?> |
|
344 | + I18N::number($this->data->get('sosa_count')), |
|
345 | + I18N::number($this->data->get('sosa_theo')), |
|
346 | + I18N::percentage($this->data->get('sosa_ratio'),2) |
|
347 | + ); ?> |
|
348 | 348 | <?php if($this->data->get('sosa_hidden') > 0) { |
349 | - echo '['. I18N::translate('%s hidden', I18N::number($this->data->get('sosa_hidden'))).']'; |
|
349 | + echo '['. I18N::translate('%s hidden', I18N::number($this->data->get('sosa_hidden'))).']'; |
|
350 | 350 | } ?> |
351 | 351 | </div> |
352 | 352 | </th> |
@@ -380,8 +380,8 @@ discard block |
||
380 | 380 | </div> |
381 | 381 | </div> |
382 | 382 | <?php |
383 | - } |
|
384 | - } |
|
383 | + } |
|
384 | + } |
|
385 | 385 | |
386 | 386 | } |
387 | 387 | |
388 | 388 | \ No newline at end of file |
@@ -33,12 +33,12 @@ discard block |
||
33 | 33 | */ |
34 | 34 | protected function renderContent() { |
35 | 35 | |
36 | - if($this->data->get('has_sosa', false)) { |
|
36 | + if ($this->data->get('has_sosa', false)) { |
|
37 | 37 | $table_id = $this->data->get('table_id'); |
38 | 38 | ?> |
39 | 39 | |
40 | 40 | <div id="sosa-indi-list" class="sosa-list"> |
41 | - <table id="<?php echo $table_id;?>"> |
|
41 | + <table id="<?php echo $table_id; ?>"> |
|
42 | 42 | <thead> |
43 | 43 | <tr> |
44 | 44 | <th colspan="22"> |
@@ -185,7 +185,7 @@ discard block |
||
185 | 185 | </thead> |
186 | 186 | <tbody> |
187 | 187 | |
188 | - <?php foreach($this->data->get('sosa_list') as $sosa => $person) { |
|
188 | + <?php foreach ($this->data->get('sosa_list') as $sosa => $person) { |
|
189 | 189 | /** @var \Fisharebest\Webtrees\Individual $person */ |
190 | 190 | if ($person->isPendingAddtion()) { |
191 | 191 | $class = ' class="new"'; |
@@ -201,18 +201,18 @@ discard block |
||
201 | 201 | <td class="transparent"><?php echo $person->getXref(); ?></td> |
202 | 202 | <td colspan="2"> |
203 | 203 | <?php foreach ($person->getAllNames() as $num=>$name) { |
204 | - if ($name['type']=='NAME') { |
|
205 | - $title=''; |
|
204 | + if ($name['type'] == 'NAME') { |
|
205 | + $title = ''; |
|
206 | 206 | } else { |
207 | - $title='title="'.strip_tags(GedcomTag::getLabel($name['type'], $person)).'"'; |
|
207 | + $title = 'title="'.strip_tags(GedcomTag::getLabel($name['type'], $person)).'"'; |
|
208 | 208 | } |
209 | - if ($num==$person->getPrimaryName()) { |
|
210 | - $class=' class="name2"'; |
|
211 | - $sex_image=$person->getSexImage(); |
|
212 | - list($surn, $givn)=explode(',', $name['sort']); |
|
209 | + if ($num == $person->getPrimaryName()) { |
|
210 | + $class = ' class="name2"'; |
|
211 | + $sex_image = $person->getSexImage(); |
|
212 | + list($surn, $givn) = explode(',', $name['sort']); |
|
213 | 213 | } else { |
214 | - $class=''; |
|
215 | - $sex_image=''; |
|
214 | + $class = ''; |
|
215 | + $sex_image = ''; |
|
216 | 216 | } ?> |
217 | 217 | <a <?php echo $title.' '.$class; ?> href="<?php echo $person->getHtmlUrl(); ?>"> |
218 | 218 | <?php echo \Fisharebest\Webtrees\Functions\FunctionsPrint::highlightSearchHits($name['full']); ?> |
@@ -225,20 +225,20 @@ discard block |
||
225 | 225 | </td> |
226 | 226 | <td style="display:none;"></td> |
227 | 227 | <td> |
228 | - <?php echo Filter::escapeHtml(str_replace('@P.N.', 'AAAA', $givn)) . 'AAAA' . Filter::escapeHtml(str_replace('@N.N.', 'AAAA', $surn)); ?> |
|
228 | + <?php echo Filter::escapeHtml(str_replace('@P.N.', 'AAAA', $givn)).'AAAA'.Filter::escapeHtml(str_replace('@N.N.', 'AAAA', $surn)); ?> |
|
229 | 229 | </td> |
230 | 230 | <td> |
231 | - <?php echo Filter::escapeHtml(str_replace('@N.N.', 'AAAA', $surn)) . 'AAAA' . Filter::escapeHtml(str_replace('@P.N.', 'AAAA', $givn)); ?> |
|
231 | + <?php echo Filter::escapeHtml(str_replace('@N.N.', 'AAAA', $surn)).'AAAA'.Filter::escapeHtml(str_replace('@P.N.', 'AAAA', $givn)); ?> |
|
232 | 232 | </td> |
233 | 233 | <td> |
234 | 234 | <?php |
235 | - if ($birth_dates=$person->getAllBirthDates()) { |
|
235 | + if ($birth_dates = $person->getAllBirthDates()) { |
|
236 | 236 | foreach ($birth_dates as $num=>$birth_date) { |
237 | 237 | if ($num) { ?><br/><?php } ?> |
238 | 238 | <?php echo $birth_date->display(true); |
239 | 239 | } |
240 | 240 | } else { |
241 | - $birth_date=$person->getEstimatedBirthDate(); |
|
241 | + $birth_date = $person->getEstimatedBirthDate(); |
|
242 | 242 | if ($person->getTree()->getPreference('SHOW_EST_LIST_DATES')) { |
243 | 243 | $birth_date->display(true); |
244 | 244 | } else { |
@@ -248,7 +248,7 @@ discard block |
||
248 | 248 | } |
249 | 249 | ?> |
250 | 250 | </td> |
251 | - <td><?php echo $birth_date->julianDay();?></td> |
|
251 | + <td><?php echo $birth_date->julianDay(); ?></td> |
|
252 | 252 | <td> |
253 | 253 | <?php foreach ($person->getAllBirthPlaces() as $n => $birth_place) { |
254 | 254 | $tmp = new \Fisharebest\Webtrees\Place($birth_place, $person->getTree()); |
@@ -343,10 +343,10 @@ discard block |
||
343 | 343 | <?php echo I18N::translate('Number of Sosa ancestors: %1$s known / %2$s theoretical (%3$s)', |
344 | 344 | I18N::number($this->data->get('sosa_count')), |
345 | 345 | I18N::number($this->data->get('sosa_theo')), |
346 | - I18N::percentage($this->data->get('sosa_ratio'),2) |
|
346 | + I18N::percentage($this->data->get('sosa_ratio'), 2) |
|
347 | 347 | ); ?> |
348 | - <?php if($this->data->get('sosa_hidden') > 0) { |
|
349 | - echo '['. I18N::translate('%s hidden', I18N::number($this->data->get('sosa_hidden'))).']'; |
|
348 | + <?php if ($this->data->get('sosa_hidden') > 0) { |
|
349 | + echo '['.I18N::translate('%s hidden', I18N::number($this->data->get('sosa_hidden'))).']'; |
|
350 | 350 | } ?> |
351 | 351 | </div> |
352 | 352 | </th> |
@@ -358,7 +358,7 @@ discard block |
||
358 | 358 | <button type="button" class="ui-state-default btn-toggle-parents"> |
359 | 359 | <?php echo I18N::translate('Show parents') ?> |
360 | 360 | </button> |
361 | - <button id="btn-toggle-statistics-<?php echo $table_id ;?>" type="button" class="ui-state-default btn-toggle-statistics"> |
|
361 | + <button id="btn-toggle-statistics-<?php echo $table_id; ?>" type="button" class="ui-state-default btn-toggle-statistics"> |
|
362 | 362 | <?php echo I18N::translate('Show statistics charts') ?> |
363 | 363 | </button> |
364 | 364 | </div> |
@@ -23,13 +23,13 @@ discard block |
||
23 | 23 | * {@inhericDoc} |
24 | 24 | * @see \MyArtJaub\Webtrees\Mvc\View\AbstractView::renderContent() |
25 | 25 | */ |
26 | - protected function renderContent() { |
|
27 | - ?> |
|
26 | + protected function renderContent() { |
|
27 | + ?> |
|
28 | 28 | <div id="maj-sosa-stats-page"> |
29 | 29 | <h2><?php echo $this->data->get('title'); ?></h2> |
30 | 30 | |
31 | 31 | <?php if($this->data->get('is_setup')) { |
32 | - $general_stats = $this->data->get('general_stats'); ?> |
|
32 | + $general_stats = $this->data->get('general_stats'); ?> |
|
33 | 33 | <h3><?php echo I18N::translate('General statistics'); ?></h3> |
34 | 34 | <div class="maj-table"> |
35 | 35 | <div class="maj-row"> |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | <?php } else { ?> |
135 | 135 | <div class="warning"><?php echo I18N::translate('No Sosa root individual has been defined.'); ?></div> |
136 | 136 | <?php } |
137 | - } |
|
137 | + } |
|
138 | 138 | |
139 | 139 | } |
140 | 140 | |
141 | 141 | \ No newline at end of file |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | <div id="maj-sosa-stats-page"> |
29 | 29 | <h2><?php echo $this->data->get('title'); ?></h2> |
30 | 30 | |
31 | - <?php if($this->data->get('is_setup')) { |
|
31 | + <?php if ($this->data->get('is_setup')) { |
|
32 | 32 | $general_stats = $this->data->get('general_stats'); ?> |
33 | 33 | <h3><?php echo I18N::translate('General statistics'); ?></h3> |
34 | 34 | <div class="maj-table"> |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | </div> |
51 | 51 | <div class="maj-row"> |
52 | 52 | <div class="label"><?php echo I18N::translate('Mean generation time'); ?></div> |
53 | - <div class="value"><?php echo I18N::plural('%s year', '%s years', $general_stats['mean_gen_time'], I18N::number($general_stats['mean_gen_time'], 1)); ?></div> |
|
53 | + <div class="value"><?php echo I18N::plural('%s year', '%s years', $general_stats['mean_gen_time'], I18N::number($general_stats['mean_gen_time'], 1)); ?></div> |
|
54 | 54 | </div> |
55 | 55 | </div> |
56 | 56 | |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | </tr> |
91 | 91 | </thead> |
92 | 92 | <tbody> |
93 | - <?php foreach($this->data->get('generation_stats') as $gen => $row) { ?> |
|
93 | + <?php foreach ($this->data->get('generation_stats') as $gen => $row) { ?> |
|
94 | 94 | <tr class="maj-row"> |
95 | 95 | <td class="label"><?php echo I18N::translate('<strong>G%d</strong>', $gen); ?></td> |
96 | 96 | <td class="label"><?php echo I18N::translate('%1$s <> %2$s', $row['gen_min_birth'], $row['gen_max_birth']); ?></td> |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | <td class="value"><?php echo I18N::number($row['different']); ?></td> |
105 | 105 | <td class="value left percent_container"> |
106 | 106 | <div class="percent_frame"> |
107 | - <div class="percent_cell" style="width:<?php echo 100*$row['perc_different'] ?>%;"> |
|
107 | + <div class="percent_cell" style="width:<?php echo 100 * $row['perc_different'] ?>%;"> |
|
108 | 108 | <?php echo I18N::percentage($row['perc_different']); ?> |
109 | 109 | </div> |
110 | 110 | </div> |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | <tfoot> |
118 | 118 | <tr class="maj-row"> |
119 | 119 | <td class="label" colspan="13"> |
120 | - <?php echo I18N::translate('Generation-equivalent: %s generations', I18N::number($this->data->get('equivalent_gen'),2)); ?> |
|
120 | + <?php echo I18N::translate('Generation-equivalent: %s generations', I18N::number($this->data->get('equivalent_gen'), 2)); ?> |
|
121 | 121 | </td> |
122 | 122 | </tr> |
123 | 123 | </tfoot> |
@@ -126,8 +126,8 @@ discard block |
||
126 | 126 | |
127 | 127 | <h3><?php echo I18N::translate('Known Sosa ancestors\' family dispersion'); ?></h3> |
128 | 128 | <div class="center"> |
129 | - <?php echo $this->data->get('chart_img_g2') ?: '' ; ?> |
|
130 | - <?php echo $this->data->get('chart_img_g3') ?: '' ; ?> |
|
129 | + <?php echo $this->data->get('chart_img_g2') ?: ''; ?> |
|
130 | + <?php echo $this->data->get('chart_img_g3') ?: ''; ?> |
|
131 | 131 | <!-- <canvas id="chart_ancestors_g2" width="300" height="300"></canvas> --> |
132 | 132 | </div> |
133 | 133 |
@@ -32,11 +32,11 @@ discard block |
||
32 | 32 | * {@inhericDoc} |
33 | 33 | * @see \MyArtJaub\Webtrees\Mvc\View\AbstractView::renderContent() |
34 | 34 | */ |
35 | - protected function renderContent() { |
|
35 | + protected function renderContent() { |
|
36 | 36 | |
37 | - if($this->data->get('has_sosa', false)) { |
|
38 | - $table_id = $this->data->get('table_id'); |
|
39 | - ?> |
|
37 | + if($this->data->get('has_sosa', false)) { |
|
38 | + $table_id = $this->data->get('table_id'); |
|
39 | + ?> |
|
40 | 40 | |
41 | 41 | <div id="sosa-fam-list" class="sosa-list"> |
42 | 42 | <table id="<?php echo $table_id; ?>"> |
@@ -187,59 +187,59 @@ discard block |
||
187 | 187 | <tbody> |
188 | 188 | |
189 | 189 | <?php foreach($this->data->get('sosa_list') as $sosa => $family) { |
190 | - /** @var \Fisharebest\Webtrees\Family $person */ |
|
190 | + /** @var \Fisharebest\Webtrees\Family $person */ |
|
191 | 191 | |
192 | - //PERSO Create decorator for Family |
|
193 | - $dfamily = new Family($family); |
|
192 | + //PERSO Create decorator for Family |
|
193 | + $dfamily = new Family($family); |
|
194 | 194 | |
195 | - $husb = $family->getHusband(); |
|
196 | - if (is_null($husb)) { |
|
197 | - $husb = new Individual('H', '0 @H@ INDI', null, $family->getTree()); |
|
198 | - } |
|
199 | - $dhusb = new \MyArtJaub\Webtrees\Individual($husb); |
|
200 | - $wife = $family->getWife(); |
|
201 | - if (is_null($wife)) { |
|
202 | - $wife = new Individual('W', '0 @W@ INDI', null, $family->getTree()); |
|
203 | - } |
|
204 | - $dwife = new \MyArtJaub\Webtrees\Individual($wife); |
|
195 | + $husb = $family->getHusband(); |
|
196 | + if (is_null($husb)) { |
|
197 | + $husb = new Individual('H', '0 @H@ INDI', null, $family->getTree()); |
|
198 | + } |
|
199 | + $dhusb = new \MyArtJaub\Webtrees\Individual($husb); |
|
200 | + $wife = $family->getWife(); |
|
201 | + if (is_null($wife)) { |
|
202 | + $wife = new Individual('W', '0 @W@ INDI', null, $family->getTree()); |
|
203 | + } |
|
204 | + $dwife = new \MyArtJaub\Webtrees\Individual($wife); |
|
205 | 205 | |
206 | - $mdate=$family->getMarriageDate(); |
|
206 | + $mdate=$family->getMarriageDate(); |
|
207 | 207 | |
208 | - if ($family->isPendingAddtion()) { |
|
209 | - $class = ' class="new"'; |
|
210 | - } elseif ($family->isPendingDeletion()) { |
|
211 | - $class = ' class="old"'; |
|
212 | - } else { |
|
213 | - $class = ''; |
|
214 | - } |
|
215 | - ?> |
|
208 | + if ($family->isPendingAddtion()) { |
|
209 | + $class = ' class="new"'; |
|
210 | + } elseif ($family->isPendingDeletion()) { |
|
211 | + $class = ' class="old"'; |
|
212 | + } else { |
|
213 | + $class = ''; |
|
214 | + } |
|
215 | + ?> |
|
216 | 216 | <tr <?php echo $class?>> |
217 | 217 | <td class="transparent"><?php echo I18N::translate('%1$d/%2$d', $sosa, ($sosa + 1) % 10); ?></td> |
218 | 218 | <td class="transparent"><?php echo $sosa; ?></td> |
219 | 219 | <!-- HUSBAND --> |
220 | 220 | <td colspan="2"> |
221 | 221 | <?php foreach ($husb->getAllNames() as $num=>$name) { |
222 | - if ($name['type']=='NAME') { |
|
223 | - $title=''; |
|
224 | - } else { |
|
225 | - $title='title="'.strip_tags(GedcomTag::getLabel($name['type'], $husb)).'"'; |
|
226 | - } |
|
227 | - if ($num==$husb->getPrimaryName()) { |
|
228 | - $class=' class="name2"'; |
|
229 | - $sex_image=$husb->getSexImage(); |
|
230 | - list($surn, $givn)=explode(',', $name['sort']); |
|
231 | - } else { |
|
232 | - $class=''; |
|
233 | - $sex_image=''; |
|
234 | - } ?> |
|
222 | + if ($name['type']=='NAME') { |
|
223 | + $title=''; |
|
224 | + } else { |
|
225 | + $title='title="'.strip_tags(GedcomTag::getLabel($name['type'], $husb)).'"'; |
|
226 | + } |
|
227 | + if ($num==$husb->getPrimaryName()) { |
|
228 | + $class=' class="name2"'; |
|
229 | + $sex_image=$husb->getSexImage(); |
|
230 | + list($surn, $givn)=explode(',', $name['sort']); |
|
231 | + } else { |
|
232 | + $class=''; |
|
233 | + $sex_image=''; |
|
234 | + } ?> |
|
235 | 235 | <a <?php echo $title.' '.$class; ?> href="<?php echo $husb->getHtmlUrl(); ?>"> |
236 | 236 | <?php echo \Fisharebest\Webtrees\Functions\FunctionsPrint::highlightSearchHits($name['full']); ?> |
237 | 237 | </a> |
238 | 238 | <?php echo $sex_image.FunctionsPrint::formatSosaNumbers($dhusb->getSosaNumbers(), 1, 'smaller'); ?> |
239 | 239 | <br/> |
240 | 240 | <?php } |
241 | - echo $husb->getPrimaryParentsNames('parents details1', 'none'); |
|
242 | - ?> |
|
241 | + echo $husb->getPrimaryParentsNames('parents details1', 'none'); |
|
242 | + ?> |
|
243 | 243 | </td> |
244 | 244 | <!-- Dummy column to match colspan in header --> |
245 | 245 | <td style="display:none;"></td> |
@@ -255,27 +255,27 @@ discard block |
||
255 | 255 | <!-- WIFE --> |
256 | 256 | <td colspan="2"> |
257 | 257 | <?php foreach ($wife->getAllNames() as $num=>$name) { |
258 | - if ($name['type']=='NAME') { |
|
259 | - $title=''; |
|
260 | - } else { |
|
261 | - $title='title="'.strip_tags(GedcomTag::getLabel($name['type'], $wife)).'"'; |
|
262 | - } |
|
263 | - if ($num==$wife->getPrimaryName()) { |
|
264 | - $class=' class="name2"'; |
|
265 | - $sex_image=$wife->getSexImage(); |
|
266 | - list($surn, $givn)=explode(',', $name['sort']); |
|
267 | - } else { |
|
268 | - $class=''; |
|
269 | - $sex_image=''; |
|
270 | - } ?> |
|
258 | + if ($name['type']=='NAME') { |
|
259 | + $title=''; |
|
260 | + } else { |
|
261 | + $title='title="'.strip_tags(GedcomTag::getLabel($name['type'], $wife)).'"'; |
|
262 | + } |
|
263 | + if ($num==$wife->getPrimaryName()) { |
|
264 | + $class=' class="name2"'; |
|
265 | + $sex_image=$wife->getSexImage(); |
|
266 | + list($surn, $givn)=explode(',', $name['sort']); |
|
267 | + } else { |
|
268 | + $class=''; |
|
269 | + $sex_image=''; |
|
270 | + } ?> |
|
271 | 271 | <a <?php echo $title.' '.$class; ?> href="<?php echo $wife->getHtmlUrl(); ?>"> |
272 | 272 | <?php echo \Fisharebest\Webtrees\Functions\FunctionsPrint::highlightSearchHits($name['full']); ?> |
273 | 273 | </a> |
274 | 274 | <?php echo $sex_image.FunctionsPrint::formatSosaNumbers($dwife->getSosaNumbers(), 1, 'smaller'); ?> |
275 | 275 | <br/> |
276 | 276 | <?php } |
277 | - echo $wife->getPrimaryParentsNames('parents details1', 'none'); |
|
278 | - ?> |
|
277 | + echo $wife->getPrimaryParentsNames('parents details1', 'none'); |
|
278 | + ?> |
|
279 | 279 | </td> |
280 | 280 | <!-- Dummy column to match colspan in header --> |
281 | 281 | <td style="display:none;"></td> |
@@ -289,31 +289,31 @@ discard block |
||
289 | 289 | <td><?php Date::getAge($wdate, $mdate, 2); ?></td> |
290 | 290 | <td><?php Date::getAge($wdate, $mdate, 1); ?></td> |
291 | 291 | <td><?php |
292 | - if ($marriage_dates = $family->getAllMarriageDates()) { |
|
293 | - foreach ($marriage_dates as $n => $marriage_date) { |
|
294 | - if ($n) { echo '<br>'; } ?> |
|
292 | + if ($marriage_dates = $family->getAllMarriageDates()) { |
|
293 | + foreach ($marriage_dates as $n => $marriage_date) { |
|
294 | + if ($n) { echo '<br>'; } ?> |
|
295 | 295 | <div><?php echo $marriage_date->display(true); ?></div> |
296 | 296 | <?php } |
297 | - } elseif ($family->getFacts('_NMR')) { |
|
298 | - echo I18N::translate('no'); |
|
299 | - } elseif ($family->getFacts('MARR')) { |
|
300 | - echo I18N::translate('yes'); |
|
301 | - } else { |
|
302 | - echo ' '; |
|
303 | - } ?> |
|
297 | + } elseif ($family->getFacts('_NMR')) { |
|
298 | + echo I18N::translate('no'); |
|
299 | + } elseif ($family->getFacts('MARR')) { |
|
300 | + echo I18N::translate('yes'); |
|
301 | + } else { |
|
302 | + echo ' '; |
|
303 | + } ?> |
|
304 | 304 | </td> |
305 | 305 | <td><?php echo $marriage_dates ? $marriage_date->julianDay() : 0; ?></td> |
306 | 306 | <td><?php |
307 | - foreach ($family->getAllMarriagePlaces() as $n => $marriage_place) { |
|
308 | - $tmp = new Place($marriage_place, $family->getTree()); |
|
309 | - if ($n) { ?><br><?php } ?> |
|
307 | + foreach ($family->getAllMarriagePlaces() as $n => $marriage_place) { |
|
308 | + $tmp = new Place($marriage_place, $family->getTree()); |
|
309 | + if ($n) { ?><br><?php } ?> |
|
310 | 310 | <a href="'<?php echo $tmp->getURL(); ?>" title="<?php echo strip_tags($tmp->getFullName()); ?>"> |
311 | 311 | <?php echo \Fisharebest\Webtrees\Functions\FunctionsPrint::highlightSearchHits($tmp->getShortName()); ?> |
312 | 312 | </a> |
313 | 313 | <?php } ?> |
314 | 314 | </td> |
315 | 315 | <?php if (ModuleManager::getInstance()->isOperational(Constants::MODULE_MAJ_ISSOURCED_NAME)) { |
316 | - $isMSourced = $dfamily->isMarriageSourced(); ?> |
|
316 | + $isMSourced = $dfamily->isMarriageSourced(); ?> |
|
317 | 317 | <td><?php echo FunctionsPrint::formatIsSourcedIcon('E', $isMSourced, 'MARR', 1, 'medium'); ?></td> |
318 | 318 | <td><?php echo $isMSourced; ?></td> |
319 | 319 | <?php } else { ?> |
@@ -326,30 +326,30 @@ discard block |
||
326 | 326 | <td><?php |
327 | 327 | if (!$mdate->isOK()) { echo 'U'; } |
328 | 328 | else { |
329 | - if (Date::compare($mdate, new Date(date('Y') - 100)) > 0) { echo 'Y100'; } |
|
330 | - else { echo 'YES'; } |
|
329 | + if (Date::compare($mdate, new Date(date('Y') - 100)) > 0) { echo 'Y100'; } |
|
330 | + else { echo 'YES'; } |
|
331 | 331 | } |
332 | 332 | if ($family->getFacts(WT_EVENTS_DIV)) { echo 'D'; } |
333 | 333 | if (count($husb->getSpouseFamilies()) > 1 || count($wife->getSpouseFamilies()) > 1) { |
334 | - echo 'M'; |
|
334 | + echo 'M'; |
|
335 | 335 | } ?> |
336 | 336 | </td> |
337 | 337 | <td><?php |
338 | - if ($husb->isDead() && $wife->isDead()) { echo 'Y'; } |
|
339 | - if ($husb->isDead() && !$wife->isDead()) { |
|
340 | - if ($wife->getSex() == 'F') { echo 'H'; } |
|
341 | - if ($wife->getSex() == 'M') { echo 'W'; } // male partners |
|
342 | - } |
|
343 | - if (!$husb->isDead() && $wife->isDead()) { |
|
344 | - if ($husb->getSex() == 'M') { echo 'W'; } |
|
345 | - if ($husb->getSex() == 'F') { echo 'H'; } // female partners |
|
346 | - } |
|
347 | - if (!$husb->isDead() && !$wife->isDead()) { echo 'N'; } ?> |
|
338 | + if ($husb->isDead() && $wife->isDead()) { echo 'Y'; } |
|
339 | + if ($husb->isDead() && !$wife->isDead()) { |
|
340 | + if ($wife->getSex() == 'F') { echo 'H'; } |
|
341 | + if ($wife->getSex() == 'M') { echo 'W'; } // male partners |
|
342 | + } |
|
343 | + if (!$husb->isDead() && $wife->isDead()) { |
|
344 | + if ($husb->getSex() == 'M') { echo 'W'; } |
|
345 | + if ($husb->getSex() == 'F') { echo 'H'; } // female partners |
|
346 | + } |
|
347 | + if (!$husb->isDead() && !$wife->isDead()) { echo 'N'; } ?> |
|
348 | 348 | </td> |
349 | 349 | <td><?php |
350 | - if (!$husb->getChildFamilies() && !$wife->getChildFamilies()) { echo 'R'; } |
|
351 | - elseif (!$husb->isDead() && !$wife->isDead() && $family->getNumberOfChildren() < 1) { echo 'L'; } |
|
352 | - else { echo ' '; } ?> |
|
350 | + if (!$husb->getChildFamilies() && !$wife->getChildFamilies()) { echo 'R'; } |
|
351 | + elseif (!$husb->isDead() && !$wife->isDead() && $family->getNumberOfChildren() < 1) { echo 'L'; } |
|
352 | + else { echo ' '; } ?> |
|
353 | 353 | </td> |
354 | 354 | </tr> |
355 | 355 | <?php } ?> |
@@ -387,7 +387,7 @@ discard block |
||
387 | 387 | <p class="warning"><?php echo I18N::translate('No family has been found for generation %d', $this->data->get('generation')); ?></p> |
388 | 388 | <?php |
389 | 389 | } |
390 | - } |
|
390 | + } |
|
391 | 391 | |
392 | 392 | } |
393 | 393 | |
394 | 394 | \ No newline at end of file |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | */ |
35 | 35 | protected function renderContent() { |
36 | 36 | |
37 | - if($this->data->get('has_sosa', false)) { |
|
37 | + if ($this->data->get('has_sosa', false)) { |
|
38 | 38 | $table_id = $this->data->get('table_id'); |
39 | 39 | ?> |
40 | 40 | |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | class="ui-state-default" |
53 | 53 | title="<?php echo I18N::translate('Show individuals who are alive or couples where both partners are alive.'); ?>" |
54 | 54 | > |
55 | - <?php echo I18N::translate('Both alive');?> |
|
55 | + <?php echo I18N::translate('Both alive'); ?> |
|
56 | 56 | </button> |
57 | 57 | <button |
58 | 58 | type="button" |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | class="ui-state-default" |
62 | 62 | title="<?php echo I18N::translate('Show couples where only the female partner is deceased.'); ?>" |
63 | 63 | > |
64 | - <?php echo I18N::translate('Widower');?> |
|
64 | + <?php echo I18N::translate('Widower'); ?> |
|
65 | 65 | </button> |
66 | 66 | <button |
67 | 67 | type="button" |
@@ -186,7 +186,7 @@ discard block |
||
186 | 186 | </thead> |
187 | 187 | <tbody> |
188 | 188 | |
189 | - <?php foreach($this->data->get('sosa_list') as $sosa => $family) { |
|
189 | + <?php foreach ($this->data->get('sosa_list') as $sosa => $family) { |
|
190 | 190 | /** @var \Fisharebest\Webtrees\Family $person */ |
191 | 191 | |
192 | 192 | //PERSO Create decorator for Family |
@@ -203,7 +203,7 @@ discard block |
||
203 | 203 | } |
204 | 204 | $dwife = new \MyArtJaub\Webtrees\Individual($wife); |
205 | 205 | |
206 | - $mdate=$family->getMarriageDate(); |
|
206 | + $mdate = $family->getMarriageDate(); |
|
207 | 207 | |
208 | 208 | if ($family->isPendingAddtion()) { |
209 | 209 | $class = ' class="new"'; |
@@ -219,18 +219,18 @@ discard block |
||
219 | 219 | <!-- HUSBAND --> |
220 | 220 | <td colspan="2"> |
221 | 221 | <?php foreach ($husb->getAllNames() as $num=>$name) { |
222 | - if ($name['type']=='NAME') { |
|
223 | - $title=''; |
|
222 | + if ($name['type'] == 'NAME') { |
|
223 | + $title = ''; |
|
224 | 224 | } else { |
225 | - $title='title="'.strip_tags(GedcomTag::getLabel($name['type'], $husb)).'"'; |
|
225 | + $title = 'title="'.strip_tags(GedcomTag::getLabel($name['type'], $husb)).'"'; |
|
226 | 226 | } |
227 | - if ($num==$husb->getPrimaryName()) { |
|
228 | - $class=' class="name2"'; |
|
229 | - $sex_image=$husb->getSexImage(); |
|
230 | - list($surn, $givn)=explode(',', $name['sort']); |
|
227 | + if ($num == $husb->getPrimaryName()) { |
|
228 | + $class = ' class="name2"'; |
|
229 | + $sex_image = $husb->getSexImage(); |
|
230 | + list($surn, $givn) = explode(',', $name['sort']); |
|
231 | 231 | } else { |
232 | - $class=''; |
|
233 | - $sex_image=''; |
|
232 | + $class = ''; |
|
233 | + $sex_image = ''; |
|
234 | 234 | } ?> |
235 | 235 | <a <?php echo $title.' '.$class; ?> href="<?php echo $husb->getHtmlUrl(); ?>"> |
236 | 236 | <?php echo \Fisharebest\Webtrees\Functions\FunctionsPrint::highlightSearchHits($name['full']); ?> |
@@ -244,29 +244,29 @@ discard block |
||
244 | 244 | <!-- Dummy column to match colspan in header --> |
245 | 245 | <td style="display:none;"></td> |
246 | 246 | <td> |
247 | - <?php echo Filter::escapeHtml(str_replace('@P.N.', 'AAAA', $givn)) . 'AAAA' . Filter::escapeHtml(str_replace('@N.N.', 'AAAA', $surn)); ?> |
|
247 | + <?php echo Filter::escapeHtml(str_replace('@P.N.', 'AAAA', $givn)).'AAAA'.Filter::escapeHtml(str_replace('@N.N.', 'AAAA', $surn)); ?> |
|
248 | 248 | </td> |
249 | 249 | <td> |
250 | - <?php echo Filter::escapeHtml(str_replace('@N.N.', 'AAAA', $surn)) . 'AAAA' . Filter::escapeHtml(str_replace('@P.N.', 'AAAA', $givn)); ?> |
|
250 | + <?php echo Filter::escapeHtml(str_replace('@N.N.', 'AAAA', $surn)).'AAAA'.Filter::escapeHtml(str_replace('@P.N.', 'AAAA', $givn)); ?> |
|
251 | 251 | </td> |
252 | - <?php $hdate=$husb->getBirthDate(); ?> |
|
252 | + <?php $hdate = $husb->getBirthDate(); ?> |
|
253 | 253 | <td><?php Date::getAge($hdate, $mdate, 2); ?></td> |
254 | 254 | <td><?php Date::getAge($hdate, $mdate, 1); ?></td> |
255 | 255 | <!-- WIFE --> |
256 | 256 | <td colspan="2"> |
257 | 257 | <?php foreach ($wife->getAllNames() as $num=>$name) { |
258 | - if ($name['type']=='NAME') { |
|
259 | - $title=''; |
|
258 | + if ($name['type'] == 'NAME') { |
|
259 | + $title = ''; |
|
260 | 260 | } else { |
261 | - $title='title="'.strip_tags(GedcomTag::getLabel($name['type'], $wife)).'"'; |
|
261 | + $title = 'title="'.strip_tags(GedcomTag::getLabel($name['type'], $wife)).'"'; |
|
262 | 262 | } |
263 | - if ($num==$wife->getPrimaryName()) { |
|
264 | - $class=' class="name2"'; |
|
265 | - $sex_image=$wife->getSexImage(); |
|
266 | - list($surn, $givn)=explode(',', $name['sort']); |
|
263 | + if ($num == $wife->getPrimaryName()) { |
|
264 | + $class = ' class="name2"'; |
|
265 | + $sex_image = $wife->getSexImage(); |
|
266 | + list($surn, $givn) = explode(',', $name['sort']); |
|
267 | 267 | } else { |
268 | - $class=''; |
|
269 | - $sex_image=''; |
|
268 | + $class = ''; |
|
269 | + $sex_image = ''; |
|
270 | 270 | } ?> |
271 | 271 | <a <?php echo $title.' '.$class; ?> href="<?php echo $wife->getHtmlUrl(); ?>"> |
272 | 272 | <?php echo \Fisharebest\Webtrees\Functions\FunctionsPrint::highlightSearchHits($name['full']); ?> |
@@ -280,12 +280,12 @@ discard block |
||
280 | 280 | <!-- Dummy column to match colspan in header --> |
281 | 281 | <td style="display:none;"></td> |
282 | 282 | <td> |
283 | - <?php echo Filter::escapeHtml(str_replace('@P.N.', 'AAAA', $givn)) . 'AAAA' . Filter::escapeHtml(str_replace('@N.N.', 'AAAA', $surn)); ?> |
|
283 | + <?php echo Filter::escapeHtml(str_replace('@P.N.', 'AAAA', $givn)).'AAAA'.Filter::escapeHtml(str_replace('@N.N.', 'AAAA', $surn)); ?> |
|
284 | 284 | </td> |
285 | 285 | <td> |
286 | - <?php echo Filter::escapeHtml(str_replace('@N.N.', 'AAAA', $surn)) . 'AAAA' . Filter::escapeHtml(str_replace('@P.N.', 'AAAA', $givn)); ?> |
|
286 | + <?php echo Filter::escapeHtml(str_replace('@N.N.', 'AAAA', $surn)).'AAAA'.Filter::escapeHtml(str_replace('@P.N.', 'AAAA', $givn)); ?> |
|
287 | 287 | </td> |
288 | - <?php $wdate=$wife->getBirthDate(); ?> |
|
288 | + <?php $wdate = $wife->getBirthDate(); ?> |
|
289 | 289 | <td><?php Date::getAge($wdate, $mdate, 2); ?></td> |
290 | 290 | <td><?php Date::getAge($wdate, $mdate, 1); ?></td> |
291 | 291 | <td><?php |
@@ -302,7 +302,7 @@ discard block |
||
302 | 302 | echo ' '; |
303 | 303 | } ?> |
304 | 304 | </td> |
305 | - <td><?php echo $marriage_dates ? $marriage_date->julianDay() : 0; ?></td> |
|
305 | + <td><?php echo $marriage_dates ? $marriage_date->julianDay() : 0; ?></td> |
|
306 | 306 | <td><?php |
307 | 307 | foreach ($family->getAllMarriagePlaces() as $n => $marriage_place) { |
308 | 308 | $tmp = new Place($marriage_place, $family->getTree()); |
@@ -362,7 +362,7 @@ discard block |
||
362 | 362 | <button type="button" class="ui-state-default btn-toggle-parents"> |
363 | 363 | <?php echo I18N::translate('Show parents') ?> |
364 | 364 | </button> |
365 | - <button id="btn-toggle-statistics-<?php echo $table_id ;?>" type="button" class="ui-state-default btn-toggle-statistics"> |
|
365 | + <button id="btn-toggle-statistics-<?php echo $table_id; ?>" type="button" class="ui-state-default btn-toggle-statistics"> |
|
366 | 366 | <?php echo I18N::translate('Show statistics charts') ?> |
367 | 367 | </button> |
368 | 368 | </div> |
@@ -324,10 +324,8 @@ discard block |
||
324 | 324 | <td><?php echo I18N::number($nchi); ?></td> |
325 | 325 | <td><?php echo $nchi; ?></td> |
326 | 326 | <td><?php |
327 | - if (!$mdate->isOK()) { echo 'U'; } |
|
328 | - else { |
|
329 | - if (Date::compare($mdate, new Date(date('Y') - 100)) > 0) { echo 'Y100'; } |
|
330 | - else { echo 'YES'; } |
|
327 | + if (!$mdate->isOK()) { echo 'U'; } else { |
|
328 | + if (Date::compare($mdate, new Date(date('Y') - 100)) > 0) { echo 'Y100'; } else { echo 'YES'; } |
|
331 | 329 | } |
332 | 330 | if ($family->getFacts(WT_EVENTS_DIV)) { echo 'D'; } |
333 | 331 | if (count($husb->getSpouseFamilies()) > 1 || count($wife->getSpouseFamilies()) > 1) { |
@@ -347,9 +345,7 @@ discard block |
||
347 | 345 | if (!$husb->isDead() && !$wife->isDead()) { echo 'N'; } ?> |
348 | 346 | </td> |
349 | 347 | <td><?php |
350 | - if (!$husb->getChildFamilies() && !$wife->getChildFamilies()) { echo 'R'; } |
|
351 | - elseif (!$husb->isDead() && !$wife->isDead() && $family->getNumberOfChildren() < 1) { echo 'L'; } |
|
352 | - else { echo ' '; } ?> |
|
348 | + if (!$husb->getChildFamilies() && !$wife->getChildFamilies()) { echo 'R'; } elseif (!$husb->isDead() && !$wife->isDead() && $family->getNumberOfChildren() < 1) { echo 'L'; } else { echo ' '; } ?> |
|
353 | 349 | </td> |
354 | 350 | </tr> |
355 | 351 | <?php } ?> |
@@ -23,18 +23,18 @@ |
||
23 | 23 | * {@inhericDoc} |
24 | 24 | * @see \MyArtJaub\Webtrees\Mvc\View\AbstractView::renderContent() |
25 | 25 | */ |
26 | - protected function renderContent() { |
|
26 | + protected function renderContent() { |
|
27 | 27 | |
28 | - if($this->data->get('is_success', false)) { |
|
29 | - ?> |
|
28 | + if($this->data->get('is_success', false)) { |
|
29 | + ?> |
|
30 | 30 | <i class="icon-maj-success" title="<?php echo I18N::translate('Success'); ?>"></i> |
31 | 31 | <?php echo I18N::translate('Success'); ?> |
32 | 32 | <?php } else { ?> |
33 | 33 | <i class="icon-maj-error" title="<?php echo I18N::translate('Error'); ?>"></i> |
34 | 34 | <?php echo I18N::translate('Error'); ?> |
35 | 35 | <?php if($error = $this->data->get('error')) { echo ' - ' . $error; } |
36 | - } |
|
37 | - } |
|
36 | + } |
|
37 | + } |
|
38 | 38 | |
39 | 39 | } |
40 | 40 | |
41 | 41 | \ No newline at end of file |
@@ -25,14 +25,14 @@ |
||
25 | 25 | */ |
26 | 26 | protected function renderContent() { |
27 | 27 | |
28 | - if($this->data->get('is_success', false)) { |
|
28 | + if ($this->data->get('is_success', false)) { |
|
29 | 29 | ?> |
30 | 30 | <i class="icon-maj-success" title="<?php echo I18N::translate('Success'); ?>"></i> |
31 | 31 | <?php echo I18N::translate('Success'); ?> |
32 | 32 | <?php } else { ?> |
33 | 33 | <i class="icon-maj-error" title="<?php echo I18N::translate('Error'); ?>"></i> |
34 | 34 | <?php echo I18N::translate('Error'); ?> |
35 | - <?php if($error = $this->data->get('error')) { echo ' - ' . $error; } |
|
35 | + <?php if ($error = $this->data->get('error')) { echo ' - '.$error; } |
|
36 | 36 | } |
37 | 37 | } |
38 | 38 |
@@ -36,15 +36,15 @@ discard block |
||
36 | 36 | <div id="maj-sosa-missing-page" class="center"> |
37 | 37 | <h2><?php echo $this->data->get('title'); ?></h2> |
38 | 38 | |
39 | - <?php if($this->data->get('is_setup')) { |
|
39 | + <?php if ($this->data->get('is_setup')) { |
|
40 | 40 | $selectedgen = $this->data->get('generation'); |
41 | 41 | $this->renderSosaHeader(); |
42 | - if($this->data->get('has_missing', false)) { |
|
42 | + if ($this->data->get('has_missing', false)) { |
|
43 | 43 | $missing_list = $this->data->get('missing_list'); |
44 | 44 | $table_id = $this->data->get('table_id'); |
45 | 45 | ?> |
46 | 46 | <div id="sosa-indi-missing" class="smissing-list"> |
47 | - <table id="<?php echo $table_id;?>"> |
|
47 | + <table id="<?php echo $table_id; ?>"> |
|
48 | 48 | <thead> |
49 | 49 | <tr> |
50 | 50 | <th colspan="16"> |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | </thead> |
113 | 113 | <tbody> |
114 | 114 | |
115 | - <?php foreach($this->data->get('missing_list') as $missing_tab) { |
|
115 | + <?php foreach ($this->data->get('missing_list') as $missing_tab) { |
|
116 | 116 | $person = $missing_tab['indi']; |
117 | 117 | |
118 | 118 | /** @var \Fisharebest\Webtrees\Individual $person */ |
@@ -130,18 +130,18 @@ discard block |
||
130 | 130 | <td class="transparent"><?php echo $person->getXref(); ?></td> |
131 | 131 | <td colspan="2"> |
132 | 132 | <?php foreach ($person->getAllNames() as $num=>$name) { |
133 | - if ($name['type']=='NAME') { |
|
134 | - $title=''; |
|
133 | + if ($name['type'] == 'NAME') { |
|
134 | + $title = ''; |
|
135 | 135 | } else { |
136 | - $title='title="'.strip_tags(GedcomTag::getLabel($name['type'], $person)).'"'; |
|
136 | + $title = 'title="'.strip_tags(GedcomTag::getLabel($name['type'], $person)).'"'; |
|
137 | 137 | } |
138 | - if ($num==$person->getPrimaryName()) { |
|
139 | - $class=' class="name2"'; |
|
140 | - $sex_image=$person->getSexImage(); |
|
141 | - list($surn, $givn)=explode(',', $name['sort']); |
|
138 | + if ($num == $person->getPrimaryName()) { |
|
139 | + $class = ' class="name2"'; |
|
140 | + $sex_image = $person->getSexImage(); |
|
141 | + list($surn, $givn) = explode(',', $name['sort']); |
|
142 | 142 | } else { |
143 | - $class=''; |
|
144 | - $sex_image=''; |
|
143 | + $class = ''; |
|
144 | + $sex_image = ''; |
|
145 | 145 | } ?> |
146 | 146 | <a <?php echo $title.' '.$class; ?> href="<?php echo $person->getHtmlUrl(); ?>"> |
147 | 147 | <?php echo \Fisharebest\Webtrees\Functions\FunctionsPrint::highlightSearchHits($name['full']); ?> |
@@ -154,10 +154,10 @@ discard block |
||
154 | 154 | </td> |
155 | 155 | <td style="display:none;"></td> |
156 | 156 | <td> |
157 | - <?php echo Filter::escapeHtml(str_replace('@P.N.', 'AAAA', $givn)) . 'AAAA' . Filter::escapeHtml(str_replace('@N.N.', 'AAAA', $surn)); ?> |
|
157 | + <?php echo Filter::escapeHtml(str_replace('@P.N.', 'AAAA', $givn)).'AAAA'.Filter::escapeHtml(str_replace('@N.N.', 'AAAA', $surn)); ?> |
|
158 | 158 | </td> |
159 | 159 | <td> |
160 | - <?php echo Filter::escapeHtml(str_replace('@N.N.', 'AAAA', $surn)) . 'AAAA' . Filter::escapeHtml(str_replace('@P.N.', 'AAAA', $givn)); ?> |
|
160 | + <?php echo Filter::escapeHtml(str_replace('@N.N.', 'AAAA', $surn)).'AAAA'.Filter::escapeHtml(str_replace('@P.N.', 'AAAA', $givn)); ?> |
|
161 | 161 | </td> |
162 | 162 | <?php if (ModuleManager::getInstance()->isOperational(Constants::MODULE_MAJ_ISSOURCED_NAME)) { |
163 | 163 | $isISourced = $dperson->isSourced(); ?> |
@@ -167,17 +167,17 @@ discard block |
||
167 | 167 | <td> </td> |
168 | 168 | <td></td> |
169 | 169 | <?php } ?> |
170 | - <td><?php echo $missing_tab['has_father'] ? ' ' : 'X';?></td> |
|
171 | - <td><?php echo $missing_tab['has_mother'] ? ' ' : 'X';?></td> |
|
170 | + <td><?php echo $missing_tab['has_father'] ? ' ' : 'X'; ?></td> |
|
171 | + <td><?php echo $missing_tab['has_mother'] ? ' ' : 'X'; ?></td> |
|
172 | 172 | <td> |
173 | 173 | <?php |
174 | - if ($birth_dates=$person->getAllBirthDates()) { |
|
174 | + if ($birth_dates = $person->getAllBirthDates()) { |
|
175 | 175 | foreach ($birth_dates as $num=>$birth_date) { |
176 | 176 | if ($num) { ?><br/><?php } ?> |
177 | 177 | <?php echo $birth_date->display(true); |
178 | 178 | } |
179 | 179 | } else { |
180 | - $birth_date=$person->getEstimatedBirthDate(); |
|
180 | + $birth_date = $person->getEstimatedBirthDate(); |
|
181 | 181 | if ($person->getTree()->getPreference('SHOW_EST_LIST_DATES')) { |
182 | 182 | $birth_date->display(true); |
183 | 183 | } else { |
@@ -187,7 +187,7 @@ discard block |
||
187 | 187 | } |
188 | 188 | ?> |
189 | 189 | </td> |
190 | - <td><?php echo $birth_date->julianDay();?></td> |
|
190 | + <td><?php echo $birth_date->julianDay(); ?></td> |
|
191 | 191 | <td> |
192 | 192 | <?php foreach ($person->getAllBirthPlaces() as $n => $birth_place) { |
193 | 193 | $tmp = new \Fisharebest\Webtrees\Place($birth_place, $person->getTree()); |
@@ -218,9 +218,9 @@ discard block |
||
218 | 218 | $missing_hidden = $this->data->get('missing_hidden'); |
219 | 219 | ?> |
220 | 220 | <?php echo I18N::translate('Number of different missing ancestors: %s', I18N::number($this->data->get('missing_diff_count'))); ?> |
221 | - <?php if($this->data->get('missing_hidden') > 0) echo ' ['. I18N::translate('%s hidden', I18N::number($this->data->get('missing_hidden'))).']'; ?> |
|
222 | - <?php echo ' - ' . I18N::translate('Generation complete at %s', I18N::percentage($this->data->get('perc_sosa'), 2)); ?> |
|
223 | - <?php echo ' [' . I18N::translate('Potential %s', I18N::percentage($this->data->get('perc_sosa_potential'),2)).']'; ?> |
|
221 | + <?php if ($this->data->get('missing_hidden') > 0) echo ' ['.I18N::translate('%s hidden', I18N::number($this->data->get('missing_hidden'))).']'; ?> |
|
222 | + <?php echo ' - '.I18N::translate('Generation complete at %s', I18N::percentage($this->data->get('perc_sosa'), 2)); ?> |
|
223 | + <?php echo ' ['.I18N::translate('Potential %s', I18N::percentage($this->data->get('perc_sosa_potential'), 2)).']'; ?> |
|
224 | 224 | </div> |
225 | 225 | </td> |
226 | 226 | </tr> |
@@ -218,7 +218,10 @@ |
||
218 | 218 | $missing_hidden = $this->data->get('missing_hidden'); |
219 | 219 | ?> |
220 | 220 | <?php echo I18N::translate('Number of different missing ancestors: %s', I18N::number($this->data->get('missing_diff_count'))); ?> |
221 | - <?php if($this->data->get('missing_hidden') > 0) echo ' ['. I18N::translate('%s hidden', I18N::number($this->data->get('missing_hidden'))).']'; ?> |
|
221 | + <?php if($this->data->get('missing_hidden') > 0) { |
|
222 | + echo ' ['. I18N::translate('%s hidden', I18N::number($this->data->get('missing_hidden'))).']'; |
|
223 | +} |
|
224 | +?> |
|
222 | 225 | <?php echo ' - ' . I18N::translate('Generation complete at %s', I18N::percentage($this->data->get('perc_sosa'), 2)); ?> |
223 | 226 | <?php echo ' [' . I18N::translate('Potential %s', I18N::percentage($this->data->get('perc_sosa_potential'),2)).']'; ?> |
224 | 227 | </div> |
@@ -29,16 +29,16 @@ discard block |
||
29 | 29 | * {@inhericDoc} |
30 | 30 | * @see \MyArtJaub\Webtrees\Mvc\View\AbstractView::renderContent() |
31 | 31 | */ |
32 | - protected function renderContent() { |
|
33 | - ?> |
|
32 | + protected function renderContent() { |
|
33 | + ?> |
|
34 | 34 | <div id="maj-sosa-missing-page" class="center"> |
35 | 35 | <h2><?php echo $this->data->get('title'); ?></h2> |
36 | 36 | |
37 | 37 | <?php if($this->data->get('is_setup')) { |
38 | - $this->renderSosaHeader(); |
|
39 | - if($this->data->get('has_missing', false)) { |
|
40 | - $table_id = $this->data->get('table_id'); |
|
41 | - ?> |
|
38 | + $this->renderSosaHeader(); |
|
39 | + if($this->data->get('has_missing', false)) { |
|
40 | + $table_id = $this->data->get('table_id'); |
|
41 | + ?> |
|
42 | 42 | <div id="sosa-indi-missing" class="smissing-list"> |
43 | 43 | <table id="<?php echo $table_id;?>"> |
44 | 44 | <thead> |
@@ -109,44 +109,44 @@ discard block |
||
109 | 109 | <tbody> |
110 | 110 | |
111 | 111 | <?php foreach($this->data->get('missing_list') as $missing_tab) { |
112 | - $person = $missing_tab['indi']; |
|
112 | + $person = $missing_tab['indi']; |
|
113 | 113 | |
114 | - /** @var \Fisharebest\Webtrees\Individual $person */ |
|
115 | - if ($person->isPendingAddtion()) { |
|
116 | - $class = ' class="new"'; |
|
117 | - } elseif ($person->isPendingDeletion()) { |
|
118 | - $class = ' class="old"'; |
|
119 | - } else { |
|
120 | - $class = ''; |
|
121 | - } |
|
122 | - $dperson = new \MyArtJaub\Webtrees\Individual($person); |
|
123 | - ?> |
|
114 | + /** @var \Fisharebest\Webtrees\Individual $person */ |
|
115 | + if ($person->isPendingAddtion()) { |
|
116 | + $class = ' class="new"'; |
|
117 | + } elseif ($person->isPendingDeletion()) { |
|
118 | + $class = ' class="old"'; |
|
119 | + } else { |
|
120 | + $class = ''; |
|
121 | + } |
|
122 | + $dperson = new \MyArtJaub\Webtrees\Individual($person); |
|
123 | + ?> |
|
124 | 124 | <tr <?php echo $class?>> |
125 | 125 | <td class="transparent"><?php echo $missing_tab['sosa']; ?></td> |
126 | 126 | <td class="transparent"><?php echo $person->getXref(); ?></td> |
127 | 127 | <td colspan="2"> |
128 | 128 | <?php foreach ($person->getAllNames() as $num=>$name) { |
129 | - if ($name['type']=='NAME') { |
|
130 | - $title=''; |
|
131 | - } else { |
|
132 | - $title='title="'.strip_tags(GedcomTag::getLabel($name['type'], $person)).'"'; |
|
133 | - } |
|
134 | - if ($num==$person->getPrimaryName()) { |
|
135 | - $class=' class="name2"'; |
|
136 | - $sex_image=$person->getSexImage(); |
|
137 | - list($surn, $givn)=explode(',', $name['sort']); |
|
138 | - } else { |
|
139 | - $class=''; |
|
140 | - $sex_image=''; |
|
141 | - } ?> |
|
129 | + if ($name['type']=='NAME') { |
|
130 | + $title=''; |
|
131 | + } else { |
|
132 | + $title='title="'.strip_tags(GedcomTag::getLabel($name['type'], $person)).'"'; |
|
133 | + } |
|
134 | + if ($num==$person->getPrimaryName()) { |
|
135 | + $class=' class="name2"'; |
|
136 | + $sex_image=$person->getSexImage(); |
|
137 | + list($surn, $givn)=explode(',', $name['sort']); |
|
138 | + } else { |
|
139 | + $class=''; |
|
140 | + $sex_image=''; |
|
141 | + } ?> |
|
142 | 142 | <a <?php echo $title.' '.$class; ?> href="<?php echo $person->getHtmlUrl(); ?>"> |
143 | 143 | <?php echo \Fisharebest\Webtrees\Functions\FunctionsPrint::highlightSearchHits($name['full']); ?> |
144 | 144 | </a> |
145 | 145 | <?php echo $sex_image.FunctionsPrint::formatSosaNumbers($dperson->getSosaNumbers(), 1, 'smaller'); ?> |
146 | 146 | <br/> |
147 | 147 | <?php } |
148 | - echo $person->getPrimaryParentsNames('parents details1', 'none'); |
|
149 | - ?> |
|
148 | + echo $person->getPrimaryParentsNames('parents details1', 'none'); |
|
149 | + ?> |
|
150 | 150 | </td> |
151 | 151 | <td style="display:none;"></td> |
152 | 152 | <td> |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | <?php echo Filter::escapeHtml(str_replace('@N.N.', 'AAAA', $surn)) . 'AAAA' . Filter::escapeHtml(str_replace('@P.N.', 'AAAA', $givn)); ?> |
157 | 157 | </td> |
158 | 158 | <?php if (ModuleManager::getInstance()->isOperational(Constants::MODULE_MAJ_ISSOURCED_NAME)) { |
159 | - $isISourced = $dperson->isSourced(); ?> |
|
159 | + $isISourced = $dperson->isSourced(); ?> |
|
160 | 160 | <td><?php echo FunctionsPrint::formatIsSourcedIcon('R', $isISourced, 'INDI', 1, 'medium'); ?></td> |
161 | 161 | <td><?php echo $isISourced; ?></td> |
162 | 162 | <?php } else { ?> |
@@ -167,34 +167,34 @@ discard block |
||
167 | 167 | <td><?php echo $missing_tab['has_mother'] ? ' ' : 'X';?></td> |
168 | 168 | <td> |
169 | 169 | <?php |
170 | - if ($birth_dates=$person->getAllBirthDates()) { |
|
171 | - foreach ($birth_dates as $num=>$birth_date) { |
|
172 | - if ($num) { ?><br/><?php } ?> |
|
170 | + if ($birth_dates=$person->getAllBirthDates()) { |
|
171 | + foreach ($birth_dates as $num=>$birth_date) { |
|
172 | + if ($num) { ?><br/><?php } ?> |
|
173 | 173 | <?php echo $birth_date->display(true); |
174 | - } |
|
175 | - } else { |
|
176 | - $birth_date=$person->getEstimatedBirthDate(); |
|
177 | - if ($person->getTree()->getPreference('SHOW_EST_LIST_DATES')) { |
|
178 | - $birth_date->display(true); |
|
179 | - } else { |
|
180 | - echo ' '; |
|
181 | - } |
|
182 | - $birth_dates[0] = new Date(''); |
|
183 | - } |
|
184 | - ?> |
|
174 | + } |
|
175 | + } else { |
|
176 | + $birth_date=$person->getEstimatedBirthDate(); |
|
177 | + if ($person->getTree()->getPreference('SHOW_EST_LIST_DATES')) { |
|
178 | + $birth_date->display(true); |
|
179 | + } else { |
|
180 | + echo ' '; |
|
181 | + } |
|
182 | + $birth_dates[0] = new Date(''); |
|
183 | + } |
|
184 | + ?> |
|
185 | 185 | </td> |
186 | 186 | <td><?php echo $birth_date->julianDay();?></td> |
187 | 187 | <td> |
188 | 188 | <?php foreach ($person->getAllBirthPlaces() as $n => $birth_place) { |
189 | - $tmp = new \Fisharebest\Webtrees\Place($birth_place, $person->getTree()); |
|
190 | - if ($n) { ?><br><?php } ?> |
|
189 | + $tmp = new \Fisharebest\Webtrees\Place($birth_place, $person->getTree()); |
|
190 | + if ($n) { ?><br><?php } ?> |
|
191 | 191 | <a href="'<?php echo $tmp->getURL(); ?>" title="<?php echo strip_tags($tmp->getFullName()); ?>"> |
192 | 192 | <?php echo \Fisharebest\Webtrees\Functions\FunctionsPrint::highlightSearchHits($tmp->getShortName()); ?> |
193 | 193 | </a> |
194 | 194 | <?php } ?> |
195 | 195 | </td> |
196 | 196 | <?php if (ModuleManager::getInstance()->isOperational(Constants::MODULE_MAJ_ISSOURCED_NAME)) { |
197 | - $isBSourced = $dperson->isBirthSourced(); ?> |
|
197 | + $isBSourced = $dperson->isBirthSourced(); ?> |
|
198 | 198 | <td><?php echo FunctionsPrint::formatIsSourcedIcon('E', $isBSourced, 'BIRT', 1, 'medium'); ?></td> |
199 | 199 | <td><?php echo $isBSourced; ?></td> |
200 | 200 | <?php } else { ?> |
@@ -221,7 +221,7 @@ discard block |
||
221 | 221 | <?php } else { ?> |
222 | 222 | <p><?php echo I18N::translate('No ancestors are missing for this generation. Generation complete at %s.', I18N::percentage($this->data->get('perc_sosa'), 2)); ?></p> |
223 | 223 | <?php } |
224 | - } else { ?> |
|
224 | + } else { ?> |
|
225 | 225 | <p class="warning"><?php echo I18N::translate('The list could not be displayed. Reasons might be:'); ?><br/> |
226 | 226 | <ul> |
227 | 227 | <li><?php echo I18N::translate('No Sosa root individual has been defined.'); ?></li> |
@@ -232,6 +232,6 @@ discard block |
||
232 | 232 | <?php } ?> |
233 | 233 | </div> |
234 | 234 | <?php |
235 | - } |
|
235 | + } |
|
236 | 236 | } |
237 | 237 | |
238 | 238 | \ No newline at end of file |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | $view_bag->set('title', $controller->getPageTitle()); |
65 | 65 | $view_bag->set('is_setup', false); |
66 | 66 | |
67 | - if($this->sosa_provider->isSetup()) { |
|
67 | + if ($this->sosa_provider->isSetup()) { |
|
68 | 68 | $view_bag->set('is_setup', true); |
69 | 69 | |
70 | 70 | $sosaCount = $this->sosa_provider->getSosaCount(); |
@@ -82,23 +82,23 @@ discard block |
||
82 | 82 | $stats_gen = $this->sosa_provider->getStatisticsByGeneration(); |
83 | 83 | $view_bag->set('missinganc_url', 'module.php?mod='.$this->module->getName().'&mod_action=SosaList@missing&ged='.$WT_TREE->getNameUrl().'&gen='); |
84 | 84 | |
85 | - $gen_theoretical=1; |
|
86 | - $total_theoretical=0; |
|
87 | - $prev_diff=0; |
|
88 | - $prev_known=0.5; |
|
89 | - $gen_equiv=0; |
|
85 | + $gen_theoretical = 1; |
|
86 | + $total_theoretical = 0; |
|
87 | + $prev_diff = 0; |
|
88 | + $prev_known = 0.5; |
|
89 | + $gen_equiv = 0; |
|
90 | 90 | $generation_stats = array(); |
91 | 91 | |
92 | - foreach($stats_gen as $gen => $tab){ |
|
93 | - $genY1= I18N::translate('-'); |
|
94 | - $genY2= I18N::translate('-'); |
|
95 | - if($tab['firstBirth']>0) $genY1=$tab['firstBirth']; |
|
96 | - if($tab['lastBirth']>0) $genY2=$tab['lastBirth']; |
|
92 | + foreach ($stats_gen as $gen => $tab) { |
|
93 | + $genY1 = I18N::translate('-'); |
|
94 | + $genY2 = I18N::translate('-'); |
|
95 | + if ($tab['firstBirth'] > 0) $genY1 = $tab['firstBirth']; |
|
96 | + if ($tab['lastBirth'] > 0) $genY2 = $tab['lastBirth']; |
|
97 | 97 | $total_theoretical += $gen_theoretical; |
98 | 98 | $perc_sosa_count_theor = Functions::safeDivision($tab['sosaCount'], $gen_theoretical); |
99 | 99 | $gen_equiv += $perc_sosa_count_theor; |
100 | - $missing=2*$prev_known - $tab['sosaCount']; |
|
101 | - $gen_diff=$tab['diffSosaTotalCount']-$prev_diff; |
|
100 | + $missing = 2 * $prev_known - $tab['sosaCount']; |
|
101 | + $gen_diff = $tab['diffSosaTotalCount'] - $prev_diff; |
|
102 | 102 | |
103 | 103 | $generation_stats[$gen] = array( |
104 | 104 | 'gen_min_birth' => $genY1, |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | 'known' => $tab['sosaCount'], |
108 | 108 | 'perc_known' => $perc_sosa_count_theor, |
109 | 109 | 'missing' => $missing, |
110 | - 'perc_missing' => 1-Functions::safeDivision($tab['sosaCount'], 2*$prev_known), |
|
110 | + 'perc_missing' => 1 - Functions::safeDivision($tab['sosaCount'], 2 * $prev_known), |
|
111 | 111 | 'total_known' => $tab['sosaTotalCount'], |
112 | 112 | 'perc_total_known' => Functions::safeDivision($tab['sosaTotalCount'], $total_theoretical), |
113 | 113 | 'different' => $gen_diff, |
@@ -117,8 +117,8 @@ discard block |
||
117 | 117 | ); |
118 | 118 | |
119 | 119 | $gen_theoretical = $gen_theoretical * 2; |
120 | - $prev_known=$tab['sosaCount']; |
|
121 | - $prev_diff=$tab['diffSosaTotalCount']; |
|
120 | + $prev_known = $tab['sosaCount']; |
|
121 | + $prev_diff = $tab['diffSosaTotalCount']; |
|
122 | 122 | } |
123 | 123 | |
124 | 124 | $view_bag->set('generation_stats', $generation_stats); |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | private function htmlAncestorDispersionG2() |
140 | 140 | { |
141 | 141 | $ancestorsDispGen2 = $this->sosa_provider->getAncestorDispersionForGen(2); |
142 | - if(count($ancestorsDispGen2) == 0) return; |
|
142 | + if (count($ancestorsDispGen2) == 0) return; |
|
143 | 143 | |
144 | 144 | $size = '600x300'; |
145 | 145 | $sizes = explode('x', $size); |
@@ -150,21 +150,21 @@ discard block |
||
150 | 150 | |
151 | 151 | $total = array_sum($ancestorsDispGen2); |
152 | 152 | $father_count = isset($ancestorsDispGen2[1]) ? $ancestorsDispGen2[1] : 0; |
153 | - $father = array ( |
|
153 | + $father = array( |
|
154 | 154 | 'color' => '84beff', |
155 | 155 | 'count' => $father_count, |
156 | 156 | 'perc' => Functions::safeDivision($father_count, $total), |
157 | 157 | 'name' => \Fisharebest\Webtrees\Functions\Functions::getRelationshipNameFromPath('fat') |
158 | 158 | ); |
159 | 159 | $mother_count = isset($ancestorsDispGen2[2]) ? $ancestorsDispGen2[2] : 0; |
160 | - $mother = array ( |
|
160 | + $mother = array( |
|
161 | 161 | 'color' => 'ffd1dc', |
162 | 162 | 'count' => $mother_count, |
163 | 163 | 'perc' => Functions::safeDivision($mother_count, $total), |
164 | 164 | 'name' => \Fisharebest\Webtrees\Functions\Functions::getRelationshipNameFromPath('mot') |
165 | 165 | ); |
166 | 166 | $shared_count = isset($ancestorsDispGen2[-1]) ? $ancestorsDispGen2[-1] : 0; |
167 | - $shared = array ( |
|
167 | + $shared = array( |
|
168 | 168 | 'color' => '777777', |
169 | 169 | 'count' => $shared_count, |
170 | 170 | 'perc' => Functions::safeDivision($shared_count, $total), |
@@ -174,10 +174,10 @@ discard block |
||
174 | 174 | $chd = $this->arrayToExtendedEncoding(array(4095 * $father['perc'], 4095 * $shared['perc'], 4095 * $mother['perc'])); |
175 | 175 | $chart_title = I18N::translate('Known Sosa ancestors\' dispersion'); |
176 | 176 | $chl = |
177 | - $father['name'] . ' - ' . I18N::percentage($father['perc'], 1) . '|' . |
|
178 | - $shared['name'] . ' - ' . I18N::percentage($shared['perc'], 1) . '|' . |
|
179 | - $mother['name'] . ' - ' . I18N::percentage($mother['perc'], 1); |
|
180 | - return "<img src=\"https://chart.googleapis.com/chart?cht=p&chp=1.5708&chd=e:{$chd}&chs={$size}&chco={$father['color']},{$shared['color']},{$mother['color']}&chf=bg,s,ffffff00&chl={$chl}\" alt=\"" . $chart_title . "\" title=\"" . $chart_title . "\" />"; |
|
177 | + $father['name'].' - '.I18N::percentage($father['perc'], 1).'|'. |
|
178 | + $shared['name'].' - '.I18N::percentage($shared['perc'], 1).'|'. |
|
179 | + $mother['name'].' - '.I18N::percentage($mother['perc'], 1); |
|
180 | + return "<img src=\"https://chart.googleapis.com/chart?cht=p&chp=1.5708&chd=e:{$chd}&chs={$size}&chco={$father['color']},{$shared['color']},{$mother['color']}&chf=bg,s,ffffff00&chl={$chl}\" alt=\"".$chart_title."\" title=\"".$chart_title."\" />"; |
|
181 | 181 | } |
182 | 182 | |
183 | 183 | /** |
@@ -201,7 +201,7 @@ discard block |
||
201 | 201 | $total_motfat = $ancestorsDispGen2[4] ?: 0; |
202 | 202 | $total_motmot = $ancestorsDispGen2[8] ?: 0; |
203 | 203 | $total_sha = $ancestorsDispGen2[-1] ?: 0; |
204 | - $total = $total_fatfat + $total_fatmot + $total_motfat+ $total_motmot + $total_sha; |
|
204 | + $total = $total_fatfat + $total_fatmot + $total_motfat + $total_motmot + $total_sha; |
|
205 | 205 | |
206 | 206 | $chd = $this->arrayToExtendedEncoding(array( |
207 | 207 | 4095 * $total_fatfat / $total, |
@@ -212,12 +212,12 @@ discard block |
||
212 | 212 | )); |
213 | 213 | $chart_title = I18N::translate('Known Sosa ancestors\' dispersion - G3'); |
214 | 214 | $chl = |
215 | - \Fisharebest\Webtrees\Functions\Functions::getRelationshipNameFromPath('fatfat') . ' - ' . I18N::percentage(Functions::safeDivision($total_fatfat, $total), 1) . '|' . |
|
216 | - \Fisharebest\Webtrees\Functions\Functions::getRelationshipNameFromPath('fatmot') . ' - ' . I18N::percentage(Functions::safeDivision($total_fatmot, $total), 1) . '|' . |
|
217 | - I18N::translate('Shared') . ' - ' . I18N::percentage(Functions::safeDivision($total_sha, $total), 1) . '|' . |
|
218 | - \Fisharebest\Webtrees\Functions\Functions::getRelationshipNameFromPath('motfat') . ' - ' . I18N::percentage(Functions::safeDivision($total_motfat, $total), 1) . '|' . |
|
219 | - \Fisharebest\Webtrees\Functions\Functions::getRelationshipNameFromPath('motmot') . ' - ' . I18N::percentage(Functions::safeDivision($total_motmot, $total), 1); |
|
220 | - return "<img src=\"https://chart.googleapis.com/chart?cht=p&chp=1.5708&chd=e:{$chd}&chs={$size}&chco={$color_fatfat},{$color_fatmot},{$color_shared},{$color_motfat},{$color_motmot}&chf=bg,s,ffffff00&chl={$chl}\" alt=\"" . $chart_title . "\" title=\"" . $chart_title . "\" />"; |
|
215 | + \Fisharebest\Webtrees\Functions\Functions::getRelationshipNameFromPath('fatfat').' - '.I18N::percentage(Functions::safeDivision($total_fatfat, $total), 1).'|'. |
|
216 | + \Fisharebest\Webtrees\Functions\Functions::getRelationshipNameFromPath('fatmot').' - '.I18N::percentage(Functions::safeDivision($total_fatmot, $total), 1).'|'. |
|
217 | + I18N::translate('Shared').' - '.I18N::percentage(Functions::safeDivision($total_sha, $total), 1).'|'. |
|
218 | + \Fisharebest\Webtrees\Functions\Functions::getRelationshipNameFromPath('motfat').' - '.I18N::percentage(Functions::safeDivision($total_motfat, $total), 1).'|'. |
|
219 | + \Fisharebest\Webtrees\Functions\Functions::getRelationshipNameFromPath('motmot').' - '.I18N::percentage(Functions::safeDivision($total_motmot, $total), 1); |
|
220 | + return "<img src=\"https://chart.googleapis.com/chart?cht=p&chp=1.5708&chd=e:{$chd}&chs={$size}&chco={$color_fatfat},{$color_fatmot},{$color_shared},{$color_motfat},{$color_motmot}&chf=bg,s,ffffff00&chl={$chl}\" alt=\"".$chart_title."\" title=\"".$chart_title."\" />"; |
|
221 | 221 | } |
222 | 222 | |
223 | 223 | /** |
@@ -233,9 +233,9 @@ discard block |
||
233 | 233 | if ($value < 0) { |
234 | 234 | $value = 0; |
235 | 235 | } |
236 | - $first = (int) ($value / 64); |
|
236 | + $first = (int)($value / 64); |
|
237 | 237 | $second = $value % 64; |
238 | - $encoding .= $xencoding[(int) $first] . $xencoding[(int) $second]; |
|
238 | + $encoding .= $xencoding[(int)$first].$xencoding[(int)$second]; |
|
239 | 239 | } |
240 | 240 | |
241 | 241 | return $encoding; |
@@ -92,8 +92,12 @@ discard block |
||
92 | 92 | foreach($stats_gen as $gen => $tab){ |
93 | 93 | $genY1= I18N::translate('-'); |
94 | 94 | $genY2= I18N::translate('-'); |
95 | - if($tab['firstBirth']>0) $genY1=$tab['firstBirth']; |
|
96 | - if($tab['lastBirth']>0) $genY2=$tab['lastBirth']; |
|
95 | + if($tab['firstBirth']>0) { |
|
96 | + $genY1=$tab['firstBirth']; |
|
97 | + } |
|
98 | + if($tab['lastBirth']>0) { |
|
99 | + $genY2=$tab['lastBirth']; |
|
100 | + } |
|
97 | 101 | $total_theoretical += $gen_theoretical; |
98 | 102 | $perc_sosa_count_theor = Functions::safeDivision($tab['sosaCount'], $gen_theoretical); |
99 | 103 | $gen_equiv += $perc_sosa_count_theor; |
@@ -139,7 +143,9 @@ discard block |
||
139 | 143 | private function htmlAncestorDispersionG2() |
140 | 144 | { |
141 | 145 | $ancestorsDispGen2 = $this->sosa_provider->getAncestorDispersionForGen(2); |
142 | - if(count($ancestorsDispGen2) == 0) return; |
|
146 | + if(count($ancestorsDispGen2) == 0) { |
|
147 | + return; |
|
148 | + } |
|
143 | 149 | |
144 | 150 | $size = '600x300'; |
145 | 151 | $sizes = explode('x', $size); |
@@ -25,215 +25,215 @@ |
||
25 | 25 | */ |
26 | 26 | class SosaStatsController extends MvcController |
27 | 27 | { |
28 | - /** |
|
29 | - * Sosa Provider for the controller |
|
30 | - * @var SosaProvider $sosa_provider |
|
31 | - */ |
|
32 | - protected $sosa_provider; |
|
28 | + /** |
|
29 | + * Sosa Provider for the controller |
|
30 | + * @var SosaProvider $sosa_provider |
|
31 | + */ |
|
32 | + protected $sosa_provider; |
|
33 | 33 | |
34 | - /** |
|
35 | - * Constructor for SosaStatsController |
|
36 | - * @param AbstractModule $module |
|
37 | - */ |
|
38 | - public function __construct(AbstractModule $module) { |
|
39 | - global $WT_TREE; |
|
34 | + /** |
|
35 | + * Constructor for SosaStatsController |
|
36 | + * @param AbstractModule $module |
|
37 | + */ |
|
38 | + public function __construct(AbstractModule $module) { |
|
39 | + global $WT_TREE; |
|
40 | 40 | |
41 | - parent::__construct($module); |
|
41 | + parent::__construct($module); |
|
42 | 42 | |
43 | - $this->sosa_provider = new SosaProvider($WT_TREE, Auth::user()); |
|
44 | - } |
|
43 | + $this->sosa_provider = new SosaProvider($WT_TREE, Auth::user()); |
|
44 | + } |
|
45 | 45 | |
46 | - /** |
|
47 | - * Pages |
|
48 | - */ |
|
46 | + /** |
|
47 | + * Pages |
|
48 | + */ |
|
49 | 49 | |
50 | - /** |
|
51 | - * SosaStats@index |
|
52 | - */ |
|
53 | - public function index() { |
|
54 | - global $WT_TREE; |
|
50 | + /** |
|
51 | + * SosaStats@index |
|
52 | + */ |
|
53 | + public function index() { |
|
54 | + global $WT_TREE; |
|
55 | 55 | |
56 | - $controller = new PageController(); |
|
57 | - $controller |
|
58 | - ->setPageTitle(I18N::translate('Sosa Statistics')) |
|
59 | - ->addInlineJavascript('$(".help_tooltip").tooltip();') |
|
60 | - ; |
|
56 | + $controller = new PageController(); |
|
57 | + $controller |
|
58 | + ->setPageTitle(I18N::translate('Sosa Statistics')) |
|
59 | + ->addInlineJavascript('$(".help_tooltip").tooltip();') |
|
60 | + ; |
|
61 | 61 | |
62 | - $view_bag = new ViewBag(); |
|
63 | - $view_bag->set('title', $controller->getPageTitle()); |
|
64 | - $view_bag->set('is_setup', false); |
|
62 | + $view_bag = new ViewBag(); |
|
63 | + $view_bag->set('title', $controller->getPageTitle()); |
|
64 | + $view_bag->set('is_setup', false); |
|
65 | 65 | |
66 | - if($this->sosa_provider->isSetup()) { |
|
67 | - $view_bag->set('is_setup', true); |
|
66 | + if($this->sosa_provider->isSetup()) { |
|
67 | + $view_bag->set('is_setup', true); |
|
68 | 68 | |
69 | - $sosaCount = $this->sosa_provider->getSosaCount(); |
|
70 | - $diffSosaCount = $this->sosa_provider->getDifferentSosaCount(); |
|
69 | + $sosaCount = $this->sosa_provider->getSosaCount(); |
|
70 | + $diffSosaCount = $this->sosa_provider->getDifferentSosaCount(); |
|
71 | 71 | |
72 | - $general_stats = array( |
|
73 | - 'sosa_count' => $sosaCount, |
|
74 | - 'distinct_count' => $diffSosaCount, |
|
75 | - 'sosa_rate' => Functions::safeDivision($diffSosaCount, $this->sosa_provider->getTotalIndividuals()), |
|
76 | - 'pedi_collapse' => 1 - Functions::safeDivision($diffSosaCount, $sosaCount), |
|
77 | - 'mean_gen_time' => $this->sosa_provider->getMeanGenerationTime() |
|
78 | - ); |
|
79 | - $view_bag->set('general_stats', $general_stats); |
|
72 | + $general_stats = array( |
|
73 | + 'sosa_count' => $sosaCount, |
|
74 | + 'distinct_count' => $diffSosaCount, |
|
75 | + 'sosa_rate' => Functions::safeDivision($diffSosaCount, $this->sosa_provider->getTotalIndividuals()), |
|
76 | + 'pedi_collapse' => 1 - Functions::safeDivision($diffSosaCount, $sosaCount), |
|
77 | + 'mean_gen_time' => $this->sosa_provider->getMeanGenerationTime() |
|
78 | + ); |
|
79 | + $view_bag->set('general_stats', $general_stats); |
|
80 | 80 | |
81 | - $stats_gen = $this->sosa_provider->getStatisticsByGeneration(); |
|
82 | - $view_bag->set('missinganc_url', 'module.php?mod='.$this->module->getName().'&mod_action=SosaList@missing&ged='.$WT_TREE->getNameUrl().'&gen='); |
|
81 | + $stats_gen = $this->sosa_provider->getStatisticsByGeneration(); |
|
82 | + $view_bag->set('missinganc_url', 'module.php?mod='.$this->module->getName().'&mod_action=SosaList@missing&ged='.$WT_TREE->getNameUrl().'&gen='); |
|
83 | 83 | |
84 | - $gen_theoretical=1; |
|
85 | - $total_theoretical=0; |
|
86 | - $prev_diff=0; |
|
87 | - $prev_known=0.5; |
|
88 | - $gen_equiv=0; |
|
89 | - $generation_stats = array(); |
|
84 | + $gen_theoretical=1; |
|
85 | + $total_theoretical=0; |
|
86 | + $prev_diff=0; |
|
87 | + $prev_known=0.5; |
|
88 | + $gen_equiv=0; |
|
89 | + $generation_stats = array(); |
|
90 | 90 | |
91 | - foreach($stats_gen as $gen => $tab){ |
|
92 | - $genY1= I18N::translate('-'); |
|
93 | - $genY2= I18N::translate('-'); |
|
94 | - if($tab['firstBirth']>0) $genY1=$tab['firstBirth']; |
|
95 | - if($tab['lastBirth']>0) $genY2=$tab['lastBirth']; |
|
96 | - $total_theoretical += $gen_theoretical; |
|
97 | - $perc_sosa_count_theor = Functions::safeDivision($tab['sosaCount'], $gen_theoretical); |
|
98 | - $gen_equiv += $perc_sosa_count_theor; |
|
99 | - $missing=2*$prev_known - $tab['sosaCount']; |
|
100 | - $gen_diff=$tab['diffSosaTotalCount']-$prev_diff; |
|
91 | + foreach($stats_gen as $gen => $tab){ |
|
92 | + $genY1= I18N::translate('-'); |
|
93 | + $genY2= I18N::translate('-'); |
|
94 | + if($tab['firstBirth']>0) $genY1=$tab['firstBirth']; |
|
95 | + if($tab['lastBirth']>0) $genY2=$tab['lastBirth']; |
|
96 | + $total_theoretical += $gen_theoretical; |
|
97 | + $perc_sosa_count_theor = Functions::safeDivision($tab['sosaCount'], $gen_theoretical); |
|
98 | + $gen_equiv += $perc_sosa_count_theor; |
|
99 | + $missing=2*$prev_known - $tab['sosaCount']; |
|
100 | + $gen_diff=$tab['diffSosaTotalCount']-$prev_diff; |
|
101 | 101 | |
102 | - $generation_stats[$gen] = array( |
|
103 | - 'gen_min_birth' => $genY1, |
|
104 | - 'gen_max_birth' => $genY2, |
|
105 | - 'theoretical' => $gen_theoretical, |
|
106 | - 'known' => $tab['sosaCount'], |
|
107 | - 'perc_known' => $perc_sosa_count_theor, |
|
108 | - 'missing' => $missing, |
|
109 | - 'perc_missing' => 1-Functions::safeDivision($tab['sosaCount'], 2*$prev_known), |
|
110 | - 'total_known' => $tab['sosaTotalCount'], |
|
111 | - 'perc_total_known' => Functions::safeDivision($tab['sosaTotalCount'], $total_theoretical), |
|
112 | - 'different' => $gen_diff, |
|
113 | - 'perc_different' => Functions::safeDivision($gen_diff, $tab['sosaCount']), |
|
114 | - 'total_different' => $tab['diffSosaTotalCount'], |
|
115 | - 'pedi_collapse' => 1 - Functions::safeDivision($tab['diffSosaTotalCount'], $tab['sosaTotalCount']) |
|
116 | - ); |
|
102 | + $generation_stats[$gen] = array( |
|
103 | + 'gen_min_birth' => $genY1, |
|
104 | + 'gen_max_birth' => $genY2, |
|
105 | + 'theoretical' => $gen_theoretical, |
|
106 | + 'known' => $tab['sosaCount'], |
|
107 | + 'perc_known' => $perc_sosa_count_theor, |
|
108 | + 'missing' => $missing, |
|
109 | + 'perc_missing' => 1-Functions::safeDivision($tab['sosaCount'], 2*$prev_known), |
|
110 | + 'total_known' => $tab['sosaTotalCount'], |
|
111 | + 'perc_total_known' => Functions::safeDivision($tab['sosaTotalCount'], $total_theoretical), |
|
112 | + 'different' => $gen_diff, |
|
113 | + 'perc_different' => Functions::safeDivision($gen_diff, $tab['sosaCount']), |
|
114 | + 'total_different' => $tab['diffSosaTotalCount'], |
|
115 | + 'pedi_collapse' => 1 - Functions::safeDivision($tab['diffSosaTotalCount'], $tab['sosaTotalCount']) |
|
116 | + ); |
|
117 | 117 | |
118 | - $gen_theoretical = $gen_theoretical * 2; |
|
119 | - $prev_known=$tab['sosaCount']; |
|
120 | - $prev_diff=$tab['diffSosaTotalCount']; |
|
121 | - } |
|
118 | + $gen_theoretical = $gen_theoretical * 2; |
|
119 | + $prev_known=$tab['sosaCount']; |
|
120 | + $prev_diff=$tab['diffSosaTotalCount']; |
|
121 | + } |
|
122 | 122 | |
123 | - $view_bag->set('generation_stats', $generation_stats); |
|
124 | - $view_bag->set('equivalent_gen', $gen_equiv); |
|
123 | + $view_bag->set('generation_stats', $generation_stats); |
|
124 | + $view_bag->set('equivalent_gen', $gen_equiv); |
|
125 | 125 | |
126 | - $view_bag->set('chart_img_g2', $this->htmlAncestorDispersionG2()); |
|
127 | - $view_bag->set('chart_img_g3', $this->htmlAncestorDispersionG3()); |
|
126 | + $view_bag->set('chart_img_g2', $this->htmlAncestorDispersionG2()); |
|
127 | + $view_bag->set('chart_img_g3', $this->htmlAncestorDispersionG3()); |
|
128 | 128 | |
129 | - } |
|
129 | + } |
|
130 | 130 | |
131 | - ViewFactory::make('SosaStats', $this, $controller, $view_bag)->render(); |
|
132 | - } |
|
131 | + ViewFactory::make('SosaStats', $this, $controller, $view_bag)->render(); |
|
132 | + } |
|
133 | 133 | |
134 | - /** |
|
135 | - * Returns HTML code for a graph showing the dispersion of ancestors across father & mother |
|
136 | - * @return string HTML code |
|
137 | - */ |
|
138 | - private function htmlAncestorDispersionG2() |
|
139 | - { |
|
140 | - $ancestorsDispGen2 = $this->sosa_provider->getAncestorDispersionForGen(2); |
|
141 | - if(count($ancestorsDispGen2) == 0) return; |
|
134 | + /** |
|
135 | + * Returns HTML code for a graph showing the dispersion of ancestors across father & mother |
|
136 | + * @return string HTML code |
|
137 | + */ |
|
138 | + private function htmlAncestorDispersionG2() |
|
139 | + { |
|
140 | + $ancestorsDispGen2 = $this->sosa_provider->getAncestorDispersionForGen(2); |
|
141 | + if(count($ancestorsDispGen2) == 0) return; |
|
142 | 142 | |
143 | - $size = '600x300'; |
|
143 | + $size = '600x300'; |
|
144 | 144 | |
145 | - $total = array_sum($ancestorsDispGen2); |
|
146 | - $father_count = isset($ancestorsDispGen2[1]) ? $ancestorsDispGen2[1] : 0; |
|
147 | - $father = array ( |
|
148 | - 'color' => '84beff', |
|
149 | - 'count' => $father_count, |
|
150 | - 'perc' => Functions::safeDivision($father_count, $total), |
|
151 | - 'name' => \Fisharebest\Webtrees\Functions\Functions::getRelationshipNameFromPath('fat') |
|
152 | - ); |
|
153 | - $mother_count = isset($ancestorsDispGen2[2]) ? $ancestorsDispGen2[2] : 0; |
|
154 | - $mother = array ( |
|
155 | - 'color' => 'ffd1dc', |
|
156 | - 'count' => $mother_count, |
|
157 | - 'perc' => Functions::safeDivision($mother_count, $total), |
|
158 | - 'name' => \Fisharebest\Webtrees\Functions\Functions::getRelationshipNameFromPath('mot') |
|
159 | - ); |
|
160 | - $shared_count = isset($ancestorsDispGen2[-1]) ? $ancestorsDispGen2[-1] : 0; |
|
161 | - $shared = array ( |
|
162 | - 'color' => '777777', |
|
163 | - 'count' => $shared_count, |
|
164 | - 'perc' => Functions::safeDivision($shared_count, $total), |
|
165 | - 'name' => I18N::translate('Shared') |
|
166 | - ); |
|
145 | + $total = array_sum($ancestorsDispGen2); |
|
146 | + $father_count = isset($ancestorsDispGen2[1]) ? $ancestorsDispGen2[1] : 0; |
|
147 | + $father = array ( |
|
148 | + 'color' => '84beff', |
|
149 | + 'count' => $father_count, |
|
150 | + 'perc' => Functions::safeDivision($father_count, $total), |
|
151 | + 'name' => \Fisharebest\Webtrees\Functions\Functions::getRelationshipNameFromPath('fat') |
|
152 | + ); |
|
153 | + $mother_count = isset($ancestorsDispGen2[2]) ? $ancestorsDispGen2[2] : 0; |
|
154 | + $mother = array ( |
|
155 | + 'color' => 'ffd1dc', |
|
156 | + 'count' => $mother_count, |
|
157 | + 'perc' => Functions::safeDivision($mother_count, $total), |
|
158 | + 'name' => \Fisharebest\Webtrees\Functions\Functions::getRelationshipNameFromPath('mot') |
|
159 | + ); |
|
160 | + $shared_count = isset($ancestorsDispGen2[-1]) ? $ancestorsDispGen2[-1] : 0; |
|
161 | + $shared = array ( |
|
162 | + 'color' => '777777', |
|
163 | + 'count' => $shared_count, |
|
164 | + 'perc' => Functions::safeDivision($shared_count, $total), |
|
165 | + 'name' => I18N::translate('Shared') |
|
166 | + ); |
|
167 | 167 | |
168 | - $chd = $this->arrayToExtendedEncoding(array(4095 * $father['perc'], 4095 * $shared['perc'], 4095 * $mother['perc'])); |
|
169 | - $chart_title = I18N::translate('Known Sosa ancestors\' dispersion'); |
|
170 | - $chl = |
|
171 | - $father['name'] . ' - ' . I18N::percentage($father['perc'], 1) . '|' . |
|
172 | - $shared['name'] . ' - ' . I18N::percentage($shared['perc'], 1) . '|' . |
|
173 | - $mother['name'] . ' - ' . I18N::percentage($mother['perc'], 1); |
|
174 | - return "<img src=\"https://chart.googleapis.com/chart?cht=p&chp=1.5708&chd=e:{$chd}&chs={$size}&chco={$father['color']},{$shared['color']},{$mother['color']}&chf=bg,s,ffffff00&chl={$chl}\" alt=\"" . $chart_title . "\" title=\"" . $chart_title . "\" />"; |
|
175 | - } |
|
168 | + $chd = $this->arrayToExtendedEncoding(array(4095 * $father['perc'], 4095 * $shared['perc'], 4095 * $mother['perc'])); |
|
169 | + $chart_title = I18N::translate('Known Sosa ancestors\' dispersion'); |
|
170 | + $chl = |
|
171 | + $father['name'] . ' - ' . I18N::percentage($father['perc'], 1) . '|' . |
|
172 | + $shared['name'] . ' - ' . I18N::percentage($shared['perc'], 1) . '|' . |
|
173 | + $mother['name'] . ' - ' . I18N::percentage($mother['perc'], 1); |
|
174 | + return "<img src=\"https://chart.googleapis.com/chart?cht=p&chp=1.5708&chd=e:{$chd}&chs={$size}&chco={$father['color']},{$shared['color']},{$mother['color']}&chf=bg,s,ffffff00&chl={$chl}\" alt=\"" . $chart_title . "\" title=\"" . $chart_title . "\" />"; |
|
175 | + } |
|
176 | 176 | |
177 | - /** |
|
178 | - * Returns HTML code for a graph showing the dispersion of ancestors across grand-parents |
|
179 | - * @return string HTML code |
|
180 | - */ |
|
181 | - private function htmlAncestorDispersionG3() |
|
182 | - { |
|
183 | - $ancestorsDispGen2 = $this->sosa_provider->getAncestorDispersionForGen(3); |
|
177 | + /** |
|
178 | + * Returns HTML code for a graph showing the dispersion of ancestors across grand-parents |
|
179 | + * @return string HTML code |
|
180 | + */ |
|
181 | + private function htmlAncestorDispersionG3() |
|
182 | + { |
|
183 | + $ancestorsDispGen2 = $this->sosa_provider->getAncestorDispersionForGen(3); |
|
184 | 184 | |
185 | - $size = '700x300'; |
|
185 | + $size = '700x300'; |
|
186 | 186 | |
187 | - $color_motmot = 'ffd1dc'; |
|
188 | - $color_motfat = 'b998a0'; |
|
189 | - $color_fatfat = '577292'; |
|
190 | - $color_fatmot = '84beff'; |
|
191 | - $color_shared = '777777'; |
|
187 | + $color_motmot = 'ffd1dc'; |
|
188 | + $color_motfat = 'b998a0'; |
|
189 | + $color_fatfat = '577292'; |
|
190 | + $color_fatmot = '84beff'; |
|
191 | + $color_shared = '777777'; |
|
192 | 192 | |
193 | - $total_fatfat = $ancestorsDispGen2[1] ?: 0; |
|
194 | - $total_fatmot = $ancestorsDispGen2[2] ?: 0; |
|
195 | - $total_motfat = $ancestorsDispGen2[4] ?: 0; |
|
196 | - $total_motmot = $ancestorsDispGen2[8] ?: 0; |
|
197 | - $total_sha = $ancestorsDispGen2[-1] ?: 0; |
|
198 | - $total = $total_fatfat + $total_fatmot + $total_motfat+ $total_motmot + $total_sha; |
|
193 | + $total_fatfat = $ancestorsDispGen2[1] ?: 0; |
|
194 | + $total_fatmot = $ancestorsDispGen2[2] ?: 0; |
|
195 | + $total_motfat = $ancestorsDispGen2[4] ?: 0; |
|
196 | + $total_motmot = $ancestorsDispGen2[8] ?: 0; |
|
197 | + $total_sha = $ancestorsDispGen2[-1] ?: 0; |
|
198 | + $total = $total_fatfat + $total_fatmot + $total_motfat+ $total_motmot + $total_sha; |
|
199 | 199 | |
200 | - $chd = $this->arrayToExtendedEncoding(array( |
|
201 | - 4095 * $total_fatfat / $total, |
|
202 | - 4095 * $total_fatmot / $total, |
|
203 | - 4095 * $total_sha / $total, |
|
204 | - 4095 * $total_motfat / $total, |
|
205 | - 4095 * $total_motmot / $total |
|
206 | - )); |
|
207 | - $chart_title = I18N::translate('Known Sosa ancestors\' dispersion - G3'); |
|
208 | - $chl = |
|
209 | - \Fisharebest\Webtrees\Functions\Functions::getRelationshipNameFromPath('fatfat') . ' - ' . I18N::percentage(Functions::safeDivision($total_fatfat, $total), 1) . '|' . |
|
210 | - \Fisharebest\Webtrees\Functions\Functions::getRelationshipNameFromPath('fatmot') . ' - ' . I18N::percentage(Functions::safeDivision($total_fatmot, $total), 1) . '|' . |
|
211 | - I18N::translate('Shared') . ' - ' . I18N::percentage(Functions::safeDivision($total_sha, $total), 1) . '|' . |
|
212 | - \Fisharebest\Webtrees\Functions\Functions::getRelationshipNameFromPath('motfat') . ' - ' . I18N::percentage(Functions::safeDivision($total_motfat, $total), 1) . '|' . |
|
213 | - \Fisharebest\Webtrees\Functions\Functions::getRelationshipNameFromPath('motmot') . ' - ' . I18N::percentage(Functions::safeDivision($total_motmot, $total), 1); |
|
214 | - return "<img src=\"https://chart.googleapis.com/chart?cht=p&chp=1.5708&chd=e:{$chd}&chs={$size}&chco={$color_fatfat},{$color_fatmot},{$color_shared},{$color_motfat},{$color_motmot}&chf=bg,s,ffffff00&chl={$chl}\" alt=\"" . $chart_title . "\" title=\"" . $chart_title . "\" />"; |
|
215 | - } |
|
200 | + $chd = $this->arrayToExtendedEncoding(array( |
|
201 | + 4095 * $total_fatfat / $total, |
|
202 | + 4095 * $total_fatmot / $total, |
|
203 | + 4095 * $total_sha / $total, |
|
204 | + 4095 * $total_motfat / $total, |
|
205 | + 4095 * $total_motmot / $total |
|
206 | + )); |
|
207 | + $chart_title = I18N::translate('Known Sosa ancestors\' dispersion - G3'); |
|
208 | + $chl = |
|
209 | + \Fisharebest\Webtrees\Functions\Functions::getRelationshipNameFromPath('fatfat') . ' - ' . I18N::percentage(Functions::safeDivision($total_fatfat, $total), 1) . '|' . |
|
210 | + \Fisharebest\Webtrees\Functions\Functions::getRelationshipNameFromPath('fatmot') . ' - ' . I18N::percentage(Functions::safeDivision($total_fatmot, $total), 1) . '|' . |
|
211 | + I18N::translate('Shared') . ' - ' . I18N::percentage(Functions::safeDivision($total_sha, $total), 1) . '|' . |
|
212 | + \Fisharebest\Webtrees\Functions\Functions::getRelationshipNameFromPath('motfat') . ' - ' . I18N::percentage(Functions::safeDivision($total_motfat, $total), 1) . '|' . |
|
213 | + \Fisharebest\Webtrees\Functions\Functions::getRelationshipNameFromPath('motmot') . ' - ' . I18N::percentage(Functions::safeDivision($total_motmot, $total), 1); |
|
214 | + return "<img src=\"https://chart.googleapis.com/chart?cht=p&chp=1.5708&chd=e:{$chd}&chs={$size}&chco={$color_fatfat},{$color_fatmot},{$color_shared},{$color_motfat},{$color_motmot}&chf=bg,s,ffffff00&chl={$chl}\" alt=\"" . $chart_title . "\" title=\"" . $chart_title . "\" />"; |
|
215 | + } |
|
216 | 216 | |
217 | - /** |
|
218 | - * Convert an array to Google Chart encoding |
|
219 | - * @param arrat $a Array to encode |
|
220 | - * @return string |
|
221 | - */ |
|
222 | - private function arrayToExtendedEncoding($a) { |
|
223 | - $xencoding = WT_GOOGLE_CHART_ENCODING; |
|
217 | + /** |
|
218 | + * Convert an array to Google Chart encoding |
|
219 | + * @param arrat $a Array to encode |
|
220 | + * @return string |
|
221 | + */ |
|
222 | + private function arrayToExtendedEncoding($a) { |
|
223 | + $xencoding = WT_GOOGLE_CHART_ENCODING; |
|
224 | 224 | |
225 | - $encoding = ''; |
|
226 | - foreach ($a as $value) { |
|
227 | - if ($value < 0) { |
|
228 | - $value = 0; |
|
229 | - } |
|
230 | - $first = (int) ($value / 64); |
|
231 | - $second = $value % 64; |
|
232 | - $encoding .= $xencoding[(int) $first] . $xencoding[(int) $second]; |
|
233 | - } |
|
225 | + $encoding = ''; |
|
226 | + foreach ($a as $value) { |
|
227 | + if ($value < 0) { |
|
228 | + $value = 0; |
|
229 | + } |
|
230 | + $first = (int) ($value / 64); |
|
231 | + $second = $value % 64; |
|
232 | + $encoding .= $xencoding[(int) $first] . $xencoding[(int) $second]; |
|
233 | + } |
|
234 | 234 | |
235 | - return $encoding; |
|
236 | - } |
|
235 | + return $encoding; |
|
236 | + } |
|
237 | 237 | |
238 | 238 | |
239 | 239 | } |
240 | 240 | \ No newline at end of file |
@@ -37,12 +37,12 @@ |
||
37 | 37 | * @param Place $place |
38 | 38 | */ |
39 | 39 | public function addPlace(Place $place) { |
40 | - if(!is_null($place) && !$place->isEmpty()){ |
|
40 | + if (!is_null($place) && !$place->isEmpty()) { |
|
41 | 41 | $place_name = $place->getFullName(); |
42 | - if(isset($this->places[$place_name])){ |
|
43 | - $this->places[$place_name]+=1; |
|
42 | + if (isset($this->places[$place_name])) { |
|
43 | + $this->places[$place_name] += 1; |
|
44 | 44 | } |
45 | - else{ |
|
45 | + else { |
|
46 | 46 | $this->places[$place_name] = 1; |
47 | 47 | } |
48 | 48 | } |
@@ -77,8 +77,7 @@ |
||
77 | 77 | $index = str_replace('%', '', $match2); |
78 | 78 | if(is_numeric($index) && $index >0 && $index <= $nbLevels){ |
79 | 79 | $displayPlace = str_replace($match2, $levels[$index-1] , $displayPlace); |
80 | - } |
|
81 | - else{ |
|
80 | + } else{ |
|
82 | 81 | $displayPlace = str_replace($match2, '' , $displayPlace); |
83 | 82 | } |
84 | 83 | } |
@@ -55,8 +55,7 @@ discard block |
||
55 | 55 | echo FunctionsPrintLists::surnameTable($surns, WT_SCRIPT_NAME, $tree, $extra_params); |
56 | 56 | break; |
57 | 57 | } |
58 | - } |
|
59 | - else if ($this->data->get('islineages', false)) { |
|
58 | + } else if ($this->data->get('islineages', false)) { |
|
60 | 59 | //Link to indilist |
61 | 60 | echo '<p class="center"><strong>'. |
62 | 61 | '<a href="indilist.php?ged=' . $tree->getNameUrl() . '&surname=' . rawurlencode($this->data->get('surname')) .'">'. |
@@ -81,7 +80,9 @@ discard block |
||
81 | 80 | |
82 | 81 | foreach($lineages as $i => $lineage) { |
83 | 82 | $this->printRootLineage($lineage); |
84 | - if($i < $nb_lineages - 1) echo '<hr />'; |
|
83 | + if($i < $nb_lineages - 1) { |
|
84 | + echo '<hr />'; |
|
85 | + } |
|
85 | 86 | } |
86 | 87 | |
87 | 88 | echo '</div>'; |
@@ -156,8 +157,7 @@ discard block |
||
156 | 157 | } |
157 | 158 | } |
158 | 159 | } |
159 | - } |
|
160 | - else { |
|
160 | + } else { |
|
161 | 161 | $this->printLineage($node); |
162 | 162 | } |
163 | 163 | echo '</div>'; |
@@ -185,8 +185,7 @@ discard block |
||
185 | 185 | echo '<li>'; |
186 | 186 | if($is_first_family){ |
187 | 187 | echo FunctionsPrint::htmlIndividualForList($node_indi); |
188 | - } |
|
189 | - else{ |
|
188 | + } else{ |
|
190 | 189 | echo FunctionsPrint::htmlIndividualForList($node_indi, false); |
191 | 190 | } |
192 | 191 | //Get individual's spouse |
@@ -207,15 +206,13 @@ discard block |
||
207 | 206 | foreach($fam_nodes[$fam] as $child_node) { |
208 | 207 | if($child_node) { |
209 | 208 | $this->printLineage($child_node); |
210 | - } |
|
211 | - else { |
|
209 | + } else { |
|
212 | 210 | echo '<ul><li><strong>…</strong></li></ul>'; |
213 | 211 | } |
214 | 212 | } |
215 | 213 | $is_first_family = false; |
216 | 214 | } |
217 | - } |
|
218 | - else { |
|
215 | + } else { |
|
219 | 216 | echo '<li>'; |
220 | 217 | echo \MyArtJaub\Webtrees\Functions\FunctionsPrint::htmlIndividualForList($node->getIndividual()); |
221 | 218 | if($node->hasFollowUpSurname()) { |
@@ -31,161 +31,161 @@ discard block |
||
31 | 31 | * {@inhericDoc} |
32 | 32 | * @see \MyArtJaub\Webtrees\Mvc\View\AbstractView::renderContent() |
33 | 33 | */ |
34 | - protected function renderContent() { |
|
34 | + protected function renderContent() { |
|
35 | 35 | |
36 | - /** @var \Fisharebest\Webtrees\Tree $tree */ |
|
37 | - $tree = $this->data->get('tree'); |
|
36 | + /** @var \Fisharebest\Webtrees\Tree $tree */ |
|
37 | + $tree = $this->data->get('tree'); |
|
38 | 38 | |
39 | - echo '<h2 class="center">', $this->data->get('title') , '</h2>'; |
|
40 | - echo '<p class="center alpha_index">', implode(' | ', $this->getInitialLettersList()), '</p>'; |
|
39 | + echo '<h2 class="center">', $this->data->get('title') , '</h2>'; |
|
40 | + echo '<p class="center alpha_index">', implode(' | ', $this->getInitialLettersList()), '</p>'; |
|
41 | 41 | |
42 | - if($this->data->get('issurnames', false)) { |
|
43 | - $surns = $this->data->get('surnameslist', array()); |
|
44 | - $extra_params = array ('mod' => Constants::MODULE_MAJ_PATROLIN_NAME, 'mod_action' => 'Lineage'); |
|
45 | - // Show the surname list |
|
46 | - switch ($tree->getPreference('SURNAME_LIST_STYLE')) { |
|
47 | - case 'style1': |
|
42 | + if($this->data->get('issurnames', false)) { |
|
43 | + $surns = $this->data->get('surnameslist', array()); |
|
44 | + $extra_params = array ('mod' => Constants::MODULE_MAJ_PATROLIN_NAME, 'mod_action' => 'Lineage'); |
|
45 | + // Show the surname list |
|
46 | + switch ($tree->getPreference('SURNAME_LIST_STYLE')) { |
|
47 | + case 'style1': |
|
48 | 48 | echo FunctionsPrintLists::surnameList($surns, 3, true, WT_SCRIPT_NAME, $tree, $extra_params); |
49 | 49 | break; |
50 | - case 'style3': |
|
51 | - echo FunctionsPrintLists::surnameTagCloud($surns, WT_SCRIPT_NAME, true, $tree, $extra_params); |
|
52 | - break; |
|
53 | - case 'style2': |
|
54 | - default: |
|
55 | - echo FunctionsPrintLists::surnameTable($surns, WT_SCRIPT_NAME, $tree, $extra_params); |
|
56 | - break; |
|
57 | - } |
|
58 | - } |
|
59 | - else if ($this->data->get('islineages', false)) { |
|
60 | - //Link to indilist |
|
61 | - echo '<p class="center"><strong>'. |
|
62 | - '<a href="indilist.php?ged=' . $tree->getNameUrl() . '&surname=' . rawurlencode($this->data->get('surname')) .'">'. |
|
63 | - I18N::translate('Go to the list of individuals with surname %s', $this->data->get('legend')). |
|
64 | - '</a></strong></p>'; |
|
50 | + case 'style3': |
|
51 | + echo FunctionsPrintLists::surnameTagCloud($surns, WT_SCRIPT_NAME, true, $tree, $extra_params); |
|
52 | + break; |
|
53 | + case 'style2': |
|
54 | + default: |
|
55 | + echo FunctionsPrintLists::surnameTable($surns, WT_SCRIPT_NAME, $tree, $extra_params); |
|
56 | + break; |
|
57 | + } |
|
58 | + } |
|
59 | + else if ($this->data->get('islineages', false)) { |
|
60 | + //Link to indilist |
|
61 | + echo '<p class="center"><strong>'. |
|
62 | + '<a href="indilist.php?ged=' . $tree->getNameUrl() . '&surname=' . rawurlencode($this->data->get('surname')) .'">'. |
|
63 | + I18N::translate('Go to the list of individuals with surname %s', $this->data->get('legend')). |
|
64 | + '</a></strong></p>'; |
|
65 | 65 | |
66 | - $lineages = $this->data->get('lineages', null); |
|
67 | - $nb_lineages = count($lineages); |
|
68 | - if(is_null($lineages) || $nb_lineages == 0) { |
|
69 | - echo '<p class="center"><span class="warning">', |
|
70 | - I18N::translate('No individuals with surname %s has been found. Please try another name.', |
|
71 | - '<span dir="auto">' . $this->data->get('legend') . '</span>'), |
|
72 | - '</span></p>'; |
|
73 | - } else { |
|
66 | + $lineages = $this->data->get('lineages', null); |
|
67 | + $nb_lineages = count($lineages); |
|
68 | + if(is_null($lineages) || $nb_lineages == 0) { |
|
69 | + echo '<p class="center"><span class="warning">', |
|
70 | + I18N::translate('No individuals with surname %s has been found. Please try another name.', |
|
71 | + '<span dir="auto">' . $this->data->get('legend') . '</span>'), |
|
72 | + '</span></p>'; |
|
73 | + } else { |
|
74 | 74 | |
75 | - echo '<div id="patronymiclineages">'. |
|
76 | - '<div class="list_label">', |
|
77 | - $this->data->get('table_title'), |
|
78 | - '</div>'; |
|
75 | + echo '<div id="patronymiclineages">'. |
|
76 | + '<div class="list_label">', |
|
77 | + $this->data->get('table_title'), |
|
78 | + '</div>'; |
|
79 | 79 | |
80 | - echo '<div class="list_value_wrap">'; |
|
80 | + echo '<div class="list_value_wrap">'; |
|
81 | 81 | |
82 | - foreach($lineages as $i => $lineage) { |
|
83 | - $this->printRootLineage($lineage); |
|
84 | - if($i < $nb_lineages - 1) echo '<hr />'; |
|
85 | - } |
|
82 | + foreach($lineages as $i => $lineage) { |
|
83 | + $this->printRootLineage($lineage); |
|
84 | + if($i < $nb_lineages - 1) echo '<hr />'; |
|
85 | + } |
|
86 | 86 | |
87 | - echo '</div>'; |
|
87 | + echo '</div>'; |
|
88 | 88 | |
89 | - echo '<div class="list_label">', |
|
90 | - I18N::translate('%s lineages found', $nb_lineages), |
|
91 | - '</div>'. |
|
92 | - '</div>'; |
|
89 | + echo '<div class="list_label">', |
|
90 | + I18N::translate('%s lineages found', $nb_lineages), |
|
91 | + '</div>'. |
|
92 | + '</div>'; |
|
93 | 93 | |
94 | - } |
|
95 | - } |
|
96 | - } |
|
94 | + } |
|
95 | + } |
|
96 | + } |
|
97 | 97 | |
98 | - /** |
|
99 | - * Get the list of initial letters |
|
100 | - * |
|
101 | - * @return string[] |
|
102 | - */ |
|
103 | - private function getInitialLettersList() { |
|
104 | - $list = array(); |
|
105 | - /** @var \Fisharebest\Webtrees\Tree $tree */ |
|
106 | - $tree = $this->data->get('tree'); |
|
98 | + /** |
|
99 | + * Get the list of initial letters |
|
100 | + * |
|
101 | + * @return string[] |
|
102 | + */ |
|
103 | + private function getInitialLettersList() { |
|
104 | + $list = array(); |
|
105 | + /** @var \Fisharebest\Webtrees\Tree $tree */ |
|
106 | + $tree = $this->data->get('tree'); |
|
107 | 107 | $script_base_url = WT_SCRIPT_NAME . '?mod=' . \MyArtJaub\Webtrees\Constants::MODULE_MAJ_PATROLIN_NAME . '&mod_action=Lineage'; |
108 | 108 | |
109 | - foreach (QueryName::surnameAlpha($tree, false, false) as $letter => $count) { |
|
110 | - switch ($letter) { |
|
111 | - case '@': |
|
112 | - $html = I18N::translateContext('Unknown surname', '…'); |
|
113 | - break; |
|
114 | - case ',': |
|
115 | - $html = I18N::translate('None'); |
|
116 | - break; |
|
117 | - default: |
|
118 | - $html = Filter::escapeHtml($letter); |
|
119 | - break; |
|
120 | - } |
|
121 | - if ($count) { |
|
122 | - if ($letter == $this->data->get('alpha')) { |
|
123 | - $list[] = '<a href="' . $script_base_url . '&alpha=' . rawurlencode($letter) . '&ged=' . $tree->getNameUrl() . '" class="warning" title="' . I18N::number($count) . '">' . $html . '</a>'; |
|
124 | - } else { |
|
125 | - $list[] = '<a href="' . $script_base_url . '&alpha=' . rawurlencode($letter) . '&ged=' . $tree->getNameUrl() . '" title="' . I18N::number($count) . '">' . $html . '</a>'; |
|
126 | - } |
|
127 | - } else { |
|
128 | - $list[] = $html; |
|
129 | - } |
|
130 | - } |
|
109 | + foreach (QueryName::surnameAlpha($tree, false, false) as $letter => $count) { |
|
110 | + switch ($letter) { |
|
111 | + case '@': |
|
112 | + $html = I18N::translateContext('Unknown surname', '…'); |
|
113 | + break; |
|
114 | + case ',': |
|
115 | + $html = I18N::translate('None'); |
|
116 | + break; |
|
117 | + default: |
|
118 | + $html = Filter::escapeHtml($letter); |
|
119 | + break; |
|
120 | + } |
|
121 | + if ($count) { |
|
122 | + if ($letter == $this->data->get('alpha')) { |
|
123 | + $list[] = '<a href="' . $script_base_url . '&alpha=' . rawurlencode($letter) . '&ged=' . $tree->getNameUrl() . '" class="warning" title="' . I18N::number($count) . '">' . $html . '</a>'; |
|
124 | + } else { |
|
125 | + $list[] = '<a href="' . $script_base_url . '&alpha=' . rawurlencode($letter) . '&ged=' . $tree->getNameUrl() . '" title="' . I18N::number($count) . '">' . $html . '</a>'; |
|
126 | + } |
|
127 | + } else { |
|
128 | + $list[] = $html; |
|
129 | + } |
|
130 | + } |
|
131 | 131 | |
132 | - // Search spiders don't get the "show all" option as the other links give them everything. |
|
133 | - if (!Auth::isSearchEngine()) { |
|
134 | - if ($this->data->get('show_all') === 'yes') { |
|
135 | - $list[] = '<span class="warning">' . I18N::translate('All') . '</span>'; |
|
136 | - } else { |
|
137 | - $list[] = '<a href="' . $script_base_url . '&show_all=yes' . '&ged=' . $tree->getNameUrl() . '">' . I18N::translate('All') . '</a>'; |
|
138 | - } |
|
139 | - } |
|
132 | + // Search spiders don't get the "show all" option as the other links give them everything. |
|
133 | + if (!Auth::isSearchEngine()) { |
|
134 | + if ($this->data->get('show_all') === 'yes') { |
|
135 | + $list[] = '<span class="warning">' . I18N::translate('All') . '</span>'; |
|
136 | + } else { |
|
137 | + $list[] = '<a href="' . $script_base_url . '&show_all=yes' . '&ged=' . $tree->getNameUrl() . '">' . I18N::translate('All') . '</a>'; |
|
138 | + } |
|
139 | + } |
|
140 | 140 | |
141 | - return $list; |
|
142 | - } |
|
141 | + return $list; |
|
142 | + } |
|
143 | 143 | |
144 | - /** |
|
145 | - * Print a root lineage node |
|
146 | - * @param LineageRootNode $node |
|
147 | - */ |
|
148 | - private function printRootLineage(LineageRootNode $node) { |
|
149 | - print '<div class="patrolin_tree">'; |
|
150 | - if($node->getIndividual() === null) { |
|
151 | - $fam_nodes = $node->getFamiliesNodes(); |
|
152 | - foreach($fam_nodes as $fam){ |
|
153 | - foreach($fam_nodes[$fam] as $child_node) { |
|
154 | - if($child_node) { |
|
155 | - $this->printLineage($child_node); |
|
156 | - } |
|
157 | - } |
|
158 | - } |
|
159 | - } |
|
160 | - else { |
|
161 | - $this->printLineage($node); |
|
162 | - } |
|
163 | - echo '</div>'; |
|
144 | + /** |
|
145 | + * Print a root lineage node |
|
146 | + * @param LineageRootNode $node |
|
147 | + */ |
|
148 | + private function printRootLineage(LineageRootNode $node) { |
|
149 | + print '<div class="patrolin_tree">'; |
|
150 | + if($node->getIndividual() === null) { |
|
151 | + $fam_nodes = $node->getFamiliesNodes(); |
|
152 | + foreach($fam_nodes as $fam){ |
|
153 | + foreach($fam_nodes[$fam] as $child_node) { |
|
154 | + if($child_node) { |
|
155 | + $this->printLineage($child_node); |
|
156 | + } |
|
157 | + } |
|
158 | + } |
|
159 | + } |
|
160 | + else { |
|
161 | + $this->printLineage($node); |
|
162 | + } |
|
163 | + echo '</div>'; |
|
164 | 164 | |
165 | - $places = $node->getPlaces(); |
|
166 | - if($places && count($places)>0){ |
|
167 | - echo '<div class="patrolin_places">'; |
|
168 | - echo \MyArtJaub\Webtrees\Functions\FunctionsPrint::htmlPlacesCloud($places, false, $this->data->get('tree')); |
|
169 | - echo '</div>'; |
|
170 | - } |
|
171 | - } |
|
165 | + $places = $node->getPlaces(); |
|
166 | + if($places && count($places)>0){ |
|
167 | + echo '<div class="patrolin_places">'; |
|
168 | + echo \MyArtJaub\Webtrees\Functions\FunctionsPrint::htmlPlacesCloud($places, false, $this->data->get('tree')); |
|
169 | + echo '</div>'; |
|
170 | + } |
|
171 | + } |
|
172 | 172 | |
173 | - /** |
|
174 | - * Print a lineage node, recursively. |
|
175 | - * @param LineageNode $node |
|
176 | - */ |
|
177 | - private function printLineage(LineageNode $node) { |
|
173 | + /** |
|
174 | + * Print a lineage node, recursively. |
|
175 | + * @param LineageNode $node |
|
176 | + */ |
|
177 | + private function printLineage(LineageNode $node) { |
|
178 | 178 | |
179 | - echo '<ul>'; |
|
180 | - $fam_nodes = $node->getFamiliesNodes(); |
|
181 | - if(count($fam_nodes) > 0) { |
|
182 | - $is_first_family = true; |
|
183 | - foreach($fam_nodes as $fam) { |
|
184 | - $node_indi = $node->getIndividual(); |
|
185 | - echo '<li>'; |
|
186 | - if($is_first_family){ |
|
187 | - echo FunctionsPrint::htmlIndividualForList($node_indi); |
|
188 | - } |
|
179 | + echo '<ul>'; |
|
180 | + $fam_nodes = $node->getFamiliesNodes(); |
|
181 | + if(count($fam_nodes) > 0) { |
|
182 | + $is_first_family = true; |
|
183 | + foreach($fam_nodes as $fam) { |
|
184 | + $node_indi = $node->getIndividual(); |
|
185 | + echo '<li>'; |
|
186 | + if($is_first_family){ |
|
187 | + echo FunctionsPrint::htmlIndividualForList($node_indi); |
|
188 | + } |
|
189 | 189 | else{ |
190 | 190 | echo FunctionsPrint::htmlIndividualForList($node_indi, false); |
191 | 191 | } |
@@ -204,32 +204,32 @@ discard block |
||
204 | 204 | echo '<span class="details1" title="'.$marrdate.'"><i class="icon-rings"></i>'.$marryear.'</span></a> '; |
205 | 205 | echo FunctionsPrint::htmlIndividualForList($spouse); |
206 | 206 | } |
207 | - foreach($fam_nodes[$fam] as $child_node) { |
|
208 | - if($child_node) { |
|
209 | - $this->printLineage($child_node); |
|
210 | - } |
|
211 | - else { |
|
212 | - echo '<ul><li><strong>…</strong></li></ul>'; |
|
213 | - } |
|
214 | - } |
|
215 | - $is_first_family = false; |
|
216 | - } |
|
217 | - } |
|
218 | - else { |
|
219 | - echo '<li>'; |
|
220 | - echo \MyArtJaub\Webtrees\Functions\FunctionsPrint::htmlIndividualForList($node->getIndividual()); |
|
221 | - if($node->hasFollowUpSurname()) { |
|
222 | - $url_base = WT_SCRIPT_NAME . '?mod=' . \MyArtJaub\Webtrees\Constants::MODULE_MAJ_PATROLIN_NAME . '&mod_action=Lineage'; |
|
223 | - echo ' '. |
|
224 | - '<a href="' . $url_base . '&surname=' . rawurlencode($node->getFollowUpSurname()) . '&ged=' . $this->data->get('tree')->getNameUrl() . '">'. |
|
225 | - '('.I18N::translate('Go to %s lineages', $node->getFollowUpSurname()).')'. |
|
226 | - '</a>'; |
|
227 | - } |
|
228 | - echo '</li>'; |
|
229 | - } |
|
230 | - echo '</ul>'; |
|
207 | + foreach($fam_nodes[$fam] as $child_node) { |
|
208 | + if($child_node) { |
|
209 | + $this->printLineage($child_node); |
|
210 | + } |
|
211 | + else { |
|
212 | + echo '<ul><li><strong>…</strong></li></ul>'; |
|
213 | + } |
|
214 | + } |
|
215 | + $is_first_family = false; |
|
216 | + } |
|
217 | + } |
|
218 | + else { |
|
219 | + echo '<li>'; |
|
220 | + echo \MyArtJaub\Webtrees\Functions\FunctionsPrint::htmlIndividualForList($node->getIndividual()); |
|
221 | + if($node->hasFollowUpSurname()) { |
|
222 | + $url_base = WT_SCRIPT_NAME . '?mod=' . \MyArtJaub\Webtrees\Constants::MODULE_MAJ_PATROLIN_NAME . '&mod_action=Lineage'; |
|
223 | + echo ' '. |
|
224 | + '<a href="' . $url_base . '&surname=' . rawurlencode($node->getFollowUpSurname()) . '&ged=' . $this->data->get('tree')->getNameUrl() . '">'. |
|
225 | + '('.I18N::translate('Go to %s lineages', $node->getFollowUpSurname()).')'. |
|
226 | + '</a>'; |
|
227 | + } |
|
228 | + echo '</li>'; |
|
229 | + } |
|
230 | + echo '</ul>'; |
|
231 | 231 | |
232 | - } |
|
232 | + } |
|
233 | 233 | |
234 | 234 | } |
235 | 235 | |
236 | 236 | \ No newline at end of file |
@@ -36,12 +36,12 @@ discard block |
||
36 | 36 | /** @var \Fisharebest\Webtrees\Tree $tree */ |
37 | 37 | $tree = $this->data->get('tree'); |
38 | 38 | |
39 | - echo '<h2 class="center">', $this->data->get('title') , '</h2>'; |
|
39 | + echo '<h2 class="center">', $this->data->get('title'), '</h2>'; |
|
40 | 40 | echo '<p class="center alpha_index">', implode(' | ', $this->getInitialLettersList()), '</p>'; |
41 | 41 | |
42 | - if($this->data->get('issurnames', false)) { |
|
42 | + if ($this->data->get('issurnames', false)) { |
|
43 | 43 | $surns = $this->data->get('surnameslist', array()); |
44 | - $extra_params = array ('mod' => Constants::MODULE_MAJ_PATROLIN_NAME, 'mod_action' => 'Lineage'); |
|
44 | + $extra_params = array('mod' => Constants::MODULE_MAJ_PATROLIN_NAME, 'mod_action' => 'Lineage'); |
|
45 | 45 | // Show the surname list |
46 | 46 | switch ($tree->getPreference('SURNAME_LIST_STYLE')) { |
47 | 47 | case 'style1': |
@@ -59,16 +59,16 @@ discard block |
||
59 | 59 | else if ($this->data->get('islineages', false)) { |
60 | 60 | //Link to indilist |
61 | 61 | echo '<p class="center"><strong>'. |
62 | - '<a href="indilist.php?ged=' . $tree->getNameUrl() . '&surname=' . rawurlencode($this->data->get('surname')) .'">'. |
|
62 | + '<a href="indilist.php?ged='.$tree->getNameUrl().'&surname='.rawurlencode($this->data->get('surname')).'">'. |
|
63 | 63 | I18N::translate('Go to the list of individuals with surname %s', $this->data->get('legend')). |
64 | 64 | '</a></strong></p>'; |
65 | 65 | |
66 | 66 | $lineages = $this->data->get('lineages', null); |
67 | 67 | $nb_lineages = count($lineages); |
68 | - if(is_null($lineages) || $nb_lineages == 0) { |
|
68 | + if (is_null($lineages) || $nb_lineages == 0) { |
|
69 | 69 | echo '<p class="center"><span class="warning">', |
70 | 70 | I18N::translate('No individuals with surname %s has been found. Please try another name.', |
71 | - '<span dir="auto">' . $this->data->get('legend') . '</span>'), |
|
71 | + '<span dir="auto">'.$this->data->get('legend').'</span>'), |
|
72 | 72 | '</span></p>'; |
73 | 73 | } else { |
74 | 74 | |
@@ -79,9 +79,9 @@ discard block |
||
79 | 79 | |
80 | 80 | echo '<div class="list_value_wrap">'; |
81 | 81 | |
82 | - foreach($lineages as $i => $lineage) { |
|
82 | + foreach ($lineages as $i => $lineage) { |
|
83 | 83 | $this->printRootLineage($lineage); |
84 | - if($i < $nb_lineages - 1) echo '<hr />'; |
|
84 | + if ($i < $nb_lineages - 1) echo '<hr />'; |
|
85 | 85 | } |
86 | 86 | |
87 | 87 | echo '</div>'; |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | $list = array(); |
105 | 105 | /** @var \Fisharebest\Webtrees\Tree $tree */ |
106 | 106 | $tree = $this->data->get('tree'); |
107 | - $script_base_url = WT_SCRIPT_NAME . '?mod=' . \MyArtJaub\Webtrees\Constants::MODULE_MAJ_PATROLIN_NAME . '&mod_action=Lineage'; |
|
107 | + $script_base_url = WT_SCRIPT_NAME.'?mod='.\MyArtJaub\Webtrees\Constants::MODULE_MAJ_PATROLIN_NAME.'&mod_action=Lineage'; |
|
108 | 108 | |
109 | 109 | foreach (QueryName::surnameAlpha($tree, false, false) as $letter => $count) { |
110 | 110 | switch ($letter) { |
@@ -120,9 +120,9 @@ discard block |
||
120 | 120 | } |
121 | 121 | if ($count) { |
122 | 122 | if ($letter == $this->data->get('alpha')) { |
123 | - $list[] = '<a href="' . $script_base_url . '&alpha=' . rawurlencode($letter) . '&ged=' . $tree->getNameUrl() . '" class="warning" title="' . I18N::number($count) . '">' . $html . '</a>'; |
|
123 | + $list[] = '<a href="'.$script_base_url.'&alpha='.rawurlencode($letter).'&ged='.$tree->getNameUrl().'" class="warning" title="'.I18N::number($count).'">'.$html.'</a>'; |
|
124 | 124 | } else { |
125 | - $list[] = '<a href="' . $script_base_url . '&alpha=' . rawurlencode($letter) . '&ged=' . $tree->getNameUrl() . '" title="' . I18N::number($count) . '">' . $html . '</a>'; |
|
125 | + $list[] = '<a href="'.$script_base_url.'&alpha='.rawurlencode($letter).'&ged='.$tree->getNameUrl().'" title="'.I18N::number($count).'">'.$html.'</a>'; |
|
126 | 126 | } |
127 | 127 | } else { |
128 | 128 | $list[] = $html; |
@@ -132,9 +132,9 @@ discard block |
||
132 | 132 | // Search spiders don't get the "show all" option as the other links give them everything. |
133 | 133 | if (!Auth::isSearchEngine()) { |
134 | 134 | if ($this->data->get('show_all') === 'yes') { |
135 | - $list[] = '<span class="warning">' . I18N::translate('All') . '</span>'; |
|
135 | + $list[] = '<span class="warning">'.I18N::translate('All').'</span>'; |
|
136 | 136 | } else { |
137 | - $list[] = '<a href="' . $script_base_url . '&show_all=yes' . '&ged=' . $tree->getNameUrl() . '">' . I18N::translate('All') . '</a>'; |
|
137 | + $list[] = '<a href="'.$script_base_url.'&show_all=yes'.'&ged='.$tree->getNameUrl().'">'.I18N::translate('All').'</a>'; |
|
138 | 138 | } |
139 | 139 | } |
140 | 140 | |
@@ -147,11 +147,11 @@ discard block |
||
147 | 147 | */ |
148 | 148 | private function printRootLineage(LineageRootNode $node) { |
149 | 149 | print '<div class="patrolin_tree">'; |
150 | - if($node->getIndividual() === null) { |
|
150 | + if ($node->getIndividual() === null) { |
|
151 | 151 | $fam_nodes = $node->getFamiliesNodes(); |
152 | - foreach($fam_nodes as $fam){ |
|
153 | - foreach($fam_nodes[$fam] as $child_node) { |
|
154 | - if($child_node) { |
|
152 | + foreach ($fam_nodes as $fam) { |
|
153 | + foreach ($fam_nodes[$fam] as $child_node) { |
|
154 | + if ($child_node) { |
|
155 | 155 | $this->printLineage($child_node); |
156 | 156 | } |
157 | 157 | } |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | echo '</div>'; |
164 | 164 | |
165 | 165 | $places = $node->getPlaces(); |
166 | - if($places && count($places)>0){ |
|
166 | + if ($places && count($places) > 0) { |
|
167 | 167 | echo '<div class="patrolin_places">'; |
168 | 168 | echo \MyArtJaub\Webtrees\Functions\FunctionsPrint::htmlPlacesCloud($places, false, $this->data->get('tree')); |
169 | 169 | echo '</div>'; |
@@ -178,34 +178,34 @@ discard block |
||
178 | 178 | |
179 | 179 | echo '<ul>'; |
180 | 180 | $fam_nodes = $node->getFamiliesNodes(); |
181 | - if(count($fam_nodes) > 0) { |
|
181 | + if (count($fam_nodes) > 0) { |
|
182 | 182 | $is_first_family = true; |
183 | - foreach($fam_nodes as $fam) { |
|
183 | + foreach ($fam_nodes as $fam) { |
|
184 | 184 | $node_indi = $node->getIndividual(); |
185 | 185 | echo '<li>'; |
186 | - if($is_first_family){ |
|
186 | + if ($is_first_family) { |
|
187 | 187 | echo FunctionsPrint::htmlIndividualForList($node_indi); |
188 | 188 | } |
189 | - else{ |
|
189 | + else { |
|
190 | 190 | echo FunctionsPrint::htmlIndividualForList($node_indi, false); |
191 | 191 | } |
192 | 192 | //Get individual's spouse |
193 | 193 | $dfam = new Family($fam); |
194 | - $spouse=$dfam->getSpouseById($node_indi); |
|
194 | + $spouse = $dfam->getSpouseById($node_indi); |
|
195 | 195 | //Print the spouse if relevant |
196 | - if($spouse){ |
|
196 | + if ($spouse) { |
|
197 | 197 | $marrdate = I18N::translate('yes'); |
198 | 198 | $marryear = ''; |
199 | 199 | echo ' <a href="'.$fam->getHtmlUrl().'">'; |
200 | - if ($fam->getMarriageYear()){ |
|
200 | + if ($fam->getMarriageYear()) { |
|
201 | 201 | $marrdate = strip_tags($fam->getMarriageDate()->Display()); |
202 | 202 | $marryear = $fam->getMarriageYear(); |
203 | 203 | } |
204 | 204 | echo '<span class="details1" title="'.$marrdate.'"><i class="icon-rings"></i>'.$marryear.'</span></a> '; |
205 | 205 | echo FunctionsPrint::htmlIndividualForList($spouse); |
206 | 206 | } |
207 | - foreach($fam_nodes[$fam] as $child_node) { |
|
208 | - if($child_node) { |
|
207 | + foreach ($fam_nodes[$fam] as $child_node) { |
|
208 | + if ($child_node) { |
|
209 | 209 | $this->printLineage($child_node); |
210 | 210 | } |
211 | 211 | else { |
@@ -218,10 +218,10 @@ discard block |
||
218 | 218 | else { |
219 | 219 | echo '<li>'; |
220 | 220 | echo \MyArtJaub\Webtrees\Functions\FunctionsPrint::htmlIndividualForList($node->getIndividual()); |
221 | - if($node->hasFollowUpSurname()) { |
|
222 | - $url_base = WT_SCRIPT_NAME . '?mod=' . \MyArtJaub\Webtrees\Constants::MODULE_MAJ_PATROLIN_NAME . '&mod_action=Lineage'; |
|
221 | + if ($node->hasFollowUpSurname()) { |
|
222 | + $url_base = WT_SCRIPT_NAME.'?mod='.\MyArtJaub\Webtrees\Constants::MODULE_MAJ_PATROLIN_NAME.'&mod_action=Lineage'; |
|
223 | 223 | echo ' '. |
224 | - '<a href="' . $url_base . '&surname=' . rawurlencode($node->getFollowUpSurname()) . '&ged=' . $this->data->get('tree')->getNameUrl() . '">'. |
|
224 | + '<a href="'.$url_base.'&surname='.rawurlencode($node->getFollowUpSurname()).'&ged='.$this->data->get('tree')->getNameUrl().'">'. |
|
225 | 225 | '('.I18N::translate('Go to %s lineages', $node->getFollowUpSurname()).')'. |
226 | 226 | '</a>'; |
227 | 227 | } |
@@ -92,14 +92,14 @@ discard block |
||
92 | 92 | $this->show = 'lineage'; // SURN list makes no sense here |
93 | 93 | } elseif ($this->alpha) { |
94 | 94 | $this->show_all = 'no'; |
95 | - $this->legend = Filter::escapeHtml($this->alpha) . '…'; |
|
95 | + $this->legend = Filter::escapeHtml($this->alpha).'…'; |
|
96 | 96 | $this->show = Filter::get('show', 'surn|lineage', 'surn'); |
97 | 97 | } else { |
98 | 98 | $this->show_all = 'no'; |
99 | 99 | $this->legend = '…'; |
100 | 100 | $this->show = 'none'; // Don't show lists until something is chosen |
101 | 101 | } |
102 | - $this->legend = '<span dir="auto">' . $this->legend . '</span>'; |
|
102 | + $this->legend = '<span dir="auto">'.$this->legend.'</span>'; |
|
103 | 103 | |
104 | 104 | } |
105 | 105 | |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | global $WT_TREE; |
153 | 153 | |
154 | 154 | $controller = new PageController(); |
155 | - $controller->setPageTitle(I18N::translate('Patronymic Lineages') . ' : ' . $this->legend); |
|
155 | + $controller->setPageTitle(I18N::translate('Patronymic Lineages').' : '.$this->legend); |
|
156 | 156 | |
157 | 157 | $view_bag = new ViewBag(); |
158 | 158 | $view_bag->set('title', $controller->getPageTitle()); |
@@ -161,15 +161,15 @@ discard block |
||
161 | 161 | $view_bag->set('surname', $this->surname); |
162 | 162 | $view_bag->set('legend', $this->legend); |
163 | 163 | $view_bag->set('show_all', $this->show_all); |
164 | - if($this->isShowingSurnames()) { |
|
164 | + if ($this->isShowingSurnames()) { |
|
165 | 165 | $view_bag->set('issurnames', true); |
166 | 166 | $view_bag->set('surnameslist', $this->getSurnamesList()); |
167 | 167 | } |
168 | - if($this->isShowingLineages()) { |
|
168 | + if ($this->isShowingLineages()) { |
|
169 | 169 | $view_bag->set('islineages', true); |
170 | 170 | $view_bag->set('lineages', $this->getLineages()); |
171 | 171 | |
172 | - if ($this->show_all==='no') { |
|
172 | + if ($this->show_all === 'no') { |
|
173 | 173 | $view_bag->set('table_title', I18N::translate('Individuals in %s lineages', $this->legend)); |
174 | 174 | } |
175 | 175 | else { |
@@ -171,8 +171,7 @@ |
||
171 | 171 | |
172 | 172 | if ($this->show_all==='no') { |
173 | 173 | $view_bag->set('table_title', I18N::translate('Individuals in %s lineages', $this->legend)); |
174 | - } |
|
175 | - else { |
|
174 | + } else { |
|
176 | 175 | $view_bag->set('table_title', I18N::translate('All lineages')); |
177 | 176 | } |
178 | 177 | } |
@@ -26,166 +26,166 @@ |
||
26 | 26 | class LineageController extends MvcController |
27 | 27 | { |
28 | 28 | |
29 | - /** |
|
30 | - * Generate the patronymic lineage for this surname |
|
31 | - * @var string $surname Reference surname |
|
32 | - */ |
|
33 | - private $surname; |
|
29 | + /** |
|
30 | + * Generate the patronymic lineage for this surname |
|
31 | + * @var string $surname Reference surname |
|
32 | + */ |
|
33 | + private $surname; |
|
34 | 34 | |
35 | - /** |
|
36 | - * Initial letter |
|
37 | - * @var string $alpha |
|
38 | - */ |
|
39 | - private $alpha; |
|
35 | + /** |
|
36 | + * Initial letter |
|
37 | + * @var string $alpha |
|
38 | + */ |
|
39 | + private $alpha; |
|
40 | 40 | |
41 | - /** |
|
42 | - * Show all names (values: yes|no) |
|
43 | - * @var bool $show |
|
44 | - */ |
|
45 | - private $show_all; |
|
41 | + /** |
|
42 | + * Show all names (values: yes|no) |
|
43 | + * @var bool $show |
|
44 | + */ |
|
45 | + private $show_all; |
|
46 | 46 | |
47 | - /** |
|
48 | - * Page to display (values: surn|lineage) |
|
49 | - * @var unknown $show |
|
50 | - */ |
|
51 | - private $show; |
|
47 | + /** |
|
48 | + * Page to display (values: surn|lineage) |
|
49 | + * @var unknown $show |
|
50 | + */ |
|
51 | + private $show; |
|
52 | 52 | |
53 | - /** |
|
54 | - * Page title |
|
55 | - * @var string $legend |
|
56 | - */ |
|
57 | - private $legend; |
|
53 | + /** |
|
54 | + * Page title |
|
55 | + * @var string $legend |
|
56 | + */ |
|
57 | + private $legend; |
|
58 | 58 | |
59 | - /** |
|
60 | - * {@inheritDoc} |
|
61 | - * @see \MyArtJaub\Webtrees\Mvc\Controller\MvcController::__construct(AbstractModule $module) |
|
62 | - */ |
|
63 | - public function __construct(AbstractModule $module) { |
|
64 | - global $WT_TREE; |
|
59 | + /** |
|
60 | + * {@inheritDoc} |
|
61 | + * @see \MyArtJaub\Webtrees\Mvc\Controller\MvcController::__construct(AbstractModule $module) |
|
62 | + */ |
|
63 | + public function __construct(AbstractModule $module) { |
|
64 | + global $WT_TREE; |
|
65 | 65 | |
66 | - parent::__construct($module); |
|
66 | + parent::__construct($module); |
|
67 | 67 | |
68 | - $this->surname = Filter::get('surname'); |
|
69 | - $this->alpha = Filter::get('alpha'); // All surnames beginning with this letter where "@"=unknown and ","=none |
|
70 | - $this->show_all = Filter::get('show_all', 'no|yes', 'no'); // All indis |
|
71 | - // Make sure selections are consistent. |
|
72 | - // i.e. can’t specify show_all and surname at the same time. |
|
73 | - if ($this->show_all === 'yes') { |
|
74 | - $this->alpha = ''; |
|
75 | - $this->surname = ''; |
|
76 | - $this->legend = I18N::translate('All'); |
|
77 | - $this->show = Filter::get('show', 'surn|lineage', 'surn'); |
|
78 | - } elseif ($this->surname) { |
|
79 | - $this->alpha = QueryName::initialLetter($this->surname); // so we can highlight the initial letter |
|
80 | - $this->show_all = 'no'; |
|
81 | - if ($this->surname === '@N.N.') { |
|
82 | - $this->legend = I18N::translateContext('Unknown surname', '…'); |
|
83 | - } else { |
|
84 | - $this->legend = Filter::escapeHtml($this->surname); |
|
85 | - // The surname parameter is a root/canonical form. |
|
86 | - // Display it as the actual surname |
|
87 | - foreach (QueryName::surnames($WT_TREE, $this->surname, $this->alpha, false, false) as $details) { |
|
88 | - $this->legend = implode('/', array_keys($details)); |
|
89 | - } |
|
90 | - } |
|
91 | - $this->show = 'lineage'; // SURN list makes no sense here |
|
92 | - } elseif ($this->alpha === '@') { |
|
93 | - $this->show_all = 'no'; |
|
94 | - $this->legend = I18N::translateContext('Unknown surname', '…'); |
|
95 | - $this->show = 'lineage'; // SURN list makes no sense here |
|
96 | - } elseif ($this->alpha === ',') { |
|
97 | - $this->show_all = 'no'; |
|
98 | - $this->legend = I18N::translate('None'); |
|
99 | - $this->show = 'lineage'; // SURN list makes no sense here |
|
100 | - } elseif ($this->alpha) { |
|
101 | - $this->show_all = 'no'; |
|
102 | - $this->legend = Filter::escapeHtml($this->alpha) . '…'; |
|
103 | - $this->show = Filter::get('show', 'surn|lineage', 'surn'); |
|
104 | - } else { |
|
105 | - $this->show_all = 'no'; |
|
106 | - $this->legend = '…'; |
|
107 | - $this->show = 'none'; // Don't show lists until something is chosen |
|
108 | - } |
|
109 | - $this->legend = '<span dir="auto">' . $this->legend . '</span>'; |
|
68 | + $this->surname = Filter::get('surname'); |
|
69 | + $this->alpha = Filter::get('alpha'); // All surnames beginning with this letter where "@"=unknown and ","=none |
|
70 | + $this->show_all = Filter::get('show_all', 'no|yes', 'no'); // All indis |
|
71 | + // Make sure selections are consistent. |
|
72 | + // i.e. can’t specify show_all and surname at the same time. |
|
73 | + if ($this->show_all === 'yes') { |
|
74 | + $this->alpha = ''; |
|
75 | + $this->surname = ''; |
|
76 | + $this->legend = I18N::translate('All'); |
|
77 | + $this->show = Filter::get('show', 'surn|lineage', 'surn'); |
|
78 | + } elseif ($this->surname) { |
|
79 | + $this->alpha = QueryName::initialLetter($this->surname); // so we can highlight the initial letter |
|
80 | + $this->show_all = 'no'; |
|
81 | + if ($this->surname === '@N.N.') { |
|
82 | + $this->legend = I18N::translateContext('Unknown surname', '…'); |
|
83 | + } else { |
|
84 | + $this->legend = Filter::escapeHtml($this->surname); |
|
85 | + // The surname parameter is a root/canonical form. |
|
86 | + // Display it as the actual surname |
|
87 | + foreach (QueryName::surnames($WT_TREE, $this->surname, $this->alpha, false, false) as $details) { |
|
88 | + $this->legend = implode('/', array_keys($details)); |
|
89 | + } |
|
90 | + } |
|
91 | + $this->show = 'lineage'; // SURN list makes no sense here |
|
92 | + } elseif ($this->alpha === '@') { |
|
93 | + $this->show_all = 'no'; |
|
94 | + $this->legend = I18N::translateContext('Unknown surname', '…'); |
|
95 | + $this->show = 'lineage'; // SURN list makes no sense here |
|
96 | + } elseif ($this->alpha === ',') { |
|
97 | + $this->show_all = 'no'; |
|
98 | + $this->legend = I18N::translate('None'); |
|
99 | + $this->show = 'lineage'; // SURN list makes no sense here |
|
100 | + } elseif ($this->alpha) { |
|
101 | + $this->show_all = 'no'; |
|
102 | + $this->legend = Filter::escapeHtml($this->alpha) . '…'; |
|
103 | + $this->show = Filter::get('show', 'surn|lineage', 'surn'); |
|
104 | + } else { |
|
105 | + $this->show_all = 'no'; |
|
106 | + $this->legend = '…'; |
|
107 | + $this->show = 'none'; // Don't show lists until something is chosen |
|
108 | + } |
|
109 | + $this->legend = '<span dir="auto">' . $this->legend . '</span>'; |
|
110 | 110 | |
111 | - } |
|
111 | + } |
|
112 | 112 | |
113 | - /** |
|
114 | - * Indicates whether the list of surname should be displayed |
|
115 | - * @return bool |
|
116 | - */ |
|
117 | - protected function isShowingSurnames() { |
|
118 | - return $this->show === 'surn'; |
|
119 | - } |
|
113 | + /** |
|
114 | + * Indicates whether the list of surname should be displayed |
|
115 | + * @return bool |
|
116 | + */ |
|
117 | + protected function isShowingSurnames() { |
|
118 | + return $this->show === 'surn'; |
|
119 | + } |
|
120 | 120 | |
121 | - /** |
|
122 | - * Indicates whether the lineages should be displayed |
|
123 | - * @return bool |
|
124 | - */ |
|
125 | - protected function isShowingLineages() { |
|
126 | - return $this->show === 'lineage'; |
|
127 | - } |
|
121 | + /** |
|
122 | + * Indicates whether the lineages should be displayed |
|
123 | + * @return bool |
|
124 | + */ |
|
125 | + protected function isShowingLineages() { |
|
126 | + return $this->show === 'lineage'; |
|
127 | + } |
|
128 | 128 | |
129 | - /** |
|
130 | - * Get list of surnames, starting with the specified initial |
|
131 | - * @return array |
|
132 | - */ |
|
133 | - protected function getSurnamesList() { |
|
134 | - global $WT_TREE; |
|
129 | + /** |
|
130 | + * Get list of surnames, starting with the specified initial |
|
131 | + * @return array |
|
132 | + */ |
|
133 | + protected function getSurnamesList() { |
|
134 | + global $WT_TREE; |
|
135 | 135 | |
136 | - return QueryName::surnames($WT_TREE, $this->surname, $this->alpha, false, false); |
|
137 | - } |
|
136 | + return QueryName::surnames($WT_TREE, $this->surname, $this->alpha, false, false); |
|
137 | + } |
|
138 | 138 | |
139 | - /** |
|
140 | - * Get the lineages for the controller's specified surname |
|
141 | - */ |
|
142 | - protected function getLineages() { |
|
139 | + /** |
|
140 | + * Get the lineages for the controller's specified surname |
|
141 | + */ |
|
142 | + protected function getLineages() { |
|
143 | 143 | global $WT_TREE; |
144 | 144 | |
145 | 145 | $builder = new LineageBuilder($this->surname, $WT_TREE); |
146 | 146 | $lineages = $builder->buildLineages(); |
147 | 147 | |
148 | - return $lineages; |
|
149 | - } |
|
148 | + return $lineages; |
|
149 | + } |
|
150 | 150 | |
151 | - /** |
|
152 | - * Pages |
|
153 | - */ |
|
151 | + /** |
|
152 | + * Pages |
|
153 | + */ |
|
154 | 154 | |
155 | - /** |
|
156 | - * Lineage@index |
|
157 | - */ |
|
158 | - public function index() { |
|
159 | - global $WT_TREE; |
|
155 | + /** |
|
156 | + * Lineage@index |
|
157 | + */ |
|
158 | + public function index() { |
|
159 | + global $WT_TREE; |
|
160 | 160 | |
161 | - $controller = new PageController(); |
|
162 | - $controller->setPageTitle(I18N::translate('Patronymic Lineages') . ' : ' . $this->legend); |
|
161 | + $controller = new PageController(); |
|
162 | + $controller->setPageTitle(I18N::translate('Patronymic Lineages') . ' : ' . $this->legend); |
|
163 | 163 | |
164 | - $view_bag = new ViewBag(); |
|
165 | - $view_bag->set('title', $controller->getPageTitle()); |
|
166 | - $view_bag->set('tree', $WT_TREE); |
|
167 | - $view_bag->set('alpha', $this->alpha); |
|
168 | - $view_bag->set('surname', $this->surname); |
|
169 | - $view_bag->set('legend', $this->legend); |
|
170 | - $view_bag->set('show_all', $this->show_all); |
|
171 | - if($this->isShowingSurnames()) { |
|
172 | - $view_bag->set('issurnames', true); |
|
173 | - $view_bag->set('surnameslist', $this->getSurnamesList()); |
|
174 | - } |
|
175 | - if($this->isShowingLineages()) { |
|
176 | - $view_bag->set('islineages', true); |
|
177 | - $view_bag->set('lineages', $this->getLineages()); |
|
164 | + $view_bag = new ViewBag(); |
|
165 | + $view_bag->set('title', $controller->getPageTitle()); |
|
166 | + $view_bag->set('tree', $WT_TREE); |
|
167 | + $view_bag->set('alpha', $this->alpha); |
|
168 | + $view_bag->set('surname', $this->surname); |
|
169 | + $view_bag->set('legend', $this->legend); |
|
170 | + $view_bag->set('show_all', $this->show_all); |
|
171 | + if($this->isShowingSurnames()) { |
|
172 | + $view_bag->set('issurnames', true); |
|
173 | + $view_bag->set('surnameslist', $this->getSurnamesList()); |
|
174 | + } |
|
175 | + if($this->isShowingLineages()) { |
|
176 | + $view_bag->set('islineages', true); |
|
177 | + $view_bag->set('lineages', $this->getLineages()); |
|
178 | 178 | |
179 | - if ($this->show_all==='no') { |
|
180 | - $view_bag->set('table_title', I18N::translate('Individuals in %s lineages', $this->legend)); |
|
181 | - } |
|
182 | - else { |
|
183 | - $view_bag->set('table_title', I18N::translate('All lineages')); |
|
184 | - } |
|
185 | - } |
|
179 | + if ($this->show_all==='no') { |
|
180 | + $view_bag->set('table_title', I18N::translate('Individuals in %s lineages', $this->legend)); |
|
181 | + } |
|
182 | + else { |
|
183 | + $view_bag->set('table_title', I18N::translate('All lineages')); |
|
184 | + } |
|
185 | + } |
|
186 | 186 | |
187 | - ViewFactory::make('Lineage', $this, $controller, $view_bag)->render(); |
|
188 | - } |
|
187 | + ViewFactory::make('Lineage', $this, $controller, $view_bag)->render(); |
|
188 | + } |
|
189 | 189 | |
190 | 190 | |
191 | 191 |