瀏覽代碼

完善主编功能,以及修改bug

Xiahai 1 年之前
父節點
當前提交
585b9edcf7
共有 37 個文件被更改,包括 975 次插入178 次删除
  1. 50 0
      application/admin/controller/cms/Channel.php
  2. 7 6
      application/admin/controller/cms/Manuscript.php
  3. 16 4
      application/admin/controller/user/RoleLog.php
  4. 81 4
      application/admin/controller/user/User.php
  5. 2 0
      application/admin/lang/zh-cn/cms/channel.php
  6. 2 1
      application/admin/lang/zh-cn/cms/manuscript.php
  7. 1 0
      application/admin/lang/zh-cn/user/role_log.php
  8. 1 0
      application/admin/lang/zh-cn/user/user.php
  9. 1 1
      application/admin/model/User.php
  10. 23 0
      application/admin/view/cms/channel/add_chief.html
  11. 5 5
      application/admin/view/cms/manuscript/edit_chief.html
  12. 7 1
      application/admin/view/user/role_log/user_detail.html
  13. 12 6
      application/api/controller/Ems.php
  14. 97 3
      application/api/controller/User.php
  15. 13 2
      application/extra/site.php
  16. 219 13
      application/index/controller/User.php
  17. 1 1
      application/index/view/common/sidenav.html
  18. 27 0
      application/index/view/user/article_details.html
  19. 17 17
      application/index/view/user/become_an_editor.html
  20. 17 1
      application/index/view/user/display_submitted.html
  21. 16 2
      application/index/view/user/editing_manuscripts.html
  22. 49 0
      application/index/view/user/invite_editor.html
  23. 1 1
      application/index/view/user/login.html
  24. 42 0
      application/index/view/user/review_comments.html
  25. 7 33
      application/index/view/user/reviewer_information.html
  26. 70 0
      application/index/view/user/send_email.html
  27. 6 0
      application/index/view/user/show_reviewed_manuscripts.html
  28. 8 7
      application/index/view/user/special_issue.html
  29. 1 1
      application/index/view/user/special_issue_list.html
  30. 13 16
      application/index/view/user/submit_manuscript.html
  31. 10 2
      public/assets/css/user/display_submitted.css
  32. 二進制
      public/assets/img/index/email.png
  33. 二進制
      public/assets/img/index/invite-editor.png
  34. 二進制
      public/assets/img/index/reply.png
  35. 22 1
      public/assets/js/backend/cms/channel.js
  36. 4 4
      public/assets/js/backend/cms/manuscript.js
  37. 127 46
      public/assets/js/frontend/user.js

+ 50 - 0
application/admin/controller/cms/Channel.php

@@ -6,10 +6,14 @@ use addons\vip\library\Service;
 use app\admin\model\Admin;
 use app\admin\model\AuthGroupAccess;
 use app\admin\model\cms\ChannelAdmin;
+use app\admin\model\User;
 use app\common\controller\Backend;
 use app\admin\model\cms\Channel as ChannelModel;
 use fast\Tree;
+use think\Db;
 use think\Exception;
+use think\exception\PDOException;
+use think\exception\ValidateException;
 
 /**
  * 栏目表
@@ -314,4 +318,50 @@ class Channel extends Backend
             }
         }
     }
+
+    /**
+     * 添加编辑
+     *
+     * @return string|void
+     * @throws Exception
+     */
+    public function add_chief($ids = null)
+    {
+        $row = $this->model->get($ids);
+        // 获取编辑信息
+        $chief_list = User::where(['is_chief' => 'correct'])->column('nickname', 'id');
+
+        // 模板
+        if (false === $this->request->isPost()) {
+            $this->view->assign('row', $row);
+            $this->view->assign('chief_list', $chief_list);
+            return $this->view->fetch();
+        }
+
+        $params = $this->request->post('row/a');
+        if (empty($params)) {
+            $this->error(__('Parameter %s can not be empty', ''));
+        }
+        $params = $this->preExcludeFields($params);
+        $result = false;
+        Db::startTrans();
+        try {
+            //是否采用模型验证
+            if ($this->modelValidate) {
+                $name = str_replace("\\model\\", "\\validate\\", get_class($this->model));
+                $validate = is_bool($this->modelValidate) ? ($this->modelSceneValidate ? $name . '.edit' : $name) : $this->modelValidate;
+                $row->validateFailException()->validate($validate);
+            }
+            $result = $row->allowField(true)->save($params);
+
+            Db::commit();
+        } catch (ValidateException|PDOException|Exception $e) {
+            Db::rollback();
+            $this->error($e->getMessage());
+        }
+        if (false === $result) {
+            $this->error(__('No rows were updated'));
+        }
+        $this->success();
+    }
 }

+ 7 - 6
application/admin/controller/cms/Manuscript.php

@@ -26,7 +26,7 @@ class Manuscript extends Backend
      */
     protected $model = null;
     protected $searchFields = '';
-    protected $noNeedRight = ['add_editor', 'comments', 'comments_detail', 'send_user_list', 'email'];
+    protected $noNeedRight = ['edit_chief', 'comments', 'comments_detail', 'send_user_list', 'email'];
 
     public function _initialize()
     {
@@ -106,16 +106,16 @@ class Manuscript extends Backend
     }
 
     /**
-     * 添加编辑
+     * 修改主编
      *
      * @return string|void
      * @throws Exception
      */
-    public function add_editor($ids = null)
+    public function edit_chief($ids = null)
     {
         $row = $this->model->get($ids);
         // 获取编辑信息
-        $editor_list = User::where(['is_editor' => 'correct'])->column('nickname', 'id');
+        $chief_list = User::where(['is_chief' => 'correct'])->column('nickname', 'id');
 
         // 获取编辑状态
         $status_list = config('site.edit_manuscript_status');
@@ -124,7 +124,7 @@ class Manuscript extends Backend
         if (false === $this->request->isPost()) {
             $this->view->assign('row', $row);
             $this->view->assign('status_list', $status_list);
-            $this->view->assign('editor_list', $editor_list);
+            $this->view->assign('chief_list', $chief_list);
             return $this->view->fetch();
         }
 
@@ -142,7 +142,6 @@ class Manuscript extends Backend
                 $validate = is_bool($this->modelValidate) ? ($this->modelSceneValidate ? $name . '.edit' : $name) : $this->modelValidate;
                 $row->validateFailException()->validate($validate);
             }
-            $params['editor_ids'] = implode(',', $params['editor_ids']);
             $result = $row->allowField(true)->save($params);
 
             // 添加手稿状态日志
@@ -258,6 +257,8 @@ class Manuscript extends Backend
                 Db::startTrans();
                 try {
                     $email_content_param['user_id'] = $this->auth->id;
+                    $receiver_user = User::where(['email' => $params['send_user_email']])->find();
+                    $email_content_param['receiver_id'] = $receiver_user['id'];
                     $email_content_param['email'] = $params['send_user_email'];
                     $email_content_param['content'] = $params['send_content'];
                     $model_result = $email_content_model->allowField(true)->save($email_content_param);

+ 16 - 4
application/admin/controller/user/RoleLog.php

@@ -2,6 +2,7 @@
 
 namespace app\admin\controller\user;
 
+use app\admin\model\cms\Channel;
 use app\common\controller\Backend;
 use app\common\model\UserRoleContent;
 use app\common\model\UserRoleLog;
@@ -19,7 +20,7 @@ class RoleLog extends Backend
      * @var \app\common\model\UserRoleLog
      */
     protected $model = null;
-    protected $role_list = ['author' => '作者', 'review' => '审稿人', 'editor' => '编辑'];
+    protected $role_list = ['author' => '作者', 'review' => '审稿人', 'chief' => '主编', 'editor' => '编辑'];
     protected $adopt_list = ['review' => '审核中', 'fault' => '拒绝', 'correct' => '通过'];
     protected $noNeedRight = ['detail', 'is_adopt'];
 
@@ -78,14 +79,16 @@ class RoleLog extends Backend
         if ($user) {
 
             // 如果是审稿或者编辑则走不同页面
-            if ($type == 'review' || $type == 'editor') {
+            if ($type == 'review' || $type == 'chief' || $type == 'editor') {
                 $user_content = UserRoleContent::where(['log_id' => $ids])->find();
                 if ($user_content) {
+                    $journal_ids = explode(',', $user_content['journal_ids']);
+                    $channel_name_list = Channel::where(['id' => ['in', $journal_ids]])->column('name');
+                    $user_content['journal_ids'] = $channel_name_list;
                     $this->view->assign('type', $type);
                     $this->view->assign('row', $user_content);
-
-                    return $this->view->fetch('user/role_log/user_detail');
                 }
+                return $this->view->fetch('user/role_log/user_detail');
             }
 
             $this->view->assign('row', $user);
@@ -118,8 +121,17 @@ class RoleLog extends Backend
                     if ($user_log->type == 'review') {
                         $user->is_review = $adopt;
                     }
+                    if ($user_log->type == 'chief') {
+                        $user->is_chief = $adopt;
+                        if ($adopt == 'correct') {
+                            $user->is_editor = 'fault';
+                        }
+                    }
                     if ($user_log->type == 'editor') {
                         $user->is_editor = $adopt;
+                        if ($adopt == 'correct') {
+                            $user->is_chief = 'fault';
+                        }
                     }
                     if ($user->save()) {
                         $this->success();

+ 81 - 4
application/admin/controller/user/User.php

@@ -4,6 +4,8 @@ namespace app\admin\controller\user;
 
 use app\common\controller\Backend;
 use app\common\library\Auth;
+use app\common\model\UserRoleContent;
+use app\common\model\UserRoleLog;
 use think\Db;
 use think\exception\PDOException;
 use think\exception\ValidateException;
@@ -31,7 +33,7 @@ class User extends Backend
         $this->model = model('User');
         $this->view->assign("typesList", $this->model->getTypesList());
 
-        $group_list = ['author' => __('Author'), 'review' => __('Review'), 'editor' => __('editor')];
+        $group_list = ['author' => __('Author'), 'review' => __('Review'), 'chief' => __('chief'), 'editor' => __('editor')];
         $this->view->assign('group_list', $group_list);
     }
 
@@ -57,6 +59,9 @@ class User extends Backend
             if ($type == 'review') {
                 $new_where['is_review'] = 'correct';
             }
+            if ($type == 'chief') {
+                $new_where['is_chief'] = 'correct';
+            }
             if ($type == 'editor') {
                 $new_where['is_editor'] = 'correct';
             }
@@ -71,13 +76,16 @@ class User extends Backend
                 $type_arr = [];
                 // 添加对应用户身份
                 if ($v['is_author'] == 'correct') {
-                    $type_arr[] = '作者';
+                    $type_arr[] = __('Author');
                 }
                 if ($v['is_review'] == 'correct') {
-                    $type_arr[] = '审稿人';
+                    $type_arr[] = __('Review');
+                }
+                if ($v['is_chief'] == 'correct') {
+                    $type_arr[] = __('Chief');
                 }
                 if ($v['is_editor'] == 'correct') {
-                    $type_arr[] = '编辑';
+                    $type_arr[] = __('Editor');
                 }
                 $v->type = implode(',',$type_arr);
                 $v->avatar = $v->avatar ? cdnurl($v->avatar, true) : letter_avatar($v->nickname);
@@ -131,6 +139,9 @@ class User extends Backend
             if ($row['is_editor'] == 'correct') {
                 $group[] = 'editor';
             }
+            if ($row['is_chief'] == 'correct') {
+                $group[] = 'chief';
+            }
             $row->group = implode(',', $group);
             $this->view->assign('row', $row);
             return $this->view->fetch();
@@ -155,6 +166,9 @@ class User extends Backend
             if ($row['is_editor'] == 'correct') {
                 $row_group[] = 'editor';
             }
+            if ($row['is_chief'] == 'correct') {
+                $row_group[] = 'chief';
+            }
 
             // 用户选中的角色
             $groups = $params['group'];
@@ -169,6 +183,7 @@ class User extends Backend
                     $group_data['is_author'] = 'fault';
                     $group_data['is_review'] = 'fault';
                     $group_data['is_editor'] = 'fault';
+                    $group_data['is_chief'] = 'fault';
                 }
             }
 
@@ -177,6 +192,7 @@ class User extends Backend
                 $group_data['is_author'] = 'fault';
                 $group_data['is_review'] = 'fault';
                 $group_data['is_editor'] = 'fault';
+                $group_data['is_chief'] = 'fault';
             }
 
             // 修改的角色数组大于0
@@ -196,6 +212,9 @@ class User extends Backend
                                 if ($item == 'editor') {
                                     $group_data['is_editor'] = 'correct';
                                 }
+                                if ($item == 'chief') {
+                                    $group_data['is_chief'] = 'correct';
+                                }
                             }
                         }
                     } else { // 如果是空角色时则直接添加
@@ -209,6 +228,9 @@ class User extends Backend
                             if ($group == 'editor') {
                                 $group_data['is_editor'] = 'correct';
                             }
+                            if ($group == 'chief') {
+                                $group_data['is_chief'] = 'correct';
+                            }
                         }
                     }
                 }
@@ -227,6 +249,9 @@ class User extends Backend
                             if ($item == 'editor') {
                                 $group_data['is_editor'] = 'correct';
                             }
+                            if ($item == 'chief') {
+                                $group_data['is_chief'] = 'correct';
+                            }
                         }
                     }
                     foreach ($row_group as $item) {
@@ -240,6 +265,9 @@ class User extends Backend
                             if ($item == 'editor') {
                                 $group_data['is_editor'] = 'fault';
                             }
+                            if ($item == 'chief') {
+                                $group_data['is_chief'] = 'fault';
+                            }
                         }
                     }
                 }
@@ -256,6 +284,9 @@ class User extends Backend
                         if ($group == 'editor') {
                             $group_data['is_editor'] = 'correct';
                         }
+                        if ($group == 'chief') {
+                            $group_data['is_chief'] = 'correct';
+                        }
                     }
                 }
 
@@ -273,6 +304,9 @@ class User extends Backend
                             if ($item == 'editor') {
                                 $group_data['is_editor'] = 'fault';
                             }
+                            if ($item == 'chief') {
+                                $group_data['is_chief'] = 'fault';
+                            }
                         }
                     }
                 }
@@ -281,6 +315,49 @@ class User extends Backend
             // 对应的角色信息插入到
             foreach ($group_data as $key => $item) {
                 $params[$key] = $item;
+                if ($key == 'is_author') {
+                    $type = 'author';
+                }
+                if ($key == 'is_review') {
+                    $type = 'review';
+                }
+                if ($key == 'is_editor') {
+                    $type = 'editor';
+                }
+                if ($key == 'is_chief') {
+                    $type = 'chief';
+                }
+
+                // 增加user_role_content数据
+                if ($item == 'correct') {
+                    // 如果是增加角色则需要添加user_role_log 和 user_role_content
+                    $user_role_log_model = new UserRoleLog();
+                    $user_role_log_model->user_id = $row->id;
+                    $user_role_log_model->type = $type;
+                    $user_role_log_model->is_adopt = $item;
+                    if ($user_role_log_model->save()) {
+                        $user_role_model = new UserRoleContent();
+                        $user_role_model->user_id = $row->id;
+                        $user_role_model->log_id = $user_role_log_model->id;
+                        $user_role_model->type = $type;
+                        $user_role_model->affiliation = $row->affiliation;
+                        $user_role_model->save();
+                    }
+                } else {
+                    // 如果是删减角色则需要删除user_role_log 和 user_role_content
+                    $user_role_log_model = UserRoleLog::where(['user_id' => $row->id, 'type' => $type])->select();
+                    if (count($user_role_log_model) > 0) {
+                        foreach ($user_role_log_model as $user_log) {
+                            $user_role_model = UserRoleContent::where(['user_id' => $row->id, 'type' => $type, 'log_id' => $user_log->id])->select();
+                            $user_log->delete();
+                            if (count($user_role_model) > 0) {
+                                foreach ($user_role_model as $user_role) {
+                                    $user_role->delete();
+                                }
+                            }
+                        }
+                    }
+                }
             }
 
             $result = $row->allowField(true)->save($params);

+ 2 - 0
application/admin/lang/zh-cn/cms/channel.php

@@ -48,4 +48,6 @@ return [
     'Home Button'                                => '首页按钮',
     'Hover Image'                                => '选中图片',
     'Cycle'                                      => '周期',
+    'Assign editors'                             => '指派主编',
+    'Chief'                                      => '主编',
 ];

+ 2 - 1
application/admin/lang/zh-cn/cms/manuscript.php

@@ -12,7 +12,7 @@ return [
     'Zip code'                      => '邮政编码',
     'City'                          => '城市',
     'Send email'                    => '发送邮件',
-    'Assign editors'                => '指派编辑',
+    'Assign chief'                  => '指派主编',
     'Manuscript comments'           => '手稿意见',
     'Send content'                  => '发送内容',
     'Addressee'                     => '收件人',
@@ -20,4 +20,5 @@ return [
     'Editor'                        => '编辑',
     'Reviewer'                      => '审稿人',
     'No corresponding user found'   => '未找到对应用户',
+    'Chief'                         => '主编',
 ];

+ 1 - 0
application/admin/lang/zh-cn/user/role_log.php

@@ -18,4 +18,5 @@ return [
     'City'              => '城市',
     'Country'           => '国家',
     'Avatar'            => '头像',
+    'Is Adopt'          => '审核状态',
 ];

+ 1 - 0
application/admin/lang/zh-cn/user/user.php

@@ -46,5 +46,6 @@ return [
     'Type'           => '身份',
     'Author'         => '作者',
     'Review'         => '审稿人',
+    'Chief'          => '主编',
     'Editor'         => '编辑',
 ];

+ 1 - 1
application/admin/model/User.php

@@ -25,7 +25,7 @@ class User extends Model
 
     public function getTypesList()
     {
-        return ['author' => __('Author'), 'review' => __('Review'), 'editor' => __('Editor')];
+        return ['author' => __('Author'), 'review' => __('Review'), 'chief' => __('Chief'),'editor' => __('Editor')];
     }
 
     public function getOriginData()

+ 23 - 0
application/admin/view/cms/channel/add_chief.html

@@ -0,0 +1,23 @@
+<form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
+    <input type="hidden" value="{$row.id}" id="c-id"/>
+    <div class="form-group">
+        <label for="c-chief_id" class="control-label col-xs-12 col-sm-2">{:__('Chief')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <!--@formatter:off-->
+            <select  id="c-chief_id" class="form-control selectpicker" name="row[chief_id]">
+                <optoin value="">Select</optoin>
+                {foreach name="chief_list" item="vo"}
+                <option value="{$key}" {in name="key" value="$row.chief_id" }selected{/in}>{$vo}</option>
+                {/foreach}
+            </select>
+            <!--@formatter:on-->
+        </div>
+    </div>
+    <div class="form-group layer-footer">
+        <label class="control-label col-xs-12 col-sm-2"></label>
+        <div class="col-xs-12 col-sm-8">
+            <button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
+            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
+        </div>
+    </div>
+</form>

+ 5 - 5
application/admin/view/cms/manuscript/add_editor.html → application/admin/view/cms/manuscript/edit_chief.html

@@ -1,19 +1,19 @@
 <form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
     <input type="hidden" value="{$row.id}" id="c-manuscript-id"/>
     <div class="form-group">
-        <label for="c-editor_ids" class="control-label col-xs-12 col-sm-2">{:__('Editor')}:</label>
+        <label for="c-chief_id" class="control-label col-xs-12 col-sm-2">{:__('Chief')}:</label>
         <div class="col-xs-12 col-sm-8">
             <!--@formatter:off-->
-            <select  id="c-editor_ids" class="form-control selectpicker" multiple="" name="row[editor_ids][]">
-                {foreach name="editor_list" item="vo"}
-                <option value="{$key}" {in name="key" value="$row.editor_ids" }selected{/in}>{$vo}</option>
+            <select  id="c-chief_id" class="form-control selectpicker" multiple="" name="row[chief_id]">
+                {foreach name="chief_list" item="vo"}
+                <option value="{$key}" {in name="key" value="$row.chief_id" }selected{/in}>{$vo}</option>
                 {/foreach}
             </select>
             <!--@formatter:on-->
         </div>
     </div>
     <div class="form-group">
-        <label for="c-editor_ids" class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
+        <label for="c-status" class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
         <div class="col-xs-12 col-sm-8">
             <!--@formatter:off-->
             <select  id="c-status" class="form-control" name="row[status]">

+ 7 - 1
application/admin/view/user/role_log/user_detail.html

@@ -64,7 +64,13 @@
     <div class="form-group">
         <label for="c-journal" class="control-label col-xs-12 col-sm-2">{:__('Journal')}:</label>
         <div class="col-xs-12 col-sm-4">
-            <input id="c-journal" class="form-control" type="text" value="{$row.journal_id|htmlentities}" readonly>
+            <div class="bootstrap-tagsinput">
+                {foreach name="$row.journal_ids" item="vo"}
+                <span class="tag label label-info">
+                    {$vo}
+                </span><br />
+                {/foreach}
+            </div>
         </div>
     </div>
 </form>

+ 12 - 6
application/api/controller/Ems.php

@@ -35,26 +35,32 @@ class Ems extends Api
 
         $last = Emslib::get($email, $event);
         if ($last && time() - $last['createtime'] < 60) {
-            $this->error(__('发送频繁'));
+//            $this->error(__('发送频繁'));
+            $this->error('Frequent sending');
         }
         if ($event) {
             $userinfo = User::getByEmail($email);
             if ($event == 'register' && $userinfo) {
                 //已被注册
-                $this->error(__('已被注册'));
+//                $this->error(__('已被注册'));
+                $this->error('Registered');
             } elseif (in_array($event, ['changeemail']) && $userinfo) {
                 //被占用
-                $this->error(__('已被占用'));
+//                $this->error(__('已被占用'));
+                $this->error('Already occupied');
             } elseif (in_array($event, ['changepwd', 'resetpwd']) && !$userinfo) {
                 //未注册
-                $this->error(__('未注册'));
+//                $this->error(__('未注册'));
+                $this->error('unregistered');
             }
         }
         $ret = Emslib::send($email, null, $event);
         if ($ret) {
-            $this->success(__('发送成功'));
+//            $this->success(__('发送成功'));
+            $this->success('Successfully sent');
         } else {
-            $this->error(__('发送失败'));
+//            $this->error(__('发送失败'));
+            $this->error('Fail in send');
         }
     }
 

+ 97 - 3
application/api/controller/User.php

@@ -4,6 +4,7 @@ namespace app\api\controller;
 
 use app\admin\model\cms\AuthorManuscript;
 use app\admin\model\cms\AuthorService;
+use app\admin\model\cms\Channel;
 use app\admin\model\cms\Comments;
 use app\admin\model\cms\Conference;
 use app\admin\model\cms\Email;
@@ -427,7 +428,7 @@ class User extends Api
         $homepage = $this->request->param('homepage');
         $review_journal = $this->request->param('review_journal');
         $interested_journal = $this->request->param('interested_journal');
-        $journal_ids = implode(',', $param['journal_ids']);
+        $journal_ids = $param['journal_ids'];
         $type = $this->request->param('type');
 
         // 查询是否有对应的申请角色数据信息
@@ -513,6 +514,14 @@ class User extends Api
                     $params['status'] = 'processing';
                 }
 
+                // 通过选择的期刊来绑定对应的主编
+                if (!empty($params['journal'])) {
+                    $channel = Channel::get($params['journal']);
+                    if ($channel) {
+                        $params['chief_id'] = $channel['chief_id'];
+                    }
+                }
+
                 // 手稿状态日志
                 $log = ManuscriptLog::where(['manuscript_id' => $params['id'], 'user_id' => $this->auth->id, 'type' => 'user', 'status' => $params['status']])->find();
                 if (!$log) {
@@ -558,13 +567,25 @@ class User extends Api
                 $manuscript->save();
             }
 
-            $result = $model->allowField(true)->save($params);
+            if ($params['type'] != 'author') {
+                $result = $model->allowField(true)->save($params);
+            } else {
+                // 如果是作者则先查询是否有审稿意见回复,如果有则进行更新操作
+                $result = Comments::where(['manuscript_id' => $params['manuscript_id'], 'user_id' => $this->auth->id, 'type' => 'author'])->find();
+                if ($result) {
+                    $result->comments = $params['comments'];
+                    $result->save();
+                } else {
+                    $result = $model->allowField(true)->save($params);
+                }
+            }
+
 
             // 手稿状态日志
             $log = ManuscriptLog::where(['manuscript_id' => $params['manuscript_id'], 'user_id' => $this->auth->id, 'type' => 'user', 'status' => $params['status']])->find();
             if (!$log) {
                 $log = new ManuscriptLog();
-                $log->manuscript_id = $params['id'];
+                $log->manuscript_id = $params['manuscript_id'];
                 $log->user_id = $this->auth->id;
                 $log->type = 'user';
             }
@@ -622,6 +643,7 @@ class User extends Api
     {
         $params = $this->request->post('row/a');
         $reviewers = $params['reviewer'];
+        if (!$reviewers) $this->error('Please select reviewer');
         $result = false;
         Db::startTrans();
         try {
@@ -898,4 +920,76 @@ class User extends Api
         }
         $this->success('Success', $manuscript->id ?? $params['id']);
     }
+
+    /**
+     * 发送邮件
+     *
+     * @return void
+     * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\ModelNotFoundException
+     * @throws \think\exception\DbException
+     */
+    public function send_email()
+    {
+        $params = $this->request->post('row/a');
+
+        $option = [
+            'mail_smtp_host' => $this->auth->mail_smtp_host,
+            'mail_smtp_port' => $this->auth->mail_smtp_port,
+            'mail_smtp_user' => $this->auth->mail_smtp_user,
+            'mail_smtp_pass' => $this->auth->mail_smtp_pass,
+            'mail_from' => $this->auth->mail_smtp_user,
+        ];
+
+        $email = new \app\common\library\Email($option);
+        $result = $email
+            ->to($params['send_user_email'])
+            ->subject($params['title'])
+            ->message('<div style="min-height:550px; padding: 100px 55px 200px;">' . $params['content'] . '</div>')
+            ->send();
+
+        Db::startTrans();
+        try {
+            $receiver_user = \app\admin\model\User::where(['email' => $params['send_user_email']])->find();
+            $params['type'] = 'user';
+            $params['user_id'] = $this->auth->id;
+            $params['receiver_id'] = $receiver_user['id'];
+            $params['email'] = $params['send_user_email'];
+
+            $email_model = new EmailContent();
+            $result = $email_model->allowField(true)->save($params);
+            Db::commit();
+        } catch (ValidateException|PDOException|Exception $e) {
+            Db::rollback();
+            $this->error($e->getMessage());
+        }
+        if (false === $result) {
+            $this->error(__('No rows were updated'));
+        }
+        $this->success('Successfully sent');
+    }
+
+    /**
+     * 邀请编辑
+     *
+     * @return void
+     * @throws \think\exception\DbException
+     */
+    public function invite_editor()
+    {
+        $params = $this->request->post('row/a');
+        $row = AuthorManuscript::get($params['manuscript_id']);
+        Db::startTrans();
+        try {
+            if ($row) {
+                $row['editor_ids'] = $params['editor_ids'];
+                $row->save();
+            }
+            Db::commit();
+        } catch (ValidateException|PDOException|Exception $e) {
+            Db::rollback();
+            $this->error($e->getMessage());
+        }
+        $this->success('Successfully');
+    }
 }

+ 13 - 2
application/extra/site.php

@@ -101,7 +101,6 @@ return array (
   array (
     'incomplete_submission' => 'Incomplete submission',
     'processing' => 'processing',
-    'reject_recall_archive' => 'reject_recall_archive',
     'comment_submission' => 'comment_submission',
     'final_review' => 'final_review',
     'final_verification' => 'final_verification',
@@ -117,7 +116,9 @@ return array (
     'all' => 'All',
     'incomplete_submission' => 'Incomplete submission',
     'processing' => 'Processing',
-    'reject_recall_archive' => 'Reject/ Recall/ Archive',
+    'rejected' => 'Rejected',
+    'accept' => 'Accept',
+    'refuse' => 'Refuse',
   ),
   'reviewer_manuscript_status' => 
   array (
@@ -168,6 +169,7 @@ return array (
     'reviewer_details' => 'Reviewer Details',
     'reviewer_suggestion' => 'Reviewer\'s suggestion',
     'review_report' => 'Review report',
+    'author_report' => 'Author report',
   ),
   'error_manuscript_status' => 
   array (
@@ -193,4 +195,13 @@ return array (
   array (
     '/p/Chooseediting.html' => 'Which editing option should I choose?',
   ),
+  'author_edit_status' => 
+  array (
+    'incomplete_submission' => 'Incomplete submission',
+    'processing' => 'processing',
+  ),
+  'author_comments_status' => 
+  array (
+    'accept' => 'accept',
+  ),
 );

+ 219 - 13
application/index/controller/User.php

@@ -6,6 +6,7 @@ use addons\wechat\model\WechatCaptcha;
 use app\admin\model\Admin;
 use app\admin\model\cms\AuthorManuscript;
 use app\admin\model\cms\Channel;
+use app\admin\model\cms\Comment;
 use app\admin\model\cms\Comments;
 use app\admin\model\cms\InviteReviewer;
 use app\admin\model\cms\Issue;
@@ -17,6 +18,7 @@ use app\common\library\Sms;
 use app\common\model\Attachment;
 use app\common\model\UserRoleContent;
 use app\common\model\UserRoleLog;
+use app\manytenant\model\Manytenant;
 use think\Config;
 use think\Cookie;
 use think\Db;
@@ -470,22 +472,47 @@ class User extends Frontend
         // 查询当前用户手稿
         $manuscripts = AuthorManuscript::where(['user_id' => $this->auth->id])
             ->where($where)
-            ->field('id,title,image,createtime,journal')
+            ->field('id,title,image,createtime,journal,status')
             ->order('createtime', 'DESC')
             ->paginate($limit);
+        $author_edit_status = config('site.author_edit_status');
+        $author_comments_status = config('site.author_comments_status');
 
         foreach ($manuscripts as $manuscript) {
             $manuscript['journal'] = Channel::where(['id' => $manuscript['journal']])->value('name');
+            $manuscript['is_edit'] = false;
+            $manuscript['is_comments'] = false;
+            if (in_array($manuscript['status'], $author_edit_status)) {
+                $manuscript['is_edit'] = true;
+            }
+            if (in_array($manuscript['status'], $author_comments_status)) {
+                $manuscript['is_comments'] = true;
+            }
         }
         if ($this->request->isAjax()) {
             $keyword = $this->request->param('keyword');
-            $manuscripts = AuthorManuscript::where(['user_id' => $this->auth->id, 'title' => ['like', '%'. $keyword .'%'], 'status' => $status])
-                ->field('id,title,image,createtime,journal')
+            $manuscripts = AuthorManuscript::where(['user_id' => $this->auth->id])
+                ->where(function ($query) use ($keyword, $status) {
+                    if ($status != 'all') {
+                        return $query->where(['status' => $status]);
+                    }
+                    if ($keyword != '') {
+                        return $query->where(['title' => ['like', '%'. $keyword .'%']]);
+                    }
+                })->field('id,title,image,createtime,journal,status')
                 ->order('createtime', 'DESC')
                 ->paginate($limit);
             foreach ($manuscripts as $manuscript) {
                 $manuscript['createtime'] = date('Y-m-d', $manuscript['createtime']);
-                $manuscript['journal'] = Channel::where(['id' => $manuscript['journal']])->value('name');
+                $manuscript['journal'] = Channel::where(['id' => $manuscript['journal']])->value('name') ?? '';
+                $manuscript['is_edit'] = false;
+                $manuscript['is_comments'] = false;
+                if (in_array($manuscript['status'], $author_edit_status)) {
+                    $manuscript['is_edit'] = true;
+                }
+                if (in_array($manuscript['status'], $author_comments_status)) {
+                    $manuscript['is_comments'] = true;
+                }
             }
             $this->success('', '', $manuscripts);
         }
@@ -631,7 +658,20 @@ class User extends Frontend
                 }
             }
 
+            if ($status == 'author_report') {
+                // 查询作者提交意见信息回复
+                $author_comment = Comments::where(['user_id' => $row['user_id'], 'manuscript_id' => $row['id'], 'type' => 'author'])
+                    ->order('createtime', 'DESC')
+                    ->find();
+                if ($author_comment) {
+                    $author_user = \app\admin\model\User::where(['id' => $row['user_id']])->find();
+                    $author['nickname'] = $author_user['nickname'] ?? '';
+                    $author['comment'] = $author_comment['comments'] ?? '';
+                    $author['createtime'] = date('Y-m-d', $author_comment['createtime']);
+                }
+            }
             $row['reviewer'] = $reviewers;
+            $row['author'] = $author ?? [];
         }
         $row['comments'] = $comments ?? [];
         $this->view->assign('status', $status);
@@ -686,8 +726,8 @@ class User extends Frontend
      */
     public function become_an_editor()
     {
-        $user_role = UserRoleLog::where(['user_id' => $this->auth->id, 'type' => 'editor', 'is_adopt' => ['in', ['review', 'fault']]])->order('createtime', 'DESC')->find();
         $user_content = UserRoleContent::where(['user_id' => $this->auth->id, 'type' => 'editor'])->find();
+        $user = \app\common\model\User::get($this->auth->id);
         if (empty($user_content)) {
             $user_content['degree'] = '';
             $user_content['affiliation'] = '';
@@ -698,9 +738,14 @@ class User extends Frontend
             $user_content['interested_journal'] = '';
             $user_content['resume'] = '';
             $user_content['journal_ids'] = '';
+            $user_content['is_chief'] = '';
+            $user_content['is_editor'] = '';
+        } else {
+            $user_content['is_chief'] = $user['is_chief'];
+            $user_content['is_editor'] = $user['is_editor'];
         }
         $this->view->assign('row', $user_content);
-        $this->view->assign('user_role', $user_role);
+        $this->view->assign('user', $user);
         $this->view->assign('title', 'Apply to become an editor');
         return $this->view->fetch();
     }
@@ -728,9 +773,14 @@ class User extends Frontend
         }
         if ($this->request->isAjax()) {
             $keyword = $this->request->param('keyword');
-            $manuscripts = AuthorManuscript::where(['title' => ['like', '%'. $keyword .'%']])->whereRaw("FIND_IN_SET(". $this->auth->id .", `editor_ids`)")->field('id,title,image,createtime')->order('createtime', 'DESC')->paginate($limit);
+            $manuscripts = AuthorManuscript::where(['title' => ['like', '%'. $keyword .'%']])->whereRaw("FIND_IN_SET(". $this->auth->id .", `editor_ids`)")->field('id,title,image,createtime,journal')->order('createtime', 'DESC')->paginate($limit);
             foreach ($manuscripts as $manuscript) {
+                $manuscript['is_chief'] = false;
                 $manuscript['createtime'] = date('Y-m-d', $manuscript['createtime']);
+                $manuscript['journal'] = Channel::where(['id' => $manuscript['journal']])->value('name') ?? '';
+                if ($this->auth->is_chief == 'correct') {
+                    $manuscript['is_chief'] = true;
+                }
             }
             $this->success('', '', $manuscripts);
         }
@@ -769,11 +819,12 @@ class User extends Frontend
         $id = $this->request->param('id');
         // 构建分页参数
         $limit = $this->request->param('limit', 10);
+        $manuscript = AuthorManuscript::get($id);
 
         // 获取审稿人信息
-        $review_id_arr = \app\common\model\User::where(['is_review' => 'correct'])->column('id');
-//        $list = UserRoleContent::with(['user'])->where(['user_id' => ['in', $review_id_arr], 'type' => 'review'])->paginate($limit);
+        $review_id_arr = \app\common\model\User::where(['is_review' => 'correct', 'id' => ['not in', $manuscript->user_id]])->column('id');
         $list = UserRoleContent::with(['user'])->where(['user_id' => ['in', $review_id_arr], 'type' => 'review'])->select();
+//        $list = UserRoleContent::with(['user'])->where(['user_id' => ['in', $review_id_arr], 'type' => 'review'])->paginate($limit);
         foreach ($list as $value) {
             $channel_name_arr = Channel::where(['id' => ['in', explode(',', $value['journal_ids'])]])->column('name');
             $value['journal'] = implode(',', $channel_name_arr);
@@ -841,12 +892,12 @@ class User extends Frontend
      */
     public function special_issue_list()
     {
-        $status = $this->request->param('status', 'All');
+        $status = $this->request->param('status', 'all');
         $where = ['user_id' => $this->auth->id];
-        if ($status != 'All') {
+        if ($status != 'all') {
             $where = ['status' => $status, 'user_id' => $this->auth->id];
         }
-        if ($status == '') {
+        if ($status == 'all') {
             unset($where['status']);
         }
 
@@ -854,7 +905,7 @@ class User extends Frontend
 
         if ($this->request->isAjax()) {
             $keyword = $this->request->param('keyword');
-            if ($status == 'All') {
+            if ($status == 'all') {
                 $status = '';
             }
             $special_issues = Issue::where(['user_id' => $this->auth->id, 'issue_name' => ['like', '%'. $keyword .'%']])
@@ -885,4 +936,159 @@ class User extends Frontend
 
         return $this->view->fetch();
     }
+
+    /**
+     * 作者审稿意见
+     *
+     * @return string
+     * @throws \think\Exception
+     * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\ModelNotFoundException
+     * @throws \think\exception\DbException
+     */
+    public function review_comments()
+    {
+        $param = $this->request->param();
+        $type = $param['type'];
+        $row = Comments::where(['manuscript_id' => $param['id']])->find();
+        $manuscript = AuthorManuscript::get($param['id']);
+        if (empty($row)) {
+            $row['manuscript_id'] = $param['id'];
+            $row['comments'] = '';
+            $row['status'] = $manuscript['status'];
+        }
+        $this->view->assign('row', $row);
+        $this->view->assign('type', $type);
+        return $this->view->fetch();
+    }
+
+    /**
+     * 发送邮件列表
+     *
+     * @return string
+     * @throws \think\Exception
+     * @throws \think\exception\DbException
+     */
+    public function send_email()
+    {
+        $param = $this->request->param();
+        $type = $param['type'];
+        $row = AuthorManuscript::get($param['id']);
+
+        // 身份是不同的则需要查询不同人的列表
+        if ($type == 'author') {
+            /** 审稿人 编辑 */
+            $review_ids = explode(',', $row['reviewer_ids']);
+            $editor_ids = explode(',', $row['editor_ids']);
+            $user_arr = array_merge($review_ids, $editor_ids);
+            $user_arr = array_unique($user_arr);
+        }
+        if ($type == 'reviewer') {
+            /** 作者 编辑 */
+            $editor_ids = explode(',', $row['editor_ids']);
+            $author_ids = [$row['user_id']];
+            $user_arr = array_merge($editor_ids, $author_ids);
+            $user_arr = array_unique($user_arr);
+        }
+        if ($type == 'editor') {
+            /** 作者 审稿人 */
+            $author_ids = [$row['user_id']];
+            $review_ids = explode(',', $row['reviewer_ids']);
+            $user_arr = array_merge($review_ids, $author_ids);
+            $user_arr = array_unique($user_arr);
+        }
+
+        $user_list = \app\admin\model\User::where(['id' => ['in', $user_arr]])->column('email', 'id');
+        $this->view->assign('type', $type);
+        $this->view->assign('user_list', $user_list);
+        $this->view->assign('row', $row);
+        $this->view->assign('mail_smtp_host', $this->auth->mail_smtp_host);
+        $this->view->assign('mail_smtp_port', $this->auth->mail_smtp_port);
+        $this->view->assign('mail_smtp_user', $this->auth->mail_smtp_user);
+        $this->view->assign('mail_smtp_pass', $this->auth->mail_smtp_pass);
+        $this->view->assign('title', 'Send Email');
+        return $this->view->fetch();
+    }
+
+    /**
+     * 邀请编辑页
+     *
+     * @return string
+     * @throws \think\Exception
+     * @throws \think\exception\DbException
+     */
+    public function invite_editor()
+    {
+        $param = $this->request->param();
+        $type = $param['type'];
+        $row = AuthorManuscript::get($param['id']);
+        $this->view->assign('row', $row);
+        $this->view->assign('type', $type);
+        $this->view->assign('title', 'Invite Editor');
+        return $this->view->fetch();
+    }
+
+    /**
+     * 选择编辑
+     *
+     * @return \think\response\Json
+     * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\ModelNotFoundException
+     * @throws \think\exception\DbException
+     */
+    public function choose_editor()
+    {
+        $info = \app\common\model\User::where(['is_editor' => 'correct', 'id' => ['not in', $this->auth->id]])->field('nickname, id')->select();
+        $params = $this->request->request();
+        if (array_key_exists('name', $params) && $params['name']) {
+            $info = \app\common\model\User::where(['is_editor' => 'correct', 'nickname' => ['like', '%' . $params['name'] . '%'], 'id' => ['not in', $this->auth->id]])->field('nickname, id')->select();
+        }
+
+        if ($this->request->request("keyValue")) {
+            $id_arr = $this->request->request('keyValue');
+            $info = \app\common\model\User::where(['id' => ['in', $id_arr]])->field('nickname, id')->select();
+        }
+
+        $arr = [];
+        foreach ($info as $item) {
+            $v['id'] = $item['id'];
+            $v['name'] = $item['nickname'];
+            $arr[] = $v;
+        }
+        $data['list'] = $arr;
+        $data['total'] = count($arr);
+        return json($data);
+    }
+
+    /**
+     * 选择期刊
+     *
+     * @return \think\response\Json
+     * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\ModelNotFoundException
+     * @throws \think\exception\DbException
+     */
+    public function choose_journal()
+    {
+        $info = Channel::where(['parent_id' => 1])->field('name, id')->select();
+        $params = $this->request->request();
+        if (array_key_exists('name', $params) && $params['name']) {
+            $info = Channel::where(['parent_id' => 1, 'name' => ['like', '%' . $params['name'] . '%']])->field('name, id')->select();
+        }
+
+        if ($this->request->request("keyValue")) {
+            $id_arr = $this->request->request('keyValue');
+            $info = Channel::where(['id' => ['in', $id_arr]])->field('name, id')->select();
+        }
+
+        $arr = [];
+        foreach ($info as $item) {
+            $v['id'] = $item['id'];
+            $v['name'] = $item['name'];
+            $arr[] = $v;
+        }
+        $data['list'] = $arr;
+        $data['total'] = count($arr);
+        return json($data);
+    }
 }

+ 1 - 1
application/index/view/common/sidenav.html

@@ -101,7 +101,7 @@
                 <img src="__CDN__/assets/img/index/arrow_right_icon.png" alt="">
             </a>
         </li>
-        {if condition="$user.is_editor == 'correct'"}
+        {if condition="$user.is_editor == 'correct' || $user.is_chief == 'correct'"}
         <li class="list-group-item {:check_nav_active('user/special_issue')}">
             <a href="{:url('user/special_issue')}">
                 Apply to creat a special issue

+ 27 - 0
application/index/view/user/article_details.html

@@ -313,6 +313,33 @@
                                 </div>
                             </div>
                             {/if}
+
+                            {if condition="$status == 'author_report'"}
+                            <div class="form-group">
+                                <div class="col-xs-12 col-sm-12 article-details-content">
+                                    <div class="table-responsive">
+                                        <table class="table inbox-table">
+                                            <thead style="background: #FAFAFA;" class="thead">
+                                            <tr>
+                                                <th style="width: 100px">Name</th>
+                                                <th style="width: 100px">Recommendation</th>
+                                                <th style="width: 150px">Submission time</th>
+                                            </tr>
+                                            </thead>
+                                            <tbody class="tbody">
+                                            {if condition="$row.author"}
+                                            <tr>
+                                                <td>{$row.author.nickname}</td>
+                                                <td>{$row.author.comment}</td>
+                                                <td>{$row.author.createtime}</td>
+                                            </tr>
+                                            {/if}
+                                            </tbody>
+                                        </table>
+                                    </div>
+                                </div>
+                            </div>
+                            {/if}
                         </div>
 
                         {/if}

+ 17 - 17
application/index/view/user/become_an_editor.html

@@ -15,19 +15,10 @@
                     <div class="header-content">
                         <h2 class="page-header">Edit personal information</h2>
                     </div>
-                    {if condition="$user_role"}
-                        {if condition="$user_role.is_adopt == 'fault'"}
-                            <p class="text-danger">Status:Fault</p>
-                        {/if}
-                        {if condition="$user_role.is_adopt == 'review'"}
-                            <p class="text-warning">Status:Review</p>
-                        {/if}
-                    {/if}
-                    {if condition="!$user_role || $user_role.is_adopt == 'fault' || $user_role.is_adopt == 'correct'"}
-                    <form id="become-an-editor-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="{:url('api/user/apply_role?type=editor')}">
+                    {if condition="$user.is_chief == 'correct' || $user.is_editor == 'correct'"}
+                    <form id="become-an-editor-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="{:url('api/user/apply_role')}">
                         {:token()}
 
-                        <input type="hidden" name="type" value="editor" />
                         <div class="form-item">
 
                             <div class="form-group">
@@ -102,16 +93,25 @@
                             </div>
 
                             <div class="form-group">
+                                <label class="control-label col-xs-12 col-sm-4">Identity:</label>
+                                <div class="col-xs-12 col-sm-8">
+                                    <label><input type="radio" name="type" value="chief" {if condition="$user.is_chief == 'correct'" }checked{/if} /> Chief Compiler</label>
+                                    <label><input type="radio" name="type" value="editor" {if condition="$user.is_editor == 'correct'" }checked{/if} /> Editor</label>
+                                </div>
+                            </div>
+
+                            <div class="form-group">
                                 <label class="control-label col-xs-12 col-sm-4">
                                     Select a journal:
                                 </label>
                                 <div class="col-xs-12 col-sm-8">
-                                    <select id="c-journal_id" class="form-control selectpicker" multiple="" name="journal_ids[]">
-                                        <option value="">Please select</option>
-                                        {cms:channellist id="channel" type="son" typeid="1"}
-                                        <option value="{$channel.id}" {in name="$channel.id" value="$row.journal_ids" }selected{/in}>{$channel.name}</option>
-                                        {/cms:channellist}
-                                    </select>
+<!--                                    <select id="c-journal_id" class="form-control selectpicker" multiple="" name="journal_ids[]">-->
+<!--                                        <option value="">Please select</option>-->
+<!--                                        {cms:channellist id="channel" type="son" typeid="1"}-->
+<!--                                        <option value="{$channel.id}" {in name="$channel.id" value="$row.journal_ids" }selected{/in}>{$channel.name}</option>-->
+<!--                                        {/cms:channellist}-->
+<!--                                    </select>-->
+                                    <input id="c-journal_id" data-rule="required" data-source="user/choose_journal" data-primary-key="id" data-search-field="name" data-multiple="true" class="form-control selectpage" name="journal_ids" type="text" value="{$row.journal_ids}">
                                 </div>
                             </div>
 

+ 17 - 1
application/index/view/user/display_submitted.html

@@ -66,7 +66,7 @@
                                     <article class="article-item">
                                         <div class="media">
                                             <div class="media-left">
-                                                <a href="/wearable/109.html">
+                                                <a href="#">
                                                     <div class="embed-responsive embed-responsive-4by3 img-zoom p-0">
                                                         <img src="{$vo.image}">
                                                     </div>
@@ -86,12 +86,28 @@
                                                     <div itemprop="date">Submission date:{$vo.createtime}</div>
                                                 </div>
                                                 <div class="article-tag">
+                                                    {if condition="$vo.is_edit"}
                                                     <div class="article-read">
                                                         <a href="submit_manuscript?id={$vo.id}" style="color: #007bff;" target="_blank">
                                                             <img src="__CDN__/assets/img/index/personal_data_icon.png" alt="">
                                                             Edit
                                                         </a>
                                                     </div>
+                                                    {/if}
+                                                    {if condition="$vo.is_comments"}
+                                                    <div class="article-read">
+                                                        <a href="review_comments.html?id={$vo.id}&type=author" style="color: #007bff;" target="_blank">
+                                                            <img src="__CDN__/assets/img/index/reply.png" alt="">
+                                                            Reply to review comments
+                                                        </a>
+                                                    </div>
+                                                    {/if}
+                                                    <div class="article-read">
+                                                        <a href="send_email.html?id={$vo.id}&type=author" style="color: #007bff;" target="_blank">
+                                                            <img src="__CDN__/assets/img/index/email.png" alt="">
+                                                            Send Email
+                                                        </a>
+                                                    </div>
                                                 </div>
                                             </div>
                                         </div>

+ 16 - 2
application/index/view/user/editing_manuscripts.html

@@ -36,7 +36,7 @@
                         </ol>
                     </nav>
 
-                    {if condition="$user.is_editor == 'correct'"}
+                    {if condition="$user.is_editor == 'correct' || $user.is_chief == 'correct'"}
 
                     <div class="row">
                         <div class="col-md-12 col-sm-12">
@@ -69,7 +69,7 @@
                                                     <div class="article-read">
                                                         <a href="handing_suggestions.html?id={$vo.id}&type=editor" style="color: #007bff;" target="_blank">
                                                             <img src="__CDN__/assets/img/index/suggestions_button.png" alt="">
-                                                            Submit handing suggestions
+                                                            Handing suggestions
                                                         </a>
                                                     </div>
                                                     <div class="article-read">
@@ -84,6 +84,20 @@
                                                             Invite Reviewers
                                                         </a>
                                                     </div>
+                                                    {if condition="$user.is_chief == 'correct'"}
+                                                    <div class="article-read">
+                                                        <a href="invite_editor.html?id={$vo.id}&type=chief" style="color: #007bff;" target="_blank">
+                                                            <img src="__CDN__/assets/img/index/invite-editor.png" alt="">
+                                                            Invite Editor
+                                                        </a>
+                                                    </div>
+                                                    {/if}
+                                                    <div class="article-read">
+                                                        <a href="send_email.html?id={$vo.id}&type=editor" style="color: #007bff;" target="_blank">
+                                                            <img src="__CDN__/assets/img/index/email.png" alt="">
+                                                            Send Email
+                                                        </a>
+                                                    </div>
                                                 </div>
                                             </div>
                                         </div>

+ 49 - 0
application/index/view/user/invite_editor.html

@@ -0,0 +1,49 @@
+<div class="common-bg">
+    <div class="common-font">
+        Invite Editor
+    </div>
+</div>
+
+<div id="content-container" class="container">
+    <div class="row">
+        <div class="col-md-3">
+            {include file="common/sidenav" /}
+        </div>
+        <div class="col-md-9">
+            <div class="panel panel-default">
+                <div class="panel-body">
+                    <div class="header-content">
+                        <h2 class="page-header">Invite Editor</h2>
+                    </div>
+                    {if condition="$user.is_chief == 'correct'"}
+                    <form id="invite-editor-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="{:url('api/user/invite_editor')}">
+                        {:token()}
+
+                        <input type="hidden" name="row[manuscript_id]" value="{$row.id|htmlentities}" />
+
+                        <div class="form-item">
+                            <div class="form-group">
+                                <label class="control-label col-xs-12 col-sm-4">
+                                    Editor:
+                                </label>
+                                <div class="col-xs-12 col-sm-8">
+                                    <input id="c-editor" data-rule="required" data-source="user/choose_editor" data-primary-key="id" data-search-field="name" data-multiple="true" class="form-control selectpage" name="row[editor_ids]" type="text" value="{$row.editor_ids}">
+                                </div>
+                            </div>
+                        </div>
+
+                        <div class="form-group normal-footer">
+                            <label class="control-label col-xs-12 col-sm-4"></label>
+                            <div class="col-xs-12 col-sm-8">
+                                <button type="submit" class="btn btn-primary btn-embossed disabled">Submit</button>
+                                <button type="reset" class="btn btn-default btn-embossed">Reset</button>
+                            </div>
+                        </div>
+                    </form>
+                    {else}
+                    {/if}
+                </div>
+            </div>
+        </div>
+    </div>
+</div>

+ 1 - 1
application/index/view/user/login.html

@@ -84,7 +84,7 @@
                     <div class="input-group">
                         <input type="text" name="captcha" class="form-control" data-rule="required;length({$Think.config.captcha.length});digits;remote({:url('api/validate/check_ems_correct')}, event=resetpwd, email:#email)"/>
                         <span class="input-group-btn" style="padding:0;border:none;">
-                            <a href="javascript:;" class="btn btn-primary btn-captcha" data-url="{:url('api/ems/send')}" data-type="email" data-event="resetpwd">{:__('Send verification code')}</a>
+                            <a href="javascript:;" class="btn btn-primary btn-captcha" data-url="{:url('api/ems/send')}" data-type="email" data-event="resetpwd">Send verification code</a>
                         </span>
                     </div>
                     <span class="msg-box"></span>

+ 42 - 0
application/index/view/user/review_comments.html

@@ -0,0 +1,42 @@
+<link href="__CDN__/assets/css/user/reviewer_information.css?v={$Think.config.site.version|htmlentities}" rel="stylesheet">
+<div class="common-bg">
+    <div class="common-font">
+        Review comments
+    </div>
+</div>
+<div id="content-container" class="container">
+    <div class="row">
+        <div class="col-md-3">
+            {include file="common/sidenav" /}
+        </div>
+        <div class="col-md-9">
+            <div class="panel panel-default">
+                <div class="panel-body">
+                    <h2 class="page-header">Review comments</h2>
+                    <form id="review-comments-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="{:url('api/user/submit_comments')}">
+                        {:token()}
+
+                        <input type="hidden" name="row[manuscript_id]" value="{$row.manuscript_id|htmlentities}" />
+                        <input type="hidden" name="row[status]" value="{$row.status}" />
+                        <input type="hidden" name="row[type]" value="{$type}">
+
+                        <div class="form-group">
+                            <label class="control-label col-xs-12 col-sm-4">Comments:</label>
+                            <div class="col-xs-12 col-sm-8">
+                                <textarea id="c-comments" class="form-control editor" name="row[comments]" rows="15" placeholder="">{$row.comments|htmlentities}</textarea>
+                            </div>
+                        </div>
+
+                        <div class="form-group normal-footer">
+                            <label class="control-label col-xs-12 col-sm-3"></label>
+                            <div class="col-xs-12 col-sm-8">
+                                <button type="submit" class="btn btn-primary btn-embossed disabled">Submit</button>
+                                <button type="reset" class="btn btn-default btn-embossed">Reset</button>
+                            </div>
+                        </div>
+                    </form>
+                </div>
+            </div>
+        </div>
+    </div>
+</div>

+ 7 - 33
application/index/view/user/reviewer_information.html

@@ -104,12 +104,13 @@
                                 Select a journal:
                             </label>
                             <div class="col-xs-12 col-sm-8">
-                                <select id="c-journal_id" class="form-control selectpicker" multiple="" name="journal_ids[]">
-                                    <option value="">Please select</option>
-                                    {cms:channellist id="channel" type="son" typeid="1"}
-                                    <option value="{$channel.id}" {in name="$channel.id" value="$row.journal_ids" }selected{/in}>{$channel.name}</option>
-                                    {/cms:channellist}
-                                </select>
+<!--                                <select id="c-journal_id" class="form-control selectpicker" multiple="" name="journal_ids[]">-->
+<!--                                    <option value="">Please select</option>-->
+<!--                                    {cms:channellist id="channel" type="son" typeid="1"}-->
+<!--                                    <option value="{$channel.id}" {in name="$channel.id" value="$row.journal_ids" }selected{/in}>{$channel.name}</option>-->
+<!--                                    {/cms:channellist}-->
+<!--                                </select>-->
+                                <input id="c-journal_id" data-rule="required" data-source="user/choose_journal" data-primary-key="id" data-search-field="name" data-multiple="true" class="form-control selectpage" name="journal_ids[]" type="text" value="{$row.journal_ids}">
                             </div>
                         </div>
 
@@ -129,30 +130,3 @@
         </div>
     </div>
 </div>
-
-<style>
-    .form-layer {height:100%;min-height:150px;min-width:300px;}
-    .form-body {
-        width:100%;
-        overflow:auto;
-        top:0;
-        position:absolute;
-        z-index:10;
-        bottom:50px;
-        padding:15px;
-    }
-    .form-layer .form-footer {
-        height:50px;
-        line-height:50px;
-        background-color: #ecf0f1;
-        width:100%;
-        position:absolute;
-        z-index:200;
-        bottom:0;
-        margin:0;
-    }
-    .form-footer .form-group{
-        margin-left:0;
-        margin-right:0;
-    }
-</style>

+ 70 - 0
application/index/view/user/send_email.html

@@ -0,0 +1,70 @@
+<link href="__CDN__/assets/css/user/reviewer_information.css?v={$Think.config.site.version|htmlentities}" rel="stylesheet">
+<div class="common-bg">
+    <div class="common-font">
+        Review comments
+    </div>
+</div>
+<div id="content-container" class="container">
+    <div class="row">
+        <div class="col-md-3">
+            {include file="common/sidenav" /}
+        </div>
+        <div class="col-md-9">
+            <div class="panel panel-default">
+                <div class="panel-body">
+                    <h2 class="page-header">Review comments</h2>
+                    <form id="send-email-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="{:url('api/user/send_email')}">
+                        {:token()}
+
+                        <input type="hidden" name="row[manuscript_id]" value="{$row.id|htmlentities}" />
+                        <input type="hidden" name="row[type]" value="{$type}">
+                        <input type="hidden" name="mail_smtp_host" value="{$mail_smtp_host}">
+                        <input type="hidden" name="mail_smtp_port" value="{$mail_smtp_port}">
+                        <input type="hidden" name="mail_smtp_user" value="{$mail_smtp_user}">
+                        <input type="hidden" name="mail_smtp_pass" value="{$mail_smtp_pass}">
+
+                        <div class="form-group">
+                            <label class="control-label col-xs-12 col-sm-4">
+                                <span style="color:#ed534b;margin-right: 10px;">*</span>Choose User:
+                            </label>
+                            <div class="col-xs-12 col-sm-8">
+                                <select id="c-send_user_email" data-rule="required" class="form-control" name="row[send_user_email]">
+                                    <option value="">Please select</option>
+                                    {foreach name="user_list" item="vo"}
+                                    <option value="{$vo}" {in name="key">{$vo}</option>
+                                    {/foreach}
+                                </select>
+                            </div>
+                        </div>
+
+                        <div class="form-group">
+                            <label class="control-label col-xs-12 col-sm-4">
+                                <span style="color:#ed534b;margin-right: 10px;">*</span>Title:
+                            </label>
+                            <div class="col-xs-12 col-sm-8">
+                                <input type="text" data-rule="required" class="form-control" id="c-title" name="row[title]" value="" placeholder="Type here...">
+                            </div>
+                        </div>
+
+                        <div class="form-group">
+                            <label class="control-label col-xs-12 col-sm-4">
+                                <span style="color:#ed534b;margin-right: 10px;">*</span>Content:
+                            </label>
+                            <div class="col-xs-12 col-sm-8">
+                                <textarea id="c-content" class="form-control editor" name="row[content]" rows="15" placeholder=""></textarea>
+                            </div>
+                        </div>
+
+                        <div class="form-group normal-footer">
+                            <label class="control-label col-xs-12 col-sm-4"></label>
+                            <div class="col-xs-12 col-sm-8">
+                                <button type="submit" id="submit-button" class="btn btn-primary btn-embossed disabled">Submit</button>
+                                <button type="reset" class="btn btn-default btn-embossed">Reset</button>
+                            </div>
+                        </div>
+                    </form>
+                </div>
+            </div>
+        </div>
+    </div>
+</div>

+ 6 - 0
application/index/view/user/show_reviewed_manuscripts.html

@@ -73,6 +73,12 @@
                                                             Review
                                                         </a>
                                                     </div>
+                                                    <div class="article-read">
+                                                        <a href="send_email.html?id={$vo.id}&type=reviewer" style="color: #007bff;" target="_blank">
+                                                            <img src="__CDN__/assets/img/index/email.png" alt="">
+                                                            Send Email
+                                                        </a>
+                                                    </div>
                                                 </div>
                                             </div>
                                         </div>

+ 8 - 7
application/index/view/user/special_issue.html

@@ -16,7 +16,7 @@
                         <h2 class="page-header">Apply to create a special issue</h2>
                     </div>
 
-                    {if condition="$user.is_editor == 'correct'"}
+                    {if condition="$user.is_editor == 'correct' || $user.is_chief == 'correct'"}
                     <form id="submit-issue-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="{:url('api/user/submit_issue')}">
                         {:token()}
                         <div class="form-item">
@@ -43,12 +43,13 @@
                                     <span style="color:#ed534b;margin-right: 10px;">*</span>Choose Jounal:
                                 </label>
                                 <div class="col-xs-12 col-sm-8">
-                                    <select id="c-journal" data-rule="required" class="form-control" name="row[journal]">
-                                        <option value="">Please select</option>
-                                        {cms:channellist id="channel" type="son" typeid="1"}
-                                        <option value="{$channel.id}" {in name="$channel.id" value="$row.journal" }selected{/in}>{$channel.name}</option>
-                                        {/cms:channellist}
-                                    </select>
+<!--                                    <select id="c-journal" data-rule="required" class="form-control" name="row[journal]">-->
+<!--                                        <option value="">Please select</option>-->
+<!--                                        {cms:channellist id="channel" type="son" typeid="1"}-->
+<!--                                        <option value="{$channel.id}" {in name="$channel.id" value="$row.journal" }selected{/in}>{$channel.name}</option>-->
+<!--                                        {/cms:channellist}-->
+<!--                                    </select>-->
+                                    <input id="c-journal" data-rule="required" data-source="user/choose_journal" data-primary-key="id" data-search-field="name" class="form-control selectpage" name="row[journal]" type="text" value="{$row.journal}">
                                 </div>
                             </div>
 

+ 1 - 1
application/index/view/user/special_issue_list.html

@@ -52,7 +52,7 @@
 
                     <nav aria-label="breadcrumb" class="breadcrumb-content">
                         <ol class="breadcrumb">
-                            <li class="breadcrumb-item <?php if($status == '') echo 'active'; ?>"><a href="?status=">All</a></li>
+                            <li class="breadcrumb-item <?php if($status == 'all') echo 'active'; ?>"><a href="?status=all">All</a></li>
                             <li class="breadcrumb-item <?php if($status == 'review') echo 'active'; ?>"><a href="?status=review">Review</a></li>
                             <li class="breadcrumb-item <?php if($status == 'correct') echo 'active'; ?>"><a href="?status=correct">Correct</a></li>
                             <li class="breadcrumb-item <?php if($status == 'fault') echo 'active'; ?>"><a href="?status=fault">Fault</a></li>

+ 13 - 16
application/index/view/user/submit_manuscript.html

@@ -280,12 +280,10 @@
                         <!-- 稿件信息 -->
                         <div class="form-item journal-content" style="display: none">
                             <div class="form-group">
-                                <label class="control-label col-xs-12 col-sm-4">
-                                    <span style="color:#ed534b;margin-right: 10px;">*</span>Cover Image:
-                                </label>
+                                <label class="control-label col-xs-12 col-sm-4">Cover Image:</label>
                                 <div class="col-xs-12 col-sm-8">
                                     <div class="input-group">
-                                        <input id="c-image" data-rule="required" class="form-control" name="row[image]" type="text" value="{$row.image|htmlentities}">
+                                        <input id="c-image" class="form-control" name="row[image]" type="text" value="{$row.image|htmlentities}">
                                         <div class="input-group-addon no-border no-padding">
                                             <span><button type="button" id="c-image-plupload-images" class="btn btn-danger plupload" data-input-id="c-image" data-multiple="true" data-preview-id="p-image"><i class="fa fa-upload"></i> Upload</button></span>
                                             <span><button type="button" id="c-image-fachoose-images" class="btn btn-primary fachoose" data-input-id="c-image" data-preview-id="p-image" data-mimetype="image/*" data-multiple="true"><i class="fa fa-list"></i> Choose</button></span>
@@ -301,12 +299,13 @@
                                     <span style="color:#ed534b;margin-right: 10px;">*</span>Choose Journal:
                                 </label>
                                 <div class="col-xs-12 col-sm-8">
-                                    <select id="c-journal" data-rule="required" class="form-control" name="row[journal]">
-                                        <option value="">Please select</option>
-                                        {cms:channellist id="channel" type="son" typeid="1"}
-                                        <option value="{$channel.id}" {if condition="$row.journal == $channel.id"}selected{/if}>{$channel.name}</option>
-                                        {/cms:channellist}
-                                    </select>
+<!--                                    <select id="c-journal" data-rule="required" class="form-control" name="row[journal]">-->
+<!--                                        <option value="">Please select</option>-->
+<!--                                        {cms:channellist id="channel" type="son" typeid="1"}-->
+<!--                                        <option value="{$channel.id}" {if condition="$row.journal == $channel.id"}selected{/if}>{$channel.name}</option>-->
+<!--                                        {/cms:channellist}-->
+<!--                                    </select>-->
+                                    <input id="c-journal" data-rule="required" data-source="user/choose_journal" data-primary-key="id" data-search-field="name" class="form-control selectpage" name="row[journal]" type="text" value="{$row.journal}">
                                 </div>
                             </div>
                             <div class="form-group">
@@ -356,11 +355,9 @@
                                 </div>
                             </div>
                             <div class="form-group">
-                                <label class="control-label col-xs-12 col-sm-4">
-                                    <span style="color:#ed534b;margin-right: 10px;">*</span>Number of Pages:
-                                </label>
+                                <label class="control-label col-xs-12 col-sm-4">Number of Pages:</label>
                                 <div class="col-xs-12 col-sm-8">
-                                    <input type="text" data-rule="required" class="form-control" id="c-number_page" name="row[number_page]" value="{$row.number_page|htmlentities}" placeholder="Type here...">
+                                    <input type="text" class="form-control" id="c-number_page" name="row[number_page]" value="{$row.number_page|htmlentities}" placeholder="Type here...">
                                     <div class="input-group-addon no-border no-padding">
                                         <span class="msg-box n-right" for="c-number_page"></span>
                                     </div>
@@ -767,7 +764,7 @@
         <div class="modal-content">
             <div class="modal-header">
                 <div class="modal-title" id="myModalLabel">
-                    Reviewer Information
+                    Recommended Reviewer
                     <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                         <span aria-hidden="true">&times;</span>
                     </button>
@@ -812,7 +809,7 @@
         <div class="modal-content">
             <div class="modal-header">
                 <div class="modal-title" id="addReviewModalLabel">
-                    Add Reviewer Information
+                    Add Recommended Reviewer
                     <div class="header-button-content add-reviewer-button">
                         <div class="author-button-item">
                             <div class="header-button-item" style="margin-right: 70px">

+ 10 - 2
public/assets/css/user/display_submitted.css

@@ -117,8 +117,9 @@
 .article-list .media-body .article-tag {
     padding-top: 10px;
     display: flex;
-    justify-content: space-between;
-    width: 100%;
+    overflow-x: scroll;
+    white-space: nowrap;
+    /*width: 100%;*/
     color: #aaa;
     font-size: 13px;
 }
@@ -157,12 +158,19 @@
     color: #527DF5;
     letter-spacing: 0.13px;
     font-weight: 400;
+    margin-right: 20px;
 }
 .breadcrumb {
     background: transparent;
     border-radius: 0;
     padding: 0 15px;
     border-bottom: 1px solid #D9D9D9;
+    display: inline;
+    white-space: nowrap;
+    overflow-x: scroll;
+    float: left;
+    overflow-y: hidden;
+    width: 800px;
 }
 .breadcrumb-item {
     padding: 15px 40px;

二進制
public/assets/img/index/email.png


二進制
public/assets/img/index/invite-editor.png


二進制
public/assets/img/index/reply.png


+ 22 - 1
public/assets/js/backend/cms/channel.js

@@ -123,7 +123,25 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
                                     classname: 'btn btn-info btn-xs btn-dialog',
                                     icon: 'fa fa-plus',
                                     url: 'cms/channel/add/parent_id/{ids}'
-                                }
+                                },
+                                {
+                                    name: 'editor',
+                                    classname: 'btn btn-xs btn-warning btn-dialog',
+                                    icon: 'fa fa-user-circle-o',
+                                    title: __('Assign editors'),
+                                    text: __('Assign editors'),
+                                    url: function (row) {
+                                        return 'cms/channel/add_chief?ids=' + row.id;
+                                    },
+                                    visible: function (row) {
+                                        if (row.pid == 1) {
+                                            return true;
+                                        }
+                                    },
+                                    callback: function (data) {
+                                        Layer.alert("接收到回传数据:" + JSON.stringify(data), {title: "回传数据"});
+                                    },
+                                },
                             ]
                         }
                     ]
@@ -209,6 +227,9 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
                 $("#outlink-extend").html(Template("outlinktpl", data));
             }
         },
+        add_chief: function () {
+            Controller.api.bindevent();
+        },
         admin: function () {
 
             // 初始化表格参数配置

+ 4 - 4
public/assets/js/backend/cms/manuscript.js

@@ -65,10 +65,10 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
                                     name: 'editor',
                                     classname: 'btn btn-xs btn-primary btn-dialog',
                                     icon: 'fa fa-user-circle-o',
-                                    title: __('Assign editors'),
-                                    text: __('Assign editors'),
+                                    title: __('Assign chief'),
+                                    text: __('Assign chief'),
                                     url: function (row) {
-                                        return 'cms/manuscript/add_editor?ids=' + row.id;
+                                        return 'cms/manuscript/edit_chief?ids=' + row.id;
                                     },
                                     callback: function (data) {
                                         Layer.alert("接收到回传数据:" + JSON.stringify(data), {title: "回传数据"});
@@ -274,7 +274,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
 
             Controller.api.bindevent();
         },
-        add_editor: function () {
+        edit_chief: function () {
             Form.api.bindevent($("form[role=form]"));
             Controller.api.bindevent();
         },

+ 127 - 46
public/assets/js/frontend/user.js

@@ -290,20 +290,18 @@ define(['jquery', 'bootstrap', 'frontend', 'form', 'template'], function ($, und
                     }
                     // 手稿信息
                     if (index == 1) {
-                        $("#c-image").trigger("validate");
+                        // $("#c-image").trigger("validate");
                         $('#c-journal').trigger("validate");
                         $('#c-article-type').trigger("validate");
                         $('#c-title').trigger("validate");
                         $('#c-abstract').trigger("validate");
                         $("#c-keywords").trigger("validate");
-                        $("#c-number_page").trigger("validate");
-                        let image = $("#c-image").isValid();
+                        // let image = $("#c-image").isValid();
                         let journal = $('#c-journal').isValid();
                         let article_type = $('#c-article-type').isValid();
                         let title = $('#c-title').isValid();
                         let abstract = $("#c-abstract").isValid();
                         let keywords = $('#c-keywords').isValid();
-                        let number_page = $('#c-number_page').isValid();
 
                         if (!image) {
                             return true;
@@ -1362,46 +1360,64 @@ define(['jquery', 'bootstrap', 'frontend', 'form', 'template'], function ($, und
                        },
                        success: function(res) {
                            if (res.code === 1) {
-                                if (res.data.total > 0) {
-                                    $('.article-list').html('');
-                                    var tableData = res.data.data;
-                                    for (var i = 0; i < tableData.length; i++) {
-                                        let rowData = tableData[i];
-                                        let html = '<article class="article-item">\n' +
-                                            '                                        <div class="media">\n' +
-                                            '                                            <div class="media-left">\n' +
-                                            '                                                <a href="submit_manuscript?id='+ rowData.id +'">\n' +
-                                            '                                                    <div class="embed-responsive embed-responsive-4by3 img-zoom">\n' +
-                                            '                                                        <img src="'+ rowData.image +'">\n' +
-                                            '                                                    </div>\n' +
-                                            '                                                </a>\n' +
-                                            '                                            </div>\n' +
-                                            '                                            <div class="media-body">\n' +
-                                            '                                                <h3 class="article-title">\n' +
-                                            '                                                    <a href="submit_manuscript?id='+ rowData.id +'">'+ rowData.title +'</a>\n' +
-                                            '                                                    <div class="article-title-id">\n' +
-                                            '                                                        ID:'+ rowData.id +'\n' +
-                                            '                                                    </div>\n' +
-                                            '                                                </h3>\n' +
-                                            '                                                <div class="article-intro">\n' +
-                                            '                                                    <span class="label label-primary article-intro-label">Open Access</span>\n' +
-                                            '                                                    <span class="label label-success article-intro-label">Feature Paper</span>\n' +
-                                            '                                                    <span class="label label-info article-intro-label">Review</span>\n' +
-                                            '                                                </div>\n' +
-                                            '                                                <div class="article-tag">\n' +
-                                            '                                                    <span itemprop="date">Submission date:'+ rowData.createtime +'</span>\n' +
-                                            '                                                    <span class="article-read">\n' +
+                                $('.article-list').html('');
+                                var tableData = res.data.data;
+                                for (var i = 0; i < tableData.length; i++) {
+                                    let rowData = tableData[i];
+                                    let edit_str = '';
+                                    let comments_str = '';
+                                    if (rowData.is_edit) {
+                                        edit_str = '<div class="article-read">\n' +
                                             '                                                        <a href="submit_manuscript?id='+ rowData.id +'" style="color: #007bff;" target="_blank">\n' +
-                                            '                                                            <img src="__CDN__/assets/img/index/personal_data_icon.png" alt="">\n' +
+                                            '                                                            <img src="/assets/img/index/personal_data_icon.png" alt="">\n' +
                                             '                                                            Edit\n' +
                                             '                                                        </a>\n' +
-                                            '                                                    <span/>\n' +
-                                            '                                                </div>\n' +
-                                            '                                            </div>\n' +
-                                            '                                        </div>\n' +
-                                            '                                    </article>';
-                                        $('.article-list').append(html);
+                                            '                                                    </div>\n';
                                     }
+                                    if (rowData.is_comments) {
+                                        comments_str = '<div class="article-read">\n' +
+                                            '                                                        <a href="review_comments.html?id='+ rowData.id +'&type=author" style="color: #007bff;" target="_blank">\n' +
+                                            '                                                            <img src="/assets/img/index/reply.png" alt="">\n' +
+                                            '                                                            Reply to review comments\n' +
+                                            '                                                        </a>\n' +
+                                            '                                                    </div>';
+                                    }
+                                    let html = '<article class="article-item">\n' +
+                                        '                                        <div class="media">\n' +
+                                        '                                            <div class="media-left">\n' +
+                                        '                                                <a href="#">\n' +
+                                        '                                                    <div class="embed-responsive embed-responsive-4by3 img-zoom p-0">\n' +
+                                        '                                                        <img src="'+ rowData.image +'">\n' +
+                                        '                                                    </div>\n' +
+                                        '                                                </a>\n' +
+                                        '                                            </div>\n' +
+                                        '                                            <div class="media-body">\n' +
+                                        '                                                <h3 class="article-title">\n' +
+                                        '                                                    <a href="#">'+ rowData.title +'</a>\n' +
+                                        '                                                    <div class="article-title-id">\n' +
+                                        '                                                        ID:'+ rowData.id +'\n' +
+                                        '                                                    </div>\n' +
+                                        '                                                </h3>\n' +
+                                        '                                                <div class="article-intro">\n' +
+                                        '                                                    <span class="label label-info article-intro-label">'+ rowData.journal +'</span>\n' +
+                                        '                                                </div>\n' +
+                                        '                                                <div class="article-tag">\n' +
+                                        '                                                    <div itemprop="date">Submission date:'+ rowData.createtime +'</div>\n' +
+                                        '                                                </div>\n' +
+                                        '                                                <div class="article-tag">\n' +
+                                        '                                                    '+ edit_str +'' +
+                                        '                                                    '+ comments_str +'' +
+                                        '                                                    <div class="article-read">\n' +
+                                        '                                                        <a href="send_email.html?id='+ rowData.id +'&type=author" style="color: #007bff;" target="_blank">\n' +
+                                        '                                                            <img src="/assets/img/index/email.png" alt="">\n' +
+                                        '                                                            Send Email' +
+                                        '                                                        </a>\n' +
+                                        '                                                    </div>\n'+
+                                        '                                                </div>\n' +
+                                        '                                            </div>\n' +
+                                        '                                        </div>\n' +
+                                        '                                    </article>';
+                                    $('.article-list').append(html);
                                 }
                            }
                        },
@@ -1438,6 +1454,15 @@ define(['jquery', 'bootstrap', 'frontend', 'form', 'template'], function ($, und
                                     var tableData = res.data.data;
                                     for (var i = 0; i < tableData.length; i++) {
                                         let rowData = tableData[i];
+                                        let str = '';
+                                        if (rowData.is_chief) {
+                                            str = `<div class="article-read">
+                                                        <a href="invite_editor.html?id=${rowData.id}&type=chief" style="color: #007bff;" target="_blank">
+                                                            <img src="/assets/img/index/invite-editor.png" alt="">
+                                                            Invite Editor
+                                                        </a>
+                                                    </div>`;
+                                        }
                                         let html = `<article class="article-item">
                                                 <div class="media">
                                                     <div class="media-left">
@@ -1458,15 +1483,13 @@ define(['jquery', 'bootstrap', 'frontend', 'form', 'template'], function ($, und
                                                             </div>
                                                         </div>
                                                         <div class="article-intro">
-                                                            <span class="label label-primary article-intro-label">Open Access</span>
-                                                            <span class="label label-success article-intro-label">Feature Paper</span>
-                                                            <span class="label label-info article-intro-label">Review</span>
+                                                            <span class="label label-success article-intro-label">${rowData.journal}</span>
                                                         </div>
                                                         <div class="article-tag">
                                                             <div class="article-read">
                                                                 <a href="handing_suggestions.html?id=${rowData.id}&type=editor" style="color: #007bff;" target="_blank">
                                                                     <img src="/assets/img/index/suggestions_button.png" alt="">
-                                                                    Submit handing suggestions
+                                                                    Handing suggestions
                                                                 </a>
                                                             </div>
                                                             <div class="article-read">
@@ -1481,6 +1504,13 @@ define(['jquery', 'bootstrap', 'frontend', 'form', 'template'], function ($, und
                                                                     Invite Reviewers
                                                                 </a>
                                                             </div>
+                                                            ${str}
+                                                             <div class="article-read">
+                                                                <a href="send_email.html?id=${rowData.id}&type=editor" style="color: #007bff;" target="_blank">
+                                                                    <img src="/assets/img/index/email.png" alt="">
+                                                                    Send Email
+                                                                </a>
+                                                            </div>
                                                         </div>
                                                     </div>
                                                 </div>
@@ -1548,11 +1578,17 @@ define(['jquery', 'bootstrap', 'frontend', 'form', 'template'], function ($, und
                                             '                                                <div class="article-tag">\n' +
                                             '                                                    <span itemprop="date">Submission date:'+ rowData.createtime +'</span>\n' +
                                             '                                                    <span class="article-read">\n' +
-                                            '                                                        <a href="conduct_review?id='+ rowData.id +'" style="color: #007bff;" target="_blank">\n' +
-                                            '                                                            <img src="__CDN__/assets/img/index/review_button.png" alt="">\n' +
+                                            '                                                        <a href="conduct_review?id='+ rowData.id +'&type=reviewer" style="color: #007bff;" target="_blank">\n' +
+                                            '                                                            <img src="/assets/img/index/review_button.png" alt="">\n' +
                                             '                                                            Review\n' +
                                             '                                                        </a>\n' +
                                             '                                                    <span/>\n' +
+                                            '                                                    <div class="article-read">\n' +
+                                            '                                                        <a href="send_email.html?id='+ rowData.id +'&type=reviewer" style="color: #007bff;" target="_blank">\n' +
+                                            '                                                            <img src="/assets/img/index/email.png" alt="">\n' +
+                                            '                                                            Send Email\n' +
+                                            '                                                        </a>\n' +
+                                            '                                                    </div>'
                                             '                                                </div>\n' +
                                             '                                            </div>\n' +
                                             '                                        </div>\n' +
@@ -1873,6 +1909,51 @@ define(['jquery', 'bootstrap', 'frontend', 'form', 'template'], function ($, und
                 // $("input[name=captcha]").next(".input-group-btn").find("img").trigger("click");
             });
         },
+        review_comments: function () {
+            //为表单绑定事件
+            Form.api.bindevent($("#review-comments-form"), function (data, ret) {
+                setTimeout(function () {
+                    location.href = "/index/user/display_submitted";
+                }, 2000);
+            }, function (data) {
+
+            });
+        },
+        // 发送邮件
+        send_email: function () {
+            $('#submit-button').prop('disabled', true);
+            let mail_smtp_host = $('input[name="mail_smtp_host"]').val();
+            let mail_smtp_port = $('input[name="mail_smtp_port"]').val();
+            let mail_smtp_user = $('input[name="mail_smtp_user"]').val();
+            let mail_smtp_pass = $('input[name="mail_smtp_pass"]').val();
+            if (!mail_smtp_host && !mail_smtp_port && !mail_smtp_user && !mail_smtp_pass) {
+                Layer.confirm("You have not filled in the email configuration yet, which may cause sending the specified email to fail", {title: "Tips", icon: 0, btn: ["Go to fill out", "Ignore/Cancel"]}, function () {
+                    location.href = "/index/user/profile";
+                });
+            } else {
+                $('#submit-button').prop('disabled', false);
+            }
+
+            //为表单绑定事件
+            Form.api.bindevent($("#send-email-form"), function (data, ret) {
+                setTimeout(function () {
+                    location.href = window.history.go(-1);
+                }, 2000);
+            }, function (data) {
+
+            });
+        },
+        // 邀请编辑
+        invite_editor: function () {
+            //为表单绑定事件
+            Form.api.bindevent($("#invite-editor-form"), function (data, ret) {
+                setTimeout(function () {
+                    location.href = "/index/user/editing_manuscripts";
+                }, 2000);
+            }, function (data) {
+
+            });
+        },
         special_issue_list: function () {
             // 初始化分页参数
             var currentPage = 1;