From dbad8ae3208abcbc74e045a8e1a90dd13181134b Mon Sep 17 00:00:00 2001 From: james Date: Thu, 26 Nov 2009 18:29:03 +0000 Subject: [PATCH] Update the status on save and on page load --- user_personal.php | 45 ++++++++++++++++++++++++--------------------- 1 file changed, 24 insertions(+), 21 deletions(-) diff --git a/user_personal.php b/user_personal.php index 2db6c0f..eff1b4b 100644 --- a/user_personal.php +++ b/user_personal.php @@ -63,7 +63,7 @@ 'regexp' => '^[1-9][0-9]{2}-[1-9][0-9]{2}-[0-9]{4}$', 'format' => '\'NNN-NNN-NNNN\'',), 'postalcode' => array('name' => $config['postalzip'], - 'regexp' => '^(([A-Z][0-9][A-Z]( )?[0-9][A-Z][0-9])|([0-9]{5}))$', + 'regexp' => '^(([A-Za-z][0-9][A-Za-z]( )?[0-9][A-Za-z][0-9])|([0-9]{5}))$', 'format' => '\'ANA NAN\' or \'ANANAN\' or \'NNNNN\'',), ); @@ -81,6 +81,7 @@ if($eid != $_SESSION['users_id']) { * a committee member */ user_auth_required('committee','admin'); } + $type = $_SESSION['users_type']; $u = user_load($eid); /* Load the fields the user can edit, and theones that are required */ @@ -160,12 +161,19 @@ case 'save': user_save($u); happy_("%1 %2 successfully updated",array($_POST['firstname'],$_POST['lastname'])); } + + //reload the user record because we dont know if we saved or didnt save above, we just want + //to know what the user looks like _now_ + $u = user_load($users_id); + $newstatus=user_personal_info_status($u); + echo "\n"; exit; } - $type = $_SESSION['users_type']; //send the header if($_SESSION['embed'] == true) { echo "
"; @@ -179,6 +187,7 @@ case 'save': ); } +$newstatus=user_personal_info_status($u); ?> -'); + } + else + $("#personal_info_status").html(''); } +//when we're ready, output the status +$(document).ready( function() { personal_update_status('');}); + + +"; + if(count($u['types']) > 1) { $roles=''; foreach($u['types'] as $t) {