Explorar el Código

修改手稿必填项错误

夏海 hace 1 año
padre
commit
3e717a72d4

+ 9 - 0
application/admin/controller/cms/Manuscript.php

@@ -144,6 +144,15 @@ class Manuscript extends Backend
             }
             $params['editor_ids'] = implode(',', $params['editor_ids']);
             $result = $row->allowField(true)->save($params);
+
+            // 添加手稿状态日志
+            $log = new \app\admin\model\cms\ManuscriptLog();
+            $log->manuscript_id = $ids;
+            $log->user_id = $this->auth->id;
+            $log->type = 'admin';
+            $log->status = $params['status'];
+            $log->save();
+
             Db::commit();
         } catch (ValidateException|PDOException|Exception $e) {
             Db::rollback();

+ 69 - 0
application/admin/controller/cms/ManuscriptLog.php

@@ -0,0 +1,69 @@
+<?php
+
+namespace app\admin\controller\cms;
+
+use app\admin\model\Admin;
+use app\admin\model\User;
+use app\common\controller\Backend;
+
+/**
+ * 搜索引擎记录管理
+ *
+ * @icon fa fa-circle-o
+ */
+class ManuscriptLog extends Backend
+{
+
+    /**
+     * ManuscriptLog模型对象
+     * @var \app\admin\model\cms\ManuscriptLog
+     */
+    protected $model = null;
+    protected $searchFields = 'id';
+
+    public function _initialize()
+    {
+        parent::_initialize();
+        $this->model = new \app\admin\model\cms\ManuscriptLog();
+        $site_manuscript_status = config('site.manuscript_status');
+        $this->assignconfig('site_manuscript_status', $site_manuscript_status);
+    }
+
+
+    /**
+     * 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个基础方法、destroy/restore/recyclebin三个回收站方法
+     * 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑
+     * 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改
+     */
+
+    public function index()
+    {
+        $this->relationSearch = true;
+        //设置过滤方法
+        $this->request->filter(['strip_tags', 'trim']);
+        if (false === $this->request->isAjax()) {
+            return $this->view->fetch();
+        }
+        //如果发送的来源是 Selectpage,则转发到 Selectpage
+        if ($this->request->request('keyField')) {
+            return $this->selectpage();
+        }
+        [$where, $sort, $order, $offset, $limit] = $this->buildparams();
+        $list = $this->model
+            ->with(['manuscript'])
+            ->where($where)
+            ->order($sort, $order)
+            ->paginate($limit);
+
+        foreach ($list as $value) {
+            $user = Admin::where(['id' => $value['user_id']])->find();
+            if ($value['type'] == 'user') {
+                $user = User::where(['id' => $value['user_id']])->find();
+            }
+            $value['user'] = $user;
+        }
+
+        $result = ['total' => $list->total(), 'rows' => $list->items()];
+        return json($result);
+    }
+}

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

@@ -15,6 +15,7 @@ class User extends Backend
 
     protected $relationSearch = true;
     protected $searchFields = 'id,username,nickname';
+    protected $noNeedRight = ['getAuthorList'];
 
     /**
      * @var \app\admin\model\User

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

@@ -134,7 +134,7 @@ return [
     'Jump now'                                              => '立即跳转',
     'Click to search %s'                                    => '点击搜索 %s',
     'Click to toggle'                                       => '点击切换',
-    'Operation completed'                                   => '操作成功!',
+    'Operation completed'                                   => 'Operation completed!',
     'Operation failed'                                      => '操作失败!',
     'Unknown data format'                                   => '未知的数据格式!',
     'Network error'                                         => '网络错误!',

+ 1 - 1
application/admin/lang/zh-cn/addon.php

@@ -89,7 +89,7 @@ return [
     'Continue operate'                                        => '继续操作',
     'Install successful'                                      => '安装成功',
     'Uninstall successful'                                    => '卸载成功',
-    'Operate successful'                                      => '操作成功',
+    'Operate successful'                                      => 'Operation completed',
     'Import successful'                                       => '导入测试数据成功!清除浏览器缓存和框架缓存后生效!',
     'Initialize successful'                                   => '初始化成功',
     'Initialize template not found'                           => '初始化模板未找到',

+ 11 - 0
application/admin/lang/zh-cn/cms/manuscript_log.php

@@ -0,0 +1,11 @@
+<?php
+
+return [
+    'Manuscript_id' => '手稿',
+    'User_Id' => '用户',
+    'Type' => '类型',
+    'User' => '用户',
+    'Admin' => '后台',
+    'Createtime' => '创建时间',
+    'Status'     => '状态'
+];

+ 23 - 0
application/admin/model/cms/ManuscriptLog.php

@@ -0,0 +1,23 @@
+<?php
+
+namespace app\admin\model\cms;
+
+use think\Model;
+
+class ManuscriptLog extends Model
+{
+    // 表名
+    protected $name = 'cms_manuscript_status_log';
+
+    // 自动写入时间戳字段
+    protected $autoWriteTimestamp = 'int';
+
+    // 定义时间戳字段名
+    protected $createTime = 'createtime';
+    protected $updateTime = 'updatetime';
+
+    public function manuscript()
+    {
+        return $this->belongsTo("\app\admin\model\cms\AuthorManuscript", 'manuscript_id', 'id', [], 'LEFT')->setEagerlyType(0);
+    }
+}

+ 28 - 28
application/admin/view/cms/archives/add.html

@@ -29,26 +29,26 @@
                                     </select>
                                 </div>
                             </div>
-                            <div class="form-group" data-field="channel_ids">
-                                <label for="c-channel_ids" class="control-label col-xs-12 col-sm-2">{:__('Channel_ids')}</label>
-                                <div class="col-xs-12 col-sm-8">
-                                    <select id="c-channel_ids" data-rule="" class="form-control selectpicker" multiple data-live-search="true" name="row[channel_ids][]">
-                                        {$secondChannelOptions}
-                                    </select>
-                                </div>
-                            </div>
+<!--                            <div class="form-group" data-field="channel_ids">-->
+<!--                                <label for="c-channel_ids" class="control-label col-xs-12 col-sm-2">{:__('Channel_ids')}</label>-->
+<!--                                <div class="col-xs-12 col-sm-8">-->
+<!--                                    <select id="c-channel_ids" data-rule="" class="form-control selectpicker" multiple data-live-search="true" name="row[channel_ids][]">-->
+<!--                                        {$secondChannelOptions}-->
+<!--                                    </select>-->
+<!--                                </div>-->
+<!--                            </div>-->
                             <div class="form-group" data-field="special_ids">
                                 <label for="c-manuscript_id" class="control-label col-xs-12 col-sm-2">{:__('Manuscript_id')}</label>
                                 <div class="col-xs-12 col-sm-8">
                                     <input id="c-manuscript_id" type="text" class="form-control selectpage" data-source="cms/manuscript/index" placeholder="所属手稿,可为空" data-field="title" name="row[manuscript_id]"/>
                                 </div>
                             </div>
-                            <div class="form-group" data-field="user_id">
-                                <label for="c-user_id" class="control-label col-xs-12 col-sm-2">{:__('User_id')}</label>
-                                <div class="col-xs-12 col-sm-8">
-                                    <input id="c-user_id" type="text" class="form-control selectpage" data-source="user/user/index" placeholder="发布会员,可为空" data-field="nickname" name="row[user_id]"/>
-                                </div>
-                            </div>
+<!--                            <div class="form-group" data-field="user_id">-->
+<!--                                <label for="c-user_id" class="control-label col-xs-12 col-sm-2">{:__('User_id')}</label>-->
+<!--                                <div class="col-xs-12 col-sm-8">-->
+<!--                                    <input id="c-user_id" type="text" class="form-control selectpage" data-source="user/user/index" placeholder="发布会员,可为空" data-field="nickname" name="row[user_id]"/>-->
+<!--                                </div>-->
+<!--                            </div>-->
                             <div class="form-group" data-field="user_id">
                                 <label for="c-author_ids" class="control-label col-xs-12 col-sm-2">{:__('Author_ids')}</label>
                                 <div class="col-xs-12 col-sm-8">
@@ -133,24 +133,24 @@
                                     </div>
                                 </div>
                             </div>
-                            <div class="form-group" data-field="price">
-                                <div class="control-label col-xs-12 col-sm-2">{:__('Price')}</div>
-                                <div class="col-xs-12 col-sm-8">
-                                    <input type="number" name="row[price]" id="c-price" value="0" class="form-control" data-tip="" data-rule="">
-                                </div>
-                            </div>
+<!--                            <div class="form-group" data-field="price">-->
+<!--                                <div class="control-label col-xs-12 col-sm-2">{:__('Price')}</div>-->
+<!--                                <div class="col-xs-12 col-sm-8">-->
+<!--                                    <input type="number" name="row[price]" id="c-price" value="0" class="form-control" data-tip="" data-rule="">-->
+<!--                                </div>-->
+<!--                            </div>-->
                             <div class="form-group" data-field="outlink">
                                 <div class="control-label col-xs-12 col-sm-2">{:__('Outlink')}</div>
                                 <div class="col-xs-12 col-sm-8">
                                     <input type="text" name="row[outlink]" id="c-outlink" value="" class="form-control" data-tip="" data-rule="" placeholder="只有当需要跳转到外部链接时才需填写">
                                 </div>
                             </div>
-                            <div class="form-group" data-field="seotitle">
-                                <label for="c-seotitle" class="control-label col-xs-12 col-sm-2">{:__('Seotitle')}</label>
-                                <div class="col-xs-12 col-sm-8">
-                                    <input id="c-seotitle" data-rule="" class="form-control" name="row[seotitle]" type="text" value="" placeholder="为空时将使用文档标题">
-                                </div>
-                            </div>
+<!--                            <div class="form-group" data-field="seotitle">-->
+<!--                                <label for="c-seotitle" class="control-label col-xs-12 col-sm-2">{:__('Seotitle')}</label>-->
+<!--                                <div class="col-xs-12 col-sm-8">-->
+<!--                                    <input id="c-seotitle" data-rule="" class="form-control" name="row[seotitle]" type="text" value="" placeholder="为空时将使用文档标题">-->
+<!--                                </div>-->
+<!--                            </div>-->
                             <div class="form-group" data-field="keywords">
                                 <label for="c-keywords" class="control-label col-xs-12 col-sm-2">{:__('Keywords')}</label>
                                 <div class="col-xs-12 col-sm-8">
@@ -173,9 +173,9 @@
                                             <span><button type="button" id="fachoose-image" class="btn btn-primary fachoose" data-maxsize="10M" data-input-id="c-pdf" data-mimetype="*" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
                                         </div>
                                         <span class="msg-box n-right" for="c-pdf"></span>
-                                        <span  class="msg-box" style="color: #f00;line-height: 25px">File size:Not greater than 10M</span>
                                     </div>
                                     <ul class="row list-inline plupload-preview" id="p-pdf"></ul>
+                                    <span  class="msg-box" style="color: #f00;line-height: 25px">File size:Not greater than 10M</span>
                                 </div>
                             </div>
                             <div class="form-group" data-field="image">
@@ -203,9 +203,9 @@
                                             <span><button type="button" id="fachoose-image" class="btn btn-primary fachoose" data-maxsize="10M" data-input-id="c-xml" data-mimetype="*" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
                                         </div>
                                         <span class="msg-box n-right" for="c-xml"></span>
-                                        <span  class="msg-box" style="color: #f00;line-height: 25px">File size:Not greater than 10M</span>
                                     </div>
                                     <ul class="row list-inline plupload-preview" id="p-xml"></ul>
+                                    <span  class="msg-box" style="color: #f00;line-height: 25px">File size:Not greater than 10M</span>
                                 </div>
                             </div>
                             <div class="form-group" data-field="image">

+ 26 - 26
application/admin/view/cms/archives/edit.html

@@ -30,26 +30,26 @@
                                     </select>
                                 </div>
                             </div>
-                            <div class="form-group" data-field="channel_ids">
-                                <label for="c-channel_ids" class="control-label col-xs-12 col-sm-2">{:__('Channel_ids')}</label>
-                                <div class="col-xs-12 col-sm-8">
-                                    <select id="c-channel_ids" data-rule="" class="form-control selectpicker" multiple data-live-search="true" name="row[channel_ids][]">
-                                        {$secondChannelOptions}
-                                    </select>
-                                </div>
-                            </div>
+<!--                            <div class="form-group" data-field="channel_ids">-->
+<!--                                <label for="c-channel_ids" class="control-label col-xs-12 col-sm-2">{:__('Channel_ids')}</label>-->
+<!--                                <div class="col-xs-12 col-sm-8">-->
+<!--                                    <select id="c-channel_ids" data-rule="" class="form-control selectpicker" multiple data-live-search="true" name="row[channel_ids][]">-->
+<!--                                        {$secondChannelOptions}-->
+<!--                                    </select>-->
+<!--                                </div>-->
+<!--                            </div>-->
                             <div class="form-group" data-field="special_ids">
                                 <label for="c-manuscript_id" class="control-label col-xs-12 col-sm-2">{:__('Manuscript_id')}</label>
                                 <div class="col-xs-12 col-sm-8">
                                     <input id="c-manuscript_id" type="text" class="form-control selectpage" data-source="cms/manuscript/index" placeholder="所属手稿,可为空" data-field="title" name="row[manuscript_id]" value="{$row.manuscript_id}"/>
                                 </div>
                             </div>
-                            <div class="form-group" data-field="user_id">
-                                <label for="c-user_id" class="control-label col-xs-12 col-sm-2">{:__('User_id')}</label>
-                                <div class="col-xs-12 col-sm-8">
-                                    <input id="c-user_id" type="text" class="form-control selectpage" data-source="user/user/index" placeholder="发布会员,可为空" data-field="nickname" name="row[user_id]" value="{$row.user_id}"/>
-                                </div>
-                            </div>
+<!--                            <div class="form-group" data-field="user_id">-->
+<!--                                <label for="c-user_id" class="control-label col-xs-12 col-sm-2">{:__('User_id')}</label>-->
+<!--                                <div class="col-xs-12 col-sm-8">-->
+<!--                                    <input id="c-user_id" type="text" class="form-control selectpage" data-source="user/user/index" placeholder="发布会员,可为空" data-field="nickname" name="row[user_id]" value="{$row.user_id}"/>-->
+<!--                                </div>-->
+<!--                            </div>-->
                             <div class="form-group" data-field="user_id">
                                 <label for="c-author_ids" class="control-label col-xs-12 col-sm-2">{:__('Author_ids')}</label>
                                 <div class="col-xs-12 col-sm-8">
@@ -134,24 +134,24 @@
                                     </div>
                                 </div>
                             </div>
-                            <div class="form-group" data-field="price">
-                                <label for="c-price" class="control-label col-xs-12 col-sm-2">{:__('Price')}</label>
-                                <div class="col-xs-12 col-sm-8">
-                                    <input type="number" name="row[price]" id="c-price" value="{$row.price}" class="form-control" data-tip="" data-rule="">
-                                </div>
-                            </div>
+<!--                            <div class="form-group" data-field="price">-->
+<!--                                <label for="c-price" class="control-label col-xs-12 col-sm-2">{:__('Price')}</label>-->
+<!--                                <div class="col-xs-12 col-sm-8">-->
+<!--                                    <input type="number" name="row[price]" id="c-price" value="{$row.price}" class="form-control" data-tip="" data-rule="">-->
+<!--                                </div>-->
+<!--                            </div>-->
                             <div class="form-group" data-field="outlink">
                                 <label for="c-outlink" class="control-label col-xs-12 col-sm-2">{:__('Outlink')}</label>
                                 <div class="col-xs-12 col-sm-8">
                                     <input type="text" name="row[outlink]" id="c-outlink" value="{$row.outlink|htmlentities}" class="form-control" data-tip="" data-rule="" placeholder="只有当需要跳转到外部链接时才需填写">
                                 </div>
                             </div>
-                            <div class="form-group" data-field="seotitle">
-                                <label for="c-seotitle" class="control-label col-xs-12 col-sm-2">{:__('Seotitle')}</label>
-                                <div class="col-xs-12 col-sm-8">
-                                    <input id="c-seotitle" data-rule="" class="form-control" name="row[seotitle]" type="text" value="{$row.seotitle|htmlentities}" placeholder="为空时将使用文档标题">
-                                </div>
-                            </div>
+<!--                            <div class="form-group" data-field="seotitle">-->
+<!--                                <label for="c-seotitle" class="control-label col-xs-12 col-sm-2">{:__('Seotitle')}</label>-->
+<!--                                <div class="col-xs-12 col-sm-8">-->
+<!--                                    <input id="c-seotitle" data-rule="" class="form-control" name="row[seotitle]" type="text" value="{$row.seotitle|htmlentities}" placeholder="为空时将使用文档标题">-->
+<!--                                </div>-->
+<!--                            </div>-->
                             <div class="form-group" data-field="keywords">
                                 <label for="c-keywords" class="control-label col-xs-12 col-sm-2">{:__('Keywords')}</label>
                                 <div class="col-xs-12 col-sm-8">

+ 0 - 82
application/admin/view/cms/manuscript/edit.html

@@ -330,88 +330,6 @@
             </div>
         </div>
 
-        <div class="form-group required">
-            <label for="c-article_three" class="control-label col-xs-12 col-sm-2">{:__('Country/Temitory')}:</label>
-            <div class="col-xs-12 col-sm-7">
-                <select id="c-country" data-rule="required" class="form-control" name="row[country]" readonly="">
-                    <option value="">Please select</option>
-                    {foreach name="site.country" item="vo"}
-                    <option value="{$key}" {in name="key" value="$row.country" }selected{/in}>{$vo}</option>
-                    {/foreach}
-                </select>
-            </div>
-        </div>
-
-        <div class="form-group required">
-            <label for="c-article_three" class="control-label col-xs-12 col-sm-2">{:__('Affiliation')}:</label>
-            <div class="col-xs-12 col-sm-7">
-                <input type="text" data-rule="required" class="form-control" id="c-affiliation" name="row[affiliation]" value="{$row.affiliation|htmlentities}" placeholder="Type here..." readonly>
-            </div>
-        </div>
-
-        <div class="form-group required">
-            <label for="c-article_three" class="control-label col-xs-12 col-sm-2">{:__('Name')}:</label>
-            <div class="col-xs-12 col-sm-7">
-                <input type="text" data-rule="required" class="form-control" id="c-name" name="row[name]" value="{$row.name|htmlentities}" placeholder="Type here..." readonly>
-            </div>
-        </div>
-
-        <div class="form-group required">
-            <label for="c-article_three" class="control-label col-xs-12 col-sm-2">{:__('Invoice Email')}:</label>
-            <div class="col-xs-12 col-sm-7">
-                <input type="text" data-rule="required" class="form-control" id="c-invoice-email" name="row[invoice_email]" value="{$row.invoice_email|htmlentities}" placeholder="Type here..." readonly>
-            </div>
-        </div>
-
-        <div class="form-group required">
-            <label for="c-article_three" class="control-label col-xs-12 col-sm-2">{:__('Order Email')}:</label>
-            <div class="col-xs-12 col-sm-7">
-                <input type="text" data-rule="required" class="form-control" id="c-order-email" name="row[order_email]" value="{$row.order_email|htmlentities}" placeholder="Type here..." readonly>
-            </div>
-        </div>
-
-        <div class="form-group required">
-            <label for="c-article_three" class="control-label col-xs-12 col-sm-2">{:__('Address')}:</label>
-            <div class="col-xs-12 col-sm-7">
-                <input type="text" data-rule="required" class="form-control" id="c-address" name="row[address]" value="{$row.address|htmlentities}" placeholder="Type here..." readonly>
-            </div>
-        </div>
-
-        <div class="form-group required">
-            <label for="c-article_three" class="control-label col-xs-12 col-sm-2">{:__('Zip Code')}:</label>
-            <div class="col-xs-12 col-sm-7">
-                <input type="text" data-rule="required" class="form-control" id="c-zip-code" name="row[zip_code]" value="{$row.zip_code|htmlentities}" placeholder="Type here..." readonly>
-            </div>
-        </div>
-
-        <div class="form-group required">
-            <label for="c-article_three" class="control-label col-xs-12 col-sm-2">{:__('City')}:</label>
-            <div class="col-xs-12 col-sm-7">
-                <input type="text" data-rule="required" class="form-control" id="c-city" name="row[city]" value="{$row.city|htmlentities}" placeholder="Type here..." readonly>
-            </div>
-        </div>
-
-        <div class="form-group required">
-            <label for="c-article_three" class="control-label col-xs-12 col-sm-2">{:__('Telephone')}:</label>
-            <div class="col-xs-12 col-sm-7">
-                <input type="text" class="form-control" id="c-telephone" name="row[telephone]" value="{$row.telephone|htmlentities}" placeholder="Type here..." readonly>
-            </div>
-        </div>
-
-        <div class="form-group required">
-            <label for="c-article_three" class="control-label col-xs-12 col-sm-2">{:__('Fax')}:</label>
-            <div class="col-xs-12 col-sm-7">
-                <input type="text" class="form-control" id="c-fax" name="row[fax]" value="{$row.fax|htmlentities}" placeholder="Type here..." readonly>
-            </div>
-        </div>
-
-        <div class="form-group required">
-            <label for="c-article_three" class="control-label col-xs-12 col-sm-2">{:__('VAT')}:</label>
-            <div class="col-xs-12 col-sm-7">
-                <input type="text" class="form-control" id="c-vat" name="row[vat]" value="{$row.vat|htmlentities}" placeholder="Type here..." readonly>
-            </div>
-        </div>
-
         <div class="form-button">
             <input type="button" name="previous" class="previous action-button-previous" value="上一步">
             <input type="button" name="Submit" class="disabled Submit action-button submit-button" value="完成设置">

+ 32 - 0
application/admin/view/cms/manuscript_log/add.html

@@ -0,0 +1,32 @@
+<form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
+
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Keywords')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-keywords" class="form-control" name="row[keywords]" type="text" value="">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Nums')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-nums" min="0" class="form-control" name="row[nums]" type="number" value="0">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <div class="radio">
+                {foreach name="statusList" item="vo"}
+                <label for="row[status]-{$key}"><input id="row[status]-{$key}" name="row[status]" type="radio" value="{$key}" {in name="key" value="normal"}checked{/in} /> {$vo}</label>
+                {/foreach}
+            </div>
+        </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>

+ 32 - 0
application/admin/view/cms/manuscript_log/edit.html

@@ -0,0 +1,32 @@
+<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
+
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Keywords')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-keywords" class="form-control" name="row[keywords]" type="text" value="{$row.keywords|htmlentities}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Nums')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-nums" min="0" class="form-control" name="row[nums]" type="number" value="{$row.nums|htmlentities}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <div class="radio">
+                {foreach name="statusList" item="vo"}
+                <label for="row[status]-{$key}"><input id="row[status]-{$key}" name="row[status]" type="radio" value="{$key}" {in name="key" value="$row.status" }checked{/in} /> {$vo}</label>
+                {/foreach}
+            </div>
+        </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>

+ 21 - 0
application/admin/view/cms/manuscript_log/index.html

@@ -0,0 +1,21 @@
+<div class="panel panel-default panel-intro">
+    {:build_heading()}
+
+    <div class="panel-body">
+        <div id="myTabContent" class="tab-content">
+            <div class="tab-pane fade active in" id="one">
+                <div class="widget-body no-padding">
+                    <div id="toolbar" class="toolbar">
+                        <a href="javascript:;" class="btn btn-primary btn-refresh" title="{:__('Refresh')}" ><i class="fa fa-refresh"></i> </a>
+
+                    </div>
+                    <table id="table" class="table table-striped table-bordered table-hover table-nowrap"
+                           data-operate-del="{:$auth->check('cms/manuscript_log/del')}"
+                           width="100%">
+                    </table>
+                </div>
+            </div>
+
+        </div>
+    </div>
+</div>

+ 58 - 24
application/api/controller/User.php

@@ -9,6 +9,7 @@ use app\admin\model\cms\Conference;
 use app\admin\model\cms\Email;
 use app\admin\model\cms\InviteReviewer;
 use app\admin\model\cms\Issue;
+use app\admin\model\cms\ManuscriptLog;
 use app\admin\model\cms\Participate;
 use app\admin\model\EmailContent;
 use app\common\controller\Api;
@@ -490,29 +491,12 @@ class User extends Api
         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 (!$params['reviewer']) $this->error('Reviewer Cannot be Empty');
-        // 添加
-        if (!$params['id']) {
-            $result = false;
-            Db::startTrans();
-            try {
-                $params['user_id'] = $this->auth->id;
-
-                // 数组内容需转换为字符串
-                $params['author_content'] = json_encode($params['author']);
-                $params['review_content'] = json_encode($params['reviewer']);
+        if (array_key_exists('reviewer', $params)) {
+            if (!$params['reviewer']) $this->error('Reviewer Cannot be Empty');
+        }
 
-                $model = new AuthorManuscript();
-                $result = $model->allowField(true)->save($params);
-                Db::commit();
-            } catch (ValidateException|PDOException|Exception $e) {
-                Db::rollback();
-                $this->error($e->getMessage());
-            }
-            if ($result === false) {
-                $this->error('No rows were inserted');
-            }
-        } else {
+        // 修改
+        if ($params['id']) {
             // 修改操作
             $row = AuthorManuscript::where(['id' => $params['id']])->find();
             if (empty($row)) $this->error('Submit Failed');
@@ -520,7 +504,25 @@ class User extends Api
             try {
                 // 数组内容需转换为字符串
                 $params['author_content'] = json_encode($params['author']);
-                $params['review_content'] = json_encode($params['reviewer']);
+                if (array_key_exists('reviewer', $params)) {
+                    $params['review_content'] = json_encode($params['reviewer']);
+                }
+
+                // 如果修改时状态是未编辑完得状态  提交后则修改完处理中状态
+                if ($row['status'] == 'incomplete_submission') {
+                    $params['status'] = 'processing';
+                }
+
+                // 手稿状态日志
+                $log = ManuscriptLog::where(['manuscript_id' => $params['id'], 'user_id' => $this->auth->id, 'type' => 'user', 'status' => $params['status']])->find();
+                if (!$log) {
+                    $log = new ManuscriptLog();
+                    $log->manuscript_id = $params['id'];
+                    $log->user_id = $this->auth->id;
+                    $log->type = 'user';
+                }
+                $log->status = $params['status'];
+                $log->save();
 
                 $result = $row->allowField(true)->save($params);
                 Db::commit();
@@ -548,7 +550,27 @@ class User extends Api
         Db::startTrans();
         try {
             $params['user_id'] = $this->auth->id;
+
+            // 获取手稿
+            $manuscript = AuthorManuscript::where(['id' => $params['manuscript_id']])->find();
+            if ($manuscript) {
+                $manuscript['status'] = $params['status'];
+                $manuscript->save();
+            }
+
             $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->user_id = $this->auth->id;
+                $log->type = 'user';
+            }
+            $log->status = $params['status'];
+            $log->save();
+
             Db::commit();
         } catch (ValidateException|PDOException|Exception $e) {
             Db::rollback();
@@ -625,7 +647,7 @@ class User extends Api
             // 去重数组
             $unique_reviewer_ids_arr = array_filter(array_unique($merged_reviewer_ids_arr));
             $manuscript['reviewer_ids'] = implode(',', $unique_reviewer_ids_arr);
-//            $manuscript['status'] =
+            $manuscript['status'] = $params['status'];
             $result = $manuscript->save();
             Db::commit();
         } catch (ValidateException|PDOException|Exception $e) {
@@ -857,6 +879,18 @@ class User extends Api
             } else {
                 $manuscript = $manuscript->allowField(true)->create($params);
             }
+
+            // 手稿状态日志
+            $log = ManuscriptLog::where(['manuscript_id' => $params['id'], 'user_id' => $this->auth->id, 'type' => 'user', 'status' => $params['status']])->find();
+            if (!$log) {
+                $log = new ManuscriptLog();
+                $log->manuscript_id = $params['id'];
+                $log->user_id = $this->auth->id;
+                $log->type = 'user';
+            }
+            $log->status = $params['status'];
+            $log->save();
+
             Db::commit();
         } catch (ValidateException|PDOException|Exception $e) {
             Db::rollback();

+ 1 - 1
application/api/lang/zh-cn.php

@@ -88,7 +88,7 @@ return [
     'Server responded with %s code'                  => '服务端响应(Code:%s)',
     'File is too big (%sMiB), Max filesize: %sMiB'   => '当前上传(%sM),最大允许上传文件大小:%sM',
     'Redirect now'                                   => '立即跳转',
-    'Operation completed'                            => '操作成功!',
+    'Operation completed'                            => 'Operation completed!',
     'Operation failed'                               => '操作失败!',
     'Unknown data format'                            => '未知的数据格式!',
     'Network error'                                  => '网络错误!',

+ 1 - 1
application/common/lang/zh-cn/addon.php

@@ -83,7 +83,7 @@ return [
     'Please login first'                          => '请登录后再操作',
     'Send verification code'                      => '发送验证码',
     'Redirect now'                                => '立即跳转',
-    'Operation completed'                         => '操作成功!',
+    'Operation completed'                         => 'Operation completed!',
     'Operation failed'                            => '操作失败!',
     'Unknown data format'                         => '未知的数据格式!',
     'Network error'                               => '网络错误!',

+ 0 - 1
application/extra/site.php

@@ -131,7 +131,6 @@ return array (
   ),
   'edit_manuscript_status' => 
   array (
-    'all' => 'All',
     'submit' => 'Submit',
     'accept' => 'Accept',
     'rejected' => 'Rejected',

+ 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',
+    'mimetype'  => 'jpg,png,bmp,jpeg,gif,webp,zip,rar,wav,mp4,mp3,webm,pdf,xlsx,doc,docx',
     /**
      * 是否支持批量上传
      */

+ 10 - 4
application/index/controller/User.php

@@ -526,7 +526,7 @@ class User extends Frontend
     public function show_reviewed_manuscripts()
     {
         $limit = $this->request->param('limit', 10);
-        $status = $this->request->param('status', '');
+        $status = $this->request->param('status', 'comment_submission');
         $where = ['status' => $status];
         // 查询当前用户手稿
         $manuscripts = AuthorManuscript::whereRaw("FIND_IN_SET(". $this->auth->id .", `reviewer_ids`)")
@@ -586,12 +586,14 @@ class User extends Frontend
                             ->order('createtime', 'DESC')
                             ->find();
                         $reviewer_user = \app\admin\model\User::where(['id' => $reviewer_role['user_id']])->find();
+                        if ($reviewer_comment) {
+                            $reviewer['reply_time'] = date('Y-m-d', $reviewer_comment['createtime'] ?? time());
+                            $reviewer['submission_time'] = date('Y-m-d', $reviewer_comment['createtime'] ?? time());
+                            $reviewer['status'] = $reviewer_comment['recommendation'] ?? '';
+                        }
                     }
                     $reviewer['nickname'] = $reviewer_user['nickname'];
                     $reviewer['invited_time'] = date('Y-m-d', $reviewer['createtime']);
-                    $reviewer['reply_time'] = date('Y-m-d', $reviewer_comment['createtime'] ?? '');
-                    $reviewer['submission_time'] = date('Y-m-d', $reviewer_comment['createtime'] ?? '');
-                    $reviewer['status'] = $reviewer_comment['recommendation'] ?? '';
                 }
             }
 
@@ -647,7 +649,9 @@ class User extends Frontend
         $id = $this->request->param('id');
         $type = $this->request->param('type');
         $row = Comments::where(['manuscript_id' => $id, 'type' => $type])->find();
+        $manuscript = AuthorManuscript::where(['id' => $id])->find();
         $this->view->assign('row', $row);
+        $this->view->assign('manuscript', $manuscript);
         $this->view->assign('id', $id);
         $this->view->assign('type', $type);
         $this->view->assign('title', 'Conduct Review');
@@ -745,10 +749,12 @@ class User extends Frontend
         $id = $this->request->param('id');
         $type = $this->request->param('type');
         $row = Comments::where(['manuscript_id' => $id, 'type' => $type, 'user_id' => $this->auth->id])->find();
+        $manuscript = AuthorManuscript::where(['id' => $id])->find();
         if (empty($row)) {
             $row['is_interest'] = '';
         }
         $this->view->assign('row', $row);
+        $this->view->assign('manuscript', $manuscript);
         $this->view->assign('id', $id);
         $this->view->assign('type', $type);
         $this->view->assign('title', 'Submit Handing Suggestions');

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

@@ -130,7 +130,7 @@ return [
     'File is too big (%sMiB), Max filesize: %sMiB'           => '当前上传(%sM),最大允许上传文件大小:%sM',
     'Send verification code'                                 => '发送验证码',
     'Redirect now'                                           => '立即跳转',
-    'Operation completed'                                    => '操作成功!',
+    'Operation completed'                                    => 'Operation completed!',
     'Operation failed'                                       => '操作失败!',
     'Unknown data format'                                    => '未知的数据格式!',
     'Network error'                                          => '网络错误!',

+ 3 - 3
application/index/view/user/article_details.html

@@ -246,9 +246,9 @@
                                             <tr>
                                                 <td>{$reviewer.nickname}</td>
                                                 <td>{$reviewer.invited_time}</td>
-                                                <td>{$reviewer.reply_time}</td>
-                                                <td>{$reviewer.submission_time}</td>
-                                                <td>{$reviewer.status}</td>
+                                                <td>{$reviewer.reply_time ?? ''}</td>
+                                                <td>{$reviewer.submission_time ?? ''}</td>
+                                                <td>{$reviewer.status ?? ''}</td>
                                             </tr>
                                             {/foreach}
                                             </tbody>

+ 15 - 1
application/index/view/user/conduct_review.html

@@ -28,7 +28,7 @@
                                 <div class="col-xs-12 col-sm-8">
                                     <select id="c-recommendation" class="form-control" name="row[recommendation]">
                                         <option value="">Please select</option>
-                                        {foreach name="site.country" item="vo"}
+                                        {foreach name="site.recommendation_list" item="vo"}
                                         <option value="{$key}" {in name="key" value="$row.recommendation|default=''|htmlentities" }selected{/in}>{$vo}</option>
                                         {/foreach}
                                     </select>
@@ -60,6 +60,20 @@
                                     <ul class="row list-inline plupload-preview" id="p-file"></ul>
                                 </div>
                             </div>
+
+                            <div class="form-group">
+                                <label class="control-label col-xs-12 col-sm-4">
+                                    Manuscript Status:
+                                </label>
+                                <div class="col-xs-12 col-sm-8">
+                                    <select id="c-status" class="form-control" name="row[status]">
+                                        <option value="">Please select</option>
+                                        {foreach name="site.reviewer_manuscript_status" item="vo"}
+                                        <option value="{$key}" {in name="key" value="$manuscript.status"}selected{/in}>{$vo}</option>
+                                        {/foreach}
+                                    </select>
+                                </div>
+                            </div>
                         </div>
 
                         <div class="form-group normal-footer">

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

@@ -29,6 +29,7 @@
 
                     <nav aria-label="breadcrumb" class="breadcrumb-content">
                         <ol class="breadcrumb">
+                            <li class="breadcrumb-item <?php if($status == 'all') echo 'active'; ?>"><a href="?status=all">All</a></li>
                             {foreach name="$site.edit_manuscript_status" item="item"}
                             <li class="breadcrumb-item <?php if($status == $key) echo 'active'; ?>"><a href="?status={$key}">{$item}</a></li>
                             {/foreach}

+ 14 - 0
application/index/view/user/handing_suggestions.html

@@ -95,6 +95,20 @@
                             </div>
                         </div>
 
+                        <div class="form-group">
+                            <label class="control-label col-xs-12 col-sm-4">
+                                Manuscript Status:
+                            </label>
+                            <div class="col-xs-12 col-sm-8">
+                                <select id="c-status" class="form-control" name="row[status]">
+                                    <option value="">Please select</option>
+                                    {foreach name="site.edit_manuscript_status" item="vo"}
+                                    <option value="{$key}" {in name="key" value="$manuscript.status"}selected{/in}>{$vo}</option>
+                                    {/foreach}
+                                </select>
+                            </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">

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

@@ -52,7 +52,7 @@
                             <input type="hidden" name="row[manuscript_id]" value="{$id}">
                             <div class="form-group">
                                 <label class="control-label col-xs-12 col-sm-4">
-                                    My recommendation
+                                    Manuscript Status
                                 </label>
                                 <div class="col-xs-12 col-sm-8">
                                     <select id="c-status" class="form-control" name="row[status]">

+ 55 - 0
public/assets/js/backend/cms/manuscript_log.js

@@ -0,0 +1,55 @@
+define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
+
+    var Controller = {
+        index: function () {
+            // 初始化表格参数配置
+            Table.api.init({
+                extend: {
+                    index_url: 'cms/manuscript_log/index' + location.search,
+                    add_url: '',
+                    edit_url: '',
+                    del_url: 'cms/manuscript_log/del',
+                    multi_url: 'cms/manuscript_log/multi',
+                    import_url: 'cms/manuscript_log/import',
+                    table: 'cms_manuscript_log',
+                }
+            });
+
+            var table = $("#table");
+
+            // 初始化表格
+            table.bootstrapTable({
+                url: $.fn.bootstrapTable.defaults.extend.index_url,
+                pk: 'id',
+                sortName: 'id',
+                columns: [
+                    [
+                        {checkbox: true},
+                        {field: 'id', title: __('Id')},
+                        {field: 'manuscript.title', title: __('Manuscript_id')},
+                        {field: 'user.nickname', title: __('User_id')},
+                        {field: 'type', title: __('Type'), searchList: {"user": __('User'), "admin": __('Admin')}, formatter: Table.api.formatter.status},
+                        {field: 'status', title: __('Status'), searchList: Config.site_manuscript_status,},
+                        {field: 'createtime', title: __('Createtime'), sortable: true, operate: 'RANGE', addclass: 'datetimerange', autocomplete: false, formatter: Table.api.formatter.datetime},
+                        {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
+                    ]
+                ]
+            });
+
+            // 为表格绑定事件
+            Table.api.bindevent(table);
+        },
+        add: function () {
+            Controller.api.bindevent();
+        },
+        edit: function () {
+            Controller.api.bindevent();
+        },
+        api: {
+            bindevent: function () {
+                Form.api.bindevent($("form[role=form]"));
+            }
+        }
+    };
+    return Controller;
+});

+ 77 - 14
public/assets/js/frontend/user.js

@@ -270,20 +270,6 @@ define(['jquery', 'bootstrap', 'frontend', 'form', 'template'], function ($, und
             $(document).ready(function () {
                 // 下一步按钮
                 $('.next-button').on('click', function () {
-                    // 规则验证
-                    $.validator.config({
-                        rules: {
-                            required: function (element) {
-                                if (element.value == "") {
-                                    is_next = false;
-                                    return false;
-                                } else {
-                                    is_next = true;
-                                }
-                            }
-                        }
-                    });
-
                     // 陈述内容可点击下一步按钮
                     if ($('.statement-content').css('display') == 'block') {
                         is_next = true;
@@ -294,6 +280,83 @@ define(['jquery', 'bootstrap', 'frontend', 'form', 'template'], function ($, und
                         is_next = true;
                     }
 
+                    // 判断当前页面的必填项是否都填写
+                    if (index == 0) {
+                        $("#c-manuscript-zip").trigger("validate");
+                        let manuscript_zip = $("#c-manuscript-zip").isValid();
+                        if(!manuscript_zip) {
+                            return true;
+                        }
+                    }
+                    // 手稿信息
+                    if (index == 1) {
+                        $("#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 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;
+                        }
+                        if (!journal) {
+                            return true;
+                        }
+                        if (!article_type) {
+                            return true;
+                        }
+                        if (!title) {
+                            return true;
+                        }
+                        if (!abstract) {
+                            return true;
+                        }
+                        if (!keywords) {
+                            return true;
+                        }
+                        if (!number_page) {
+                            return true;
+                        }
+                        is_next = true;
+                    }
+
+                    // 作者信息
+                    if (index == 2) {;
+                        for (let i = 0; i < $('.add-author-item').length; i++) {
+                            $("[name='row[author]["+ i +"][email]']").trigger("validate");
+                            $("[name='row[author]["+ i +"][first_name]']").trigger("validate");
+                            $("[name='row[author]["+ i +"][author_affiliation]']").trigger("validate");
+                            $("[name='row[author]["+ i +"][author_country]']").trigger("validate");
+                            let email = $("[name='row[author]["+ i +"][email]']").isValid();
+                            let first_name = $("[name='row[author]["+ i +"][first_name]']").isValid();
+                            let author_affiliation = $("[name='row[author]["+ i +"][author_affiliation]']").isValid();
+                            let author_country = $("[name='row[author]["+ i +"][author_country]']").isValid();
+
+                            if (!email) {
+                                return true;
+                            }
+                            if (!first_name) {
+                                return true;
+                            }
+                            if (!author_affiliation) {
+                                return true;
+                            }
+                            if (!author_country) {
+                                return true;
+                            }
+                        }
+                        is_next = true;
+                    }
+
                     if (is_next || index == 0) {
                         index++;
                         $("ul.nav-justified li").removeClass("active");