* Fix bug of my::audit.
This commit is contained in:
@@ -8,8 +8,20 @@ window.onRenderCell = function(result, {row, col})
|
||||
|
||||
if(result && col.name == 'actions')
|
||||
{
|
||||
result[0][0].disabled = false;
|
||||
col.setting.actionsMap.review.url = reviewLink.replace('{module}', row.data.module).replace('{id}', row.data.id);
|
||||
if(reviewPrivs[row.data.module])
|
||||
{
|
||||
result[0].props.items[0]['data-toggle'] = 'modal'
|
||||
result[0].props.items[0]['disabled'] = false;
|
||||
result[0].props.items[0]['url'] = reviewLink.replace('{module}', row.data.module).replace('{id}', row.data.id);;
|
||||
result[0].props.items[0]['href'] = reviewLink.replace('{module}', row.data.module).replace('{id}', row.data.id);;
|
||||
}
|
||||
else
|
||||
{
|
||||
result[0].props.items[0]['disabled'] = true;
|
||||
delete result[0].props.items[0]['data-toggle'];
|
||||
delete result[0].props.items[0]['url'];
|
||||
delete result[0].props.items[0]['href'];
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -10,8 +10,12 @@ declare(strict_types=1);
|
||||
*/
|
||||
namespace zin;
|
||||
|
||||
$reviewPrivs = array();
|
||||
foreach(array_keys($lang->my->featureBar['audit']) as $type) $reviewPrivs[$type] = hasPriv($type, 'review');
|
||||
|
||||
jsVar('viewLink', createLink('{module}', 'view', 'id={id}'));
|
||||
jsVar('reviewLink', createLink('{module}', 'review', 'id={id}'));
|
||||
jsVar('reviewPrivs', $reviewPrivs);
|
||||
|
||||
$rawMethod = $app->rawMethod;
|
||||
if($rawMethod != 'audit' && isset($lang->my->featureBar[$rawMethod]['audit'])) $lang->my->featureBar[$rawMethod] = $lang->my->featureBar[$rawMethod]['audit'];
|
||||
|
||||
@@ -3122,14 +3122,14 @@ class storyModel extends model
|
||||
|
||||
static $shadowProducts = array();
|
||||
static $hasShadow = true;
|
||||
if($hasShadow and empty($shadowProducts[$story->product]))
|
||||
if(isset($story->product) && $hasShadow && empty($shadowProducts[$story->product]))
|
||||
{
|
||||
$stmt = $app->dbQuery('SELECT id FROM ' . TABLE_PRODUCT . " WHERE shadow = 1")->fetchAll();
|
||||
if(empty($stmt)) $hasShadow = false;
|
||||
foreach($stmt as $row) $shadowProducts[$row->id] = $row->id;
|
||||
}
|
||||
|
||||
if($story->parent < 0 and strpos($config->story->list->actionsOperatedParentStory, ",$action,") === false) return false;
|
||||
if(isset($story->parent) && $story->parent < 0 && strpos($config->story->list->actionsOperatedParentStory, ",$action,") === false) return false;
|
||||
|
||||
if($action == 'batchcreate' and $config->vision == 'lite' and ($story->status == 'active' and ($story->stage == 'wait' or $story->stage == 'projected'))) return true;
|
||||
/* Adjust code, hide split entry. */
|
||||
|
||||
Reference in New Issue
Block a user