diff --git a/application/controllers/NewrequestController.php b/application/controllers/NewrequestController.php index ce07605451ba5ae047c92dda99c701b517f71f71..ebe5495d2be9d7cf02969471dc0117faccd40b34 100644 --- a/application/controllers/NewrequestController.php +++ b/application/controllers/NewrequestController.php @@ -108,6 +108,8 @@ class NewRequestController extends Nmc_Controller_Action $request = Requests::getInstance()->find($requestId); $course = $request->getCourseGeneration(); + $course = clone $course; + Nmc_Registry_Session::getInstance()->course = $course; Nmc_Registry_Session::getInstance()->request = $request; diff --git a/application/models/rows/Asset.php b/application/models/rows/Asset.php index ea3aabdfba768b5881ef1fdd495bafa9a2af9983..295caa7a1258da0734194191893cfcad5864a001 100644 --- a/application/models/rows/Asset.php +++ b/application/models/rows/Asset.php @@ -21,6 +21,14 @@ class Asset extends Nmc_Db_Table_Row parent::_save(); } + protected function _clone() + { + parent::_clone(); + + $this->creationTime = time(); + $this->modifiedTime = time(); + } + public function getAssetId() { return $this->getPrimaryKey(); diff --git a/application/models/rows/Request.php b/application/models/rows/Request.php index 4a8c5852ae993e79bb20d42736196ae49486d528..9c6d55cc7dc48a5db92aaea25a188c410f8da721 100644 --- a/application/models/rows/Request.php +++ b/application/models/rows/Request.php @@ -50,7 +50,7 @@ class Request extends Nmc_Db_Table_Row . Assets::getInstance()->getTableName() . '.' . Assets::getInstance()->getPrimaryKeyName()); $select->where($this->_db->quoteInto('request = ?', $this->getPrimaryKey())); - $select->order('creation_time'); + $select->order('creation_time DESC'); $generations = $this->_db->fetchCol($select); if(count($generations) > 0) {