* add prompt audit toolbar for stage create.

This commit is contained in:
Chenjianyu
2023-07-26 10:47:13 +08:00
parent 94509a26bc
commit ad2fdf8f74
+19 -1
View File
@@ -66,6 +66,18 @@
</div>
<?php endif;?>
<div class="btn-toolbar pull-right">
<?php if(isset($_SESSION['aiInjectData'])): ?>
<?php
$this->app->loadLang('ai');
$prompt = $_SESSION['aiPrompt']['prompt'];
$objectId = $_SESSION['aiPrompt']['objectId'];
$isAudit = isset($_SESSION['auditPrompt']) && time() - $_SESSION['auditPrompt']['time'] < 10 * 60;
?>
<?php echo html::a(helper::createLink('ai', 'promptexecute', "promptId=$prompt->id&objectId=$objectId"), '<i class="icon icon-refresh muted"></i> ' . $lang->ai->audit->regenerate, '', 'id="promptRegenerate" class="btn btn-link"');?>
<?php if($isAudit): ?>
<?php echo html::a(helper::createLink('ai', 'promptaudit', "promptId=$prompt->id&objectId=$objectId"), $lang->ai->audit->designPrompt, '', 'id="promptAudit" class="btn btn-info iframe"'); ?>
<?php endif;?>
<?php endif;?>
<?php $customLink = $this->createLink('custom', 'ajaxSaveCustomFields', "module=programplan&section={$custom}&key=createFields")?>
<?php include '../../common/view/customfield.html.php';?>
</div>
@@ -217,7 +229,13 @@
<tfoot>
<tr>
<?php $colspan = $planID == 0 ? $colspan : $colspan - 1;?>
<td colspan='<?php echo $colspan?>' class='text-center form-actions'><?php echo html::submitButton() . ' ' . html::backButton(); ?></td>
<td colspan='<?php echo $colspan?>' class='text-center form-actions'>
<?php if($isAudit && $prompt->status == 'draft'): ?>
<?php echo html::commonButton($lang->ai->prompts->action->publish, "id='promptPublish' data-promptId=$prompt->id", 'btn btn-primary btn-wide'); ?>
<?php else: ?>
<?php echo html::submitButton() . ' ' . html::backButton(); ?>
<?php endif; ?>
</td>
</tr>
</tfoot>
</table>