Selaa lähdekoodia

主编和编辑只有一个角色属性,修改bug 9/20

Xiahai 1 vuosi sitten
vanhempi
commit
6cdc99adab

+ 24 - 0
application/admin/controller/user/User.php

@@ -2,6 +2,7 @@
 
 namespace app\admin\controller\user;
 
+use app\admin\model\cms\Channel;
 use app\common\controller\Backend;
 use app\common\library\Auth;
 use app\common\model\UserRoleContent;
@@ -33,6 +34,9 @@ class User extends Backend
         $this->model = model('User');
         $this->view->assign("typesList", $this->model->getTypesList());
 
+        $journal_list = Channel::where(['chief_id' => 0, 'parent_id' => 1])->column('name', 'id');
+        $this->view->assign('journal_list', $journal_list);
+
         $group_list = ['author' => __('Author'), 'review' => __('Review'), 'chief' => __('chief'), 'editor' => __('editor')];
         $this->view->assign('group_list', $group_list);
     }
@@ -118,6 +122,8 @@ class User extends Backend
             $this->token();
         }
         $row = $this->model->get($ids);
+        $channel = Channel::where(['chief_id' => $row->id])->find();
+        $row->journal = $channel->id ?? 0;
         $this->modelValidate = true;
         if (!$row) {
             $this->error(__('No Results were found'));
@@ -321,11 +327,29 @@ class User extends Backend
                 if ($key == 'is_review') {
                     $type = 'review';
                 }
+                // 如果是新增编辑角色则需要判断是否拥有主编,如拥有主编则需要去除掉
                 if ($key == 'is_editor') {
                     $type = 'editor';
+                    if ($row->is_chief == 'correct') {
+                        $params['is_chief'] = 'fault';
+                    }
                 }
+                // 如果是新增主编角色则需要判断是否拥有编辑,如拥有编辑则需要去除掉
                 if ($key == 'is_chief') {
                     $type = 'chief';
+                    if ($row->is_editor == 'correct') {
+                        $params['is_editor'] = 'fault';
+                    }
+
+                    // 判断如果选择了主编则需要填写期刊
+                    if (empty($params['journal'])) {
+                        $this->error(__('Please select a journal'));
+                    }
+
+                    // 对应期刊绑定主编
+                    $channel = Channel::get($params['journal']);
+                    $channel->chief_id = $row->id;
+                    $channel->save();
                 }
 
                 // 增加user_role_content数据

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

@@ -48,4 +48,8 @@ return [
     'Review'         => '审稿人',
     'Chief'          => '主编',
     'Editor'         => '编辑',
+    'Note: Editors and chief editors can only have one'           => '注:编辑和主编只能拥有一个',
+    'Journal'        => '期刊',
+    'Please select a journal'    => '请选择期刊',
+    'Note: If the editor in chief role is selected, a journal must be filled in' => '如果选择了主编角色,必须填写期刊',
 ];

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

@@ -64,7 +64,7 @@
     <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">
-            <div class="bootstrap-tagsinput">
+            <div class="bootstrap-tagsinput" style="width: auto;">
                 {foreach name="$row.journal_ids" item="vo"}
                 <span class="tag label label-info">
                     {$vo}

+ 13 - 0
application/admin/view/user/user/edit.html

@@ -16,6 +16,19 @@
                 {/foreach}
             </select>
         </div>
+        <span class="msg-box" style="color: #f00;line-height: 25px">{:__('Note: Editors and chief editors can only have one')}</span>
+    </div>
+    <div class="form-group">
+        <label for="c-username" class="control-label col-xs-12 col-sm-2">{:__('Journal')}:</label>
+        <div class="col-xs-12 col-sm-4">
+            <select id="c-journal" class="form-control" name="row[journal]">
+                <option value="">{:__('Please select a journal')}</option>
+                {foreach name="journal_list" item="vo"}
+                <option value="{$key}" {in name="key" value="$row.journal" }selected{/in}>{$vo}</option>
+                {/foreach}
+            </select>
+        </div>
+        <span class="msg-box" style="color: #f00;line-height: 25px">{:__('Note: If the editor in chief role is selected, a journal must be filled in')}</span>
     </div>
     <div class="form-group">
         <label for="c-username" class="control-label col-xs-12 col-sm-2">{:__('Username')}:</label>

+ 78 - 55
application/api/controller/User.php

@@ -233,16 +233,9 @@ class User extends Api
         $user->mail_smtp_port = $mail_smtp_port;
         $user->mail_smtp_user = $mail_smtp_user;
         $user->mail_smtp_pass = $mail_smtp_pass;
+        $user->is_author = 'correct';
         $user->save();
 
-        // 查询用户是否已有申请角色记录表
-        $user_role_log = UserRoleLog::where(['user_id' => $user->id, 'type' => 'author', 'is_adopt' => ['in', ['review', 'fault', 'correct']]])->find();
-        if (empty($user_role_log)) {
-            $user_role = new UserRoleLog();
-            $user_role->user_id = $user->id;
-            $user_role->save();
-        }
-
         $this->success();
     }
 
@@ -431,46 +424,70 @@ class User extends Api
         $journal_ids = $param['journal_ids'];
         $type = $this->request->param('type');
 
-        // 查询是否有对应的申请角色数据信息
-        $user_content = UserRoleContent::where(['user_id' => $user->id, 'type' => $type])->find();
-        if ($user_content) {
-            $user_content->field = $field;
-            $user_content->degree = $degree;
-            $user_content->resume = $resume;
-            $user_content->affiliation = $affiliation;
-            $user_content->publication = $publication;
-            $user_content->orcid = $orcid;
-            $user_content->homepage = $homepage;
-            $user_content->review_journal = $review_journal;
-            $user_content->interested_journal = $interested_journal;
-            $user_content->journal_ids = $journal_ids;
-            $user_content->save();
-        }
-
-        // 查询用户是否已有申请角色记录表
-        $user_role_log = UserRoleLog::where(['user_id' => $user->id, 'type' => $type, 'is_adopt' => ['in', ['review', 'fault', 'correct']]])->find();
-        if (empty($user_role_log)) {
-            $new_user_role = new UserRoleLog();
-            $new_user_role->user_id = $user->id;
-            $new_user_role->type = $type;
-            if ($new_user_role->save()) {
-                // 创建对应的信息
-                $new_user_content = new UserRoleContent();
-                $new_user_content->user_id = $user->id;
-                $new_user_content->log_id = $new_user_role->id;
-                $new_user_content->type = $type;
-                $new_user_content->field = $field;
-                $new_user_content->degree = $degree;
-                $new_user_content->resume = $resume;
-                $new_user_content->affiliation = $affiliation;
-                $new_user_content->publication = $publication;
-                $new_user_content->orcid = $orcid;
-                $new_user_content->homepage = $homepage;
-                $new_user_content->review_journal = $review_journal;
-                $new_user_content->interested_journal = $interested_journal;
-                $new_user_content->journal_ids = $journal_ids;
-                $new_user_content->save();
+        Db::startTrans();
+        try {
+            // 查询是否有对应的申请角色数据信息
+            $user_content = UserRoleContent::where(['user_id' => $user->id, 'type' => $type])->find();
+            if ($user_content) {
+                $user_content->field = $field;
+                $user_content->degree = $degree;
+                $user_content->resume = $resume;
+                $user_content->affiliation = $affiliation;
+                $user_content->publication = $publication;
+                $user_content->orcid = $orcid;
+                $user_content->homepage = $homepage;
+                $user_content->review_journal = $review_journal;
+                $user_content->interested_journal = $interested_journal;
+                $user_content->journal_ids = $journal_ids;
+                $user_content->save();
+            }
+
+            // 查询用户是否已有申请角色记录表
+            $user_role_log = UserRoleLog::where(['user_id' => $user->id, 'type' => $type, 'is_adopt' => ['in', ['review', 'fault', 'correct']]])->find();
+            if (empty($user_role_log)) {
+                $new_user_role = new UserRoleLog();
+                $new_user_role->user_id = $user->id;
+                $new_user_role->type = $type;
+                if ($new_user_role->save()) {
+                    // 创建对应的信息
+                    $new_user_content = new UserRoleContent();
+                    $new_user_content->user_id = $user->id;
+                    $new_user_content->log_id = $new_user_role->id;
+                    $new_user_content->type = $type;
+                    $new_user_content->field = $field;
+                    $new_user_content->degree = $degree;
+                    $new_user_content->resume = $resume;
+                    $new_user_content->affiliation = $affiliation;
+                    $new_user_content->publication = $publication;
+                    $new_user_content->orcid = $orcid;
+                    $new_user_content->homepage = $homepage;
+                    $new_user_content->review_journal = $review_journal;
+                    $new_user_content->interested_journal = $interested_journal;
+                    $new_user_content->journal_ids = $journal_ids;
+                    $new_user_content->save();
+                }
+            } else {
+                // 如果之前申请了主编或者编辑角色、并且已经通过了,则需要查看当前是否为主编或者编辑
+                if ($type == 'editor') {
+                    if($user->is_chief == 'correct') {
+                        $user_role_log->is_adopt = 'fault';
+                        $user->is_chief = 'fault';
+                    }
+                }
+                if ($type == 'chief') {
+                    if ($user->is_ediot == 'correct') {
+                        $user_role_log->is_adopt = 'fault';
+                        $user->is_editor = 'fault';
+                    }
+                }
+                $user->save();
+                $user_role_log->save();
             }
+
+            Db::commit();
+        } catch (ValidateException|PDOException|Exception $e) {
+            Db::rollback();
+            $this->error($e->getMessage());
         }
 
         $this->success('Submit Success');
@@ -490,7 +507,6 @@ class User extends Api
         if (!$params['title']) $this->error('Title Cannot be Empty');
         if (!$params['abstract']) $this->error('Abstract Cannot be Empty');
         if (!$params['keywords']) $this->error('Keywords Cannot be Empty');
-        if (!$params['number_page']) $this->error('Number of Pages Cannot be Empty');
         if (!$params['author']) $this->error('Author Cannot be Empty');
         if (array_key_exists('reviewer', $params)) {
             if (!$params['reviewer']) $this->error('Reviewer Cannot be Empty');
@@ -514,6 +530,11 @@ class User extends Api
                     $params['status'] = 'processing';
                 }
 
+                // 默认图片
+                if ($params['image'] == '') {
+                    $params['image'] = 'https://dummyimage.com/205x128';
+                }
+
                 // 通过选择的期刊来绑定对应的主编
                 if (!empty($params['journal'])) {
                     $channel = Channel::get($params['journal']);
@@ -642,6 +663,7 @@ class User extends Api
     public function submit_invite_reviewer()
     {
         $params = $this->request->post('row/a');
+        $manuscript = AuthorManuscript::where(['id' =>  $params['manuscript_id']])->find();
         $reviewers = $params['reviewer'];
         if (!$reviewers) $this->error('Please select reviewer');
         $result = false;
@@ -655,15 +677,16 @@ class User extends Api
                 $data['editor_id'] = $this->auth->id;
                 $data['manuscript_id'] = $params['manuscript_id'];
 
-                $reviewer_old = InviteReviewer::where(['role_id' => $reviewer['id'], 'editor_id' => $this->auth->id, 'manuscript_id' => $params['manuscript_id']])->find();
-                // 如果存在选择数据则不进行插入操作
-                if (!$reviewer_old) {
-                    $model = new InviteReviewer();
-                    $model->allowField(true)->save($data);
+                // 删除所有关于这个期刊的审稿人信息
+                $reviewer_old = InviteReviewer::where(['manuscript_id' => $params['manuscript_id']])->select();
+                foreach ($reviewer_old as $item) {
+                    $item->delete();
                 }
+
+                $model = new InviteReviewer();
+                $model->allowField(true)->save($data);
             }
-            $manuscript = AuthorManuscript::where(['id' =>  $params['manuscript_id']])->find();
-            $reviewer_ids_arr = explode(',', $manuscript['reviewer_ids']);
+            $reviewer_ids_arr = [];
             // 合并数组
             $merged_reviewer_ids_arr = array_merge($reviewer_ids_arr, $reviewer_id_arr);
             // 去重数组

+ 1 - 1
application/extra/upload.php

@@ -21,7 +21,7 @@ return [
     /**
      * 可上传的文件类型
      */
-    'mimetype'  => 'jpg,png,bmp,jpeg,gif,webp,zip,rar,wav,mp4,mp3,webm,pdf,xlsx,doc,docx',
+    'mimetype'  => 'jpg,png,bmp,jpeg,gif,webp,zip,rar,wav,mp4,mp3,webm,pdf,xlsx,doc,docx,word',
     /**
      * 是否支持批量上传
      */

+ 26 - 8
application/index/controller/User.php

@@ -573,7 +573,7 @@ class User extends Frontend
                 ->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') ?? '';
             }
             $this->success('', '', $manuscripts);
         }
@@ -726,8 +726,12 @@ class User extends Frontend
      */
     public function become_an_editor()
     {
-        $user_content = UserRoleContent::where(['user_id' => $this->auth->id, 'type' => 'editor'])->find();
+        $user_content = UserRoleContent::where(['user_id' => $this->auth->id, 'type' => ['in', ['editor', 'chief']]])->find();
         $user = \app\common\model\User::get($this->auth->id);
+
+        // 因为是主编和编辑共用一个页面所以只查询这两个角色下最后一个申请记录就可以
+        $user_role_log = UserRoleLog::where(['user_id' => $this->auth->id, 'type' => ['in', ['editor', 'chief']]])->order('createtime', 'DESC')->find();
+
         if (empty($user_content)) {
             $user_content['degree'] = '';
             $user_content['affiliation'] = '';
@@ -745,6 +749,7 @@ class User extends Frontend
             $user_content['is_editor'] = $user['is_editor'];
         }
         $this->view->assign('row', $user_content);
+        $this->view->assign('user_role', $user_role_log);
         $this->view->assign('user', $user);
         $this->view->assign('title', 'Apply to become an editor');
         return $this->view->fetch();
@@ -762,10 +767,16 @@ class User extends Frontend
         if ($status != 'all') {
             $where = ['status' => $status];
         }
+        $user = $this->auth;
         // 查询当前用户手稿
-        $manuscripts = AuthorManuscript::whereRaw("FIND_IN_SET(". $this->auth->id .", `editor_ids`)")
-            ->where($where)
-            ->field('id,title,image,createtime,journal')
+        $manuscripts = AuthorManuscript::where(function ($query) use ($user) {
+                if ($user->is_chief == 'correct') {
+                    $query->where(['chief_id' => $this->auth->id]);
+                }
+                if ($user->is_editor == 'correct') {
+                    $query->whereRaw("FIND_IN_SET(". $this->auth->id .", `editor_ids`)");
+                }
+            })->where($where)->field('id,title,image,createtime,journal')
             ->order('createtime', 'DESC')
             ->paginate($limit);
         foreach ($manuscripts as $manuscript) {
@@ -820,6 +831,8 @@ class User extends Frontend
         // 构建分页参数
         $limit = $this->request->param('limit', 10);
         $manuscript = AuthorManuscript::get($id);
+        $manuscript_review_id_arr = explode(',', $manuscript['reviewer_ids']);
+        $review_user_content = UserRoleContent::where(['user_id' => ['in', $manuscript_review_id_arr], 'type' => 'review'])->select();
 
         // 获取审稿人信息
         $review_id_arr = \app\common\model\User::where(['is_review' => 'correct', 'id' => ['not in', $manuscript->user_id]])->column('id');
@@ -828,9 +841,14 @@ class User extends Frontend
         foreach ($list as $value) {
             $channel_name_arr = Channel::where(['id' => ['in', explode(',', $value['journal_ids'])]])->column('name');
             $value['journal'] = implode(',', $channel_name_arr);
+            $value['is_checked'] = false;
+            if (in_array($value['user_id'], $manuscript_review_id_arr)) {
+                $value['is_checked'] = true;
+            }
         }
         $this->view->assign('id', $id);
         $this->view->assign('list', $list);
+        $this->view->assign('reviewer_user_content', $review_user_content);
         $this->view->assign('title', 'Invite Reviewers');
         return $this->view->fetch();
     }
@@ -1070,15 +1088,15 @@ class User extends Frontend
      */
     public function choose_journal()
     {
-        $info = Channel::where(['parent_id' => 1])->field('name, id')->select();
+        $info = Channel::where(['parent_id' => 1, 'chief_id' => ['<>', 0]])->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();
+            $info = Channel::where(['parent_id' => 1, 'name' => ['like', '%' . $params['name'] . '%'], 'chief_id' => ['<>', 0]])->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();
+            $info = Channel::where(['id' => ['in', $id_arr], 'chief_id' => ['<>', 0]])->field('name, id')->select();
         }
 
         $arr = [];

+ 1 - 1
application/index/lang/zh-cn/user.php

@@ -34,7 +34,7 @@ return [
     'Email already exist'                        => '邮箱已经存在',
     'Mobile already exist'                       => '手机号已经存在',
     'Username is incorrect'                      => '用户名不正确',
-    'Reset password'                             => '修改密码',
+    'Reset password'                             => 'Reset password',
     'Reset password by email'                    => '通过邮箱',
     'Reset password by mobile'                   => '通过手机重置',
     'Reset password successful'                  => '修改密码成功',

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

@@ -97,7 +97,7 @@
         </li>
         <li class="list-group-item {:check_nav_active('user/become_an_editor')}">
             <a href="{:url('user/become_an_editor')}">
-                Apply to become an editor
+                Apply to become an chief/editor
                 <img src="__CDN__/assets/img/index/arrow_right_icon.png" alt="">
             </a>
         </li>

+ 14 - 5
application/index/view/user/become_an_editor.html

@@ -12,10 +12,19 @@
         <div class="col-md-9">
             <div class="panel panel-default">
                 <div class="panel-body">
-                    <div class="header-content">
-                        <h2 class="page-header">Edit personal information</h2>
-                    </div>
-                    {if condition="$user.is_chief == 'correct' || $user.is_editor == 'correct'"}
+                    <h2 class="page-header">Edit personal information</h2>
+                    {if condition="$user_role"}
+                    {if condition="$user_role.is_adopt == 'correct'"}
+                    <p class="text-success">Status:Correct</p>
+                    {/if}
+                    {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.workplace != '' || $user.job_type != '' || $user.first_name != '' || $user.last_name != '' || $user.affiliation != '' || $user.address != '' || $user.zip_code != ''"}
                     <form id="become-an-editor-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="{:url('api/user/apply_role')}">
                         {:token()}
 
@@ -120,7 +129,7 @@
                         <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="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>

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

@@ -56,7 +56,7 @@
                                                 <h3 class="article-title">
                                                     <a href="article_details?id={$vo.id}&type=editor">{$vo.title}</a>
                                                 </h3>
-                                                <div class="article-tag">
+                                                <div class="article-tag" style="display: flex;justify-content: space-between;">
                                                     <span itemprop="date">Submission date:{$vo.createtime|date="Y-m-d", ###}</span>
                                                     <div class="article-title-id">
                                                         ID:{$vo.id}

+ 5 - 2
application/index/view/user/invite_reviewers.html

@@ -34,7 +34,7 @@
                             <tr data-id="{$vo.id}">
                                 <td>
                                     <div class="inbox-checkbox">
-                                        <input type="checkbox" class="check-single review-check son-chk" name="son-chk" data-id="{$vo.id}" data-user-id="{$vo.user.id}" data-name="{$vo.user.nickname}" data-education="{$vo.degree}" data-affiliation="{$vo.affiliation}" data-field="{$vo.field}">
+                                        <input {if condition="$vo.is_checked"}checked{/if} type="checkbox" class="check-single review-check son-chk" name="son-chk" data-id="{$vo.id}" data-user-id="{$vo.user.id}" data-name="{$vo.user.nickname}" data-education="{$vo.degree}" data-affiliation="{$vo.affiliation}" data-field="{$vo.field}">
                                     </div>
                                 </td>
                                 <td><a href="#">{$vo.user.nickname}</a></td>
@@ -65,7 +65,10 @@
                             </div>
 
                             <div class="form-group reviewer-content">
-
+                                {foreach name="$reviewer_user_content" item="vo"}
+                                <input type="hidden" name="row[reviewer][{$key}][id]" value="{$vo.id}">
+                                <input type="hidden" name="row[reviewer][{$key}][user_id]" value="{$vo.user_id}">
+                                {/foreach}
                             </div>
 
                             <div class="form-group normal-footer">

+ 1 - 3
application/index/view/user/show_reviewed_manuscripts.html

@@ -59,9 +59,7 @@
                                                     </div>
                                                 </h3>
                                                 <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">{$vo.journal}</span>
                                                 </div>
                                                 <div class="article-tag">
                                                     <div itemprop="date">Submission date:{$vo.createtime|date="Y-m-d", ###}</div>

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

@@ -172,8 +172,8 @@
                                     <div class="input-group">
                                         <input id="c-manuscript-zip" data-rule="required" class="form-control" name="row[manuscript_zip]" type="text" value="{$row.manuscript_zip|htmlentities}">
                                         <div class="input-group-addon no-border no-padding">
-                                            <span><button type="button" id="plupload-images" class="btn btn-danger plupload" data-input-id="c-manuscript-zip" data-multiple="true" data-preview-id="p-manuscript-zip"><i class="fa fa-upload"></i> Upload</button></span>
-                                            <span><button type="button" id="fachoose-images" class="btn btn-primary fachoose" data-input-id="c-manuscript-zip" data-preview-id="p-manuscript-zip" data-mimetype="image/*" data-multiple="true"><i class="fa fa-list"></i> Choose</button></span>
+                                            <span><button type="button" id="plupload-images" class="btn btn-danger plupload" data-input-id="c-manuscript-zip" data-multiple="true" data-mimetype="word,zip,doc,docx" data-preview-id="p-manuscript-zip"><i class="fa fa-upload"></i> Upload</button></span>
+                                            <span><button type="button" id="fachoose-images" class="btn btn-primary fachoose" data-input-id="c-manuscript-zip" data-preview-id="p-manuscript-zip" data-mimetype="word,zip,doc,docx" data-multiple="true"><i class="fa fa-list"></i> Choose</button></span>
                                             <span class="msg-box n-right" for="c-manuscript-zip"></span>
                                         </div>
                                     </div>
@@ -188,8 +188,8 @@
                                     <div class="input-group">
                                         <input id="c-manuscript-pdf" class="form-control" name="row[manuscript_pdf]" type="text" value="{$row.manuscript_pdf|htmlentities}">
                                         <div class="input-group-addon no-border no-padding">
-                                            <span><button type="button" id="c-manuscript-pdf-plupload-images" class="btn btn-danger plupload" data-input-id="c-manuscript-pdf" data-multiple="true" data-preview-id="p-manuscript-pdf"><i class="fa fa-upload"></i> Upload</button></span>
-                                            <span><button type="button" id="c-manuscript-pdf-fachoose-images" class="btn btn-primary fachoose" data-input-id="c-manuscript-pdf" data-preview-id="p-manuscript-pdf" data-mimetype="image/*" data-multiple="true"><i class="fa fa-list"></i> Choose</button></span>
+                                            <span><button type="button" id="c-manuscript-pdf-plupload-images" class="btn btn-danger plupload" data-input-id="c-manuscript-pdf" data-multiple="true" data-mimetype="pdf" data-preview-id="p-manuscript-pdf"><i class="fa fa-upload"></i> Upload</button></span>
+                                            <span><button type="button" id="c-manuscript-pdf-fachoose-images" class="btn btn-primary fachoose" data-input-id="c-manuscript-pdf" data-preview-id="p-manuscript-pdf" data-mimetype="pdf" data-multiple="true"><i class="fa fa-list"></i> Choose</button></span>
                                             <span class="msg-box n-right" for="c-manuscript-pdf"></span>
                                         </div>
                                     </div>
@@ -202,7 +202,7 @@
                                     <div class="input-group">
                                         <input id="c-cover_letter" class="form-control" name="row[cover_letter]" type="text" value="{$row.cover_letter|htmlentities}">
                                         <div class="input-group-addon no-border no-padding">
-                                            <span><button type="button" id="c-cover_letter-plupload-images" class="btn btn-danger plupload" data-input-id="c-cover_letter" data-multiple="true" data-preview-id="p-cover_letter"><i class="fa fa-upload"></i> Upload</button></span>
+                                            <span><button type="button" id="c-cover_letter-plupload-images" class="btn btn-danger plupload" data-input-id="c-cover_letter" data-multiple="true" data-mimetype="image/* data-preview-id="p-cover_letter"><i class="fa fa-upload"></i> Upload</button></span>
                                             <span><button type="button" id="c-cover_letter-fachoose-images" class="btn btn-primary fachoose" data-input-id="c-cover_letter" data-preview-id="p-cover_letter" data-mimetype="image/*" data-multiple="true"><i class="fa fa-list"></i> Choose</button></span>
                                             <span class="msg-box n-right" for="c-cover_letter"></span>
                                         </div>
@@ -235,8 +235,8 @@
                                     <div class="input-group">
                                         <input id="c-non_material" class="form-control" name="row[non_material]" type="text" value="{$row.non_material|htmlentities}">
                                         <div class="input-group-addon no-border no-padding">
-                                            <span><button type="button" id="c-non_material-plupload-images" class="btn btn-danger plupload" data-input-id="c-non_material" data-multiple="true" data-preview-id="p-non_material"><i class="fa fa-upload"></i> Upload</button></span>
-                                            <span><button type="button" id="c-non_material-fachoose-images" class="btn btn-primary fachoose" data-input-id="c-non_material" data-preview-id="p-non_material" data-mimetype="image/*" data-multiple="true"><i class="fa fa-list"></i> Choose</button></span>
+                                            <span><button type="button" id="c-non_material-plupload-images" class="btn btn-danger plupload" data-input-id="c-non_material" data-multiple="true" data-mimetype="word,doc,docx,zip,pdf" data-preview-id="p-non_material"><i class="fa fa-upload"></i> Upload</button></span>
+                                            <span><button type="button" id="c-non_material-fachoose-images" class="btn btn-primary fachoose" data-input-id="c-non_material" data-preview-id="p-non_material" data-mimetype="word,doc,docx,zip,pdf" data-multiple="true"><i class="fa fa-list"></i> Choose</button></span>
                                             <span class="msg-box n-right" for="c-non_material"></span>
                                         </div>
                                     </div>
@@ -258,8 +258,8 @@
                                     <div class="input-group">
                                         <input id="c-copyright_files" class="form-control" name="row[copyright_files]" type="text" value="{$row.copyright_files|htmlentities}">
                                         <div class="input-group-addon no-border no-padding">
-                                            <span><button type="button" id="c-copyright_files-plupload-images" class="btn btn-danger plupload" data-input-id="c-copyright_files" data-multiple="true" data-preview-id="p-copyright_files"><i class="fa fa-upload"></i> Upload</button></span>
-                                            <span><button type="button" id="c-copyright_files-fachoose-images" class="btn btn-primary fachoose" data-input-id="c-copyright_files" data-preview-id="p-copyright_files" data-mimetype="image/*" data-multiple="true"><i class="fa fa-list"></i> Choose</button></span>
+                                            <span><button type="button" id="c-copyright_files-plupload-images" class="btn btn-danger plupload" data-input-id="c-copyright_files" data-multiple="true" data-mimetype="zip,pdf" data-preview-id="p-copyright_files"><i class="fa fa-upload"></i> Upload</button></span>
+                                            <span><button type="button" id="c-copyright_files-fachoose-images" class="btn btn-primary fachoose" data-input-id="c-copyright_files" data-preview-id="p-copyright_files" data-mimetype="zip,pdf" data-multiple="true"><i class="fa fa-list"></i> Choose</button></span>
                                             <span class="msg-box n-right" for="c-copyright_files"></span>
                                         </div>
                                     </div>
@@ -285,7 +285,7 @@
                                     <div class="input-group">
                                         <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-plupload-images" class="btn btn-danger plupload" data-input-id="c-image" data-multiple="true" data-mimetype="image/*" 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>
                                             <span class="msg-box n-right" for="c-image"></span>
                                         </div>
@@ -358,9 +358,6 @@
                                 <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" 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>
                                 </div>
                             </div>
                         </div>

+ 55 - 27
public/assets/js/frontend/user.js

@@ -25,7 +25,7 @@ define(['jquery', 'bootstrap', 'frontend', 'form', 'template'], function ($, und
                 var content = Template(id, {});
                 Layer.open({
                     type: 1,
-                    title: __('Reset password'),
+                    title: 'Reset password',
                     area: ["450px", "355px"],
                     content: content,
                     success: function (layero) {
@@ -303,9 +303,9 @@ define(['jquery', 'bootstrap', 'frontend', 'form', 'template'], function ($, und
                         let abstract = $("#c-abstract").isValid();
                         let keywords = $('#c-keywords').isValid();
 
-                        if (!image) {
-                            return true;
-                        }
+                        // if (!image) {
+                        //     return true;
+                        // }
                         if (!journal) {
                             return true;
                         }
@@ -321,9 +321,9 @@ define(['jquery', 'bootstrap', 'frontend', 'form', 'template'], function ($, und
                         if (!keywords) {
                             return true;
                         }
-                        if (!number_page) {
-                            return true;
-                        }
+                        // if (!number_page) {
+                        //     return true;
+                        // }
                         is_next = true;
                     }
 
@@ -1278,12 +1278,12 @@ define(['jquery', 'bootstrap', 'frontend', 'form', 'template'], function ($, und
 
             Form.api.bindevent($("#submit-manuscript-form"), function () {
                 setTimeout(function () {
-                    location.href = "/index/user/display_submitted";
+                    location.href = window.history.go(-1);
                 }, 2000);
             });
         },
         invite_reviewers: function () {
-            updateHidden();
+            // updateHidden();
             // 全选
             $('#reviewer-table').on('click', '.chk', function () {
                 var checkedStatus = this.checked;
@@ -1329,15 +1329,15 @@ define(['jquery', 'bootstrap', 'frontend', 'form', 'template'], function ($, und
                 // 清理缓存
                 localStorage.removeItem('selectedTableVals');
 
-                // setTimeout(function () {
-                //     location.href = "index/user/reviewer_information";
-                // }, 2000);
+                setTimeout(function () {
+                    location.href = '/index/user/editing_manuscripts';
+                }, 2000);
             });
         },
         handing_suggestions: function () {
             Form.api.bindevent($("#submit-comments-form"), function () {
                 setTimeout(function () {
-                    location.href = "index/user/reviewer_information";
+                    location.href = window.history.go(-1);
                 }, 2000);
             });
         },
@@ -1476,7 +1476,7 @@ define(['jquery', 'bootstrap', 'frontend', 'form', 'template'], function ($, und
                                                         <h3 class="article-title">
                                                             <a href="article_details?id=${rowData.id}&type=editor">${rowData.title}</a>
                                                         </h3>
-                                                        <div class="article-tag">
+                                                        <div class="article-tag" style="display: flex;justify-content: space-between;">
                                                             <span itemprop="date">Submission date:${rowData.createtime}</span>
                                                             <div class="article-title-id">
                                                                 ID:${rowData.id}
@@ -1571,9 +1571,7 @@ define(['jquery', 'bootstrap', 'frontend', 'form', 'template'], function ($, und
                                             '                                                    </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' +
+                                            '                                                    <span class="label label-success article-intro-label">'+ rowData.journal +'</span>\n' +
                                             '                                                </div>\n' +
                                             '                                                <div class="article-tag">\n' +
                                             '                                                    <span itemprop="date">Submission date:'+ rowData.createtime +'</span>\n' +
@@ -1862,21 +1860,21 @@ define(['jquery', 'bootstrap', 'frontend', 'form', 'template'], function ($, und
             }, 300);
             Form.api.bindevent($("#article-details-form"), function () {
                 setTimeout(function () {
-                    location.href = "index/user/reviewer_information";
+                    location.href = window.history.go(-1);
                 }, 2000);
             });
         },
         conduct_review: function () {
             Form.api.bindevent($("#submit-comments-form"), function () {
                 setTimeout(function () {
-                    location.href = "index/user/reviewer_information";
+                    location.href = window.history.go(-1);
                 }, 2000);
             });
         },
         submit_conference: function () {
             Form.api.bindevent($("#conference-form"), function () {
                 setTimeout(function () {
-                    location.href = "/p/conference";
+                    location.href = window.history.go(-1);
                 }, 2000);
             }, function (data) {
                 $("input[name=captcha]").next(".input-group-addon").find("img").trigger("click");
@@ -1885,7 +1883,7 @@ define(['jquery', 'bootstrap', 'frontend', 'form', 'template'], function ($, und
         conference_participate: function () {
             Form.api.bindevent($("#conference-participate-form"), function () {
                 setTimeout(function () {
-                    location.href = "/p/conference";
+                    location.href = window.history.go(-1);
                 }, 2000);
             });
         },
@@ -1900,11 +1898,41 @@ define(['jquery', 'bootstrap', 'frontend', 'form', 'template'], function ($, und
             });
         },
         become_an_editor: function () {
+            let is_radio_checked = false;
+            // 点击单选框时触发事件
+            $("input[type='radio']").on("click", function() {
+                // 判断单选框是否更改
+                var isChecked = $("input[type='radio']").is(":checked");
+                if (isChecked) {
+                    is_radio_checked = true;
+                }
+            });
+
+            // 获取表单内所有单选框
+            var radios = $("input[type='radio']");
+            // 遍历单选框
+            for (let i = 0; i < radios.length; i++) {
+                if ($(radios[i]).is(":checked")) {
+                    is_radio_checked = true;
+                }
+            }
+
+            // 如果更改了单选框的值则需要提示
+            $('#submit-button').click(function () {
+                if (is_radio_checked) {
+                    Layer.confirm("If you have selected a character, the corresponding character attributes will be lost. Do you want to continue?", {title: "Tips", icon: 0, btn: ["Continue", "Cancel"]}, function () {
+                        is_radio_checked = false;
+                        $('#submit-button').click();
+                    });
+                    return false;
+                }
+            })
+
             //为表单绑定事件
             Form.api.bindevent($("#become-an-editor-form"), function (data, ret) {
-                // setTimeout(function () {
-                //     location.href = ret.url ? ret.url : "/";
-                // }, 6000);
+                setTimeout(function () {
+                    // location.reload();
+                }, 2000);
             }, function (data) {
                 // $("input[name=captcha]").next(".input-group-btn").find("img").trigger("click");
             });
@@ -1913,7 +1941,7 @@ define(['jquery', 'bootstrap', 'frontend', 'form', 'template'], function ($, und
             //为表单绑定事件
             Form.api.bindevent($("#review-comments-form"), function (data, ret) {
                 setTimeout(function () {
-                    location.href = "/index/user/display_submitted";
+                    location.href = window.history.go(-1);
                 }, 2000);
             }, function (data) {
 
@@ -1928,7 +1956,7 @@ define(['jquery', 'bootstrap', 'frontend', 'form', 'template'], function ($, und
             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";
+                    location.href = window.history.go(-1);
                 });
             } else {
                 $('#submit-button').prop('disabled', false);
@@ -1948,7 +1976,7 @@ define(['jquery', 'bootstrap', 'frontend', 'form', 'template'], function ($, und
             //为表单绑定事件
             Form.api.bindevent($("#invite-editor-form"), function (data, ret) {
                 setTimeout(function () {
-                    location.href = "/index/user/editing_manuscripts";
+                    location.href = window.history.go(-1);
                 }, 2000);
             }, function (data) {