diff --git a/module/ai/config.php b/module/ai/config.php
index 9aceb09429..c1c101a182 100644
--- a/module/ai/config.php
+++ b/module/ai/config.php
@@ -124,7 +124,7 @@ $config->ai->targetForm['productplan']['create'] = (object)array('m' =>
// $config->ai->targetForm['project']['issue/create'] = (object)array('m' => 'issue', 'f' => 'create');
// $config->ai->targetForm['project']['doc/create'] = (object)array('m' => 'doc', 'f' => 'create');
$config->ai->targetForm['project']['programplan/create'] = (object)array('m' => 'programplan', 'f' => 'create', 'for' => 'project');
-$config->ai->targetForm['execution']['batchcreatetask'] = (object)array('m' => 'task', 'f' => 'batchcreate');
+$config->ai->targetForm['execution']['batchcreatetask'] = (object)array('m' => 'task', 'f' => 'batchcreate', 'for' => 'execution');
// $config->ai->targetForm['execution']['createtestreport'] = (object)array('m' => 'execution', 'f' => 'testreport');
// $config->ai->targetForm['execution']['createqa'] = (object)array('m' => 'execution', 'f' => 'createQA');
// $config->ai->targetForm['execution']['createrisk'] = (object)array('m' => 'execution', 'f' => 'createRisk');
@@ -210,7 +210,7 @@ $config->ai->menuPrint->locations['execution']['storyView'] = $config->ai->men
$config->ai->menuPrint->locations['execution']['view'] = (object)array( // TODO: fix this.
'module' => 'execution',
'injectMethod' => 'prepend',
- 'targetContainer' => '#mainContent.main-row > .col-4.side-col .detail:first-child > .detail-title',
+ 'targetContainer' => '#mainContent .ai-menu-box',
'class' => 'pull-right'
);
@@ -222,14 +222,14 @@ $config->ai->menuPrint->locations['project']['view']->module = 'project';
$config->ai->menuPrint->locations['product']['view'] = (object)array( // TODO: fix this.
'module' => 'product',
'injectMethod' => 'append',
- 'targetContainer' => '#mainContent.main-row > .col-8.main-col .detail:first-child > .detail-title',
+ 'targetContainer' => '#mainContent .ai-menu-box',
'class' => 'pull-right'
);
$config->ai->menuPrint->locations['productplan']['view'] = (object)array(
'module' => 'productplan',
'injectMethod' => 'prepend',
- 'targetContainer' => '#mainContent .toolbar',
+ 'targetContainer' => '#mainContent .tab-actions',
'objectVarName' => 'plan'
);
$config->ai->menuPrint->locations['projectplan']['view'] = $config->ai->menuPrint->locations['productplan']['view'];
diff --git a/module/ai/ui/promptmenu.html.php b/module/ai/ui/promptmenu.html.php
index 2635655942..3a84ab60d8 100644
--- a/module/ai/ui/promptmenu.html.php
+++ b/module/ai/ui/promptmenu.html.php
@@ -98,7 +98,9 @@ $promptMenuInject = function()
container.classList.remove('no-delay');
}
JAVASCRIPT;
- $script .= "$(`$menuOptions->targetContainer`).first()." . (!empty($menuOptions->injectMethod) ? $menuOptions->injectMethod : 'append') . "(`$html`).css('z-index', 2);\n";
+ $script .= 'let $aiMenu = $("' . $menuOptions->targetContainer . '").first();';
+ $script .= 'if(!$aiMenu.length) $aiMenu = $("#mainContent .ai-menu-box").empty();';
+ $script .= '$aiMenu.' . (!empty($menuOptions->injectMethod) ? $menuOptions->injectMethod : 'append') . "(`$html`).css('z-index', 2);\n";
$script .= <<< JAVASCRIPT
$('[data-toggle="popover"]').popover({template: '
'});
JAVASCRIPT;
diff --git a/module/execution/ui/view.html.php b/module/execution/ui/view.html.php
index 16b05612fa..841c0d56f5 100644
--- a/module/execution/ui/view.html.php
+++ b/module/execution/ui/view.html.php
@@ -268,7 +268,8 @@ div
set('data-class-name', 'text-gray border border-light'),
setClass('ml-2 mt-2 text-gray')
)
- )
+ ),
+ div(setClass('ai-menu-box flex-auto'))
),
div
(
diff --git a/module/product/ui/view.html.php b/module/product/ui/view.html.php
index 4894fd377c..4ff181e55c 100644
--- a/module/product/ui/view.html.php
+++ b/module/product/ui/view.html.php
@@ -160,9 +160,9 @@ div
setClass($product->status == 'normal' ? 'text-success' : 'text-gray'),
$this->processStatus('product', $product)
),
- span
+ div
(
- setClass('ml-2 flex-none'),
+ setClass('ml-2 flex-none row items-center gap-2'),
$lang->product->abbr->aclList[$product->acl],
icon
(
@@ -171,9 +171,10 @@ div
set('data-placement', 'right'),
set('data-type', 'white'),
set('data-class-name', 'text-gray border border-light'),
- setClass('ml-2 mt-2 text-gray')
+ setClass('text-gray')
)
- )
+ ),
+ div(setClass('ai-menu-box flex-auto'))
),
div
(
diff --git a/module/project/ui/view.html.php b/module/project/ui/view.html.php
index fb85352dd7..adb569c069 100644
--- a/module/project/ui/view.html.php
+++ b/module/project/ui/view.html.php
@@ -272,7 +272,8 @@ row
setClass('ghost form-label-hint text-gray-300 ml-2'),
toggle::tooltip(array('title' => $lang->project->subAclList[$project->acl], 'className' => 'text-gray border border-gray-300', 'type' => 'white', 'placement' => 'right'))
)
- )
+ ),
+ div(setClass('ai-menu-box flex-auto'))
),
div
(
diff --git a/www/js/zui3/ai.js b/www/js/zui3/ai.js
index 5303e1ba0e..c811f4792e 100644
--- a/www/js/zui3/ai.js
+++ b/www/js/zui3/ai.js
@@ -20,9 +20,11 @@ window.openPageForm = function(url, data, callback)
{
return new Promise((resolve, reject) => {
const openedApp = $.apps.openApp(url);
- const handlePageLoad = () =>
+ let updateTimer = 0;
+ const tryUpdateForm = () =>
{
- setTimeout(() =>
+ if(updateTimer) clearTimeout(updateTimer);
+ updateTimer = setTimeout(() =>
{
try
{
@@ -36,8 +38,8 @@ window.openPageForm = function(url, data, callback)
} catch (error) {reject(error)}
}, 2000);
};
- openedApp.$app.one('updateapp.apps updatepage.app', handlePageLoad);
- setTimeout(() => openedApp.$app.off('updateapp.apps', handlePageLoad), 5000);
+ openedApp.$app.one('updateapp.apps updatepage.app', tryUpdateForm);
+ setTimeout(() => openedApp.$app.off('updateapp.apps', tryUpdateForm), 5000);
});
}
@@ -80,6 +82,7 @@ window.executeZentaoPrompt = async function(info, auto)
}
},
fn: (response) => {
+ console.log('> executeZentaoPrompt', info.name, {info, response});
const result = response.data;
const targetForm = info.targetForm;
if(!targetForm) return {result: result};
diff --git a/www/js/zui3/zui.zentao.js b/www/js/zui3/zui.zentao.js
index 48c14d71fe..73d7c04773 100644
--- a/www/js/zui3/zui.zentao.js
+++ b/www/js/zui3/zui.zentao.js
@@ -1,7 +1,7 @@
var df=(M,ut,Ut)=>{if(!ut.has(M))throw TypeError("Cannot "+Ut)};var Ht=(M,ut,Ut)=>(df(M,ut,"read from private field"),Ut?Ut.call(M):ut.get(M)),nn=(M,ut,Ut)=>{if(ut.has(M))throw TypeError("Cannot add the same private member more than once");ut instanceof WeakSet?ut.add(M):ut.set(M,Ut)},cn=(M,ut,Ut,yc)=>(df(M,ut,"write to private field"),yc?yc.call(M,Ut):ut.set(M,Ut),Ut);var uf=(M,ut,Ut)=>(df(M,ut,"access private method"),Ut);(function(M,ut){typeof exports=="object"&&typeof module<"u"?ut(exports):typeof define=="function"&&define.amd?define(["exports"],ut):(M=typeof globalThis<"u"?globalThis:M||self,ut(M.zui={}))})(this,function(M){var Bl,Hl,lo,co,ho,uo,fo,po,Ul,v_,Vl,__,xs,Ss,Nv,Ev;"use strict";const ut="",Ut="",yc="",SS="",TS="",$S="",DS="",IS="",MS="",NS="",ES="",AS="",vc="3.0.0",D_="production",bf="f3c40ecb03e5cd2c88a31cc9380c7d53ceeda037",jn=document,Mo=window,wf=jn.documentElement,As=jn.createElement.bind(jn),Cf=As("div"),_c=As("table"),I_=As("tbody"),kf=As("tr"),{isArray:No,prototype:xf}=Array,{concat:M_,filter:bc,indexOf:Sf,map:Tf,push:N_,slice:$f,some:wc,splice:E_}=xf,A_=/^#(?:[\w-]|\\.|[^\x00-\xa0])*$/,P_=/^\.(?:[\w-]|\\.|[^\x00-\xa0])*$/,L_=/<.+>/,R_=/^\w+$/;function Cc(i,e){const t=z_(e);return!i||!t&&!Ps(e)&&!gt(e)?[]:!t&&P_.test(i)?e.getElementsByClassName(i.slice(1).replace(/\\/g,"")):!t&&R_.test(i)?e.getElementsByTagName(i):e.querySelectorAll(i)}class Eo{constructor(e,t){if(!e)return;if(kc(e))return e;let n=e;if(At(e)){const s=t||jn;if(n=A_.test(e)&&Ps(s)?s.getElementById(e.slice(1).replace(/\\/g,"")):L_.test(e)?Af(e):kc(s)?s.find(e):At(s)?y(s).find(e):Cc(e,s),!n)return}else if(Ls(e))return this.ready(e);(n.nodeType||n===Mo)&&(n=[n]),this.length=n.length;for(let s=0,r=this.length;s{for(;e.firstChild;)e.removeChild(e.firstChild)})};function Ao(...i){const e=O_(i[0])?i.shift():!1,t=i.shift(),n=i.length;if(!t)return{};if(!n)return Ao(e,y,t);for(let s=0;s{gt(r)&&Ct(t,(o,a)=>{n?e?r.classList.add(a):r.classList.remove(a):r.classList.toggle(a)})})},ae.addClass=function(i){return this.toggleClass(i,!0)},ae.removeAttr=function(i){const e=Po(i);return this.each((t,n)=>{gt(n)&&Ct(e,(s,r)=>{n.removeAttribute(r)})})};function B_(i,e){if(i){if(At(i)){if(arguments.length<2){if(!this[0]||!gt(this[0]))return;const t=this[0].getAttribute(i);return rr(t)?void 0:t}return Vt(e)?this:rr(e)?this.removeAttr(i):this.each((t,n)=>{gt(n)&&n.setAttribute(i,e)})}for(const t in i)this.attr(t,i[t]);return this}}ae.attr=B_,ae.removeClass=function(i){return arguments.length?this.toggleClass(i,!1):this.attr("class","")},ae.hasClass=function(i){return!!i&&wc.call(this,e=>gt(e)&&e.classList.contains(i))},ae.get=function(i){return Vt(i)?$f.call(this):(i=Number(i),this[i<0?i+this.length:i])},ae.eq=function(i){return y(this.get(i))},ae.first=function(){return this.eq(0)},ae.last=function(){return this.eq(-1)};function H_(i){return Vt(i)?this.get().map(e=>gt(e)||F_(e)?e.textContent:"").join(""):this.each((e,t)=>{gt(t)&&(t.textContent=i)})}ae.text=H_;function Bn(i,e,t){if(!gt(i))return;const n=Mo.getComputedStyle(i,null);return t?n.getPropertyValue(e)||void 0:n[e]||i.style[e]}function xn(i,e){return parseInt(Bn(i,e),10)||0}function If(i,e){return xn(i,`border${e?"Left":"Top"}Width`)+xn(i,`padding${e?"Left":"Top"}`)+xn(i,`padding${e?"Right":"Bottom"}`)+xn(i,`border${e?"Right":"Bottom"}Width`)}const Sc={};function U_(i){if(Sc[i])return Sc[i];const e=As(i);jn.body.insertBefore(e,null);const t=Bn(e,"display");return jn.body.removeChild(e),Sc[i]=t!=="none"?t:"block"}function Mf(i){return Bn(i,"display")==="none"}function Nf(i,e){const t=i&&(i.matches||i.webkitMatchesSelector||i.msMatchesSelector);return!!t&&!!e&&t.call(i,e)}function Lo(i){return At(i)?(e,t)=>Nf(t,i):Ls(i)?i:kc(i)?(e,t)=>i.is(t):i?(e,t)=>t===i:()=>!1}ae.filter=function(i){const e=Lo(i);return y(bc.call(this,(t,n)=>e.call(t,n,t)))};function ts(i,e){return e?i.filter(e):i}ae.detach=function(i){return ts(this,i).each((e,t)=>{t.parentNode&&t.parentNode.removeChild(t)}),this};const V_=/^\s*<(\w+)[^>]*>/,W_=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,Ef={"*":Cf,tr:I_,td:kf,th:kf,thead:_c,tbody:_c,tfoot:_c};function Af(i){if(!At(i))return[];if(W_.test(i))return[As(RegExp.$1)];const e=V_.test(i)&&RegExp.$1,t=Ef[e]||Ef["*"];return t.innerHTML=i,y(t.childNodes).detach().get()}y.parseHTML=Af,ae.has=function(i){const e=At(i)?(t,n)=>Cc(i,n).length:(t,n)=>n.contains(i);return this.filter(e)},ae.not=function(i){const e=Lo(i);return this.filter((t,n)=>(!At(i)||gt(n))&&!e.call(n,t,n))};function Hn(i,e,t,n){const s=[],r=Ls(e),o=n&&Lo(n);for(let a=0,l=i.length;ae.selected&&!e.disabled&&!e.parentNode.disabled),"value"):i.value||""}function K_(i){return arguments.length?this.each((e,t)=>{const n=t.multiple&&t.options;if(n||Wf.test(t.type)){const s=No(i)?Tf.call(i,String):rr(i)?[]:[String(i)];n?Ct(t.options,(r,o)=>{o.selected=s.indexOf(o.value)>=0},!0):t.checked=s.indexOf(t.value)>=0}else t.value=Vt(i)||rr(i)?"":i}):this[0]&&Pf(this[0])}ae.val=K_,ae.is=function(i){const e=Lo(i);return wc.call(this,(t,n)=>e.call(t,n,t))},y.guid=1;function Sn(i){return i.length>1?bc.call(i,(e,t,n)=>Sf.call(n,e)===t):i}y.unique=Sn,ae.add=function(i,e){return y(Sn(this.get().concat(y(i,e).get())))},ae.children=function(i){return ts(y(Sn(Hn(this,e=>e.children))),i)},ae.parent=function(i){return ts(y(Sn(Hn(this,"parentNode"))),i)},ae.index=function(i){const e=i?y(i)[0]:this[0],t=i?this:y(e).parent().children();return Sf.call(t,e)},ae.closest=function(i){const e=this.filter(i);if(e.length)return e;const t=this.parent();return t.length?t.closest(i):e},ae.siblings=function(i){return ts(y(Sn(Hn(this,e=>y(e).parent().children().not(e)))),i)},ae.find=function(i){return y(Sn(Hn(this,e=>Cc(i,e))))};const q_=/^\s*\s*$/g,G_=/^$|^module$|\/(java|ecma)script/i,Z_=["type","src","nonce","noModule"];function Y_(i,e){const t=y(i);t.filter("script").add(t.find("script")).each((n,s)=>{if(G_.test(s.type)&&wf.contains(s)){const r=As("script");r.text=s.textContent.replace(q_,""),Ct(Z_,(o,a)=>{s[a]&&(r[a]=s[a])}),e.head.insertBefore(r,null),e.head.removeChild(r)}})}function J_(i,e,t,n,s){n?i.insertBefore(e,t?i.firstChild:null):i.nodeName==="HTML"?i.parentNode.replaceChild(e,i):i.parentNode.insertBefore(e,t?i:i.nextSibling),s&&Y_(e,i.ownerDocument)}function ns(i,e,t,n,s,r,o,a){return Ct(i,(l,c)=>{Ct(y(c),(h,d)=>{Ct(y(e),(f,m)=>{const _=t?d:m,w=t?m:d,C=t?h:f;J_(_,C?w.cloneNode(!0):w,n,s,!C)},a)},o)},r),e}ae.after=function(){return ns(arguments,this,!1,!1,!1,!0,!0)},ae.append=function(){return ns(arguments,this,!1,!1,!0)};function X_(i){if(!arguments.length)return this[0]&&this[0].innerHTML;if(Vt(i))return this;const e=/