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, version 2. 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; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ ?> '; return; } $req = in_array($fname, $required) ? REQUIREDFIELD : ''; $c = ($label == '') ? '' : ':'; echo ""; echo ''; switch($type) { case 'textbox': if($data1 != NULL) $size = "size=\"$data1\""; echo ""; break; case 'province': emit_province_selector($fname, $u[$fname]); break; case 'yesno': echo ""; break; case 'sex': echo ""; echo "\n"; foreach($config['languages'] AS $l=>$ln) { if($u['lang']==$l) $sel="selected=\"selected\""; else $sel=""; echo "\n"; } echo ""; break; case 'languages': echo ""; $x = 0; foreach($config['languages'] AS $l=>$ln) { $ch = (in_array($l,$u['languages'])) ? 'checked="checked"' : ''; if($x) echo '
'; echo ""; $x=1; } echo "
"; break; case 'checklist': /* data1 = items, data2 = checked items */ echo ""; $x = 0; foreach($data1 AS $key=>$txt) { $ch = (in_array($key,$data2)) ? 'checked="checked"' : ''; if($x) echo '
'; echo ""; $x=1; } echo "
"; break; } echo ''; } function user_account_status(&$u, $a = null) { if(is_array($u)) { $a = account_load($u['accounts_id']); } if($a['username'] == '') return 'incomplete'; return 'complete'; } function user_personal_info_status(&$u) { $required = array(); foreach(array_keys($u['roles']) as $r) { $required = array_merge($required, user_fields_required($r)); } $our_fields = array('salutation', 'firstname','lastname','address', 'address2','city','province','postalcode', 'phonehome','phonecell','language','sex', 'firstaid','cpr','birthdate','grade'); $required = array_intersect($our_fields, $required); foreach($required as $r) { if($r=="birthdate") { if($u[$r]=="0000-00-00" || !$u[$r]) return "incomplete"; } if(trim($u[$r]) == '') return 'incomplete'; } /* FIXME: somehow call the $role _status_update() function to update * the individual [$role]['complete'] entry? */ return 'complete'; } function user_organization_status(&$u) { $required = array(); foreach(array_keys($u['roles']) as $r) { $required = array_merge($required, user_fields_required($r)); } $our_fields = array('organization', 'phonework','fax'); $required = array_intersect($our_fields, $required); foreach($required as $r) { if(trim($u[$r]) == '') return 'incomplete'; } /* FIXME: somehow call the $role _status_update() function to update * the individual [$role]['complete'] entry? */ return 'complete'; } function user_roles_status(&$u) { return 'complete'; } ?>