reisl/ohiocitycycles — pull request #3 by pgarver96 (2012-07-21 03:42:26+00:00)
Title: Add support for new field "Commission mechanic"

Add support for "Commission mechanic" flag. New public static function getGroupmemberList() in class CbodbMember in cbodb.functions.php to create the list, and modification to function addBicycle in cbodb.html.php to pull the new list and use it in the dropdown when adding a new bicycle.

This commit changes the "add bicycle" option in the front end to load a list of all users with the isGroup9 flag set in their member row. It does not add support for editing this field. It requires a modification to the users table; the new create statement is below. Further below is an update statement that will add all users currently flagged as "Staff" to the "Commission mechanic" group.

CREATE TABLE IF NOT EXISTS `jos_cbodb_members` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`oldid` int(10) unsigned DEFAULT '0',
`joomlaID` int(11) DEFAULT NULL,
`nameFirst` varchar(40) NOT NULL DEFAULT '',
`nameLast` varchar(40) DEFAULT NULL,
`phoneMain` varchar(40) DEFAULT NULL,
`phoneAlt` varchar(40) DEFAULT NULL,
`phoneEmerg` varchar(40) NOT NULL DEFAULT '',
`emailAddress` varchar(100) DEFAULT NULL,
`emailStatus` tinyint(4) NOT NULL DEFAULT '0',
`emailNews` tinyint(4) NOT NULL DEFAULT '0',
`isMember` tinyint(4) NOT NULL DEFAULT '0',
`membershipExpire` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`creditRate` float NOT NULL DEFAULT '5',
`isGroup1` tinyint(4) NOT NULL DEFAULT '0',
`isGroup2` tinyint(4) NOT NULL DEFAULT '0',
`isGroup3` tinyint(4) NOT NULL DEFAULT '0',
`isGroup4` tinyint(4) NOT NULL DEFAULT '0',
`isGroup5` tinyint(4) NOT NULL DEFAULT '0',
`isGroup6` tinyint(4) NOT NULL DEFAULT '0',
`isGroup7` tinyint(4) NOT NULL DEFAULT '0',
`isGroup8` tinyint(4) NOT NULL DEFAULT '0',
`isGroup9` tinyint(4) NOT NULL DEFAULT '0',
`timeCreated` datetime DEFAULT NULL,
`timeChanged` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP,
`address1` text NOT NULL,
`address2` text NOT NULL,
`city` varchar(100) NOT NULL DEFAULT '',
`state` varchar(40) NOT NULL DEFAULT '',
`zip` varchar(10) NOT NULL DEFAULT '',
`custom1` tinyint(4) NOT NULL DEFAULT '0',
`custom2` tinyint(4) NOT NULL DEFAULT '0',
`custom3` tinyint(4) NOT NULL DEFAULT '0',
`custom4` tinyint(4) NOT NULL DEFAULT '0',
`custom5` tinyint(4) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=3647 ;

UPDATE `jos_cbodb_members` set isGroup9 = 1 WHERE isGroup8 = 1