From fff01b40ce9eaf1c0978ee1122026194a63dadbb Mon Sep 17 00:00:00 2001 From: wlx Date: Fri, 1 Nov 2013 09:13:35 +0000 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=8F=82=E8=80=83=E6=96=87?= =?UTF-8?q?=E7=8C=AE=E6=A0=BC=E5=BC=8F=E7=94=9F=E6=88=90=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=EF=BC=9B=E4=BF=AE=E6=94=B9=E6=89=B9=E9=87=8F=E5=AF=BC=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/module/Reference/Reference.php | 2 +- application/module/Reference/Ris.php | 30 ++++++++++++---------- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/application/module/Reference/Reference.php b/application/module/Reference/Reference.php index ca7abfd6..bb9731dd 100644 --- a/application/module/Reference/Reference.php +++ b/application/module/Reference/Reference.php @@ -453,7 +453,7 @@ class Reference public function referenceType() { return array( - 0 => '相关文献', + 0 => '相关文献',//作者建议的文献或数据中心建议的文献 1 => '施引文献', 2 => '参考文献', 3 => '多篇文献', diff --git a/application/module/Reference/Ris.php b/application/module/Reference/Ris.php index 3b891373..c9432ddd 100644 --- a/application/module/Reference/Ris.php +++ b/application/module/Reference/Ris.php @@ -174,18 +174,20 @@ class Ris $results = $this->events()->trigger('checkLoad', $this, compact('ref')); $id = $results->bottom(); - $this->unsetVar($ref); + if ($id > 0) - { + { + $this->unsetVar($ref); $this->events()->trigger('deleteAuthor', $this, compact('id')); $this->events()->trigger('deleteTag', $this, compact('id')); unset($ref['reference']); $dbh->update($this->table->reference,$ref," id=$id "); - } else { - $ref['reference'] = $this->makeReferenceFlag($ref); + } else { + $ref['reference'] = $this->makeReferenceFlag($ref); + $this->unsetVar($ref); $id = $dbh->insert($this->table->reference,$ref,true); } @@ -272,17 +274,17 @@ class Ris //创建reference 字段 public function makeReferenceFlag($ref){ - $str = array(); - isset($ref['author']) ? $str[] = join(",",$ref['author']):""; - isset($ref['title']) ? $str[] = $ref['title']:""; - isset($ref['year']) ? $str[] = $ref['year']:""; - isset($ref['volume']) ? $str[] = $ref['volume']:""; - isset($ref['issue']) ? $str[] = $ref['issue']:""; - isset($ref['pages']) ? $str[] = $ref['pages']:""; - isset($ref['endpage'])? $str[] = $ref['endpage']:""; - isset($ref['doi']) ? $str[] = $ref['doi'] : ""; + $str = join(', ',$ref['author']).'. '; + $str .= $ref['title'].'. '; + $str .= $ref['publisher'].', '; + isset($ref['year']) ? $str .= $ref['year'].', ':""; + isset($ref['volume']) ? $str .= $ref['volume']:""; + isset($ref['issue']) ? $str .= '('.$ref['issue'].')':""; + isset($ref['pages']) ? $str .= ':'.$ref['pages']:""; + isset($ref['endpage'])? $str .= '-'.$ref['endpage']:""; + isset($ref['doi']) ? $str .= '. doi:'.$ref['doi'] : ""; - return join(",",$str); + return $str; } //卸载不需要的变量