Commit 4e55f88542424d72b6d9c79e4e507e1b09956503

Authored by Megan
1 parent 154d525e

Added static signatures on document actions and bulk actions

In progress.

Committed by: Megan Watson
Reviewed by: Kevin Cyster
plugins/ktcore/KTDocumentActions.php
... ... @@ -1016,20 +1016,52 @@ class KTDocumentDeleteAction extends KTDocumentAction {
1016 1016 'submit_label' => _kt('Delete Document'),
1017 1017 'context' => &$this,
1018 1018 ));
1019   - $oForm->setWidgets(array(
1020   - array('ktcore.widgets.reason', array(
  1019 +
  1020 + // Electronic Signature if enabled
  1021 + global $default;
  1022 + if($default->enableESignatures){
  1023 + $widgets[] = array('ktcore.widgets.info', array(
  1024 + 'label' => _kt('This action requires authentication'),
  1025 + 'description' => _kt('Please provide your user credentials as confirmation of this action.'),
  1026 + 'name' => 'info'
  1027 + ));
  1028 + $widgets[] = array('ktcore.widgets.string', array(
  1029 + 'label' => _kt('Username'),
  1030 + 'name' => 'sign_username',
  1031 + 'required' => true
  1032 + ));
  1033 + $widgets[] = array('ktcore.widgets.password', array(
  1034 + 'label' => _kt('Password'),
  1035 + 'name' => 'sign_password',
  1036 + 'required' => true
  1037 + ));
  1038 + }
  1039 +
  1040 + $widgets[] = array('ktcore.widgets.reason', array(
1021 1041 'label' => _kt('Reason'),
1022 1042 'description' => _kt('Please specify why you are deleting this document. Please bear in mind that you can use a maximum of <strong>250</strong> characters.'),
1023 1043 'name' => 'reason',
1024   - )),
1025   - ));
1026   - $oForm->setValidators(array(
1027   - array('ktcore.validators.string', array(
  1044 + ));
  1045 +
  1046 + $oForm->setWidgets($widgets);
  1047 +
  1048 + $validators[] = array('ktcore.validators.string', array(
1028 1049 'test' => 'reason',
1029 1050 'max_length' => 250,
1030 1051 'output' => 'reason',
1031   - )),
1032   - ));
  1052 + ));
  1053 +
  1054 + if($default->enableESignatures){
  1055 + $validators[] = array('electonic.signatures.validators.authenticate', array(
  1056 + 'object_id' => $this->oDocument->iId,
  1057 + 'type' => 'document',
  1058 + 'action' => 'ktcore.transactions.delete',
  1059 + 'test' => 'info',
  1060 + 'output' => 'info'
  1061 + ));
  1062 + }
  1063 +
  1064 + $oForm->setValidators($validators);
1033 1065  
1034 1066 return $oForm;
1035 1067 }
... ... @@ -1144,35 +1176,67 @@ class KTDocumentMoveAction extends KTDocumentAction {
1144 1176 * This is still not the most elegant solution.
1145 1177 */
1146 1178  
1147   - $oForm->setWidgets(array(
1148   - array('ktcore.widgets.foldercollection', array(
  1179 + $widgets[] = array('ktcore.widgets.foldercollection', array(
1149 1180 'label' => _kt('Target Folder'),
1150 1181 'description' => _kt('Use the folder collection and path below select the folder into which you wish to move the document.'),
1151 1182 'required' => true,
1152 1183 'name' => 'browse',
1153   - 'folder_id' => $this->oDocument->getFolderID(),
1154   - )),
1155   - array('ktcore.widgets.reason', array(
  1184 + 'folder_id' => $this->oDocument->getFolderID()
  1185 + ));
  1186 +
  1187 +
  1188 + // Electronic Signature if enabled
  1189 + global $default;
  1190 + if($default->enableESignatures){
  1191 + $widgets[] = array('ktcore.widgets.info', array(
  1192 + 'label' => _kt('This action requires authentication'),
  1193 + 'description' => _kt('Please provide your user credentials as confirmation of this action.'),
  1194 + 'name' => 'info'
  1195 + ));
  1196 + $widgets[] = array('ktcore.widgets.string', array(
  1197 + 'label' => _kt('Username'),
  1198 + 'name' => 'sign_username',
  1199 + 'required' => true
  1200 + ));
  1201 + $widgets[] = array('ktcore.widgets.password', array(
  1202 + 'label' => _kt('Password'),
  1203 + 'name' => 'sign_password',
  1204 + 'required' => true
  1205 + ));
  1206 + }
  1207 +
  1208 +
  1209 + $widgets[] = array('ktcore.widgets.reason', array(
1156 1210 'label' => _kt('Reason'),
1157 1211 'description' => _kt('Please specify why you are moving this document. Bear in mind that you can use a maximum of <strong>250</strong> characters.'),
1158 1212 'name' => 'reason',
1159   - )),
1160 1213 ));
1161 1214  
  1215 + $oForm->setWidgets($widgets);
1162 1216  
1163   - $oForm->setValidators(array(
1164   - array('ktcore.validators.string', array(
  1217 + $validators[] = array('ktcore.validators.string', array(
1165 1218 'test' => 'reason',
1166 1219 'max_length' => 250,
1167 1220 'output' => 'reason',
1168   - )),
1169   - array('ktcore.validators.entity', array(
  1221 + ));
  1222 + $validators[] = array('ktcore.validators.entity', array(
1170 1223 'class' => 'Folder',
1171 1224 'test' => 'browse',
1172 1225 'output' => 'browse',
1173   - )),
1174 1226 ));
1175 1227  
  1228 + if($default->enableESignatures){
  1229 + $validators[] = array('electonic.signatures.validators.authenticate', array(
  1230 + 'object_id' => $this->oDocument->iId,
  1231 + 'type' => 'document',
  1232 + 'action' => 'ktcore.transactions.move',
  1233 + 'test' => 'info',
  1234 + 'output' => 'info'
  1235 + ));
  1236 + }
  1237 +
  1238 + $oForm->setValidators($validators);
  1239 +
1176 1240 // here's the ugly bit.
1177 1241  
1178 1242 $err = $oForm->getErrors();
... ... @@ -1565,20 +1629,52 @@ class KTDocumentArchiveAction extends KTDocumentAction {
1565 1629 'submit_label' => _kt('Archive Document'),
1566 1630 'context' => &$this,
1567 1631 ));
1568   - $oForm->setWidgets(array(
1569   - array('ktcore.widgets.reason', array(
  1632 +
  1633 + // Electronic Signature if enabled
  1634 + global $default;
  1635 + if($default->enableESignatures){
  1636 + $widgets[] = array('ktcore.widgets.info', array(
  1637 + 'label' => _kt('This action requires authentication'),
  1638 + 'description' => _kt('Please provide your user credentials as confirmation of this action.'),
  1639 + 'name' => 'info'
  1640 + ));
  1641 + $widgets[] = array('ktcore.widgets.string', array(
  1642 + 'label' => _kt('Username'),
  1643 + 'name' => 'sign_username',
  1644 + 'required' => true
  1645 + ));
  1646 + $widgets[] = array('ktcore.widgets.password', array(
  1647 + 'label' => _kt('Password'),
  1648 + 'name' => 'sign_password',
  1649 + 'required' => true
  1650 + ));
  1651 + }
  1652 +
  1653 + $widgets[] = array('ktcore.widgets.reason', array(
1570 1654 'label' => _kt('Reason'),
1571 1655 'description' => _kt('Please specify why you are archiving this document. Please bear in mind that you can use a maximum of <strong>250</strong> characters.'),
1572 1656 'name' => 'reason',
1573   - )),
1574   - ));
1575   - $oForm->setValidators(array(
1576   - array('ktcore.validators.string', array(
  1657 + ));
  1658 +
  1659 + $oForm->setWidgets($widgets);
  1660 +
  1661 + $validators[] = array('ktcore.validators.string', array(
1577 1662 'test' => 'reason',
1578 1663 'max_length' => 250,
1579 1664 'output' => 'reason',
1580   - )),
1581   - ));
  1665 + ));
  1666 +
  1667 + if($default->enableESignatures){
  1668 + $validators[] = array('electonic.signatures.validators.authenticate', array(
  1669 + 'object_id' => $this->oDocument->iId,
  1670 + 'type' => 'document',
  1671 + 'action' => 'ktcore.transactions.archive',
  1672 + 'test' => 'info',
  1673 + 'output' => 'info'
  1674 + ));
  1675 + }
  1676 +
  1677 + $oForm->setValidators($validators);
1582 1678  
1583 1679 return $oForm;
1584 1680 }
... ... @@ -1710,6 +1806,22 @@ class KTDocumentWorkflowAction extends KTDocumentAction {
1710 1806 }
1711 1807 }
1712 1808  
  1809 + // Add an electronic signature
  1810 + global $default;
  1811 + if($default->enableESignatures){
  1812 + $sUrl = KTPluginUtil::getPluginPath('electronic.signatures.plugin', true);
  1813 + $heading = _kt('You are attempting to modify the document workflow');
  1814 + $submit['type'] = 'button';
  1815 + $submit['onclick'] = "javascript: showSignatureForm('{$sUrl}', '{$heading}', 'ktcore.transactions.modify_workflow', 'document', 'start_workflow_form', 'submit', {$this->oDocument->iId});";
  1816 +
  1817 + $heading2 = _kt('You are attempting to transition the document workflow');
  1818 + $submit2['onclick'] = "javascript: showSignatureForm('{$sUrl}', '{$heading2}', 'ktcore.transactions.transition_workflow', 'document', 'transition_wf_form', 'submit', {$this->oDocument->iId});";
  1819 + }else{
  1820 + $submit['type'] = 'submit';
  1821 + $submit['onclick'] = '';
  1822 + $submit2['onclick'] = '';
  1823 + }
  1824 +
1713 1825 $aTemplateData = array(
1714 1826 'oDocument' => $oDocument,
1715 1827 'oWorkflow' => $oWorkflow,
... ... @@ -1719,6 +1831,8 @@ class KTDocumentWorkflowAction extends KTDocumentAction {
1719 1831 'transition_fields' => $transition_fields,
1720 1832 'bHasPerm' => $bHasPerm,
1721 1833 'bIsCheckedOut' => $bIsCheckedOut,
  1834 + 'submit' => $submit,
  1835 + 'submit2' => $submit2
1722 1836 );
1723 1837 return $oTemplate->render($aTemplateData);
1724 1838 }
... ... @@ -1779,14 +1893,37 @@ class KTDocumentWorkflowAction extends KTDocumentAction {
1779 1893 'fail_action' => 'quicktransition',
1780 1894 'cancel_url' => KTBrowseUtil::getUrlForDocument($this->oDocument),
1781 1895 ));
1782   - $oForm->setWidgets(array(
1783   - array('ktcore.widgets.reason', array(
  1896 +
  1897 + // Electronic Signature if enabled
  1898 + global $default;
  1899 + if($default->enableESignatures){
  1900 + $widgets[] = array('ktcore.widgets.info', array(
  1901 + 'label' => _kt('This action requires authentication'),
  1902 + 'description' => _kt('Please provide your user credentials as confirmation of this action.'),
  1903 + 'name' => 'info'
  1904 + ));
  1905 + $widgets[] = array('ktcore.widgets.string', array(
  1906 + 'label' => _kt('Username'),
  1907 + 'name' => 'sign_username',
  1908 + 'required' => true
  1909 + ));
  1910 + $widgets[] = array('ktcore.widgets.password', array(
  1911 + 'label' => _kt('Password'),
  1912 + 'name' => 'sign_password',
  1913 + 'required' => true
  1914 + ));
  1915 + }
  1916 +
  1917 +
  1918 + $widgets[] = array('ktcore.widgets.reason', array(
1784 1919 'label' => _kt('Reason'),
1785 1920 'description' => _kt('Specify your reason for performing this action.'),
1786 1921 'important_description' => _kt('Please bear in mind that you can use a maximum of <strong>250</strong> characters.'),
1787 1922 'name' => 'reason',
1788   - )),
1789   - ));
  1923 + ));
  1924 +
  1925 + $oForm->setWidgets($widgets);
  1926 +
1790 1927 $oForm->setValidators(array(
1791 1928 array('ktcore.validators.string', array(
1792 1929 'test' => 'reason',
... ... @@ -1794,6 +1931,17 @@ class KTDocumentWorkflowAction extends KTDocumentAction {
1794 1931 'output' => 'reason',
1795 1932 )),
1796 1933 ));
  1934 +
  1935 + if($default->enableESignatures){
  1936 + $oForm->addValidator(array('electonic.signatures.validators.authenticate', array(
  1937 + 'object_id' => $this->oDocument->iId,
  1938 + 'type' => 'document',
  1939 + 'action' => 'ktcore.transactions.transition_workflow',
  1940 + 'test' => 'info',
  1941 + 'output' => 'info'
  1942 + )));
  1943 + }
  1944 +
1797 1945 }
1798 1946  
1799 1947 return $oForm;
... ...
plugins/ktcore/document/Rename.php
... ... @@ -6,31 +6,31 @@
6 6 * Document Management Made Simple
7 7 * Copyright (C) 2008, 2009 KnowledgeTree Inc.
8 8 * Portions copyright The Jam Warehouse Software (Pty) Limited
9   - *
  9 + *
10 10 * This program is free software; you can redistribute it and/or modify it under
11 11 * the terms of the GNU General Public License version 3 as published by the
12 12 * Free Software Foundation.
13   - *
  13 + *
14 14 * This program is distributed in the hope that it will be useful, but WITHOUT
15 15 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
16 16 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
17 17 * details.
18   - *
  18 + *
19 19 * You should have received a copy of the GNU General Public License
20 20 * along with this program. If not, see <http://www.gnu.org/licenses/>.
21   - *
22   - * You can contact KnowledgeTree Inc., PO Box 7775 #87847, San Francisco,
  21 + *
  22 + * You can contact KnowledgeTree Inc., PO Box 7775 #87847, San Francisco,
23 23 * California 94120-7775, or email info@knowledgetree.com.
24   - *
  24 + *
25 25 * The interactive user interfaces in modified source and object code versions
26 26 * of this program must display Appropriate Legal Notices, as required under
27 27 * Section 5 of the GNU General Public License version 3.
28   - *
  28 + *
29 29 * In accordance with Section 7(b) of the GNU General Public License version 3,
30 30 * these Appropriate Legal Notices must retain the display of the "Powered by
31   - * KnowledgeTree" logo and retain the original copyright notice. If the display of the
  31 + * KnowledgeTree" logo and retain the original copyright notice. If the display of the
32 32 * logo is not reasonably feasible for technical reasons, the Appropriate Legal Notices
33   - * must display the words "Powered by KnowledgeTree" and retain the original
  33 + * must display the words "Powered by KnowledgeTree" and retain the original
34 34 * copyright notice.
35 35 * Contributor( s): ______________________________________
36 36 *
... ... @@ -86,9 +86,22 @@ class KTDocumentRenameAction extends KTDocumentAction {
86 86 $fields[] = new KTStaticTextWidget(_kt('Current file name'), _kt('The current file name is shown below:'), 'oldfilename', $this->oDocument->getFileName(), $this->oPage, false);
87 87 $fields[] = new KTStringWidget(_kt('New file name'), _kt('The name to which the current file should be renamed.'), 'filename', $this->oDocument->getFileName(), $this->oPage, true);
88 88  
  89 + // Add an electronic signature
  90 + global $default;
  91 + if($default->enableESignatures){
  92 + $sUrl = KTPluginUtil::getPluginPath('electronic.signatures.plugin', true);
  93 + $heading = _kt('You are attempting to rename the document');
  94 + $submit['type'] = 'button';
  95 + $submit['onclick'] = "javascript: showSignatureForm('{$sUrl}', '{$heading}', 'ktcore.transactions.rename', 'document', 'document_rename_form', 'submit', {$this->oDocument->iId});";
  96 + }else{
  97 + $submit['type'] = 'submit';
  98 + $submit['onclick'] = '';
  99 + }
  100 +
89 101 $oTemplate->setData(array(
90 102 'context' => &$this,
91 103 'fields' => $fields,
  104 + 'submit' => $submit
92 105 ));
93 106 return $oTemplate->render();
94 107 }
... ... @@ -103,7 +116,7 @@ class KTDocumentRenameAction extends KTDocumentAction {
103 116 );
104 117 $this->oValidator->validateString($sFilename, $aOptions);
105 118 $this->oValidator->validateIllegalCharacters($sFilename, $aOptions);
106   -
  119 +
107 120 $res = KTDocumentUtil::rename($this->oDocument, $sFilename, $this->oUser);
108 121 if (PEAR::isError($res)) {
109 122 $_SESSION['KTErrorMessage'][] = $res->getMessage();
... ... @@ -111,7 +124,7 @@ class KTDocumentRenameAction extends KTDocumentAction {
111 124 } else {
112 125 $_SESSION['KTInfoMessage'][] = sprintf(_kt('Document "%s" renamed.'),$this->oDocument->getName());
113 126 }
114   -
  127 +
115 128 controllerRedirect('viewDocument', sprintf('fDocumentId=%d', $this->oDocument->getId()));
116 129 exit(0);
117 130 }
... ...
plugins/ktcore/document/edit.php
... ... @@ -120,6 +120,39 @@ class KTDocumentEditAction extends KTDocumentAction {
120 120 $validators = kt_array_merge($validators, $oFReg->validatorsForFieldset($oFieldset, 'fieldset_' . $oFieldset->getId(), $this->oDocument));
121 121 }
122 122  
  123 + // Electronic Signature if enabled
  124 + global $default;
  125 + if($default->enableESignatures){
  126 + $widgets[] = array('ktcore.widgets.info', array(
  127 + 'label' => _kt('This action requires authentication'),
  128 + 'description' => _kt('Please provide your user credentials as confirmation of this action.'),
  129 + 'name' => 'info'
  130 + ));
  131 + $widgets[] = array('ktcore.widgets.string', array(
  132 + 'label' => _kt('Username'),
  133 + 'name' => 'sign_username',
  134 + 'required' => true
  135 + ));
  136 + $widgets[] = array('ktcore.widgets.password', array(
  137 + 'label' => _kt('Password'),
  138 + 'name' => 'sign_password',
  139 + 'required' => true
  140 + ));
  141 + $widgets[] = array('ktcore.widgets.reason', array(
  142 + 'label' => _kt('Reason'),
  143 + 'name' => 'reason',
  144 + 'required' => true
  145 + ));
  146 +
  147 + $validators[] = array('electonic.signatures.validators.authenticate', array(
  148 + 'object_id' => $this->oDocument->iId,
  149 + 'type' => 'document',
  150 + 'action' => 'ktcore.transactions.edit_metadata',
  151 + 'test' => 'info',
  152 + 'output' => 'info'
  153 + ));
  154 + }
  155 +
123 156 $oForm->setWidgets($widgets);
124 157 $oForm->setValidators($validators);
125 158  
... ...
plugins/ktstandard/KTDocumentLinks.php
... ... @@ -6,31 +6,31 @@
6 6 * Document Management Made Simple
7 7 * Copyright (C) 2008, 2009 KnowledgeTree Inc.
8 8 * Portions copyright The Jam Warehouse Software (Pty) Limited
9   - *
  9 + *
10 10 * This program is free software; you can redistribute it and/or modify it under
11 11 * the terms of the GNU General Public License version 3 as published by the
12 12 * Free Software Foundation.
13   - *
  13 + *
14 14 * This program is distributed in the hope that it will be useful, but WITHOUT
15 15 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
16 16 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
17 17 * details.
18   - *
  18 + *
19 19 * You should have received a copy of the GNU General Public License
20 20 * along with this program. If not, see <http://www.gnu.org/licenses/>.
21   - *
22   - * You can contact KnowledgeTree Inc., PO Box 7775 #87847, San Francisco,
  21 + *
  22 + * You can contact KnowledgeTree Inc., PO Box 7775 #87847, San Francisco,
23 23 * California 94120-7775, or email info@knowledgetree.com.
24   - *
  24 + *
25 25 * The interactive user interfaces in modified source and object code versions
26 26 * of this program must display Appropriate Legal Notices, as required under
27 27 * Section 5 of the GNU General Public License version 3.
28   - *
  28 + *
29 29 * In accordance with Section 7(b) of the GNU General Public License version 3,
30 30 * these Appropriate Legal Notices must retain the display of the "Powered by
31   - * KnowledgeTree" logo and retain the original copyright notice. If the display of the
  31 + * KnowledgeTree" logo and retain the original copyright notice. If the display of the
32 32 * logo is not reasonably feasible for technical reasons, the Appropriate Legal Notices
33   - * must display the words "Powered by KnowledgeTree" and retain the original
  33 + * must display the words "Powered by KnowledgeTree" and retain the original
34 34 * copyright notice.
35 35 * Contributor( s): ______________________________________
36 36 *
... ... @@ -179,6 +179,16 @@ class KTDocumentLinkAction extends KTDocumentAction {
179 179 $oReadPermission =& KTPermission::getByName('ktcore.permissions.read');
180 180 $oWritePermission =& KTPermission::getByName('ktcore.permissions.write');
181 181  
  182 + // Add an electronic signature
  183 + global $default;
  184 + if($default->enableESignatures){
  185 + $signatures = true;
  186 + $submit['sUrl'] = KTPluginUtil::getPluginPath('electronic.signatures.plugin', true);
  187 + $submit['heading'] = _kt('You are attempting to delete a document link');
  188 + }else{
  189 + $signatures = false;
  190 + }
  191 +
182 192 $aTemplateData = array(
183 193 'context' => $this,
184 194 'iDocId' => $iDocId,
... ... @@ -187,6 +197,8 @@ class KTDocumentLinkAction extends KTDocumentAction {
187 197 'links_to' => DocumentLink::getLinksToDocument($iDocId),
188 198 'read_permission' => KTPermissionUtil::userHasPermissionOnItem($this->oUser, $oReadPermission, $this->oDocument),
189 199 'write_permission' => KTPermissionUtil::userHasPermissionOnItem($this->oUser, $oWritePermission, $this->oDocument),
  200 + 'submit' => $submit,
  201 + 'signatures' => $signatures
190 202 );
191 203  
192 204 return $oTemplate->render($aTemplateData);
... ... @@ -251,6 +263,20 @@ class KTDocumentLinkAction extends KTDocumentAction {
251 263 $aURLParams['action'] = 'new';
252 264 $aBreadcrumbs = KTUtil::generate_breadcrumbs($oFolder, $iFolderId, $aURLParams);
253 265  
  266 +
  267 + // Add an electronic signature
  268 + global $default;
  269 + if($default->enableESignatures){
  270 + $sUrl = KTPluginUtil::getPluginPath('electronic.signatures.plugin', true);
  271 + $heading = _kt('You are attempting to add a document link');
  272 + $submit['type'] = 'button';
  273 + $submit['onclick'] = "javascript: showSignatureForm('{$sUrl}', '{$heading}', 'ktcore.transactions.add_link', 'document', 'document_add_link_form', 'submit', {$oParentDocument->iId});";
  274 + }else{
  275 + $submit['type'] = 'submit';
  276 + $submit['onclick'] = '';
  277 + }
  278 +
  279 +
254 280 $aTemplateData = array(
255 281 'context' => $this,
256 282 'folder' => $oFolder,
... ... @@ -258,6 +284,7 @@ class KTDocumentLinkAction extends KTDocumentAction {
258 284 'breadcrumbs' => $aBreadcrumbs,
259 285 'collection' => $collection,
260 286 'link_types' => LinkType::getList("id > 0"),
  287 + 'submit' => $submit
261 288 );
262 289  
263 290 $oTemplate =& $this->oValidator->validateTemplate('ktstandard/action/link');
... ... @@ -278,10 +305,23 @@ class KTDocumentLinkAction extends KTDocumentAction {
278 305 $oParentDocument =& $this->oDocument;
279 306 $iParentId = $oParentDocument->getId();
280 307  
  308 + // Add an electronic signature
  309 + global $default;
  310 + if($default->enableESignatures){
  311 + $sUrl = KTPluginUtil::getPluginPath('electronic.signatures.plugin', true);
  312 + $heading = _kt('You are attempting to add an external document link');
  313 + $submit['type'] = 'button';
  314 + $submit['onclick'] = "javascript: showSignatureForm('{$sUrl}', '{$heading}', 'ktcore.transactions.add_external_link', 'document', 'document_add_ext_link_form', 'submit', {$oParentDocument->iId});";
  315 + }else{
  316 + $submit['type'] = 'submit';
  317 + $submit['onclick'] = '';
  318 + }
  319 +
281 320 $aTemplateData = array(
282 321 'context' => $this,
283 322 'iDocId' => $iParentId,
284 323 'link_types' => LinkType::getList("id > 0"),
  324 + 'submit' => $submit
285 325 );
286 326  
287 327 $oTemplate =& $this->oValidator->validateTemplate('ktstandard/action/link_external');
... ...
templates/ktcore/action/rename.smarty
... ... @@ -6,7 +6,7 @@ name (not the document title) for a document.{/i18n}&lt;/p&gt;
6 6 {assign var=iDocumentId value=$context->oDocument->getId()}
7 7 {capture assign=link}{"viewDocument"|generateControllerUrl:"fDocumentId=$iDocumentId"}{/capture}
8 8  
9   -<form method="POST" action="{$smarty.server.PHP_SELF}">
  9 +<form method="POST" action="{$smarty.server.PHP_SELF}" name="document_rename_form" >
10 10 <fieldset><legend>{i18n}Rename{/i18n}</legend>
11 11 <input type="hidden" name="action" value="rename" />
12 12 <input type="hidden" name="fDocumentId" value="{$iDocumentId}" />
... ... @@ -14,7 +14,7 @@ name (not the document title) for a document.{/i18n}&lt;/p&gt;
14 14 {$oWidget->render()}
15 15 {/foreach}
16 16 <div class="form_actions">
17   -<input type="submit" name="submit" value="{i18n}Rename{/i18n}" />
  17 +<input type="{$submit.type}" name="btn_submit" value="{i18n}Rename{/i18n}" onclick="{$submit.onclick}" />
18 18 <input type="submit" name="kt_cancel[{$link}]" value="{i18n}Cancel{/i18n}" />
19 19 </div>
20 20 </fieldset>
... ...
templates/ktcore/workflow/documentWorkflow.smarty
... ... @@ -9,20 +9,20 @@
9 9  
10 10 {if !$oWorkflow}
11 11 <h3>{i18n}No workflow{/i18n}</h3>
12   -
  12 +
13 13 <p>{i18n}Document has no assigned workflow.{/i18n}</p>
14 14  
15 15 {else}
16   -
  16 +
17 17 <h3>{i18n}Current workflow settings{/i18n}</h3>
18   -
  18 +
19 19 <dl class="metadata">
20 20 <dt>{i18n}Workflow{/i18n}</dt><dd>{$oWorkflow->getName()}</dd>
21 21 <dt>{i18n}State{/i18n}</dt><dd>{$oState->getName()}</dd>
22 22 </dl>
23 23  
24 24 {if $aTransitions}
25   - <form action="{$smarty.server.PHP_SELF}" method="POST">
  25 + <form action="{$smarty.server.PHP_SELF}" method="POST" name="transition_wf_form">
26 26 <input type="hidden" name="action" value="performTransition" />
27 27 <input type="hidden" name="fDocumentId" value="{$oDocument->getId()}" />
28 28 <fieldset><legend>{i18n}Transition to another workflow state{/i18n}</legend>
... ... @@ -30,7 +30,7 @@
30 30 {$oWidget->render()}
31 31 {/foreach}
32 32 <div class="form_actions">
33   - <input type="submit" name="submit" value="{i18n}Perform Transition{/i18n}" />
  33 + <input type="{$submit.type}" onclick="{$submit2.onclick}" name="form_submit" value="{i18n}Perform Transition{/i18n}" />
34 34 </div>
35 35 </fieldset>
36 36 </form>
... ... @@ -52,19 +52,19 @@
52 52 {/if}
53 53 {if $aWorkflows}
54 54 {if $bHasPerm}
55   - <form action="{$smarty.server.PHP_SELF}" method="POST">
  55 + <form action="{$smarty.server.PHP_SELF}" method="POST" name="start_workflow_form">
56 56 <input type="hidden" name="action" value="startWorkflow" />
57 57 <input type="hidden" name="fDocumentId" value="{$oDocument->getId()}" />
58   -
  58 +
59 59 <p class="descriptiveText">{i18n}Please note that changing the workflow on a document will start the workflow
60 60 at the beginning of the new workflow. <strong>This is true even if the new workflow is identical to the old one.</strong>{/i18n}</p>
61   -
  61 +
62 62 {entity_select entities=$aWorkflows name=fWorkflowId none=$none}
63 63 <div class="form_actions">
64 64 {if !$oWorkflow}
65   - <input type="submit" name="submit" value="{i18n}Start Workflow{/i18n}" />
  65 + <input type="{$submit.type}" onclick="{$submit.onclick}" name="form_submit" value="{i18n}Start Workflow{/i18n}" />
66 66 {else}
67   - <input type="submit" name="submit" value="{i18n}Change Workflow{/i18n}" />
  67 + <input type="{$submit.type}" onclick="{$submit.onclick}" name="form_submit" value="{i18n}Change Workflow{/i18n}" />
68 68 {/if}
69 69 </div>
70 70 </form>
... ...
templates/ktstandard/action/document_links.smarty
... ... @@ -29,7 +29,11 @@
29 29 <tr>
30 30 <td>
31 31 {if $write_permission}
32   - <a href="{addQS}action=delete&fDocumentId={$context->oDocument->getId()}&fDocumentLinkId={$link->getId()}{/addQS}" class="ktAction ktDelete">{i18n}Delete{/i18n}</a>
  32 + {if $signatures}
  33 + <a href="#" onclick="javascript: showSignatureForm('{$submit.sUrl}', '{$submit.heading}', 'ktcore.transactions.delete_link', 'document', '{addQS}action=delete&fDocumentId={$context->oDocument->getId()}&fDocumentLinkId={$link->getId()}{/addQS}', 'redirect', {$iDocId});" class="ktAction ktDelete">{i18n}Delete{/i18n}</a>
  34 + {else}
  35 + <a href="{addQS}action=delete&fDocumentId={$context->oDocument->getId()}&fDocumentLinkId={$link->getId()}{/addQS}" class="ktAction ktDelete">{i18n}Delete{/i18n}</a>
  36 + {/if}
33 37 {else}
34 38 &nbsp;
35 39 {/if}
... ... @@ -50,7 +54,11 @@
50 54 <tr>
51 55 <td>
52 56 {if $write_permission}
53   - <a href="{addQS}action=delete&fDocumentId={$context->oDocument->getId()}&fDocumentLinkId={$link->getId()}{/addQS}" class="ktAction ktDelete">{i18n}Delete{/i18n}</a>
  57 + {if $signatures}
  58 + <a href="#" onclick="javascript: showSignatureForm('{$submit.sUrl}', '{$submit.heading}', 'ktcore.transactions.delete_link', 'document', '{addQS}action=delete&fDocumentId={$context->oDocument->getId()}&fDocumentLinkId={$link->getId()}{/addQS}', 'redirect', {$iDocId});" class="ktAction ktDelete">{i18n}Delete{/i18n}</a>
  59 + {else}
  60 + <a href="{addQS}action=delete&fDocumentId={$context->oDocument->getId()}&fDocumentLinkId={$link->getId()}{/addQS}" class="ktAction ktDelete">{i18n}Delete{/i18n}</a>
  61 + {/if}
54 62 {else}
55 63 &nbsp;
56 64 {/if}
... ... @@ -71,7 +79,11 @@
71 79 <tr>
72 80 <td>
73 81 {if $write_permission}
74   - <a href="{addQS}action=delete&fDocumentId={$iDocId}&fDocumentLinkId={$link->getId()}{/addQS}" class="ktAction ktDelete">{i18n}Delete{/i18n}</a>
  82 + {if $signatures}
  83 + <a href="#" onclick="javascript: showSignatureForm('{$submit.sUrl}', '{$submit.heading}', 'ktcore.transactions.delete_link', 'document', '{addQS}action=delete&fDocumentId={$iDocId}&fDocumentLinkId={$link->getId()}{/addQS}', 'redirect', {$iDocId});" class="ktAction ktDelete">{i18n}Delete{/i18n}</a>
  84 + {else}
  85 + <a href="{addQS}action=delete&fDocumentId={$iDocId}&fDocumentLinkId={$link->getId()}{/addQS}" class="ktAction ktDelete">{i18n}Delete{/i18n}</a>
  86 + {/if}
75 87 {else}
76 88 &nbsp;
77 89 {/if}
... ...
templates/ktstandard/action/link.smarty
... ... @@ -13,12 +13,12 @@
13 13 {/if}
14 14 {/foreach}
15 15  
16   -<form method="POST" action="{$smarty.server.PHP_SELF}">
  16 +<form method="POST" action="{$smarty.server.PHP_SELF}" name="document_add_link_form">
17 17 {$collection->render()}
18 18 <div class="form_actions">
19 19 <input type="hidden" name="action" value="type_select" />
20 20 <input type="hidden" name="fDocumentId" value="{$parent->getId()}" />
21   -<input type="submit" name="submit[move]" value="{i18n}Link{/i18n}" />
  21 +<input type="{$submit.type}" name="submit[move]" value="{i18n}Link{/i18n}" onclick="{$submit.onclick}" />
22 22 </div>
23 23 </form>
24 24 {else}
... ...
templates/ktstandard/action/link_external.smarty
... ... @@ -5,7 +5,7 @@
5 5 <p class='descriptiveText'>{i18n}Enter the URL to the external document or site.{/i18n}
6 6 </p>
7 7  
8   -<form method='POST' action="{$smarty.server.PHP_SELF}">
  8 +<form method='POST' action="{$smarty.server.PHP_SELF}" name="document_add_ext_link_form">
9 9  
10 10 <label for='target_name'>{i18n}Link Name{/i18n}: </label><br />
11 11 <input id='target_name' name='target_name' />
... ... @@ -17,7 +17,7 @@
17 17 <input type='hidden' name='action' value='type_select' />
18 18 <input type='hidden' name='linktype' value='external' />
19 19 <input type='hidden' name='fDocumentId' value='{$iDocId}' />
20   -<input type='submit' name='submit[move]' value='{i18n}Link{/i18n}' />
  20 +<input type='{$submit.type}' name='submit[move]' value='{i18n}Link{/i18n}' onclick="{$submit.onclick}" />
21 21 </div>
22 22 </form>
23 23 {else}
... ...