* finish task #2405.

This commit is contained in:
wangyidong
2015-11-12 11:37:20 +08:00
parent 086848c53e
commit b7578aaca2
7 changed files with 67 additions and 0 deletions

View File

@@ -831,6 +831,7 @@ INSERT INTO `zt_grouppriv` (`group`, `module`, `method`) VALUES
(1, 'my', 'testCase'),
(1, 'my', 'testTask'),
(1, 'my', 'todo'),
(1, 'my', 'unbind'),
(1, 'product', 'batchEdit'),
(1, 'product', 'browse'),
(1, 'product', 'close'),
@@ -1080,6 +1081,7 @@ INSERT INTO `zt_grouppriv` (`group`, `module`, `method`) VALUES
(2, 'my', 'story'),
(2, 'my', 'task'),
(2, 'my', 'todo'),
(2, 'my', 'unbind'),
(2, 'product', 'browse'),
(2, 'product', 'doc'),
(2, 'product', 'dynamic'),
@@ -1238,6 +1240,7 @@ INSERT INTO `zt_grouppriv` (`group`, `module`, `method`) VALUES
(3, 'my', 'testCase'),
(3, 'my', 'testTask'),
(3, 'my', 'todo'),
(3, 'my', 'unbind'),
(3, 'product', 'browse'),
(3, 'product', 'doc'),
(3, 'product', 'dynamic'),
@@ -1437,6 +1440,7 @@ INSERT INTO `zt_grouppriv` (`group`, `module`, `method`) VALUES
(4, 'my', 'testCase'),
(4, 'my', 'testTask'),
(4, 'my', 'todo'),
(4, 'my', 'unbind'),
(4, 'product', 'browse'),
(4, 'product', 'doc'),
(4, 'product', 'dynamic'),
@@ -1636,6 +1640,7 @@ INSERT INTO `zt_grouppriv` (`group`, `module`, `method`) VALUES
(5, 'my', 'testCase'),
(5, 'my', 'testTask'),
(5, 'my', 'todo'),
(5, 'my', 'unbind'),
(5, 'product', 'batchEdit'),
(5, 'product', 'browse'),
(5, 'product', 'close'),
@@ -1865,6 +1870,7 @@ INSERT INTO `zt_grouppriv` (`group`, `module`, `method`) VALUES
(6, 'my', 'testCase'),
(6, 'my', 'testTask'),
(6, 'my', 'todo'),
(6, 'my', 'unbind'),
(6, 'product', 'browse'),
(6, 'product', 'doc'),
(6, 'product', 'dynamic'),
@@ -2062,6 +2068,7 @@ INSERT INTO `zt_grouppriv` (`group`, `module`, `method`) VALUES
(7, 'my', 'testCase'),
(7, 'my', 'testTask'),
(7, 'my', 'todo'),
(7, 'my', 'unbind'),
(7, 'product', 'batchEdit'),
(7, 'product', 'browse'),
(7, 'product', 'close'),
@@ -2269,6 +2276,7 @@ INSERT INTO `zt_grouppriv` (`group`, `module`, `method`) VALUES
(8, 'my', 'testCase'),
(8, 'my', 'testTask'),
(8, 'my', 'todo'),
(8, 'my', 'unbind'),
(8, 'product', 'browse'),
(8, 'product', 'doc'),
(8, 'product', 'dynamic'),
@@ -2456,6 +2464,7 @@ INSERT INTO `zt_grouppriv` (`group`, `module`, `method`) VALUES
(9, 'my', 'testCase'),
(9, 'my', 'testTask'),
(9, 'my', 'todo'),
(9, 'my', 'unbind'),
(9, 'product', 'browse'),
(9, 'product', 'doc'),
(9, 'product', 'dynamic'),
@@ -2576,6 +2585,7 @@ INSERT INTO `zt_grouppriv` (`group`, `module`, `method`) VALUES
(10, 'my', 'profile'),
(10, 'my', 'task'),
(10, 'my', 'todo'),
(10, 'my', 'unbind'),
(10, 'product', 'browse'),
(10, 'product', 'doc'),
(10, 'product', 'dynamic'),

View File

@@ -78,6 +78,7 @@ $lang->resource->my->profile = 'profile';
$lang->resource->my->dynamic = 'dynamic';
$lang->resource->my->editProfile = 'editProfile';
$lang->resource->my->changePassword = 'changePassword';
$lang->resource->my->unbind = 'unbind';
$lang->my->methodOrder[0] = 'index';
$lang->my->methodOrder[5] = 'todo';
@@ -91,6 +92,7 @@ $lang->my->methodOrder[40] = 'profile';
$lang->my->methodOrder[45] = 'dynamic';
$lang->my->methodOrder[50] = 'editProfile';
$lang->my->methodOrder[55] = 'changePassword';
$lang->my->methodOrder[60] = 'unbind';
/* Todo. */
$lang->resource->todo = new stdclass();
@@ -1107,3 +1109,4 @@ $lang->changelog['7.4'][] = 'release-changeStatus';
$lang->changelog['7.4'][] = 'user-unbind';
$lang->changelog['7.4'][] = 'branch-manage';
$lang->changelog['7.4'][] = 'branch-delete';
$lang->changelog['7.4'][] = 'my-unbind';

View File

@@ -465,4 +465,25 @@ class my extends control
$this->display();
}
/**
* Unbind ranzhi
*
* @param string $confirm
* @access public
* @return void
*/
public function unbind($confirm = 'no')
{
$this->loadModel('user');
if($confirm == 'no')
{
die(js::confirm($this->lang->user->confirmUnbind, $this->createLink('my', 'unbind', "confirm=yes")));
}
else
{
$this->user->unbind($this->app->user->account);
die(js::locate($this->createLink('my', 'profile'), 'parent'));
}
}
}

View File

@@ -15,6 +15,7 @@ $lang->my->profile = 'Profile';
$lang->my->dynamic = 'Dynamic';
$lang->my->editProfile = 'Edit profile';
$lang->my->changePassword = 'Change password';
$lang->my->unbind = 'Unbind ranzhi';
$lang->my->taskMenu = new stdclass();
$lang->my->taskMenu->assignedToMe = 'To me';

View File

@@ -15,6 +15,7 @@ $lang->my->profile = '我的档案';
$lang->my->dynamic = '我的动态';
$lang->my->editProfile = '修改档案';
$lang->my->changePassword = '修改密码';
$lang->my->unbind = '解除然之绑定';
$lang->my->taskMenu = new stdclass();
$lang->my->taskMenu->assignedToMe = '指派给我';

View File

@@ -114,6 +114,15 @@
<th><?php echo $lang->user->zipcode;?></th>
<td><?php echo $user->zipcode;?></td>
</tr>
<?php if($user->ranzhi):?>
<tr>
<th><?php echo $lang->user->ranzhi;?></th>
<td>
<?php echo $user->ranzhi . ' ';?>
<?php if(common::hasPriv('my', 'unbind')) echo html::a($this->createLink('my', 'unbind'), "<i class='icon-unlink'></i>", 'hiddenwin', "class='bin-icon' title='{$lang->user->unbind}'");?>
</td>
</tr>
<?php endif;?>
</table>
</div>
<?php include '../../common/view/footer.html.php';?>

View File

@@ -127,6 +127,7 @@ class upgradeModel extends model
$this->adjustOrder7_3();
case '7_3':
$this->execSQL($this->getUpgradeFile('7.3'));
$this->adjustPriv7_4();
default: if(!$this->isError()) $this->setting->updateVersion($this->config->version);
}
@@ -961,6 +962,27 @@ class upgradeModel extends model
return true;
}
/**
* Adjust priv for 7.4
*
* @access public
* @return void
*/
public function adjustPriv7_4()
{
$groups = $this->dao->select('id')->from(TABLE_GROUP)->where('name')->eq('guest')->fetchAll();
foreach($groups as $groupID)
{
$groupPriv = new stdclass();
$groupPriv->group = $groupID;
$groupPriv->module = 'my';
$groupPriv->method = 'unbind';
$this->dao->replae(TABLE_GROUPPRIV)->data($data)->exec();
}
return true;
}
/**
* Judge any error occers.
*