调整了ajax读取元数据评审意见附件的动作位置,增加了图片类型文件的缩略图预览。
This commit is contained in:
parent
8b3da22dfb
commit
53c323d1ca
|
@ -642,6 +642,50 @@ class ServiceController extends Zend_Controller_Action
|
|||
}
|
||||
}
|
||||
|
||||
function getattsAction(){
|
||||
|
||||
$this->_helper->layout()->disableLayout();
|
||||
$this->_helper->viewRenderer->setNoRender();
|
||||
|
||||
$id = $this->_request->getParam('id');
|
||||
|
||||
if($id!='')
|
||||
{
|
||||
$auth = Zend_Auth::getInstance();
|
||||
if($auth->hasIdentity())
|
||||
{
|
||||
$user = $auth->getIdentity();
|
||||
$userid = $user->id;
|
||||
$sql = "select att.realname,att.id,att.filename from attachments att
|
||||
left join mdreviewattach ratt on att.id=ratt.attachid
|
||||
where ratt.reviewid=$id and att.userid=$userid";
|
||||
$rs = $this->db->query($sql);
|
||||
$atts = $rs->fetchAll();
|
||||
|
||||
include_once('files.php');
|
||||
|
||||
foreach($atts as $k=>$v)
|
||||
{
|
||||
$imgct = files::getImageType($this->config->upload.$v['filename']);
|
||||
|
||||
if(!isset($imgct['error'])) $preview = '<img src="/service/attpreview/id/'.$v['id'].'" style="display:block;" />';
|
||||
else $preview = "";
|
||||
|
||||
$atts[$k]['html']= $preview.$v['realname'].'[已完成]<input type="hidden" name="atts[]" value="'.$v['id'].'" /><div class="cancel"><a href="javascript:;" id="deletebtn_'.$v['id'].'"><img border="0" src="/static/js/uploadify/cancel.png" /></a></div>';
|
||||
}
|
||||
|
||||
echo Zend_Json::encode($atts);
|
||||
exit();
|
||||
}else
|
||||
{
|
||||
exit();
|
||||
}
|
||||
}else{
|
||||
exit();
|
||||
}
|
||||
//不输出错误
|
||||
}//获取附件
|
||||
|
||||
function filelistAction()
|
||||
{
|
||||
$uuid=$this->_request->getParam('uuid');
|
||||
|
|
|
@ -259,7 +259,7 @@ $(document).ready(function() {
|
|||
});
|
||||
}
|
||||
|
||||
$.getJSON("/upload/getatts/id/<?php echo $this->review['id'];?>", function(data) {
|
||||
$.getJSON("/service/getatts/id/<?php echo $this->review['id'];?>", function(data) {
|
||||
if(data)
|
||||
{
|
||||
$.each(data, function(key, val) {
|
||||
|
|
Loading…
Reference in New Issue