Skip to content
Permalink
Browse files

+updt actoption

  • Loading branch information...
wadelau committed Apr 27, 2019
1 parent 7f747b5 commit e8aaaf032740865da91a0521c96542adbef546c2
Showing with 65 additions and 23 deletions.
  1. +9 −7 act/view.php
  2. +3 −1 class/gtbl.class.php
  3. +27 −11 comm/ido.js
  4. +15 −0 ido.php
  5. +4 −4 jdo.php
  6. +7 −0 view/signupin_signin.html
@@ -224,21 +224,20 @@
$out .= "<tr ><td style=\"border-top: 1px dotted #cccccc; vertical-align:middle;\" colspan=\""
.$form_cols."\"> </td></tr>";
}
$out .= "<tr><td colspan=\"".$form_cols."\" align=\"center\">
$rtn2top = 'document.location.href=\'#contentarea_outer\';';
$out .= "<tr><td colspan=\"".$form_cols."\" align=\"center\" style=\"word-spacing:8px;\">
<input type=\"button\" name=\"viewbtn\" id=\"viewbtn\" value=\"编辑\"
onclick=\"javascript:doActionEx('"
.$jdo."&act=modify','contentarea');\"".($hasDisableW ? ' disabled' : '')."/>
.$jdo."&act=modify','contentarea');$rtn2top\"".($hasDisableW ? ' disabled' : '')."/>
<input type=\"button\" name=\"printbtn\" id=\"printbtn\" value=\"打印预览\"
onclick=\"javascript:window.open('"
.$jdo."&act=print&isoput=1&isheader=0','PrintWindow','scrollbars,toolbar,location=0');\"/>
<input type=\"button\" name=\"deletebtn\" id=\"deletebtn\" value=\"删除\"
onclick=\"javascript:if(window.confirm('Are you sure to delete? / 您确定要删除 id:".$id
." 吗?')){doAction('".$jdo."&act=list-dodelete');}\"".($hasDisableW ? ' disabled' : '')."/>
<input type=\"button\" name=\"addbycopybtn\" id=\"addbycopybtn\" value=\"复制\"
onclick=\"javascript:doActionEx('".$jdo."&act=addbycopy','contentarea');\"/>
<input type=\"button\" name=\"cancelbtn\" value=\"关闭\"
onclick=\"javascript:parent.switchArea('contentarea_outer','off');\" />";
onclick=\"javascript:doActionEx('".$jdo."&act=addbycopy','contentarea');$rtn2top\"/>";
# more act options
if(true){
$actArr = $gtbl->getActOption($hmorig);
@@ -251,9 +250,12 @@
$actv[0] = "javascript:doActionEx('".$actv[0]."','contentarea');";
}
$out .= "<input type='button' name='actoption_$actk' value='".$actv[1]."'"
." onclick=\"".$actv[0]."\"/>\n";
." onclick=\"".$actv[0].";$rtn2top\"/>\n";
}
}
$out .= "<input type=\"button\" name=\"cancelbtn\" value=\"关闭\"
onclick=\"javascript:parent.switchArea('contentarea_outer','off');\" />";
$out .="</td></tr>";
@@ -367,7 +367,9 @@ public function getSearchByTime(){
return $tmpstr=='' ? $default : $tmpstr;
}
//-
//- Action options in popup menu and/or act/view for every single row
//- retrieve in ido, act/view
//- see xml/fin_todotbl
public function getActOption($result=null){
$tmpstr = $this->hmconf[$this->taglist['table'].$this->sep.$this->prttbl.$this->sep.$this->taglist['actoption']];
$tmpstr = $tmpstr==null?'':$tmpstr;
@@ -638,11 +638,14 @@ function registerAct(tObj){
function doActSelect(sSel, sUrl, iId, fieldVal){

var fieldv = fieldVal;
if(fieldv == null || fieldv ==''){
if((fieldv == null || fieldv =='') && fieldv != 'ActOption'){
fieldv = document.getElementById(sSel).options[document.getElementById(sSel).selectedIndex].value;
}
console.log("doActSelect: fieldv:["+fieldv+"]");
var targetUrl = sUrl+"&act="+fieldv;
var targetUrl = sUrl;
if(fieldv != 'ActOption'){
targetUrl += "&act="+fieldv;
}
var actListDiv = document.getElementById('divActList_'+iId); var hideActListDiv = 1;

if(fieldv != ''){
@@ -1192,7 +1195,7 @@ function input2Search(inputx, obj, div3rd, valueoption){
}

//-
function showActList(nId, isOn, sUrl){
function showActList(nId, isOn, sUrl, dataId){
var divId = 'divActList_'+nId;
//console.log((new Date())+": divId:["+divId+"]");
var divObj = document.getElementById(divId);
@@ -1202,20 +1205,33 @@ function showActList(nId, isOn, sUrl){
divObj.onmouseover = function(){ this.style.display='block'; };
divObj.onmouseout = function(){ this.style.display='none'; };

var sCont = '<p>';

sCont += '&nbsp; &nbsp;&nbsp;<a href="javascript:void(0);" onclick="javascript:doActSelect(\'\', \''+sUrl+'\', \''
var sCont = '<p>'; var targetAreaId = '#contentarea_outer';
sCont += '&nbsp; &nbsp;&nbsp;<a href="'+targetAreaId+'" onclick="javascript:doActSelect(\'\', \''+sUrl+'\', \''
+nId+'\', \'view\');">查看View</a>&nbsp; &nbsp;&nbsp;';
sCont += '<br/>&nbsp; &nbsp;&nbsp;<a href="javascript:void(0);" onclick="javascript:doActSelect(\'\', \''+sUrl+'\', \''
sCont += '<br/>&nbsp; &nbsp;&nbsp;<a href="'+targetAreaId+'" onclick="javascript:doActSelect(\'\', \''+sUrl+'\', \''
+nId+'\', \'modify\');">修改Edit</a>&nbsp; &nbsp;&nbsp;';
sCont += '<br/>&nbsp; &nbsp;&nbsp;<a href="javascript:void(0);" onclick="javascript:doActSelect(\'\', \''+sUrl+'\', \''
sCont += '<br/>&nbsp; &nbsp;&nbsp;<a href="'+targetAreaId+'" onclick="javascript:doActSelect(\'\', \''+sUrl+'\', \''
+nId+'\', \'print\');">打印Print</a>&nbsp; &nbsp;&nbsp;';
sCont += '<br/>&nbsp; &nbsp;&nbsp;<a href="javascript:void(0);" onclick="javascript:doActSelect(\'\', \''+sUrl+'\', \''
sCont += '<br/>&nbsp; &nbsp;&nbsp;<a href="'+targetAreaId+'" onclick="javascript:doActSelect(\'\', \''+sUrl+'\', \''
+nId+'\', \'list-dodelete\');">删除Delete</a>&nbsp; &nbsp;&nbsp;';
sCont += '<br/>&nbsp; &nbsp;&nbsp;<a href="javascript:void(0);" onclick="javascript:doActSelect(\'\', \''+sUrl+'\', \''+nId+'\', \'addbycopy\');">复制Copy</a>&nbsp; &nbsp;&nbsp;';
sCont += '<br/>&nbsp; &nbsp;&nbsp;<a href="'+targetAreaId+'" onclick="javascript:doActSelect(\'\', \''+sUrl+'\', \''
+nId+'\', \'addbycopy\');">复制Copy</a>&nbsp; &nbsp;&nbsp;';

//- add more options on popup menu, Fri Apr 26 10:58:24 HKT 2019
if(typeof userinfo.actListOption != 'undefined'){
var actArr = userinfo.actListOption; var tmpName, tmpUrl;
for(var ai=0; ai<actArr.length; ai++){
tmpName = actArr[ai].actName;
tmpUrl = actArr[ai].actUrl;
if(tmpUrl != null && tmpUrl.indexOf('&id=&') > -1){
tmpUrl = tmpUrl.replace('&id=&', '&id='+dataId+'&');
}
sCont += '<br/>&nbsp; &nbsp;&nbsp;<a href="'+targetAreaId+'" onclick="javascript:doActSelect(\'\', \''+tmpUrl+'\', \''
+nId+'\', \'ActOption\');">'+tmpName+'</a>&nbsp; &nbsp;&nbsp;';
}
}

sCont += '</p>';

divObj.innerHTML = sCont;

}
15 ido.php
@@ -171,6 +171,21 @@
$out_footer = "<hr width=\"1\"/> &nbsp;&nbsp;&nbsp;<span id=\"noticediv\" style=\"color:green;\"> </span>";
if(true){
//- output more act options
$actArr = $gtbl->getActOption();
$out .= "\n<script type=\"text/javascript\">userinfo.actListOption=[";
$tmpstr = '';
if(count($actArr) > 0){
foreach($actArr as $actk=>$actv){
$tmpstr .= "{\"actName\":\"".$actv[1]."\", \"actUrl\":\"".$actv[0]."\""."},";
}
}
if(endsWith($tmpstr, ',')){ $tmpstr = substr($tmpstr, 0, strlen($tmpstr)-1); }
$out .= $tmpstr;
$out .= "];</script>";
}
$data['title'] = $gtbl->getTblCHN();
$gtbl = null;
@@ -226,8 +226,8 @@
$out .= "<td nowrap> <input name=\"checkboxid\" type=\"checkbox\" value=\"".$id
."\"> &nbsp; <a onmouseover=\"javascript:showActList('".$i."', 1, '"
.str_replace("&".$gtbl->getMyId()."=","&oid=", $jdo)."&".$gtbl->getMyId()."=".$id
."');\" onmouseout=\"javascript:showActList('".$i."', 0, '".str_replace("&".$gtbl->getMyId()."=","&oid=", $jdo)
."&".$gtbl->getMyId()."=".$id."');\" href='javascript:void(0);' onclick=\"javascript:doActionEx('".$jdo."&act=view&"
."', '$id');\" onmouseout=\"javascript:showActList('".$i."', 0, '".str_replace("&".$gtbl->getMyId()."=","&oid=", $jdo)
."&".$gtbl->getMyId()."=".$id."', '$id');\" href='javascript:void(0);' onclick=\"javascript:doActionEx('".$jdo."&act=view&"
.$gtbl->getMyId()."=".$id."','contentarea');;\" title=\"详细信息\">"
.($i + (intval($navi->get('pnpn'))-1) * (intval($navi->get('pnps'))))." / ".$id
." &#x25BE;</a> <div id=\"divActList_$i\" style=\"display:none; position: absolute; margin-left:50px; "
@@ -237,8 +237,8 @@
$url_uni_extra = $gtbl->getUniquePara($rec);
$out .= "<td nowrap> <input name=\"checkboxid\" type=\"checkbox\" value=\"".$id
."\"> &nbsp; <a onmouseover=\"javascript:showActList('".$i."', 1, '".$jdo."&".$url_uni_extra
."');\" onmouseout=\"javascript:showActList('".$i."', 0, '".$jdo."&".$url_uni_extra
."');\" href='javascript:void(0);' onclick=\"javascript:doActionEx('".$jdo."&act=view&".$url_uni_extra
."', '$id');\" onmouseout=\"javascript:showActList('".$i."', 0, '".$jdo."&".$url_uni_extra
."', '$id');\" href='javascript:void(0);' onclick=\"javascript:doActionEx('".$jdo."&act=view&".$url_uni_extra
."','contentarea');;\" title=\"详细信息\">".($i + (intval($navi->get('pnpn'))-1) * (intval($navi->get('pnps'))))
." / ".$id." &#x25BE;</a> <div id=\"divActList_$i\" style=\"display:none; position: absolute; margin-left:50px; "
."margin-top:-11px; z-index:99; background-color:silver;\">actlist-$i</div> </td>";
@@ -44,6 +44,13 @@
{$agentname}
</span>
<br/><strong><i>With</i></strong><br/>
<a href="#">
<img src="../upld/your_logo.jpg" title="-YourSite-"
style="width:18%;"
/>
</a>
&nbsp; &nbsp;&nbsp;&nbsp;
<a href="#-gmis" target="_blank" title="gMIS"
style="font-size:18px;font-weight:bold" target="_blank">
<!-- <i>g</i>MIS -->

0 comments on commit e8aaaf0

Please sign in to comment.
You can’t perform that action at this time.