summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfisharebest <fisharebest@gmail.com>2011-10-21 15:03:42 +0000
committerfisharebest <fisharebest@gmail.com>2011-10-21 15:03:42 +0000
commit664f5a84cce34660e57e0ead947fc887e84c0cd0 (patch)
tree4dfb24cadde68543e124a3bf5e5f4588d6ce8249
parentd9947a81cef95fb7f851759bcd0e6604684900cf (diff)
downloadwebtrees-664f5a84cce34660e57e0ead947fc887e84c0cd0.tar.gz
webtrees-664f5a84cce34660e57e0ead947fc887e84c0cd0.tar.bz2
webtrees-664f5a84cce34660e57e0ead947fc887e84c0cd0.zip
#821931 - Individual.php: Default tab isn't selected
-rw-r--r--admin_pgv_to_wt.php16
-rw-r--r--admin_trees_config.php9
-rw-r--r--admin_users.php11
-rw-r--r--edituser.php7
-rw-r--r--help_text.php15
-rw-r--r--includes/db_schema/db_schema_14_15.php42
-rw-r--r--includes/functions/functions_edit.php16
-rw-r--r--includes/session.php2
-rw-r--r--includes/set_gedcom_defaults.php1
-rw-r--r--individual.php10
-rw-r--r--library/WT/Controller/Individual.php15
-rw-r--r--login_register.php1
-rw-r--r--save.php3
13 files changed, 50 insertions, 98 deletions
diff --git a/admin_pgv_to_wt.php b/admin_pgv_to_wt.php
index ce979d8d79..c598f9eeab 100644
--- a/admin_pgv_to_wt.php
+++ b/admin_pgv_to_wt.php
@@ -312,15 +312,7 @@ if ($PGV_SCHEMA_VERSION>=12) {
" WHEN 'themes/simplyred/' THEN 'colors'".
" WHEN 'themes/xenea/' THEN 'xenea'".
" ELSE 'themes/webtrees/'". // ocean, simplyred/blue/green, standard, wood
- " END".
- " WHEN 'defaulttab' THEN".
- " CASE setting_value".
- " WHEN '1' THEN 'notes'".
- " WHEN '2' THEN 'sources_tab'".
- " WHEN '3' THEN 'media'".
- " WHEN '4' THEN 'relatives'".
- " ELSE 'personal_facts'". // -1=all and -2=last are not supported
- " END".
+ " END".
" ELSE".
" CASE".
" WHEN setting_value IN ('Y', 'yes') THEN 1 WHEN setting_value IN ('N', 'no') THEN 0 ELSE setting_value END".
@@ -471,11 +463,6 @@ if ($PGV_SCHEMA_VERSION>=12) {
" FROM `{$DBNAME}`.`{$TBLPREFIX}users`".
" JOIN `##user` ON (user_name=CONVERT(u_username USING utf8) COLLATE utf8_unicode_ci)".
" UNION ALL".
- " SELECT user_id, 'defaulttab', ".
- " CASE u_defaulttab WHEN 1 THEN 'notes' WHEN 2 THEN 'sources_tab' WHEN 3 THEN 'media' WHEN 4 THEN 'relatives' ELSE 'personal_facts' END".
- " FROM `{$DBNAME}`.`{$TBLPREFIX}users`".
- " JOIN `##user` ON (user_name=CONVERT(u_username USING utf8) COLLATE utf8_unicode_ci)".
- " UNION ALL".
" SELECT user_id, 'comment', u_comment".
" FROM `{$DBNAME}`.`{$TBLPREFIX}users`".
" JOIN `##user` ON (user_name=CONVERT(u_username USING utf8) COLLATE utf8_unicode_ci)".
@@ -607,7 +594,6 @@ foreach (get_all_gedcoms() as $ged_id=>$gedcom) {
@set_gedcom_setting($ged_id, 'FAM_FACTS_UNIQUE', $FAM_FACTS_UNIQUE);
@set_gedcom_setting($ged_id, 'FAM_ID_PREFIX', $FAM_ID_PREFIX);
@set_gedcom_setting($ged_id, 'FULL_SOURCES', $FULL_SOURCES);
- @set_gedcom_setting($ged_id, 'GEDCOM_DEFAULT_TAB', $GEDCOM_DEFAULT_TAB);
@set_gedcom_setting($ged_id, 'GEDCOM_ID_PREFIX', $GEDCOM_ID_PREFIX);
@set_gedcom_setting($ged_id, 'GENERATE_UIDS', $GENERATE_UIDS);
@set_gedcom_setting($ged_id, 'HIDE_GEDCOM_ERRORS', $HIDE_GEDCOM_ERRORS);
diff --git a/admin_trees_config.php b/admin_trees_config.php
index 0c7defd958..24c8d1a3a0 100644
--- a/admin_trees_config.php
+++ b/admin_trees_config.php
@@ -185,7 +185,6 @@ case 'update':
set_gedcom_setting(WT_GED_ID, 'FAM_FACTS_UNIQUE', str_replace(' ', '', safe_POST('NEW_FAM_FACTS_UNIQUE')));
set_gedcom_setting(WT_GED_ID, 'FAM_ID_PREFIX', safe_POST('NEW_FAM_ID_PREFIX'));
set_gedcom_setting(WT_GED_ID, 'FULL_SOURCES', safe_POST_bool('NEW_FULL_SOURCES'));
- set_gedcom_setting(WT_GED_ID, 'GEDCOM_DEFAULT_TAB', safe_POST('NEW_GEDCOM_DEFAULT_TAB'));
set_gedcom_setting(WT_GED_ID, 'GEDCOM_ID_PREFIX', safe_POST('NEW_GEDCOM_ID_PREFIX'));
set_gedcom_setting(WT_GED_ID, 'GENERATE_UIDS', safe_POST_bool('NEW_GENERATE_UIDS'));
set_gedcom_setting(WT_GED_ID, 'HIDE_GEDCOM_ERRORS', !safe_POST_bool('NEW_HIDE_GEDCOM_ERRORS'));
@@ -1164,14 +1163,6 @@ echo WT_JS_START;?>
</tr>
<tr>
<td>
- <?php echo WT_I18N::translate('Default tab to show on individual page'), help_link('GEDCOM_DEFAULT_TAB'); ?>
- </td>
- <td>
- <?php echo edit_field_default_tab('NEW_GEDCOM_DEFAULT_TAB', get_gedcom_setting(WT_GED_ID, 'GEDCOM_DEFAULT_TAB')); ?>
- </td>
- </tr>
- <tr>
- <td>
<?php echo WT_I18N::translate('Automatically expand list of events of close relatives'), help_link('EXPAND_RELATIVES_EVENTS'); ?>
</td>
<td>
diff --git a/admin_users.php b/admin_users.php
index a6f1f46781..d049b4922d 100644
--- a/admin_users.php
+++ b/admin_users.php
@@ -64,7 +64,6 @@ $emailaddress =safe_POST('emailaddress', WT_REGEX_EMAIL);
$user_theme =safe_POST('user_theme', $ALL_THEME_DIRS);
$user_language =safe_POST('user_language', array_keys(WT_I18N::installed_languages()), WT_LOCALE);
$new_contact_method =safe_POST('new_contact_method');
-$new_default_tab =safe_POST('new_default_tab', array_keys(WT_Module::getActiveTabs()), get_gedcom_setting(WT_GED_ID, 'GEDCOM_DEFAULT_TAB'));
$new_comment =safe_POST('new_comment', WT_REGEX_UNSAFE);
$new_auto_accept =safe_POST_bool('new_auto_accept');
$canadmin =safe_POST_bool('canadmin');
@@ -224,9 +223,6 @@ case 'load1row':
echo '<dt>', WT_I18N::translate('Theme'), '</dt>';
echo '<dd>', select_edit_control_inline('user_setting-'.$user_id.'-theme', array_flip(get_theme_names()), WT_I18N::translate('<default theme>'), get_user_setting($user_id, 'theme')), '</dd>';
- echo '<dt>', WT_I18N::translate('Default Tab to show on Individual Information page'), '</dt>';
- echo '<dd>', edit_field_default_tab_inline('user_setting-'.$user_id.'-defaulttab', get_user_setting($user_id, 'defaulttab', 'personal_facts')), '</dd>';
-
echo '<dt>', WT_I18N::translate('Visible to other users when online'), '</dt>';
echo '<dd>', edit_field_yes_no_inline('user_setting-'.$user_id.'-visibleonline', get_user_setting($user_id, 'visibleonline')), '</dd>';
@@ -313,7 +309,6 @@ if ($action=='createuser' || $action=='edituser2') {
set_user_setting($user_id, 'theme', $user_theme);
set_user_setting($user_id, 'language', $user_language);
set_user_setting($user_id, 'contactmethod', $new_contact_method);
- set_user_setting($user_id, 'defaulttab', $new_default_tab);
set_user_setting($user_id, 'comment', $new_comment);
set_user_setting($user_id, 'auto_accept', $new_auto_accept);
set_user_setting($user_id, 'canadmin', $canadmin);
@@ -499,12 +494,6 @@ case 'createform':
</td>
</tr>
<?php } ?>
- <tr>
- <td><?php echo WT_I18N::translate('Default Tab to show on Individual Information page'), help_link('useradmin_user_default_tab'); ?></td>
- <td colspan="3">
- <?php echo edit_field_default_tab('new_default_tab', get_gedcom_setting(WT_GED_ID, 'GEDCOM_DEFAULT_TAB')); ?>
- </td>
- </tr>
<!-- access and relationship path details -->
<tr>
<th colspan="4"><?php print WT_I18N::translate('Family tree access and settings'); ?></th>
diff --git a/edituser.php b/edituser.php
index f1e0f47be1..21813bf17d 100644
--- a/edituser.php
+++ b/edituser.php
@@ -51,7 +51,6 @@ $form_rootid =safe_POST('form_rootid', WT_REGEX_XREF,
$form_theme =safe_POST('form_theme', $ALL_THEME_DIRS);
$form_language =safe_POST('form_language', array_keys(WT_I18N::installed_languages()), WT_LOCALE );
$form_contact_method=safe_POST('form_contact_method');
-$form_default_tab =safe_POST('form_default_tab', array_keys(WT_Module::getActiveTabs()), get_gedcom_setting(WT_GED_ID, 'GEDCOM_DEFAULT_TAB'));
$form_visible_online=safe_POST_bool('form_visible_online');
// Respond to form action
@@ -78,7 +77,6 @@ if ($form_action=='update') {
$_SESSION['locale']=$form_language; // switch to the new language right away
set_user_setting(WT_USER_ID, 'contactmethod', $form_contact_method);
set_user_setting(WT_USER_ID, 'visibleonline', $form_visible_online);
- set_user_setting(WT_USER_ID, 'defaulttab', $form_default_tab);
set_user_gedcom_setting(WT_USER_ID, WT_GED_ID, 'rootid', $form_rootid);
// Change username
@@ -215,11 +213,6 @@ echo '</td><td class="optionbox">';
echo checkbox('form_visible_online', get_user_setting(WT_USER_ID, 'visibleonline'));
echo '</td></tr>';
-echo '<tr><td class="descriptionbox wrap">';
-echo WT_I18N::translate('Default Tab to show on Individual Information page'), help_link('edituser_user_default_tab'), '</td><td class="optionbox">';
-echo edit_field_default_tab('form_default_tab', get_user_setting(WT_USER_ID, 'defaulttab'));
-echo '</td></tr>';
-
echo '<tr><td class="topbottombar" colspan="2"><input type="submit" value="', WT_I18N::translate('Save'), '" /></td></tr>';
echo '</table></form>';
diff --git a/help_text.php b/help_text.php
index 6220c73c4f..647221303e 100644
--- a/help_text.php
+++ b/help_text.php
@@ -1439,11 +1439,6 @@ case 'FULL_SOURCES':
$text=WT_I18N::translate('Source citations can include fields to record the quality of the data (primary, secondary, etc.) and the date the event was recorded in the source. If you don\'t use these fields, you can disable them when creating new source citations.');
break;
-case 'GEDCOM_DEFAULT_TAB':
- $title=WT_I18N::translate('Default tab to show on individual page');
- $text=WT_I18N::translate('This option allows you to choose which tab opens automatically on the Individual page when that page is accessed.');
- break;
-
case 'GEDCOM_ID_PREFIX':
$title=WT_I18N::translate('Individual ID prefix');
$text=WT_I18N::translate('When a new individual record is added online in <b>webtrees</b>, a new ID for that individual will be generated automatically. The individual ID will have this prefix.');
@@ -2395,11 +2390,6 @@ case 'edituser_rootid':
$text=WT_I18N::translate('This is the starting (Root) person of all your charts.<br /><br />If, for example, you were to click the link to the Pedigree, you would see this root person in the leftmost box. This root person does not have to be you; you can start with any person (your grandfather or your mother\'s aunt, for instance), as long you have the rights to see that person.<br /><br />This changes the default Root person for most charts. You can change the Root person on many charts, but that is just for that page at that particular invocation.');
break;
-case 'edituser_user_default_tab':
- $title=WT_I18N::translate('Default tab setting');
- $text=WT_I18N::translate('This setting allows you to specify which tab is opened automatically when you access the Individual Information page.');
- break;
-
case 'edituser_username':
$title=WT_I18N::translate('Username');
$text=WT_I18N::translate('You can change your username by updating it here. Usernames are case insensitive and ignore accented letters, so that "chloe", "chlo&euml;" and "CHLOE" are considered to be the same. Usernames may not contain the following characters: &lt;&gt;"%%{};');
@@ -2902,11 +2892,6 @@ case 'useradmin_rootid':
$text=WT_I18N::translate('For each genealogical database, you can designate a <b>Root Person</b> for the user.<br /><br />This Root Person does not need to be the user himself; it can be anybody. The user will probably want to start the Pedigree chart with himself. You control that, as well as the default Root person on other charts, here.<br /><br />If the user has Edit rights to his own account information, he can change this setting himself.');
break;
-case 'useradmin_user_default_tab':
- $title=WT_I18N::translate('User default tab setting');
- $text=WT_I18N::translate('This setting allows you to specify which tab is opened automatically when this user accesses the Individual Information page. If allowed to edit their account, the user can change this setting later.');
- break;
-
case 'useradmin_verification':
$title=WT_I18N::translate('Account approval and email verification');
$text=WT_I18N::translate('When a user registers for an account, an email is sent to their email address with a verification link. When they click this link, we know the email address is correct, and the "email verified" option is selected automatically.').
diff --git a/includes/db_schema/db_schema_14_15.php b/includes/db_schema/db_schema_14_15.php
new file mode 100644
index 0000000000..e842bc53bc
--- /dev/null
+++ b/includes/db_schema/db_schema_14_15.php
@@ -0,0 +1,42 @@
+<?php
+// Update the database schema from version 14 to 15
+// - delete old config settings
+//
+// The script should assume that it can be interrupted at
+// any point, and be able to continue by re-running the script.
+// Fatal errors, however, should be allowed to throw exceptions,
+// which will be caught by the framework.
+// It shouldn't do anything that might take more than a few
+// seconds, for systems with low timeout values.
+//
+// webtrees: Web based Family History software
+// Copyright (C) 2011 Greg Roach
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// $Id$
+
+if (!defined('WT_WEBTREES')) {
+ header('HTTP/1.0 403 Forbidden');
+ exit;
+}
+
+// Remove the i_isdead column
+self::exec("DELETE FROM `##gedcom_setting` WHERE setting_name='GEDCOM_DEFAULT_TAB'");
+self::exec("DELETE FROM `##user_setting` WHERE setting_name='default'");
+
+// Update the version to indicate success
+set_site_setting($schema_name, $next_version);
+
diff --git a/includes/functions/functions_edit.php b/includes/functions/functions_edit.php
index d607bbf7fc..7d25c1d5ef 100644
--- a/includes/functions/functions_edit.php
+++ b/includes/functions/functions_edit.php
@@ -289,22 +289,6 @@ function edit_field_rela($name, $selected='', $extra='') {
return select_edit_control($name, $rela_codes, '', $selected, $extra);
}
-// Print an edit control for a default tab field
-function edit_field_default_tab($name, $selected='', $extra='') {
- $tabs=array();
- foreach (WT_Module::getActiveTabs() as $module) {
- $tabs[$module->getName()]=$module->getTitle();
- }
- return select_edit_control($name, $tabs, null, $selected, $extra);
-}
-function edit_field_default_tab_inline($name, $selected='', $extra='') {
- $tabs=array();
- foreach (WT_Module::getActiveTabs() as $module) {
- $tabs[$module->getName()]=$module->getTitle();
- }
- return select_edit_control_inline($name, $tabs, null, $selected, $extra);
-}
-
/**
* Check if the given gedcom record has changed since the last session access
* This is used to check if the gedcom record changed between the time the user
diff --git a/includes/session.php b/includes/session.php
index fff20df4ff..767c326135 100644
--- a/includes/session.php
+++ b/includes/session.php
@@ -78,7 +78,7 @@ define('WT_DEBUG_LANG', false);
define('WT_ERROR_LEVEL', 2); // 0=none, 1=minimal, 2=full
// Required version of database tables/columns/indexes/etc.
-define('WT_SCHEMA_VERSION', 14);
+define('WT_SCHEMA_VERSION', 15);
// Regular expressions for validating user input, etc.
define('WT_REGEX_XREF', '[A-Za-z0-9:_-]+');
diff --git a/includes/set_gedcom_defaults.php b/includes/set_gedcom_defaults.php
index a30c52429b..060eaabb2c 100644
--- a/includes/set_gedcom_defaults.php
+++ b/includes/set_gedcom_defaults.php
@@ -56,7 +56,6 @@ set_gedcom_setting($ged_id, 'FAM_FACTS_QUICK', 'MARR,DIV,_NMR');
set_gedcom_setting($ged_id, 'FAM_FACTS_UNIQUE', 'NCHI,MARL,DIV,ANUL,DIVF,ENGA,MARB,MARC,MARS');
set_gedcom_setting($ged_id, 'FAM_ID_PREFIX', 'F');
set_gedcom_setting($ged_id, 'FULL_SOURCES', false);
-set_gedcom_setting($ged_id, 'GEDCOM_DEFAULT_TAB', 'personal_facts');
set_gedcom_setting($ged_id, 'GEDCOM_ID_PREFIX', 'I');
set_gedcom_setting($ged_id, 'GENERATE_UIDS', false);
set_gedcom_setting($ged_id, 'HIDE_GEDCOM_ERRORS', true);
diff --git a/individual.php b/individual.php
index 7d24fa8d71..21fc57107b 100644
--- a/individual.php
+++ b/individual.php
@@ -250,12 +250,12 @@ foreach ($controller->tabs as $tab) {
$greyed_out='';
}
if ($tab->hasTabContent()) {
- if ($tab->getName()==$controller->default_tab || !$tab->canLoadAjax()) {
- // The default tab and non-AJAX tabs load immediately
- echo '<li class="'.$greyed_out.'"><a title="', $tab->getName(), '" href="#', $tab->getName(), '">';
- } else {
+ if ($tab->canLoadAjax()) {
// AJAX tabs load only when selected
echo '<li class="'.$greyed_out.'"><a title="', $tab->getName(), '" href="',$controller->indi->getHtmlUrl(),'&amp;action=ajax&amp;module=', $tab->getName(), '">';
+ } else {
+ // Non-AJAX tabs load immediately
+ echo '<li class="'.$greyed_out.'"><a title="', $tab->getName(), '" href="#', $tab->getName(), '">';
}
echo '<span title="', $tab->getTitle(), '">', $tab->getTitle(), '</span></a></li>';
}
@@ -263,7 +263,7 @@ foreach ($controller->tabs as $tab) {
echo '</ul>';
foreach ($controller->tabs as $tab) {
if ($tab->hasTabContent()) {
- if ($tab->getName()==$controller->default_tab || !$tab->canLoadAjax()) {
+ if (!$tab->canLoadAjax()) {
echo '<div id="', $tab->getName(), '">', $tab->getTabContent(), '</div>';
}
}
diff --git a/library/WT/Controller/Individual.php b/library/WT/Controller/Individual.php
index 3d2b9eb4ea..d7958ec479 100644
--- a/library/WT/Controller/Individual.php
+++ b/library/WT/Controller/Individual.php
@@ -35,8 +35,6 @@ class WT_Controller_Individual extends WT_Controller_Base {
var $pid = '';
var $indi = null;
var $diffindi = null;
- var $default_tab = '';
-
var $name_count = 0;
var $total_names = 0;
var $SEX_COUNT = 0;
@@ -63,14 +61,6 @@ class WT_Controller_Individual extends WT_Controller_Base {
$gedrec = "0 @".$this->pid."@ INDI\n";
}
- if (WT_USER_ID) {
- // Start with the user's default tab
- $this->default_tab=get_user_setting(WT_USER_ID, 'defaulttab');
- } else {
- // Start with the gedcom's default tab
- $this->default_tab=get_gedcom_setting(WT_GED_ID, 'GEDCOM_DEFAULT_TAB');
- }
-
if (find_person_record($this->pid, WT_GED_ID) || find_updated_record($this->pid, WT_GED_ID)!==null) {
$this->indi = new WT_Person($gedrec);
$this->indi->ged_id=WT_GED_ID; // This record is from a file
@@ -140,11 +130,6 @@ class WT_Controller_Individual extends WT_Controller_Base {
$this->tabs = WT_Module::getActiveTabs();
foreach ($this->tabs as $mod) {
$mod->setController($this);
- if ($mod->hasTabContent()) {
- if (empty($this->default_tab)) {
- $this->default_tab=$mod->getName();
- }
- }
}
if (!isset($_SESSION['WT_pin']) && $DEFAULT_PIN_STATE)
diff --git a/login_register.php b/login_register.php
index 68be13b883..384affc6b1 100644
--- a/login_register.php
+++ b/login_register.php
@@ -335,7 +335,6 @@ switch ($action) {
set_user_setting($user_id, 'reg_timestamp', date('U'));
set_user_setting($user_id, 'reg_hashcode', md5(uniqid(rand(), true)));
set_user_setting($user_id, 'contactmethod', "messaging2");
- set_user_setting($user_id, 'defaulttab', get_gedcom_setting(WT_GED_ID, 'GEDCOM_DEFAULT_TAB'));
set_user_setting($user_id, 'visibleonline', 1);
set_user_setting($user_id, 'editaccount', 1);
set_user_setting($user_id, 'auto_accept', 0);
diff --git a/save.php b/save.php
index b785965cb1..9ff4888d68 100644
--- a/save.php
+++ b/save.php
@@ -190,7 +190,7 @@ case 'user_setting':
//////////////////////////////////////////////////////////////////////////////
// Authorisation
- if (!(WT_USER_IS_ADMIN || WT_USER_ID && get_user_setting($id1, 'editaccount') && _array($id2, array('language','defaulttab','visible_online','contact_method')))) {
+ if (!(WT_USER_IS_ADMIN || WT_USER_ID && get_user_setting($id1, 'editaccount') && _array($id2, array('language','visible_online','contact_method')))) {
fail();
}
@@ -212,7 +212,6 @@ case 'user_setting':
break;
case 'contactmethod':
case 'comment':
- case 'defaulttab':
case 'language':
case 'theme':
break;