示例#1
0
 function do_main()
 {
     $oTemplate =& $this->oValidator->validateTemplate('ktstandard/action/document_links');
     $this->oPage->setBreadcrumbDetails(_kt("Links"));
     $this->oPage->setTitle(_kt("Links"));
     $iDocId = $_REQUEST['fDocumentId'];
     $oDocument = Document::get($iDocId);
     $oReadPermission =& KTPermission::getByName('ktcore.permissions.read');
     $oWritePermission =& KTPermission::getByName('ktcore.permissions.write');
     // Add an electronic signature
     global $default;
     if ($default->enableESignatures) {
         $signatures = true;
         $submit['sUrl'] = KTPluginUtil::getPluginPath('electronic.signatures.plugin', true);
         $submit['heading'] = _kt('You are attempting to delete a document link');
     } else {
         $signatures = false;
     }
     $aTemplateData = array('context' => $this, 'iDocId' => $iDocId, 'links_external' => DocumentLink::getExternalLinks($iDocId), 'links_from' => DocumentLink::getLinksFromDocument($iDocId), 'links_to' => DocumentLink::getLinksToDocument($iDocId), 'read_permission' => KTPermissionUtil::userHasPermissionOnItem($this->oUser, $oReadPermission, $this->oDocument), 'write_permission' => KTPermissionUtil::userHasPermissionOnItem($this->oUser, $oWritePermission, $this->oDocument), 'submit' => $submit, 'signatures' => $signatures);
     return $oTemplate->render($aTemplateData);
 }