@@ -473,7 +473,7 @@ |
||
473 | 473 | '<p class="small text-muted">' . I18N::translate('Do not change to keep original filename.') . '<br>' . I18N::translate('You may enter a URL, beginning with “http://”.') . '</p>' |
474 | 474 | ); |
475 | 475 | } |
476 | - $folder = ''; |
|
476 | + $folder = ''; |
|
477 | 477 | } else { |
478 | 478 | if ($isExternal) { |
479 | 479 | $fileName = substr($gedfile, 5); |
@@ -506,23 +506,23 @@ |
||
506 | 506 | */ |
507 | 507 | public function getCalendarDate($date) { |
508 | 508 | switch ($this->calendar) { |
509 | - case 'julian': |
|
510 | - $caldate = new JulianDate($date); |
|
511 | - break; |
|
512 | - case 'french': |
|
513 | - $caldate = new FrenchDate($date); |
|
514 | - break; |
|
515 | - case 'jewish': |
|
516 | - $caldate = new JewishDate($date); |
|
517 | - break; |
|
518 | - case 'hijri': |
|
519 | - $caldate = new HijriDate($date); |
|
520 | - break; |
|
521 | - case 'jalali': |
|
522 | - $caldate = new JalaliDate($date); |
|
523 | - break; |
|
524 | - default: |
|
525 | - $caldate = new GregorianDate($date); |
|
509 | + case 'julian': |
|
510 | + $caldate = new JulianDate($date); |
|
511 | + break; |
|
512 | + case 'french': |
|
513 | + $caldate = new FrenchDate($date); |
|
514 | + break; |
|
515 | + case 'jewish': |
|
516 | + $caldate = new JewishDate($date); |
|
517 | + break; |
|
518 | + case 'hijri': |
|
519 | + $caldate = new HijriDate($date); |
|
520 | + break; |
|
521 | + case 'jalali': |
|
522 | + $caldate = new JalaliDate($date); |
|
523 | + break; |
|
524 | + default: |
|
525 | + $caldate = new GregorianDate($date); |
|
526 | 526 | } |
527 | 527 | |
528 | 528 | return $caldate; |
@@ -41,12 +41,12 @@ discard block |
||
41 | 41 | // Base color parameters |
42 | 42 | const RANGE = 120; // degrees |
43 | 43 | const SATURATION = 100; // percent |
44 | - const LIGHTNESS = 30; // percent |
|
44 | + const LIGHTNESS = 30; // percent |
|
45 | 45 | const ALPHA = 0.25; |
46 | 46 | const CHART_TOP = 10; // pixels |
47 | 47 | const BAR_SPACING = 22; // pixels |
48 | 48 | const YEAR_SPAN = 10; // Number of years per scale section |
49 | - const PIXELS_PER_YEAR = 7; // Number of pixels to shift per year |
|
49 | + const PIXELS_PER_YEAR = 7; // Number of pixels to shift per year |
|
50 | 50 | const SESSION_DATA = 'lifespan_data'; |
51 | 51 | |
52 | 52 | /** @var string|null Chart parameter */ |
@@ -457,8 +457,8 @@ discard block |
||
457 | 457 | } |
458 | 458 | echo |
459 | 459 | '</div>' . // class="popup" |
460 | - '</div>' . // class="itr" |
|
461 | - '</div>'; // class=$popupclass |
|
460 | + '</div>' . // class="itr" |
|
461 | + '</div>'; // class=$popupclass |
|
462 | 462 | |
463 | 463 | $maxY = max($maxY, $Y); |
464 | 464 | } |
@@ -102,26 +102,26 @@ discard block |
||
102 | 102 | |
103 | 103 | $this->arrows = new \stdClass(); |
104 | 104 | switch ($this->orientation) { |
105 | - case self::PORTRAIT: |
|
106 | - //drop through |
|
107 | - case self::LANDSCAPE: |
|
108 | - $this->arrows->prevGen = I18N::direction() === 'rtl' ? 'icon-larrow' : 'icon-rarrow'; |
|
109 | - $this->arrows->menu = I18N::direction() === 'rtl' ? 'icon-rarrow' : 'icon-larrow'; |
|
110 | - $addoffset['x'] = $this->chartHasAncestors ? self::ARROW_SIZE : 0; |
|
111 | - $addoffset['y'] = 0; |
|
112 | - break; |
|
113 | - case self::OLDEST_AT_TOP: |
|
114 | - $this->arrows->prevGen = 'icon-uarrow'; |
|
115 | - $this->arrows->menu = 'icon-darrow'; |
|
116 | - $addoffset['x'] = 0; |
|
117 | - $addoffset['y'] = $this->root->getSpouseFamilies() ? self::ARROW_SIZE : 0; |
|
118 | - break; |
|
119 | - case self::OLDEST_AT_BOTTOM: |
|
120 | - $this->arrows->prevGen = 'icon-darrow'; |
|
121 | - $this->arrows->menu = 'icon-uarrow'; |
|
122 | - $addoffset['x'] = 0; |
|
123 | - $addoffset['y'] = $this->chartHasAncestors ? self::ARROW_SIZE : 0; |
|
124 | - break; |
|
105 | + case self::PORTRAIT: |
|
106 | + //drop through |
|
107 | + case self::LANDSCAPE: |
|
108 | + $this->arrows->prevGen = I18N::direction() === 'rtl' ? 'icon-larrow' : 'icon-rarrow'; |
|
109 | + $this->arrows->menu = I18N::direction() === 'rtl' ? 'icon-rarrow' : 'icon-larrow'; |
|
110 | + $addoffset['x'] = $this->chartHasAncestors ? self::ARROW_SIZE : 0; |
|
111 | + $addoffset['y'] = 0; |
|
112 | + break; |
|
113 | + case self::OLDEST_AT_TOP: |
|
114 | + $this->arrows->prevGen = 'icon-uarrow'; |
|
115 | + $this->arrows->menu = 'icon-darrow'; |
|
116 | + $addoffset['x'] = 0; |
|
117 | + $addoffset['y'] = $this->root->getSpouseFamilies() ? self::ARROW_SIZE : 0; |
|
118 | + break; |
|
119 | + case self::OLDEST_AT_BOTTOM: |
|
120 | + $this->arrows->prevGen = 'icon-darrow'; |
|
121 | + $this->arrows->menu = 'icon-uarrow'; |
|
122 | + $addoffset['x'] = 0; |
|
123 | + $addoffset['y'] = $this->chartHasAncestors ? self::ARROW_SIZE : 0; |
|
124 | + break; |
|
125 | 125 | } |
126 | 126 | |
127 | 127 | // -- this next section will create and position the DIV layers for the pedigree tree |
@@ -150,73 +150,73 @@ discard block |
||
150 | 150 | |
151 | 151 | // -- calculate the xoffset |
152 | 152 | switch ($this->orientation) { |
153 | - case self::PORTRAIT: |
|
154 | - $xoffset = ($this->generations - $curgen) * (($this->getBoxDimensions()->width + $bxspacing) / 1.8); |
|
155 | - if(!$i && $this->root->getSpouseFamilies()) { |
|
156 | - $xoffset -= self::ARROW_SIZE; |
|
153 | + case self::PORTRAIT: |
|
154 | + $xoffset = ($this->generations - $curgen) * (($this->getBoxDimensions()->width + $bxspacing) / 1.8); |
|
155 | + if(!$i && $this->root->getSpouseFamilies()) { |
|
156 | + $xoffset -= self::ARROW_SIZE; |
|
157 | + } |
|
158 | + // -- compact the tree |
|
159 | + if ($curgen < $this->generations) { |
|
160 | + if ($i % 2 == 0) { |
|
161 | + $yoffset = $yoffset - (($boxspacing / 2) * ($curgen - 1)); |
|
162 | + } else { |
|
163 | + $yoffset = $yoffset + (($boxspacing / 2) * ($curgen - 1)); |
|
157 | 164 | } |
158 | - // -- compact the tree |
|
159 | - if ($curgen < $this->generations) { |
|
160 | - if ($i % 2 == 0) { |
|
161 | - $yoffset = $yoffset - (($boxspacing / 2) * ($curgen - 1)); |
|
165 | + $parent = (int) (($i - 1) / 2); |
|
166 | + $pgen = $curgen; |
|
167 | + while ($parent > 0) { |
|
168 | + if ($parent % 2 == 0) { |
|
169 | + $yoffset = $yoffset - (($boxspacing / 2) * $pgen); |
|
162 | 170 | } else { |
163 | - $yoffset = $yoffset + (($boxspacing / 2) * ($curgen - 1)); |
|
164 | - } |
|
165 | - $parent = (int) (($i - 1) / 2); |
|
166 | - $pgen = $curgen; |
|
167 | - while ($parent > 0) { |
|
168 | - if ($parent % 2 == 0) { |
|
169 | - $yoffset = $yoffset - (($boxspacing / 2) * $pgen); |
|
170 | - } else { |
|
171 | - $yoffset = $yoffset + (($boxspacing / 2) * $pgen); |
|
172 | - } |
|
173 | - $pgen++; |
|
174 | - if ($pgen > 3) { |
|
175 | - $temp = 0; |
|
176 | - for ($j = 1; $j < ($pgen - 2); $j++) { |
|
177 | - $temp += (pow(2, $j) - 1); |
|
178 | - } |
|
179 | - if ($parent % 2 == 0) { |
|
180 | - $yoffset = $yoffset - (($boxspacing / 2) * $temp); |
|
181 | - } else { |
|
182 | - $yoffset = $yoffset + (($boxspacing / 2) * $temp); |
|
183 | - } |
|
184 | - } |
|
185 | - $parent = (int) (($parent - 1) / 2); |
|
171 | + $yoffset = $yoffset + (($boxspacing / 2) * $pgen); |
|
186 | 172 | } |
187 | - if ($curgen > 3) { |
|
173 | + $pgen++; |
|
174 | + if ($pgen > 3) { |
|
188 | 175 | $temp = 0; |
189 | - for ($j = 1; $j < ($curgen - 2); $j++) { |
|
176 | + for ($j = 1; $j < ($pgen - 2); $j++) { |
|
190 | 177 | $temp += (pow(2, $j) - 1); |
191 | 178 | } |
192 | - if ($i % 2 == 0) { |
|
179 | + if ($parent % 2 == 0) { |
|
193 | 180 | $yoffset = $yoffset - (($boxspacing / 2) * $temp); |
194 | 181 | } else { |
195 | 182 | $yoffset = $yoffset + (($boxspacing / 2) * $temp); |
196 | 183 | } |
197 | 184 | } |
185 | + $parent = (int) (($parent - 1) / 2); |
|
198 | 186 | } |
199 | - $yoffset -= (($boxspacing / 2) * pow(2, ($this->generations - 2)) - ($boxspacing / 2)); |
|
200 | - break; |
|
201 | - case self::LANDSCAPE: |
|
202 | - $xoffset = ($this->generations - $curgen) * ($this->getBoxDimensions()->width + $bxspacing); |
|
203 | - if ($curgen == 1) { |
|
204 | - $xoffset += 10; |
|
205 | - } |
|
206 | - break; |
|
207 | - case self::OLDEST_AT_TOP: |
|
208 | - //swap x & y offsets as chart is rotated |
|
209 | - $xoffset = $yoffset; |
|
210 | - $yoffset = $curgen * ($this->getBoxDimensions()->height + ($byspacing * 4)); |
|
211 | - break; |
|
212 | - case self::OLDEST_AT_BOTTOM: |
|
213 | - //swap x & y offsets as chart is rotated |
|
214 | - $xoffset = $yoffset; |
|
215 | - $yoffset = ($this->generations - $curgen) * ($this->getBoxDimensions()->height + ($byspacing * 2)); |
|
216 | - if ($i && $this->root->getSpouseFamilies()) { |
|
217 | - $yoffset += self::ARROW_SIZE; |
|
187 | + if ($curgen > 3) { |
|
188 | + $temp = 0; |
|
189 | + for ($j = 1; $j < ($curgen - 2); $j++) { |
|
190 | + $temp += (pow(2, $j) - 1); |
|
191 | + } |
|
192 | + if ($i % 2 == 0) { |
|
193 | + $yoffset = $yoffset - (($boxspacing / 2) * $temp); |
|
194 | + } else { |
|
195 | + $yoffset = $yoffset + (($boxspacing / 2) * $temp); |
|
196 | + } |
|
218 | 197 | } |
219 | - break; |
|
198 | + } |
|
199 | + $yoffset -= (($boxspacing / 2) * pow(2, ($this->generations - 2)) - ($boxspacing / 2)); |
|
200 | + break; |
|
201 | + case self::LANDSCAPE: |
|
202 | + $xoffset = ($this->generations - $curgen) * ($this->getBoxDimensions()->width + $bxspacing); |
|
203 | + if ($curgen == 1) { |
|
204 | + $xoffset += 10; |
|
205 | + } |
|
206 | + break; |
|
207 | + case self::OLDEST_AT_TOP: |
|
208 | + //swap x & y offsets as chart is rotated |
|
209 | + $xoffset = $yoffset; |
|
210 | + $yoffset = $curgen * ($this->getBoxDimensions()->height + ($byspacing * 4)); |
|
211 | + break; |
|
212 | + case self::OLDEST_AT_BOTTOM: |
|
213 | + //swap x & y offsets as chart is rotated |
|
214 | + $xoffset = $yoffset; |
|
215 | + $yoffset = ($this->generations - $curgen) * ($this->getBoxDimensions()->height + ($byspacing * 2)); |
|
216 | + if ($i && $this->root->getSpouseFamilies()) { |
|
217 | + $yoffset += self::ARROW_SIZE; |
|
218 | + } |
|
219 | + break; |
|
220 | 220 | } |
221 | 221 | $this->nodes[$i]["x"] = (int) $xoffset; |
222 | 222 | $this->nodes[$i]["y"] = (int) $yoffset; |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | switch ($this->orientation) { |
153 | 153 | case self::PORTRAIT: |
154 | 154 | $xoffset = ($this->generations - $curgen) * (($this->getBoxDimensions()->width + $bxspacing) / 1.8); |
155 | - if(!$i && $this->root->getSpouseFamilies()) { |
|
155 | + if (!$i && $this->root->getSpouseFamilies()) { |
|
156 | 156 | $xoffset -= self::ARROW_SIZE; |
157 | 157 | } |
158 | 158 | // -- compact the tree |
@@ -207,7 +207,7 @@ discard block |
||
207 | 207 | case self::OLDEST_AT_TOP: |
208 | 208 | //swap x & y offsets as chart is rotated |
209 | 209 | $xoffset = $yoffset; |
210 | - $yoffset = $curgen * ($this->getBoxDimensions()->height + ($byspacing * 4)); |
|
210 | + $yoffset = $curgen * ($this->getBoxDimensions()->height + ($byspacing * 4)); |
|
211 | 211 | break; |
212 | 212 | case self::OLDEST_AT_BOTTOM: |
213 | 213 | //swap x & y offsets as chart is rotated |
@@ -245,7 +245,7 @@ discard block |
||
245 | 245 | return $item['y']; |
246 | 246 | }, $this->nodes)); |
247 | 247 | |
248 | - $this->chartsize['x'] = $max_xoffset + $bxspacing + $this->getBoxDimensions()->width + $addoffset['x']; |
|
248 | + $this->chartsize['x'] = $max_xoffset + $bxspacing + $this->getBoxDimensions()->width + $addoffset['x']; |
|
249 | 249 | $this->chartsize['y'] = $max_yoffset + $byspacing + $this->getBoxDimensions()->height + $addoffset['y']; |
250 | 250 | } |
251 | 251 |
@@ -50,7 +50,7 @@ |
||
50 | 50 | $menu = new Menu(I18N::translate('Edit'), '#', 'menu-repo'); |
51 | 51 | |
52 | 52 | if (Auth::isEditor($this->record->getTree())) { |
53 | - $fact = $this->record->getFirstFact('NAME'); |
|
53 | + $fact = $this->record->getFirstFact('NAME'); |
|
54 | 54 | if ($fact) { |
55 | 55 | // Edit existing name |
56 | 56 | $menu->addSubmenu(new Menu(I18N::translate('Edit repository'), '#', 'menu-repo-edit', array( |
@@ -85,8 +85,7 @@ |
||
85 | 85 | // Create the underlying PDO object |
86 | 86 | self::$pdo = new PDO( |
87 | 87 | (substr($DBHOST, 0, 1) === '/' ? |
88 | - "mysql:unix_socket={$DBHOST};dbname={$DBNAME}" : |
|
89 | - "mysql:host={$DBHOST};dbname={$DBNAME};port={$DBPORT}" |
|
88 | + "mysql:unix_socket={$DBHOST};dbname={$DBNAME}" : "mysql:host={$DBHOST};dbname={$DBNAME};port={$DBPORT}" |
|
90 | 89 | ), |
91 | 90 | $DBUSER, $DBPASS, |
92 | 91 | array( |
@@ -32,32 +32,32 @@ discard block |
||
32 | 32 | */ |
33 | 33 | public static function getAgeAtEvent($age_string, $show_years) { |
34 | 34 | switch (strtoupper($age_string)) { |
35 | - case 'CHILD': |
|
36 | - return I18N::translate('Child'); |
|
37 | - case 'INFANT': |
|
38 | - return I18N::translate('Infant'); |
|
39 | - case 'STILLBORN': |
|
40 | - return I18N::translate('Stillborn'); |
|
41 | - default: |
|
42 | - return preg_replace_callback( |
|
43 | - array( |
|
44 | - '/(\d+)([ymwd])/', |
|
45 | - ), |
|
46 | - function ($match) use ($age_string, $show_years) { |
|
47 | - switch ($match[2]) { |
|
48 | - case 'y': |
|
49 | - if ($show_years || preg_match('/[dm]/', $age_string)) { |
|
50 | - return I18N::plural('%s year', '%s years', $match[1], I18N::digits($match[1])); |
|
51 | - } else { |
|
52 | - return I18N::digits($match[1]); |
|
53 | - } |
|
54 | - case 'm': |
|
55 | - return I18N::plural('%s month', '%s months', $match[1], I18N::digits($match[1])); |
|
56 | - case 'w': |
|
57 | - return I18N::plural('%s week', '%s weeks', $match[1], I18N::digits($match[1])); |
|
58 | - case 'd': |
|
59 | - return I18N::plural('%s day', '%s days', $match[1], I18N::digits($match[1])); |
|
60 | - } |
|
35 | + case 'CHILD': |
|
36 | + return I18N::translate('Child'); |
|
37 | + case 'INFANT': |
|
38 | + return I18N::translate('Infant'); |
|
39 | + case 'STILLBORN': |
|
40 | + return I18N::translate('Stillborn'); |
|
41 | + default: |
|
42 | + return preg_replace_callback( |
|
43 | + array( |
|
44 | + '/(\d+)([ymwd])/', |
|
45 | + ), |
|
46 | + function ($match) use ($age_string, $show_years) { |
|
47 | + switch ($match[2]) { |
|
48 | + case 'y': |
|
49 | + if ($show_years || preg_match('/[dm]/', $age_string)) { |
|
50 | + return I18N::plural('%s year', '%s years', $match[1], I18N::digits($match[1])); |
|
51 | + } else { |
|
52 | + return I18N::digits($match[1]); |
|
53 | + } |
|
54 | + case 'm': |
|
55 | + return I18N::plural('%s month', '%s months', $match[1], I18N::digits($match[1])); |
|
56 | + case 'w': |
|
57 | + return I18N::plural('%s week', '%s weeks', $match[1], I18N::digits($match[1])); |
|
58 | + case 'd': |
|
59 | + return I18N::plural('%s day', '%s days', $match[1], I18N::digits($match[1])); |
|
60 | + } |
|
61 | 61 | }, |
62 | 62 | $age_string |
63 | 63 | ); |
@@ -79,40 +79,40 @@ discard block |
||
79 | 79 | preg_match_all('/%[^%]/', $time_fmt, $matches); |
80 | 80 | foreach ($matches[0] as $match) { |
81 | 81 | switch ($match) { |
82 | - case '%a': |
|
83 | - $t = gmdate('His', $time); |
|
84 | - if ($t == '000000') { |
|
85 | - $time_fmt = str_replace($match, /* I18N: time format “%a” - exactly 00:00:00 */ |
|
86 | - I18N::translate('midnight'), $time_fmt); |
|
87 | - } elseif ($t < '120000') { |
|
88 | - $time_fmt = str_replace($match, /* I18N: time format “%a” - between 00:00:01 and 11:59:59 */ |
|
89 | - I18N::translate('a.m.'), $time_fmt); |
|
90 | - } elseif ($t == '120000') { |
|
91 | - $time_fmt = str_replace($match, /* I18N: time format “%a” - exactly 12:00:00 */ |
|
92 | - I18N::translate('noon'), $time_fmt); |
|
93 | - } else { |
|
94 | - $time_fmt = str_replace($match, /* I18N: time format “%a” - between 12:00:01 and 23:59:59 */ |
|
95 | - I18N::translate('p.m.'), $time_fmt); |
|
96 | - } |
|
97 | - break; |
|
98 | - case '%A': |
|
99 | - $t = gmdate('His', $time); |
|
100 | - if ($t == '000000') { |
|
101 | - $time_fmt = str_replace($match, /* I18N: time format “%A” - exactly 00:00:00 */ |
|
102 | - I18N::translate('Midnight'), $time_fmt); |
|
103 | - } elseif ($t < '120000') { |
|
104 | - $time_fmt = str_replace($match, /* I18N: time format “%A” - between 00:00:01 and 11:59:59 */ |
|
105 | - I18N::translate('A.M.'), $time_fmt); |
|
106 | - } elseif ($t == '120000') { |
|
107 | - $time_fmt = str_replace($match, /* I18N: time format “%A” - exactly 12:00:00 */ |
|
108 | - I18N::translate('Noon'), $time_fmt); |
|
109 | - } else { |
|
110 | - $time_fmt = str_replace($match, /* I18N: time format “%A” - between 12:00:01 and 23:59:59 */ |
|
111 | - I18N::translate('P.M.'), $time_fmt); |
|
112 | - } |
|
113 | - break; |
|
114 | - default: |
|
115 | - $time_fmt = str_replace($match, I18N::digits(gmdate(substr($match, -1), $time)), $time_fmt); |
|
82 | + case '%a': |
|
83 | + $t = gmdate('His', $time); |
|
84 | + if ($t == '000000') { |
|
85 | + $time_fmt = str_replace($match, /* I18N: time format “%a” - exactly 00:00:00 */ |
|
86 | + I18N::translate('midnight'), $time_fmt); |
|
87 | + } elseif ($t < '120000') { |
|
88 | + $time_fmt = str_replace($match, /* I18N: time format “%a” - between 00:00:01 and 11:59:59 */ |
|
89 | + I18N::translate('a.m.'), $time_fmt); |
|
90 | + } elseif ($t == '120000') { |
|
91 | + $time_fmt = str_replace($match, /* I18N: time format “%a” - exactly 12:00:00 */ |
|
92 | + I18N::translate('noon'), $time_fmt); |
|
93 | + } else { |
|
94 | + $time_fmt = str_replace($match, /* I18N: time format “%a” - between 12:00:01 and 23:59:59 */ |
|
95 | + I18N::translate('p.m.'), $time_fmt); |
|
96 | + } |
|
97 | + break; |
|
98 | + case '%A': |
|
99 | + $t = gmdate('His', $time); |
|
100 | + if ($t == '000000') { |
|
101 | + $time_fmt = str_replace($match, /* I18N: time format “%A” - exactly 00:00:00 */ |
|
102 | + I18N::translate('Midnight'), $time_fmt); |
|
103 | + } elseif ($t < '120000') { |
|
104 | + $time_fmt = str_replace($match, /* I18N: time format “%A” - between 00:00:01 and 11:59:59 */ |
|
105 | + I18N::translate('A.M.'), $time_fmt); |
|
106 | + } elseif ($t == '120000') { |
|
107 | + $time_fmt = str_replace($match, /* I18N: time format “%A” - exactly 12:00:00 */ |
|
108 | + I18N::translate('Noon'), $time_fmt); |
|
109 | + } else { |
|
110 | + $time_fmt = str_replace($match, /* I18N: time format “%A” - between 12:00:01 and 23:59:59 */ |
|
111 | + I18N::translate('P.M.'), $time_fmt); |
|
112 | + } |
|
113 | + break; |
|
114 | + default: |
|
115 | + $time_fmt = str_replace($match, I18N::digits(gmdate(substr($match, -1), $time)), $time_fmt); |
|
116 | 116 | } |
117 | 117 | } |
118 | 118 |
@@ -248,18 +248,18 @@ discard block |
||
248 | 248 | */ |
249 | 249 | public static function searchIndividualsPhonetic($soundex, $lastname, $firstname, $place, array $trees) { |
250 | 250 | switch ($soundex) { |
251 | - case 'Russell': |
|
252 | - $givn_sdx = Soundex::russell($firstname); |
|
253 | - $surn_sdx = Soundex::russell($lastname); |
|
254 | - $plac_sdx = Soundex::russell($place); |
|
255 | - break; |
|
256 | - case 'DaitchM': |
|
257 | - $givn_sdx = Soundex::daitchMokotoff($firstname); |
|
258 | - $surn_sdx = Soundex::daitchMokotoff($lastname); |
|
259 | - $plac_sdx = Soundex::daitchMokotoff($place); |
|
260 | - break; |
|
261 | - default: |
|
262 | - throw new \DomainException('soundex: ' . $soundex); |
|
251 | + case 'Russell': |
|
252 | + $givn_sdx = Soundex::russell($firstname); |
|
253 | + $surn_sdx = Soundex::russell($lastname); |
|
254 | + $plac_sdx = Soundex::russell($place); |
|
255 | + break; |
|
256 | + case 'DaitchM': |
|
257 | + $givn_sdx = Soundex::daitchMokotoff($firstname); |
|
258 | + $surn_sdx = Soundex::daitchMokotoff($lastname); |
|
259 | + $plac_sdx = Soundex::daitchMokotoff($place); |
|
260 | + break; |
|
261 | + default: |
|
262 | + throw new \DomainException('soundex: ' . $soundex); |
|
263 | 263 | } |
264 | 264 | |
265 | 265 | // Nothing to search for? Return nothing. |
@@ -291,12 +291,12 @@ discard block |
||
291 | 291 | foreach ($givn_sdx as $n => $sdx) { |
292 | 292 | $sql .= $n ? " OR " : ""; |
293 | 293 | switch ($soundex) { |
294 | - case 'Russell': |
|
295 | - $sql .= "n_soundex_givn_std LIKE CONCAT('%', :given_name_" . $n . ", '%')"; |
|
296 | - break; |
|
297 | - case 'DaitchM': |
|
298 | - $sql .= "n_soundex_givn_dm LIKE CONCAT('%', :given_name_" . $n . ", '%')"; |
|
299 | - break; |
|
294 | + case 'Russell': |
|
295 | + $sql .= "n_soundex_givn_std LIKE CONCAT('%', :given_name_" . $n . ", '%')"; |
|
296 | + break; |
|
297 | + case 'DaitchM': |
|
298 | + $sql .= "n_soundex_givn_dm LIKE CONCAT('%', :given_name_" . $n . ", '%')"; |
|
299 | + break; |
|
300 | 300 | } |
301 | 301 | $args['given_name_' . $n] = $sdx; |
302 | 302 | } |
@@ -309,12 +309,12 @@ discard block |
||
309 | 309 | foreach ($surn_sdx as $n => $sdx) { |
310 | 310 | $sql .= $n ? " OR " : ""; |
311 | 311 | switch ($soundex) { |
312 | - case 'Russell': |
|
313 | - $sql .= "n_soundex_surn_std LIKE CONCAT('%', :surname_" . $n . ", '%')"; |
|
314 | - break; |
|
315 | - case 'DaitchM': |
|
316 | - $sql .= "n_soundex_surn_dm LIKE CONCAT('%', :surname_" . $n . ", '%')"; |
|
317 | - break; |
|
312 | + case 'Russell': |
|
313 | + $sql .= "n_soundex_surn_std LIKE CONCAT('%', :surname_" . $n . ", '%')"; |
|
314 | + break; |
|
315 | + case 'DaitchM': |
|
316 | + $sql .= "n_soundex_surn_dm LIKE CONCAT('%', :surname_" . $n . ", '%')"; |
|
317 | + break; |
|
318 | 318 | } |
319 | 319 | $args['surname_' . $n] = $sdx; |
320 | 320 | } |
@@ -327,12 +327,12 @@ discard block |
||
327 | 327 | foreach ($plac_sdx as $n => $sdx) { |
328 | 328 | $sql .= $n ? " OR " : ""; |
329 | 329 | switch ($soundex) { |
330 | - case 'Russell': |
|
331 | - $sql .= "p_std_soundex LIKE CONCAT('%', :place_" . $n . ", '%')"; |
|
332 | - break; |
|
333 | - case 'DaitchM': |
|
334 | - $sql .= "p_dm_soundex LIKE CONCAT('%', :place_" . $n . ", '%')"; |
|
335 | - break; |
|
330 | + case 'Russell': |
|
331 | + $sql .= "p_std_soundex LIKE CONCAT('%', :place_" . $n . ", '%')"; |
|
332 | + break; |
|
333 | + case 'DaitchM': |
|
334 | + $sql .= "p_dm_soundex LIKE CONCAT('%', :place_" . $n . ", '%')"; |
|
335 | + break; |
|
336 | 336 | } |
337 | 337 | $args['place_' . $n] = $sdx; |
338 | 338 | } |
@@ -790,82 +790,82 @@ discard block |
||
790 | 790 | } else { |
791 | 791 | // SPECIAL CASES: |
792 | 792 | switch ($anniv->m) { |
793 | - case 2: |
|
794 | - // 29 CSH does not include 30 CSH (but would include an invalid 31 CSH if there were no 30 CSH) |
|
795 | - if ($anniv->d === 1) { |
|
796 | - $where .= " AND d_day <= 1 AND d_mon = 2"; |
|
797 | - } elseif ($anniv->d === 30) { |
|
798 | - $where .= " AND d_day >= 30 AND d_mon = 2"; |
|
799 | - } elseif ($anniv->d === 29 && $anniv->daysInMonth() === 29) { |
|
800 | - $where .= " AND (d_day = 29 OR d_day > 30) AND d_mon = 2"; |
|
801 | - } else { |
|
802 | - $where .= " AND d_day = :day AND d_mon = 2"; |
|
803 | - $args['day'] = $anniv->d; |
|
804 | - } |
|
805 | - break; |
|
806 | - case 3: |
|
807 | - // 1 KSL includes 30 CSH (if this year didn’t have 30 CSH) |
|
808 | - // 29 KSL does not include 30 KSL (but would include an invalid 31 KSL if there were no 30 KSL) |
|
809 | - if ($anniv->d === 1) { |
|
810 | - $tmp = new JewishDate(array($anniv->y, 'CSH', 1)); |
|
811 | - if ($tmp->daysInMonth() === 29) { |
|
812 | - $where .= " AND (d_day <= 1 AND d_mon = 3 OR d_day = 30 AND d_mon = 2)"; |
|
813 | - } else { |
|
814 | - $where .= " AND d_day <= 1 AND d_mon = 3"; |
|
815 | - } |
|
816 | - } elseif ($anniv->d === 30) { |
|
817 | - $where .= " AND d_day >= 30 AND d_mon = 3"; |
|
818 | - } elseif ($anniv->d == 29 && $anniv->daysInMonth() === 29) { |
|
819 | - $where .= " AND (d_day = 29 OR d_day > 30) AND d_mon = 3"; |
|
820 | - } else { |
|
821 | - $where .= " AND d_day = :day AND d_mon = 3"; |
|
822 | - $args['day'] = $anniv->d; |
|
823 | - } |
|
824 | - break; |
|
825 | - case 4: |
|
826 | - // 1 TVT includes 30 KSL (if this year didn’t have 30 KSL) |
|
827 | - if ($anniv->d === 1) { |
|
828 | - $tmp = new JewishDate(array($anniv->y, 'KSL', 1)); |
|
829 | - if ($tmp->daysInMonth() === 29) { |
|
830 | - $where .= " AND (d_day <=1 AND d_mon = 4 OR d_day = 30 AND d_mon = 3)"; |
|
831 | - } else { |
|
832 | - $where .= " AND d_day <= 1 AND d_mon = 4"; |
|
833 | - } |
|
834 | - } elseif ($anniv->d === $anniv->daysInMonth()) { |
|
835 | - $where .= " AND d_day >= :day AND d_mon=4"; |
|
836 | - $args['day'] = $anniv->d; |
|
793 | + case 2: |
|
794 | + // 29 CSH does not include 30 CSH (but would include an invalid 31 CSH if there were no 30 CSH) |
|
795 | + if ($anniv->d === 1) { |
|
796 | + $where .= " AND d_day <= 1 AND d_mon = 2"; |
|
797 | + } elseif ($anniv->d === 30) { |
|
798 | + $where .= " AND d_day >= 30 AND d_mon = 2"; |
|
799 | + } elseif ($anniv->d === 29 && $anniv->daysInMonth() === 29) { |
|
800 | + $where .= " AND (d_day = 29 OR d_day > 30) AND d_mon = 2"; |
|
801 | + } else { |
|
802 | + $where .= " AND d_day = :day AND d_mon = 2"; |
|
803 | + $args['day'] = $anniv->d; |
|
804 | + } |
|
805 | + break; |
|
806 | + case 3: |
|
807 | + // 1 KSL includes 30 CSH (if this year didn’t have 30 CSH) |
|
808 | + // 29 KSL does not include 30 KSL (but would include an invalid 31 KSL if there were no 30 KSL) |
|
809 | + if ($anniv->d === 1) { |
|
810 | + $tmp = new JewishDate(array($anniv->y, 'CSH', 1)); |
|
811 | + if ($tmp->daysInMonth() === 29) { |
|
812 | + $where .= " AND (d_day <= 1 AND d_mon = 3 OR d_day = 30 AND d_mon = 2)"; |
|
837 | 813 | } else { |
838 | - $where .= " AND d_day = :day AND d_mon=4"; |
|
839 | - $args['day'] = $anniv->d; |
|
814 | + $where .= " AND d_day <= 1 AND d_mon = 3"; |
|
840 | 815 | } |
841 | - break; |
|
842 | - case 7: // ADS includes ADR (non-leap) |
|
843 | - if ($anniv->d === 1) { |
|
844 | - $where .= " AND d_day <= 1"; |
|
845 | - } elseif ($anniv->d === $anniv->daysInMonth()) { |
|
846 | - $where .= " AND d_day >= :day"; |
|
847 | - $args['day'] = $anniv->d; |
|
816 | + } elseif ($anniv->d === 30) { |
|
817 | + $where .= " AND d_day >= 30 AND d_mon = 3"; |
|
818 | + } elseif ($anniv->d == 29 && $anniv->daysInMonth() === 29) { |
|
819 | + $where .= " AND (d_day = 29 OR d_day > 30) AND d_mon = 3"; |
|
820 | + } else { |
|
821 | + $where .= " AND d_day = :day AND d_mon = 3"; |
|
822 | + $args['day'] = $anniv->d; |
|
823 | + } |
|
824 | + break; |
|
825 | + case 4: |
|
826 | + // 1 TVT includes 30 KSL (if this year didn’t have 30 KSL) |
|
827 | + if ($anniv->d === 1) { |
|
828 | + $tmp = new JewishDate(array($anniv->y, 'KSL', 1)); |
|
829 | + if ($tmp->daysInMonth() === 29) { |
|
830 | + $where .= " AND (d_day <=1 AND d_mon = 4 OR d_day = 30 AND d_mon = 3)"; |
|
848 | 831 | } else { |
849 | - $where .= " AND d_day = :day"; |
|
850 | - $args['day'] = $anniv->d; |
|
832 | + $where .= " AND d_day <= 1 AND d_mon = 4"; |
|
851 | 833 | } |
852 | - $where .= " AND (d_mon = 6 AND MOD(7 * d_year + 1, 19) >= 7 OR d_mon = 7)"; |
|
853 | - break; |
|
854 | - case 8: // 1 NSN includes 30 ADR, if this year is non-leap |
|
855 | - if ($anniv->d === 1) { |
|
856 | - if ($anniv->isLeapYear()) { |
|
857 | - $where .= " AND d_day <= 1 AND d_mon = 8"; |
|
858 | - } else { |
|
859 | - $where .= " AND (d_day <= 1 AND d_mon = 8 OR d_day = 30 AND d_mon = 6)"; |
|
860 | - } |
|
861 | - } elseif ($anniv->d === $anniv->daysInMonth()) { |
|
862 | - $where .= " AND d_day >= :day AND d_mon = 8"; |
|
863 | - $args['day'] = $anniv->d; |
|
834 | + } elseif ($anniv->d === $anniv->daysInMonth()) { |
|
835 | + $where .= " AND d_day >= :day AND d_mon=4"; |
|
836 | + $args['day'] = $anniv->d; |
|
837 | + } else { |
|
838 | + $where .= " AND d_day = :day AND d_mon=4"; |
|
839 | + $args['day'] = $anniv->d; |
|
840 | + } |
|
841 | + break; |
|
842 | + case 7: // ADS includes ADR (non-leap) |
|
843 | + if ($anniv->d === 1) { |
|
844 | + $where .= " AND d_day <= 1"; |
|
845 | + } elseif ($anniv->d === $anniv->daysInMonth()) { |
|
846 | + $where .= " AND d_day >= :day"; |
|
847 | + $args['day'] = $anniv->d; |
|
848 | + } else { |
|
849 | + $where .= " AND d_day = :day"; |
|
850 | + $args['day'] = $anniv->d; |
|
851 | + } |
|
852 | + $where .= " AND (d_mon = 6 AND MOD(7 * d_year + 1, 19) >= 7 OR d_mon = 7)"; |
|
853 | + break; |
|
854 | + case 8: // 1 NSN includes 30 ADR, if this year is non-leap |
|
855 | + if ($anniv->d === 1) { |
|
856 | + if ($anniv->isLeapYear()) { |
|
857 | + $where .= " AND d_day <= 1 AND d_mon = 8"; |
|
864 | 858 | } else { |
865 | - $where .= " AND d_day = :day AND d_mon = 8"; |
|
866 | - $args['day'] = $anniv->d; |
|
859 | + $where .= " AND (d_day <= 1 AND d_mon = 8 OR d_day = 30 AND d_mon = 6)"; |
|
867 | 860 | } |
868 | - break; |
|
861 | + } elseif ($anniv->d === $anniv->daysInMonth()) { |
|
862 | + $where .= " AND d_day >= :day AND d_mon = 8"; |
|
863 | + $args['day'] = $anniv->d; |
|
864 | + } else { |
|
865 | + $where .= " AND d_day = :day AND d_mon = 8"; |
|
866 | + $args['day'] = $anniv->d; |
|
867 | + } |
|
868 | + break; |
|
869 | 869 | } |
870 | 870 | } |
871 | 871 | // Only events in the past (includes dates without a year) |
@@ -183,18 +183,18 @@ discard block |
||
183 | 183 | */ |
184 | 184 | public static function exportGedcom(Tree $tree, $gedout, $exportOptions) { |
185 | 185 | switch ($exportOptions['privatize']) { |
186 | - case 'gedadmin': |
|
187 | - $access_level = Auth::PRIV_NONE; |
|
188 | - break; |
|
189 | - case 'user': |
|
190 | - $access_level = Auth::PRIV_USER; |
|
191 | - break; |
|
192 | - case 'visitor': |
|
193 | - $access_level = Auth::PRIV_PRIVATE; |
|
194 | - break; |
|
195 | - case 'none': |
|
196 | - $access_level = Auth::PRIV_HIDE; |
|
197 | - break; |
|
186 | + case 'gedadmin': |
|
187 | + $access_level = Auth::PRIV_NONE; |
|
188 | + break; |
|
189 | + case 'user': |
|
190 | + $access_level = Auth::PRIV_USER; |
|
191 | + break; |
|
192 | + case 'visitor': |
|
193 | + $access_level = Auth::PRIV_PRIVATE; |
|
194 | + break; |
|
195 | + case 'none': |
|
196 | + $access_level = Auth::PRIV_HIDE; |
|
197 | + break; |
|
198 | 198 | } |
199 | 199 | |
200 | 200 | $head = self::gedcomHeader($tree); |
@@ -251,15 +251,15 @@ discard block |
||
251 | 251 | |
252 | 252 | foreach ($rows as $row) { |
253 | 253 | switch ($row->type) { |
254 | - case 'NOTE': |
|
255 | - $record = Note::getInstance($row->xref, $tree, $row->gedcom); |
|
256 | - break; |
|
257 | - case 'REPO': |
|
258 | - $record = Repository::getInstance($row->xref, $tree, $row->gedcom); |
|
259 | - break; |
|
260 | - default: |
|
261 | - $record = GedcomRecord::getInstance($row->xref, $tree, $row->gedcom); |
|
262 | - break; |
|
254 | + case 'NOTE': |
|
255 | + $record = Note::getInstance($row->xref, $tree, $row->gedcom); |
|
256 | + break; |
|
257 | + case 'REPO': |
|
258 | + $record = Repository::getInstance($row->xref, $tree, $row->gedcom); |
|
259 | + break; |
|
260 | + default: |
|
261 | + $record = GedcomRecord::getInstance($row->xref, $tree, $row->gedcom); |
|
262 | + break; |
|
263 | 263 | } |
264 | 264 | |
265 | 265 | $rec = $record->privatizeGedcom($access_level); |
@@ -34,17 +34,17 @@ |
||
34 | 34 | $val = -1; |
35 | 35 | } |
36 | 36 | switch (substr($val, -1)) { |
37 | - case 'g': |
|
38 | - case 'G': |
|
39 | - return (int) $val * 1024 * 1024 * 1024; |
|
40 | - case 'm': |
|
41 | - case 'M': |
|
42 | - return (int) $val * 1024 * 1024; |
|
43 | - case 'k': |
|
44 | - case 'K': |
|
45 | - return (int) $val * 1024; |
|
46 | - default: |
|
47 | - return (int) $val; |
|
37 | + case 'g': |
|
38 | + case 'G': |
|
39 | + return (int) $val * 1024 * 1024 * 1024; |
|
40 | + case 'm': |
|
41 | + case 'M': |
|
42 | + return (int) $val * 1024 * 1024; |
|
43 | + case 'k': |
|
44 | + case 'K': |
|
45 | + return (int) $val * 1024; |
|
46 | + default: |
|
47 | + return (int) $val; |
|
48 | 48 | } |
49 | 49 | } |
50 | 50 |