@@ -84,18 +84,18 @@ discard block |
||
84 | 84 | * @param User $user |
85 | 85 | */ |
86 | 86 | public function __construct(Tree $tree, User $user = null) { |
87 | - if(self::$default_user === null) |
|
87 | + if (self::$default_user === null) |
|
88 | 88 | self::$default_user = User::find(-1); |
89 | 89 | |
90 | 90 | $this->tree = $tree; |
91 | 91 | $this->user = $user; |
92 | 92 | $this->is_setup = true; |
93 | - if($this->user === null) $this->user = Auth::user(); |
|
94 | - if(strlen($this->user->getUserId()) == 0) $this->user = self::$default_user; |
|
93 | + if ($this->user === null) $this->user = Auth::user(); |
|
94 | + if (strlen($this->user->getUserId()) == 0) $this->user = self::$default_user; |
|
95 | 95 | |
96 | 96 | // Check if the user, or the default user, has a root already setup; |
97 | - if(!$this->getRootIndi()) { |
|
98 | - if($this->user == self::$default_user) { // If the default user is not setup |
|
97 | + if (!$this->getRootIndi()) { |
|
98 | + if ($this->user == self::$default_user) { // If the default user is not setup |
|
99 | 99 | $this->is_setup = false; |
100 | 100 | } |
101 | 101 | else { |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | * Remove all Sosa entries related to the gedcom file and user |
130 | 130 | */ |
131 | 131 | public function deleteAll() { |
132 | - if(!$this->is_setup) return; |
|
132 | + if (!$this->is_setup) return; |
|
133 | 133 | Database::prepare( |
134 | 134 | 'DELETE FROM `##maj_sosa`'. |
135 | 135 | ' WHERE majs_gedcom_id= :tree_id and majs_user_id = :user_id ') |
@@ -145,12 +145,12 @@ discard block |
||
145 | 145 | * @param int $sosa |
146 | 146 | */ |
147 | 147 | public function deleteAncestors($sosa) { |
148 | - if(!$this->is_setup) return; |
|
148 | + if (!$this->is_setup) return; |
|
149 | 149 | $gen = Functions::getGeneration($sosa); |
150 | 150 | Database::prepare( |
151 | 151 | 'DELETE FROM `##maj_sosa`'. |
152 | - ' WHERE majs_gedcom_id=:tree_id and majs_user_id = :user_id' . |
|
153 | - ' AND majs_gen >= :gen' . |
|
152 | + ' WHERE majs_gedcom_id=:tree_id and majs_user_id = :user_id'. |
|
153 | + ' AND majs_gen >= :gen'. |
|
154 | 154 | ' AND FLOOR(majs_sosa / (POW(2, (majs_gen - :gen)))) = :sosa' |
155 | 155 | )->execute(array( |
156 | 156 | 'tree_id' => $this->tree->getTreeId(), |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | * @param array $sosa_records |
166 | 166 | */ |
167 | 167 | public function insertOrUpdate($sosa_records) { |
168 | - if(!$this->is_setup) return; |
|
168 | + if (!$this->is_setup) return; |
|
169 | 169 | |
170 | 170 | $treeid = $this->tree->getTreeId(); |
171 | 171 | $userid = $this->user->getUserId(); |
@@ -173,9 +173,9 @@ discard block |
||
173 | 173 | $values_table = array(); |
174 | 174 | |
175 | 175 | $i = 0; |
176 | - foreach ($sosa_records as $row) { |
|
176 | + foreach ($sosa_records as $row) { |
|
177 | 177 | $gen = Functions::getGeneration($row['sosa']); |
178 | - if($gen <= self::MAX_DB_GENERATIONS) { |
|
178 | + if ($gen <= self::MAX_DB_GENERATIONS) { |
|
179 | 179 | $questionmarks_table[] = |
180 | 180 | '(:tree_id'.$i.', :user_id'.$i.', :sosa'.$i.', :indi_id'.$i.', :gen'.$i.', :byear'.$i.', :dyear'.$i.')'; |
181 | 181 | $values_table = array_merge( |
@@ -194,9 +194,9 @@ discard block |
||
194 | 194 | $i++; |
195 | 195 | } |
196 | 196 | |
197 | - $sql = 'REPLACE INTO `##maj_sosa`' . |
|
198 | - ' (majs_gedcom_id, majs_user_id, majs_sosa, majs_i_id, majs_gen, majs_birth_year, majs_death_year)' . |
|
199 | - ' VALUES '. implode(',', $questionmarks_table); |
|
197 | + $sql = 'REPLACE INTO `##maj_sosa`'. |
|
198 | + ' (majs_gedcom_id, majs_user_id, majs_sosa, majs_i_id, majs_gen, majs_birth_year, majs_death_year)'. |
|
199 | + ' VALUES '.implode(',', $questionmarks_table); |
|
200 | 200 | Database::prepare($sql)->execute($values_table); |
201 | 201 | } |
202 | 202 | |
@@ -212,7 +212,7 @@ discard block |
||
212 | 212 | * @return array Array of sosa numbers |
213 | 213 | */ |
214 | 214 | public function getSosaNumbers(Individual $indi) { |
215 | - if(!$this->is_setup) return array(); |
|
215 | + if (!$this->is_setup) return array(); |
|
216 | 216 | return Database::prepare( |
217 | 217 | 'SELECT majs_sosa, majs_gen FROM `##maj_sosa`'. |
218 | 218 | ' WHERE majs_i_id=:indi_id AND majs_gedcom_id=:tree_id AND majs_user_id=:user_id' |
@@ -229,7 +229,7 @@ discard block |
||
229 | 229 | * @return number Last generation if found, 1 otherwise |
230 | 230 | */ |
231 | 231 | public function getLastGeneration() { |
232 | - if(!$this->is_setup) return; |
|
232 | + if (!$this->is_setup) return; |
|
233 | 233 | return Database::prepare( |
234 | 234 | 'SELECT MAX(majs_gen) FROM `##maj_sosa`'. |
235 | 235 | ' WHERE majs_gedcom_id=:tree_id AND majs_user_id=:user_id' |
@@ -249,13 +249,13 @@ discard block |
||
249 | 249 | * @param int $ged_id ID of the gedcom file |
250 | 250 | * @return array Associative array of Sosa ancestors, with their generation, comma separated |
251 | 251 | */ |
252 | - public function getAllSosaWithGenerations(){ |
|
253 | - if(!$this->is_setup) return array(); |
|
252 | + public function getAllSosaWithGenerations() { |
|
253 | + if (!$this->is_setup) return array(); |
|
254 | 254 | return Database::prepare( |
255 | - 'SELECT majs_i_id AS indi,' . |
|
256 | - ' GROUP_CONCAT(DISTINCT majs_gen ORDER BY majs_gen ASC SEPARATOR ",") AS generations' . |
|
257 | - ' FROM `##maj_sosa`' . |
|
258 | - ' WHERE majs_gedcom_id=:tree_id AND majs_user_id=:user_id' . |
|
255 | + 'SELECT majs_i_id AS indi,'. |
|
256 | + ' GROUP_CONCAT(DISTINCT majs_gen ORDER BY majs_gen ASC SEPARATOR ",") AS generations'. |
|
257 | + ' FROM `##maj_sosa`'. |
|
258 | + ' WHERE majs_gedcom_id=:tree_id AND majs_user_id=:user_id'. |
|
259 | 259 | ' GROUP BY majs_i_id' |
260 | 260 | )->execute(array( |
261 | 261 | 'tree_id' => $this->tree->getTreeId(), |
@@ -269,13 +269,13 @@ discard block |
||
269 | 269 | * @param number $gen Generation |
270 | 270 | * @return array Array of Sosa individuals |
271 | 271 | */ |
272 | - public function getSosaListAtGeneration($gen){ |
|
273 | - if(!$this->is_setup) return array(); |
|
274 | - if(!$this->sosa_list_by_gen) |
|
272 | + public function getSosaListAtGeneration($gen) { |
|
273 | + if (!$this->is_setup) return array(); |
|
274 | + if (!$this->sosa_list_by_gen) |
|
275 | 275 | $this->sosa_list_by_gen = array(); |
276 | 276 | |
277 | - if($gen){ |
|
278 | - if(!isset($this->sosa_list_by_gen[$gen])){ |
|
277 | + if ($gen) { |
|
278 | + if (!isset($this->sosa_list_by_gen[$gen])) { |
|
279 | 279 | $this->sosa_list_by_gen[$gen] = Database::prepare( |
280 | 280 | 'SELECT majs_sosa AS sosa, majs_i_id AS indi'. |
281 | 281 | ' FROM `##maj_sosa`'. |
@@ -300,13 +300,13 @@ discard block |
||
300 | 300 | * @param number $gen Generation |
301 | 301 | * @return array Array of Sosa families |
302 | 302 | */ |
303 | - public function getFamilySosaListAtGeneration($gen){ |
|
304 | - if(!$this->is_setup) return array(); |
|
305 | - if(!$this->sosa_fam_list_by_gen) |
|
303 | + public function getFamilySosaListAtGeneration($gen) { |
|
304 | + if (!$this->is_setup) return array(); |
|
305 | + if (!$this->sosa_fam_list_by_gen) |
|
306 | 306 | $this->sosa_fam_list_by_gen = array(); |
307 | 307 | |
308 | - if($gen){ |
|
309 | - if(!isset($this->sosa_fam_list_by_gen[$gen])){ |
|
308 | + if ($gen) { |
|
309 | + if (!isset($this->sosa_fam_list_by_gen[$gen])) { |
|
310 | 310 | $this->sosa_fam_list_by_gen[$gen] = Database::prepare( |
311 | 311 | 'SELECT s1.majs_sosa AS sosa, f_id AS fam'. |
312 | 312 | ' FROM `##families`'. |
@@ -336,9 +336,9 @@ discard block |
||
336 | 336 | * @param number $gen Generation |
337 | 337 | * @return array Array of Sosa individuals |
338 | 338 | */ |
339 | - public function getMissingSosaListAtGeneration($gen){ |
|
340 | - if(!$this->is_setup) return array(); |
|
341 | - if($gen){ |
|
339 | + public function getMissingSosaListAtGeneration($gen) { |
|
340 | + if (!$this->is_setup) return array(); |
|
341 | + if ($gen) { |
|
342 | 342 | return $this->sosa_list_by_gen[$gen] = Database::prepare( |
343 | 343 | 'SELECT schild.majs_sosa sosa, schild.majs_i_id indi, sfat.majs_sosa IS NOT NULL has_father, smot.majs_sosa IS NOT NULL has_mother'. |
344 | 344 | ' FROM `##maj_sosa` schild'. |
@@ -375,10 +375,10 @@ discard block |
||
375 | 375 | * @return array Statistics array |
376 | 376 | */ |
377 | 377 | public function getStatisticsByGeneration() { |
378 | - if(!$this->is_setup) return array(); |
|
379 | - if(!$this->statistics_tab) { |
|
378 | + if (!$this->is_setup) return array(); |
|
379 | + if (!$this->statistics_tab) { |
|
380 | 380 | $this->statistics_tab = array(); |
381 | - if($maxGeneration = $this->getLastGeneration()) { |
|
381 | + if ($maxGeneration = $this->getLastGeneration()) { |
|
382 | 382 | for ($gen = 1; $gen <= $maxGeneration; $gen++) { |
383 | 383 | $birthStats = $this->getStatsBirthYearInGeneration($gen); |
384 | 384 | $this->statistics_tab[$gen] = array( |
@@ -401,9 +401,9 @@ discard block |
||
401 | 401 | * @return int |
402 | 402 | */ |
403 | 403 | public function getTotalIndividuals() { |
404 | - if(!$this->is_setup) return 0; |
|
404 | + if (!$this->is_setup) return 0; |
|
405 | 405 | return Database::prepare( |
406 | - 'SELECT SQL_CACHE COUNT(*) FROM `##individuals`' . |
|
406 | + 'SELECT SQL_CACHE COUNT(*) FROM `##individuals`'. |
|
407 | 407 | ' WHERE i_file = :tree_id') |
408 | 408 | ->execute(array('tree_id' => $this->tree->getTreeId())) |
409 | 409 | ->fetchOne() ?: 0; |
@@ -414,10 +414,10 @@ discard block |
||
414 | 414 | * |
415 | 415 | * @return number Number of Sosas |
416 | 416 | */ |
417 | - public function getSosaCount(){ |
|
418 | - if(!$this->is_setup) return 0; |
|
417 | + public function getSosaCount() { |
|
418 | + if (!$this->is_setup) return 0; |
|
419 | 419 | return Database::prepare( |
420 | - 'SELECT SQL_CACHE COUNT(majs_sosa) FROM `##maj_sosa`' . |
|
420 | + 'SELECT SQL_CACHE COUNT(majs_sosa) FROM `##maj_sosa`'. |
|
421 | 421 | ' WHERE majs_gedcom_id=:tree_id AND majs_user_id=:user_id') |
422 | 422 | ->execute(array( |
423 | 423 | 'tree_id' => $this->tree->getTreeId(), |
@@ -431,10 +431,10 @@ discard block |
||
431 | 431 | * @param number $gen Generation |
432 | 432 | * @return number Number of Sosas in generation |
433 | 433 | */ |
434 | - public function getSosaCountAtGeneration($gen){ |
|
435 | - if(!$this->is_setup) return 0; |
|
434 | + public function getSosaCountAtGeneration($gen) { |
|
435 | + if (!$this->is_setup) return 0; |
|
436 | 436 | return Database::prepare( |
437 | - 'SELECT SQL_CACHE COUNT(majs_sosa) FROM `##maj_sosa`' . |
|
437 | + 'SELECT SQL_CACHE COUNT(majs_sosa) FROM `##maj_sosa`'. |
|
438 | 438 | ' WHERE majs_gedcom_id=:tree_id AND majs_user_id=:user_id'. |
439 | 439 | ' AND majs_gen= :gen') |
440 | 440 | ->execute(array( |
@@ -450,10 +450,10 @@ discard block |
||
450 | 450 | * @param number $gen Generation |
451 | 451 | * @return number Total number of Sosas up to generation |
452 | 452 | */ |
453 | - public function getSosaCountUpToGeneration($gen){ |
|
454 | - if(!$this->is_setup) return 0; |
|
453 | + public function getSosaCountUpToGeneration($gen) { |
|
454 | + if (!$this->is_setup) return 0; |
|
455 | 455 | return Database::prepare( |
456 | - 'SELECT SQL_CACHE COUNT(majs_sosa) FROM `##maj_sosa`' . |
|
456 | + 'SELECT SQL_CACHE COUNT(majs_sosa) FROM `##maj_sosa`'. |
|
457 | 457 | ' WHERE majs_gedcom_id=:tree_id AND majs_user_id=:user_id'. |
458 | 458 | ' AND majs_gen <= :gen') |
459 | 459 | ->execute(array( |
@@ -468,10 +468,10 @@ discard block |
||
468 | 468 | * |
469 | 469 | * @return number Total number of distinct individual |
470 | 470 | */ |
471 | - public function getDifferentSosaCount(){ |
|
472 | - if(!$this->is_setup) return 0; |
|
471 | + public function getDifferentSosaCount() { |
|
472 | + if (!$this->is_setup) return 0; |
|
473 | 473 | return Database::prepare( |
474 | - 'SELECT SQL_CACHE COUNT(DISTINCT majs_i_id) FROM `##maj_sosa`' . |
|
474 | + 'SELECT SQL_CACHE COUNT(DISTINCT majs_i_id) FROM `##maj_sosa`'. |
|
475 | 475 | ' WHERE majs_gedcom_id=:tree_id AND majs_user_id=:user_id') |
476 | 476 | ->execute(array( |
477 | 477 | 'tree_id' => $this->tree->getTreeId(), |
@@ -485,10 +485,10 @@ discard block |
||
485 | 485 | * @param number $gen Generation |
486 | 486 | * @return number Number of distinct Sosa individuals up to generation |
487 | 487 | */ |
488 | - public function getDifferentSosaCountUpToGeneration($gen){ |
|
489 | - if(!$this->is_setup) return 0; |
|
488 | + public function getDifferentSosaCountUpToGeneration($gen) { |
|
489 | + if (!$this->is_setup) return 0; |
|
490 | 490 | return Database::prepare( |
491 | - 'SELECT SQL_CACHE COUNT(DISTINCT majs_i_id) FROM `##maj_sosa`' . |
|
491 | + 'SELECT SQL_CACHE COUNT(DISTINCT majs_i_id) FROM `##maj_sosa`'. |
|
492 | 492 | ' WHERE majs_gedcom_id=:tree_id AND majs_user_id=:user_id'. |
493 | 493 | ' AND majs_gen <= :gen') |
494 | 494 | ->execute(array( |
@@ -508,11 +508,11 @@ discard block |
||
508 | 508 | * @param number $gen Generation |
509 | 509 | * @return array Birth statistics array |
510 | 510 | */ |
511 | - public function getStatsBirthYearInGeneration($gen){ |
|
512 | - if(!$this->is_setup) return array('first' => 0, 'avg' => 0, 'last' => 0); |
|
511 | + public function getStatsBirthYearInGeneration($gen) { |
|
512 | + if (!$this->is_setup) return array('first' => 0, 'avg' => 0, 'last' => 0); |
|
513 | 513 | return Database::prepare( |
514 | 514 | 'SELECT MIN(majs_birth_year) AS first, AVG(majs_birth_year) AS avg, MAX(majs_birth_year) AS last'. |
515 | - ' FROM `##maj_sosa`' . |
|
515 | + ' FROM `##maj_sosa`'. |
|
516 | 516 | ' WHERE majs_gedcom_id=:tree_id AND majs_user_id=:user_id'. |
517 | 517 | ' AND majs_gen=:gen AND NOT majs_birth_year = :birth_year') |
518 | 518 | ->execute(array( |
@@ -528,26 +528,26 @@ discard block |
||
528 | 528 | * |
529 | 529 | * @return number|NULL Mean generation time |
530 | 530 | */ |
531 | - public function getMeanGenerationTime(){ |
|
532 | - if(!$this->is_setup) return; |
|
533 | - if(!$this->statistics_tab){ |
|
531 | + public function getMeanGenerationTime() { |
|
532 | + if (!$this->is_setup) return; |
|
533 | + if (!$this->statistics_tab) { |
|
534 | 534 | $this->getStatisticsByGeneration(); |
535 | 535 | } |
536 | 536 | //Linear regression on x=generation and y=birthdate |
537 | 537 | $sum_xy = 0; |
538 | - $sum_x=0; |
|
539 | - $sum_y=0; |
|
540 | - $sum_x2=0; |
|
541 | - $n=count($this->statistics_tab); |
|
542 | - foreach($this->statistics_tab as $gen=>$stats){ |
|
543 | - $sum_xy+=$gen*$stats['avgBirth']; |
|
544 | - $sum_x+=$gen; |
|
545 | - $sum_y+=$stats['avgBirth']; |
|
546 | - $sum_x2+=$gen*$gen; |
|
538 | + $sum_x = 0; |
|
539 | + $sum_y = 0; |
|
540 | + $sum_x2 = 0; |
|
541 | + $n = count($this->statistics_tab); |
|
542 | + foreach ($this->statistics_tab as $gen=>$stats) { |
|
543 | + $sum_xy += $gen * $stats['avgBirth']; |
|
544 | + $sum_x += $gen; |
|
545 | + $sum_y += $stats['avgBirth']; |
|
546 | + $sum_x2 += $gen * $gen; |
|
547 | 547 | } |
548 | - $denom=($n*$sum_x2)-($sum_x*$sum_x); |
|
549 | - if($denom!=0){ |
|
550 | - return -(($n*$sum_xy)-($sum_x*$sum_y))/($denom); |
|
548 | + $denom = ($n * $sum_x2) - ($sum_x * $sum_x); |
|
549 | + if ($denom != 0) { |
|
550 | + return -(($n * $sum_xy) - ($sum_x * $sum_y)) / ($denom); |
|
551 | 551 | } |
552 | 552 | return null; |
553 | 553 | } |
@@ -575,14 +575,14 @@ discard block |
||
575 | 575 | * @return array |
576 | 576 | */ |
577 | 577 | public function getAncestorDispersionForGen($gen) { |
578 | - if(!$this->is_setup || $gen > 11) return array(); // Going further than 11 gen will be out of range in the query |
|
578 | + if (!$this->is_setup || $gen > 11) return array(); // Going further than 11 gen will be out of range in the query |
|
579 | 579 | return Database::prepare( |
580 | 580 | 'SELECT branches, count(i_id)'. |
581 | 581 | ' FROM ('. |
582 | 582 | ' SELECT i_id,'. |
583 | 583 | ' CASE'. |
584 | 584 | ' WHEN CEIL(LOG2(SUM(branch))) = LOG2(SUM(branch)) THEN SUM(branch)'. |
585 | - ' ELSE -1'. // We put all ancestors shared between some branches in the same bucket |
|
585 | + ' ELSE -1'.// We put all ancestors shared between some branches in the same bucket |
|
586 | 586 | ' END branches'. |
587 | 587 | ' FROM ('. |
588 | 588 | ' SELECT DISTINCT majs_i_id i_id,'. |
@@ -22,17 +22,17 @@ |
||
22 | 22 | public function upgrade() { |
23 | 23 | |
24 | 24 | Database::exec( |
25 | - 'CREATE TABLE IF NOT EXISTS `##maj_sosa` (' . |
|
26 | - ' majs_gedcom_id INTEGER NOT NULL,' . |
|
27 | - ' majs_user_id INTEGER NOT NULL DEFAULT -1,' . |
|
28 | - ' majs_sosa BIGINT UNSIGNED NOT NULL,' . // Allow to calculate sosa on 64 generations |
|
29 | - ' majs_i_id VARCHAR(20) NOT NULL,' . |
|
30 | - ' majs_gen TINYINT NULL,' . |
|
31 | - ' majs_birth_year SMALLINT NULL,' . |
|
32 | - ' majs_death_year SMALLINT NULL,' . |
|
33 | - ' PRIMARY KEY (majs_gedcom_id, majs_user_id, majs_sosa),' . |
|
34 | - ' FOREIGN KEY `##gedcom_id_fk1` (majs_gedcom_id) REFERENCES `##gedcom` (gedcom_id) ON DELETE CASCADE,' . |
|
35 | - ' FOREIGN KEY `##user_id_fk1` (majs_user_id) REFERENCES `##user` (user_id) ON DELETE CASCADE' . |
|
25 | + 'CREATE TABLE IF NOT EXISTS `##maj_sosa` ('. |
|
26 | + ' majs_gedcom_id INTEGER NOT NULL,'. |
|
27 | + ' majs_user_id INTEGER NOT NULL DEFAULT -1,'. |
|
28 | + ' majs_sosa BIGINT UNSIGNED NOT NULL,'.// Allow to calculate sosa on 64 generations |
|
29 | + ' majs_i_id VARCHAR(20) NOT NULL,'. |
|
30 | + ' majs_gen TINYINT NULL,'. |
|
31 | + ' majs_birth_year SMALLINT NULL,'. |
|
32 | + ' majs_death_year SMALLINT NULL,'. |
|
33 | + ' PRIMARY KEY (majs_gedcom_id, majs_user_id, majs_sosa),'. |
|
34 | + ' FOREIGN KEY `##gedcom_id_fk1` (majs_gedcom_id) REFERENCES `##gedcom` (gedcom_id) ON DELETE CASCADE,'. |
|
35 | + ' FOREIGN KEY `##user_id_fk1` (majs_user_id) REFERENCES `##user` (user_id) ON DELETE CASCADE'. |
|
36 | 36 | ') COLLATE utf8_unicode_ci ENGINE=InnoDB' |
37 | 37 | ); |
38 | 38 | } |
@@ -28,11 +28,11 @@ discard block |
||
28 | 28 | <div id="maj-sosa-list-page" class="center"> |
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 | $selectedgen = $this->data->get('generation'); |
33 | 33 | $this->renderSosaHeader(); |
34 | - if($this->data->get('has_sosa') ) { |
|
35 | - if($selectedgen > 0) { |
|
34 | + if ($this->data->get('has_sosa')) { |
|
35 | + if ($selectedgen > 0) { |
|
36 | 36 | ?> |
37 | 37 | <div id="sosalist-tabs"> |
38 | 38 | <ul> |
@@ -75,9 +75,9 @@ discard block |
||
75 | 75 | ?> |
76 | 76 | |
77 | 77 | <form method="get" name="setgen" action="module.php"> |
78 | - <input type="hidden" name="mod" value="<?php echo $this->data->get('url_module');?>"> |
|
79 | - <input type="hidden" name="mod_action" value="<?php echo $this->data->get('url_action');?>"> |
|
80 | - <input type="hidden" name="ged" value="<?php echo $this->data->get('url_ged');?>"> |
|
78 | + <input type="hidden" name="mod" value="<?php echo $this->data->get('url_module'); ?>"> |
|
79 | + <input type="hidden" name="mod_action" value="<?php echo $this->data->get('url_action'); ?>"> |
|
80 | + <input type="hidden" name="ged" value="<?php echo $this->data->get('url_ged'); ?>"> |
|
81 | 81 | <div class="maj-table"> |
82 | 82 | <div class="maj-row"> |
83 | 83 | <div class="label"><?php echo I18N::translate('Choose generation') ?></div> |
@@ -85,9 +85,9 @@ discard block |
||
85 | 85 | <div class="maj-row"> |
86 | 86 | <div class="value"> |
87 | 87 | <select name="gen"> |
88 | - <?php for($i=$this->data->get('min_gen'); $i <= $max_gen;$i++) {?> |
|
88 | + <?php for ($i = $this->data->get('min_gen'); $i <= $max_gen; $i++) {?> |
|
89 | 89 | <option value="<?php echo $i; ?>" |
90 | - <?php if($selectedgen && $selectedgen==$i) { ?> selected="true" <?php } ?> |
|
90 | + <?php if ($selectedgen && $selectedgen == $i) { ?> selected="true" <?php } ?> |
|
91 | 91 | ><?php echo I18N::translate('Generation %d', $i); ?> |
92 | 92 | </option> |
93 | 93 | <?php } ?> |
@@ -95,21 +95,21 @@ discard block |
||
95 | 95 | </div> |
96 | 96 | </div> |
97 | 97 | </div> |
98 | - <input type="submit" value="<?php echo I18N::translate('Show');?>" /> |
|
98 | + <input type="submit" value="<?php echo I18N::translate('Show'); ?>" /> |
|
99 | 99 | <br /> |
100 | 100 | </form> |
101 | - <?php if($selectedgen > 0) { ?> |
|
101 | + <?php if ($selectedgen > 0) { ?> |
|
102 | 102 | <h4> |
103 | - <?php if($selectedgen > $this->data->get('min_gen')) { ?> |
|
104 | - <a href="module.php?mod=<?php echo $this->data->get('url_module');?>&mod_action=<?php echo $this->data->get('url_action');?>&ged=<?php echo $this->data->get('url_ged');?>&gen=<?php echo $selectedgen-1; ?>"> |
|
103 | + <?php if ($selectedgen > $this->data->get('min_gen')) { ?> |
|
104 | + <a href="module.php?mod=<?php echo $this->data->get('url_module'); ?>&mod_action=<?php echo $this->data->get('url_action'); ?>&ged=<?php echo $this->data->get('url_ged'); ?>&gen=<?php echo $selectedgen - 1; ?>"> |
|
105 | 105 | <i class="icon-ldarrow" title="<?php echo I18N::translate('Previous generation'); ?>" ></i> |
106 | 106 | </a> |
107 | 107 | |
108 | 108 | <?php } ?> |
109 | 109 | <?php echo I18N::translate('Generation %d', $selectedgen); ?> |
110 | - <?php if($selectedgen < $max_gen) { ?> |
|
110 | + <?php if ($selectedgen < $max_gen) { ?> |
|
111 | 111 | |
112 | - <a href="module.php?mod=<?php echo $this->data->get('url_module');?>&mod_action=<?php echo $this->data->get('url_action');?>&ged=<?php echo $this->data->get('url_ged');?>&gen=<?php echo $selectedgen+1; ?>"> |
|
112 | + <a href="module.php?mod=<?php echo $this->data->get('url_module'); ?>&mod_action=<?php echo $this->data->get('url_action'); ?>&ged=<?php echo $this->data->get('url_ged'); ?>&gen=<?php echo $selectedgen + 1; ?>"> |
|
113 | 113 | <i class="icon-rdarrow" title="<?php echo I18N::translate('Next generation'); ?>" ></i> |
114 | 114 | </a> |
115 | 115 | <?php } ?> |
@@ -48,13 +48,13 @@ |
||
48 | 48 | <div class="value"> |
49 | 49 | <?php |
50 | 50 | $users = $this->data->get('users_settings'); |
51 | - if(count($users) == 1) { |
|
51 | + if (count($users) == 1) { |
|
52 | 52 | ?> |
53 | 53 | <label> |
54 | 54 | <input id="maj_sosa_input_userid" type="hidden" name="userid" value="<?php echo $users[0]['user']->getUserId(); ?>" /> |
55 | 55 | <?php echo $users[0]['user']->getRealNameHtml() ?> |
56 | 56 | </label> |
57 | - <?php } else if(count($users) > 1) { ?> |
|
57 | + <?php } else if (count($users) > 1) { ?> |
|
58 | 58 | <select id='maj-sosa-config-select' name="userid"> |
59 | 59 | <?php |
60 | 60 | $root_indi = $users[0]['rootid']; |
@@ -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> |
@@ -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 |
@@ -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> |
@@ -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> |