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; 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 /> <br />
<form class="editor" name="account" id="accountform"> <form class="editor" name="account" id="accountform">
@ -330,8 +323,6 @@ $(document).ready(function() {
} }
}); });
user_update_tab_status('account');
<? if($_SESSION['password_expired'] == false) { ?> <? if($_SESSION['password_expired'] == false) { ?>
/* Code to disable the username box, only included if the password hasn't expired */ /* 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'), 'types' => array('fair'),
'file' => 'fair_stats_select.php', '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( 'personal' => array(
'label' => 'Personal', 'label' => 'Personal',
'name' => 'Personal Information', 'name' => 'Personal Information',
@ -63,41 +56,55 @@ $tabs = array( 'fairinfo' => array(
'file' => 'user_organization.php', 'file' => 'user_organization.php',
'status_func' => 'user_organization_status', '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( 'judgeother' => array(
'label' => 'Judge Other', 'label' => 'Judge Other',
'types' => array('judge'), 'types' => array('judge'),
'file' => 'judge_other.php', 'file' => 'judge_other.php',
'disabled' => true,
), ),
'judgeexpertise' => array( 'judgeexpertise' => array(
'label' => 'Expertise', 'label' => 'Expertise',
'types' => array('judge'), 'types' => array('judge'),
'file' => 'judge_expertise.php', 'file' => 'judge_expertise.php',
'disabled' => true,
), ),
'judgeavailability' => array( 'judgeavailability' => array(
'label' => 'Time Avail.', 'label' => 'Time Avail.',
'types' => array('judge'), 'types' => array('judge'),
'file' => 'judge_availability.php', 'file' => 'judge_availability.php',
'disabled' => true,
), ),
'judgesa' => array( 'judgesa' => array(
'label' => 'Special Awards', 'label' => 'Special Awards',
'types' => array('judge'), 'types' => array('judge'),
'file' => 'judge_special_awards.php', 'file' => 'judge_special_awards.php',
'disabled' => true,
), ),
'volunteerpos' => array( 'volunteerpos' => array(
'label' => 'Volunteer Positions', 'label' => 'Volunteer Positions',
'types' => array('volunteer'), 'types' => array('volunteer'),
'file' => 'volunteer_position.php', 'file' => 'volunteer_position.php',
'disabled' => true,
), ),
'fairstats' => array( 'fairstats' => array(
'label' => 'Fair Statistics and Information', 'label' => 'Fair Statistics and Information',
'types' => array('fair'), 'types' => array('fair'),
'file' => 'fair_stats.php', '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 */ /* Enabled has been modified now for this user */
if($t['disabled'] == true) continue; if($t['disabled'] == true) continue;
if($t['status_func'] == false) {
/* No status func, skip in the "todo list" */
continue;
}
/* Get the status */ /* Get the status */
if(is_callable($t['status_func'])) { if(is_callable($t['status_func'])) {
$s = call_user_func($t['status_func'], $u); $s = call_user_func($t['status_func'], $u);
@ -198,6 +210,29 @@ foreach($tabs as $k=>$t) {
</tr> </tr>
</table> </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>
</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>'; echo '<ul>';
@ -138,11 +138,6 @@ function remove(role)
} }
} }
$(document).ready(function() {
user_update_tab_status('roles');
});
</script> </script>