|
PDA权限的设计(A解决方案)
权限的获取;
- /*
- * 插叙访问权限
- */
- function check_privilege($app,$fun,$emp){
- $ret=0;
- $this->prepare_mes(false);
- $sql="select syant.CHECK_PRIVILEGE('{$app}','{$fun}','{$emp}') bb from dual";
- $row = $this->mes->getRow($sql);
- if($row){
- $ret=$row["bb"]*1;
- }
- return $ret;
- }
复制代码
老版本对APP的适应:
- function MPageIQCCreate($sender, $params)
- {
- $this->showDebug();
- $this->getEmp();
- // KIT - CHECKIN - 收料入库
- $flag=check_privilege("SMTAPP","pWhs-checkin.php",$this->emp_no);
- $data=array("action"=>"COMMON",
- "url"=>"pWhs-checkin.php",
- "color"=>"#003366",
- "privilege"=>$flag,
- );
- //$this->Image1->Link="pDevice.php?d=".$this->getStrEncode($data);
- $this->Image1->Link=get_real_url($data);
- }
复制代码
新版本对APP的适应
- /*
- * 展开每一个Image Link, 范例如下:
- * <div id="Image1_outer" style="Z-INDEX: 0; LEFT: 24px; WIDTH: 120px; POSITION: absolute; TOP: 7px; HEIGHT: 120px">
- * <div id="Image1_container" style=" width: 120px; height: 120px; cursor: default;">
- * <a href="http://localhost:3571/pIQC.php?emp=SYANT" target="_self" class="ui-link">
- * <img id="Image1" src="../images/IQC.png" width="120" height="120" border="0">
- * </a>
- * </div>
- * </div>
- */
- function printRealLink($kindex,$link){
- global $config;
- $kindex=$kindex+10;
- $bgcolor=$this->bgcolor;
- $mytop=$link["height"]+$link["top"]+4;
- $linkdata=array("action"=>"COMMON", //全部转到COMMON这个activity来处理
- "url"=>$link["link"], //真正需要跳转的页面地址
- "color"=>$this->bgcolor, //activity的加载前,webview的背景颜色,
- "privilege"=>1, //是否有权限,这个数据留给app处理,提示没有权限或者其他操作
- );
- $linkstr=$config->site_path."".$this->get_real_url($linkdata, $this->weborapp); //."?emp=".$this->empno; ///pda/A.php/menu/mainmenu
- if($this->bDebug){
- $this->addDebugInfo($linkstr,"#".dechex(rand(150, 255)).dechex(rand(150, 255)).dechex(rand(150, 255))."");
- //$this->addDebugInfo($linkstr,"rgb(0,0,255)");
- }
- /*
- * app还会在后面固定添加以下参数:
- * "&did=" + did +
- * "&rid=" + rid +
- * "&ap=" + ap +
- * "&ver=" + ver +
- * "&emp=" + emp_no +
- * "&w=" + w +
- * "&h=" + h +
- * "&t=" + t +
- * "&device=pda";
- */
-
- $str = <<<EOD
- <div id="{$link["name"]}_outer" style="Z-INDEX: {$kindex}; LEFT: {$link["left"]}px; WIDTH: {$link["width"]}px; POSITION: absolute; TOP: {$link["top"]}px; HEIGHT: {$link["height"]}px">
- <div id="{$link["name"]}_container" style=" width: {$link["width"]}px; height: {$link["height"]}px; cursor: default;">
- <a href="{$linkstr}" target="_self" class="ui-link">
- <img id="Image1" src="../images/{$link["src"]}" width="{$link["width"]}" height="{$link["height"]}" border="0">
- </a>
- </div>
- </div>
- EOD;
- $str2=<<<EOD
- <div id="Label1_outer" style="background-color: {$bgcolor}; Z-INDEX: {$kindex}; LEFT: {$link["left"]}px; WIDTH: {$link["width"]}px; POSITION: absolute; TOP: {$mytop}px; HEIGHT: 24px">
- <div id="Label1" style="text-align:center; margin:0 auto; font-family: Tahoma; font-size: 14px; color: White;font-weight: bold; background-color: {$bgcolor};cursor: default;height:24px;width:{$link["width"]}px;">{$link["title"]}</div>
- </div>
- EOD;
- return $str."\r\n".$str2;
- }
复制代码 |
|