From 105846afe95e13f72277a9544a8af8aa14b068db Mon Sep 17 00:00:00 2001
From: Leif Andersson <leif.andersson@control.lth.se>
Date: Sat, 14 May 2016 18:40:49 +0200
Subject: [PATCH] Changes to handle cmsms-2.1.3

---
 action.default.php          | 2 +-
 action.showpublication.php  | 2 +-
 lib/class.PublicationDB.php | 7 ++++---
 3 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/action.default.php b/action.default.php
index 9c6a012..b660e49 100644
--- a/action.default.php
+++ b/action.default.php
@@ -268,7 +268,7 @@ if (count($records) == $limit) {
  }
 $smarty->assign('num_records',count($records));
 $smarty->assign('text_num_records',$numRec);
-$smarty->assign_by_ref('records',$records);
+$smarty->assign('records',$records);
 //echo '<pre>'; print_r($query); echo '</pre>';
 
 if ($style == 'full' || $style = 'short') {
diff --git a/action.showpublication.php b/action.showpublication.php
index cc0b48a..a5264e3 100644
--- a/action.showpublication.php
+++ b/action.showpublication.php
@@ -67,7 +67,7 @@ $place = $this->CreateInputSubmit($id,'showBibtex',$label);
 $smarty->assign('toggleBibtex',$place);
 
 $publications = array($publication);
-$smarty->assign_by_ref('publications',$publications);
+$smarty->assign('publications',$publications);
 $smarty->assign('title', 'Publication: '.$artkey);
 if (isset($publication->errorMessage)) {
   echo $publication->errorMessage;
diff --git a/lib/class.PublicationDB.php b/lib/class.PublicationDB.php
index 11940c3..7788e13 100644
--- a/lib/class.PublicationDB.php
+++ b/lib/class.PublicationDB.php
@@ -6,9 +6,10 @@ class PublicationDB {
   private $PDB;
 
   private function __construct() {
-    global $gCms;
-    if (!isset($gCms)) exit;
-    $config =& $gCms->GetConfig();
+    //global $gCms;
+    //if (!isset($gCms)) exit;
+    //$config =& $gCms->GetConfig();
+    $config = cms_utils::get_config();
     //$this->PDB = ADONewConnection($config['dbms']);
     $this->PDB = ADONewConnection($config['dbms'],
     				  'pear:date:extend:transaction');
-- 
GitLab