Commit 091dbcf8 authored by luoboss's avatar luoboss
Browse files

添加附件管理模型。

调整附件管理列表图片和文件展示形式。
调整文件上传记录形式为UBB格式。
完成UE编辑器在线管理资源功能。
调整工单详细页中反馈表单的布局。
parent 1e19c4dd
Showing with 405 additions and 131 deletions
+405 -131
......@@ -249,6 +249,11 @@ class Label {
return \Model\Auth::check($auth);
}
/**
* 超时标签输出
* @param $param
* @return string
*/
public function ticketTimeOutTag($param){
if($param['ticket_status'] == 0 && $param['ticket_submit_time'] + $param['ticket_model_time_out'] * 60 < time() ){
return 'ticket-timeout';
......@@ -257,4 +262,18 @@ class Label {
}
}
/**
* ubbURL模板输出
* @param $string
* @return array
*/
public function ubbUrl($string){
static $ubb;
if(is_object($ubb)){
return $ubb->url($string);
}
$ubb = new \Expand\UBB();
return $ubb->url($string);
}
}
<?php
namespace Expand;
/**
* 简单的HTML标记
*/
class UBB{
private $returnMatch;
/**
* UBB constructor.
* @param bool $returnMatch 是否直接返回转行好的UBB数组,默认返回处理好的HTML断片
*/
public function __construct($returnMatch = false) {
$this->returnMatch = $returnMatch;
}
/**
* 处理URL格式
* @param $string 要处理的字符
* @return array
*/
public function url($string){
$pattern = '/\[url=(.*?)\](.*?)\[\/url\]/i';
preg_match_all($pattern, $string, $match);
if(empty($match[0])){
return false;
}
if($this->returnMatch == true){
return $match;
}
$html = [];
foreach ($match[1] as $key => $value){
$html []= "<a href='{$value}' target='_blank' >{$match[2][$key]}</a>";
}
return $html;
}
}
\ No newline at end of file
......@@ -77,13 +77,33 @@ class UEController {
if(!in_array($action, ['listimage', 'listfile'])){
//上传成功,顺便将文件信息记录数据库
if($info['state'] == 'SUCCESS'){
// \Model\Content::insert('attachment', [
// 'attachment_name' => $info['original'],
// 'attachment_upload_name' => $info['title'],
// 'attachment_path' => $info['url'],
// 'attachment_type' => in_array($info['type'], json_decode($imgsuffix, true)) ? '1' : '2',
// 'attachment_createtime' => time(),
// ]);
$session = \Core\Func\CoreFunc::session()->getAll();
switch ($action){
case 'uploadimage':
$type = 0;
break;
case 'uploadfile':
$type = 1;
break;
case 'uploadvideo':
$type = 3;
break;
}
\Model\Content::insert('attachment', [
'attachment_status' => 1,
'attachment_path' => $info['url'],
'attachment_path_type' => 0,
'attachment_createtime' => time(),
'attachment_name' => (new \voku\helper\AntiXSS())->xss_clean(trim($info['original'])),
'attachment_type' => $type,
'attachment_owner' => empty($session['ticket']) ? 0 : 1,
'attachment_user_id' => empty($session['ticket']) ? 0 : $session['ticket']['user_id'],
'attachment_member_id' => empty($session['member']) ? -1 : $session['member']['member_id']
]);
}
}
return $result;
......
......@@ -10,6 +10,7 @@
namespace Expand;
class Uploader {
private $action;//请求方法
private $fileField; //文件域名
private $file; //文件上传对象
private $base64; //文件上传对象
......@@ -45,12 +46,15 @@ class Uploader {
);
/**
* 构造函数
* Uploader constructor.
* @param $action 请求方法
* @param string $fileField 表单名称
* @param array $config 配置项
* @param bool $base64 是否解析base64编码,可省略。若开启,则$fileField代表的是base64编码的字符串表单名
* @param bool $type | $base64 是否解析base64编码,可省略。若开启,则$fileField代表的是base64编码的字符串表单名
* @param string $imgsuffix
*/
public function __construct($fileField, $config, $type = "upload", $imgsuffix = "") {
public function __construct($action, $fileField, $config, $type = "upload", $imgsuffix = "") {
$this->action = $action;
$this->fileField = $fileField;
$this->config = $config;
$this->type = $type;
......@@ -351,6 +355,7 @@ class Uploader {
*/
public function getFileInfo() {
return array(
"action" => $this->action,
"state" => $this->stateInfo,
"url" => DOCUMENT_ROOT . $this->fullName,
"title" => $this->fileName,
......
<?php
/**
* 获取已上传的文件列表
* User: Jinqn
* Date: 14-04-09
* Time: 上午10:17
* 重写UE文件获取文件列表
* Copyright (c) 2019 PESCMS (https://www.pescms.com)
*
* For the full copyright and license information, please view
* the file LICENSE.md that was distributed with this source code.
*/
include "Uploader.php";
/* 判断类型 */
switch ($_GET['action']) {
/* 列出文件 */
case 'listfile':
$allowFiles = $CONFIG['fileManagerAllowFiles'];
$listSize = $CONFIG['fileManagerListSize'];
$path = $CONFIG['fileManagerListPath'];
break;
/* 列出图片 */
case 'listimage':
default:
$allowFiles = $CONFIG['imageManagerAllowFiles'];
$listSize = $CONFIG['imageManagerListSize'];
$path = $CONFIG['imageManagerListPath'];
}
$allowFiles = substr(str_replace(".", "|", join("", $allowFiles)), 1);
/* 获取参数 */
$size = isset($_GET['size']) ? htmlspecialchars($_GET['size']) : $listSize;
$start = isset($_GET['start']) ? htmlspecialchars($_GET['start']) : 0;
$end = $start + $size;
/* 获取文件列表 */
$path = $_SERVER['DOCUMENT_ROOT'] . (substr($path, 0, 1) == "/" ? "":"/") . $path;
$files = getfiles($path, $allowFiles);
if (!count($files)) {
return json_encode(array(
"state" => "no match file",
"list" => array(),
"start" => $start,
"total" => count($files)
));
}
/* 获取指定范围的列表 */
$len = count($files);
for ($i = min($end, $len) - 1, $list = array(); $i < $len && $i >= 0 && $i >= $start; $i--){
$list[] = $files[$i];
}
//倒序
//for ($i = $end, $list = array(); $i < $len && $i < $end; $i++){
// $list[] = $files[$i];
//}
class resource{
/* 返回数据 */
$result = json_encode(array(
"state" => "SUCCESS",
"list" => $list,
"start" => $start,
"total" => count($files)
));
private $getType = 0, $session = [], $start = 0;
return $result;
public function __construct() {
switch ($_GET['action']){
case 'listimage':
$this->getType = 0;
break;
case 'listfile':
$this->getType = 1;
break;
default:
die($this->returnMsg('获取类型失败'));
}
$this->session = \Core\Func\CoreFunc::session();
//判断是否登录状态下获取资源列表
if(empty($this->session->get('ticket')) && empty($this->session->get('member')) ){
die($this->returnMsg('非法请求,我们已记录此错误信息'));
}
/**
* 遍历获取目录下的指定类型的文件
* @param $path
* @param array $files
* @return array
*/
function getfiles($path, $allowFiles, &$files = array())
{
if (!is_dir($path)) return null;
if(substr($path, strlen($path) - 1) != '/') $path .= '/';
$handle = opendir($path);
while (false !== ($file = readdir($handle))) {
if ($file != '.' && $file != '..') {
$path2 = $path . $file;
if (is_dir($path2)) {
getfiles($path2, $allowFiles, $files);
} else {
if (preg_match("/\.(".$allowFiles.")$/i", $file)) {
$files[] = array(
'url'=> substr($path2, strlen($_SERVER['DOCUMENT_ROOT'])),
'mtime'=> filemtime($path2)
);
}
$this->start = (int) trim($_GET['start']);
}
public function index(){
$param = [
'attachment_type' => $this->getType
];
//客户登录状态下,获取自己上传的文件
if(!empty($this->session->get('member'))){
$condition = ' AND attachment_owner = 0 AND attachment_member_id = :id';
$param['id'] = $this->session->get('member')['member_id'];
}
//管理员登录状态,则覆写搜索条件
if(!empty($this->session->get('ticket'))){
$condition = ' AND attachment_owner = 1';
}
$result = \Model\Content::listContent([
'table' => 'attachment',
'condition' => "attachment_type = :attachment_type {$condition}",
'limit' => "{$this->start}, 20",
'param' => $param
]);
if(!empty($result)){
foreach ($result as $item){
$list[] = [
'url' => $item['attachment_path'],
'mtime' => $item['attachment_createtime'],
'name' => $item['attachment_name']
];
}
}
return $this->returnMsg('SUCCESS', $list);
}
return $files;
}
\ No newline at end of file
private function returnMsg($status, $list = array()){
return json_encode([
'state' => $status,
'list' => $list,
"start" => $this->start,
]);
}
}
return (new resource())->index();
\ No newline at end of file
......@@ -9,7 +9,8 @@ include "Uploader.php";
/* 上传配置 */
$base64 = "upload";
switch (htmlspecialchars($_GET['action'])) {
$action = htmlspecialchars(trim($_GET['action']));
switch ($action) {
case 'uploadimage':
$config = array(
"pathFormat" => $CONFIG['imagePathFormat'],
......@@ -48,7 +49,7 @@ switch (htmlspecialchars($_GET['action'])) {
}
/* 生成上传实例对象并完成上传 */
$up = new \Expand\Uploader($fieldName, $config, $base64, $imgsuffix);
$up = new \Expand\Uploader($action, $fieldName, $config, $base64, $imgsuffix);
/**
* 得到上传文件所对应的各个参数,数组结构
......
......@@ -150,6 +150,8 @@ class Ticket extends \Core\Model\Model {
if (empty($result)) {
return $form;
}
//组装一下,让他ticket_form_id成为键值
foreach ($result as $value) {
$form[$value['ticket_form_id']] = $value;
......@@ -197,15 +199,26 @@ class Ticket extends \Core\Model\Model {
break;
case 'file':
//@todo 待优化,下载应该基于header方法
$splitImg = explode(',', $value['ticket_form_content']);
$imgStr = '<ul class="am-avg-sm-4 am-thumbnails">';
if(!empty($value['ticket_form_content'])){
foreach ($splitImg as $key => $item){
$imgStr .= '<li><a href="'.$item.'">下载附件'.($key +1) .'</a></li>';
$downloadFile = (new \Expand\UBB())->url($value['ticket_form_content']);
if($downloadFile == false){
$splitImg = explode(',', $value['ticket_form_content']);
$imgStr = '<ul class="am-avg-sm am-thumbnails">';
if(!empty($value['ticket_form_content'])){
foreach ($splitImg as $key => $item){
$imgStr .= '<li><a href="'.$item.'">下载附件'.($key +1) .'</a></li>';
}
}
$imgStr .= '</ul>';
$form[$value['ticket_form_id']]['ticket_value'] = $imgStr;
}else{
$imgStr = '<ul class="am-avg-sm am-thumbnails">';
foreach ($downloadFile as $item){
$imgStr .= "<li>{$item}</li>";
}
$imgStr .= '</ul>';
$form[$value['ticket_form_id']]['ticket_value'] = $imgStr;
}
$imgStr .= '</ul>';
$form[$value['ticket_form_id']]['ticket_value'] = $imgStr;
break;
case 'encrypt':
$form[$value['ticket_form_id']]['ticket_value'] = !empty(self::session()->get('ticket')['user_id']) ? (new \Expand\OpenSSL(\Core\Func\CoreFunc::loadConfig('USER_KEY', true)))->decrypt($value['ticket_form_content']) : '<i class="am-text-warning">您提交了加密信息,此部分只有客服可知.</i>' ;
......@@ -218,7 +231,6 @@ class Ticket extends \Core\Model\Model {
$form[$value['ticket_form_id']]['ticket_form_bind_value'] = explode(',', $value['ticket_form_bind_value']);
}
}
return $form;
}
......
......@@ -3,7 +3,7 @@
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: 2019-09-02 02:38:50
-- Generation Time: 2019-09-12 02:13:20
-- 服务器版本: 5.6.25-log
-- PHP Version: 5.6.12
......@@ -22,6 +22,26 @@ SET time_zone = "+00:00";
-- --------------------------------------------------------
--
-- 表的结构 `pes_attachment`
--
CREATE TABLE IF NOT EXISTS `pes_attachment` (
`attachment_id` int(11) NOT NULL AUTO_INCREMENT,
`attachment_status` tinyint(4) NOT NULL DEFAULT '0',
`attachment_path` varchar(1000) NOT NULL DEFAULT '',
`attachment_createtime` int(11) NOT NULL DEFAULT '0',
`attachment_name` varchar(255) NOT NULL DEFAULT '',
`attachment_path_type` int(11) NOT NULL DEFAULT '0',
`attachment_type` int(11) NOT NULL DEFAULT '0',
`attachment_user_id` int(11) NOT NULL DEFAULT '0' COMMENT '后台上传用户ID',
`attachment_member_id` int(11) NOT NULL DEFAULT '-1' COMMENT '前台上传用户ID -1 为匿名',
`attachment_owner` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`attachment_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- 表的结构 `pes_category`
--
......@@ -60,7 +80,7 @@ CREATE TABLE IF NOT EXISTS `pes_field` (
PRIMARY KEY (`field_id`),
UNIQUE KEY `modle_id` (`field_model_id`,`field_name`),
KEY `field_name` (`field_name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=245 ;
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=252 ;
--
-- 转存表中的数据 `pes_field`
......@@ -181,7 +201,14 @@ INSERT INTO `pes_field` (`field_id`, `field_model_id`, `field_name`, `field_disp
(241, 15, 'contact_default', '默认联系方式', 'radio', '{&quot;\\u90ae\\u4ef6&quot;:&quot;1&quot;,&quot;\\u624b\\u673a\\u53f7\\u7801&quot;:&quot;2&quot;,&quot;\\u5fae\\u4fe1&quot;:&quot;3&quot;}', '', '', 1, 13, 0, 1, 1, 0),
(242, 15, 'postscript', '页内指引', 'editor', '', '填写此项,在工单提交内页顶部将显示这部分填写的内容。', '', 0, 11, 0, 1, 1, 0),
(243, 15, 'default_send', '默认发送通知', 'radio', '{&quot;\\u5426&quot;:&quot;0&quot;,&quot;\\u662f&quot;:&quot;1&quot;}', '选择是,则当前工单模型的工单处理过程,默认发送通知复选框会勾上。', '', 0, 14, 0, 1, 1, 0),
(244, 16, 'postscript', '工单表单详细说明', 'editor', '', '若需要对当前表单字段有更加完整的说明,请在此处填写。', '', 0, 11, 0, 1, 1, 0);
(244, 16, 'postscript', '工单表单详细说明', 'editor', '', '若需要对当前表单字段有更加完整的说明,请在此处填写。', '', 0, 11, 0, 1, 1, 0),
(245, 24, 'status', '状态', 'radio', '{"\\u7981\\u7528":"0","\\u542f\\u7528":"1"}', '', '1', 1, 100, 1, 1, 1, 0),
(246, 24, 'createtime', '创建时间', 'date', '', '', '', 0, 99, 1, 1, 1, 0),
(247, 24, 'name', '附件名称', 'text', '', '', '', 1, 2, 1, 1, 1, 0),
(248, 24, 'path', '附件地址', 'text', '', '', '', 1, 3, 1, 1, 1, 0),
(249, 24, 'path_type', '存储位置', 'radio', '{&quot;\\u672c\\u5730\\u786c\\u76d8&quot;:&quot;0&quot;}', '', '', 1, 4, 1, 1, 1, 0),
(250, 24, 'type', '附件类型', 'radio', '{&quot;\\u56fe\\u7247&quot;:&quot;0&quot;,&quot;\\u6587\\u4ef6&quot;:&quot;1&quot;,&quot;\\u591a\\u5a92\\u4f53&quot;:&quot;3&quot;}', '', '', 1, 1, 1, 1, 1, 0),
(251, 24, 'owner', '上传方', 'radio', '{&quot;\\u524d\\u53f0\\u7528\\u6237&quot;:&quot;0&quot;,&quot;\\u540e\\u53f0\\u7ba1\\u7406&quot;:&quot;1&quot;}', '', '', 1, 94, 1, 1, 1, 0);
-- --------------------------------------------------------
......@@ -285,7 +312,7 @@ CREATE TABLE IF NOT EXISTS `pes_menu` (
`menu_type` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`menu_id`),
KEY `menu_pid` (`menu_pid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=34 ;
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=35 ;
--
-- 转存表中的数据 `pes_menu`
......@@ -299,8 +326,7 @@ INSERT INTO `pes_menu` (`menu_id`, `menu_name`, `menu_pid`, `menu_icon`, `menu_l
(6, '基础设置', 9, 'am-icon-tv', 'Ticket-Setting-action', 1, 0),
(7, '菜单设置', 9, 'am-icon-map-signs', 'Ticket-Menu-index', 2, 0),
(9, '系统设置', 0, 'am-icon-cog', '', 10, 0),
(10, '帮助文档', 9, 'am-icon-leanpub', 'https://www.pescms.com/d/index/22', 6, 1),
(11, '反馈建议', 9, 'am-icon-twitch', 'https://forum.pescms.com/list/22.html', 7, 1),
(10, '帮助文档', 9, 'am-icon-leanpub', 'https://www.pescms.com/d/index/22', 8, 1),
(12, '工作台', 0, 'am-icon-tachometer', 'Ticket-Index-index', 1, 0),
(13, '工单列表', 0, 'am-icon-yelp', '', 2, 0),
(14, '用户组', 3, 'am-icon-steam', 'Ticket-User_group-index', 2, 0),
......@@ -308,7 +334,7 @@ INSERT INTO `pes_menu` (`menu_id`, `menu_name`, `menu_pid`, `menu_icon`, `menu_l
(16, '路由规则', 9, 'am-icon-map-o', 'Ticket-Route-index', 4, 0),
(17, '工单列表', 13, 'am-icon-fire', 'Ticket-Ticket-index', 1, 0),
(18, '我的工单', 13, 'am-icon-coffee', 'Ticket-Ticket-myTicket', 2, 0),
(19, '邮件模板', 9, 'am-icon-paint-brush', 'Ticket-Mail_template-index', 5, 0),
(19, '邮件模板', 9, 'am-icon-paint-brush', 'Ticket-Mail_template-index', 6, 0),
(21, '工单分类', 1, 'am-icon-list-alt', 'Ticket-Category-index', 1, 0),
(23, '客户管理', 3, 'am-icon-street-view', 'Ticket-Member-index', 4, 0),
(24, '应用商店', 9, 'am-icon-cogs', 'Ticket-Application-index', 3, 0),
......@@ -316,7 +342,8 @@ INSERT INTO `pes_menu` (`menu_id`, `menu_name`, `menu_pid`, `menu_icon`, `menu_l
(26, '发送列表', 9, 'am-icon-send', 'Ticket-Send-index', 5, 0),
(27, '全部工单', 13, 'am-icon-list', 'Ticket-Ticket-all', 1, 0),
(32, '常见问题解答', 1, 'am-icon-question-circle', 'Ticket-Fqa-index', 20, 0),
(33, '工单投诉反馈', 0, 'am-icon-cutlery', 'Ticket-Ticket-complain', 6, 0);
(33, '工单投诉反馈', 0, 'am-icon-cutlery', 'Ticket-Ticket-complain', 6, 0),
(34, '附件管理', 9, 'am-icon-suitcase', 'Ticket-Attachment-index', 7, 0);
-- --------------------------------------------------------
......@@ -334,7 +361,7 @@ CREATE TABLE IF NOT EXISTS `pes_model` (
`model_page` int(11) NOT NULL DEFAULT '10',
PRIMARY KEY (`model_id`),
UNIQUE KEY `model_name` (`model_name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=24 ;
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=25 ;
--
-- 转存表中的数据 `pes_model`
......@@ -355,7 +382,8 @@ INSERT INTO `pes_model` (`model_id`, `model_name`, `model_title`, `model_status`
(20, 'Member', '客户管理', 1, 1, 1, 10),
(21, 'Send', '发送列表', 1, 1, 1, 10),
(22, 'Phrase', '回复短语', 1, 0, 2, 10),
(23, 'Fqa', '常见问题解答', 1, 1, 1, 10);
(23, 'Fqa', '常见问题解答', 1, 1, 1, 10),
(24, 'attachment', '附件管理', 1, 0, 2, 30);
-- --------------------------------------------------------
......@@ -375,7 +403,7 @@ CREATE TABLE IF NOT EXISTS `pes_node` (
`node_controller` int(11) NOT NULL DEFAULT '0',
`node_listsort` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`node_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=93 ;
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=99 ;
--
-- 转存表中的数据 `pes_node`
......@@ -473,7 +501,13 @@ INSERT INTO `pes_node` (`node_id`, `node_name`, `node_parent`, `node_verify`, `n
(89, 'FQA删除', 7, 1, '', 'DELETE', 'action', 'TicketDELETEFqaaction', 84, 114),
(90, '复制用户组', 21, 1, '', 'POST', 'copy', 'TicketPOSTUser_groupcopy', 22, 141),
(91, '工单投诉列表', 2, 1, '', 'GET', 'complain', 'TicketGETTicketcomplain', 2, 130),
(92, '工单投诉详情', 2, 1, '', 'GET', 'complainDetail', 'TicketGETTicketcomplainDetail', 2, 131);
(92, '工单投诉详情', 2, 1, '', 'GET', 'complainDetail', 'TicketGETTicketcomplainDetail', 2, 131),
(93, '附件管理', 11, 1, '', 'GET', 'Attachment', '', 0, 9),
(94, '附件列表', 43, 1, '', 'GET', 'index', 'TicketGETAttachmentindex', 93, 130),
(95, '附件编辑', 43, 1, '', 'GET', 'action', 'TicketGETAttachmentaction', 93, 140),
(96, '附件添加', 43, 1, '', 'POST', 'action', 'TicketPOSTAttachmentaction', 93, 150),
(97, '附件更新', 43, 1, '', 'PUT', 'action', 'TicketPUTAttachmentaction', 93, 160),
(98, '附件删除', 43, 1, '', 'DELETE', 'action', 'TicketDELETEAttachmentaction', 93, 170);
-- --------------------------------------------------------
......
1.2.19
\ No newline at end of file
1.2.20
\ No newline at end of file
......@@ -4,7 +4,6 @@
<h3>新工单 > <?= $ticketInfo['category']['category_name'] ?> > <?= $ticketInfo['title'] ?></h3>
<form action="<?= $label->url('Submit-ticket') ?>" method="POST" class="am-form ajax-submit am-form-horizontal" data-am-validator>
<input type="hidden" name="number" value="<?= $ticketInfo['number'] ?>">
<input type="hidden" name="PHPSESSIONID" value="">
<?= $label->token() ?>
<?php if(!empty($ticketInfo['postscript'])): ?>
......
......@@ -56,25 +56,34 @@
<h3 class="am-margin-0">沟通记录</h3>
</div>
<ul class="am-list am-list-static am-text-sm am-list-hover">
<li class="am-text-gray am-text-gray-background">
<li class="am-text-gray-background">
<div class="am-g">
<div class="am-u-sm-1">
<div class="am-u-sm-2 am-u-lg-1">
<img src="<?= DOCUMENT_ROOT . '/Theme/assets/i/custom.ico'; ?>" alt=""
class="am-comment-avatar" width="48" height="48">
</div>
<div class="am-u-sm-11">
<div class="am-u-sm-10 am-u-lg-11">
<div class="am-block">
<?php foreach ($form as $key => $value): ?>
<?php if ($value['ticket_form_bind'] == '0'): ?>
<p><span class="pt-text-explode"><?= $value['ticket_form_description']; ?>: </span><?= $value['ticket_value']; ?></p>
<div class="pt-text-border">
<div class="pt-text-explode"><?= $value['ticket_form_description']; ?>:</div>
<div><?= $value['ticket_value']; ?></div>
</div>
<?php else: ?>
<?php if (in_array($form[$value['ticket_form_bind']]['ticket_form_content'], $value['ticket_form_bind_value'])): ?>
<p><span class="pt-text-explode"><?= $value['ticket_form_description']; ?>: </span><?= $value['ticket_value']; ?></p>
<div class="pt-text-border">
<div class="pt-text-explode"><?= $value['ticket_form_description']; ?>:</div>
<div><?= $value['ticket_value']; ?></div>
</div>
<?php endif; ?>
<?php endif; ?>
<?php endforeach; ?>
</div>
<div class="am-block"><?= date('Y-m-d H:i:s', $ticket_submit_time); ?></div>
</div>
</div>
</li>
......
<?php include THEME_PATH . "/Content/Content_index_header.php"; ?>
<?php include $tool_column; ?>
<?php if (empty($list)): ?>
<div class="am-alert am-alert-secondary am-margin-top am-margin-bottom am-text-center" data-am-alert>
<p>本页面没有数据 :-(</p>
</div>
<?php else: ?>
<form class="am-form ajax-submit" action="<?= $label->url(GROUP . '-' . MODULE . '-listsort'); ?>" method="POST">
<input type="hidden" name="method" value="PUT"/>
<table class="am-table am-table-bordered am-table-striped am-table-hover am-text-sm">
<tr>
<?php if ($listsort): ?>
<th class="table-sort">排序</th>
<?php endif; ?>
<th class="table-set">ID</th>
<?php foreach ($field as $value) : ?>
<?php if ($value['field_name'] == 'status'): ?>
<?php $class = 'table-set'; ?>
<?php else: ?>
<?php $class = 'table-title'; ?>
<?php endif; ?>
<th class="<?= $class ?>"><?= $value['field_display_name']; ?></th>
<?php endforeach; ?>
<th class="table-set">操作</th>
</tr>
<?php foreach ($list as $key => $value) : ?>
<tr>
<?php if ($listsort): ?>
<td class="am-text-middle">
<input type="text" class="am-input-sm" name="id[<?= $value["{$fieldPrefix}id"]; ?>]"
value="<?= $value["{$fieldPrefix}listsort"]; ?>">
</td>
<?php endif; ?>
<td class="am-text-middle"><?= $value["{$fieldPrefix}id"]; ?></td>
<?php foreach ($field as $fv) : ?>
<td class="am-text-middle">
<?php
if($fv['field_name'] == 'path'){
switch ($value['attachment_type']){
case '0':
$fv['field_type'] = 'img';
break;
case '1':
$fv['field_type'] = 'file';
break;
case '3':
break;
}
}
?>
<?= $label->valueTheme($fv, $fieldPrefix, $value); ?>
</td>
<?php endforeach; ?>
<td class="am-text-middle">
<?php /* 若要实现自定义的操作按钮,请更改本变量 */ ?>
<?php $operate = empty($operate) ? '/Content/Content_index_operate.php' : $operate; ?>
<?php include THEME_PATH . $operate; ?>
</td>
</tr>
<?php endforeach; ?>
</table>
<div class="am-g am-g-collapse">
<div class="am-u-sm-12 am-u-lg-6">
<?php if ($listsort): ?>
<button type="submit" class="am-btn am-btn-primary am-btn-sm am-radius">排序</button>
<?php endif; ?>
</div>
<div class="am-u-sm-12 am-u-lg-6">
<ul class="am-pagination am-pagination-right am-text-sm am-margin-0">
<?= $page; ?>
</ul>
</div>
</div>
</form>
<?php endif; ?>
<?php include THEME_PATH . "/Content/Content_index_footer.php"; ?>
......@@ -54,9 +54,18 @@
<div class="am-dropdown" data-am-dropdown>
<a href="javascript:;" class="am-dropdown-toggle" data-am-dropdown-toggle>文件列表 <span class="am-icon-caret-down"></span></a>
<ul class="am-dropdown-content">
<?php foreach(explode(',', $value[$prefix . $field['field_name']]) as $key => $file): ?>
<li><a href="<?= $file ?>" target="_blank">下载文件<?= $key + 1?></a></li>
<?php endforeach; ?>
<?php
$downloadFile = $this->ubbUrl($value[$prefix . $field['field_name']]);
?>
<?php if($downloadFile == false): ?>
<?php foreach(explode(',', $value[$prefix . $field['field_name']]) as $key => $file): ?>
<li><a href="<?= $file ?>" target="_blank">下载文件<?= $key + 1?></a></li>
<?php endforeach; ?>
<?php else: ?>
<?php foreach($downloadFile as $key => $value): ?>
<li><?= $value ?></li>
<?php endforeach; ?>
<?php endif; ?>
</ul>
</div>
<?php endif; ?>
......
......@@ -264,8 +264,32 @@ html,body{
.pt-info-panel{
background-color: #f8f8f8;
}
.pt-text-border{
border-bottom: 1px dashed #d6d6d6;
padding-bottom: 0.5rem;
margin-bottom: 0.5rem;
}
.pt-text-border:last-child{
border: 0px;
}
.pt-text-explode {
color: #999 !important;
margin-bottom: 0.5rem;
}
.pt-text-border p{
margin: 0 0 0.3rem 0;
}
.pt-text-border ul{
margin: 0 !important;
}
.pt-text-border li{
padding: 0 0.5rem 0 0 !important;
}
.pt-text-border li:hover{
background:none !important;
}
.pt-text-border a:hover{
border-bottom: 1px solid;
}
/*工单内容描述结束*/
......
......@@ -94,7 +94,18 @@ $(function () {
uploader.on('uploadSuccess', function (file, response) {
//上传成功,则在对应文件的li层追加一个隐藏域存放上传成功的图片URL
if (response.state == 'SUCCESS') {
$('#' + file.id).append('<input type="hidden" name="' + obj.name + '" value="' + response.url + '">');
//判断上传类型
switch(response.action){
case 'uploadfile':
var inputValue = '[url='+response.url+']'+response.original+'[/url]';
break;
case 'uploadimage':
default:
var inputValue = response.url;
}
$('#' + file.id).append('<input type="hidden" name="' + obj.name + '" value="' + inputValue + '">');
}
$('#' + file.id + ' h3.am-gallery-title').html(response.state).removeClass('am-hide');
});
......
......@@ -20,6 +20,7 @@
<div class="wrapper">
<div id="tabhead" class="tabhead">
<span class="tab focus" data-content-id="upload"><var id="lang_tab_upload"></var></span>
<span class="tab" data-content-id="online"><var id="lang_tab_online"></var></span>
</div>
<div id="tabbody" class="tabbody">
<!-- 上传图片 -->
......@@ -46,7 +47,10 @@
</div>
</div>
<!-- 在线图片 -->
<div id="online" class="panel">
<div id="fileList"><var id="lang_imgLoading"></var></div>
</div>
</div>
</div>
......
......@@ -566,7 +566,6 @@
/* 在线附件 */
function OnlineFile(target) {
return false;
this.container = utils.isString(target) ? document.getElementById(target) : target;
this.init();
}
......@@ -687,7 +686,7 @@
} else {
var ic = document.createElement('i'),
textSpan = document.createElement('span');
textSpan.innerHTML = list[i].url.substr(list[i].url.lastIndexOf('/') + 1);
textSpan.innerHTML = list[i].name;
preview = document.createElement('div');
preview.appendChild(ic);
preview.appendChild(textSpan);
......@@ -698,8 +697,8 @@
}
domUtils.addClass(icon, 'icon');
item.setAttribute('data-url', urlPrefix + list[i].url);
if (list[i].original) {
item.setAttribute('data-title', list[i].original);
if (list[i].name) {
item.setAttribute('data-title', list[i].name);
}
item.appendChild(preview);
......@@ -737,6 +736,7 @@
},
getInsertList: function () {
var i, lis = this.list.children, list = [];
for (i = 0; i < lis.length; i++) {
if (domUtils.hasClass(lis[i], 'selected')) {
var url = lis[i].getAttribute('data-url');
......
......@@ -21,6 +21,7 @@
<div id="tabhead" class="tabhead">
<span class="tab" data-content-id="remote"><var id="lang_tab_remote"></var></span>
<span class="tab focus" data-content-id="upload"><var id="lang_tab_upload"></var></span>
<span class="tab" data-content-id="online"><var id="lang_tab_online"></var></span>
<span class="tab" data-content-id="search"><var id="lang_tab_search"></var></span>
</div>
<div class="alignBar">
......@@ -90,6 +91,11 @@
</div>
</div>
<!-- 在线图片 -->
<div id="online" class="panel">
<div id="imageList"><var id="lang_imgLoading"></var></div>
</div>
<!-- 搜索图片 -->
<div id="search" class="panel">
<div class="searchBar">
......
......@@ -787,7 +787,6 @@
/* 在线图片 */
function OnlineImage(target) {
return false
this.container = utils.isString(target) ? document.getElementById(target) : target;
this.init();
}
......
......@@ -24700,6 +24700,7 @@ UE.plugin.register('insertfile', function (){
"pdf":"icon_pdf.gif",
"mp3":"icon_mp3.gif",
"xls":"icon_xls.gif",
"xlsx":"icon_xls.gif",
"chm":"icon_chm.gif",
"ppt":"icon_ppt.gif",
"pptx":"icon_ppt.gif",
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment