function action_lock_del() { $item = $this->_controler->_actionParams['item']; $user = $this->_controler->getUser(); $lockFactory = new Docman_LockFactory(); if ($this->_controler->userCanWrite($item->getId())) { $lockFactory->unlock($item); $this->_raiseUnlockEvent($item, $user); } }
/** * Mark item as deleted * * @param Docman_Item $item * * @return void */ function delete($item) { // The event must be processed before the item is deleted $um = UserManager::instance(); $user = $um->getCurrentUser(); $itemParent = $this->getItemFromDb($item->getParentId()); $item->fireEvent('plugin_docman_event_del', $user, $itemParent); // Delete Lock if any $lF = new Docman_LockFactory(); if ($lF->itemIsLocked($item)) { $lF->unlock($item); } $item->setDeleteDate(time()); $this->delCutPreferenceForAllUsers($item->getId()); $this->delCopyPreferenceForAllUsers($item->getId()); $dao = $this->_getItemDao(); $dao->updateFromRow($item->toRow()); $dao->storeDeletedItem($item->getId()); }