Skip to content
Permalink
Browse files

チームの管理 - 選択できるメンバーがいない場合は表示しない

  • Loading branch information...
piyoyo
piyoyo committed Mar 29, 2015
1 parent 7c4884d commit 56a282d2a51649a1000f58bf04a027046903b995
Showing with 17 additions and 6 deletions.
  1. +2 −0 nucleus/language/japanese-utf8.php
  2. +15 −6 nucleus/libs/ADMIN.php
@@ -17,6 +17,8 @@
// Note for Japanese users
// このファイルは Nucleus の UTF-8 版日本語ランゲージファイルです。
define('_TEAM_NO_SELECTABLE_MEMBERS', '選択可能なメンバーはいません');
define('_LISTS_FORM_SELECT_ALL_CATEGORY', 'すべてのカテゴリ');
define('_LIST_BACK_TO', '%sに戻る');
@@ -2424,7 +2424,18 @@ function action_manageteam() {
?>
<h3><?php echo _TEAM_ADDNEW?></h3>

<?php
// TODO: try to make it so only non-team-members are listed
// From https://github.com/Lord-Matt-NucleusCMS-Stuff/lmnucleuscms/commit/3b4e236449a2212ff2440f8654197a9c01667166#diff-34cb57d57a38d46e6406db82a324c224R2337
$from_where = sprintf(" FROM %s WHERE mnumber NOT IN (SELECT tmember FROM %s WHERE tblog='%s')",
sql_table('member') , sql_table('team') , $blogid);
$query = "SELECT mname as text, mnumber as value" . $from_where;
$count_non_team_members = intval(quickQuery("SELECT count(*) AS result " . $from_where));
if ($count_non_team_members == 0)
echo _TEAM_NO_SELECTABLE_MEMBERS;
else {
?>
<form method='post' action='index.php'><div>

<input type='hidden' name='action' value='teamaddmember' />
@@ -2433,11 +2444,7 @@ function action_manageteam() {

<table><tr>
<td><?php echo _TEAM_CHOOSEMEMBER?></td>
<td><?php // TODO: try to make it so only non-team-members are listed
// From https://github.com/Lord-Matt-NucleusCMS-Stuff/lmnucleuscms/commit/3b4e236449a2212ff2440f8654197a9c01667166#diff-34cb57d57a38d46e6406db82a324c224R2337
$query = "SELECT mname as text, mnumber as value FROM %s WHERE mnumber NOT IN (SELECT tmember FROM %s WHERE tblog='%s')";
$query = sprintf($query, sql_table('member'),sql_table('team'),$blogid);
<td><?php
$template['name'] = 'memberid';
$template['tabindex'] = 10000;
showlist($query,'select',$template);
@@ -2452,6 +2459,7 @@ function action_manageteam() {

</div></form>
<?php
} /* end $count_non_team_members > 0 */
$this->pagefoot();
}
@@ -2469,6 +2477,7 @@ function action_teamaddmember() {
$member->blogAdminRights($blogid) or $this->disallow();
$blog =& $manager->getBlog($blogid);
if ($member->existsID($memberid))
if (!$blog->addTeamMember($memberid, $admin))
$this->error(_ERROR_ALREADYONTEAM);

0 comments on commit 56a282d

Please sign in to comment.
You can’t perform that action at this time.