Minahito
minah****@users*****
2006年 9月 25日 (月) 18:40:16 JST
Index: xoops2jp/html/modules/user/admin/forms/UserSearchFilterForm.class.php diff -u xoops2jp/html/modules/user/admin/forms/UserSearchFilterForm.class.php:1.1.2.4 xoops2jp/html/modules/user/admin/forms/UserSearchFilterForm.class.php:1.1.2.5 --- xoops2jp/html/modules/user/admin/forms/UserSearchFilterForm.class.php:1.1.2.4 Sun Sep 24 15:13:01 2006 +++ xoops2jp/html/modules/user/admin/forms/UserSearchFilterForm.class.php Mon Sep 25 18:40:16 2006 @@ -1,7 +1,7 @@ <?php /** * @package user - * @version $Id: UserSearchFilterForm.class.php,v 1.1.2.4 2006/09/24 06:13:01 minahito Exp $ + * @version $Id: UserSearchFilterForm.class.php,v 1.1.2.5 2006/09/25 09:40:16 minahito Exp $ */ if (!defined('XOOPS_ROOT_PATH')) exit(); @@ -47,37 +47,37 @@ class User_UserSearchFilterForm extends User_AbstractFilterForm { var $mSortKeys = array( - USER_SORT_KEY_UID => 'uid', - USER_SORT_KEY_NAME => 'name', - USER_SORT_KEY_UNAME => 'uname', - USER_SORT_KEY_EMAIL => 'email', - USER_SORT_KEY_URL => 'url', - USER_SORT_KEY_USER_AVATAR => 'user_avatar', - USER_SORT_KEY_USER_REGDATE => 'user_regdate', - USER_SORT_KEY_USER_ICQ => 'user_icq', - USER_SORT_KEY_USER_FROM => 'user_from', - USER_SORT_KEY_USER_SIG => 'user_sig', - USER_SORT_KEY_USER_VIEWEMAIL => 'user_viewemail', - USER_SORT_KEY_ACTKEY => 'actkey', - USER_SORT_KEY_USER_AIM => 'user_aim', - USER_SORT_KEY_USER_YIM => 'user_yim', - USER_SORT_KEY_USER_MSNM => 'user_msnm', - USER_SORT_KEY_PASS => 'pass', - USER_SORT_KEY_POSTS => 'posts', - USER_SORT_KEY_ATTACHSIG => 'attachsig', - USER_SORT_KEY_RANK => 'rank', - USER_SORT_KEY_LEVEL => 'level', - USER_SORT_KEY_THEME => 'theme', - USER_SORT_KEY_TIMEZONE_OFFSET => 'timezone_offset', - USER_SORT_KEY_LAST_LOGIN => 'last_login', - USER_SORT_KEY_UMODE => 'umode', - USER_SORT_KEY_UORDER => 'uorder', - USER_SORT_KEY_NOTIFY_METHOD => 'notify_method', - USER_SORT_KEY_NOTIFY_MODE => 'notify_mode', - USER_SORT_KEY_USER_OCC => 'user_occ', - USER_SORT_KEY_BIO => 'bio', - USER_SORT_KEY_USER_INTREST => 'user_intrest', - USER_SORT_KEY_USER_MAILOK => 'user_mailok' + USER_SORT_KEY_UID => 'u.uid', + USER_SORT_KEY_NAME => 'u.name', + USER_SORT_KEY_UNAME => 'u.uname', + USER_SORT_KEY_EMAIL => 'u.email', + USER_SORT_KEY_URL => 'u.url', + USER_SORT_KEY_USER_AVATAR => 'u.user_avatar', + USER_SORT_KEY_USER_REGDATE => 'u.user_regdate', + USER_SORT_KEY_USER_ICQ => 'u.user_icq', + USER_SORT_KEY_USER_FROM => 'u.user_from', + USER_SORT_KEY_USER_SIG => 'u.user_sig', + USER_SORT_KEY_USER_VIEWEMAIL => 'u.user_viewemail', + USER_SORT_KEY_ACTKEY => 'u.actkey', + USER_SORT_KEY_USER_AIM => 'u.user_aim', + USER_SORT_KEY_USER_YIM => 'u.user_yim', + USER_SORT_KEY_USER_MSNM => 'u.user_msnm', + USER_SORT_KEY_PASS => 'u.pass', + USER_SORT_KEY_POSTS => 'u.posts', + USER_SORT_KEY_ATTACHSIG => 'u.attachsig', + USER_SORT_KEY_RANK => 'u.rank', + USER_SORT_KEY_LEVEL => 'u.level', + USER_SORT_KEY_THEME => 'u.theme', + USER_SORT_KEY_TIMEZONE_OFFSET => 'u.timezone_offset', + USER_SORT_KEY_LAST_LOGIN => 'u.last_login', + USER_SORT_KEY_UMODE => 'u.umode', + USER_SORT_KEY_UORDER => 'u.uorder', + USER_SORT_KEY_NOTIFY_METHOD => 'u.notify_method', + USER_SORT_KEY_NOTIFY_MODE => 'u.notify_mode', + USER_SORT_KEY_USER_OCC => 'u.user_occ', + USER_SORT_KEY_BIO => 'u.bio', + USER_SORT_KEY_USER_INTREST => 'u.user_intrest', + USER_SORT_KEY_USER_MAILOK => 'u.user_mailok' ); var $_mMatchFields = array ("uname", "name", "email", "user_icq", "user_aim", "user_yim", "user_msnm", @@ -104,64 +104,74 @@ foreach ($this->_mMatchFields as $field) { if (strlen($form->get($field)) > 0) { $this->_mNavi->addExtra($field, $form->get($field)); - $this->_mCriteria->add(new Criteria($field, '%' . $form->get($field) . '%', 'LIKE')); + $this->_mCriteria->add(new Criteria('u.' . $field, '%' . $form->get($field) . '%', 'LIKE')); } } $this->_mNavi->addExtra('mail_condition', $form->get('mail_condition')); switch ($form->get('mail_condition')) { case 1: - $this->_mCriteria->add(new Criteria('user_mailok', 1)); + $this->_mCriteria->add(new Criteria('u.user_mailok', 1)); break; case 2: - $this->_mCriteria->add(new Criteria('user_mailok', 0)); + $this->_mCriteria->add(new Criteria('u.user_mailok', 0)); break; } $this->_mNavi->addExtra('user_level', $form->get('user_level')); switch ($form->get('user_level')) { case 1: - $this->_mCriteria->add(new Criteria('level', 0, '>')); + $this->_mCriteria->add(new Criteria('u.level', 0, '>')); break; case 2: - $this->_mCriteria->add(new Criteria('level', 0)); + $this->_mCriteria->add(new Criteria('u.level', 0)); break; } if (strlen($form->get('over_posts')) > 0) { $this->_mNavi->addExtra('over_posts', $form->get('over_posts')); - $this->_mCriteria->add(new Criteria('posts', $form->get('over_posts'), '>=')); + $this->_mCriteria->add(new Criteria('u.posts', $form->get('over_posts'), '>=')); } if (strlen($form->get('under_posts')) > 0) { $this->_mNavi->addExtra('under_posts', $form->get('under_posts')); - $this->_mCriteria->add(new Criteria('posts', $form->get('under_posts'), '<=')); + $this->_mCriteria->add(new Criteria('u.posts', $form->get('under_posts'), '<=')); } if (strlen($form->get('lastlog_more')) > 0) { $this->_mNavi->addExtra('lastlog_more', $form->get('lastlog_more')); $time = time() - $form->get('lastlog_more') * 86400; - $this->_mCriteria->add(new Criteria('last_login', $time, '<=')); + $this->_mCriteria->add(new Criteria('u.last_login', $time, '<=')); } if (strlen($form->get('lastlog_less')) > 0) { $this->_mNavi->addExtra('lastlog_less', $form->get('lastlog_less')); $time = time() - $form->get('lastlog_more') * 86400; - $this->_mCriteria->add(new Criteria('last_login', $time, '>=')); + $this->_mCriteria->add(new Criteria('u.last_login', $time, '>=')); } if (strlen($form->get('regdate_more')) > 0) { $this->_mNavi->addExtra('regdate_more', $form->get('regdate_more')); $time = time() - $form->get('regdate_more') * 86400; - $this->_mCriteria->add(new Criteria('user_regdate', $time, '<=')); + $this->_mCriteria->add(new Criteria('u.user_regdate', $time, '<=')); } if (strlen($form->get('regdate_less')) > 0) { $this->_mNavi->addExtra('regdate_less', $form->get('regdate_less')); $time = time() - $form->get('regdate_less') * 86400; - $this->_mCriteria->add(new Criteria('user_regdate', $time, '>=')); + $this->_mCriteria->add(new Criteria('u.user_regdate', $time, '>=')); + } + + $groups = $form->get('groups'); + if (count($groups) > 0) { + $g_criteria =& new CriteriaCompo(); + foreach($groups as $gid) { + $g_criteria->add(new Criteria('g.groupid', $gid)); + } + $this->_mNavi->addExtra('groups[' . $gid . ']', $gid); + $this->_mCriteria->add($g_criteria); } $this->_mCriteria->addSort($this->getSort(), $this->getOrder());