* Fix bug of my::audit.

This commit is contained in:
liumengyi
2023-11-15 16:17:42 +08:00
parent 7a5cd6fd40
commit eda765b1b7
3 changed files with 20 additions and 4 deletions
+14 -2
View File
@@ -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;
}
+4
View File
@@ -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'];
+2 -2
View File
@@ -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. */