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; } //卸载不需要的变量