* @access public
*/
- public function getListWithParents($memberInfoID = false, $category = false) {
+ public function getListWithParents($memberInfoID = false, $category = false)
+ {
$where = '';
* @access public
*/
- public function setMemberInfoCategories($memberInfoID, $selectedCategories) {
+ public function setMemberInfoCategories($memberInfoID, $selectedCategories)
+ {
// Check supplied data
if (!is_int($memberInfoID) || $memberInfoID <=0 || !is_array($selectedCategories) || count($selectedCategories) == 0 ) {
}
// Get current list
- $current = $this->getList($memberInfoID);
+ $current = $this->getList("T.member_info = $memberInfoID");
// If we have any currently selected categories
if (is_array($current) && count($current) > 0) {
* @access public
*/
- public function clearMemberInfoCategories($memberInfoID) {
+ public function clearMemberInfoCategories($memberInfoID)
+ {
$sql = "
DELETE FROM ".GLM_MEMBERS_PLUGIN_DB_PREFIX."category_member_info
'list' => $this->config['status'],
'required' => true,
'default' => $this->config['status_numb']['Pending'],
-// 'force_list' => true,
'use' => 'a'
),
'p_field' => 'name',
'p_orderby' => 'name',
'p_blank' => true,
-// 'force_list' => true,
'use' => 'a'
),
'type' => 'list',
'list' => $this->config['states'],
'default' => 'MI',
-// 'force_list' => true,
'use' => 'a'
),
'type' => 'list',
'list' => $this->config['countries'],
'default' => 'US',
-// 'force_list' => true,
'use' => 'a'
),
$alwaysList = (isset($f['force_list']) && $f['force_list']);
$pStatic = (isset($f['p_static']) && $f['p_static']);
$pSum = (isset($f['p_sum']) && $f['p_sum']);
- if (($alwaysList || $forEdit || $pSum) && !$pStatic ) {
+ if (($this->optionIncludeSelectListData || $alwaysList || $forEdit || $pSum) && !$pStatic ) {
$p_value = $d;
reset($p_list);
foreach ($p_list as $p) {
- if ($this->optionIncludeSelectListData) {
+ if ($this->optionIncludeSelectListData) {
$pick_list[$p['p_id']] = array(
'value' => $p['p_id'],
'name' => $p['p_value'],
// if the list is not required, dump it now. (List, Get, Delete, Confirm delete)
$forceList = (isset($f['force_list']) && $f['force_list']);
- if (!$forceList && !$forEdit && in_array($op, array('l', 'g', 'd', 'c'))) {
+ if (!$this->optionIncludeSelectListData && !$forceList && !$forEdit && in_array($op, array('l', 'g', 'd', 'c'))) {
$r['list'] = false;
}
public function modelAction ($actionData = false)
{
+ $this->optionIncludeSelectListData = true;
+
// Check for action option - Should be one of the values in the "switch" statement below
$option = false;
if (isset($_REQUEST['option']) && trim($_REQUEST['option']) != '') {
// Determine if the current member info record active?
$this->isActive = $this->isActive();
- // Check for new cities being submitted
- $this->checkNewCities();
-
// Get member base data
require_once(GLM_MEMBERS_PLUGIN_CLASS_PATH.'/data/dataMembers.php');
$Members = new GlmDataMembers($this->wpdb, $this->config);
// Process submission of a member information record update
case 'submit':
+ // Check for new cities being submitted
+ $this->checkNewCities();
+
// Update submitted categories
$this->updateCategories();
if ($this->haveMemberInfo) {
// Update the member Info data
- $this->memberInfo = $this->updateEntry($this->memberInfoID);
+
+ $this->memberInfo = $this->updateEntry($this->memberInfoID, 'id', true, true);
break;
} else {
$this->memberInfoID = $this->memberInfo['fieldData']['id'];
$this->haveMemberInfo = true;
+ // Check for new cities being submitted
+ $this->checkNewCities();
+
// Update submitted categories
$this->updateCategories();