diff --git a/admin/reports_committees.inc.php b/admin/reports_committees.inc.php index 02e1030..dda72a7 100644 --- a/admin/reports_committees.inc.php +++ b/admin/reports_committees.inc.php @@ -94,6 +94,20 @@ $report_committees_fields = array( 'header' => 'Organization', 'width' => 2, 'table' => 'users.organization'), + + 'firstaid' => array( + 'name' => 'Committee Member -- First Aid Training', + 'header' => 'F.Aid', + 'width' => 0.5, + 'table' => 'users.firstaid', + 'value_map' =>array ('no' => 'no', 'yes' => 'YES')), + + 'cpr' => array( + 'name' => 'Committee Member -- CPR Training', + 'header' => 'CPR', + 'width' => 0.5, + 'table' => 'users.cpr', + 'value_map' =>array ('no' => 'no', 'yes' => 'YES')), 'static_text' => array( 'name' => 'Static Text (useful for labels)', diff --git a/admin/reports_volunteers.inc.php b/admin/reports_volunteers.inc.php index 045a4a0..3162d81 100644 --- a/admin/reports_volunteers.inc.php +++ b/admin/reports_volunteers.inc.php @@ -73,6 +73,20 @@ $report_volunteers_fields = array( 'width' => 1.0, 'table' => 'users.organization'), + 'firstaid' => array( + 'name' => 'Volunteer -- First Aid Training', + 'header' => 'F.Aid', + 'width' => 0.5, + 'table' => 'users.firstaid', + 'value_map' =>array ('no' => 'no', 'yes' => 'YES')), + + 'cpr' => array( + 'name' => 'Volunteer -- CPR Training', + 'header' => 'CPR', + 'width' => 0.5, + 'table' => 'users.cpr', + 'value_map' =>array ('no' => 'no', 'yes' => 'YES')), + 'position_name' => array ( 'name' => 'Volunteer Position -- Name', 'header' => 'Position', diff --git a/db/db.code.version.txt b/db/db.code.version.txt index a9c8fe8..b16e5f7 100644 --- a/db/db.code.version.txt +++ b/db/db.code.version.txt @@ -1 +1 @@ -103 +104 diff --git a/db/db.update.104.sql b/db/db.update.104.sql new file mode 100644 index 0000000..b9e551e --- /dev/null +++ b/db/db.update.104.sql @@ -0,0 +1,9 @@ +ALTER TABLE `users` ADD `firstaid` ENUM( 'no', 'yes' ) NOT NULL DEFAULT 'no' AFTER `postalcode` ; +ALTER TABLE `users` ADD `cpr` ENUM( 'no', 'yes' ) NOT NULL DEFAULT 'no' AFTER `firstaid` ; + +UPDATE `config` SET `type_values` = 'sex=Gender|phonehome=Home Phone|phonework=Work Phone|phonecell=Cell Phone|fax=Fax|org=Organization|birthdate=Birthdate|lang=Preferred Language|address=Address and PostalCode|city=City|province=Province|firstaid=First Aid and CPR' WHERE `var` = 'committee_personal_fields' ; +UPDATE `config` SET `type_values` = 'sex=Gender|phonehome=Home Phone|phonework=Work Phone|phonecell=Cell Phone|fax=Fax|org=Organization|birthdate=Birthdate|lang=Preferred Language|address=Address and PostalCode|city=City|province=Province|firstaid=First Aid and CPR' WHERE `var` = 'committee_personal_required' ; + +UPDATE `config` SET `type_values` = 'sex=Gender|phonehome=Home Phone|phonework=Work Phone|phonecell=Cell Phone|fax=Fax|org=Organization|birthdate=Birthdate|lang=Preferred Language|address=Address and PostalCode|city=City|province=Province|firstaid=First Aid and CPR' WHERE `var` = 'volunteer_personal_fields' ; +UPDATE `config` SET `type_values` = 'sex=Gender|phonehome=Home Phone|phonework=Work Phone|phonecell=Cell Phone|fax=Fax|org=Organization|birthdate=Birthdate|lang=Preferred Language|address=Address and PostalCode|city=City|province=Province|firstaid=First Aid and CPR' WHERE `var` = 'volunteer_personal_required' ; + diff --git a/user.inc.php b/user.inc.php index ed95fc8..7a6cde7 100644 --- a/user.inc.php +++ b/user.inc.php @@ -219,7 +219,8 @@ function user_save($u) $fields = array('firstname','lastname','username','password', 'email', 'phonehome','phonework','phonecell','fax','organization', - 'address','address2','city','province','postalcode','sex'); + 'address','address2','city','province','postalcode','sex', + 'firstaid', 'cpr'); $set = ""; foreach($fields as $f) { @@ -466,7 +467,8 @@ $user_personal_fields_map = array( 'lang' => array('lang'), 'address' => array('address', 'address2', 'postalcode'), 'city' => array('city'), - 'province' => array('province')); + 'province' => array('province'), + 'firstaid' => array('firstaid','cpr')); function user_personal_fields($type) { diff --git a/user_personal.php b/user_personal.php index 229ac22..448a113 100644 --- a/user_personal.php +++ b/user_personal.php @@ -45,6 +45,10 @@ 'province' => array('name' => 'Province'), 'organization' => array('name' => 'Organization'), 'sex' => array('name' => 'Gender'), + 'firstaid' => array ('name' => 'First Aid Training', + 'type' => 'yesno'), + 'cpr' => array ('name' => 'CPR Training', + 'type' => 'yesno'), 'phonehome' => array('name' => 'Phone (Home)', 'regexp' => '^[1-9][0-9]{2}-[1-9][0-9]{2}-[0-9]{4}( x[0-9]{1,5})?$', 'format' => '\'NNN-NNN-NNNN\' or \'NNN-NNN-NNNN xEXT\'',), @@ -225,9 +229,23 @@ function item($user, $fname, $subtext='') if(in_array($fname, $errorfields)) $style = 'style="color:red;"'; echo "$text: "; if($subtext != '') echo '
'.i18n($subtext).''; - echo ''; - echo ""; - if(in_array($fname, $required)) echo REQUIREDFIELD; + echo ''; + + $req = in_array($fname, $required) ? REQUIREDFIELD : ''; + + switch($user_personal_fields[$fname]['type']) { + case 'yesno': + echo " $req"; + break; + default: + echo "$req"; + break; + } echo ''; } else { echo ''; @@ -303,6 +321,11 @@ item($u, 'fax'); } echo ""; +echo "\n"; +item($u, 'firstaid'); +item($u, 'cpr'); +echo ""; + echo "
"; echo "";