* revert ajaxSetUnfoldID.
This commit is contained in:
@@ -9,7 +9,7 @@ $(function()
|
||||
$td.find('a').eq(0).css('max-width', $td.width() - labelWidth - 60);
|
||||
});
|
||||
|
||||
toggleFold('#executionTaskForm', unfoldTasks, executionID, 'project');
|
||||
toggleFold('#executionTaskForm', unfoldTasks, executionID, 'execution');
|
||||
|
||||
adjustTableFooter();
|
||||
$('body').on('click', '#toggleFold', adjustTableFooter);
|
||||
|
||||
@@ -236,6 +236,53 @@ class misc extends control
|
||||
$captcha->build()->output();
|
||||
}
|
||||
|
||||
/**
|
||||
* Ajax set unfoldID.
|
||||
*
|
||||
* @param int $objectID
|
||||
* @param string $objectType
|
||||
* @param string $action add|delete
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function ajaxSetUnfoldID($objectID, $objectType, $action = 'add')
|
||||
{
|
||||
$account = $this->app->user->account;
|
||||
if($objectType == 'execution')
|
||||
{
|
||||
$condition = "owner={$account}&module={$objectType}§ion=task&key=unfoldTasks";
|
||||
$settingPath = $account . ".{$objectType}.task.unfoldTasks";
|
||||
}
|
||||
else
|
||||
{
|
||||
$condition = "owner={$account}&module=product§ion=browse&key=unfoldStories";
|
||||
$settingPath = $account . ".{$objectType}.browse.unfoldStories";
|
||||
}
|
||||
|
||||
$this->loadModel('setting');
|
||||
$setting = $this->setting->createDAO($this->setting->parseItemParam($condition), 'select')->fetch();
|
||||
$newUnfoldID = $this->post->newUnfoldID;
|
||||
if(empty($newUnfoldID)) die();
|
||||
|
||||
$newUnfoldID = json_decode($newUnfoldID);
|
||||
$unfoldIdList = $setting ? json_decode($setting->value, true) : array();
|
||||
foreach($newUnfoldID as $unfoldID)
|
||||
{
|
||||
unset($unfoldIdList[$objectID][$unfoldID]);
|
||||
if($action == 'add') $unfoldIdList[$objectID][$unfoldID] = $unfoldID;
|
||||
}
|
||||
|
||||
if(empty($setting))
|
||||
{
|
||||
$this->setting->setItem($settingPath, json_encode($unfoldIdList));
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->dao->update(TABLE_CONFIG)->set('value')->eq(json_encode($unfoldIdList))->where('id')->eq($setting->id)->exec();
|
||||
}
|
||||
die('success');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get annual remind.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user