public function saveAction()
 {
     if ($this->_getParam("id")) {
         $folder = Document_Folder::getById($this->_getParam("id"));
         $folder->setModificationDate(time());
         $folder->setUserModification($this->getUser()->getId());
         if ($folder->isAllowed("publish")) {
             $this->setValuesToDocument($folder);
             $folder->save();
             $this->_helper->json(array("success" => true));
         }
     }
     $this->_helper->json(false);
 }
Example #2
0
 /**
  * creates a document folder to hold all documents for later tests
  * @return void
  */
 public function testDocumentFolderCreate()
 {
     $document = $this->createRandomDocument("folder");
     $this->assertTrue($document->getId() > 0);
     $document->setKey($document->getKey() . "_data");
     $document->setProperties($this->getRandomProperties("document"));
     $document->save();
     $refetch = Document_Folder::getById($document->getId());
     //$this->assertTrue($refetch instanceof Document_Folder);
     $this->assertTrue(Test_Tool::documentsAreEqual($document, $refetch, false));
 }