@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | */ |
56 | 56 | public function postDeleteMessageAction(Request $request, Tree $tree): Response |
57 | 57 | { |
58 | - $message_ids = (array)$request->get('message_id', []); |
|
58 | + $message_ids = (array) $request->get('message_id', []); |
|
59 | 59 | |
60 | 60 | $stmt = Database::prepare("DELETE FROM `##message` WHERE user_id = :user_id AND message_id = :message_id"); |
61 | 61 | |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | |
101 | 101 | $content = ''; |
102 | 102 | if (!empty($users)) { |
103 | - $url = route('user-page', ['ged' => $tree->getName()]); |
|
103 | + $url = route('user-page', ['ged' => $tree->getName()]); |
|
104 | 104 | $content .= '<form onsubmit="return $("#to").val() !== """>'; |
105 | 105 | $content .= '<input type="hidden" name="route" value="message">'; |
106 | 106 | $content .= '<input type="hidden" name="ged" value="' . e($tree->getName()) . '">'; |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | $content .= '<td class="list_value_wrap"><a href="#" onclick="return expand_layer(\'message' . $message->message_id . '\');"><i id="message' . $message->message_id . '_img" class="icon-plus"></i> <b dir="auto">' . e($message->subject) . '</b></a></td>'; |
137 | 137 | $content .= '<td class="list_value_wrap">' . FunctionsDate::formatTimestamp($message->created + WT_TIMESTAMP_OFFSET) . '</td>'; |
138 | 138 | $content .= '<td class="list_value_wrap">'; |
139 | - $user = User::findByIdentifier($message->sender); |
|
139 | + $user = User::findByIdentifier($message->sender); |
|
140 | 140 | if ($user) { |
141 | 141 | $content .= '<span dir="auto">' . e($user->getRealName()) . '</span> - <span dir="auto">' . $user->getEmail() . '</span>'; |
142 | 142 | } else { |
@@ -158,7 +158,7 @@ discard block |
||
158 | 158 | 'subject' => $message->subject, |
159 | 159 | 'ged' => $tree->getName(), |
160 | 160 | ]); |
161 | - $content .= '<a class="btn btn-primary" href="' . e($reply_url) . '" title="' . I18N::translate('Reply') . '">' . I18N::translate('Reply') . '</a> '; |
|
161 | + $content .= '<a class="btn btn-primary" href="' . e($reply_url) . '" title="' . I18N::translate('Reply') . '">' . I18N::translate('Reply') . '</a> '; |
|
162 | 162 | } |
163 | 163 | $content .= '<button type="button" class="btn btn-danger" data-confirm="' . I18N::translate('Are you sure you want to delete this message? It cannot be retrieved later.') . '" onclick="if (confirm(this.dataset.confirm)) {$(\'#messageform :checkbox\').prop(\'checked\', false); $(\'#cb_message' . $message->message_id . '\').prop(\'checked\', true); document.messageform.submit();}">' . I18N::translate('Delete') . '</button></div></td></tr>'; |
164 | 164 | } |
@@ -191,7 +191,7 @@ |
||
191 | 191 | */ |
192 | 192 | public function postDeleteFavoriteAction(Request $request, Tree $tree, User $user): RedirectResponse |
193 | 193 | { |
194 | - $favorite_id = (int)$request->get('favorite_id'); |
|
194 | + $favorite_id = (int) $request->get('favorite_id'); |
|
195 | 195 | |
196 | 196 | if (Auth::check()) { |
197 | 197 | Database::prepare( |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | */ |
157 | 157 | public function postAdminDeleteAction(Request $request, Tree $tree): RedirectResponse |
158 | 158 | { |
159 | - $block_id = (int)$request->get('block_id'); |
|
159 | + $block_id = (int) $request->get('block_id'); |
|
160 | 160 | |
161 | 161 | Database::prepare( |
162 | 162 | "DELETE FROM `##block_setting` WHERE block_id = :block_id" |
@@ -184,7 +184,7 @@ discard block |
||
184 | 184 | */ |
185 | 185 | public function postAdminMoveDownAction(Request $request, Tree $tree): RedirectResponse |
186 | 186 | { |
187 | - $block_id = (int)$request->get('block_id'); |
|
187 | + $block_id = (int) $request->get('block_id'); |
|
188 | 188 | |
189 | 189 | $block_order = Database::prepare( |
190 | 190 | "SELECT block_order FROM `##block` WHERE block_id = :block_id" |
@@ -237,7 +237,7 @@ discard block |
||
237 | 237 | */ |
238 | 238 | public function postAdminMoveUpAction(Request $request, Tree $tree): RedirectResponse |
239 | 239 | { |
240 | - $block_id = (int)$request->get('block_id'); |
|
240 | + $block_id = (int) $request->get('block_id'); |
|
241 | 241 | |
242 | 242 | $block_order = Database::prepare( |
243 | 243 | "SELECT block_order FROM `##block` WHERE block_id = :block_id" |
@@ -292,7 +292,7 @@ discard block |
||
292 | 292 | { |
293 | 293 | $this->layout = 'layouts/administration'; |
294 | 294 | |
295 | - $block_id = (int)$request->get('block_id'); |
|
295 | + $block_id = (int) $request->get('block_id'); |
|
296 | 296 | |
297 | 297 | if ($block_id === 0) { |
298 | 298 | // Creating a new faq |
@@ -303,7 +303,7 @@ discard block |
||
303 | 303 | )->execute([ |
304 | 304 | 'module_name' => $this->getName(), |
305 | 305 | ])->fetchOne(); |
306 | - $languages = []; |
|
306 | + $languages = []; |
|
307 | 307 | |
308 | 308 | $title = I18N::translate('Add an FAQ'); |
309 | 309 | } else { |
@@ -340,7 +340,7 @@ discard block |
||
340 | 340 | */ |
341 | 341 | public function postAdminEditAction(Request $request, Tree $tree): RedirectResponse |
342 | 342 | { |
343 | - $block_id = (int)$request->get('block_id'); |
|
343 | + $block_id = (int) $request->get('block_id'); |
|
344 | 344 | $faqbody = $request->get('faqbody', ''); |
345 | 345 | $header = $request->get('header', ''); |
346 | 346 | $languages = $request->get('languages', []); |
@@ -190,7 +190,7 @@ |
||
190 | 190 | */ |
191 | 191 | public function postDeleteFavoriteAction(Request $request, Tree $tree, User $user): RedirectResponse |
192 | 192 | { |
193 | - $favorite_id = (int)$request->get('favorite_id'); |
|
193 | + $favorite_id = (int) $request->get('favorite_id'); |
|
194 | 194 | |
195 | 195 | if (Auth::isManager($tree, $user)) { |
196 | 196 | Database::prepare( |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | // Only show this block for certain languages |
118 | 118 | $languages = $this->getBlockSetting($block_id, 'languages', ''); |
119 | 119 | if ($languages === '' || in_array(WT_LOCALE, explode(',', $languages))) { |
120 | - $stories[] = (object)[ |
|
120 | + $stories[] = (object) [ |
|
121 | 121 | 'block_id' => $block_id, |
122 | 122 | 'title' => $this->getBlockSetting($block_id, 'title'), |
123 | 123 | 'story_body' => $this->getBlockSetting($block_id, 'story_body'), |
@@ -211,7 +211,7 @@ discard block |
||
211 | 211 | { |
212 | 212 | $this->layout = 'layouts/administration'; |
213 | 213 | |
214 | - $block_id = (int)$request->get('block_id'); |
|
214 | + $block_id = (int) $request->get('block_id'); |
|
215 | 215 | |
216 | 216 | if ($block_id === 0) { |
217 | 217 | // Creating a new story |
@@ -256,7 +256,7 @@ discard block |
||
256 | 256 | */ |
257 | 257 | public function postAdminEditAction(Request $request, Tree $tree): RedirectResponse |
258 | 258 | { |
259 | - $block_id = (int)$request->get('block_id'); |
|
259 | + $block_id = (int) $request->get('block_id'); |
|
260 | 260 | $xref = $request->get('xref', ''); |
261 | 261 | $story_body = $request->get('story_body', ''); |
262 | 262 | $story_title = $request->get('story_title', ''); |
@@ -302,7 +302,7 @@ discard block |
||
302 | 302 | */ |
303 | 303 | public function postAdminDeleteAction(Request $request, Tree $tree): Response |
304 | 304 | { |
305 | - $block_id = (int)$request->get('block_id'); |
|
305 | + $block_id = (int) $request->get('block_id'); |
|
306 | 306 | |
307 | 307 | Database::prepare( |
308 | 308 | "DELETE FROM `##block_setting` WHERE block_id = :block_id" |
@@ -407,9 +407,9 @@ discard block |
||
407 | 407 | public function exportClient(Request $request, Tree $tree): Response |
408 | 408 | { |
409 | 409 | // Validate user parameters |
410 | - $convert = (bool)$request->get('convert'); |
|
411 | - $zip = (bool)$request->get('zip'); |
|
412 | - $media = (bool)$request->get('media'); |
|
410 | + $convert = (bool) $request->get('convert'); |
|
411 | + $zip = (bool) $request->get('zip'); |
|
412 | + $media = (bool) $request->get('media'); |
|
413 | 413 | $media_path = $request->get('media-path'); |
414 | 414 | $privatize_export = $request->get('privatize_export'); |
415 | 415 | |
@@ -539,8 +539,8 @@ discard block |
||
539 | 539 | public function importAction(Request $request, Tree $tree): RedirectResponse |
540 | 540 | { |
541 | 541 | $source = $request->get('source'); |
542 | - $keep_media = (bool)$request->get('keep_media'); |
|
543 | - $WORD_WRAPPED_NOTES = (bool)$request->get('WORD_WRAPPED_NOTES'); |
|
542 | + $keep_media = (bool) $request->get('keep_media'); |
|
543 | + $WORD_WRAPPED_NOTES = (bool) $request->get('WORD_WRAPPED_NOTES'); |
|
544 | 544 | $GEDCOM_MEDIA_PATH = $request->get('GEDCOM_MEDIA_PATH'); |
545 | 545 | |
546 | 546 | // Save these choices as defaults |
@@ -603,7 +603,7 @@ discard block |
||
603 | 603 | */ |
604 | 604 | public function index(Tree $tree = null): Response |
605 | 605 | { |
606 | - $multiple_tree_threshold = (int)Site::getPreference('MULTIPLE_TREE_THRESHOLD', self::MULTIPLE_TREE_THRESHOLD); |
|
606 | + $multiple_tree_threshold = (int) Site::getPreference('MULTIPLE_TREE_THRESHOLD', self::MULTIPLE_TREE_THRESHOLD); |
|
607 | 607 | $gedcom_files = $this->gedcomFiles(WT_DATA_DIR); |
608 | 608 | |
609 | 609 | $all_trees = Tree::getAll(); |
@@ -1034,16 +1034,16 @@ discard block |
||
1034 | 1034 | public function preferencesUpdate(Request $request, Tree $tree): RedirectResponse |
1035 | 1035 | { |
1036 | 1036 | // Coming soon |
1037 | - if ((bool)$request->get('all_trees')) { |
|
1037 | + if ((bool) $request->get('all_trees')) { |
|
1038 | 1038 | FlashMessages::addMessage(I18N::translate('The preferences for all family trees have been updated.'), 'success'); |
1039 | 1039 | } |
1040 | - if ((bool)$request->get('new_trees')) { |
|
1040 | + if ((bool) $request->get('new_trees')) { |
|
1041 | 1041 | FlashMessages::addMessage(I18N::translate('The preferences for new family trees have been updated.'), 'success'); |
1042 | 1042 | } |
1043 | 1043 | |
1044 | 1044 | $tree->setPreference('ADVANCED_NAME_FACTS', implode(',', $request->get('ADVANCED_NAME_FACTS', []))); |
1045 | 1045 | $tree->setPreference('ADVANCED_PLAC_FACTS', implode(',', $request->get('ADVANCED_PLAC_FACTS', []))); |
1046 | - $tree->setPreference('ALLOW_THEME_DROPDOWN', (string)(bool)$request->get('ALLOW_THEME_DROPDOWN')); |
|
1046 | + $tree->setPreference('ALLOW_THEME_DROPDOWN', (string) (bool) $request->get('ALLOW_THEME_DROPDOWN')); |
|
1047 | 1047 | // For backwards compatibility with webtrees 1.x we store the two calendar formats in one variable |
1048 | 1048 | // e.g. "gregorian_and_jewish" |
1049 | 1049 | $tree->setPreference('CALENDAR_FORMAT', implode('_and_', array_unique([ |
@@ -1052,57 +1052,57 @@ discard block |
||
1052 | 1052 | ]))); |
1053 | 1053 | $tree->setPreference('CHART_BOX_TAGS', implode(',', $request->get('CHART_BOX_TAGS', []))); |
1054 | 1054 | $tree->setPreference('CONTACT_USER_ID', $request->get('CONTACT_USER_ID')); |
1055 | - $tree->setPreference('DEFAULT_PEDIGREE_GENERATIONS', (string)(int)$request->get('DEFAULT_PEDIGREE_GENERATIONS')); |
|
1056 | - $tree->setPreference('EXPAND_NOTES', (string)(bool)$request->get('EXPAND_NOTES')); |
|
1057 | - $tree->setPreference('EXPAND_SOURCES', (string)(bool)$request->get('EXPAND_SOURCES')); |
|
1055 | + $tree->setPreference('DEFAULT_PEDIGREE_GENERATIONS', (string) (int) $request->get('DEFAULT_PEDIGREE_GENERATIONS')); |
|
1056 | + $tree->setPreference('EXPAND_NOTES', (string) (bool) $request->get('EXPAND_NOTES')); |
|
1057 | + $tree->setPreference('EXPAND_SOURCES', (string) (bool) $request->get('EXPAND_SOURCES')); |
|
1058 | 1058 | $tree->setPreference('FAM_FACTS_ADD', implode(',', $request->get('FAM_FACTS_ADD', []))); |
1059 | 1059 | $tree->setPreference('FAM_FACTS_QUICK', implode(',', $request->get('FAM_FACTS_QUICK', []))); |
1060 | 1060 | $tree->setPreference('FAM_FACTS_UNIQUE', implode(',', $request->get('FAM_FACTS_UNIQUE', []))); |
1061 | - $tree->setPreference('FULL_SOURCES', (string)(bool)$request->get('FULL_SOURCES')); |
|
1061 | + $tree->setPreference('FULL_SOURCES', (string) (bool) $request->get('FULL_SOURCES')); |
|
1062 | 1062 | $tree->setPreference('FORMAT_TEXT', $request->get('FORMAT_TEXT')); |
1063 | - $tree->setPreference('GENERATE_UIDS', (string)(bool)$request->get('GENERATE_UIDS')); |
|
1063 | + $tree->setPreference('GENERATE_UIDS', (string) (bool) $request->get('GENERATE_UIDS')); |
|
1064 | 1064 | $tree->setPreference('GEONAMES_ACCOUNT', $request->get('GEONAMES_ACCOUNT')); |
1065 | - $tree->setPreference('HIDE_GEDCOM_ERRORS', (string)(bool)$request->get('HIDE_GEDCOM_ERRORS')); |
|
1065 | + $tree->setPreference('HIDE_GEDCOM_ERRORS', (string) (bool) $request->get('HIDE_GEDCOM_ERRORS')); |
|
1066 | 1066 | $tree->setPreference('INDI_FACTS_ADD', implode(',', $request->get('INDI_FACTS_ADD', []))); |
1067 | 1067 | $tree->setPreference('INDI_FACTS_QUICK', implode(',', $request->get('INDI_FACTS_QUICK', []))); |
1068 | 1068 | $tree->setPreference('INDI_FACTS_UNIQUE', implode(',', $request->get('INDI_FACTS_UNIQUE', []))); |
1069 | 1069 | $tree->setPreference('LANGUAGE', $request->get('LANGUAGE')); |
1070 | - $tree->setPreference('MAX_DESCENDANCY_GENERATIONS', (string)(int)$request->get('MAX_DESCENDANCY_GENERATIONS')); |
|
1071 | - $tree->setPreference('MAX_PEDIGREE_GENERATIONS', (string)(int)$request->get('MAX_PEDIGREE_GENERATIONS')); |
|
1070 | + $tree->setPreference('MAX_DESCENDANCY_GENERATIONS', (string) (int) $request->get('MAX_DESCENDANCY_GENERATIONS')); |
|
1071 | + $tree->setPreference('MAX_PEDIGREE_GENERATIONS', (string) (int) $request->get('MAX_PEDIGREE_GENERATIONS')); |
|
1072 | 1072 | $tree->setPreference('MEDIA_UPLOAD', $request->get('MEDIA_UPLOAD')); |
1073 | 1073 | $tree->setPreference('META_DESCRIPTION', $request->get('META_DESCRIPTION')); |
1074 | 1074 | $tree->setPreference('META_TITLE', $request->get('META_TITLE')); |
1075 | - $tree->setPreference('NO_UPDATE_CHAN', (string)(bool)$request->get('NO_UPDATE_CHAN')); |
|
1076 | - $tree->setPreference('PEDIGREE_LAYOUT', (string)(bool)$request->get('PEDIGREE_LAYOUT')); |
|
1075 | + $tree->setPreference('NO_UPDATE_CHAN', (string) (bool) $request->get('NO_UPDATE_CHAN')); |
|
1076 | + $tree->setPreference('PEDIGREE_LAYOUT', (string) (bool) $request->get('PEDIGREE_LAYOUT')); |
|
1077 | 1077 | $tree->setPreference('PEDIGREE_ROOT_ID', $request->get('PEDIGREE_ROOT_ID', WT_REGEX_XREF)); |
1078 | - $tree->setPreference('PEDIGREE_SHOW_GENDER', (string)(bool)$request->get('PEDIGREE_SHOW_GENDER')); |
|
1078 | + $tree->setPreference('PEDIGREE_SHOW_GENDER', (string) (bool) $request->get('PEDIGREE_SHOW_GENDER')); |
|
1079 | 1079 | $tree->setPreference('PREFER_LEVEL2_SOURCES', $request->get('PREFER_LEVEL2_SOURCES')); |
1080 | 1080 | $tree->setPreference('QUICK_REQUIRED_FACTS', implode(',', $request->get('QUICK_REQUIRED_FACTS', []))); |
1081 | 1081 | $tree->setPreference('QUICK_REQUIRED_FAMFACTS', implode(',', $request->get('QUICK_REQUIRED_FAMFACTS', []))); |
1082 | 1082 | $tree->setPreference('REPO_FACTS_ADD', implode(',', $request->get('REPO_FACTS_ADD', []))); |
1083 | 1083 | $tree->setPreference('REPO_FACTS_QUICK', implode(',', $request->get('REPO_FACTS_QUICK', []))); |
1084 | 1084 | $tree->setPreference('REPO_FACTS_UNIQUE', implode(',', $request->get('REPO_FACTS_UNIQUE', []))); |
1085 | - $tree->setPreference('SHOW_COUNTER', (string)(bool)$request->get('SHOW_COUNTER')); |
|
1086 | - $tree->setPreference('SHOW_EST_LIST_DATES', (string)(bool)$request->get('SHOW_EST_LIST_DATES')); |
|
1087 | - $tree->setPreference('SHOW_FACT_ICONS', (string)(bool)$request->get('SHOW_FACT_ICONS')); |
|
1088 | - $tree->setPreference('SHOW_GEDCOM_RECORD', (string)(bool)$request->get('SHOW_GEDCOM_RECORD')); |
|
1089 | - $tree->setPreference('SHOW_HIGHLIGHT_IMAGES', (string)(bool)$request->get('SHOW_HIGHLIGHT_IMAGES')); |
|
1090 | - $tree->setPreference('SHOW_LAST_CHANGE', (string)(bool)$request->get('SHOW_LAST_CHANGE')); |
|
1091 | - $tree->setPreference('SHOW_LDS_AT_GLANCE', (string)(bool)$request->get('SHOW_LDS_AT_GLANCE')); |
|
1085 | + $tree->setPreference('SHOW_COUNTER', (string) (bool) $request->get('SHOW_COUNTER')); |
|
1086 | + $tree->setPreference('SHOW_EST_LIST_DATES', (string) (bool) $request->get('SHOW_EST_LIST_DATES')); |
|
1087 | + $tree->setPreference('SHOW_FACT_ICONS', (string) (bool) $request->get('SHOW_FACT_ICONS')); |
|
1088 | + $tree->setPreference('SHOW_GEDCOM_RECORD', (string) (bool) $request->get('SHOW_GEDCOM_RECORD')); |
|
1089 | + $tree->setPreference('SHOW_HIGHLIGHT_IMAGES', (string) (bool) $request->get('SHOW_HIGHLIGHT_IMAGES')); |
|
1090 | + $tree->setPreference('SHOW_LAST_CHANGE', (string) (bool) $request->get('SHOW_LAST_CHANGE')); |
|
1091 | + $tree->setPreference('SHOW_LDS_AT_GLANCE', (string) (bool) $request->get('SHOW_LDS_AT_GLANCE')); |
|
1092 | 1092 | $tree->setPreference('SHOW_MEDIA_DOWNLOAD', $request->get('SHOW_MEDIA_DOWNLOAD')); |
1093 | 1093 | $tree->setPreference('SHOW_NO_WATERMARK', $request->get('SHOW_NO_WATERMARK')); |
1094 | - $tree->setPreference('SHOW_PARENTS_AGE', (string)(bool)$request->get('SHOW_PARENTS_AGE')); |
|
1094 | + $tree->setPreference('SHOW_PARENTS_AGE', (string) (bool) $request->get('SHOW_PARENTS_AGE')); |
|
1095 | 1095 | $tree->setPreference('SHOW_PEDIGREE_PLACES', $request->get('SHOW_PEDIGREE_PLACES')); |
1096 | - $tree->setPreference('SHOW_PEDIGREE_PLACES_SUFFIX', (string)(bool)$request->get('SHOW_PEDIGREE_PLACES_SUFFIX')); |
|
1096 | + $tree->setPreference('SHOW_PEDIGREE_PLACES_SUFFIX', (string) (bool) $request->get('SHOW_PEDIGREE_PLACES_SUFFIX')); |
|
1097 | 1097 | $tree->setPreference('SHOW_RELATIVES_EVENTS', implode(',', $request->get('SHOW_RELATIVES_EVENTS', []))); |
1098 | 1098 | $tree->setPreference('SOUR_FACTS_ADD', implode(',', $request->get('SOUR_FACTS_ADD', []))); |
1099 | 1099 | $tree->setPreference('SOUR_FACTS_QUICK', implode(',', $request->get('SOUR_FACTS_QUICK', []))); |
1100 | 1100 | $tree->setPreference('SOUR_FACTS_UNIQUE', implode(',', $request->get('SOUR_FACTS_UNIQUE', []))); |
1101 | - $tree->setPreference('SUBLIST_TRIGGER_I', (string)(int)$request->get('SUBLIST_TRIGGER_I', 200)); |
|
1101 | + $tree->setPreference('SUBLIST_TRIGGER_I', (string) (int) $request->get('SUBLIST_TRIGGER_I', 200)); |
|
1102 | 1102 | $tree->setPreference('SURNAME_LIST_STYLE', $request->get('SURNAME_LIST_STYLE')); |
1103 | 1103 | $tree->setPreference('SURNAME_TRADITION', $request->get('SURNAME_TRADITION')); |
1104 | 1104 | $tree->setPreference('THEME_DIR', $request->get('THEME_DIR')); |
1105 | - $tree->setPreference('USE_SILHOUETTE', (string)(bool)$request->get('USE_SILHOUETTE')); |
|
1105 | + $tree->setPreference('USE_SILHOUETTE', (string) (bool) $request->get('USE_SILHOUETTE')); |
|
1106 | 1106 | $tree->setPreference('WEBMASTER_USER_ID', $request->get('WEBMASTER_USER_ID')); |
1107 | 1107 | $tree->setPreference('WEBTREES_EMAIL', $request->get('WEBTREES_EMAIL')); |
1108 | 1108 | $tree->setPreference('title', $request->get('title')); |
@@ -1607,7 +1607,7 @@ discard block |
||
1607 | 1607 | |
1608 | 1608 | foreach ($gedcom_files as $gedcom_file) { |
1609 | 1609 | // Only import files that have changed |
1610 | - $filemtime = (string)filemtime(WT_DATA_DIR . $gedcom_file); |
|
1610 | + $filemtime = (string) filemtime(WT_DATA_DIR . $gedcom_file); |
|
1611 | 1611 | |
1612 | 1612 | $tree = Tree::findByName($gedcom_file) ?? Tree::create($gedcom_file, $gedcom_file); |
1613 | 1613 | |
@@ -1640,7 +1640,7 @@ discard block |
||
1640 | 1640 | */ |
1641 | 1641 | public function unconnected(Request $request, Tree $tree, User $user): Response |
1642 | 1642 | { |
1643 | - $associates = (bool)$request->get('associates'); |
|
1643 | + $associates = (bool) $request->get('associates'); |
|
1644 | 1644 | |
1645 | 1645 | if ($associates) { |
1646 | 1646 | $sql = "SELECT l_from, l_to FROM `##link` WHERE l_file = :tree_id AND l_type IN ('FAMS', 'FAMC', 'ASSO', '_ASSO')"; |
@@ -263,35 +263,35 @@ discard block |
||
263 | 263 | |
264 | 264 | $args = []; |
265 | 265 | if ($search) { |
266 | - $sql .= " AND log_message LIKE CONCAT('%', :search, '%')"; |
|
266 | + $sql .= " AND log_message LIKE CONCAT('%', :search, '%')"; |
|
267 | 267 | $args['search'] = $search; |
268 | 268 | } |
269 | 269 | if ($from) { |
270 | - $sql .= " AND log_time >= :from"; |
|
270 | + $sql .= " AND log_time >= :from"; |
|
271 | 271 | $args['from'] = $from; |
272 | 272 | } |
273 | 273 | if ($to) { |
274 | - $sql .= " AND log_time < TIMESTAMPADD(DAY, 1 , :to)"; // before end of the day |
|
274 | + $sql .= " AND log_time < TIMESTAMPADD(DAY, 1 , :to)"; // before end of the day |
|
275 | 275 | $args['to'] = $to; |
276 | 276 | } |
277 | 277 | if ($type) { |
278 | - $sql .= " AND log_type = :type"; |
|
278 | + $sql .= " AND log_type = :type"; |
|
279 | 279 | $args['type'] = $type; |
280 | 280 | } |
281 | 281 | if ($text) { |
282 | - $sql .= " AND log_message LIKE CONCAT('%', :text, '%')"; |
|
282 | + $sql .= " AND log_message LIKE CONCAT('%', :text, '%')"; |
|
283 | 283 | $args['text'] = $text; |
284 | 284 | } |
285 | 285 | if ($ip) { |
286 | - $sql .= " AND ip_address LIKE CONCAT('%', :ip, '%')"; |
|
286 | + $sql .= " AND ip_address LIKE CONCAT('%', :ip, '%')"; |
|
287 | 287 | $args['ip'] = $ip; |
288 | 288 | } |
289 | 289 | if ($username) { |
290 | - $sql .= " AND user_name LIKE CONCAT('%', :user, '%')"; |
|
290 | + $sql .= " AND user_name LIKE CONCAT('%', :user, '%')"; |
|
291 | 291 | $args['user'] = $username; |
292 | 292 | } |
293 | 293 | if ($gedc) { |
294 | - $sql .= " AND gedcom_name = :gedc"; |
|
294 | + $sql .= " AND gedcom_name = :gedc"; |
|
295 | 295 | $args['gedc'] = $gedc; |
296 | 296 | } |
297 | 297 | |
@@ -317,7 +317,7 @@ discard block |
||
317 | 317 | } |
318 | 318 | |
319 | 319 | if ($length) { |
320 | - $sql .= " LIMIT :limit OFFSET :offset"; |
|
320 | + $sql .= " LIMIT :limit OFFSET :offset"; |
|
321 | 321 | $args['limit'] = $length; |
322 | 322 | $args['offset'] = $start; |
323 | 323 | } |
@@ -375,35 +375,35 @@ discard block |
||
375 | 375 | |
376 | 376 | $args = []; |
377 | 377 | if ($search) { |
378 | - $sql .= " AND log_message LIKE CONCAT('%', :search, '%')"; |
|
378 | + $sql .= " AND log_message LIKE CONCAT('%', :search, '%')"; |
|
379 | 379 | $args['search'] = $search; |
380 | 380 | } |
381 | 381 | if ($from) { |
382 | - $sql .= " AND log_time >= :from"; |
|
382 | + $sql .= " AND log_time >= :from"; |
|
383 | 383 | $args['from'] = $from; |
384 | 384 | } |
385 | 385 | if ($to) { |
386 | - $sql .= " AND log_time < TIMESTAMPADD(DAY, 1 , :to)"; // before end of the day |
|
386 | + $sql .= " AND log_time < TIMESTAMPADD(DAY, 1 , :to)"; // before end of the day |
|
387 | 387 | $args['to'] = $to; |
388 | 388 | } |
389 | 389 | if ($type) { |
390 | - $sql .= " AND log_type = :type"; |
|
390 | + $sql .= " AND log_type = :type"; |
|
391 | 391 | $args['type'] = $type; |
392 | 392 | } |
393 | 393 | if ($text) { |
394 | - $sql .= " AND log_message LIKE CONCAT('%', :text, '%')"; |
|
394 | + $sql .= " AND log_message LIKE CONCAT('%', :text, '%')"; |
|
395 | 395 | $args['text'] = $text; |
396 | 396 | } |
397 | 397 | if ($ip) { |
398 | - $sql .= " AND ip_address LIKE CONCAT('%', :ip, '%')"; |
|
398 | + $sql .= " AND ip_address LIKE CONCAT('%', :ip, '%')"; |
|
399 | 399 | $args['ip'] = $ip; |
400 | 400 | } |
401 | 401 | if ($username) { |
402 | - $sql .= " AND user_name LIKE CONCAT('%', :user, '%')"; |
|
402 | + $sql .= " AND user_name LIKE CONCAT('%', :user, '%')"; |
|
403 | 403 | $args['user'] = $username; |
404 | 404 | } |
405 | 405 | if ($gedc) { |
406 | - $sql .= " AND gedcom_name = :gedc"; |
|
406 | + $sql .= " AND gedcom_name = :gedc"; |
|
407 | 407 | $args['gedc'] = $gedc; |
408 | 408 | } |
409 | 409 | |
@@ -436,31 +436,31 @@ discard block |
||
436 | 436 | |
437 | 437 | $args = []; |
438 | 438 | if ($from) { |
439 | - $sql .= " AND log_time >= :from"; |
|
439 | + $sql .= " AND log_time >= :from"; |
|
440 | 440 | $args['from'] = $from; |
441 | 441 | } |
442 | 442 | if ($to) { |
443 | - $sql .= " AND log_time < TIMESTAMPADD(DAY, 1 , :to)"; // before end of the day |
|
443 | + $sql .= " AND log_time < TIMESTAMPADD(DAY, 1 , :to)"; // before end of the day |
|
444 | 444 | $args['to'] = $to; |
445 | 445 | } |
446 | 446 | if ($type) { |
447 | - $sql .= " AND log_type = :type"; |
|
447 | + $sql .= " AND log_type = :type"; |
|
448 | 448 | $args['type'] = $type; |
449 | 449 | } |
450 | 450 | if ($text) { |
451 | - $sql .= " AND log_message LIKE CONCAT('%', :text, '%')"; |
|
451 | + $sql .= " AND log_message LIKE CONCAT('%', :text, '%')"; |
|
452 | 452 | $args['text'] = $text; |
453 | 453 | } |
454 | 454 | if ($ip) { |
455 | - $sql .= " AND ip_address LIKE CONCAT('%', :ip, '%')"; |
|
455 | + $sql .= " AND ip_address LIKE CONCAT('%', :ip, '%')"; |
|
456 | 456 | $args['ip'] = $ip; |
457 | 457 | } |
458 | 458 | if ($username) { |
459 | - $sql .= " AND user_name LIKE CONCAT('%', :user, '%')"; |
|
459 | + $sql .= " AND user_name LIKE CONCAT('%', :user, '%')"; |
|
460 | 460 | $args['user'] = $username; |
461 | 461 | } |
462 | 462 | if ($gedc) { |
463 | - $sql .= " AND gedcom_name = :gedc"; |
|
463 | + $sql .= " AND gedcom_name = :gedc"; |
|
464 | 464 | $args['gedc'] = $gedc; |
465 | 465 | } |
466 | 466 |
@@ -60,11 +60,11 @@ discard block |
||
60 | 60 | { |
61 | 61 | $this->checkModuleIsActive($tree, 'timeline_chart'); |
62 | 62 | |
63 | - $scale = (int)$request->get('scale', self::SCALE_DEFAULT); |
|
63 | + $scale = (int) $request->get('scale', self::SCALE_DEFAULT); |
|
64 | 64 | $scale = min($scale, self::SCALE_MAX); |
65 | 65 | $scale = max($scale, self::SCALE_MIN); |
66 | 66 | |
67 | - $xrefs = (array)$request->get('xrefs', []); |
|
67 | + $xrefs = (array) $request->get('xrefs', []); |
|
68 | 68 | $xrefs = array_unique($xrefs); |
69 | 69 | $xrefs = array_filter($xrefs, function (string $xref) use ($tree): bool { |
70 | 70 | $individual = Individual::getInstance($xref, $tree); |
@@ -100,14 +100,14 @@ discard block |
||
100 | 100 | |
101 | 101 | $zoom_in_url = route('timeline', [ |
102 | 102 | 'ged' => $tree->getName(), |
103 | - 'scale' => min(self::SCALE_MAX, $scale + (int)($scale * 0.2 + 1)), |
|
103 | + 'scale' => min(self::SCALE_MAX, $scale + (int) ($scale * 0.2 + 1)), |
|
104 | 104 | 'xrefs' => $xrefs, |
105 | 105 | ]); |
106 | 106 | |
107 | 107 | $zoom_out_url = route('timeline', [ |
108 | 108 | 'route' => 'timeline', |
109 | 109 | 'ged' => $tree->getName(), |
110 | - 'scale' => max(self::SCALE_MIN, $scale - (int)($scale * 0.2 + 1)), |
|
110 | + 'scale' => max(self::SCALE_MIN, $scale - (int) ($scale * 0.2 + 1)), |
|
111 | 111 | 'xrefs' => $xrefs, |
112 | 112 | ]); |
113 | 113 | |
@@ -132,11 +132,11 @@ discard block |
||
132 | 132 | { |
133 | 133 | $this->checkModuleIsActive($tree, 'timeline_chart'); |
134 | 134 | |
135 | - $scale = (int)$request->get('scale', self::SCALE_DEFAULT); |
|
135 | + $scale = (int) $request->get('scale', self::SCALE_DEFAULT); |
|
136 | 136 | $scale = min($scale, self::SCALE_MAX); |
137 | 137 | $scale = max($scale, self::SCALE_MIN); |
138 | 138 | |
139 | - $xrefs = (array)$request->get('xrefs', []); |
|
139 | + $xrefs = (array) $request->get('xrefs', []); |
|
140 | 140 | $xrefs = array_unique($xrefs); |
141 | 141 | |
142 | 142 | /** @var Individual[] $individuals */ |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | return $individual !== null && $individual->canShow(); |
149 | 149 | }); |
150 | 150 | |
151 | - $baseyear = (int)date('Y'); |
|
151 | + $baseyear = (int) date('Y'); |
|
152 | 152 | $topyear = 0; |
153 | 153 | $indifacts = []; |
154 | 154 | $birthyears = []; |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | $topyear = max($topyear, $date->y); |
184 | 184 | |
185 | 185 | if (!$individual->isDead()) { |
186 | - $topyear = max($topyear, (int)date('Y')); |
|
186 | + $topyear = max($topyear, (int) date('Y')); |
|
187 | 187 | } |
188 | 188 | |
189 | 189 | // do not add the same fact twice (prevents marriages from being added multiple times) |
@@ -196,7 +196,7 @@ discard block |
||
196 | 196 | } |
197 | 197 | |
198 | 198 | if ($scale === 0) { |
199 | - $scale = (int)(($topyear - $baseyear) / 20 * count($indifacts) / 4); |
|
199 | + $scale = (int) (($topyear - $baseyear) / 20 * count($indifacts) / 4); |
|
200 | 200 | if ($scale < 6) { |
201 | 201 | $scale = 6; |
202 | 202 | } |
@@ -73,7 +73,7 @@ |
||
73 | 73 | { |
74 | 74 | $latest_version = $this->fetchLatestVersion(); |
75 | 75 | |
76 | - list(, , $url) = explode('|', $latest_version . '||'); |
|
76 | + list(,, $url) = explode('|', $latest_version . '||'); |
|
77 | 77 | |
78 | 78 | return $url; |
79 | 79 | } |