diff --git a/module/testreport/config/table.php b/module/testreport/config/table.php index f30c0e70f6..b5a0471893 100644 --- a/module/testreport/config/table.php +++ b/module/testreport/config/table.php @@ -7,19 +7,21 @@ $config->testreport->actionList['edit']['icon'] = 'edit'; $config->testreport->actionList['edit']['hint'] = $lang->testreport->edit; $config->testreport->actionList['edit']['text'] = $lang->testreport->edit; $config->testreport->actionList['edit']['url'] = array('module' => 'testreport', 'method' => 'edit', 'params' => 'reportID={id}'); -$config->testreport->actionList['edit']['order'] = 5; -$config->testreport->actionList['edit']['show'] = 'clickable'; $config->testreport->actionList['edit']['data-app'] = $app->tab; $config->testreport->actionList['delete']['icon'] = 'trash'; $config->testreport->actionList['delete']['hint'] = $lang->testreport->delete; $config->testreport->actionList['delete']['text'] = $lang->testreport->delete; $config->testreport->actionList['delete']['url'] = array('module' => 'testreport', 'method' => 'delete', 'params' => 'reportID={id}'); -$config->testreport->actionList['delete']['order'] = 10; -$config->testreport->actionList['delete']['show'] = 'clickable'; -$config->testreport->actionList['delete']['class'] = 'ajax-submit'; +$config->testreport->actionList['delete']['className'] = 'ajax-submit'; $config->testreport->actionList['delete']['data-confirm'] = array('message' => $lang->testreport->confirmDelete, 'icon' => 'icon-exclamation-sign', 'iconClass' => 'warning-pale rounded-full icon-2x'); +$config->testreport->actionList['create']['icon'] = 'refresh'; +$config->testreport->actionList['create']['hint'] = $lang->testreport->recreate; +$config->testreport->actionList['create']['text'] = $lang->testreport->recreate; +$config->testreport->actionList['create']['url'] = array('module' => 'testreport', 'method' => 'create', 'params' => 'reportID={id}'); +$config->testreport->actionList['create']['data-app'] = $app->tab; + $config->testreport->dtable->fieldList['id']['name'] = 'id'; $config->testreport->dtable->fieldList['id']['title'] = $lang->idAB; $config->testreport->dtable->fieldList['id']['type'] = 'ID'; diff --git a/module/testreport/ui/view.html.php b/module/testreport/ui/view.html.php index e0ab15d5ed..17ff983f18 100644 --- a/module/testreport/ui/view.html.php +++ b/module/testreport/ui/view.html.php @@ -337,10 +337,11 @@ foreach($bugInfo as $infoKey => $infoValue) ); } -$mainActions = array(); -if(hasPriv('testreport', 'create')) $mainActions[] = array('icon' => 'refresh', 'url' => inlink('create', "objectID={$report->objectID}&objectType={$report->objectType}" . ($report->objectType == 'execution' ? "&extra=$report->tasks" : ''))); -if(hasPriv('testreport', 'edit')) $mainActions[] = array('icon' => 'edit', 'url' => inlink('edit', "objectID={$report->id}")); -if(hasPriv('testreport', 'delete')) $mainActions[] = array('icon' => 'trash', 'className' => 'ajax-submit', 'data-confirm' => $lang->testreport->confirmDelete, 'url' => inlink('delete', "objectID={$report->id}")); +$mainActions = array(); +$canBeChanged = common::canBeChanged('testreport', $report); +if($canBeChanged && hasPriv('testreport', 'create')) $mainActions[] = array('icon' => 'refresh', 'hint' => $lang->testreport->recreate, 'url' => inlink('create', "objectID={$report->objectID}&objectType={$report->objectType}" . ($report->objectType == 'execution' ? "&extra=$report->tasks" : ''))); +if($canBeChanged && hasPriv('testreport', 'edit')) $mainActions[] = array('icon' => 'edit', 'hint' => $lang->testreport->edit, 'url' => inlink('edit', "objectID={$report->id}")); +if($canBeChanged && hasPriv('testreport', 'delete')) $mainActions[] = array('icon' => 'trash', 'hint' => $lang->testreport->delete, 'url' => inlink('delete', "objectID={$report->id}"), 'className' => 'ajax-submit', 'data-confirm' => $lang->testreport->confirmDelete, 'url' => inlink('delete', "objectID={$report->id}")); detailBody (