From: Chuck Scott Date: Mon, 30 Nov 2015 21:14:20 +0000 (-0500) Subject: Merge branch 'develop' into feature/MemberLogin X-Git-Tag: v1.0.43^2^2 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/index.cgi?a=commitdiff_plain;h=99b57c374439b9101120e43d08a2bfaf67b73ee0;p=WP-Plugins%2Fglm-member-db.git Merge branch 'develop' into feature/MemberLogin Conflicts: classes/data/dataMembers.php glm-member-db.php --- 99b57c374439b9101120e43d08a2bfaf67b73ee0 diff --cc activate.php index 21f340a1,21f340a1..25f3e828 --- a/activate.php +++ b/activate.php @@@ -90,8 -90,8 +90,40 @@@ class glmMembersPluginActivate extends // Check for plugin uploads directory $this->checkUploadsDir(); -- // Add user capabilties -- $this->addRoleCapability('glm_members_edit', ++ ++ // *** TEMPORARY TO DELETE OLD CAPABILOITIES *** ++ $this->deleteRoleCapability('glm_members_edit'); ++ $this->deleteRoleCapability('glm_members_info'); ++ $this->deleteRoleCapability('glm_members_list'); ++ ++ /* ++ * Add user capabilties ++ */ ++ ++ // Access to main menu ++ $this->addRoleCapability('glm_members_main_menu', ++ array( ++ 'administrator' => true, ++ 'author' => false, ++ 'contributor' => false, ++ 'editor' => true, ++ 'subscriber' => false ++ ) ++ ); ++ ++ // Access to Members menu ++ $this->addRoleCapability('glm_members_members', ++ array( ++ 'administrator' => true, ++ 'author' => false, ++ 'contributor' => false, ++ 'editor' => true, ++ 'subscriber' => false ++ ) ++ ); ++ ++ // Access to Member menu ++ $this->addRoleCapability('glm_members_member', array( 'administrator' => true, 'author' => false, @@@ -100,6 -100,6 +132,8 @@@ 'subscriber' => false ) ); ++ ++ // Access to Configure menu $this->addRoleCapability('glm_members_configure', array( 'administrator' => true, @@@ -109,7 -109,7 +143,9 @@@ 'subscriber' => false ) ); -- $this->addRoleCapability('glm_members_info', ++ ++ // Access to Management menu ++ $this->addRoleCapability('glm_members_management', array( 'administrator' => true, 'author' => false, @@@ -118,7 -118,7 +154,9 @@@ 'subscriber' => false ) ); -- $this->addRoleCapability('glm_members_management', ++ ++ // Access to Shortcodes menu ++ $this->addRoleCapability('glm_members_shortcodes', array( 'administrator' => true, 'author' => false, @@@ -128,6 -128,6 +166,17 @@@ ) ); ++ // Display main Dashboard widget ++ $this->addRoleCapability('glm_members_widget', ++ array( ++ 'administrator' => true, ++ 'author' => false, ++ 'contributor' => false, ++ 'editor' => true, ++ 'subscriber' => false ++ ) ++ ); ++ // Set current plugin version update_option('glmMembersDatabasePluginVersion', GLM_MEMBERS_PLUGIN_VERSION); @@@ -158,7 -158,7 +207,7 @@@ } /* -- * Add a role capability to all current roles ++ * Add a capability to all current roles * * @param string $capability Name of capability to add * @param array $default Whether capability should be on by default @@@ -172,7 -172,7 +221,7 @@@ * @return void * @access private */ -- private function addRoleCapability ($capability, $default) ++ private function addRoleCapability($capability, $default) { // Get list of role objects $roleObjects = $GLOBALS['wp_roles']->role_objects; @@@ -183,13 -183,13 +232,6 @@@ // For each role object foreach ($roleObjects as $key => $role) { -- // Uncomment to reset capabilities -- /* -- if ( isset($role->capabilities[$capability])) { -- $role->remove_cap($capability); -- } -- */ -- // Check if the role exists in list of editable roles and // the capability does not exist if (isset($roles[$key]) && ! isset($role->capabilities[$capability])) { @@@ -211,6 -211,6 +253,34 @@@ } ++ /* ++ * Delete a capability from all current roles ++ * ++ * @param string $capability Name of capability to add ++ * ++ * @return void ++ * @access private ++ */ ++ private function deleteRoleCapability($capability) ++ { ++ // Get list of role objects ++ $roleObjects = $GLOBALS['wp_roles']->role_objects; ++ ++ // Get list of roles we can edit ++ $roles = get_editable_roles(); ++ ++ // For each role object ++ foreach ($roleObjects as $key => $role) { ++ ++ if ( isset($role->capabilities[$capability])) { ++ $role->remove_cap($capability); ++ } ++ ++ } ++ ++ } ++ ++ } diff --cc classes/data/dataAmenities.php index 8dd81656,a8b20548..8c9f2bd2 --- a/classes/data/dataAmenities.php +++ b/classes/data/dataAmenities.php @@@ -194,6 -194,6 +194,7 @@@ class GlmDataAmenities extends GlmDataA AND A.id = R.amenity ORDER BY A.name ;"; ++ $amenList = $this->wpdb->get_results($sql, ARRAY_A); return $amenList; @@@ -242,12 -242,12 +243,12 @@@ VALUES ( $a, $ref_type, $ref_dest ) ;"; -- $this->wpdb->query($sql); } -- return $this->getAmenityRef($ref_type, $ref_dest); ++ $amen = $this->getAmenityRef($ref_type, $ref_dest); ++ return $amen; } diff --cc classes/data/dataImages.php index 36a71809,e40e06ed..37c42bd7 --- a/classes/data/dataImages.php +++ b/classes/data/dataImages.php @@@ -134,6 -134,6 +134,20 @@@ class GlmDataImages extends GlmDataAbst 'use' => 'a' ), ++ // Special Image flag - only one of these ++ 'selected' => array ( ++ 'field' => 'selected', ++ 'type' => 'checkbox', ++ 'use' => 'gled' ++ ), ++ ++ // Featured Image flag ++ 'featured' => array ( ++ 'field' => 'featured', ++ 'type' => 'checkbox', ++ 'use' => 'gled' ++ ), ++ // File Name 'file_name' => array( 'field' => 'file_name', @@@ -174,6 -174,6 +188,13 @@@ 'use' => 'a' ), ++ // Reference Entry ID ++ 'ref_dest' => array( ++ 'field' => 'ref_dest', ++ 'type' => 'integer', ++ 'use' => 'gled' ++ ), ++ // Reference Destination - Which entry in the table is it associated with 'position' => array( 'field' => 'position', @@@ -330,7 -330,7 +351,13 @@@ && is_array($_REQUEST['galleryImage_caption']) && count($_REQUEST['galleryImage_caption']) > 0) { -- // Update text for title and descriptions ++ // Get the ID of the "selected" image - Only one ++ $selected = 0; ++ if (isset($_REQUEST['galleryImage_selected'])) { ++ $selected = ($_REQUEST['galleryImage_selected'] - 0); ++ } ++ ++ // Update other data for this image reset($_REQUEST['galleryImage_caption']); while (list($k, $v) = each($_REQUEST['galleryImage_caption'])) { $id = ($k -0); @@@ -338,11 -338,11 +365,14 @@@ // Sanitize input $caption = sanitize_text_field( $_REQUEST['galleryImage_caption'][$k] ); $descr = sanitize_text_field( $_REQUEST['galleryImage_descr'][$k] ); ++ $featured = (isset($_REQUEST['galleryImage_featured']) && isset($_REQUEST['galleryImage_featured'][$k]) && $_REQUEST['galleryImage_featured'][$k] == 'on' ? 'true' : 'false'); ++ ++ // Check if this is the selected image ++ $thisSelected = ($selected == $k ? 'true' : 'false'); // Update data for this image -- $sql = "UPDATE ".GLM_MEMBERS_PLUGIN_DB_PREFIX ."images SET caption = '$caption', descr = '$descr' WHERE id = $id;"; ++ $sql = "UPDATE ".GLM_MEMBERS_PLUGIN_DB_PREFIX ."images SET caption = '$caption', descr = '$descr', selected = $thisSelected, featured = $featured WHERE id = $id;"; $this->wpdb->query($sql); -- } // Check for an image deletion diff --cc classes/data/dataMemberInfo.php index f58a524f,23e1d60c..5c92f33d --- a/classes/data/dataMemberInfo.php +++ b/classes/data/dataMemberInfo.php @@@ -42,296 -42,296 +42,297 @@@ class GlmDataMemberInfo extends GlmData */ public $config; /** - * Field definitions - * - * @var $ini - * @access public - */ - public $table; + * Field definitions + * + * @var $ini + * @access public + */ + public $table; - /** - * Field definitions - * - * 'type' is type of field as defined by the application - * text Regular text field - * pointer Pointer to an entry in another table - * 'filters' is the filter name for a particular filter ID in PHP filter - * functions - * See PHP filter_id() - * - * 'use' is when to use the field - * l = List - * g = Get - * n = New - * i = Insert - * e = Edit - * u = Update - * d = Delete - * a = All - * - * @var $ini - * @access public - */ - public $fields = false; + /** + * Field definitions + * + * 'type' is type of field as defined by the application + * text Regular text field + * pointer Pointer to an entry in another table + * 'filters' is the filter name for a particular filter ID in PHP filter + * functions + * See PHP filter_id() + * + * 'use' is when to use the field + * l = List + * g = Get + * n = New + * i = Insert + * e = Edit + * u = Update + * d = Delete + * a = All + * + * @var $ini + * @access public + */ + public $fields = false; - /** - * Constructor - * - * @param object $d - * database connection - * - * @return void - * @access public - */ - function __construct($wpdb, $config) - { - - // If this class is not being extended along with existing $wpdb and $config - if (!$this->wpdb) { - - // Save WordPress Database object - $this->wpdb = $wpdb; - - // Save plugin configuration object - $this->config = $config; - - } - - /* - * Table Name - */ - $this->table = GLM_MEMBERS_PLUGIN_DB_PREFIX . 'member_info'; - - /* - * Table Data Fields - */ - $this->fields = array ( - - 'id' => array ( - 'field' => 'id', - 'type' => 'integer', - 'view_only' => true, - 'use' => 'a' - ), - - // Member Pointer - 'member' => array ( - 'field' => 'member', - 'type' => 'pointer', - 'p_table' => GLM_MEMBERS_PLUGIN_DB_PREFIX . 'members', - 'p_field' => 'name', - 'p_static' => true, - 'required' => true, - 'use' => 'a' - ), - - // Member Name (stored by member updates) for sorting - 'member_name' => array( - 'field' => 'member_name', - 'type' => 'text', - 'use' => 'lg' - ), - - // Member Slug - 'member_slug' => array ( - 'field' => 'member', - 'as' => 'member_slug', - 'type' => 'pointer', - 'p_table' => GLM_MEMBERS_PLUGIN_DB_PREFIX . 'members', - 'p_field' => 'member_slug', - 'p_static' => true, - 'required' => true, - 'use' => 'gle' - ), - - // Member Pointer index - 'member_pointer' => array ( - 'field' => 'member', - 'as' => 'member_pointer', - 'type' => 'integer', - 'required' => true, - 'use' => 'gle' - ), - - // Reference Name - Not displayed to user - 'reference_name' => array ( - 'field' => 'reference_name', - 'type' => 'text', - 'use' => 'a' - ), - - // Status - 'status' => array ( - 'field' => 'status', - 'type' => 'list', - 'list' => $this->config['status'], - 'required' => true, - 'default' => $this->config['status_numb']['Pending'], - 'use' => 'a' - ), - - // Create Time - 'create_time' => array ( - 'field' => 'create_time', - 'type' => 'datetime', - 'use' => 'lgie' - ), - - // Last Modify Time - 'modify_time' => array ( - 'field' => 'modify_time', - 'type' => 'datetime', - 'use' => 'a' - ), - - // Description - 'descr' => array( - 'field' => 'descr', - 'type' => 'text', - 'use' => 'a' - ), - - // Short description - 'short_descr' => array ( - 'field' => 'short_descr', - 'type' => 'text', - 'use' => 'a' - ), - - // Address Line 1 - 'addr1' => array ( - 'field' => 'addr1', - 'type' => 'text', - 'use' => 'a' - ), - - // Address Line 2 - 'addr2' => array ( - 'field' => 'addr2', - 'type' => 'text', - 'use' => 'a' - ), - - // City - 'city' => array ( - 'field' => 'city', - 'type' => 'pointer', - 'p_table' => GLM_MEMBERS_PLUGIN_DB_PREFIX . 'cities', - 'p_field' => 'name', - 'p_orderby' => 'name', - 'p_blank' => true, - 'use' => 'a' - ), - - // State - 'state' => array ( - 'field' => 'state', - 'type' => 'list', - 'list' => $this->config['states'], - 'default' => 'MI', - 'use' => 'a' - ), - - // ZIP / Postal Code - 'zip' => array ( - 'field' => 'zip', - 'type' => 'text', - 'use' => 'a' - ), - - // Country - 'country' => array ( - 'field' => 'country', - 'type' => 'list', - 'list' => $this->config['countries'], - 'default' => 'US', - 'use' => 'a' - ), - - // Latitude - 'lat' => array( - 'field' => 'lat', - 'type' => 'float', - 'default' => $this->config['settings']['maps_default_lat'], - 'use' => 'a' - ), - - // Longitude - 'lon' => array( - 'field' => 'lon', - 'type' => 'float', - 'default' => $this->config['settings']['maps_default_lon'], - 'use' => 'a' - ), - - // Region - 'region' => array ( - 'field' => 'region', - 'type' => 'pointer', - 'p_table' => GLM_MEMBERS_PLUGIN_DB_PREFIX . 'regions', - 'p_field' => 'name', - 'p_orderby' => 'name', - 'p_blank' => true, -// 'force_list' => true, - 'use' => 'a' - ), - - // Phone - 'phone' => array( - 'field' => 'phone', - 'type' => 'phone', - 'use' => 'a' - ), - - // Toll Free - 'toll_free' => array( - 'field' => 'toll_free', - 'type' => 'phone', - 'use' => 'a' - ), - - // E-Mail Address - 'email' => array( - 'field' => 'email', - 'type' => 'email', - 'use' => 'a' - ), - - // URL - 'url' => array( - 'field' => 'url', - 'type' => 'text', - 'use' => 'a' - ), - - // Logo - 'logo' => array( - 'field' => 'logo', - 'type' => 'image', - 'use' => 'a' - ), - - // Credit Cards Accepted - multi-pick - 'cc_type' => array( - 'field' => 'cc_type', - 'type' => 'bitmap', - 'bitmap' => $this->config['credit_card'], - 'default' => 0, // no cards selected - 'use' => 'a' - ), - - // Notes - 'notes' => array ( - 'field' => 'notes', - 'type' => 'text', - 'use' => 'a' - ) - - ); - - if (is_admin() && GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE) { - glmMembersAdmin::addNotice($this->fields, 'DataBlock', 'Table Fields: '.$this->table); - } + /** + * Constructor + * + * @param object $d + * database connection + * + * @return void + * @access public + */ + function __construct($wpdb, $config) + { + + // If this class is not being extended along with existing $wpdb and $config + if (!$this->wpdb) { + + // Save WordPress Database object + $this->wpdb = $wpdb; + + // Save plugin configuration object + $this->config = $config; + + } + + /* + * Table Name + */ + $this->table = GLM_MEMBERS_PLUGIN_DB_PREFIX . 'member_info'; + + /* + * Table Data Fields + */ + $this->fields = array ( + + 'id' => array ( + 'field' => 'id', + 'type' => 'integer', + 'view_only' => true, + 'use' => 'a' + ), + + // Member Pointer + 'member' => array ( + 'field' => 'member', + 'type' => 'pointer', + 'p_table' => GLM_MEMBERS_PLUGIN_DB_PREFIX . 'members', + 'p_field' => 'name', + 'p_static' => true, + 'required' => true, + 'use' => 'a' + ), + + // Member Name (stored by member updates) for sorting + 'member_name' => array( + 'field' => 'member_name', + 'type' => 'text', + 'use' => 'lg' + ), + + // Member Slug + 'member_slug' => array ( + 'field' => 'member', + 'as' => 'member_slug', + 'type' => 'pointer', + 'p_table' => GLM_MEMBERS_PLUGIN_DB_PREFIX . 'members', + 'p_field' => 'member_slug', + 'p_static' => true, + 'required' => true, + 'use' => 'gle' + ), + + // Member Pointer index + 'member_pointer' => array ( + 'field' => 'member', + 'as' => 'member_pointer', + 'type' => 'integer', + 'required' => true, + 'use' => 'gle' + ), + + // Reference Name - Not displayed to user + 'reference_name' => array ( + 'field' => 'reference_name', + 'type' => 'text', ++ 'required' => true, + 'use' => 'a' + ), + + // Status + 'status' => array ( + 'field' => 'status', + 'type' => 'list', + 'list' => $this->config['status'], + 'required' => true, + 'default' => $this->config['status_numb']['Pending'], + 'use' => 'a' + ), + + // Create Time + 'create_time' => array ( + 'field' => 'create_time', + 'type' => 'datetime', + 'use' => 'lgie' + ), + + // Last Modify Time + 'modify_time' => array ( + 'field' => 'modify_time', + 'type' => 'datetime', + 'use' => 'a' + ), + + // Description + 'descr' => array( + 'field' => 'descr', + 'type' => 'text', + 'use' => 'a' + ), + + // Short description + 'short_descr' => array ( + 'field' => 'short_descr', + 'type' => 'text', + 'use' => 'a' + ), + + // Address Line 1 + 'addr1' => array ( + 'field' => 'addr1', + 'type' => 'text', + 'use' => 'a' + ), + + // Address Line 2 + 'addr2' => array ( + 'field' => 'addr2', + 'type' => 'text', + 'use' => 'a' + ), + + // City + 'city' => array ( + 'field' => 'city', + 'type' => 'pointer', + 'p_table' => GLM_MEMBERS_PLUGIN_DB_PREFIX . 'cities', + 'p_field' => 'name', + 'p_orderby' => 'name', + 'p_blank' => true, + 'use' => 'a' + ), + + // State + 'state' => array ( + 'field' => 'state', + 'type' => 'list', + 'list' => $this->config['states'], + 'default' => 'MI', + 'use' => 'a' + ), + + // ZIP / Postal Code + 'zip' => array ( + 'field' => 'zip', + 'type' => 'text', + 'use' => 'a' + ), + + // Country + 'country' => array ( + 'field' => 'country', + 'type' => 'list', + 'list' => $this->config['countries'], + 'default' => 'US', + 'use' => 'a' + ), + + // Latitude + 'lat' => array( + 'field' => 'lat', + 'type' => 'float', + 'default' => $this->config['settings']['maps_default_lat'], + 'use' => 'a' + ), + + // Longitude + 'lon' => array( + 'field' => 'lon', + 'type' => 'float', + 'default' => $this->config['settings']['maps_default_lon'], + 'use' => 'a' + ), + + // Region + 'region' => array ( + 'field' => 'region', + 'type' => 'pointer', + 'p_table' => GLM_MEMBERS_PLUGIN_DB_PREFIX . 'regions', + 'p_field' => 'name', + 'p_orderby' => 'name', + 'p_blank' => true, + // 'force_list' => true, + 'use' => 'a' + ), + + // Phone + 'phone' => array( + 'field' => 'phone', + 'type' => 'phone', + 'use' => 'a' + ), + + // Toll Free + 'toll_free' => array( + 'field' => 'toll_free', + 'type' => 'phone', + 'use' => 'a' + ), + + // E-Mail Address + 'email' => array( + 'field' => 'email', + 'type' => 'email', + 'use' => 'a' + ), + + // URL + 'url' => array( + 'field' => 'url', + 'type' => 'text', + 'use' => 'a' + ), + + // Logo + 'logo' => array( + 'field' => 'logo', + 'type' => 'image', + 'use' => 'a' + ), + + // Credit Cards Accepted - multi-pick + 'cc_type' => array( + 'field' => 'cc_type', + 'type' => 'bitmap', + 'bitmap' => $this->config['credit_card'], + 'default' => 0, // no cards selected + 'use' => 'a' + ), + + // Notes + 'notes' => array ( + 'field' => 'notes', + 'type' => 'text', + 'use' => 'a' + ) + + ); + + if (is_admin() && GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE) { + glmMembersAdmin::addNotice($this->fields, 'DataBlock', 'Table Fields: '.$this->table); + } } @@@ -401,92 -401,92 +402,93 @@@ WHERE C.id = CMI.category AND CMI.member_info = ".$r['id']." ;"; - $r['categories'] = $this->wpdb->get_results($sql, ARRAY_A); - - // Get Amenity Data for this entry - $sql = " - SELECT A.* - FROM ".GLM_MEMBERS_PLUGIN_DB_PREFIX. "amenities AS A, - ".GLM_MEMBERS_PLUGIN_DB_PREFIX. "amenity_ref AS R - WHERE R.ref_type = ".$this->config['ref_type_numb']['MemberInfo']." - AND R.ref_dest = ".$r['id']." - AND A.id = R.amenity + $r['categories'] = $this->wpdb->get_results($sql, ARRAY_A); + + // Get Amenity Data for this entry + $sql = " + SELECT A.* + FROM ".GLM_MEMBERS_PLUGIN_DB_PREFIX. "amenities AS A, + ".GLM_MEMBERS_PLUGIN_DB_PREFIX. "amenity_ref AS R + WHERE R.ref_type = ".$this->config['ref_type_numb']['MemberInfo']." + AND R.ref_dest = ".$r['id']." + AND A.id = R.amenity ;"; - $r['amenities'] = $this->wpdb->get_results($sql, ARRAY_A); + - return $r; - } + $r['amenities'] = $this->wpdb->get_results($sql, ARRAY_A); - /* - * Get Apha list of first characters in member name - * for those members that have active info. - * - * @param string $where Where clause - * Note the table refernces M and I. - * @param string $selected Optional selected alpha character - * - * @return object Class object - * - */ - public function getAlphaList($where = '', $selected = '') - { - - $sql = " - SELECT DISTINCT LEFT(M.name, 1) AS alpha - FROM ".GLM_MEMBERS_PLUGIN_DB_PREFIX. "members M, - ".GLM_MEMBERS_PLUGIN_DB_PREFIX. "member_info T - WHERE T.status = ".$this->config['status_numb']['Active']." - AND M.id = T.member - $where - ORDER BY alpha - ;"; - $alphaData = $this->wpdb->get_results($sql, ARRAY_A); + return $r; + } - // Set selected - foreach ($alphaData as $k=>$v) { - $alphaData[$k]['default'] = ($v['alpha'] == $selected); - } + /* + * Get Apha list of first characters in member name + * for those members that have active info. + * + * @param string $where Where clause + * Note the table refernces M and I. + * @param string $selected Optional selected alpha character + * + * @return object Class object + * + */ + public function getAlphaList($where = '', $selected = '') + { - return $alphaData; + $sql = " + SELECT DISTINCT LEFT(M.name, 1) AS alpha + FROM ".GLM_MEMBERS_PLUGIN_DB_PREFIX. "members M, + ".GLM_MEMBERS_PLUGIN_DB_PREFIX. "member_info T + WHERE T.status = ".$this->config['status_numb']['Active']." + AND M.id = T.member + $where + ORDER BY alpha + ;"; + $alphaData = $this->wpdb->get_results($sql, ARRAY_A); - } + // Set selected + foreach ($alphaData as $k=>$v) { + $alphaData[$k]['default'] = ($v['alpha'] == $selected); + } - /* - * Get simplified list of member info records. - * - * @param string $where Where clause - * Note the table refernces M and I. - * - * @return object Class object - * - */ - public function getSimpleMemberInfoList($where = '') - { - - // Save current list of fields - $f = $this->fields; - - // Replace fields list with limited list - $this->fields = array( - 'id' => $f['id'], - 'member' => $f['member'], - 'member_name' => $f['member_name'], - 'member_slug' => $f['member_slug'], - 'member_pointer' => $f['member_pointer'], - 'reference_name' => $f['reference_name'], - 'status' => $f['status'], - 'create_time' => $f['create_time'], + return $alphaData; + + } + + /* + * Get simplified list of member info records. + * + * @param string $where Where clause + * Note the table refernces M and I. + * + * @return object Class object + * + */ + public function getSimpleMemberInfoList($where = '') + { + + // Save current list of fields + $f = $this->fields; + + // Replace fields list with limited list + $this->fields = array( + 'id' => $f['id'], + 'member' => $f['member'], + 'member_name' => $f['member_name'], + 'member_slug' => $f['member_slug'], + 'member_pointer' => $f['member_pointer'], + 'reference_name' => $f['reference_name'], + 'status' => $f['status'], + 'create_time' => $f['create_time'], 'modify_time' => $f['modify_time'] - ); + ); - // Get the simplified list - $list = $this->getList($where); + // Get the simplified list + $list = $this->getList($where); - // Restore full fields list - $this->fields = $f; + // Restore full fields list + $this->fields = $f; - return $list; - } + return $list; + } } diff --cc classes/data/dataMembers.php index 296a0bd6,5f941655..601b64a7 --- a/classes/data/dataMembers.php +++ b/classes/data/dataMembers.php @@@ -41,195 -41,224 +41,235 @@@ class GlmDataMembers extends GlmDataAbs */ public $config; /** - * Field definitions - * - * @var $ini - * @access public - */ - public $table; - - /** - * Field definitions - * - * 'type' is type of field as defined by the application - * text Regular text field - * pointer Pointer to an entry in another table - * 'filters' is the filter name for a particular filter ID in PHP filter - * functions - * See PHP filter_id() - * - * 'use' is when to use the field - * l = List - * g = Get - * n = New - * i = Insert - * e = Edit - * u = Update - * d = Delete - * a = All - * - * @var $ini - * @access public - */ - public $fields = false; - - /** - * Constructor - * - * @param object $d - * database connection - * - * @return void - * @access public - */ - function __construct($wpdb, $config) - { + * Field definitions + * + * @var $ini + * @access public + */ + public $table; + + /** + * Field definitions + * + * 'type' is type of field as defined by the application + * text Regular text field + * pointer Pointer to an entry in another table + * 'filters' is the filter name for a particular filter ID in PHP filter + * functions + * See PHP filter_id() + * + * 'use' is when to use the field + * l = List + * g = Get + * n = New + * i = Insert + * e = Edit + * u = Update + * d = Delete + * a = All + * + * @var $ini + * @access public + */ + public $fields = false; + + /** + * Constructor + * + * @param object $d + * database connection + * + * @return void + * @access public + */ + function __construct($wpdb, $config) + { // If this class is not being extended along with existing $wpdb and $config - if (!$this->wpdb) { - - // Save WordPress Database object - $this->wpdb = $wpdb; - - // Save plugin configuration object - $this->config = $config; - } - - /* - * Table Name - */ - $this->table = GLM_MEMBERS_PLUGIN_DB_PREFIX . 'members'; - - /* - * Table Data Fields - */ - $this->fields = array ( - - 'id' => array ( - 'field' => 'id', - 'type' => 'integer', - 'view_only' => true, - 'use' => 'a' - ), - - // Status - 'access' => array ( - 'field' => 'access', - 'type' => 'list', - 'list' => $this->config['memb_access'], - 'l_blank' => true, - 'required' => true, - 'default' => 30, - 'force_list' => true, - 'use' => 'a' - ), - - // Member Type - 'member_type' => array ( - 'field' => 'member_type', - 'type' => 'pointer', - 'p_table' => GLM_MEMBERS_PLUGIN_DB_PREFIX . 'member_type', - 'p_field' => 'name', - 'p_orderby' => 'name', - 'p_blank' => true, - 'required' => true, - 'force_list' => true, - 'use' => 'a' - ), - - // Member Name - 'name' => array ( - 'field' => 'name', - 'type' => 'text', - 'required' => true, - 'unique' => true, - 'use' => 'a' - ), - - // Member Name (stored by member updates) for sorting - 'member_slug' => array( - 'field' => 'member_slug', - 'type' => 'text', - 'required' => false, - 'use' => 'gl' - ), - - // Date created - 'created' => array ( - 'field' => 'created', - 'type' => 'date', - 'required' => true, - 'use' => 'a' - ), - - // Active Version - 'active_id' => array ( - 'field' => 'id', - 'as' => 'active_id', - 'type' => 'pointer', - 'p_table' => GLM_MEMBERS_PLUGIN_DB_PREFIX . 'member_info', - 'p_field' => 'id', - 'p_id' => 'member', - 'p_where' => 'status = '.$this->config['status_numb']['Active'], - 'p_static' => true, - 'use' => 'gl' - ), - - /* - * Has pending information - * - * This is returning the sum of the ID field for all matching entries in the other table - * where the ID of the member entry is equal to the 'member' column in the member_info - * table and only for those entries where the status column is set to Pending. - * - * If this returns a value of 0, there are no pending informaation records for this member. - * If it returns a positive value, there are. The actual positive number returned is - * of course not anything useable, only that it's positive. - * - */ - 'pending' => array ( - 'field' => 'id', - 'as' => 'pending', - 'type' => 'pointer', - 'p_table' => GLM_MEMBERS_PLUGIN_DB_PREFIX . 'member_info', - 'p_field' => 'member', - 'p_id' => 'member', - 'p_where' => 'status = '.$this->config['status_numb']['Pending'], - 'p_sum' => true, - 'use' => 'gl' - ) - - ); - - if (is_admin() && GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE) { - glmMembersAdmin::addNotice($this->fields, 'DataBlock', 'Table Fields: '.$this->table); - } - - } - - /* - * Update member slug - should be called after a member record is added or updated - * - * @param integer id ID of member that needs the slug updated - * @access public - */ - public function updateSlug($id = false) - { - - if ($id == false) { - return false; - } - - $m = $this->getEntry($id); - - $slug = sanitize_title($m['name']); - - // Update the city selected for this memberInfo record - $sql = " - UPDATE ".GLM_MEMBERS_PLUGIN_DB_PREFIX."members - SET member_slug = '$slug' - WHERE id = $id - ;"; - $this->wpdb->query($sql); - - return $slug; - - } - - /* - * Get a simple members list - Name and ID only - * - * @return array Array of Name and ID for all members - * @access public - */ - public function getSimpleMembersList() - { - - // Save the current fields array and make a copy - $fSave = $this->fields; - $f = $fSave; - - // Remove what we don't want form the copy and get the list - unset($f['access'], $f['member_type'], $f['created']); - $this->fields = $f; - $memberList = $this->getList(); - - // Restore the fields list - $this->fields = $fSave; - - return $memberList; - } + if (!$this->wpdb) { + + // Save WordPress Database object + $this->wpdb = $wpdb; + + // Save plugin configuration object + $this->config = $config; + } + + /* + * Table Name + */ + $this->table = GLM_MEMBERS_PLUGIN_DB_PREFIX . 'members'; + + /* + * Table Data Fields + */ + $this->fields = array ( + + 'id' => array ( + 'field' => 'id', + 'type' => 'integer', + 'view_only' => true, + 'use' => 'a' + ), + + // Status + 'access' => array ( + 'field' => 'access', + 'type' => 'list', - 'list' => $this->config['memb_access'], ++ 'list' => $this->config['access'], + 'l_blank' => true, + 'required' => true, + 'default' => 30, + 'force_list' => true, + 'use' => 'a' + ), + ++ // Status - Display only short version ++ 'access_short' => array ( ++ 'field' => 'access', ++ 'as' => 'access_short', ++ 'type' => 'list', ++ 'list' => $this->config['access_short'], ++ 'l_blank' => true, ++ 'required' => true, ++ 'default' => 30, ++ 'force_list' => true, ++ 'use' => 'lged' ++ ), ++ + // Member Type + 'member_type' => array ( + 'field' => 'member_type', + 'type' => 'pointer', + 'p_table' => GLM_MEMBERS_PLUGIN_DB_PREFIX . 'member_type', + 'p_field' => 'name', + 'p_orderby' => 'name', - 'p_blank' => true, + 'required' => true, + 'force_list' => true, + 'use' => 'a' + ), + + // Member Name + 'name' => array ( + 'field' => 'name', + 'type' => 'text', + 'required' => true, + 'unique' => true, + 'use' => 'a' + ), + + // Member Name (stored by member updates) for sorting + 'member_slug' => array( + 'field' => 'member_slug', + 'type' => 'text', - 'required' => true, - 'use' => 'a' ++ 'use' => 'gl' + ), + + // Date created + 'created' => array ( + 'field' => 'created', + 'type' => 'date', + 'required' => true, + 'use' => 'a' + ), + + // Active Version + 'active_id' => array ( + 'field' => 'id', + 'as' => 'active_id', + 'type' => 'pointer', + 'p_table' => GLM_MEMBERS_PLUGIN_DB_PREFIX . 'member_info', + 'p_field' => 'id', + 'p_id' => 'member', + 'p_where' => 'status = '.$this->config['status_numb']['Active'], + 'p_static' => true, + 'use' => 'gl' + ), + + /* + * Has pending information + * + * This is returning the sum of the ID field for all matching entries in the other table + * where the ID of the member entry is equal to the 'member' column in the member_info + * table and only for those entries where the status column is set to Pending. + * + * If this returns a value of 0, there are no pending informaation records for this member. + * If it returns a positive value, there are. The actual positive number returned is + * of course not anything useable, only that it's positive. + * + */ + 'pending' => array ( + 'field' => 'id', + 'as' => 'pending', + 'type' => 'pointer', + 'p_table' => GLM_MEMBERS_PLUGIN_DB_PREFIX . 'member_info', + 'p_field' => 'member', + 'p_id' => 'member', + 'p_where' => 'status = '.$this->config['status_numb']['Pending'], + 'p_sum' => true, + 'use' => 'gl' + ) + + ); + + if (is_admin() && GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE) { + glmMembersAdmin::addNotice($this->fields, 'DataBlock', 'Table Fields: '.$this->table); + } + + } + ++ /* ++ * Update member slug - should be called after a member record is added or updated ++ * ++ * @param integer id ID of member that needs the slug updated ++ * @access public ++ */ ++ public function updateSlug($id = false) ++ { ++ ++ if ($id == false) { ++ return false; ++ } ++ ++ $m = $this->getEntry($id); ++ ++ $slug = sanitize_title($m['name']); ++ ++ // Update the city selected for this memberInfo record ++ $sql = " ++ UPDATE ".GLM_MEMBERS_PLUGIN_DB_PREFIX."members ++ SET member_slug = '$slug' ++ WHERE id = $id ++ ;"; ++ $this->wpdb->query($sql); ++ ++ return $slug; ++ ++} ++ + /* + * Get a simple members list - Name and ID only + * + * @return array Array of Name and ID for all members + * @access public + */ + public function getSimpleMembersList() + { + + // Save the current fields array and make a copy + $fSave = $this->fields; + $f = $fSave; + + // Remove what we don't want form the copy and get the list + unset($f['access'], $f['member_type'], $f['created']); + $this->fields = $f; + $memberList = $this->getList(); + + // Restore the fields list + $this->fields = $fSave; + + return $memberList; + } } diff --cc classes/glmMemberImportFromConnections.php index 8a5fb091,8a5fb091..0708fa87 --- a/classes/glmMemberImportFromConnections.php +++ b/classes/glmMemberImportFromConnections.php @@@ -339,7 -339,7 +339,7 @@@ class GlmMemberImportFromConnection ) VALUES ( -- ".$this->config['memb_access_numb']['Moderated'].", ++ ".$this->config['access_numb']['Moderated'].", $membTypeID, '".$m['ts']."', '".addslashes($m['organization'])."' diff --cc config/plugin.ini index 0b18102b,be8d6682..20b492c4 --- a/config/plugin.ini +++ b/config/plugin.ini @@@ -53,17 -55,17 +53,23 @@@ status_numb['Archived'] = 9 ; ; Member Access Levels ; --memb_access[30] = 'Display, Member Updates Moderated' --memb_access[40] = 'Display, Member Updates Not Moderated' --memb_access[20] = 'Display, No Memb Access' --memb_access[10] = 'Not Displayed, No Member Access' --memb_access[90] = 'Not Displayed, Archived' -- --memb_access_numb['NotDisplayed'] = 10 --memb_access_numb['NoAccess'] = 20 --memb_access_numb['Moderated'] = 30 --memb_access_numb['Full'] = 40 --memb_access_numb['Archived'] = 90 ++access[30] = 'Display, Updates Moderated' ++access[40] = 'Display, Updates Not Moderated' ++access[20] = 'Display, No Access' ++access[10] = 'Not Displayed, No Access' ++access[90] = 'Not Displayed, Archived' ++ ++access_short[30] = 'Moderated' ++access_short[40] = 'Not-Moderated' ++access_short[20] = 'Display' ++access_short[10] = 'None' ++access_short[90] = 'Archived' ++ ++access_numb['NotDisplayed'] = 10 ++access_numb['NoAccess'] = 20 ++access_numb['Moderated'] = 30 ++access_numb['Full'] = 40 ++access_numb['Archived'] = 90 ; ; Entity Reference Type diff --cc controllers/admin.php index 3eb77fb9,d140cac5..09c6c277 --- a/controllers/admin.php +++ b/controllers/admin.php @@@ -324,71 -376,68 +324,89 @@@ class glmMembersAdmin extends GlmPlugin { // Add a new main menu item for management and display of Members - add_menu_page( - 'Members', - 'Member DB', - 'glm_members_edit', - 'glm-members-admin-menu-members', - function() {$this->controller('members');}, - false, - '91.123' - ); - add_menu_page('Members', 'Member DB', 'glm_members_edit', ++ if (apply_filters('glm_members_menu_members', true)) { ++ ++ $mainMenuSlug = 'glm-members-admin-menu-members'; ++ ++ add_menu_page( ++ 'Members', ++ 'Members', ++ 'glm_members_main_menu', + 'glm-members-admin-menu-members', - array( - $this, - 'glmMembersAdminMenuMembers' - ), false, '91.123'); ++ function() {$this->controller('members');}, ++ false, ++ '91.123' ++ ); - // Add a submenu for Member List - add_submenu_page( - 'glm-members-admin-menu-members', - 'Member List', - '  Member List', - 'glm_members_edit', - 'glm-members-admin-menu-members-list', - function() {$this->controller('members', 'list');} - ); - /* - * Add a submenu for the "Members" section - * Note that this uses the main menu item's slug for both the parent and menu slug - * to create a sub-menu with a title different from the main menu title - */ ++ // Add a submenu for the "Member" section ++ if (apply_filters('glm_members_menu_member', true)) { ++ add_submenu_page( ++ $mainMenuSlug, ++ 'Member Dashboard', ++ 'Member', ++ 'glm_members_member', ++ 'glm-members-admin-menu-member', ++ function() {$this->controller('member');} ++ ); ++ } - // Add a submenu for the "Member" section - add_submenu_page( - 'glm-members-admin-menu-members', - 'Member Information', - 'Add Member', - 'glm_members_edit', - 'glm-members-admin-menu-member', - function() {$this->controller('member');} - ); - add_submenu_page('glm-members-admin-menu-members', 'Members', - 'Members', 'glm_members_edit', 'glm-members-admin-menu-members', - array( - $this, - 'glmMembersAdminMenuMembers' - )); ++ } else { + - // Add a submenu for Member List - add_submenu_page('glm-members-admin-menu-members', 'Member List', - '  Member List', 'glm_members_edit', 'glm-members-admin-menu-members-list', - array( - $this, - 'glmMembersAdminMenuMembersList' - )); ++ $mainMenuSlug = 'glm-members-admin-menu-member'; + - // Add a submenu for the "Member" section - add_submenu_page('glm-members-admin-menu-members', 'Member Information', - 'Add Member', 'glm_members_edit', 'glm-members-admin-menu-member', - array( - $this, - 'glmMembersAdminMenuMember' - )); ++ add_menu_page( ++ 'Member', ++ 'Member', ++ 'glm_members_main_menu', ++ 'glm-members-admin-menu-member', ++ function() {$this->controller('member');}, ++ false, ++ '91.123' ++ ); ++ ++ } // Add a submenu for the "Configure" section - add_submenu_page( - 'glm-members-admin-menu-members', - 'Configure Members Database', - 'Configure', - 'glm_members_configure', - 'glm-members-admin-menu-configure', - function() {$this->controller('configure');} - ); - add_submenu_page('glm-members-admin-menu-members', - 'Configure Members Database', 'Configure', - 'glm_members_configure', 'glm-members-admin-menu-configure', - array( - $this, - 'glmMembersAdminMenuConfigure' - )); ++ if (apply_filters('glm_members_menu_configure', true)) { ++ add_submenu_page( ++ 'glm-members-admin-menu-members', ++ 'Configure Members Database', ++ 'Configure', ++ 'glm_members_configure', ++ 'glm-members-admin-menu-configure', ++ function() {$this->controller('configure');} ++ ); ++ } // Add a submenu for the "Management" section - add_submenu_page( - 'glm-members-admin-menu-members', - 'Member DB Management', - 'Management', - 'glm_members_management', - 'glm-members-admin-menu-management', - function() {$this->controller('management');} - ); - add_submenu_page('glm-members-admin-menu-members', - 'Member DB Management', 'Management', - 'glm_members_management', 'glm-members-admin-menu-management', - array( - $this, - 'glmMembersAdminMenuManagement' - )); ++ if (apply_filters('glm_members_menu_meanagement', true)) { ++ add_submenu_page( ++ 'glm-members-admin-menu-members', ++ 'Member DB Management', ++ 'Management', ++ 'glm_members_management', ++ 'glm-members-admin-menu-management', ++ function() {$this->controller('management');} ++ ); ++ } // Add a submenu for the "Shortcode Reference" section - add_submenu_page( - 'glm-members-admin-menu-members', - 'Shortcode Reference', - 'Shortcodes', - 'glm_members_info', - 'glm-members-admin-menu-shortcodes', - function() {$this->controller('shortcodes');} - ); - add_submenu_page('glm-members-admin-menu-members', - 'Shortcode Reference', 'Shortcodes', - 'glm_members_info', 'glm-members-admin-menu-shortcodes', - array( - $this, - 'glmMembersAdminMenuShortcodes' - )); ++ if (apply_filters('glm_members_menu_shortcodes', true)) { ++ add_submenu_page( ++ 'glm-members-admin-menu-members', ++ 'Shortcode Reference', ++ 'Shortcodes', ++ 'glm_members_shortcodes', ++ 'glm-members-admin-menu-shortcodes', ++ function() {$this->controller('shortcodes');} ++ ); ++ } + + // For each add-on, read in their menu additions + foreach ($this->config['addOns'] as $a) { + require_once(GLM_MEMBERS_WORDPRESS_PLUGIN_PATH.$a['slug'].'/setup/adminMenus.php'); + require_once(GLM_MEMBERS_WORDPRESS_PLUGIN_PATH.$a['slug'].'/setup/adminTabs.php'); + } } @@@ -405,12 -454,15 +423,12 @@@ public function glmMembersAdminDashboardWidget () { -- if ( current_user_can( 'glm_members_info' ) ) { ++ if ( current_user_can( 'glm_members_widget' ) ) { wp_add_dashboard_widget( - 'glm_members_admin_dashboard_widget', - 'Member DB Summary', - array( - $this, - 'glmMembersAdminDashboardContent' - ) + 'glm_members_admin_dashboard_widget', + 'Member DB Summary', + function() {$this->controller('dashboardWidget'); } ); // Set widget default position to right column diff --cc controllers/front.php index f8cea960,3bab226a..c8319169 --- a/controllers/front.php +++ b/controllers/front.php @@@ -311,7 -328,7 +311,8 @@@ class glmMembersFront extends GlmPlugin $modelRedirect = false; // Verify that we have the requested menu item in the valid actions -- if (! isset($GLOBALS['glmMembersFrontValidActions'][$menuItem])) { ++ ++ if (! isset($GLOBALS['glmMembersValidActions']['frontActions'][$menuItem])) { $modelRedirect = true; $menuItem = 'error'; $action = 'index'; @@@ -319,9 -336,9 +320,9 @@@ } // Verify Menu item and action using array at top of this file -- if (! isset($GLOBALS['glmMembersFrontValidActions'][$menuItem]) || -- ! in_array($action, -- $GLOBALS['glmMembersFrontValidActions'][$menuItem])) { ++ if (! isset($GLOBALS['glmMembersValidActions']['frontActions']) || ++ ! isset($action, ++ $GLOBALS['glmMembersValidActions']['frontActions'][$menuItem])) { $menuItem = 'error'; $action = 'badAction'; } diff --cc css/admin.css index 69a5ad07,539820ba..065639cd --- a/css/admin.css +++ b/css/admin.css @@@ -118,12 -118,12 +118,12 @@@ white-space: nowrap; padding-right: 1em; padding-bottom: .4em; -- width: 10px; /* used to keep header fields on a line with td's to as narrow as they can be without breaking the text */ ++ width: 1%; /* used to keep header fields on a line with td's to as narrow as they can be without breaking the text */ } .glm-admin-table td { text-align: left; vertical-align: top; -- padding-bottom: .4em; ++ padding-bottom: .2em; } .glm-admin-table thead th{ font-size: 15px; @@@ -132,19 -132,13 +132,38 @@@ .glm-admin-table-active { background: #99FFFF; } ++.glm-admin-table-medium-text { ++ font-size: 0.9em; ++ margin: 0px; ++} ++.glm-admin-table-small-text { ++ font-size: 0.8em; ++ margin: 0px; ++} .glm-admin-image-edit-table { border: 2px #ddd solid; } .glm-admin-image-edit-table td { padding: 5px; } ++td.glm-shrink { ++ white-space: nowrap; ++ width: 1px; ++} ++td.glm-nowrap { ++ white-space: nowrap; ++} +/* Misc Admin */ +.glm-code { + font-size: .8em; + font-family: "Courier New", Courier, monospace; + white-space: pre; +} ++.glm-li { ++ list-style-type: circle; ++ padding-left: 1em; ++} /* Overlay dialog box */ .glm-dialog-box { @@@ -240,7 -234,7 +259,7 @@@ { float: left; height: 100%; -- width: 20%; ++/* width: 20%;*/ overflow: hidden; } .glm-galleryImage img diff --cc glm-member-db.php index 20755e39,327449f0..17a6b6f1 --- a/glm-member-db.php +++ b/glm-member-db.php @@@ -3,7 -3,7 +3,7 @@@ * Plugin Name: GLM Members Database * Plugin URI: http://www.gaslightmedia.com/ * Description: Gaslight Media Members Database. - * Version: 1.0.41 - * Version: 1.0.42 ++ * Version: 1.0.43 * Author: Chuck Scott * Author URI: http://www.gaslightmedia.com/ * License: GPL2 @@@ -19,7 -19,7 +19,7 @@@ * @package glmMembersDatabase * @author Chuck Scott * @license http://www.gaslightmedia.com Gaslightmedia - * @version 1.0.41 - * @version 1.0.42 ++ * @version 1.0.43 */ /* @@@ -33,83 -33,8 +33,84 @@@ * version when there's a change in the database!! Use the * version nunmber of that release for the DB version. */ -define('GLM_MEMBERS_PLUGIN_VERSION', '1.0.42'); -define('GLM_MEMBERS_PLUGIN_DB_VERSION', '1.0.30'); ++ +define('GLM_MEMBERS_PLUGIN_VERSION', '1.0.43'); +define('GLM_MEMBERS_PLUGIN_DB_VERSION', '1.0.43'); + +/** + * Array of valid menu items and actions. + * + * The higher level elements are valid menu items. These correlate to + * actual menu or sub menu items that are hooks back to this controller + * class. + * + * The lower level items below each menu item are actions that may be specified + * by a "glmMembersAction" form field. + * + * The string after the action is the slug of the plugin where the model/view + * is to perform that action. + * + * This array is extended to include valid menus and actions from any add-on + * plugins. + */ +$GLOBALS['glmMembersValidActions'] = array( + 'adminActions' => array( + 'ajax' => array( + 'imageUpload' => 'glm-member-db' + ), + 'dashboardWidget' => array( + 'index' => 'glm-member-db' + ), + 'members' => array( + 'index' => 'glm-member-db', // member list + 'list' => 'glm-member-db', + 'reports' => 'glm-member-db', + 'other' => 'glm-member-db' + ), + 'member' => array( + 'index' => 'glm-member-db', // Member Dashboard + 'memberInfo' => 'glm-member-db', + 'locations' => 'glm-member-db', + 'facilities' => 'glm-member-db', + 'activities' => 'glm-member-db', + 'accommodations' => 'glm-member-db' + ) + , + 'configure' => array( + 'index' => 'glm-member-db', // Member Types + 'categories' => 'glm-member-db', + 'cities' => 'glm-member-db', + 'regions' => 'glm-member-db', + 'accommodationTypes' => 'glm-member-db', + 'amenities' => 'glm-member-db' + ), + 'management' => array( + 'index' => 'glm-member-db', // General Options + 'terms' => 'glm-member-db', + 'development' => 'glm-member-db', + 'import' => 'glm-member-db', + 'addons' => 'glm-member-db', + 'hooks' => 'glm-member-db' + ), + 'shortcodes' => array( + 'index' => 'glm-member-db' + ), + 'error' => array( + 'index' => 'glm-member-db', + 'badAction' => 'glm-member-db' + ) + ), + 'frontActions' => array( + 'members' => array( + 'list' => 'glm-member-db', + 'detail' => 'glm-member-db' + ), + 'error' => array( + 'index' => 'glm-member-db', + 'badAction' => 'glm-member-db' + ) + ) +); /* * Copyright 2014 Charles Scott (email : cscott@gaslightmedia.com) @@@ -345,6 -237,6 +346,32 @@@ register_deactivation_hook(__FILE__, 'g // Load data abstract require_once(GLM_MEMBERS_PLUGIN_LIB_PATH.'/GlmDataAbstract/DataAbstract.php'); ++/* ++ * Hook through which an add-on may supply additional logged in user information and ++ * have that data stored in the config array. Typically it would be the ++ * glm-members-db-contacts add-on supplying the information. ++ * ++ * This hook provides default data with the current WordPress user 'data' object ++ * as a 'wpUser' sub-array if a WordPress user is logged in. If not 'wpUser' will ++ * be false. The supplied data is the basic information on the WordPress user ++ * provided by the 'data' object from wp_get_current_user(). ++ * ++ * To permit more than one routine to access this filter and therefore to supply ++ * additional information on the logged in user, code may merge it's own data or may ++ * add another sub-array containing user information specific to an add-on (i.e. ++ * contacts add-on might supply a 'contactUser' sub-array). ++ * ++ */ ++if (function_exists('is_user_logged_in')) { ++ $config['loggedInUser'] = array( ++ 'wpUser' => false ++ ); ++ if (is_user_logged_in()) { ++ $config['loggedInUser']['wpUser'] = (array) wp_get_current_user()->data; ++ } ++ $config['loggedInUser'] = apply_filters('glm_members_current_logged_in_user', $config['loggedInUser']); ++} ++ /* * * Determine which controller to load diff --cc js/imageUpload/imageUpload.js index 0234c2c2,9fdf5f59..e1c397f2 --- a/js/imageUpload/imageUpload.js +++ b/js/imageUpload/imageUpload.js @@@ -15,386 -15,386 +15,405 @@@ jQuery(document).ready(function($) { - - var drop; - var recordID; - var refType; - var recordID; - var maxFileSize; - var allowedTypes; - var files; - var uploadStatusTemplate; - var imageDataTemplate; - var galleryImages; - var newImageAdded = false; - - // Setup Drag and Drop when Add and - if (window.File && window.FileList && window.FileReader) { - - // is XHR2 available? - var xhr = new XMLHttpRequest(); - if (xhr.upload) { - - // Change from Drag/Drop not supported to drop here text - $('.glm-imageBrowseButton').addClass('glm-imageItemHidden'); - $('.glm-imageDropText').removeClass('glm-imageItemHidden'); - $('.glm-imageDrop').removeClass('glm-imageItemHidden'); - - // Prevent dropping on the document - $(document).on('dragenter', function (e) { - e.stopPropagation(); - e.preventDefault(); - }); - $(document).on('dragover', function (e) { - e.stopPropagation(); - e.preventDefault(); - }); - $(document).on('drop', function (e) { - e.preventDefault(); - }); - - // For each image drop area on the page - $('.glm-imageDrop').each(function() { - drop = $(this); - initDrop(); - }); - - } else { - alert('Your Web browser does not support "Drag & Drop" image uploads using "XHR2".\nThat capability is required to upload images for the image gallery on this page.\nConsider upgrading your browser.'); - } - - } - - // Setup an image drop area - function initDrop() { - - // Get information from the field on where this image file is going - refType = drop.attr("data-refType"); - recordID = drop.attr("data-recordID"); - maxFileSize = drop.attr("data-maxFileSizeKB") * 1000; - allowedTypes = drop.attr("data-allowedTypes"); - - uploadStatusTemplate = drop.children('.glm-imageUploadStatusTemplate').html(); - imageDataTemplate = drop.children('.glm-galleryImageDataTemplate').html(); - galleryImages = drop.parent().parent().children('.glm-galleryImages'); - - // Change drop destination appearance only when dragging over a file. - drop.on('dragenter', function(e){ - e.stopPropagation(); - e.preventDefault(); - drop.parent().addClass('glm-imageDropDragOver'); - }); - drop.on('dragover', function(e){ - e.stopPropagation(); - e.preventDefault(); - }); - drop.on('dragleave', function(e){ - e.stopPropagation(); - e.preventDefault(); - drop.parent().removeClass('glm-imageDropDragOver'); - }); - - // File drop action - $('.glm-imageDrop').on('drop', function (e) { - e.preventDefault(); - files = e.originalEvent.dataTransfer.files; - handleFileDrop(); - drop.parent().removeClass('glm-imageDropDragOver'); - }); - - } - - /* - * This function sets up AJAX processing of the list of files. It then fires - * off the processFile() function to do the first file. When the AJAX call - * in sendFileToServer() completes, the complete: function will call - * processFile() again to do the next file, if one exists. - */ - var thisFile = 0; - var numbFiles = 0; - - function handleFileDrop() { - - // Reset file pointer and set number of last file - thisFile = 0; - numbFiles = files.length; - - // Start with the first file - processFile(); - - } - - /* - * Process the current file - AJAX complete: will call back to this function - * for the next file - */ - function processFile() { - - // If we still have files to process - if (thisFile < numbFiles) { - - file = files[thisFile]; - - // Setup field pairs for sending in request - var fd = new FormData(); - - // Add file upload information - fd.append('file', file); - - /* - * Add "action" post parameter specifying where WordPress should - * route the request. In this case we are routing this AJAX request - * to the admin controller glmMembersAdminAjax() method which will - * route the request to the proper file in the models/admin/ajax - * directory of this plugin. - * - * see "add_action( 'wp_ajax_glm_members_admin_ajax',..." in admin - * controller. - */ - fd.append( 'action', 'glm_members_admin_ajax' ); - - // Tell admin controller where to route AJAX call - // (models/admin/ajax/imageUpload.php) - fd.append('glm_action', 'imageUpload'); - - // Tell image upload AJAX processor who the image is for - fd.append('glm_refType', refType); - fd.append('glm_refDest', recordID); - - // Setup status display area - var status = new createStatusbar(file, thisFile, numbFiles); - - statusArea.fadeIn( function() { - - // Check image size and alert the user if it's too big - if (file.size > maxFileSize) { - - alert("This image file is too large to process.\nTo use this image, consider resizing it before uploading.\n\nMaximum image size is " + (maxFileSize/1000) + "KB."); - statusArea.fadeOut(); - processFile(); - - // Check the image mime type and alert the user if it's not - // permitted - } else if (allowedTypes.indexOf(file.type) < 0) { - - alert("The file is not an accepted image type.\nTo use this image, consider resaving it as a differnt image type.\n"); - statusArea.fadeOut(); - processFile(); - - } else { - // When status has faded in, Send the files - sendFileToServer(fd, status); - } - - }); - - thisFile++; - - } else { - - // Reset expanded image and sortable events - setupExpandedImageEvents(); - - } - - } - - function createStatusbar(file, thisFile, numbFiles) - { - var statusDone = false; - - /* - * We need to redefine these values inside this function so the - * reader.onload function can see them. - */ - var curFile = thisFile + 1; - var lastFile = numbFiles; - - // Get status area for this drop area - statusArea = drop.siblings('.glm-imageUploadStatus'); - - // Make status area visible (overlay) and clear contents - statusArea.html(''); -- - // If file is an image + var drop; + var recordID; + var refType; + var recordID; + var maxFileSize; + var allowedTypes; + var files; + var uploadStatusTemplate; + var imageDataTemplate; + var galleryImages; + var newImageAdded = false; ++ var enableDragable = true; + + // Setup Drag and Drop when Add and + if (window.File && window.FileList && window.FileReader) { + + // is XHR2 available? + var xhr = new XMLHttpRequest(); + if (xhr.upload) { + + // Change from Drag/Drop not supported to drop here text + $('.glm-imageBrowseButton').addClass('glm-imageItemHidden'); + $('.glm-imageDropText').removeClass('glm-imageItemHidden'); + $('.glm-imageDrop').removeClass('glm-imageItemHidden'); + + // Prevent dropping on the document + $(document).on('dragenter', function (e) { + e.stopPropagation(); + e.preventDefault(); + }); + $(document).on('dragover', function (e) { + e.stopPropagation(); + e.preventDefault(); + }); + $(document).on('drop', function (e) { + e.preventDefault(); + }); + + // For each image drop area on the page + $('.glm-imageDrop').each(function() { + drop = $(this); + initDrop(); + }); + + } else { + alert('Your Web browser does not support "Drag & Drop" image uploads using "XHR2".\nThat capability is required to upload images for the image gallery on this page.\nConsider upgrading your browser.'); + } + + } + + // Setup an image drop area + function initDrop() { + + // Get information from the field on where this image file is going + refType = drop.attr("data-refType"); + recordID = drop.attr("data-recordID"); + maxFileSize = drop.attr("data-maxFileSizeKB") * 1000; + allowedTypes = drop.attr("data-allowedTypes"); + + uploadStatusTemplate = drop.children('.glm-imageUploadStatusTemplate').html(); + imageDataTemplate = drop.children('.glm-galleryImageDataTemplate').html(); + galleryImages = drop.parent().parent().children('.glm-galleryImages'); + + // Change drop destination appearance only when dragging over a file. + drop.on('dragenter', function(e){ + e.stopPropagation(); + e.preventDefault(); + drop.parent().addClass('glm-imageDropDragOver'); + }); + drop.on('dragover', function(e){ + e.stopPropagation(); + e.preventDefault(); + }); + drop.on('dragleave', function(e){ + e.stopPropagation(); + e.preventDefault(); + drop.parent().removeClass('glm-imageDropDragOver'); + }); + + // File drop action + $('.glm-imageDrop').on('drop', function (e) { + e.preventDefault(); + files = e.originalEvent.dataTransfer.files; + handleFileDrop(); + drop.parent().removeClass('glm-imageDropDragOver'); + }); + + } + + /* + * This function sets up AJAX processing of the list of files. It then fires + * off the processFile() function to do the first file. When the AJAX call + * in sendFileToServer() completes, the complete: function will call + * processFile() again to do the next file, if one exists. + */ + var thisFile = 0; + var numbFiles = 0; + + function handleFileDrop() { + + // Reset file pointer and set number of last file + thisFile = 0; + numbFiles = files.length; + + // Start with the first file + processFile(); + + } + + /* + * Process the current file - AJAX complete: will call back to this function + * for the next file + */ + function processFile() { + + // If we still have files to process + if (thisFile < numbFiles) { + + file = files[thisFile]; + + // Setup field pairs for sending in request + var fd = new FormData(); + + // Add file upload information + fd.append('file', file); + + /* + * Add "action" post parameter specifying where WordPress should + * route the request. In this case we are routing this AJAX request + * to the admin controller glmMembersAdminAjax() method which will + * route the request to the proper file in the models/admin/ajax + * directory of this plugin. + * + * see "add_action( 'wp_ajax_glm_members_admin_ajax',..." in admin + * controller. + */ + fd.append( 'action', 'glm_members_admin_ajax' ); + + // Tell admin controller where to route AJAX call + // (models/admin/ajax/imageUpload.php) + fd.append('glm_action', 'imageUpload'); + + // Tell image upload AJAX processor who the image is for + fd.append('glm_refType', refType); + fd.append('glm_refDest', recordID); + + // Setup status display area + var status = new createStatusbar(file, thisFile, numbFiles); + + statusArea.fadeIn( function() { + + // Check image size and alert the user if it's too big + if (file.size > maxFileSize) { + + alert("This image file is too large to process.\nTo use this image, consider resizing it before uploading.\n\nMaximum image size is " + (maxFileSize/1000) + "KB."); + statusArea.fadeOut(); + processFile(); + + // Check the image mime type and alert the user if it's not + // permitted + } else if (allowedTypes.indexOf(file.type) < 0) { + + alert("The file is not an accepted image type.\nTo use this image, consider resaving it as a differnt image type.\n"); + statusArea.fadeOut(); + processFile(); + + } else { + // When status has faded in, Send the files + sendFileToServer(fd, status); + } + + }); + + thisFile++; + + } else { + + // Reset expanded image and sortable events + setupExpandedImageEvents(); + + } + + } + + function createStatusbar(file, thisFile, numbFiles) + { + var statusDone = false; + + /* + * We need to redefine these values inside this function so the + * reader.onload function can see them. + */ + var curFile = thisFile + 1; + var lastFile = numbFiles; + + // Get status area for this drop area + statusArea = drop.siblings('.glm-imageUploadStatus'); + + // Make status area visible (overlay) and clear contents + statusArea.html(''); + + // If file is an image // var regex = /^([a-zA-Z0-9\s_\\.\-:])+(.jpg|.jpeg|.gif|.png|.bmp)$/; // if (regex.test(file.name.toLowerCase())) { - // Create HTML5 file reader and load image - var reader = new FileReader(); - reader.onload = function (e) { - - // Using a copy of the supplied template, add file information - // to statusbar - statusbar = uploadStatusTemplate; - statusbar = statusbar.replace('{ thisFile }', curFile); - statusbar = statusbar.replace('{ numbFiles }', lastFile); - statusbar = statusbar.replace('{ fileImage }', e.target.result); - statusbar = statusbar.replace('{ fileName }', file.name); - statusbar = statusbar.replace('{ fileType }', file.type); - - // Fix up file size string and replace that - var sizeStr=""; - var sizeKB = file.size/1024; - if(parseInt(sizeKB) > 1024) - { - var sizeMB = sizeKB/1024; - sizeStr = sizeMB.toFixed(2)+" MB"; + // Create HTML5 file reader and load image + var reader = new FileReader(); + reader.onload = function (e) { + + // Using a copy of the supplied template, add file information + // to statusbar + statusbar = uploadStatusTemplate; + statusbar = statusbar.replace('{ thisFile }', curFile); + statusbar = statusbar.replace('{ numbFiles }', lastFile); + statusbar = statusbar.replace('{ fileImage }', e.target.result); + statusbar = statusbar.replace('{ fileName }', file.name); + statusbar = statusbar.replace('{ fileType }', file.type); + + // Fix up file size string and replace that + var sizeStr=""; + var sizeKB = file.size/1024; + if(parseInt(sizeKB) > 1024) + { + var sizeMB = sizeKB/1024; + sizeStr = sizeMB.toFixed(2)+" MB"; + } + else + { + sizeStr = sizeKB.toFixed(2)+" KB"; + } + + // If a large file, notify user it will take time. + if (file.size > 100000 && file.type == 'image/png') { + sizeStr += ' -- NOTE: Processing for this image may be slow!'; + } + + statusbar = statusbar.replace('{ fileSize }', sizeStr); + + // Assign the HTML to the status area + statusArea.html(statusbar); + + } + reader.readAsDataURL(file); + + this.setProgress = function(progress) + { + statusArea.find('.glm-progressBar').css('width', progress + '%'); + } + + this.setAbort = function(jqxhr) + { + var sb = this.statusbar; + $('#imageUploadCancel').click(function() + { + jqxhr.abort(); + sb.hide(); + }); + } + } + + /* + * Sends file to image plugin via AJAX submission targeting WordPress AJAX + * handler. + */ + function sendFileToServer(fd, status) + { + // Send one (or more) images to the server. Normally only one image here for now. + var jqXHR=$.ajax({ + xhr: function() { + var xhrobj = $.ajaxSettings.xhr(); + if (xhrobj.upload) { + xhrobj.upload.addEventListener('progress', function(event) { + + // calculate progress periodically and set the progress bar + var percent = 0; + var position = event.loaded || event.position; + var total = event.total; + if (event.lengthComputable) { + percent = Math.ceil(position / total * 100); + } + status.setProgress(percent); + }, false); + } - else - { - sizeStr = sizeKB.toFixed(2)+" KB"; + return xhrobj; + }, + url: ajaxurl, + type: "POST", + contentType:false, + processData: false, + cache: false, + data: fd, + success: function(data){ + + // Parse returned data + fileData = JSON.parse(data); + + // Check for success + if (fileData.status) { + + // Add image(s) to gallery display - for (f of fileData.files) { ++ for (var i = 0 ; i < fileData.files.length ; i++) { + + // Using a copy of the supplied template, add image information + imageData = imageDataTemplate; - imageData = imageData.replace(/{ id }/g, f.id); - imageData = imageData.replace(/\{ filename \}/g, f.newFileName); ++ imageData = imageData.replace(/{ id }/g, fileData.files[i].id); ++ imageData = imageData.replace(/\{ filename \}/g, fileData.files[i].newFileName); + galleryImages.prepend(imageData); + + // Enable the fields that were just added - $("#" + f.id + " input, #" + f.id + " textarea").removeAttr('disabled'); ++ $("#" + fileData.files[i].id + " input, #" + fileData.files[i].id + " textarea").removeAttr('disabled'); + + // Prepend image ID to position order input field - $("#galleryPositionOrder").val(f.id + ',' + $("#galleryPositionOrder").val()); ++ $("#galleryPositionOrder").val(fileData.files[i].id + ',' + $("#galleryPositionOrder").val()); + + } + + } else { + alert("Upload Failed\nReason: " + fileData.message); + } + + }, + complete: function() { + + // When status area has faded + statusArea.fadeOut( function() { + + // Process the next file, if one exists. + processFile(); + + }); + + } + }); + + return jqXHR; + + } + + /* + * This function is used to start handling of various things and - * to restart handling when an image has been added. I neede to ++ * to restart handling when an image has been added. I need to + * do this because .on() didn't cover this situation. + */ + function setupExpandedImageEvents() { + ++ var holdImage = false; ++ + // Handle expanded images on hover for image gallery + $('.glm-galleryImage').on("mouseenter", function(){ + id = $(this).attr("data-id"); ++ ++ // If an image is being held, close it now and reset holdImage ++ if (holdImage) { ++ $('#glm-galleryImageLarger_' + holdImage).dialog("close"); ++ holdImage = false; + } - - // If a large file, notify user it will take time. - if (file.size > 100000 && file.type == 'image/png') { - sizeStr += ' -- NOTE: Processing for this image may be slow!'; - } - - statusbar = statusbar.replace('{ fileSize }', sizeStr); - - // Assign the HTML to the status area - statusArea.html(statusbar); - - } - reader.readAsDataURL(file); - - this.setProgress = function(progress) - { - statusArea.find('.glm-progressBar').css('width', progress + '%'); - } - - this.setAbort = function(jqxhr) - { - var sb = this.statusbar; - $('#imageUploadCancel').click(function() - { - jqxhr.abort(); - sb.hide(); - }); - } - } - - /* - * Sends file to image plugin via AJAX submission targeting WordPress AJAX - * handler. - */ - function sendFileToServer(fd, status) - { - // Send one (or more) images to the server. Normally only one image here for now. - var jqXHR=$.ajax({ - xhr: function() { - var xhrobj = $.ajaxSettings.xhr(); - if (xhrobj.upload) { - xhrobj.upload.addEventListener('progress', function(event) { - - // calculate progress periodically and set the progress bar - var percent = 0; - var position = event.loaded || event.position; - var total = event.total; - if (event.lengthComputable) { - percent = Math.ceil(position / total * 100); - } - status.setProgress(percent); - }, false); - - } - return xhrobj; - }, - url: ajaxurl, - type: "POST", - contentType:false, - processData: false, - cache: false, - data: fd, - success: function(data){ - - // Parse returned data - fileData = JSON.parse(data); - - // Check for success - if (fileData.status) { - - // Add image(s) to gallery display - for (f of fileData.files) { - - // Using a copy of the supplied template, add image information - imageData = imageDataTemplate; - imageData = imageData.replace(/{ id }/g, f.id); - imageData = imageData.replace(/\{ filename \}/g, f.newFileName); - galleryImages.prepend(imageData); - - // Enable the fields that were just added - $("#" + f.id + " input, #" + f.id + " textarea").removeAttr('disabled'); - - // Prepend image ID to position order input field - $("#galleryPositionOrder").val(f.id + ',' + $("#galleryPositionOrder").val()); - - } - - } else { - alert("Upload Failed\nReason: " + fileData.message); - } - - }, - complete: function() { - - // When status area has faded - statusArea.fadeOut( function() { - - // Process the next file, if one exists. - processFile(); - - }); - - } - }); - - return jqXHR; - - } - - /* - * This function is used to start handling of various things and - * to restart handling when an image has been added. I neede to - * do this because .on() didn't cover this situation. - */ - function setupExpandedImageEvents() { - - // Handle expanded images on hover for image gallery - $('.glm-galleryImage').on("mouseenter", function(){ - id = $(this).attr("data-id"); - var imgTitle = $("#galleryImage_caption_" + id).val(); - $('#glm-galleryImageLarger_' + id).dialog({ - title: imgTitle, - dialogClass: "no-close", - autoOpen: true, - resizable: false, - width: 'auto', - minWidth: 100, - minHeight: 100, - create: function() { - - $(this).dialog('option', 'maxHeight', $(window).height() * .9); - $(this).dialog('option', 'maxWidth', $(window).width() * .9); - }, - position: { my: "left+10 top+10", at: "right top", of: $(this), collision: "fit" } - }); - }); - $('.glm-galleryImage').on("mouseleave", function(){ - id = $(this).attr("data-id"); - $('#glm-galleryImageLarger_' + id).dialog("close"); - }); - - // Make images sortable and store the list of IDs in a hidden input field when order has changed. - $('.glm-galleryImages').sortable({ - update: function(event, ui) { - var sortedIDs = $(this).sortable('toArray'); - $('#galleryPositionOrder').val(sortedIDs); - } - }); - - } - setupExpandedImageEvents(); ++ ++ // Display the larger image + var imgTitle = $("#galleryImage_caption_" + id).val(); + $('#glm-galleryImageLarger_' + id).dialog({ + title: imgTitle, + dialogClass: "no-close", + autoOpen: true, + resizable: false, + width: 'auto', + minWidth: 100, + minHeight: 100, + create: function() { + + $(this).dialog('option', 'maxHeight', $(window).height() * .9); + $(this).dialog('option', 'maxWidth', $(window).width() * .9); + }, + position: { my: "left+10 top+10", at: "right top", of: $(this), collision: "fit" } + }); + }); ++ // If an image is clicked, then hold the larter image dialog box ++ $('.glm-galleryImage').on("click", function(){ ++ holdImage = $(this).attr("data-id"); ++ }); + $('.glm-galleryImage').on("mouseleave", function(){ + id = $(this).attr("data-id"); - $('#glm-galleryImageLarger_' + id).dialog("close"); - }); - - // Make images sortable and store the list of IDs in a hidden input field when order has changed. - $('.glm-galleryImages').sortable({ - update: function(event, ui) { - var sortedIDs = $(this).sortable('toArray'); - $('#galleryPositionOrder').val(sortedIDs); ++ ++ // If the image has not been clicked to keep it displayed, close it now ++ if (!holdImage) { ++ $('#glm-galleryImageLarger_' + id).dialog("close"); + } + }); + ++ // Make images sortable and store the list of IDs in a hidden input field when order has changed. ++ if (enableDragable) { ++ $('.glm-galleryImages').sortable({ ++ update: function(event, ui) { ++ var sortedIDs = $(this).sortable('toArray'); ++ $('#galleryPositionOrder').val(sortedIDs); ++ } ++ }); ++ } + } + setupExpandedImageEvents(); }); diff --cc lib/EasyPassword/EasyPassword.php index 2438ece5,d4e19dc9..f052126d --- a/lib/EasyPassword/EasyPassword.php +++ b/lib/EasyPassword/EasyPassword.php @@@ -24,33 -23,16 +24,35 @@@ class EasyPasswor return $random; } - // This is the function to produce the password - function generateEasyPassword() - { - $word1 = $this->dictionaryWord(); - $numb = rand(1, 9); // Generate specified amount of numbers - $word2 = $this->dictionaryWord(); + // Generate random capitalization - either all characters ('all')or just first and last ('firstlast') + function randomCaps($s, $type = 'full') { + + switch ($type) { + case 'firstlast': + if (rand(0, 1)) $s[0] = strtoupper($s[0]); + $last = strlen($s) - 1; + if (rand(0, 1)) $s[$last] = strtoupper($s[$last]); + break; + case 'all': + default: + for ($i = 0 ; $i < strlen($s) ; $i++) { + if (rand(0, 1)) $s[$i] = strtoupper($s[$i]); + } + break; + } + return $s; + } - $keys = array ($word1,$numb,$word2); // Place password components in an array - $rand_keys = array_rand($keys,3); // Randomize the 3 password components - return $keys[$rand_keys[0]].$keys[$rand_keys[1]].$keys[$rand_keys[2]]; // Return the resulting password + // This is the function to produce the password - optionally provide a type for capitalization + function generateEasyPassword($type = 'firstlast') + { - $numbPunct = '123456789!@#$%&_-:;.?/'; ++ $numb = '123456789'; ++ $punct = '#.-_,$%&!'; + $word1 = $this->randomCaps($this->dictionaryWord(), $type); - $char = $numbPunct[rand(0, strlen($numbPunct)-1)]; ++ $numb = $numb[rand(0, strlen($numb)-1)]; ++ $punct = $punct[rand(0, strlen($punct)-1)]; + $word2 = $this->randomCaps($this->dictionaryWord(), $type); - return $word1.$char.$word2; ++ return $word1.$punct.$word2.$numb; } diff --cc lib/GlmDataAbstract/DataAbstract.php index 67fd6da0,a7cc1f24..1463c910 --- a/lib/GlmDataAbstract/DataAbstract.php +++ b/lib/GlmDataAbstract/DataAbstract.php @@@ -1262,7 -1262,7 +1262,7 @@@ abstract class GlmDataAbstrac if ($d['count'] > 0) { $this->inputFieldStatus = false; -- $this->inputErrorReason = 'This must be unique, but it conflicts with another entry.'; ++ $this->inputErrorReason = 'This value must be unique. The text you entered conflicts with another entry. Please try again.'; return $in; } } @@@ -1318,16 -1318,16 +1318,20 @@@ return $in; } -- // Check min/max length -- if (trim($in) != '' && $f['minLength'] && strlen($in) < $f['minLength']) { -- $this->inputFieldStatus = false; -- $this->inputErrorReason = 'Input is shorter than minimum length of '.$f['minLength'].' characters.'; -- return $in; -- } -- if (trim($in) != '' && $f['maxLength'] && strlen($in) > $f['maxLength']) { -- $this->inputFieldStatus = false; -- $this->inputErrorReason = 'Input is longer than maximum length of '.$f['maxLength'].' characters.'; -- return $in; ++ // Check min/max length ++ if (isset($f['minLength'])) { ++ if (trim($in) != '' && $f['minLength'] && strlen($in) < $f['minLength']) { ++ $this->inputFieldStatus = false; ++ $this->inputErrorReason = 'Input is shorter than minimum length of '.$f['minLength'].' characters.'; ++ return $in; ++ } ++ } ++ if (isset($f['maxLength'])) { ++ if (trim($in) != '' && $f['maxLength'] && strlen($in) > $f['maxLength']) { ++ $this->inputFieldStatus = false; ++ $this->inputErrorReason = 'Input is longer than maximum length of '.$f['maxLength'].' characters.'; ++ return $in; ++ } } // Check type of password @@@ -2961,7 -2961,7 +2965,7 @@@ $sql .= "ORDER BY $order "; } -- ++// echo "
".print_r($sql,1)."
"; if (is_admin() && GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE && class_exists('glmMembersAdmin')) { glmMembersAdmin::addNotice($sql, 'DataBlock', "DataAbstract - getList() query"); } diff --cc lib/GlmDataAbstract/documentation.odt index 65242b3e,65242b3e..f344ef27 Binary files differ diff --cc misc/databaseScripts/create_database_V1.0.43.sql index d6ac3f9a,00000000..d9eb943f mode 100644,000000..100644 --- a/misc/databaseScripts/create_database_V1.0.43.sql +++ b/misc/databaseScripts/create_database_V1.0.43.sql @@@ -1,790 -1,0 +1,795 @@@ +-- Gaslight Media Members Database +-- File Created: 12/09/14 15:27:15 +-- Database Version: 1.0.43 +-- Database Creation Script +-- +-- To permit each query below to be executed separately, +-- all queries must be separated by a line with four dashes + +-- Accommodation Types +CREATE TABLE {prefix}accommodation_types ( + id INT NOT NULL AUTO_INCREMENT, + facility_type INT NULL, -- See "Facility Types" in config/plugin.ini + name TINYTEXT NULL, -- Name of accommodation type + descr TEXT NULL, -- Description of accommodation type + short_descr TINYTEXT NULL, -- Short description of accommodation type + PRIMARY KEY (id), + INDEX(facility_type), + INDEX(name(20)) +); + +---- + +-- Accommodations +CREATE TABLE {prefix}accommodations ( + id INT NOT NULL AUTO_INCREMENT, + active BOOLEAN NULL, -- Accommodation record is active flag + name TINYTEXT NULL, -- Name of the accommodation record + accommodation_type INT NULL, -- Pointer to Accommodation type in accommodation_types table + descr TEXT NULL, -- Description of accommodation + short_descr TINYTEXT NULL, -- Short description of accommodation + url TINYTEXT NULL, -- URL for info regarding this accommodation + notes TEXT NULL, -- Notes regarding this accommodation - Not displayed on front-end + create_time TIMESTAMP NULL, -- Date/time this accommondation was created + modify_time TIMESTAMP NULL, -- Date/time this accommodation was last updated + quant INT NULL, -- Quantity of this accommodation + reservation_url TINYTEXT NULL, -- URL to use for making reservaionn + reservation_id TINYTEXT NULL, -- ID to use as a reference to this accommodation when making reservations + year_round TINYINT(1) NULL, -- Accommodation is available year-round + ref_type INT NULL, -- Type of entity this accommodation is associated with + ref_dest INT NULL, -- Pointer to the specific entity of ref_type this accommodation is associated with + PRIMARY KEY (id), + INDEX(accommodation_type), + INDEX(name(20)), + INDEX(ref_type), + INDEX(ref_dest) +); + +---- + +-- Accounts +CREATE TABLE {prefix}accounts ( + id INT NOT NULL AUTO_INCREMENT, + member INT NULL, + payment_type INT NULL, + invoice_delivery INT NULL, + PRIMARY KEY (id), + INDEX(member) +); + +---- + +-- Activities +CREATE TABLE {prefix}activities ( + id INT NOT NULL AUTO_INCREMENT, + active BOOLEAN NULL, -- Activity is active flag + activity_type INT NULL, -- ***** NEED TO ADD ACTIVITY_TYPES TABLE AND SUPPORT FOR THAT ***** + name TINYTEXT NULL, -- Activity name + descr TEXT NULL, -- Description of activity + short_descr TINYTEXT NULL, -- Shot description of activity + phone TINYTEXT NULL, -- Phone number to contact someone regarding this activity + url TINYTEXT NULL, -- URL for info regarding this activity + notes TEXT NULL, -- Notes regarding this activity - Not displayed on front-end + create_time TIMESTAMP NULL, -- Date/time this activity was created + modify_time TIMESTAMP NULL, -- Date/time this activity was last updated + ref_type INT NULL, -- Type of entity this activity is associated with + ref_dest INT NULL, -- Pointer to the specific entity of type ref_type + PRIMARY KEY (id), + INDEX(activity_type), + INDEX(name(20)), + INDEX(ref_type), + INDEX(ref_dest) +); + +---- + +-- Amenities +CREATE TABLE {prefix}amenities ( + id INT NOT NULL AUTO_INCREMENT, + active TINYINT(1) NULL, -- Amenity is active flag + name TINYTEXT NULL, -- Name of amenity + descr TEXT NULL, -- Description of amenity + short_descr TINYTEXT NULL, -- Short description of amenity + ref_type INT NULL, -- Type of entity these amenitites are associated with - see plugin.ini ref_type tables + uses_value BOOLEAN NULL, -- Flag indicating whether the amenity requires a quantity number + PRIMARY KEY (id), + INDEX(name(20)) +); + +---- + +-- Amenity Reference - Links a specific amenity to a specific entity of type ref_type +CREATE TABLE {prefix}amenity_ref ( + id INT NOT NULL AUTO_INCREMENT, + amenity INT NULL, -- Pointer to amenity in amenities table + ref_type INT NULL, -- Copy of ref_type from matching ameities table entry - to simplify searches + ref_dest INT NULL, -- Pointer to the specific entity of type ref_type + amenity_value TINYTEXT NULL, -- Quanity if amenity uses values + PRIMARY KEY (id), + INDEX(ref_type), + INDEX(ref_dest) +); + +---- + +-- Member Cateogries - used with member information records +CREATE TABLE {prefix}categories ( + id INT NOT NULL AUTO_INCREMENT, + name TINYTEXT NULL, -- Name of this category + descr TEXT NULL, -- Description of this category + short_descr TINYTEXT NULL, -- Short description of this category + parent INT NULL, -- Pointer to parent category in this table - if there is one + PRIMARY KEY (id) +); + +---- + +-- Mapping of categories to speific member information records +CREATE TABLE {prefix}category_member_info ( + id INT NOT NULL AUTO_INCREMENT, + category INT NULL, -- Pointer to category in categories table + member_info INT NULL, -- Pointer to member infomation record + PRIMARY KEY (id), + CONSTRAINT {prefix}categories_fk_1 + FOREIGN KEY (category) + REFERENCES {prefix}categories (id) + ON DELETE CASCADE, + INDEX(category), + INDEX(member_info) +); + +---- + +-- Cities +CREATE TABLE {prefix}cities ( + id INT NOT NULL AUTO_INCREMENT, + name TINYTEXT NULL, -- Name of city + PRIMARY KEY (id) +); + +---- + +-- Contacts - used by various entities +CREATE TABLE {prefix}contacts ( + id INT NOT NULL AUTO_INCREMENT, + active BOOLEAN NULL, -- Contact is active flag - ++ access INT NULL, -- Access type - See access table in plugin.ini + fname TINYTEXT NULL, -- First name of contact + lname TINYTEXT NULL, -- Last name of contact + contact_type INT NULL, -- Contact type - see contact_type table (individual, role, ...) + contact_role INT NULL, -- Contact WordPress user Role + org TINYTEXT NULL, -- Organization name ++ title TINYTEXT NULL, -- Title/Position ++ descr TEXT NULL, -- Description of position/responsibilities - Displayed ++ image TINYTEXT NULL, -- Image + addr1 TINYTEXT NULL, -- Address line 1 - Address is for contact, not necessarily for organization + addr2 TINYTEXT NULL, -- Address line 2 + city INT NULL, -- Pointer to city in cities table + state TINYTEXT NULL, -- Two character state code - matches states.ini entries + country TINYTEXT NULL, -- Two character country code - matches countries.ini entries + zip TINYTEXT NULL, -- ZIP/Postal Code + lat FLOAT NULL, -- Latitude of contact location + lon FLOAT NULL, -- Longitude of contact location + url TINYTEXT NULL, -- URL to information regarding this contact + office_phone TINYTEXT NULL, -- Office phone number + home_phone TINYTEXT NULL, -- Home phone number - or after-hours phone number + mobile_phone TINYTEXT NULL, -- Mobile phone number + alt_phone TINYTEXT NULL, -- An alternate phone number + fax TINYTEXT NULL, -- FAX number (do people still use these?) + email TINYTEXT NULL, -- E-Mail address + alt_email TINYTEXT NULL, -- Alternate E-Mail address - Also used to log-in + username TINYTEXT NULL, -- Optional username to use for login + password TINYTEXT NULL, -- Encrypted password + notes TEXT NULL, -- Notes - Not displayed on front-end + create_time TIMESTAMP NULL, -- Create date/time + modify_time TIMESTAMP NULL, -- Last modified date/time + ref_type INT NULL, -- Type of entity this contact is associated with + ref_dest INT NULL, -- Pointer to the specific entity of ref_type this contact is associated with + PRIMARY KEY (id), + INDEX(fname(20)), + INDEX(lname(20)), + INDEX(city), + INDEX(zip(10)), + INDEX(lat), + INDEX(lon), + INDEX(email(20)) +); + +---- + +-- Facilities - Facilities are separate functional units of a member, either physically or operationally +-- For example, separate facilities could be individual properties (hotels, motels) or could be operationally +-- separate hotel and restaurant at the same location. A facility is an entity under a member "location". +CREATE TABLE {prefix}facilities ( + id INT NOT NULL AUTO_INCREMENT, + active BOOLEAN NULL, -- Facility is active flag + facility_type INT NULL, -- Facility type - see plugin.ini facility type + location INT NULL, -- Pointer to one of the member's locations - see locations table + name TINYTEXT NULL, -- Name of this facility + descr TEXT NULL, -- Description + short_descr TINYTEXT NULL, -- Short description + addr1 TINYTEXT NULL, -- Address line 1 + addr2 TINYTEXT NULL, -- Address line 2 + city INT NULL, -- Pointer to city in cities table + state TINYTEXT NULL, -- Two character state code - matches states.ini entries + country TINYTEXT NULL, -- Two character country code - matches countries.ini entries + zip TINYTEXT NULL, -- ZIP/Postal code + lat FLOAT NULL, -- Latitude of facility + lon FLOAT NULL, -- Longitude of facility + phone TINYTEXT NULL, -- Primary phone number + toll_free TINYTEXT NULL, -- Toll Free phone number + url TINYTEXT NULL, -- URL for information specifically regarding this facility + logo TINYTEXT NULL, -- Logo + notes TEXT NULL, -- Notes - Not displayed on front-end + create_time TIMESTAMP NULL, -- Create date/time + modify_time TIMESTAMP NULL, -- Last modified date/time + PRIMARY KEY (id), + INDEX(name(20)), + INDEX(city), + INDEX(zip(10)), + INDEX(lat), + INDEX(lon) +); + +---- + +-- Donwloadable Files - files are stored under /wp-content/uploads/glm-member-db/files/ +CREATE TABLE {prefix}files ( + id INT NOT NULL AUTO_INCREMENT, + name TINYTEXT NULL, -- Name of this file + file_name TINYTEXT NULL, -- Physical file name for this file + descr TEXT NULL, -- Description + short_descr TINYTEXT NULL, -- Short descroption + size INT NULL, -- Download size of this file + pending BOOLEAN NULL, -- File is pending review flag + create_date DATE NULL, -- Date file was uploaded + ref_type INT NULL, -- Type of entity this file is associated with + ref_dest INT NULL, -- Pointer to the specific entity of ref_type this file is associated with + PRIMARY KEY (id), + INDEX(name(20)), + INDEX(file_name(20)), + INDEX(ref_type), + INDEX(ref_dest) +); + +---- + +-- Detail on golf courses +CREATE TABLE {prefix}golf ( + id INT NOT NULL AUTO_INCREMENT, + active BOOLEAN NULL, -- This golf course is active flag + name TINYTEXT NULL, -- Name of Golf course + descr TEXT NULL, -- Description + short_descr TINYTEXT NULL, -- Short Description + rating TINYTEXT NULL, -- Rating + par TINYTEXT NULL, -- Par + yardage TINYTEXT NULL, -- Total yardage + slope TINYTEXT NULL, -- Slope rating + walking TINYINT(1) NULL, -- Walking course + holes INT NULL, -- Number of holes + reservation_url TINYTEXT NULL, -- URL for making reservations for this course + ref_type INT NULL, -- Type of entity this golf course is associated with + ref_dest INT NULL, -- Pointer to the specific entity of ref_type this golf course is associated with + PRIMARY KEY (id), + INDEX(name(20)), + INDEX(ref_type), + INDEX(ref_dest) +); + +---- + +-- Images - Images are stored under /wp-content/uploads/glm-member-db/images/{size}/ +CREATE TABLE {prefix}images ( + id INT NOT NULL AUTO_INCREMENT, + name TINYTEXT NULL, -- Original name of the image - might be URL if copied via HTTP - status TINYINT(1) NULL, -- Display/Use status - See plugin.ini status table ++ status TINYINT(1) NULL, -- Display/Use status - See plugin.ini status table ++ selected_image BOOLEAN NULL, -- A single special image in the current gallery for this entity ++ featured_image BOOLEAN null, -- Image is a member of a group of featured images + file_name TINYTEXT NULL, -- Stored file name for the image + descr TEXT NULL, -- Description + caption TINYTEXT NULL, -- Caption for the image + position INT NULL, -- Numeric position for sequence of display + ref_type INT NULL, -- Type of entity this image is associated with + ref_dest INT NULL, -- Pointer to the specific entity of ref_type this image is associated with + PRIMARY KEY (id), + INDEX(name(20)), + INDEX(file_name(20)), + INDEX(ref_type), + INDEX(ref_dest) +); + +---- + +-- Member locations - Locations are physically separate campuses where facilities exist +CREATE TABLE {prefix}locations ( + id INT NOT NULL AUTO_INCREMENT, + active BOOLEAN NULL, -- This location is active flag + member INT NULL, -- Pointer to main member record + member_info INT NULL, -- Pointer to associated member info record + name TINYTEXT NULL, -- Name of location + descr TEXT NULL, -- Description + short_descr TINYTEXT NULL, -- Short Description + addr1 TINYTEXT NULL, -- Address line 1 - Main address for this location + addr2 TINYTEXT NULL, -- Address line 2 + city INT NULL, -- Pointer to city in cities table + state TINYTEXT NULL, -- Two character state code - matches states.ini entries + country TINYTEXT NULL, -- Two character country code - matches countries.ini entries + zip TINYTEXT NULL, -- ZIP/Postal code + lat FLOAT NULL, -- Latitude of location + lon FLOAT NULL, -- Longitude of location + region INT NULL, -- Pointer to region where location exists + phone TINYTEXT NULL, -- Primary phone number + toll_free TINYTEXT NULL, -- Toll Free phone number + url TINYTEXT NULL, -- URL for information regarding this location + logo TINYTEXT NULL, -- Logo + notes TEXT NULL, -- Notes - not displayed on front-end + create_time TIMESTAMP NULL, -- Create date/time + modify_time TIMESTAMP NULL, -- Last Update date/time + PRIMARY KEY (id), + INDEX(name(20)), + INDEX(city), + INDEX(zip(10)), + INDEX(lat), + INDEX(lon), + INDEX(region) +); + +---- + +-- Meals offered by a restaurant +CREATE TABLE {prefix}meals ( + id INT NOT NULL AUTO_INCREMENT, + active BOOLEAN NULL, -- Meal is active flag + name TINYTEXT NULL, -- Name of this meal (typically Breakfast, Lunch, Dinner, Brunch, ...) + descr TEXT NULL, -- Description of the meal + short_descr TINYTEXT NULL, -- Short description + menu TEXT NULL, -- Text menu for this meal + menu_file TINYTEXT NULL, -- File name of downloadable menu file (PDF, etc.) + daily BOOLEAN NULL, -- Flag indicating if meal is available daily + daily_start_time TIME NULL, -- Daily meal - Time of day this meal starts + daily_end_time TIME NULL, -- Daily meal - Time of day this meal ends + daily_res_req BOOLEAN NULL, -- Daily meal - Reservations requested + sunday BOOLEAN NULL, -- Flag indicating if meal is available Sunday + sun_menu TEXT NULL, -- Optional menu text for Sunday + sun_start_time TIME NULL, -- Sunday - Time of day this meal starts + sun_end_time TIME NULL, -- Sunday - Time of day this meal ends + sun_res_req BOOLEAN NULL, -- Sunday - Reservations requested + monday BOOLEAN NULL, -- Flag indicating if meal is available Monday + mon_menu TEXT NULL, -- Optional menu text for Monday + mon_start_time TIME NULL, -- Monday - Time of day this meal starts + mon_end_time TIME NULL, -- Monday - Time of day this meal ends + mon_res_req BOOLEAN NULL, -- Monday - Reservations requested + tuesday BOOLEAN NULL, -- Flag indicating if meal is available Tuesday + tue_menu TEXT NULL, -- Optional menu text for Tuesday + tue_start_time TIME NULL, -- Tuesday - Time of day this meal starts + tue_end_time TIME NULL, -- Tuesday - Time of day this meal ends + tue_res_req BOOLEAN NULL, -- Tuesday - Reservations requested + wednesday BOOLEAN NULL, -- Flag indicating if meal is available Wednesday + wed_menu TEXT NULL, -- Optional menu text for Wednesday + wed_start_time TIME NULL, -- Wednesday - Time of day this meal starts + wed_end_time TIME NULL, -- Wednesday - Time of day this meal ends + wed_res_req BOOLEAN NULL, -- Wednesday - Reservations requested + thursday BOOLEAN NULL, -- Flag indicating if meal is available Thursday + thu_menu TEXT NULL, -- Optional menu text for Thursday + thu_start_time TIME NULL, -- Thursday - Time of day this meal starts + thu_end_time TIME NULL, -- Thursday - Time of day this meal ends + thu_res_req BOOLEAN NULL, -- Thursday - Reservations requested + friday BOOLEAN NULL, -- Flag indicating if meal is available Friday + fri_menu TEXT NULL, -- Optional menu text for Friday + fri_start_time TIME NULL, -- Friday - Time of day this meal starts + fri_end_time TIME NULL, -- Friday - Time of day this meal ends + fri_res_req BOOLEAN NULL, -- Friday - Reservations requested + saturday BOOLEAN NULL, -- Flag indicating if meal is available Saturday + sat_menu TEXT NULL, -- Optional menu text for Saturday + sat_start_time TIME NULL, -- Saturday - Time of day this meal starts + sat_end_time TIME NULL, -- Saturday - Time of day this meal ends + sat_res_req BOOLEAN NULL, -- Saturday - Reservations requested + restaurant INT NULL, -- Pointer to restaurant that has this meal + PRIMARY KEY (id), + INDEX(name(20)), + INDEX(restaurant) +); + +---- + +-- Primary member records - One for each member +CREATE TABLE {prefix}members ( + id INT NOT NULL AUTO_INCREMENT, - access INT NULL, -- Access type - See memb_access table in plugin.ini ++ access INT NULL, -- Access type - See access table in plugin.ini + member_type INT NULL, -- Pointer to member type in member_type table + created DATE NULL, -- Date member record was created + name TINYTEXT NULL, -- Member name + member_slug TINYTEXT NULL, -- Member name slug for canonical URLs (lowercase, "-" for spaces, no punctuation) + PRIMARY KEY (id), + INDEX(name(20)), + INDEX(member_slug(20)), + INDEX(created) +); + +---- + +-- Member information version record - May be multiples per member - Only one with stauts "Active" for a distinct date range +CREATE TABLE {prefix}member_info ( + id INT NOT NULL AUTO_INCREMENT, + member INT NULL, -- Pointer to member record in table members + member_name TINYTEXT NULL, -- Copy of member name from members table entry for fast reference + status INT NULL, -- Status of this member information record - See plugin.ini status table + reference_name TINYTEXT NULL, -- Refernce name for this member information record - Not displayed on front-end + descr TEXT NULL, -- Description + short_descr TEXT NULL, -- Short description + addr1 TINYTEXT NULL, -- Address line 1 - Main member address (main location) or + addr2 TINYTEXT NULL, -- Address line 2 + city INT NULL, -- Pointer to City in cities table + state TINYTEXT NULL, -- Two character state code - matches states.ini entries + country TINYTEXT NULL, -- Two character country code - matches countries.ini entries + zip TINYTEXT NULL, -- ZIP/Postal code + lat FLOAT NULL, -- Latitude of member's location + lon FLOAT NULL, -- Longitude of member's location + region INT NULL, -- Pointer to entry in regions table + phone TINYTEXT NULL, -- Primary phone number + toll_free TINYTEXT NULL, -- Toll Free phone number + url TINYTEXT NULL, -- URL with information about this member + email TINYTEXT NULL, -- Main E-Mail address for this member + logo TINYTEXT NULL, -- Member logo + cc_type INT NULL, -- Bitmap of credit card types accepted - See credit_card array in plugin.ini + notes TEXT NULL, -- General notes - Not displayed in front-end + create_time TIMESTAMP NULL, -- Create date/time + modify_time TIMESTAMP NULL, -- Last update date/time + PRIMARY KEY (id), + INDEX(status), + INDEX(city), + INDEX(zip(10)), + INDEX(lat), + INDEX(lon), + INDEX(region) +); + +---- + +-- Member type - Can be used to assign members to different "classes" of membership (i.e. Full, Associate, Premium) +-- Mostly for internal use by the member organization, but could be displayed - Consider a short_description if they are. +CREATE TABLE {prefix}member_type ( + id INT NOT NULL AUTO_INCREMENT, + name TINYTEXT NULL, -- Name of member type + descr TINYTEXT NULL, -- Description of member type + PRIMARY KEY (id) +); + +---- + +-- Regions - Used to segment members into various geographical regions - can be cities, counties, or other logical regions +CREATE TABLE {prefix}regions ( + id INT NOT NULL AUTO_INCREMENT, + name TINYTEXT NULL, -- Name of region + descr TEXT NULL, -- Descrption of region + short_descr TINYTEXT NULL, -- Short descroption of region + PRIMARY KEY (id) +); + +---- + +-- Resturaunt Types - Various general types of restaurants (i.e. Fast Food, Ethnic, Fine food, ...) +CREATE TABLE {prefix}restaurant_types ( + id INT NOT NULL AUTO_INCREMENT, + name TINYTEXT NULL, -- Name of restaurant type + descr TEXT NULL, -- Description + short_descr TINYTEXT NULL, -- Short Description + PRIMARY KEY (id), + INDEX(name(20)) +); + +---- + +-- Restaurants +CREATE TABLE {prefix}restaurants ( + id INT NOT NULL AUTO_INCREMENT, + active BOOLEAN NULL, -- This restaurant is active flag + name TINYTEXT NULL, -- Name of restaurant + restaurant_type INT NULL, -- Pointer to restaurant_types table entry + descr TEXT NULL, -- Description + short_descr TINYTEXT NULL, -- Short Description + url TINYTEXT NULL, -- URL of Web page about this restaurant + reservation_url TINYTEXT NULL, -- Reservations URL + phone TINYTEXT NULL, -- Phone number / reservations number + hours_descr TINYTEXT NULL, -- Description of restaurant hours + alcohol BOOLEAN NULL, -- Flag indicating whether restaurant serves alcohol + non_smoking BOOLEAN NULL, -- Flag indicating whether restaurant is non-smoking only + notes TEXT NULL, -- General notes + ref_type INT NULL, -- Type of entity this restaurant is associated with + ref_dest INT NULL, -- Pointer to the specific entity of ref_type this restaurant is associated with + PRIMARY KEY (id), + INDEX(restaurant_type), + INDEX(name(20)), + INDEX(ref_type), + INDEX(ref_dest) +); + +---- + +-- General settings available on Management page in admin - Only 1 entry in this table +-- Items in this table should be all self-explanatory +CREATE TABLE {prefix}settings_general ( + id INT NOT NULL AUTO_INCREMENT, + admin_debug BOOLEAN DEFAULT '1', + admin_debug_verbose BOOLEAN DEFAULT '0', + front_debug BOOLEAN DEFAULT '0', + front_debug_verbose BOOLEAN DEFAULT '0', + google_maps_api_key TINYTEXT DEFAULT '', + maps_default_lat FLOAT DEFAULT '45.3749', + maps_default_lon FLOAT DEFAULT '-84.9592', + maps_default_zoom INTEGER DEFAULT '10', + time_zone TINYTEXT DEFAULT NULL, + canonical_member_page TINYTEXT DEFAULT NULL, + list_show_map BOOLEAN DEFAULT '1', + list_show_list BOOLEAN DEFAULT '1', + list_show_search BOOLEAN DEFAULT '1', + list_show_search_text BOOLEAN DEFAULT '1', + list_show_search_category BOOLEAN DEFAULT '1', + list_show_search_amenities BOOLEAN DEFAULT '1', + list_show_search_alpha BOOLEAN DEFAULT '1', + list_show_detail_link BOOLEAN DEFAULT '1', + list_show_logo BOOLEAN DEFAULT '1', + list_logo_size TINYTEXT NULL, + list_show_address BOOLEAN DEFAULT '1', + list_show_street BOOLEAN DEFAULT '1', + list_show_citystatezip BOOLEAN DEFAULT '1', + list_show_country BOOLEAN DEFAULT '1', + list_show_region BOOLEAN DEFAULT '1', + list_show_descr BOOLEAN DEFAULT '0', + list_show_short_descr BOOLEAN DEFAULT '1', + list_show_phone BOOLEAN DEFAULT '1', + list_show_tollfree BOOLEAN DEFAULT '1', + list_show_url BOOLEAN DEFAULT '1', + list_show_url_newtarget BOOLEAN DEFAULT '1', + list_show_email BOOLEAN DEFAULT '1', + list_show_categories BOOLEAN DEFAULT '1', + list_show_creditcards BOOLEAN DEFAULT '1', + list_show_amenities BOOLEAN DEFAULT '0', + list_map_show_detaillink BOOLEAN DEFAULT '1', + list_map_show_logo BOOLEAN DEFAULT '0', + list_map_logo_size TINYTEXT NULL, + list_map_show_descr BOOLEAN DEFAULT '0', + list_map_show_short_descr BOOLEAN DEFAULT '1', + list_map_show_address BOOLEAN DEFAULT '1', + list_map_show_street BOOLEAN DEFAULT '1', + list_map_show_citystatezip BOOLEAN DEFAULT '1', + list_map_show_country BOOLEAN DEFAULT '1', + list_map_show_region BOOLEAN DEFAULT '1', + list_map_show_phone BOOLEAN DEFAULT '1', + list_map_show_tollfree BOOLEAN DEFAULT '1', + list_map_show_url BOOLEAN DEFAULT '1', + list_map_show_url_newtarget BOOLEAN DEFAULT '1', + list_map_show_email BOOLEAN DEFAULT '1', + list_map_show_categories BOOLEAN DEFAULT '0', + list_map_show_creditcards BOOLEAN DEFAULT '0', + list_map_show_amenities BOOLEAN DEFAULT '0', + detail_show_map BOOLEAN DEFAULT '1', + detail_show_directions BOOLEAN DEFAULT '1', + detail_show_logo BOOLEAN DEFAULT '1', + detail_logo_size TINYTEXT NULL, + detail_show_descr BOOLEAN DEFAULT '1', + detail_show_short_descr BOOLEAN DEFAULT '0', + detail_show_address BOOLEAN DEFAULT '1', + detail_show_street BOOLEAN DEFAULT '1', + detail_show_citystatezip BOOLEAN DEFAULT '1', + detail_show_country BOOLEAN DEFAULT '1', + detail_show_region BOOLEAN DEFAULT '1', + detail_show_phone BOOLEAN DEFAULT '1', + detail_show_tollfree BOOLEAN DEFAULT '1', + detail_show_url BOOLEAN DEFAULT '1', + detail_show_url_newtarget BOOLEAN DEFAULT '1', + detail_show_email BOOLEAN DEFAULT '1', + detail_show_categories BOOLEAN DEFAULT '1', + detail_show_creditcards BOOLEAN DEFAULT '1', + detail_show_amenities BOOLEAN DEFAULT '1', + detail_show_imagegallery BOOLEAN DEFAULT '1', + detail_show_coupons BOOLEAN DEFAULT '0', + detail_show_packages BOOLEAN DEFAULT '0', + detail_map_show_logo BOOLEAN DEFAULT '0', + detail_map_logo_size TINYTEXT NULL, + detail_map_show_descr BOOLEAN DEFAULT '0', + detail_map_show_short_descr BOOLEAN DEFAULT '1', + detail_map_show_address BOOLEAN DEFAULT '1', + detail_map_show_street BOOLEAN DEFAULT '1', + detail_map_show_citystatezip BOOLEAN DEFAULT '1', + detail_map_show_country BOOLEAN DEFAULT '1', + detail_map_show_region BOOLEAN DEFAULT '1', + detail_map_show_phone BOOLEAN DEFAULT '1', + detail_map_show_tollfree BOOLEAN DEFAULT '1', + detail_map_show_url BOOLEAN DEFAULT '1', + detail_map_show_url_newtarget BOOLEAN DEFAULT '1', + detail_map_show_email BOOLEAN DEFAULT '1', + detail_map_show_categories BOOLEAN DEFAULT '0', + detail_map_show_creditcards BOOLEAN DEFAULT '0', + detail_map_show_amenities BOOLEAN DEFAULT '0', + PRIMARY KEY (id) +); + +---- + +-- Set default entry +INSERT INTO {prefix}settings_general + ( id, time_zone, canonical_member_page ) + VALUES + ( 1, 'America/Detroit', 'member-detail' ) +; + +---- + +-- Terms used in site modifiable on Management page in admin - Only 1 entry in this table +-- Tems in this table should be all self-explanatory +CREATE TABLE {prefix}settings_terms ( + id INT NOT NULL AUTO_INCREMENT, + term_admin_menu_members TINYTEXT NULL, + term_admin_menu_member_list TINYTEXT NULL, + term_admin_menu_member TINYTEXT NULL, + term_admin_menu_configure TINYTEXT NULL, + term_admin_menu_settings TINYTEXT NULL, + term_admin_menu_shortcodes TINYTEXT NULL, + term_admin_menu_members_dashboard TINYTEXT NULL, + term_admin_menu_members_list TINYTEXT NULL, + term_admin_menu_members_reports TINYTEXT NULL, + term_admin_menu_member_dashboard TINYTEXT NULL, + term_admin_menu_member_info TINYTEXT NULL, + term_admin_menu_member_locations TINYTEXT NULL, + term_admin_menu_member_facilities TINYTEXT NULL, + term_admin_menu_member_attractions TINYTEXT NULL, + term_admin_menu_member_contacts TINYTEXT NULL, + term_admin_menu_configure_member_types TINYTEXT NULL, + term_admin_menu_configure_member_cats TINYTEXT NULL, + term_admin_menu_configure_accom_types TINYTEXT NULL, + term_admin_menu_configure_amenities TINYTEXT NULL, + term_admin_menu_configure_cities TINYTEXT NULL, + term_admin_menu_configure_regions TINYTEXT NULL, + term_admin_menu_settings_general TINYTEXT NULL, + term_admin_menu_settings_terms TINYTEXT NULL, + term_admin_menu_settings_development TINYTEXT NULL, + term_member TINYTEXT NULL, + term_member_cap TINYTEXT NULL, + term_member_plur TINYTEXT NULL, + term_member_plur_cap TINYTEXT NULL, + term_location TINYTEXT NULL, + term_location_cap TINYTEXT NULL, + term_location_plur TINYTEXT NULL, + term_location_plur_cap TINYTEXT NULL, + term_facility TINYTEXT NULL, + term_facility_cap TINYTEXT NULL, + term_facility_plur TINYTEXT NULL, + term_facility_plur_cap TINYTEXT NULL, + term_attraction TINYTEXT NULL, + term_attraction_cap TINYTEXT NULL, + term_attraction_plur TINYTEXT NULL, + term_attraction_plur_cap TINYTEXT NULL, + term_contact TINYTEXT NULL, + term_contact_cap TINYTEXT NULL, + term_contact_plur TINYTEXT NULL, + term_contact_plur_cap TINYTEXT NULL, + PRIMARY KEY (id) +); + +---- + +-- Default terms entry +INSERT INTO {prefix}settings_terms + ( + id, + term_admin_menu_members, + term_admin_menu_member_list, + term_admin_menu_member, + term_admin_menu_configure, + term_admin_menu_settings, + term_admin_menu_shortcodes, + term_admin_menu_members_dashboard, + term_admin_menu_members_list, + term_admin_menu_members_reports, + term_admin_menu_member_dashboard, + term_admin_menu_member_info, + term_admin_menu_member_locations, + term_admin_menu_member_facilities, + term_admin_menu_member_attractions, + term_admin_menu_member_contacts, + term_admin_menu_configure_member_types, + term_admin_menu_configure_member_cats, + term_admin_menu_configure_accom_types, + term_admin_menu_configure_amenities, + term_admin_menu_configure_cities, + term_admin_menu_configure_regions, + term_admin_menu_settings_general, + term_admin_menu_settings_terms, + term_admin_menu_settings_development, + term_member, + term_member_cap, + term_member_plur, + term_member_plur_cap, + term_location, + term_location_cap, + term_location_plur, + term_location_plur_cap, + term_facility, + term_facility_cap, + term_facility_plur, + term_facility_plur_cap, + term_attraction, + term_attraction_cap, + term_attraction_plur, + term_attraction_plur_cap, + term_contact, + term_contact_cap, + term_contact_plur, + term_contact_plur_cap + ) + VALUES + ( + 1, + 'Members', + 'Member', - 'Add Member', ++ 'Member', + 'Configure', + 'Management', + 'Shortcodes', + 'Dashboard', + 'Member List', + 'Reports', + 'Member Dashboard', + 'Member Info', + 'Locations', + 'Facilities', + 'Attractions', + 'Contacts', + 'Member Types', + 'Member Categories', + 'Accommodation Types', + 'Amenities', + 'Cities', + 'Regions', + 'General Settings', + 'Terms & Phrases', + 'Development', + 'member', + 'Member', + 'members', + 'Members', + 'location', + 'Location', + 'locations', + 'Locations', + 'facility', + 'Facility', + 'facilities', + 'Facilities', + 'attraction', + 'Attraction', + 'attractions', + 'Attractions', + 'contact', + 'Contact', + 'contacts', + 'Contacts' + ) +; + +---- + +-- Social Media types (i.e. Facebook, Twitter, ...) +CREATE TABLE {prefix}social_media ( + id INT NOT NULL AUTO_INCREMENT, + name TINYTEXT NULL, -- Name of this social media service + descr TEXT NULL, -- Description + short_descr TINYTEXT NULL, -- Short Description + PRIMARY KEY (id) +); + +---- + +-- Social media to entity cross-reference table +CREATE TABLE {prefix}social_media_ref ( + id INT NOT NULL AUTO_INCREMENT, + ref_type INT NULL, -- Type of entity this entry is associated with + ref_dest INT NULL, -- Pointer to the specific entity of ref_type + social_media INT NULL, -- Pointer to entry in social_media table + url TINYTEXT NULL, -- URL to this social media service + PRIMARY KEY (id), + INDEX(ref_type), + INDEX(ref_dest), + INDEX(social_media) +); diff --cc misc/databaseScripts/update_database_V1.0.43.sql index 7a07b1c8,00000000..921f4bd4 mode 100644,000000..100644 --- a/misc/databaseScripts/update_database_V1.0.43.sql +++ b/misc/databaseScripts/update_database_V1.0.43.sql @@@ -1,205 -1,0 +1,209 @@@ +-- Gaslight Media Members Database +-- File Created: 12/09/14 15:27:15 +-- Database Version: 1.0.28 +-- Database Update From Previous Version Script +-- +-- To permit each query below to be executed separately, +-- all queries must be separated by a line with four dashses + +RENAME TABLE {prefix}activties to {prefix}activities; + +---- + - CREATE TABLE {prefix}contact_permissions ( - id INT NOT NULL AUTO_INCREMENT, - permission INT NULL, - contact INT NULL, - PRIMARY KEY (id), - CONSTRAINT {prefix}contact_fk_1 - FOREIGN KEY (contact) - REFERENCES {prefix}contacts (id) - ON DELETE CASCADE, - INDEX(permission), - INDEX(contact) - ); - - ---- - +ALTER TABLE {prefix}contacts ADD COLUMN username TINYTEXT; + +---- + +ALTER TABLE {prefix}activities DROP COLUMN facility; + +---- + +ALTER TABLE {prefix}accommodations ADD COLUMN url TINYTEXT; + +---- + +ALTER TABLE {prefix}accommodations ADD COLUMN notes TEXT; + +---- + +ALTER TABLE {prefix}accommodations ADD COLUMN create_time TIMESTAMP; + +---- + +ALTER TABLE {prefix}accommodations ADD COLUMN modify_time TIMESTAMP; + +---- + +ALTER TABLE {prefix}contacts MODIFY state TINYTEXT; + +---- + +ALTER TABLE {prefix}contacts MODIFY country TINYTEXT; + +---- + +ALTER TABLE {prefix}contacts DROP COLUMN permissions; + +---- + +ALTER TABLE {prefix}facilities MODIFY state TINYTEXT; + +---- + +ALTER TABLE {prefix}facilities MODIFY country TINYTEXT; + +---- + +ALTER TABLE {prefix}files MODIFY pending BOOLEAN; + +---- + +ALTER TABLE {prefix}locations DROP COLUMN location_type; + +---- + +ALTER TABLE {prefix}locations ADD COLUMN member_info INT; + +---- + +ALTER TABLE {prefix}locations MODIFY state TINYTEXT; + +---- + +ALTER TABLE {prefix}locations MODIFY country TINYTEXT; + +---- + +ALTER TABLE {prefix}meals ADD COLUMN menu_file TINYTEXT; + +---- + +ALTER TABLE {prefix}meals DROP COLUMN special_menu; + +---- + +ALTER TABLE {prefix}meals DROP COLUMN daily_time; + +---- + +ALTER TABLE {prefix}meals ADD COLUMN daily BOOLEAN; + +---- + +ALTER TABLE {prefix}meals MODIFY daily_res_req BOOLEAN; + +---- + +ALTER TABLE {prefix}meals MODIFY sunday BOOLEAN; + +---- + +ALTER TABLE {prefix}meals MODIFY sun_res_req BOOLEAN; + +---- + +ALTER TABLE {prefix}meals MODIFY monday BOOLEAN; + +---- + +ALTER TABLE {prefix}meals MODIFY tuesday BOOLEAN; + +---- + +ALTER TABLE {prefix}meals MODIFY wednesday BOOLEAN; + +---- + +ALTER TABLE {prefix}meals MODIFY thursday BOOLEAN; + +---- + +ALTER TABLE {prefix}meals MODIFY friday BOOLEAN; + +---- + +ALTER TABLE {prefix}meals MODIFY saturday BOOLEAN; + +---- + +ALTER TABLE {prefix}meals MODIFY mon_res_req BOOLEAN; + +---- + +ALTER TABLE {prefix}meals MODIFY tue_res_req BOOLEAN; + +---- + +ALTER TABLE {prefix}meals MODIFY wed_res_req BOOLEAN; + +---- + +ALTER TABLE {prefix}meals MODIFY thu_res_req BOOLEAN; + +---- + +ALTER TABLE {prefix}meals MODIFY fri_res_req BOOLEAN; + +---- + +ALTER TABLE {prefix}meals MODIFY sat_res_req BOOLEAN; + +---- + +ALTER TABLE {prefix}meals DROP COLUMN ref_type; + +---- + +ALTER TABLE {prefix}meals DROP COLUMN ref_dest; + +---- + +CREATE INDEX meal_restaurant ON {prefix}meals (restaurant); + +---- + +ALTER TABLE {prefix}restaurant_types DROP COLUMN active; + +---- + +ALTER TABLE {prefix}restaurants DROP COLUMN menu; + +---- + +ALTER TABLE {prefix}restaurants DROP COLUMN special_menu; + +---- + +ALTER TABLE {prefix}restaurants MODIFY alcohol BOOLEAN; + +---- + +ALTER TABLE {prefix}restaurants MODIFY non_smoking BOOLEAN; + +---- + - DROP TABLE {prefix}contact_permissions IF EXISTS; ++ALTER TABLE {prefix}contacts ADD COLUMN contact_role INT; + +---- + - ALTER TABLE {prefix}contacts ADD COLUMN contact_role INT; ++ALTER TABLE {prefix}contacts ADD COLUMN access int null; ++ ++---- ++ ++ALTER TABLE {prefix}contacts ADD COLUMN title tinytext null; ++ ++---- ++ ++ALTER TABLE {prefix}contacts ADD COLUMN descr text null; ++ ++---- ++ ++ALTER TABLE {prefix}contacts ADD COLUMN image tinytext null; ++ ++---- ++ ++ALTER TABLE {prefix}images ADD COLUMN selected BOOLEAN null; ++ ++---- + ++ALTER TABLE {prefix}images ADD COLUMN featured BOOLEAN null; diff --cc models/admin/management/addons.php index 291462a3,00000000..27ee536b mode 100644,000000..100644 --- a/models/admin/management/addons.php +++ b/models/admin/management/addons.php @@@ -1,110 -1,0 +1,116 @@@ + + * @license http://www.gaslightmedia.com Gaslightmedia + * @version 1.0.43 + */ + +/* + * This class performs the work for the default action of the "Members" menu + * option, which is to display the members dashboard. + * + */ +class GlmMembersAdmin_management_addons +{ + + /** + * WordPress Database Object + * + * @var $wpdb + * @access public + */ + public $wpdb; + /** + * Plugin Configuration Data + * + * @var $config + * @access public + */ + public $config; + + /* + * Constructor + * + * This contructor sets up this model. At this time that only includes + * storing away the WordPress data object. + * + * @return object Class object + * + */ + public function __construct ($wpdb, $config) + { + + // Save WordPress Database object + $this->wpdb = $wpdb; + + // Save plugin configuration object + $this->config = $config; + + } + + /* + * Perform Model Action + * + * This method does the work for this model and returns any resulting data + * + * @return array Status and data array + * + * 'status' + * + * True if successfull and false if there was a fatal failure. + * + * 'menuItemRedirect' + * + * If not false, provides a menu item the controller should + * execute after this one. Normally if this is used, there would also be a + * modelRedirect value supplied as well. + * + * 'modelRedirect' + * + * If not false, provides an action the controller should execute after + * this one. + * + * 'view' + * + * A suggested view name that the contoller should use instead of the + * default view for this model or false to indicate that the default view + * should be used. + * + * 'data' + * + * Data that the model is returning for use in merging with the view to + * produce output. + * + */ + public function modelAction ($actionData = false) + { ++ $addOns = array(); ++ ++ foreach ($this->config['addOns'] as $a) { ++ $addOns[$a['slug']] = $a; ++ $addOns[$a['slug']]['print_r'] = print_r($a,1); ++ } + + // Return status, suggested view, and data to controller + return array( + 'status' => true, + 'menuItemRedirect' => false, + 'modelRedirect' => false, + 'view' => 'admin/management/addons.html', + 'data' => array( - 'addOns' => $this->config['addOns'] ++ 'addOns' => $addOns + ) + ); + + } + +} + +?> diff --cc models/admin/management/import.php index f18b7c4c,f18b7c4c..b8dcc7d0 --- a/models/admin/management/import.php +++ b/models/admin/management/import.php @@@ -835,13 -835,13 +835,13 @@@ class GlmMembersAdmin_management_impor if ($val['active'] == 't') { // Member is active, so set to active-moderated -- $access = $this->config['memb_access_numb']['Moderated']; ++ $access = $this->config['access_numb']['Moderated']; $numbMembersActive++; } else { // Member is not active, so set to no display no access -- $access = $this->config['memb_access_numb']['NotDisplayed']; ++ $access = $this->config['access_numb']['NotDisplayed']; $numbMembersInactive++; } diff --cc models/admin/management/index.php index 43299bec,43299bec..09e36f28 --- a/models/admin/management/index.php +++ b/models/admin/management/index.php @@@ -98,6 -98,6 +98,8 @@@ class GlmMembersAdmin_management_index */ public function modelAction ($actionData = false) { ++ $settingsUpdated = false; ++ // General settings are always stored in a record with ID=1. $id = 1; @@@ -127,6 -127,6 +129,9 @@@ // Update the general settings $generalSettings = $this->updateEntry(1); ++ if ($generalSettings['status']) { ++ $settingsUpdated = true; ++ } // Display admin message that the data has been updated glmMembersAdmin::addNotice('General Settings for the '.GLM_MEMBERS_PLUGIN_NAME.' plugin have been updated.', 'AdminNotice'); @@@ -165,8 -165,8 +170,8 @@@ $templateData = array( 'reason' => '', 'genSettings' => $generalSettings, -- 'timezones' => DateTimeZone::listIdentifiers() --// 'canEdit' => $canEdit ++ 'timezones' => DateTimeZone::listIdentifiers(), ++ 'settingsUpdated' => $settingsUpdated ); // Return status, suggested view, and data to controller diff --cc models/admin/member/index.php index d88174e0,7b3855b3..9521948b --- a/models/admin/member/index.php +++ b/models/admin/member/index.php @@@ -102,9 -102,9 +102,10 @@@ class GlmMembersAdmin_member_index exte $success = true; $haveMember = false; $memberData = false; ++ $memberName = false; $memberID = 0; $archived = false; -- $updated = false; ++ $memberUpdated = false; $haveMemberInfo = false; // Check for required Member Types @@@ -113,8 -113,8 +114,14 @@@ $memberTypesStats = $MemberTypes->getStats(); $haveMemberTypes = ($memberTypesStats > 0); ++ // Check if there's a logged in user who is locked to their own entity ++ $lockedToMember = apply_filters('glm_members_locked_to_member_id', false); ++ if ($lockedToMember) { ++ ++ $memberID = $lockedToMember; ++ // Check if a redirecting model supplied the member ID -- if (isset($actionData['memberID'])) { ++ } elseif (isset($actionData['memberID'])) { $memberID = $actionData['memberID']; @@@ -142,16 -147,19 +149,11 @@@ $memberID = $memberData['fieldData']['id']; $haveMember = true; - // Go directly to the member information entry page - return array( - 'status' => true, - 'menuItemRedirect' => 'member', - 'modelRedirect' => 'memberInfo', - 'view' => 'admin/member/memberInfo.html', - 'data' => array( - 'member' => $memberID - ) - ); + // Update the member slug then get member data again + $this->updateSlug($memberID); + - // Go directly to the member information entry page - return array( - 'status' => true, - 'menuItemRedirect' => 'member', - 'modelRedirect' => 'memberInfo', - 'view' => 'admin/member/memberInfo.html', - 'data' => array( - 'member' => $memberID - ) - ); ++ // Now get the updated entry with the slug ++ $memberData = $this->editEntry($memberID); } @@@ -189,8 -196,10 +190,10 @@@ // If update was successful then use editEntry() to setup for the edit again. if ($memberData['status']) { + $slug = $this->updateSlug($memberID); + $memberData = $this->editEntry($memberID); -- $updated = true; ++ $memberUpdated = true; // Also update all member info records with any possible name change $sql = " @@@ -298,6 -307,6 +301,9 @@@ $showArchived = false; if ($haveMember) { ++ // Get member name for title ++ $memberName = $memberData['fieldData']['name']; ++ // Hide archived unless instructed otherwise $hideArchived = ''; if (!isset($_REQUEST['showArchived']) || $_REQUEST['showArchived'] != 'true') { @@@ -330,18 -339,18 +336,21 @@@ } ++ // Compile template data $templateData = array( 'haveMemberTypes' => $haveMemberTypes, 'haveMember' => $haveMember, 'memberID' => $memberID, 'member' => $memberData, ++ 'memberName' => $memberName, 'haveInfoRecords' => $haveInfoRecords, 'memberInfoRecords' => $memberInfoRecords, 'noActive' => $noActive, 'showArchived' => $showArchived, 'haveMemberInfo' => $haveMemberInfo, -- 'updated' => $updated, ++ 'memberUpdated' => $memberUpdated, ++ 'statusTypeNumbers' => $this->config['status_numb'], 'statusPending' => $this->config['status_numb']['Pending'] ); diff --cc models/admin/member/memberInfo.php index 4550b20e,01a3b908..c7600028 --- a/models/admin/member/memberInfo.php +++ b/models/admin/member/memberInfo.php @@@ -219,6 -219,6 +219,7 @@@ class GlmMembersAdmin_member_memberInf { $this->optionIncludeSelectListData = true; ++ $memberUpdated = false; // Check for action option - Should be one of the values in the "switch" statement below $option = false; @@@ -274,6 -274,6 +275,7 @@@ $this->memberData = $Members->getEntry($this->memberID); $this->fields['logo']['i_prefix'] = 'memb_'.$this->memberID.'_'; $this->haveMember = true; ++ $memberName = $this->memberData['name']; // If no member info record, assume that we need to create a new one if ($this->memberInfoID <= 0 && $option != 'addNew') { @@@ -308,6 -308,6 +310,7 @@@ // Update submitted amenities $this->updateAmenities(); ++ // Load Image data class require_once(GLM_MEMBERS_PLUGIN_CLASS_PATH.'/data/dataImages.php'); $Images = new GlmDataImages($this->wpdb, $this->config); @@@ -318,10 -318,10 +321,13 @@@ if ($this->haveMemberInfo) { // Update the member Info data -- $this->memberInfo = $this->updateEntry($this->memberInfoID, 'id', true, true); ++ if ($this->memberInfo['status']) { ++ $memberUpdated = true; ++ } break; ++ } else { if (GLM_MEMBERS_PLUGIN_ADMIN_DEBUG) { @@@ -360,6 -360,6 +366,7 @@@ ;"; $this->wpdb->query($sql); ++ $this->memberInfo = $this->editEntry($this->memberInfoID); } break; @@@ -472,10 -472,10 +479,13 @@@ // Compile template data $templateData = array( ++ 'haveMember' => $this->haveMember, 'memberID' => $this->memberID, 'member' => $this->memberData, ++ 'memberName' => $memberName, 'memberInfoID' => $this->memberInfoID, 'memberInfo' => $this->memberInfo, ++ 'memberUpdated' => $memberUpdated, 'availableCategories' => $this->categories, 'availableAmenities' => $this->amenities, 'haveImageGallery' => $this->haveImageGallery, @@@ -713,11 -713,11 +723,11 @@@ } // For each amityy being submitted // Update the selected amenities for this member information record, returns new list -- $this->memberAmenities = $Amenities->updateAmenityRef($this->config['ref_type_numb']['MemberInfo'], $this->memberID, $selectedAmenities); ++ $this->memberAmenities = $Amenities->updateAmenityRef($this->config['ref_type_numb']['MemberInfo'], $this->memberInfoID, $selectedAmenities); // Otherwise if this is a submission and there's no categories submitted, make sure there's none stored } elseif (isset($_REQUEST['option']) && $_REQUEST['option'] == 'submit') { -- $this->memberAmenities = $Amenities->updateAmenityRef($this->config['ref_type_numb']['MemberInfo'], $this->memberID); ++ $this->memberAmenities = $Amenities->updateAmenityRef($this->config['ref_type_numb']['MemberInfo'], $this->memberInfoID); } } diff --cc models/admin/members/list.php index d34b478a,6bd88f03..3a154f90 --- a/models/admin/members/list.php +++ b/models/admin/members/list.php @@@ -106,25 -106,24 +106,18 @@@ class GlmMembersAdmin_members_list exte $where = ' true '; $filterPending = false; $filterArchived = false; -- $filterName = false; + $filterCat = false; $haveFilter = false; -- if (isset($_REQUEST['filterName'])) { -- $filterName = $_REQUEST['filterName']; -- $where .= " AND T.name like '%$filterName%'"; -- $haveFilter = true; -- } -- // Check if this is a request to show archived members if (isset($_REQUEST['filterArchived'])) { -- $where .= " AND T.access = ".$this->config['memb_access_numb']['Archived']; ++ $where .= " AND T.access = ".$this->config['access_numb']['Archived']; $filterArchived = true; $haveFilter = true; // If not, don't show them } else { -- $where .= " AND T.access != ".$this->config['memb_access_numb']['Archived']; ++ $where .= " AND T.access != ".$this->config['access_numb']['Archived']; } // Get a list of categories for filtering @@@ -201,7 -200,7 +194,6 @@@ 'filterArchived' => $filterArchived, 'filterPending' => $filterPending, 'filterCat' => $filterCat, -- 'filterName' => stripslashes($filterName) // 'canEdit' => $canEdit ); diff --cc models/front/members/detail.php index e6371035,e6371035..50de114a --- a/models/front/members/detail.php +++ b/models/front/members/detail.php @@@ -246,9 -246,9 +246,9 @@@ class GlmMembersFront_members_detail ex FROM ".GLM_MEMBERS_PLUGIN_DB_PREFIX."members WHERE id = T.member ) IN ( -- ".$this->config['memb_access_numb']['NoAccess'].", -- ".$this->config['memb_access_numb']['Moderated'].", -- ".$this->config['memb_access_numb']['Full']." ++ ".$this->config['access_numb']['NoAccess'].", ++ ".$this->config['access_numb']['Moderated'].", ++ ".$this->config['access_numb']['Full']." ) "; $memberInfoID = $this->getActiveInfoForMember($id, $where); diff --cc models/front/members/list.php index c9054b5f,c9054b5f..f42bf877 --- a/models/front/members/list.php +++ b/models/front/members/list.php @@@ -399,16 -399,16 +399,16 @@@ class GlmMembersFront_members_list exte } // If an amenity search has been selected } // it doing amenity search -- // Only look at active member information where the member is displayable (memb_access = 20, 30, 40) ++ // Only look at active member information where the member is displayable (access = 20, 30, 40) $where .= $whereSep." ( SELECT access FROM ".GLM_MEMBERS_PLUGIN_DB_PREFIX."members WHERE id = T.member ) IN ( -- ".$this->config['memb_access_numb']['NoAccess'].", -- ".$this->config['memb_access_numb']['Moderated'].", -- ".$this->config['memb_access_numb']['Full']." ++ ".$this->config['access_numb']['NoAccess'].", ++ ".$this->config['access_numb']['Moderated'].", ++ ".$this->config['access_numb']['Full']." ) AND T.status = ".$this->config['status_numb']['Active']; diff --cc views/admin/dashboardWidget/index.html index 063bff3a,063bff3a..c4223872 --- a/views/admin/dashboardWidget/index.html +++ b/views/admin/dashboardWidget/index.html @@@ -1,59 -1,59 +1,92 @@@ --{if $membersList} ++{if apply_filters('glm_members_permit_admin_widget_members', true)} ++ {if $membersList} ++ ++ {/if} ++ {/if} --{if !$haveMemberTypes} ++ ++{if apply_filters('glm_members_permit_admin_widget_warnings', true)} ++ {if !$haveMemberTypes} --{/if} --{if !$haveCategories} ++ {/if} ++ {if !$haveCategories} --{/if} --{if !$haveAccommodationTypes} ++ {/if} ++ {if !$haveAccommodationTypes} --{/if} --{if !$haveAmenities} ++ {/if} ++ {if !$haveAmenities} --{/if} --{if !$haveCities} ++ {/if} ++ {if !$haveCities} --{/if} --{if !$haveRegions} ++ {/if} ++ {if !$haveRegions} --{/if} --{if $numbMembers == 0} ++ {/if} ++ {if $numbMembers == 0} --{/if} ++ {/if}
-- ++ Member Search:
No Member Types Add
No Member Categories Add
No Accommodation Types Add
No Amenities Add
No Cities Add
No Regions Add
No Members Add a Member
Number of Members Listed: List Members{$numbMembers}
-- --{if $haveBadLatLon} ++ ++ {if $haveBadLatLon}

Records with Bad Map Locations

@@@ -73,13 -73,13 +106,15 @@@ {/foreach} ++ {/if} {/if} --{if $membersPending} ++{if apply_filters('glm_members_permit_admin_widget_pending_info', true)} ++ {if $membersPending}

Pending Member Information

-- ++
{assign var="i" value="0"} {foreach $pendingList as $p} @@@ -89,41 -89,41 +124,16 @@@ {/if} {/foreach}
-- {$p.member} ++ ++ {$p.member}: ++ {$p.reference_name} ++
++ {/if} {/if} --{if $membersList} -- --{/if} ++ diff --cc views/admin/management/addons.html index 4deb4bf3,00000000..76dcda74 mode 100644,000000..100644 --- a/views/admin/management/addons.html +++ b/views/admin/management/addons.html @@@ -1,25 -1,0 +1,17 @@@ +{include file='admin/management/header.html'} + +

Currently Installed and Active GLM Members DB Add-Ons

+ +{if $addOns} + - - - {assign var="i" value="0"} ++ - {else} - - {/if} - - ++
  • ++ {$a.name}
    ++
    {$a.print_r}
    ++
  • + {/foreach} - -
    - {$a.name} -
    ++ +{/if} + +{include file='admin/footer.html'} diff --cc views/admin/management/hooks.html index 15a4eb86,00000000..39b5867c mode 100644,000000..100644 --- a/views/admin/management/hooks.html +++ b/views/admin/management/hooks.html @@@ -1,152 -1,0 +1,368 @@@ +{include file='admin/management/header.html'} + +

    Hooks Into GLM Member DB Reference

    + +

    + Listed below are hooks into the GLM Member DB plugin. These hooks are used by + add-ons (child plugins) and by themes to extend and modify behavior and output + content of this plugin and its addons. +

    + + + + + + - + + + + - + + + + - + - ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +
    HookTypeDescription
    glm-member-db-register-addonFilter ++ + Informs the GLM Meembers DB plugin of an installed add-on plugin. Information + on the plugin is provided in an array that's returned from the function + referenced in the add_filer() call. -

    ++

    f + The data compiled from all registered add-on plugins is stored in the $config + object for reference throughout this plugin. +

    + An example from the registration of + the Contacts add-on is below. +

    +
    +function glmMembersRegisterContacts($addOns) { + $addOns[GLM_MEMBERS_CONTACTS_PLUGIN_SLUG] = array( + 'dir' => GLM_MEMBERS_CONTACTS_PLUGIN_PATH, + 'name' => GLM_MEMBERS_CONTACTS_PLUGIN_NAME, + 'short_name' => GLM_MEMBERS_CONTACTS_PLUGIN_SHORT_NAME + ); + return $addOns; +} +add_filter('glm-member-db-register-addon','glmMembersRegisterContacts', 10, 1); +
    +
    glm-member-db-add-menuAction ++ + Hook to add a menu or menus (or sub-menus) to the GLM Member DB menus. Note that + you may have only menu items and sub-menu items under a main menu item, or in other + words, only 3 levels of menus. +
    +// This call will generally be in the constructor of the admin controller in the add-on plugin +add_action('glm-member-db-add-menu', array($this, 'glmMembersAddMenusContacts')); + +// The following two functions would be located elsewhere of the admin controller class. +public function glmMembersAddMenusContacts() +{ + // Add hooks to WordPress + add_action('admin_menu', array($this, 'configureMenus')); +} +public function configureMenus () +{ + // A test menu + add_submenu_page( + 'glm-members-admin-menu-members', + 'Contacts', + 'Contacts', + 'glm_members_edit', + 'glm-members-admin-menu-contacts', + array($this, 'glmMembersAdminMenuContacts') + ); +} +
    +

    + Note that in the example above that the function references are as they as + would be used when contained in a class and being called from another + method--such as '_constructor()'. This will likely be the case since the + add_action() call will generally be located in the constructor of the + add-on's admin controller and the the function called by that will be + a function in the same class. +

    +

    + Current list of standard GLM Member DB menu items. +

    + + + + + + + + + - ++ + + + + +
    MenulevelSlug
    Member DBMain Menuglm-members-admin-menu-members
    MembersSub-Menu(same as Member DB main menu item)
    MembersSub-Menuglm-members-admin-menu-members
    Member ListSub-Sub-Menuglm-members-admin-menu-members-list
    Add MemberSub-Menuglm-members-admin-menu-member
    MemberSub-Menuglm-members-admin-menu-member
    ConfigureSub-Menuglm-members-admin-menu-configure
    ManagementSub-Menuglm-members-admin-menu-management
    ShortcodesSub-Menuglm-members-admin-menu-shortcodes
    +
    glm-member-db-add-tab-for-{literal}{menu_item}{/literal}Filter ++ + Hook to add a tab or tabs to the header for pages in a particular page where + {literal}{menu_item}{/literal} should be the name of the menu item (page) where + the tab(s) should be added. +

    + As shown in the example below, the $addOnTabs array that is passed is an array + of tab definition arrays wherein 'text' is the text displayed on the tab and + 'action' is the action that is to be performed when the tab is clicked. +

    +
    +// This call will generally be in the constructor of the admin controller in the add-on plugin +add_filter('glm-member-db-add-tab-for-members', array($this, 'glmMembersAddTabForMembers')); + +// The following two functions would be located elsewhere in the admin controller class. +public function glmMembersAddTabForMembers($addOnTabs) +{ + $newTabs = array( + array( + 'text' => 'New Tab', + 'action' => 'contact' + ), + array( + 'text' => 'Another Tab', + 'action' => 'anotherAction' + ) + ); + $addOnTabs = array_merge($addOnTabs, $newTabs); + return $addOnTabs; +} +
    +

    + The tabs are generated from this array by the related header.html template + for the related menu item. +

    +

    + Note that in the example above that the function references are as they as + would be used when contained in a class and being called from another + method--such as '_constructor()'. This will likely be the case since the + add_filter() call will generally be located in the constructor of the + add-on's admin controller and the the function called by that will be + a function in the same class. +

    +
    glm_members_current_logged_in_userFilter ++ Hook requesting additional information on any currently logged in user. ++

    ++ This hook is used to accumulate current user information before a controller ++ is executed. The current user information is stored in $config as 'loggedInUser' ++ so as to be available to all subsequent code. The data is stored as an array ++ and defaults to having one 'wpUser' sub-array. ++

    ++

    ++ The code providing the data should return the supplied data even if it is not ++ contributing any additional user information. ++

    ++

    ++ If the code is adding user information (i.e. the Contacts add-on adding information ++ on a "contact" user), it should probably supply the data in a separate sub-array ++ (i.e. 'contactUser'). In any case, it must still return the wpUser sub-array ++ data that was provided by the hook. ++

    ++
    glm_members_locked_to_member_idFilter ++ Hook requesting any member ID to which the current user might be restricted. ++

    ++ The code providing the data should return the provided value if it has no member ID ++ it wishes to pass back, thus permitting this hook to be chained to more than one ++ possible source of a member ID to which the user should be restricted. For example, ++ a user might only have permissions to view or edit one member and therefore should ++ not have access to any others. ++

    ++
    glm_members_menu_membersFilter ++ Hook to test if the logged in user is permitted to see the "Members" menu. ++

    ++ This hook passes the hooked code a boolean saying whether the permission has ++ been withdrawn by previously hooked code. The default is true, so all hooked ++ code must pass true back to the hook for the permission to be granted. ++

    ++
    glm_members_menu_memberFilter ++ Hook to test if the logged in user is permitted to see the "Member" menu. ++

    ++ This hook passes the hooked code a boolean saying whether the permission has ++ been withdrawn by previously hooked code. The default is true, so all hooked ++ code must pass true back to the hook for the permission to be granted. ++

    ++
    glm_members_menu_configureFilter ++ Hook to test if the logged in user is permitted to see the "Configure" menu. ++

    ++ This hook passes the hooked code a boolean saying whether the permission has ++ been withdrawn by previously hooked code. The default is true, so all hooked ++ code must pass true back to the hook for the permission to be granted. ++

    ++
    glm_members_menu_managementFilter ++ Hook to test if the logged in user is permitted to see the "Management" menu. ++

    ++ This hook passes the hooked code a boolean saying whether the permission has ++ been withdrawn by previously hooked code. The default is true, so all hooked ++ code must pass true back to the hook for the permission to be granted. ++

    ++
    glm_members_menu_menu_shortcodesFilter ++ Hook to test if the logged in user is permitted to see the "Shortcodes" menu. ++

    ++ This hook passes the hooked code a boolean saying whether the permission has ++ been withdrawn by previously hooked code. The default is true, so all hooked ++ code must pass true back to the hook for the permission to be granted. ++

    ++
    glm_members_permit_admin_members_index_add_memberFilter ++ Hook to test if the logged in user is permitted to add a new member on the ++ Members index page. ++
    glm_members_permit_admin_members_index_member_config_warningFilter ++ Hook to test if the logged in user is permitted to show the user notices regarding ++ information managed under the "Configure" menu. ++
    glm_members_permit_admin_member_index_edit_memberFilter ++ Hook to test if the logged in user is permitted to edit member base data. ++
    glm_members_permit_admin_member_index_add_member_info_versionFilter ++ Hook to test if the logged in user is permitted to add a new member information ++ version on the Member index page. ++
    glm_members_permit_admin_member_index_view_member_info_versionFilter ++ Hook to test if the logged in user is permitted to view member infor versions. ++
    glm_members_permit_admin_member_index_clone_activate_info_versionFilter ++ Hook to test if the logged in user is permitted to Clone or Activate member ++ information versions on the Member index page. ++
    glm_members_permit_admin_member_contacts_tabFilter ++ Hook to test if the logged in user is permitted to see the member Contacts tab. ++
    glm_members_permit_admin_member_contacts_add_contactFilter ++ Hook to test if the logged in user is permitted to add a new contact. ++
    glm_members_permit_admin_member_contacts_view_contactFilter ++ Hook to test if the logged in user is permitted to view a contact. ++
    glm_members_permit_admin_member_contacts_edit_contactFilter ++ Hook to test if the logged in user is permitted to edit a contact. ++
    glm_members_permit_admin_widget_membersFilter ++ Hook to test if the logged in user is permitted to search members in the Dashboard Widget. ++
    glm_members_permit_admin_widget_warningsFilter ++ Hook to test if the logged in user is permitted to see configuration and other members ++ warnings in the Dashboard Widget. ++
    glm_members_permit_admin_widget_pending_infoFilter ++ Hook to test if the logged in user is permitted to see a list of pending information ++ records for all members in the Dashboard Widget. ++
    glm_members_permit_admin_member_index_list_inactive_infoFilter ++ Hook to test if the logged in user is permitted to see a list of inactive member information. ++
    glm_members_permit_admin_member_info_editFilter ++ Hook to test if the logged in user is permitted to edit member information. ++
    glm_members_permit_admin_profile_index_edit_profileFilter ++ Hook to test if the logged in user is permitted to edit their own profile. ++
    + ++ ++ +{include file='admin/footer.html'} + + + +'glm-member-db-add-tab-for-'.$menuItem, diff --cc views/admin/management/index.html index d9139124,d9139124..b6a90640 --- a/views/admin/management/index.html +++ b/views/admin/management/index.html @@@ -1,5 -1,5 +1,8 @@@ {include file='admin/management/header.html'} ++ ++ {if $settingsUpdated}

    Settings Updated

    {/if} ++
    @@@ -311,4 -311,4 +314,15 @@@
    ++ ++ ++ {include file='admin/footer.html'} diff --cc views/admin/member/header.html index 1398eac9,18427bfc..1a2eee0a --- a/views/admin/member/header.html +++ b/views/admin/member/header.html @@@ -1,31 -1,16 +1,39 @@@ +{* Sometimes this header is called without a memberInfoID. It's easier to handle it here that to set this in all models that don't need it. *} +{if !isset($memberInfoID)} - {assign var="memberInfoID" value="false"} ++ {assign var="memberInfoID" value=false} +{/if} +{if !isset($memberInfo)} - {assign var="memberInfo" value="false"} ++ {assign var="memberInfo" value=false} +{/if} +
    --

    Member Data

    -- ++

    ++ {if $haveMember} ++ Member: {$memberName} ++ {else} ++ New Member ++ {/if} ++

    ++
    diff --cc views/admin/member/index.html index 25d1748e,c9ff480d..aaf96ab5 --- a/views/admin/member/index.html +++ b/views/admin/member/index.html @@@ -2,18 -2,18 +2,19 @@@ {if $haveMemberTypes} -- {if $updated} --

    Record Updated

    -- {/if}

    {if $haveMember} -- {$member.fieldData.name} ++ General Member Information {else} Add New Member {/if}

    ++ {if $memberUpdated} ++

    Member Updated

    ++ {/if} ++ {if apply_filters('glm_members_permit_admin_member_index_edit_member', true)}
    {if $haveMember} @@@ -26,7 -26,7 +27,6 @@@ {/if} -- {if $haveMember}{/if}
    ID{$member.fieldData.id}
    Member Name: @@@ -73,16 -72,16 +72,46 @@@

    * Required

    -- {if $haveMember} ++ {if $haveMember} -- {else} ++ {else} -- {/if} ++ {/if}
    ++ {else} ++ {if $haveMember} ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++
    Member Name:{$member.fieldData.name}
    Name for URLs:{$member.fieldData.member_slug}
    Member Display & Access:{$member.fieldData.access.name}
    Member Type:{$member.fieldData.member_type.name}
    Date created:{$member.fieldData.created.date}
    ++ {else} ++

    No member information available.

    ++ {/if} ++ {/if}

     

    ++ {if $haveMember} ++ ++ {if apply_filters('glm_members_permit_admin_member_index_view_member_info_version', true)} ++ {if apply_filters('glm_members_permit_admin_member_index_add_member_info_version', true)} Add New Member Information Version ++ {/if}

    Member Information Versions

    @@@ -93,8 -92,7 +122,7 @@@

    - {if $haveMember} -- ++
    @@@ -105,31 -103,32 +133,40 @@@ -- - {if $haveMember} -- {if $haveInfoRecords} -- -- {assign var="i" value="0"} -- {foreach $memberInfoRecords as $m} -- {if $i++ is odd by 1} ++ ++ {if $haveInfoRecords} ++ {assign var="i" value="0"} ++ {foreach $memberInfoRecords as $m} ++ ++ {if $m.status.value == $statusTypeNumbers.Active || apply_filters('glm_members_permit_admin_member_index_list_inactive_info', true)} ++ {if $i++ is odd by 1} -- {else} ++ {else} -- {/if} - - ++ {/if} ++ -- {/foreach} -- {else} -- -- {/if} ++ ++ ++ {/if} ++ {/foreach} ++ {else} ++ ++ {/if}
    Access
    {$m.status.name}{$m.status.name} ++ {$m.status.name} ++ {$m.reference_name} {$m.create_time.datetime} {$m.modify_time.datetime} - Clone  ++ {if apply_filters('glm_members_permit_admin_member_index_clone_activate_info_version', true)} + Clone  {if $m.status.name != 'Active'}Activate{/if} ++ {/if}
    Click here too start entering information for this member.
    Click here too start entering information for this member.
    ++ {/if} {/if} {else} @@@ -149,6 -148,6 +186,9 @@@ window.location.replace("{$thisURL}?page={$thisPage}&glm_action=index&member={$memberID}&showArchived=" + checked); }); ++ // Flash certain elements for a short time after display ++ $(".glm-flash-updated").fadeOut(500).fadeIn(500).fadeOut(500).fadeIn(500).fadeOut(500).fadeIn(500).fadeOut(500).fadeIn(500).fadeOut(500).fadeIn(500).fadeOut(500); ++ }); diff --cc views/admin/member/memberInfo.html index fd8529a1,1f87a456..e7bfde62 --- a/views/admin/member/memberInfo.html +++ b/views/admin/member/memberInfo.html @@@ -1,10 -1,10 +1,15 @@@ {include file='admin/member/header.html'} ++ ++ ++ {if $memberUpdated}

    Member Information Updated

    {/if} ++ ++{if apply_filters('glm_members_permit_admin_member_info_edit', true)} {if $memberInfoID && $memberInfo} @@@ -54,13 -54,13 +59,13 @@@ "Show Archiived Versions" checkbox at the top right of the versions list on that page to include archived versions.

    -- {/if} ++ {/if}

    Edit Member Information

    {else}

    Add New Member Information

    -- {/if} ++ {/if}
    @@@ -88,12 -88,12 +93,10 @@@ Access: {$member.access.name} -- {/if} -- {if $noActive} ++ {/if} ++ {if $noActive}

    You do not have any active information for this member.

    -- {/if} --   -- ++ {/if} {if $memberInfoID && $memberInfo} Created: @@@ -101,9 -101,9 +104,10 @@@ Last Updated: -- {if isset($create_time)}{$memberInfo.fieldData.modify_time.datetime}{/if} ++ {$memberInfo.fieldData.modify_time.datetime} {/if} ++ Member Info Status: Delete Image
    {$memberInfo.fieldData.logo}
    --

    Show Large Logo Image

    -- -- {/if} -- ++ New image: ++ ++ {if $memberInfo.fieldFail.logo}

    {$memberInfo.fieldFail.logo}

    {/if} @@@ -489,13 -489,13 +489,18 @@@ Caption: -- Delete: -- ++ ++ ++ ++ ++ ++ ++
    Delete:
    Selected Image:
    Featured Image:
    New Upload
    ++ Description: -- New Upload
    @@@ -512,6 -512,6 +517,7 @@@
    Drag and drop new images here
    HTML5 file drag-and-drop not supported by your browser.
    Use "Browse" button above to upload an image.
    ++
    No Selected Image: