@@ -770,13 +770,15 @@ |
||
| 770 | 770 | <p> |
| 771 | 771 | <?php if ($ucnt): ?> |
| 772 | 772 | <input type="submit" value="<?= I18N::translate('delete') ?>"> |
| 773 | - <?php else: ?> |
|
| 773 | + <?php else { |
|
| 774 | + : ?> |
|
| 774 | 775 | <?= I18N::translate('Nothing found to cleanup') ?> |
| 775 | 776 | <?php endif ?> |
| 776 | 777 | </p> |
| 777 | 778 | </form> |
| 778 | 779 | <?php |
| 779 | 780 | break; |
| 781 | +} |
|
| 780 | 782 | |
| 781 | 783 | case 'cleanup2': |
| 782 | 784 | foreach (User::all() as $user) { |
@@ -41,108 +41,108 @@ discard block |
||
| 41 | 41 | |
| 42 | 42 | // Form actions |
| 43 | 43 | switch (Filter::post('action')) { |
| 44 | -case 'save': |
|
| 45 | - if (Filter::checkCsrf()) { |
|
| 46 | - $user_id = Filter::postInteger('user_id'); |
|
| 47 | - $user = User::find($user_id); |
|
| 48 | - $username = Filter::post('username'); |
|
| 49 | - $real_name = Filter::post('real_name'); |
|
| 50 | - $email = Filter::post('email'); |
|
| 51 | - $pass1 = Filter::post('pass1', WT_REGEX_PASSWORD); |
|
| 52 | - $pass2 = Filter::post('pass2', WT_REGEX_PASSWORD); |
|
| 53 | - $theme = Filter::post('theme', implode('|', array_keys(Theme::themeNames())), ''); |
|
| 54 | - $language = Filter::post('language'); |
|
| 55 | - $timezone = Filter::post('timezone'); |
|
| 56 | - $contact_method = Filter::post('contact_method'); |
|
| 57 | - $comment = Filter::post('comment'); |
|
| 58 | - $auto_accept = Filter::postBool('auto_accept'); |
|
| 59 | - $canadmin = Filter::postBool('canadmin'); |
|
| 60 | - $visible_online = Filter::postBool('visible_online'); |
|
| 61 | - $verified = Filter::postBool('verified'); |
|
| 62 | - $approved = Filter::postBool('approved'); |
|
| 63 | - |
|
| 64 | - if ($user_id === 0) { |
|
| 65 | - // Create a new user |
|
| 66 | - if (User::findByUserName($username)) { |
|
| 67 | - FlashMessages::addMessage(I18N::translate('Duplicate username. A user with that username already exists. Please choose another username.')); |
|
| 68 | - } elseif (User::findByEmail($email)) { |
|
| 69 | - FlashMessages::addMessage(I18N::translate('Duplicate email address. A user with that email already exists.')); |
|
| 70 | - } elseif ($pass1 !== $pass2) { |
|
| 71 | - FlashMessages::addMessage(I18N::translate('The passwords do not match.')); |
|
| 44 | + case 'save': |
|
| 45 | + if (Filter::checkCsrf()) { |
|
| 46 | + $user_id = Filter::postInteger('user_id'); |
|
| 47 | + $user = User::find($user_id); |
|
| 48 | + $username = Filter::post('username'); |
|
| 49 | + $real_name = Filter::post('real_name'); |
|
| 50 | + $email = Filter::post('email'); |
|
| 51 | + $pass1 = Filter::post('pass1', WT_REGEX_PASSWORD); |
|
| 52 | + $pass2 = Filter::post('pass2', WT_REGEX_PASSWORD); |
|
| 53 | + $theme = Filter::post('theme', implode('|', array_keys(Theme::themeNames())), ''); |
|
| 54 | + $language = Filter::post('language'); |
|
| 55 | + $timezone = Filter::post('timezone'); |
|
| 56 | + $contact_method = Filter::post('contact_method'); |
|
| 57 | + $comment = Filter::post('comment'); |
|
| 58 | + $auto_accept = Filter::postBool('auto_accept'); |
|
| 59 | + $canadmin = Filter::postBool('canadmin'); |
|
| 60 | + $visible_online = Filter::postBool('visible_online'); |
|
| 61 | + $verified = Filter::postBool('verified'); |
|
| 62 | + $approved = Filter::postBool('approved'); |
|
| 63 | + |
|
| 64 | + if ($user_id === 0) { |
|
| 65 | + // Create a new user |
|
| 66 | + if (User::findByUserName($username)) { |
|
| 67 | + FlashMessages::addMessage(I18N::translate('Duplicate username. A user with that username already exists. Please choose another username.')); |
|
| 68 | + } elseif (User::findByEmail($email)) { |
|
| 69 | + FlashMessages::addMessage(I18N::translate('Duplicate email address. A user with that email already exists.')); |
|
| 70 | + } elseif ($pass1 !== $pass2) { |
|
| 71 | + FlashMessages::addMessage(I18N::translate('The passwords do not match.')); |
|
| 72 | + } else { |
|
| 73 | + $user = User::create($username, $real_name, $email, $pass1); |
|
| 74 | + $user->setPreference('reg_timestamp', date('U'))->setPreference('sessiontime', '0'); |
|
| 75 | + Log::addAuthenticationLog('User ->' . $username . '<- created'); |
|
| 76 | + } |
|
| 72 | 77 | } else { |
| 73 | - $user = User::create($username, $real_name, $email, $pass1); |
|
| 74 | - $user->setPreference('reg_timestamp', date('U'))->setPreference('sessiontime', '0'); |
|
| 75 | - Log::addAuthenticationLog('User ->' . $username . '<- created'); |
|
| 76 | - } |
|
| 77 | - } else { |
|
| 78 | - $user = User::find($user_id); |
|
| 79 | - if ($user && $username && $real_name) { |
|
| 80 | - $user->setEmail($email); |
|
| 81 | - $user->setUserName($username); |
|
| 82 | - $user->setRealName($real_name); |
|
| 83 | - if ($pass1 !== null && $pass1 === $pass2) { |
|
| 84 | - $user->setPassword($pass1); |
|
| 78 | + $user = User::find($user_id); |
|
| 79 | + if ($user && $username && $real_name) { |
|
| 80 | + $user->setEmail($email); |
|
| 81 | + $user->setUserName($username); |
|
| 82 | + $user->setRealName($real_name); |
|
| 83 | + if ($pass1 !== null && $pass1 === $pass2) { |
|
| 84 | + $user->setPassword($pass1); |
|
| 85 | + } |
|
| 85 | 86 | } |
| 86 | 87 | } |
| 87 | - } |
|
| 88 | 88 | |
| 89 | - if ($user) { |
|
| 90 | - // Approving for the first time? Send a confirmation email |
|
| 91 | - if ($approved && !$user->getPreference('verified_by_admin') && $user->getPreference('sessiontime') == 0) { |
|
| 92 | - I18N::init($user->getPreference('language')); |
|
| 93 | - |
|
| 94 | - // Create a dummy user, so we can send messages from the tree. |
|
| 95 | - $sender = new User( |
|
| 96 | - (object) [ |
|
| 97 | - 'user_id' => null, |
|
| 98 | - 'user_name' => '', |
|
| 99 | - 'real_name' => $WT_TREE->getTitle(), |
|
| 100 | - 'email' => $WT_TREE->getPreference('WEBTREES_EMAIL'), |
|
| 101 | - ] |
|
| 102 | - ); |
|
| 103 | - |
|
| 104 | - Mail::send( |
|
| 105 | - $sender, |
|
| 106 | - $user, |
|
| 107 | - $sender, |
|
| 108 | - I18N::translate('Approval of account at %s', WT_BASE_URL), |
|
| 109 | - View::make('emails/approve-user-text', ['user' => $user]), |
|
| 110 | - View::make('emails/approve-user-html', ['user' => $user]) |
|
| 111 | - ); |
|
| 112 | - } |
|
| 89 | + if ($user) { |
|
| 90 | + // Approving for the first time? Send a confirmation email |
|
| 91 | + if ($approved && !$user->getPreference('verified_by_admin') && $user->getPreference('sessiontime') == 0) { |
|
| 92 | + I18N::init($user->getPreference('language')); |
|
| 93 | + |
|
| 94 | + // Create a dummy user, so we can send messages from the tree. |
|
| 95 | + $sender = new User( |
|
| 96 | + (object) [ |
|
| 97 | + 'user_id' => null, |
|
| 98 | + 'user_name' => '', |
|
| 99 | + 'real_name' => $WT_TREE->getTitle(), |
|
| 100 | + 'email' => $WT_TREE->getPreference('WEBTREES_EMAIL'), |
|
| 101 | + ] |
|
| 102 | + ); |
|
| 103 | + |
|
| 104 | + Mail::send( |
|
| 105 | + $sender, |
|
| 106 | + $user, |
|
| 107 | + $sender, |
|
| 108 | + I18N::translate('Approval of account at %s', WT_BASE_URL), |
|
| 109 | + View::make('emails/approve-user-text', ['user' => $user]), |
|
| 110 | + View::make('emails/approve-user-html', ['user' => $user]) |
|
| 111 | + ); |
|
| 112 | + } |
|
| 113 | 113 | |
| 114 | - $user |
|
| 115 | - ->setPreference('theme', $theme) |
|
| 116 | - ->setPreference('language', $language) |
|
| 117 | - ->setPreference('TIMEZONE', $timezone) |
|
| 118 | - ->setPreference('contactmethod', $contact_method) |
|
| 119 | - ->setPreference('comment', $comment) |
|
| 120 | - ->setPreference('auto_accept', $auto_accept ? '1' : '0') |
|
| 121 | - ->setPreference('visibleonline', $visible_online ? '1' : '0') |
|
| 122 | - ->setPreference('verified', $verified ? '1' : '0') |
|
| 123 | - ->setPreference('verified_by_admin', $approved ? '1' : '0'); |
|
| 124 | - |
|
| 125 | - // We cannot change our own admin status. Another admin will need to do it. |
|
| 126 | - if ($user->getUserId() !== Auth::id()) { |
|
| 127 | - $user->setPreference('canadmin', $canadmin ? '1' : '0'); |
|
| 128 | - } |
|
| 114 | + $user |
|
| 115 | + ->setPreference('theme', $theme) |
|
| 116 | + ->setPreference('language', $language) |
|
| 117 | + ->setPreference('TIMEZONE', $timezone) |
|
| 118 | + ->setPreference('contactmethod', $contact_method) |
|
| 119 | + ->setPreference('comment', $comment) |
|
| 120 | + ->setPreference('auto_accept', $auto_accept ? '1' : '0') |
|
| 121 | + ->setPreference('visibleonline', $visible_online ? '1' : '0') |
|
| 122 | + ->setPreference('verified', $verified ? '1' : '0') |
|
| 123 | + ->setPreference('verified_by_admin', $approved ? '1' : '0'); |
|
| 124 | + |
|
| 125 | + // We cannot change our own admin status. Another admin will need to do it. |
|
| 126 | + if ($user->getUserId() !== Auth::id()) { |
|
| 127 | + $user->setPreference('canadmin', $canadmin ? '1' : '0'); |
|
| 128 | + } |
|
| 129 | 129 | |
| 130 | - foreach (Tree::getAll() as $tree) { |
|
| 131 | - $tree->setUserPreference($user, 'gedcomid', Filter::post('gedcomid' . $tree->getTreeId(), WT_REGEX_XREF)); |
|
| 132 | - $tree->setUserPreference($user, 'canedit', Filter::post('canedit' . $tree->getTreeId(), implode('|', array_keys($ALL_EDIT_OPTIONS)))); |
|
| 133 | - if (Filter::post('gedcomid' . $tree->getTreeId(), WT_REGEX_XREF)) { |
|
| 134 | - $tree->setUserPreference($user, 'RELATIONSHIP_PATH_LENGTH', Filter::postInteger('RELATIONSHIP_PATH_LENGTH' . $tree->getTreeId(), 0, 10, 0)); |
|
| 135 | - } else { |
|
| 136 | - // Do not allow a path length to be set if the individual ID is not |
|
| 137 | - $tree->setUserPreference($user, 'RELATIONSHIP_PATH_LENGTH', null); |
|
| 130 | + foreach (Tree::getAll() as $tree) { |
|
| 131 | + $tree->setUserPreference($user, 'gedcomid', Filter::post('gedcomid' . $tree->getTreeId(), WT_REGEX_XREF)); |
|
| 132 | + $tree->setUserPreference($user, 'canedit', Filter::post('canedit' . $tree->getTreeId(), implode('|', array_keys($ALL_EDIT_OPTIONS)))); |
|
| 133 | + if (Filter::post('gedcomid' . $tree->getTreeId(), WT_REGEX_XREF)) { |
|
| 134 | + $tree->setUserPreference($user, 'RELATIONSHIP_PATH_LENGTH', Filter::postInteger('RELATIONSHIP_PATH_LENGTH' . $tree->getTreeId(), 0, 10, 0)); |
|
| 135 | + } else { |
|
| 136 | + // Do not allow a path length to be set if the individual ID is not |
|
| 137 | + $tree->setUserPreference($user, 'RELATIONSHIP_PATH_LENGTH', null); |
|
| 138 | + } |
|
| 138 | 139 | } |
| 139 | 140 | } |
| 140 | 141 | } |
| 141 | - } |
|
| 142 | 142 | |
| 143 | - header('Location: admin_users.php'); |
|
| 143 | + header('Location: admin_users.php'); |
|
| 144 | 144 | |
| 145 | - return; |
|
| 145 | + return; |
|
| 146 | 146 | } |
| 147 | 147 | |
| 148 | 148 | switch (Filter::get('action')) { |
@@ -182,12 +182,12 @@ discard block |
||
| 182 | 182 | // Datatables numbers columns 0, 1, 2 |
| 183 | 183 | // MySQL numbers columns 1, 2, 3 |
| 184 | 184 | switch ($value['dir']) { |
| 185 | - case 'asc': |
|
| 186 | - $sql_select .= (1 + $value['column']) . " ASC "; |
|
| 187 | - break; |
|
| 188 | - case 'desc': |
|
| 189 | - $sql_select .= (1 + $value['column']) . " DESC "; |
|
| 190 | - break; |
|
| 185 | + case 'asc': |
|
| 186 | + $sql_select .= (1 + $value['column']) . " ASC "; |
|
| 187 | + break; |
|
| 188 | + case 'desc': |
|
| 189 | + $sql_select .= (1 + $value['column']) . " DESC "; |
|
| 190 | + break; |
|
| 191 | 191 | } |
| 192 | 192 | } |
| 193 | 193 | } else { |
@@ -235,7 +235,8 @@ discard block |
||
| 235 | 235 | <?php // Reset - otherwise we might "undo all changes", which refreshes the ?> |
| 236 | 236 | <?php // page, which makes them all again! ?> |
| 237 | 237 | <script>reset_reload();</script> |
| 238 | - <?php else: ?> |
|
| 238 | + <?php else { |
|
| 239 | + : ?> |
|
| 239 | 240 | <hr> |
| 240 | 241 | <div id="batch_update2" class="col-sm-12"> |
| 241 | 242 | <?php if ($this->curr_xref): ?> |
@@ -273,6 +274,7 @@ discard block |
||
| 273 | 274 | foreach (array_keys($this->all_xrefs) as $key) { |
| 274 | 275 | if ($key > $xref) { |
| 275 | 276 | $record = self::getLatestRecord($key, $this->all_xrefs[$key]); |
| 277 | +} |
|
| 276 | 278 | if ($this->PLUGIN->doesRecordNeedUpdate($key, $record)) { |
| 277 | 279 | return $key; |
| 278 | 280 | } |
@@ -95,13 +95,13 @@ discard block |
||
| 95 | 95 | */ |
| 96 | 96 | public function modAction($mod_action) { |
| 97 | 97 | switch ($mod_action) { |
| 98 | - case 'admin_batch_update': |
|
| 99 | - echo $this->main(); |
|
| 100 | - break; |
|
| 98 | + case 'admin_batch_update': |
|
| 99 | + echo $this->main(); |
|
| 100 | + break; |
|
| 101 | 101 | |
| 102 | - default: |
|
| 103 | - http_response_code(404); |
|
| 104 | - break; |
|
| 102 | + default: |
|
| 103 | + http_response_code(404); |
|
| 104 | + break; |
|
| 105 | 105 | } |
| 106 | 106 | } |
| 107 | 107 | |
@@ -126,36 +126,36 @@ discard block |
||
| 126 | 126 | $this->getAllXrefs(); |
| 127 | 127 | |
| 128 | 128 | switch ($this->action) { |
| 129 | - case 'update': |
|
| 130 | - $record = self::getLatestRecord($this->xref, $this->all_xrefs[$this->xref]); |
|
| 131 | - if ($this->PLUGIN->doesRecordNeedUpdate($this->xref, $record)) { |
|
| 132 | - $newrecord = $this->PLUGIN->updateRecord($this->xref, $record); |
|
| 133 | - if ($newrecord != $record) { |
|
| 134 | - if ($newrecord) { |
|
| 135 | - GedcomRecord::getInstance($this->xref, $WT_TREE)->updateRecord($newrecord, !$this->PLUGIN->chan); |
|
| 136 | - } else { |
|
| 137 | - GedcomRecord::getInstance($this->xref, $WT_TREE)->deleteRecord(); |
|
| 138 | - } |
|
| 139 | - } |
|
| 140 | - } |
|
| 141 | - $this->xref = $this->findNextXref($this->xref); |
|
| 142 | - break; |
|
| 143 | - case 'update_all': |
|
| 144 | - foreach ($this->all_xrefs as $xref => $type) { |
|
| 145 | - $record = self::getLatestRecord($xref, $type); |
|
| 146 | - if ($this->PLUGIN->doesRecordNeedUpdate($xref, $record)) { |
|
| 147 | - $newrecord = $this->PLUGIN->updateRecord($xref, $record); |
|
| 129 | + case 'update': |
|
| 130 | + $record = self::getLatestRecord($this->xref, $this->all_xrefs[$this->xref]); |
|
| 131 | + if ($this->PLUGIN->doesRecordNeedUpdate($this->xref, $record)) { |
|
| 132 | + $newrecord = $this->PLUGIN->updateRecord($this->xref, $record); |
|
| 148 | 133 | if ($newrecord != $record) { |
| 149 | 134 | if ($newrecord) { |
| 150 | - GedcomRecord::getInstance($xref, $WT_TREE)->updateRecord($newrecord, !$this->PLUGIN->chan); |
|
| 135 | + GedcomRecord::getInstance($this->xref, $WT_TREE)->updateRecord($newrecord, !$this->PLUGIN->chan); |
|
| 151 | 136 | } else { |
| 152 | - GedcomRecord::getInstance($xref, $WT_TREE)->deleteRecord(); |
|
| 137 | + GedcomRecord::getInstance($this->xref, $WT_TREE)->deleteRecord(); |
|
| 153 | 138 | } |
| 154 | 139 | } |
| 155 | 140 | } |
| 156 | - } |
|
| 157 | - $this->xref = ''; |
|
| 158 | - break; |
|
| 141 | + $this->xref = $this->findNextXref($this->xref); |
|
| 142 | + break; |
|
| 143 | + case 'update_all': |
|
| 144 | + foreach ($this->all_xrefs as $xref => $type) { |
|
| 145 | + $record = self::getLatestRecord($xref, $type); |
|
| 146 | + if ($this->PLUGIN->doesRecordNeedUpdate($xref, $record)) { |
|
| 147 | + $newrecord = $this->PLUGIN->updateRecord($xref, $record); |
|
| 148 | + if ($newrecord != $record) { |
|
| 149 | + if ($newrecord) { |
|
| 150 | + GedcomRecord::getInstance($xref, $WT_TREE)->updateRecord($newrecord, !$this->PLUGIN->chan); |
|
| 151 | + } else { |
|
| 152 | + GedcomRecord::getInstance($xref, $WT_TREE)->deleteRecord(); |
|
| 153 | + } |
|
| 154 | + } |
|
| 155 | + } |
|
| 156 | + } |
|
| 157 | + $this->xref = ''; |
|
| 158 | + break; |
|
| 159 | 159 | } |
| 160 | 160 | |
| 161 | 161 | // Make sure that our requested record really does need updating. |
@@ -313,28 +313,28 @@ discard block |
||
| 313 | 313 | $vars = []; |
| 314 | 314 | foreach ($this->PLUGIN->getRecordTypesToUpdate() as $type) { |
| 315 | 315 | switch ($type) { |
| 316 | - case 'INDI': |
|
| 317 | - $sql[] = "SELECT i_id, 'INDI' FROM `##individuals` WHERE i_file=?"; |
|
| 318 | - $vars[] = $WT_TREE->getTreeId(); |
|
| 319 | - break; |
|
| 320 | - case 'FAM': |
|
| 321 | - $sql[] = "SELECT f_id, 'FAM' FROM `##families` WHERE f_file=?"; |
|
| 322 | - $vars[] = $WT_TREE->getTreeId(); |
|
| 323 | - break; |
|
| 324 | - case 'SOUR': |
|
| 325 | - $sql[] = "SELECT s_id, 'SOUR' FROM `##sources` WHERE s_file=?"; |
|
| 326 | - $vars[] = $WT_TREE->getTreeId(); |
|
| 327 | - break; |
|
| 328 | - case 'OBJE': |
|
| 329 | - $sql[] = "SELECT m_id, 'OBJE' FROM `##media` WHERE m_file=?"; |
|
| 330 | - $vars[] = $WT_TREE->getTreeId(); |
|
| 331 | - break; |
|
| 332 | - default: |
|
| 333 | - $sql[] = "SELECT o_id, ? FROM `##other` WHERE o_type=? AND o_file=?"; |
|
| 334 | - $vars[] = $type; |
|
| 335 | - $vars[] = $type; |
|
| 336 | - $vars[] = $WT_TREE->getTreeId(); |
|
| 337 | - break; |
|
| 316 | + case 'INDI': |
|
| 317 | + $sql[] = "SELECT i_id, 'INDI' FROM `##individuals` WHERE i_file=?"; |
|
| 318 | + $vars[] = $WT_TREE->getTreeId(); |
|
| 319 | + break; |
|
| 320 | + case 'FAM': |
|
| 321 | + $sql[] = "SELECT f_id, 'FAM' FROM `##families` WHERE f_file=?"; |
|
| 322 | + $vars[] = $WT_TREE->getTreeId(); |
|
| 323 | + break; |
|
| 324 | + case 'SOUR': |
|
| 325 | + $sql[] = "SELECT s_id, 'SOUR' FROM `##sources` WHERE s_file=?"; |
|
| 326 | + $vars[] = $WT_TREE->getTreeId(); |
|
| 327 | + break; |
|
| 328 | + case 'OBJE': |
|
| 329 | + $sql[] = "SELECT m_id, 'OBJE' FROM `##media` WHERE m_file=?"; |
|
| 330 | + $vars[] = $WT_TREE->getTreeId(); |
|
| 331 | + break; |
|
| 332 | + default: |
|
| 333 | + $sql[] = "SELECT o_id, ? FROM `##other` WHERE o_type=? AND o_file=?"; |
|
| 334 | + $vars[] = $type; |
|
| 335 | + $vars[] = $type; |
|
| 336 | + $vars[] = $WT_TREE->getTreeId(); |
|
| 337 | + break; |
|
| 338 | 338 | } |
| 339 | 339 | } |
| 340 | 340 | $this->all_xrefs = Database::prepare(implode(' UNION ', $sql) . ' ORDER BY 1 ASC') |
@@ -410,20 +410,20 @@ discard block |
||
| 410 | 410 | global $WT_TREE; |
| 411 | 411 | |
| 412 | 412 | switch ($type) { |
| 413 | - case 'INDI': |
|
| 414 | - return Individual::getInstance($xref, $WT_TREE)->getGedcom(); |
|
| 415 | - case 'FAM': |
|
| 416 | - return Family::getInstance($xref, $WT_TREE)->getGedcom(); |
|
| 417 | - case 'SOUR': |
|
| 418 | - return Source::getInstance($xref, $WT_TREE)->getGedcom(); |
|
| 419 | - case 'REPO': |
|
| 420 | - return Repository::getInstance($xref, $WT_TREE)->getGedcom(); |
|
| 421 | - case 'OBJE': |
|
| 422 | - return Media::getInstance($xref, $WT_TREE)->getGedcom(); |
|
| 423 | - case 'NOTE': |
|
| 424 | - return Note::getInstance($xref, $WT_TREE)->getGedcom(); |
|
| 425 | - default: |
|
| 426 | - return GedcomRecord::getInstance($xref, $WT_TREE)->getGedcom(); |
|
| 413 | + case 'INDI': |
|
| 414 | + return Individual::getInstance($xref, $WT_TREE)->getGedcom(); |
|
| 415 | + case 'FAM': |
|
| 416 | + return Family::getInstance($xref, $WT_TREE)->getGedcom(); |
|
| 417 | + case 'SOUR': |
|
| 418 | + return Source::getInstance($xref, $WT_TREE)->getGedcom(); |
|
| 419 | + case 'REPO': |
|
| 420 | + return Repository::getInstance($xref, $WT_TREE)->getGedcom(); |
|
| 421 | + case 'OBJE': |
|
| 422 | + return Media::getInstance($xref, $WT_TREE)->getGedcom(); |
|
| 423 | + case 'NOTE': |
|
| 424 | + return Note::getInstance($xref, $WT_TREE)->getGedcom(); |
|
| 425 | + default: |
|
| 426 | + return GedcomRecord::getInstance($xref, $WT_TREE)->getGedcom(); |
|
| 427 | 427 | } |
| 428 | 428 | } |
| 429 | 429 | |
@@ -381,7 +381,8 @@ discard block |
||
| 381 | 381 | <a href="<?= $individual->getHtmlUrl() ?>#tab-stories"> |
| 382 | 382 | <?= $individual->getFullName() ?> |
| 383 | 383 | </a> |
| 384 | - <?php else: ?> |
|
| 384 | + <?php else { |
|
| 385 | + : ?> |
|
| 385 | 386 | <?= $story->xref ?> |
| 386 | 387 | <?php endif ?> |
| 387 | 388 | </td> |
@@ -410,6 +411,7 @@ discard block |
||
| 410 | 411 | */ |
| 411 | 412 | private function showList() { |
| 412 | 413 | global $controller, $WT_TREE; |
| 414 | +} |
|
| 413 | 415 | |
| 414 | 416 | $controller = new PageController; |
| 415 | 417 | $controller |
@@ -50,21 +50,21 @@ |
||
| 50 | 50 | */ |
| 51 | 51 | public function modAction($mod_action) { |
| 52 | 52 | switch ($mod_action) { |
| 53 | - case 'admin_edit': |
|
| 54 | - $this->edit(); |
|
| 55 | - break; |
|
| 56 | - case 'admin_delete': |
|
| 57 | - $this->delete(); |
|
| 58 | - $this->config(); |
|
| 59 | - break; |
|
| 60 | - case 'admin_config': |
|
| 61 | - $this->config(); |
|
| 62 | - break; |
|
| 63 | - case 'show_list': |
|
| 64 | - $this->showList(); |
|
| 65 | - break; |
|
| 66 | - default: |
|
| 67 | - http_response_code(404); |
|
| 53 | + case 'admin_edit': |
|
| 54 | + $this->edit(); |
|
| 55 | + break; |
|
| 56 | + case 'admin_delete': |
|
| 57 | + $this->delete(); |
|
| 58 | + $this->config(); |
|
| 59 | + break; |
|
| 60 | + case 'admin_config': |
|
| 61 | + $this->config(); |
|
| 62 | + break; |
|
| 63 | + case 'show_list': |
|
| 64 | + $this->showList(); |
|
| 65 | + break; |
|
| 66 | + default: |
|
| 67 | + http_response_code(404); |
|
| 68 | 68 | } |
| 69 | 69 | } |
| 70 | 70 | |
@@ -200,7 +200,8 @@ discard block |
||
| 200 | 200 | <div class="tab-pane fade show active" role="tabpanel" id="individuals"> |
| 201 | 201 | <?php if (empty($myindilist)): ?> |
| 202 | 202 | <p><?= I18N::translate('No results found.') ?></p> |
| 203 | - <?php else: ?> |
|
| 203 | + <?php else { |
|
| 204 | + : ?> |
|
| 204 | 205 | <?= FunctionsPrintLists::individualTable($myindilist) ?> |
| 205 | 206 | <?php endif ?> |
| 206 | 207 | </div> |
@@ -216,6 +217,7 @@ discard block |
||
| 216 | 217 | <?php |
| 217 | 218 | } |
| 218 | 219 | echo '<h4><a href="placelist.php?display=list">', I18N::translate('Show all places in a list'), '</a></h4>'; |
| 220 | +} |
|
| 219 | 221 | |
| 220 | 222 | if ($gm_module && $gm_module->getPreference('GM_PLACE_HIERARCHY')) { |
| 221 | 223 | $gm_module->mapScripts($numfound, $level, $parent, $linklevels, $place_names); |
@@ -46,181 +46,181 @@ |
||
| 46 | 46 | echo '<div id="place-hierarchy">'; |
| 47 | 47 | |
| 48 | 48 | switch ($display) { |
| 49 | -case 'list': |
|
| 50 | - echo '<h2>', $controller->getPageTitle(), '</h2>'; |
|
| 51 | - $list_places = Place::allPlaces($WT_TREE); |
|
| 52 | - $numfound = count($list_places); |
|
| 49 | + case 'list': |
|
| 50 | + echo '<h2>', $controller->getPageTitle(), '</h2>'; |
|
| 51 | + $list_places = Place::allPlaces($WT_TREE); |
|
| 52 | + $numfound = count($list_places); |
|
| 53 | 53 | |
| 54 | - $divisor = $numfound > 20 ? 3 : 2; |
|
| 54 | + $divisor = $numfound > 20 ? 3 : 2; |
|
| 55 | 55 | |
| 56 | - if ($numfound === 0) { |
|
| 57 | - echo '<b>', I18N::translate('No results found.'), '</b><br>'; |
|
| 58 | - } else { |
|
| 59 | - $columns = array_chunk($list_places, ceil($numfound / $divisor)); |
|
| 60 | - |
|
| 61 | - $html = '<table class="list_table"><thead>'; |
|
| 62 | - $html .= '<tr><th class="list_label" colspan="' . $divisor . '">'; |
|
| 63 | - $html .= '<i class="icon-place"></i> ' . I18N::translate('Place list'); |
|
| 64 | - $html .= '</th></tr></thead>'; |
|
| 65 | - $html .= '<tbody><tr>'; |
|
| 66 | - foreach ($columns as $column) { |
|
| 67 | - $html .= '<td class="list_value_wrap"><ul>'; |
|
| 68 | - foreach ($column as $item) { |
|
| 69 | - $html .= '<li><a href="' . $item->getURL() . '">' . $item->getReverseName() . '</a></li>'; |
|
| 56 | + if ($numfound === 0) { |
|
| 57 | + echo '<b>', I18N::translate('No results found.'), '</b><br>'; |
|
| 58 | + } else { |
|
| 59 | + $columns = array_chunk($list_places, ceil($numfound / $divisor)); |
|
| 60 | + |
|
| 61 | + $html = '<table class="list_table"><thead>'; |
|
| 62 | + $html .= '<tr><th class="list_label" colspan="' . $divisor . '">'; |
|
| 63 | + $html .= '<i class="icon-place"></i> ' . I18N::translate('Place list'); |
|
| 64 | + $html .= '</th></tr></thead>'; |
|
| 65 | + $html .= '<tbody><tr>'; |
|
| 66 | + foreach ($columns as $column) { |
|
| 67 | + $html .= '<td class="list_value_wrap"><ul>'; |
|
| 68 | + foreach ($column as $item) { |
|
| 69 | + $html .= '<li><a href="' . $item->getURL() . '">' . $item->getReverseName() . '</a></li>'; |
|
| 70 | + } |
|
| 71 | + $html .= '</ul></td>'; |
|
| 70 | 72 | } |
| 71 | - $html .= '</ul></td>'; |
|
| 73 | + $html .= '</tr></tbody></table>'; |
|
| 74 | + echo $html; |
|
| 72 | 75 | } |
| 73 | - $html .= '</tr></tbody></table>'; |
|
| 74 | - echo $html; |
|
| 75 | - } |
|
| 76 | - echo '<h4><a href="placelist.php?display=hierarchy">', I18N::translate('Show places in hierarchy'), '</a></h4>'; |
|
| 77 | - break; |
|
| 78 | -case 'hierarchy': |
|
| 79 | - $gm_module = Module::getModuleByName('googlemap'); |
|
| 76 | + echo '<h4><a href="placelist.php?display=hierarchy">', I18N::translate('Show places in hierarchy'), '</a></h4>'; |
|
| 77 | + break; |
|
| 78 | + case 'hierarchy': |
|
| 79 | + $gm_module = Module::getModuleByName('googlemap'); |
|
| 80 | 80 | |
| 81 | - // Find this place and its ID |
|
| 82 | - $place = new Place(implode(', ', array_reverse($parent)), $WT_TREE); |
|
| 83 | - $place_id = $place->getPlaceId(); |
|
| 81 | + // Find this place and its ID |
|
| 82 | + $place = new Place(implode(', ', array_reverse($parent)), $WT_TREE); |
|
| 83 | + $place_id = $place->getPlaceId(); |
|
| 84 | 84 | |
| 85 | - $child_places = $place->getChildPlaces(); |
|
| 85 | + $child_places = $place->getChildPlaces(); |
|
| 86 | 86 | |
| 87 | - $numfound = count($child_places); |
|
| 87 | + $numfound = count($child_places); |
|
| 88 | 88 | |
| 89 | - //-- if the number of places found is 0 then automatically redirect to search page |
|
| 90 | - if ($numfound === 0) { |
|
| 91 | - $action = 'show'; |
|
| 92 | - } |
|
| 93 | - |
|
| 94 | - echo '<h2>', $controller->getPageTitle(); |
|
| 95 | - // Breadcrumbs |
|
| 96 | - if ($place_id) { |
|
| 97 | - $parent_place = $place->getParentPlace(); |
|
| 98 | - while ($parent_place->getPlaceId()) { |
|
| 99 | - echo ', <a href="', $parent_place->getURL(), '" dir="auto">', $parent_place->getPlaceName(), '</a>'; |
|
| 100 | - $parent_place = $parent_place->getParentPlace(); |
|
| 89 | + //-- if the number of places found is 0 then automatically redirect to search page |
|
| 90 | + if ($numfound === 0) { |
|
| 91 | + $action = 'show'; |
|
| 101 | 92 | } |
| 102 | - echo ', <a href="placelist.php">', I18N::translate('Top level'), '</a>'; |
|
| 103 | - } |
|
| 104 | - echo '</h2>'; |
|
| 105 | 93 | |
| 106 | - if ($gm_module && $gm_module->getPreference('GM_PLACE_HIERARCHY')) { |
|
| 107 | - $linklevels = ''; |
|
| 108 | - $place_names = []; |
|
| 109 | - for ($j = 0; $j < $level; $j++) { |
|
| 110 | - $linklevels .= '&parent[' . $j . ']=' . rawurlencode($parent[$j]); |
|
| 94 | + echo '<h2>', $controller->getPageTitle(); |
|
| 95 | + // Breadcrumbs |
|
| 96 | + if ($place_id) { |
|
| 97 | + $parent_place = $place->getParentPlace(); |
|
| 98 | + while ($parent_place->getPlaceId()) { |
|
| 99 | + echo ', <a href="', $parent_place->getURL(), '" dir="auto">', $parent_place->getPlaceName(), '</a>'; |
|
| 100 | + $parent_place = $parent_place->getParentPlace(); |
|
| 101 | + } |
|
| 102 | + echo ', <a href="placelist.php">', I18N::translate('Top level'), '</a>'; |
|
| 111 | 103 | } |
| 104 | + echo '</h2>'; |
|
| 112 | 105 | |
| 113 | - $gm_module->createMap(); |
|
| 114 | - } elseif (Module::getModuleByName('places_assistant')) { |
|
| 115 | - // Places Assistant is a custom/add-on module that was once part of the core code. |
|
| 116 | - \PlacesAssistantModule::display_map($level, $parent); |
|
| 117 | - } |
|
| 106 | + if ($gm_module && $gm_module->getPreference('GM_PLACE_HIERARCHY')) { |
|
| 107 | + $linklevels = ''; |
|
| 108 | + $place_names = []; |
|
| 109 | + for ($j = 0; $j < $level; $j++) { |
|
| 110 | + $linklevels .= '&parent[' . $j . ']=' . rawurlencode($parent[$j]); |
|
| 111 | + } |
|
| 118 | 112 | |
| 119 | - if ($numfound > 0) { |
|
| 120 | - if ($numfound > 20) { |
|
| 121 | - $divisor = 3; |
|
| 122 | - } elseif ($numfound > 4) { |
|
| 123 | - $divisor = 2; |
|
| 124 | - } else { |
|
| 125 | - $divisor = 1; |
|
| 113 | + $gm_module->createMap(); |
|
| 114 | + } elseif (Module::getModuleByName('places_assistant')) { |
|
| 115 | + // Places Assistant is a custom/add-on module that was once part of the core code. |
|
| 116 | + \PlacesAssistantModule::display_map($level, $parent); |
|
| 126 | 117 | } |
| 127 | 118 | |
| 128 | - $columns = array_chunk($child_places, ceil($numfound / $divisor)); |
|
| 129 | - $html = '<table id="place_hierarchy" class="list_table"><thead><tr><th class="list_label" colspan="' . $divisor . '">'; |
|
| 130 | - $html .= '<i class="icon-place"></i> '; |
|
| 131 | - if ($place_id) { |
|
| 132 | - $html .= I18N::translate('Places in %s', $place->getPlaceName()); |
|
| 133 | - } else { |
|
| 134 | - $html .= I18N::translate('Place hierarchy'); |
|
| 135 | - } |
|
| 136 | - $html .= '</th></tr></thead>'; |
|
| 137 | - $html .= '<tbody><tr>'; |
|
| 138 | - foreach ($columns as $column) { |
|
| 139 | - $html .= '<td class="list_value"><ul>'; |
|
| 140 | - foreach ($column as $item) { |
|
| 141 | - $html .= '<li><a href="' . $item->getURL() . '" class="list_item">' . $item->getPlaceName() . '</a></li>'; |
|
| 142 | - if ($gm_module && $gm_module->getPreference('GM_PLACE_HIERARCHY')) { |
|
| 143 | - list($tmp) = explode(', ', $item->getGedcomName(), 2); |
|
| 144 | - $place_names[] = $tmp; |
|
| 119 | + if ($numfound > 0) { |
|
| 120 | + if ($numfound > 20) { |
|
| 121 | + $divisor = 3; |
|
| 122 | + } elseif ($numfound > 4) { |
|
| 123 | + $divisor = 2; |
|
| 124 | + } else { |
|
| 125 | + $divisor = 1; |
|
| 126 | + } |
|
| 127 | + |
|
| 128 | + $columns = array_chunk($child_places, ceil($numfound / $divisor)); |
|
| 129 | + $html = '<table id="place_hierarchy" class="list_table"><thead><tr><th class="list_label" colspan="' . $divisor . '">'; |
|
| 130 | + $html .= '<i class="icon-place"></i> '; |
|
| 131 | + if ($place_id) { |
|
| 132 | + $html .= I18N::translate('Places in %s', $place->getPlaceName()); |
|
| 133 | + } else { |
|
| 134 | + $html .= I18N::translate('Place hierarchy'); |
|
| 135 | + } |
|
| 136 | + $html .= '</th></tr></thead>'; |
|
| 137 | + $html .= '<tbody><tr>'; |
|
| 138 | + foreach ($columns as $column) { |
|
| 139 | + $html .= '<td class="list_value"><ul>'; |
|
| 140 | + foreach ($column as $item) { |
|
| 141 | + $html .= '<li><a href="' . $item->getURL() . '" class="list_item">' . $item->getPlaceName() . '</a></li>'; |
|
| 142 | + if ($gm_module && $gm_module->getPreference('GM_PLACE_HIERARCHY')) { |
|
| 143 | + list($tmp) = explode(', ', $item->getGedcomName(), 2); |
|
| 144 | + $place_names[] = $tmp; |
|
| 145 | + } |
|
| 145 | 146 | } |
| 147 | + $html .= '</ul></td>'; |
|
| 146 | 148 | } |
| 147 | - $html .= '</ul></td>'; |
|
| 148 | - } |
|
| 149 | - $html .= '</tr></tbody>'; |
|
| 150 | - if ($numfound > 0 && $action == 'find' && $place_id) { |
|
| 151 | - $html .= '<tfoot><tr><td class="list_label" colspan="' . $divisor . '">'; |
|
| 152 | - $html .= I18N::translate('View all records found in this place'); |
|
| 153 | - $html .= '</td></tr><tr><td class="list_value" colspan="' . $divisor . '" style="text-align: center;">'; |
|
| 154 | - $html .= '<a href="' . $place->getURL() . '&action=show" class="formField">' . $place->getPlaceName() . '</a>'; |
|
| 155 | - $html .= '</td></tr></tfoot>'; |
|
| 149 | + $html .= '</tr></tbody>'; |
|
| 150 | + if ($numfound > 0 && $action == 'find' && $place_id) { |
|
| 151 | + $html .= '<tfoot><tr><td class="list_label" colspan="' . $divisor . '">'; |
|
| 152 | + $html .= I18N::translate('View all records found in this place'); |
|
| 153 | + $html .= '</td></tr><tr><td class="list_value" colspan="' . $divisor . '" style="text-align: center;">'; |
|
| 154 | + $html .= '<a href="' . $place->getURL() . '&action=show" class="formField">' . $place->getPlaceName() . '</a>'; |
|
| 155 | + $html .= '</td></tr></tfoot>'; |
|
| 156 | + } |
|
| 157 | + $html .= '</table>'; |
|
| 158 | + // -- echo the array |
|
| 159 | + echo $html; |
|
| 156 | 160 | } |
| 157 | - $html .= '</table>'; |
|
| 158 | - // -- echo the array |
|
| 159 | - echo $html; |
|
| 160 | - } |
|
| 161 | - if ($place_id && $action == 'show') { |
|
| 162 | - // -- array of names |
|
| 163 | - $myindilist = []; |
|
| 164 | - $myfamlist = []; |
|
| 165 | - |
|
| 166 | - $positions = |
|
| 167 | - Database::prepare("SELECT DISTINCT pl_gid FROM `##placelinks` WHERE pl_p_id=? AND pl_file=?") |
|
| 168 | - ->execute([$place_id, $WT_TREE->getTreeId()]) |
|
| 169 | - ->fetchOneColumn(); |
|
| 170 | - |
|
| 171 | - foreach ($positions as $position) { |
|
| 172 | - $record = GedcomRecord::getInstance($position, $WT_TREE); |
|
| 173 | - if ($record && $record->canShow()) { |
|
| 174 | - if ($record instanceof Individual) { |
|
| 175 | - $myindilist[] = $record; |
|
| 176 | - } |
|
| 177 | - if ($record instanceof Family) { |
|
| 178 | - $myfamlist[] = $record; |
|
| 161 | + if ($place_id && $action == 'show') { |
|
| 162 | + // -- array of names |
|
| 163 | + $myindilist = []; |
|
| 164 | + $myfamlist = []; |
|
| 165 | + |
|
| 166 | + $positions = |
|
| 167 | + Database::prepare("SELECT DISTINCT pl_gid FROM `##placelinks` WHERE pl_p_id=? AND pl_file=?") |
|
| 168 | + ->execute([$place_id, $WT_TREE->getTreeId()]) |
|
| 169 | + ->fetchOneColumn(); |
|
| 170 | + |
|
| 171 | + foreach ($positions as $position) { |
|
| 172 | + $record = GedcomRecord::getInstance($position, $WT_TREE); |
|
| 173 | + if ($record && $record->canShow()) { |
|
| 174 | + if ($record instanceof Individual) { |
|
| 175 | + $myindilist[] = $record; |
|
| 176 | + } |
|
| 177 | + if ($record instanceof Family) { |
|
| 178 | + $myfamlist[] = $record; |
|
| 179 | + } |
|
| 179 | 180 | } |
| 180 | 181 | } |
| 181 | - } |
|
| 182 | - echo '<br>'; |
|
| 182 | + echo '<br>'; |
|
| 183 | 183 | |
| 184 | - ?> |
|
| 184 | + ?> |
|
| 185 | 185 | <ul class="nav nav-tabs" role="tablist"> |
| 186 | 186 | <li class="nav-item"> |
| 187 | 187 | <a class="nav-link active<?= empty($myindilist) ? ' text-muted' : '' ?>" data-toggle="tab" role="tab" href="#individuals"> |
| 188 | 188 | <?= I18N::translate('Individuals') ?> |
| 189 | - <?= Bootstrap4::badgeCount($myindilist) ?> |
|
| 189 | + <?= Bootstrap4::badgeCount($myindilist) ?> |
|
| 190 | 190 | </a> |
| 191 | 191 | </li> |
| 192 | 192 | <li class="nav-item"> |
| 193 | 193 | <a class="nav-link<?= empty($myfamlist) ? ' text-muted' : '' ?>" data-toggle="tab" role="tab" href="#families"> |
| 194 | 194 | <?= I18N::translate('Families') ?> |
| 195 | - <?= Bootstrap4::badgeCount($myfamlist) ?> |
|
| 195 | + <?= Bootstrap4::badgeCount($myfamlist) ?> |
|
| 196 | 196 | </a> |
| 197 | 197 | </li> |
| 198 | 198 | </ul> |
| 199 | 199 | <div class="tab-content"> |
| 200 | 200 | <div class="tab-pane fade show active" role="tabpanel" id="individuals"> |
| 201 | 201 | <?php if (empty($myindilist)): ?> |
| 202 | - <p><?= I18N::translate('No results found.') ?></p> |
|
| 202 | + <p><?= I18N::translate('No results found.') ?></p> |
|
| 203 | 203 | <?php else: ?> |
| 204 | - <?= FunctionsPrintLists::individualTable($myindilist) ?> |
|
| 205 | - <?php endif ?> |
|
| 204 | + <?= FunctionsPrintLists::individualTable($myindilist) ?> |
|
| 205 | + <?php endif ?> |
|
| 206 | 206 | </div> |
| 207 | 207 | |
| 208 | 208 | <div class="tab-pane fade" role="tabpanel" id="families"> |
| 209 | 209 | <?php if (empty($myfamlist)): ?> |
| 210 | - <p><?= I18N::translate('No results found.') ?></p> |
|
| 210 | + <p><?= I18N::translate('No results found.') ?></p> |
|
| 211 | 211 | <?php else: ?> |
| 212 | - <?= FunctionsPrintLists::familyTable($myfamlist) ?> |
|
| 213 | - <?php endif ?> |
|
| 212 | + <?= FunctionsPrintLists::familyTable($myfamlist) ?> |
|
| 213 | + <?php endif ?> |
|
| 214 | 214 | </div> |
| 215 | 215 | </div> |
| 216 | 216 | <?php |
| 217 | - } |
|
| 218 | - echo '<h4><a href="placelist.php?display=list">', I18N::translate('Show all places in a list'), '</a></h4>'; |
|
| 217 | + } |
|
| 218 | + echo '<h4><a href="placelist.php?display=list">', I18N::translate('Show all places in a list'), '</a></h4>'; |
|
| 219 | 219 | |
| 220 | - if ($gm_module && $gm_module->getPreference('GM_PLACE_HIERARCHY')) { |
|
| 221 | - $gm_module->mapScripts($numfound, $level, $parent, $linklevels, $place_names); |
|
| 222 | - } |
|
| 223 | - break; |
|
| 220 | + if ($gm_module && $gm_module->getPreference('GM_PLACE_HIERARCHY')) { |
|
| 221 | + $gm_module->mapScripts($numfound, $level, $parent, $linklevels, $place_names); |
|
| 222 | + } |
|
| 223 | + break; |
|
| 224 | 224 | } |
| 225 | 225 | |
| 226 | 226 | echo '</div>'; // <div id="place-hierarchy"> |
@@ -146,7 +146,8 @@ discard block |
||
| 146 | 146 | value="<?= Html::escape($controller->getValue($i)) ?>"> |
| 147 | 147 | <?php if (preg_match('/^NAME:/', $currentFieldSearch) > 0): ?> |
| 148 | 148 | <select class="form-control form-control-sm col-3" name="fields[<?= $i ?>]"> |
| 149 | - <option value="<?= $currentField ?>:EXACT" <?php if (preg_match('/:EXACT$/', $currentFieldSearch) > 0) echo 'selected' ?>> |
|
| 149 | + <option value="<?= $currentField ?>:EXACT" <?php if (preg_match('/:EXACT$/', $currentFieldSearch) > 0) { |
|
| 150 | + echo 'selected' ?>> |
|
| 150 | 151 | <?= I18N::translate('Exact') ?> |
| 151 | 152 | </option> |
| 152 | 153 | <option value="<?= $currentField ?>:BEGINS" <?php if (preg_match('/:BEGINS$/', $currentFieldSearch) > 0) echo 'selected' ?>> |
@@ -161,13 +162,15 @@ discard block |
||
| 161 | 162 | <?php else: ?> |
| 162 | 163 | <input type="hidden" name="fields[<?= $i ?>]" value="<?= $controller->getField($i) ?>"> |
| 163 | 164 | <?php endif; |
| 165 | +} |
|
| 164 | 166 | if (preg_match('/:DATE$/', $currentFieldSearch) > 0) { |
| 165 | 167 | ?> |
| 166 | 168 | <select class="form-control form-control-sm col-3" name="plusminus[<?= $i ?>]"> |
| 167 | 169 | <option value=""> |
| 168 | 170 | <?= I18N::translate('Exact date') ?> |
| 169 | 171 | </option> |
| 170 | - <option value="2" <?php if (!empty($controller->plusminus[$i]) && $controller->plusminus[$i] == 2) echo 'selected' ?>> |
|
| 172 | + <option value="2" <?php if (!empty($controller->plusminus[$i]) && $controller->plusminus[$i] == 2) { |
|
| 173 | + echo 'selected' ?>> |
|
| 171 | 174 | <?= I18N::plural('±%s year', '±%s years', 2, I18N::number(2)) ?> |
| 172 | 175 | </option> |
| 173 | 176 | <option value="5" <?php if (!empty($controller->plusminus[$i]) && $controller->plusminus[$i] == 5) echo 'selected' ?>> |
@@ -183,6 +186,7 @@ discard block |
||
| 183 | 186 | //-- relative fields |
| 184 | 187 | if ($i == 0 && $fct > 4) { |
| 185 | 188 | $j = $fct; |
| 189 | +} |
|
| 186 | 190 | // Get the current options for Father’s and Mother’s name searches |
| 187 | 191 | $fatherGivnOption = 'SDX'; |
| 188 | 192 | $fatherSurnOption = 'SDX'; |
@@ -192,18 +192,18 @@ |
||
| 192 | 192 | $searchField = $controller->getField($k); |
| 193 | 193 | $searchOption = substr($searchField, 20); // Assume we have something like "FAMC:HUSB:NAME:GIVN:foo" |
| 194 | 194 | switch (substr($searchField, 0, 20)) { |
| 195 | - case 'FAMC:HUSB:NAME:GIVN:': |
|
| 196 | - $fatherGivnOption = $searchOption; |
|
| 197 | - break; |
|
| 198 | - case 'FAMC:HUSB:NAME:SURN:': |
|
| 199 | - $fatherSurnOption = $searchOption; |
|
| 200 | - break; |
|
| 201 | - case 'FAMC:WIFE:NAME:GIVN:': |
|
| 202 | - $motherGivnOption = $searchOption; |
|
| 203 | - break; |
|
| 204 | - case 'FAMC:WIFE:NAME:SURN:': |
|
| 205 | - $motherSurnOption = $searchOption; |
|
| 206 | - break; |
|
| 195 | + case 'FAMC:HUSB:NAME:GIVN:': |
|
| 196 | + $fatherGivnOption = $searchOption; |
|
| 197 | + break; |
|
| 198 | + case 'FAMC:HUSB:NAME:SURN:': |
|
| 199 | + $fatherSurnOption = $searchOption; |
|
| 200 | + break; |
|
| 201 | + case 'FAMC:WIFE:NAME:GIVN:': |
|
| 202 | + $motherGivnOption = $searchOption; |
|
| 203 | + break; |
|
| 204 | + case 'FAMC:WIFE:NAME:SURN:': |
|
| 205 | + $motherSurnOption = $searchOption; |
|
| 206 | + break; |
|
| 207 | 207 | } |
| 208 | 208 | } |
| 209 | 209 | } |
@@ -141,7 +141,8 @@ discard block |
||
| 141 | 141 | <div class="small"> |
| 142 | 142 | <?= $spouse->getLifeSpan() ?> |
| 143 | 143 | </div> |
| 144 | - <?php else: ?> |
|
| 144 | + <?php else { |
|
| 145 | + : ?> |
|
| 145 | 146 | <?= $spouse->getFullName() ?> |
| 146 | 147 | <?php endif ?> |
| 147 | 148 | </td> |
@@ -151,6 +152,7 @@ discard block |
||
| 151 | 152 | |
| 152 | 153 | foreach ($family->getChildren() as $child) { |
| 153 | 154 | $icon = $controller->record === $child ? '<i class="icon-selected"></i>' : ''; |
| 155 | +} |
|
| 154 | 156 | $menu = new Menu($icon . Functions::getCloseRelationshipName($controller->record, $child)); |
| 155 | 157 | $menu->addSubmenu(new Menu($this->getFamily($child))); |
| 156 | 158 | ?> |
@@ -168,7 +170,8 @@ discard block |
||
| 168 | 170 | <div class="small"> |
| 169 | 171 | <?= $child->getLifeSpan() ?> |
| 170 | 172 | </div> |
| 171 | - <?php else: ?> |
|
| 173 | + <?php else { |
|
| 174 | + : ?> |
|
| 172 | 175 | <?= $child->getFullName() ?> |
| 173 | 176 | <?php endif ?> |
| 174 | 177 | </td> |
@@ -192,6 +195,7 @@ discard block |
||
| 192 | 195 | private function getHTML($person, $showUnknown = false) { |
| 193 | 196 | if ($person instanceof Individual) { |
| 194 | 197 | return sprintf(self::LNK, $person->getHtmlUrl(), $person->getFullName()); |
| 198 | +} |
|
| 195 | 199 | } elseif ($showUnknown) { |
| 196 | 200 | return sprintf(self::MSG, I18N::translate('unknown')); |
| 197 | 201 | } else { |
@@ -82,7 +82,8 @@ discard block |
||
| 82 | 82 | <?php if ($ancestors_only === '1'): ?> |
| 83 | 83 | <input type="hidden" name="ancestors" value="1"> |
| 84 | 84 | <?= I18N::translate('Find relationships via ancestors') ?> |
| 85 | - <?php else: ?> |
|
| 85 | + <?php else { |
|
| 86 | + : ?> |
|
| 86 | 87 | <?= Bootstrap4::radioButtons('ancestors', ['0' => I18N::translate('Find any relationship'), '1' => I18N::translate('Find relationships via ancestors')], $ancestors, false) ?> |
| 87 | 88 | <?php endif ?> |
| 88 | 89 | </div> |
@@ -116,6 +117,7 @@ discard block |
||
| 116 | 117 | if ($person1 && $person2) { |
| 117 | 118 | if (I18N::direction() === 'ltr') { |
| 118 | 119 | $diagonal1 = Theme::theme()->parameter('image-dline'); |
| 120 | +} |
|
| 119 | 121 | $diagonal2 = Theme::theme()->parameter('image-dline2'); |
| 120 | 122 | } else { |
| 121 | 123 | $diagonal1 = Theme::theme()->parameter('image-dline2'); |
@@ -146,39 +146,39 @@ |
||
| 146 | 146 | foreach ($path as $n => $xref) { |
| 147 | 147 | if ($n % 2 === 1) { |
| 148 | 148 | switch ($relationships[$n]) { |
| 149 | - case 'hus': |
|
| 150 | - case 'wif': |
|
| 151 | - case 'spo': |
|
| 152 | - case 'bro': |
|
| 153 | - case 'sis': |
|
| 154 | - case 'sib': |
|
| 155 | - $table[$x + 1][$y] = '<div style="background:url(' . Theme::theme()->parameter('image-hline') . ') repeat-x center; width: 94px; text-align: center"><div class="hline-text" style="height: 32px;">' . Functions::getRelationshipNameFromPath($relationships[$n], Individual::getInstance($path[$n - 1], $controller->tree()), Individual::getInstance($path[$n + 1], $controller->tree())) . '</div><div style="height: 32px;">' . FontAwesome::decorativeIcon('arrow-end') . '</div></div>'; |
|
| 156 | - $x += 2; |
|
| 157 | - break; |
|
| 158 | - case 'son': |
|
| 159 | - case 'dau': |
|
| 160 | - case 'chi': |
|
| 161 | - if ($n > 2 && preg_match('/fat|mot|par/', $relationships[$n - 2])) { |
|
| 162 | - $table[$x + 1][$y - 1] = '<div style="background:url(' . $diagonal2 . '); width: 64px; height: 64px; text-align: center;"><div style="height: 32px; text-align: end;">' . Functions::getRelationshipNameFromPath($relationships[$n], Individual::getInstance($path[$n - 1], $controller->tree()), Individual::getInstance($path[$n + 1], $controller->tree())) . '</div><div style="height: 32px; text-align: start;">' . FontAwesome::decorativeIcon('arrow-down') . '</div></div>'; |
|
| 149 | + case 'hus': |
|
| 150 | + case 'wif': |
|
| 151 | + case 'spo': |
|
| 152 | + case 'bro': |
|
| 153 | + case 'sis': |
|
| 154 | + case 'sib': |
|
| 155 | + $table[$x + 1][$y] = '<div style="background:url(' . Theme::theme()->parameter('image-hline') . ') repeat-x center; width: 94px; text-align: center"><div class="hline-text" style="height: 32px;">' . Functions::getRelationshipNameFromPath($relationships[$n], Individual::getInstance($path[$n - 1], $controller->tree()), Individual::getInstance($path[$n + 1], $controller->tree())) . '</div><div style="height: 32px;">' . FontAwesome::decorativeIcon('arrow-end') . '</div></div>'; |
|
| 163 | 156 | $x += 2; |
| 164 | - } else { |
|
| 165 | - $table[$x][$y - 1] = '<div style="background:url(' . Theme::theme() |
|
| 166 | - ->parameter('image-vline') . ') repeat-y center; height: 64px; text-align: center;"><div class="vline-text" style="display: inline-block; width:50%; line-height: 64px;">' . Functions::getRelationshipNameFromPath($relationships[$n], Individual::getInstance($path[$n - 1], $controller->tree()), Individual::getInstance($path[$n + 1], $controller->tree())) . '</div><div style="display: inline-block; width:50%; line-height: 64px;">' . FontAwesome::decorativeIcon('arrow-down') . '</div></div>'; |
|
| 167 | - } |
|
| 168 | - $y -= 2; |
|
| 169 | - break; |
|
| 170 | - case 'fat': |
|
| 171 | - case 'mot': |
|
| 172 | - case 'par': |
|
| 173 | - if ($n > 2 && preg_match('/son|dau|chi/', $relationships[$n - 2])) { |
|
| 174 | - $table[$x + 1][$y + 1] = '<div style="background:url(' . $diagonal1 . '); background-position: top right; width: 64px; height: 64px; text-align: center;"><div style="height: 32px; text-align: start;">' . Functions::getRelationshipNameFromPath($relationships[$n], Individual::getInstance($path[$n - 1], $controller->tree()), Individual::getInstance($path[$n + 1], $controller->tree())) . '</div><div style="height: 32px; text-align: end;">' . FontAwesome::decorativeIcon('arrow-down') . '</div></div>'; |
|
| 175 | - $x += 2; |
|
| 176 | - } else { |
|
| 177 | - $table[$x][$y + 1] = '<div style="background:url(' . Theme::theme() |
|
| 178 | - ->parameter('image-vline') . ') repeat-y center; height: 64px; text-align:center; "><div class="vline-text" style="display: inline-block; width: 50%; line-height: 32px;">' . Functions::getRelationshipNameFromPath($relationships[$n], Individual::getInstance($path[$n - 1], $controller->tree()), Individual::getInstance($path[$n + 1], $controller->tree())) . '</div><div style="display: inline-block; width: 50%; line-height: 32px">' . FontAwesome::decorativeIcon('arrow-up') . '</div></div>'; |
|
| 179 | - } |
|
| 180 | - $y += 2; |
|
| 181 | - break; |
|
| 157 | + break; |
|
| 158 | + case 'son': |
|
| 159 | + case 'dau': |
|
| 160 | + case 'chi': |
|
| 161 | + if ($n > 2 && preg_match('/fat|mot|par/', $relationships[$n - 2])) { |
|
| 162 | + $table[$x + 1][$y - 1] = '<div style="background:url(' . $diagonal2 . '); width: 64px; height: 64px; text-align: center;"><div style="height: 32px; text-align: end;">' . Functions::getRelationshipNameFromPath($relationships[$n], Individual::getInstance($path[$n - 1], $controller->tree()), Individual::getInstance($path[$n + 1], $controller->tree())) . '</div><div style="height: 32px; text-align: start;">' . FontAwesome::decorativeIcon('arrow-down') . '</div></div>'; |
|
| 163 | + $x += 2; |
|
| 164 | + } else { |
|
| 165 | + $table[$x][$y - 1] = '<div style="background:url(' . Theme::theme() |
|
| 166 | + ->parameter('image-vline') . ') repeat-y center; height: 64px; text-align: center;"><div class="vline-text" style="display: inline-block; width:50%; line-height: 64px;">' . Functions::getRelationshipNameFromPath($relationships[$n], Individual::getInstance($path[$n - 1], $controller->tree()), Individual::getInstance($path[$n + 1], $controller->tree())) . '</div><div style="display: inline-block; width:50%; line-height: 64px;">' . FontAwesome::decorativeIcon('arrow-down') . '</div></div>'; |
|
| 167 | + } |
|
| 168 | + $y -= 2; |
|
| 169 | + break; |
|
| 170 | + case 'fat': |
|
| 171 | + case 'mot': |
|
| 172 | + case 'par': |
|
| 173 | + if ($n > 2 && preg_match('/son|dau|chi/', $relationships[$n - 2])) { |
|
| 174 | + $table[$x + 1][$y + 1] = '<div style="background:url(' . $diagonal1 . '); background-position: top right; width: 64px; height: 64px; text-align: center;"><div style="height: 32px; text-align: start;">' . Functions::getRelationshipNameFromPath($relationships[$n], Individual::getInstance($path[$n - 1], $controller->tree()), Individual::getInstance($path[$n + 1], $controller->tree())) . '</div><div style="height: 32px; text-align: end;">' . FontAwesome::decorativeIcon('arrow-down') . '</div></div>'; |
|
| 175 | + $x += 2; |
|
| 176 | + } else { |
|
| 177 | + $table[$x][$y + 1] = '<div style="background:url(' . Theme::theme() |
|
| 178 | + ->parameter('image-vline') . ') repeat-y center; height: 64px; text-align:center; "><div class="vline-text" style="display: inline-block; width: 50%; line-height: 32px;">' . Functions::getRelationshipNameFromPath($relationships[$n], Individual::getInstance($path[$n - 1], $controller->tree()), Individual::getInstance($path[$n + 1], $controller->tree())) . '</div><div style="display: inline-block; width: 50%; line-height: 32px">' . FontAwesome::decorativeIcon('arrow-up') . '</div></div>'; |
|
| 179 | + } |
|
| 180 | + $y += 2; |
|
| 181 | + break; |
|
| 182 | 182 | } |
| 183 | 183 | $max_x = max($max_x, $x); |
| 184 | 184 | $min_y = min($min_y, $y); |
@@ -123,7 +123,8 @@ discard block |
||
| 123 | 123 | <div class="form-control"><?= Html::escape(Auth::user()->getRealName()) ?></div> |
| 124 | 124 | </div> |
| 125 | 125 | </div> |
| 126 | - <?php else: ?> |
|
| 126 | + <?php else { |
|
| 127 | + : ?> |
|
| 127 | 128 | <div class="form-group row"> |
| 128 | 129 | <label class="col-sm-3 col-form-label" for="from-name"> |
| 129 | 130 | <?= I18N::translate('Your name') ?> |
@@ -181,6 +182,7 @@ discard block |
||
| 181 | 182 | function recipients($to) { |
| 182 | 183 | if ($to === 'all') { |
| 183 | 184 | $recipients = User::all(); |
| 185 | +} |
|
| 184 | 186 | } elseif ($to === 'last_6mo') { |
| 185 | 187 | $recipients = array_filter(User::all(), function(User $user) { |
| 186 | 188 | return $user->getPreference('sessiontime') > 0 && WT_TIMESTAMP - $user->getPreference('sessiontime') > 60 * 60 * 24 * 30 * 6; |
@@ -35,72 +35,72 @@ discard block |
||
| 35 | 35 | $url = Filter::get('url', null, 'index.php'); |
| 36 | 36 | |
| 37 | 37 | switch ($action) { |
| 38 | -case 'reject': |
|
| 39 | - $gedcom_id = Database::prepare("SELECT gedcom_id FROM `##change` WHERE change_id=?")->execute([$change_id])->fetchOne(); |
|
| 40 | - $xref = Database::prepare("SELECT xref FROM `##change` WHERE change_id=?")->execute([$change_id])->fetchOne(); |
|
| 41 | - // Reject a change, and subsequent changes to the same record |
|
| 42 | - Database::prepare( |
|
| 43 | - "UPDATE `##change`" . |
|
| 44 | - " SET status = 'rejected'" . |
|
| 45 | - " WHERE status = 'pending'" . |
|
| 46 | - " AND gedcom_id = ?" . |
|
| 47 | - " AND xref = ?" . |
|
| 48 | - " AND change_id >= ?" |
|
| 49 | - )->execute([$gedcom_id, $xref, $change_id]); |
|
| 50 | - break; |
|
| 51 | -case 'accept': |
|
| 52 | - $gedcom_id = Database::prepare("SELECT gedcom_id FROM `##change` WHERE change_id=?")->execute([$change_id])->fetchOne(); |
|
| 53 | - $xref = Database::prepare("SELECT xref FROM `##change` WHERE change_id=?")->execute([$change_id])->fetchOne(); |
|
| 54 | - // Accept a change, and all previous changes to the same record |
|
| 55 | - $all_changes = Database::prepare( |
|
| 56 | - "SELECT change_id, gedcom_id, gedcom_name, xref, old_gedcom, new_gedcom" . |
|
| 57 | - " FROM `##change` c" . |
|
| 58 | - " JOIN `##gedcom` g USING (gedcom_id)" . |
|
| 59 | - " WHERE c.status = 'pending'" . |
|
| 60 | - " AND gedcom_id = ?" . |
|
| 61 | - " AND xref = ?" . |
|
| 62 | - " AND change_id <= ?" . |
|
| 63 | - " ORDER BY change_id" |
|
| 64 | - )->execute([$gedcom_id, $xref, $change_id])->fetchAll(); |
|
| 65 | - foreach ($all_changes as $change) { |
|
| 66 | - if (empty($change->new_gedcom)) { |
|
| 67 | - // delete |
|
| 68 | - FunctionsImport::updateRecord($change->old_gedcom, $gedcom_id, true); |
|
| 69 | - } else { |
|
| 70 | - // add/update |
|
| 71 | - FunctionsImport::updateRecord($change->new_gedcom, $gedcom_id, false); |
|
| 38 | + case 'reject': |
|
| 39 | + $gedcom_id = Database::prepare("SELECT gedcom_id FROM `##change` WHERE change_id=?")->execute([$change_id])->fetchOne(); |
|
| 40 | + $xref = Database::prepare("SELECT xref FROM `##change` WHERE change_id=?")->execute([$change_id])->fetchOne(); |
|
| 41 | + // Reject a change, and subsequent changes to the same record |
|
| 42 | + Database::prepare( |
|
| 43 | + "UPDATE `##change`" . |
|
| 44 | + " SET status = 'rejected'" . |
|
| 45 | + " WHERE status = 'pending'" . |
|
| 46 | + " AND gedcom_id = ?" . |
|
| 47 | + " AND xref = ?" . |
|
| 48 | + " AND change_id >= ?" |
|
| 49 | + )->execute([$gedcom_id, $xref, $change_id]); |
|
| 50 | + break; |
|
| 51 | + case 'accept': |
|
| 52 | + $gedcom_id = Database::prepare("SELECT gedcom_id FROM `##change` WHERE change_id=?")->execute([$change_id])->fetchOne(); |
|
| 53 | + $xref = Database::prepare("SELECT xref FROM `##change` WHERE change_id=?")->execute([$change_id])->fetchOne(); |
|
| 54 | + // Accept a change, and all previous changes to the same record |
|
| 55 | + $all_changes = Database::prepare( |
|
| 56 | + "SELECT change_id, gedcom_id, gedcom_name, xref, old_gedcom, new_gedcom" . |
|
| 57 | + " FROM `##change` c" . |
|
| 58 | + " JOIN `##gedcom` g USING (gedcom_id)" . |
|
| 59 | + " WHERE c.status = 'pending'" . |
|
| 60 | + " AND gedcom_id = ?" . |
|
| 61 | + " AND xref = ?" . |
|
| 62 | + " AND change_id <= ?" . |
|
| 63 | + " ORDER BY change_id" |
|
| 64 | + )->execute([$gedcom_id, $xref, $change_id])->fetchAll(); |
|
| 65 | + foreach ($all_changes as $change) { |
|
| 66 | + if (empty($change->new_gedcom)) { |
|
| 67 | + // delete |
|
| 68 | + FunctionsImport::updateRecord($change->old_gedcom, $gedcom_id, true); |
|
| 69 | + } else { |
|
| 70 | + // add/update |
|
| 71 | + FunctionsImport::updateRecord($change->new_gedcom, $gedcom_id, false); |
|
| 72 | + } |
|
| 73 | + Database::prepare("UPDATE `##change` SET status='accepted' WHERE change_id=?")->execute([$change->change_id]); |
|
| 74 | + Log::addEditLog("Accepted change {$change->change_id} for {$change->xref} / {$change->gedcom_name} into database"); |
|
| 72 | 75 | } |
| 73 | - Database::prepare("UPDATE `##change` SET status='accepted' WHERE change_id=?")->execute([$change->change_id]); |
|
| 74 | - Log::addEditLog("Accepted change {$change->change_id} for {$change->xref} / {$change->gedcom_name} into database"); |
|
| 75 | - } |
|
| 76 | - break; |
|
| 77 | -case 'rejectall': |
|
| 78 | - Database::prepare( |
|
| 79 | - "UPDATE `##change`" . |
|
| 80 | - " SET status='rejected'" . |
|
| 81 | - " WHERE status='pending' AND gedcom_id=?" |
|
| 82 | - )->execute([$WT_TREE->getTreeId()]); |
|
| 83 | - break; |
|
| 84 | -case 'acceptall': |
|
| 85 | - $all_changes = Database::prepare( |
|
| 86 | - "SELECT change_id, gedcom_id, gedcom_name, xref, old_gedcom, new_gedcom" . |
|
| 87 | - " FROM `##change` c" . |
|
| 88 | - " JOIN `##gedcom` g USING (gedcom_id)" . |
|
| 89 | - " WHERE c.status='pending' AND gedcom_id=?" . |
|
| 90 | - " ORDER BY change_id" |
|
| 91 | - )->execute([$WT_TREE->getTreeId()])->fetchAll(); |
|
| 92 | - foreach ($all_changes as $change) { |
|
| 93 | - if (empty($change->new_gedcom)) { |
|
| 94 | - // delete |
|
| 95 | - FunctionsImport::updateRecord($change->old_gedcom, $change->gedcom_id, true); |
|
| 96 | - } else { |
|
| 97 | - // add/update |
|
| 98 | - FunctionsImport::updateRecord($change->new_gedcom, $change->gedcom_id, false); |
|
| 76 | + break; |
|
| 77 | + case 'rejectall': |
|
| 78 | + Database::prepare( |
|
| 79 | + "UPDATE `##change`" . |
|
| 80 | + " SET status='rejected'" . |
|
| 81 | + " WHERE status='pending' AND gedcom_id=?" |
|
| 82 | + )->execute([$WT_TREE->getTreeId()]); |
|
| 83 | + break; |
|
| 84 | + case 'acceptall': |
|
| 85 | + $all_changes = Database::prepare( |
|
| 86 | + "SELECT change_id, gedcom_id, gedcom_name, xref, old_gedcom, new_gedcom" . |
|
| 87 | + " FROM `##change` c" . |
|
| 88 | + " JOIN `##gedcom` g USING (gedcom_id)" . |
|
| 89 | + " WHERE c.status='pending' AND gedcom_id=?" . |
|
| 90 | + " ORDER BY change_id" |
|
| 91 | + )->execute([$WT_TREE->getTreeId()])->fetchAll(); |
|
| 92 | + foreach ($all_changes as $change) { |
|
| 93 | + if (empty($change->new_gedcom)) { |
|
| 94 | + // delete |
|
| 95 | + FunctionsImport::updateRecord($change->old_gedcom, $change->gedcom_id, true); |
|
| 96 | + } else { |
|
| 97 | + // add/update |
|
| 98 | + FunctionsImport::updateRecord($change->new_gedcom, $change->gedcom_id, false); |
|
| 99 | + } |
|
| 100 | + Database::prepare("UPDATE `##change` SET status='accepted' WHERE change_id=?")->execute([$change->change_id]); |
|
| 101 | + Log::addEditLog("Accepted change {$change->change_id} for {$change->xref} / {$change->gedcom_name} into database"); |
|
| 99 | 102 | } |
| 100 | - Database::prepare("UPDATE `##change` SET status='accepted' WHERE change_id=?")->execute([$change->change_id]); |
|
| 101 | - Log::addEditLog("Accepted change {$change->change_id} for {$change->xref} / {$change->gedcom_name} into database"); |
|
| 102 | - } |
|
| 103 | - break; |
|
| 103 | + break; |
|
| 104 | 104 | } |
| 105 | 105 | |
| 106 | 106 | $rows = Database::prepare( |
@@ -120,27 +120,27 @@ discard block |
||
| 120 | 120 | preg_match('/^0 (?:@' . WT_REGEX_XREF . '@ )?(' . WT_REGEX_TAG . ')/', $row->old_gedcom . $row->new_gedcom, $match); |
| 121 | 121 | |
| 122 | 122 | switch ($match[1]) { |
| 123 | - case 'INDI': |
|
| 124 | - $row->record = new Individual($row->xref, $row->old_gedcom, $row->new_gedcom, $tree); |
|
| 125 | - break; |
|
| 126 | - case 'FAM': |
|
| 127 | - $row->record = new Family($row->xref, $row->old_gedcom, $row->new_gedcom, $tree); |
|
| 128 | - break; |
|
| 129 | - case 'SOUR': |
|
| 130 | - $row->record = new Source($row->xref, $row->old_gedcom, $row->new_gedcom, $tree); |
|
| 131 | - break; |
|
| 132 | - case 'REPO': |
|
| 133 | - $row->record = new Repository($row->xref, $row->old_gedcom, $row->new_gedcom, $tree); |
|
| 134 | - break; |
|
| 135 | - case 'OBJE': |
|
| 136 | - $row->record = new Media($row->xref, $row->old_gedcom, $row->new_gedcom, $tree); |
|
| 137 | - break; |
|
| 138 | - case 'NOTE': |
|
| 139 | - $row->record = new Note($row->xref, $row->old_gedcom, $row->new_gedcom, $tree); |
|
| 140 | - break; |
|
| 141 | - default: |
|
| 142 | - $row->record = new GedcomRecord($row->xref, $row->old_gedcom, $row->new_gedcom, $tree); |
|
| 143 | - break; |
|
| 123 | + case 'INDI': |
|
| 124 | + $row->record = new Individual($row->xref, $row->old_gedcom, $row->new_gedcom, $tree); |
|
| 125 | + break; |
|
| 126 | + case 'FAM': |
|
| 127 | + $row->record = new Family($row->xref, $row->old_gedcom, $row->new_gedcom, $tree); |
|
| 128 | + break; |
|
| 129 | + case 'SOUR': |
|
| 130 | + $row->record = new Source($row->xref, $row->old_gedcom, $row->new_gedcom, $tree); |
|
| 131 | + break; |
|
| 132 | + case 'REPO': |
|
| 133 | + $row->record = new Repository($row->xref, $row->old_gedcom, $row->new_gedcom, $tree); |
|
| 134 | + break; |
|
| 135 | + case 'OBJE': |
|
| 136 | + $row->record = new Media($row->xref, $row->old_gedcom, $row->new_gedcom, $tree); |
|
| 137 | + break; |
|
| 138 | + case 'NOTE': |
|
| 139 | + $row->record = new Note($row->xref, $row->old_gedcom, $row->new_gedcom, $tree); |
|
| 140 | + break; |
|
| 141 | + default: |
|
| 142 | + $row->record = new GedcomRecord($row->xref, $row->old_gedcom, $row->new_gedcom, $tree); |
|
| 143 | + break; |
|
| 144 | 144 | } |
| 145 | 145 | |
| 146 | 146 | $row->accept_url = Html::url('edit_changes.php', [ |