Use a second list for "other things to do". Things like the account

info and role info don't need to be complete/incomplete
This commit is contained in:
dave 2010-08-08 17:15:17 +00:00
parent 79286a56e0
commit de52f85ec3
3 changed files with 50 additions and 29 deletions

View File

@ -143,13 +143,6 @@ case 'save':
<?
}
/* Update the status */
$newstatus=user_account_status(null, $a);
?>
<script type="text/javascript">
user_update_tab_status('account','<?=$newstatus?>');
</script>
<?
exit;
}
@ -173,7 +166,7 @@ case 'save':
}
?>
<h4><?=i18n("Account/Login Information")?> - <span class="status_account"></span></h4>
<h4><?=i18n("Account/Login Information")?></h4>
<br />
<form class="editor" name="account" id="accountform">
@ -330,8 +323,6 @@ $(document).ready(function() {
}
});
user_update_tab_status('account');
<? if($_SESSION['password_expired'] == false) { ?>
/* Code to disable the username box, only included if the password hasn't expired */

View File

@ -42,13 +42,6 @@ $tabs = array( 'fairinfo' => array(
'types' => array('fair'),
'file' => 'fair_stats_select.php',
),
'account' => array(
'label' => 'Account/Login',
'name' => 'Account/Login/Password',
'types' => array('student','judge','committee','volunteer','sponsor','fair'),
'file' => 'user_account.php',
'status_func' => 'user_account_status',
),
'personal' => array(
'label' => 'Personal',
'name' => 'Personal Information',
@ -63,41 +56,55 @@ $tabs = array( 'fairinfo' => array(
'file' => 'user_organization.php',
'status_func' => 'user_organization_status',
),
'roles' => array(
'label' => 'Roles',
'types' => array('student','judge','committee','volunteer','sponsor','fair'),
'file' => 'user_roles.php',
'status_func' => 'user_roles_status',
),
'judgeother' => array(
'label' => 'Judge Other',
'types' => array('judge'),
'file' => 'judge_other.php',
'disabled' => true,
),
'judgeexpertise' => array(
'label' => 'Expertise',
'types' => array('judge'),
'file' => 'judge_expertise.php',
'disabled' => true,
),
'judgeavailability' => array(
'label' => 'Time Avail.',
'types' => array('judge'),
'file' => 'judge_availability.php',
'disabled' => true,
),
'judgesa' => array(
'label' => 'Special Awards',
'types' => array('judge'),
'file' => 'judge_special_awards.php',
'disabled' => true,
),
'volunteerpos' => array(
'label' => 'Volunteer Positions',
'types' => array('volunteer'),
'file' => 'volunteer_position.php',
'disabled' => true,
),
'fairstats' => array(
'label' => 'Fair Statistics and Information',
'types' => array('fair'),
'file' => 'fair_stats.php',
'disabled' => true,
),
'account' => array(
'label' => 'Account/Login',
'name' => 'Change Username/Email/Password',
'types' => array('student','judge','committee','volunteer','sponsor','fair'),
'file' => 'user_account.php',
'status_func' => false,
),
'roles' => array(
'label' => 'Roles',
'name' => 'Add/Remove Roles',
'types' => array('student','judge','committee','volunteer','sponsor','fair'),
'file' => 'user_roles.php',
'status_func' => false,
),
);
@ -174,6 +181,11 @@ foreach($tabs as $k=>$t) {
/* Enabled has been modified now for this user */
if($t['disabled'] == true) continue;
if($t['status_func'] == false) {
/* No status func, skip in the "todo list" */
continue;
}
/* Get the status */
if(is_callable($t['status_func'])) {
$s = call_user_func($t['status_func'], $u);
@ -198,6 +210,29 @@ foreach($tabs as $k=>$t) {
</tr>
</table>
<br />
<br />
<b>Other Options and Things To Do:</b><br />
<ul>
<?
foreach($tabs as $k=>$t) {
/* Enabled has been modified now for this user */
if($t['disabled'] == true) continue;
if($t['status_func'] != false) {
/* Now we want all the other links not part of the status */
continue;
}
/* Link to switch to the tab */
$n = ($t['name'] != '') ? $t['name'] : $t['label'];
?>
<li><a href="#" onclick="return linkto_click(<?=$t['index']?>);"><?=i18n($n)?></a></li>
<?
}
?>
</ul>
</div>
</div>

View File

@ -101,7 +101,7 @@ case 'remove':
?>
<h4><?=i18n("Roles")?> - <span class="status_roles"></span></h4>
<h4><?=i18n("Roles")?></h4>
<?
echo '<ul>';
@ -138,11 +138,6 @@ function remove(role)
}
}
$(document).ready(function() {
user_update_tab_status('roles');
});
</script>