diff --git a/lib/templating/kt3template.inc.php b/lib/templating/kt3template.inc.php index 767ec54..27db665 100644 --- a/lib/templating/kt3template.inc.php +++ b/lib/templating/kt3template.inc.php @@ -154,13 +154,20 @@ class KTPage { // FIXME: we lost the getDefaultAction stuff - do we care? // note that key == action. this is _important_, since we crossmatch the breadcrumbs against this for "active" $sBaseUrl = KTUtil::kt_url(); - $heading = _kt('You are attempting to access DMS Administration'); $this->menu = array(); $this->menu['dashboard'] = array('label' => _kt("Dashboard"), 'url' => $sBaseUrl.'/dashboard.php'); $this->menu['browse'] = array('label' => _kt("Browse Documents"), 'url' => $sBaseUrl.'/browse.php'); - $this->menu['administration'] = array('label' => _kt("DMS Administration"), 'url' => '#', - 'onclick' => "javascript: showSignatureForm('{$heading}', 'dms.administration.access', 'system', '{$sBaseUrl}/admin.php', 'redirect');"); //$sBaseUrl.'/admin.php', + $this->menu['administration'] = array('label' => _kt("DMS Administration")); + + global $default; + if($default->enableESignatures){ + $heading = _kt('You are attempting to access DMS Administration'); + $this->menu['administration']['url'] = '#'; + $this->menu['administration']['onclick'] = "javascript: showSignatureForm('{$heading}', 'dms.administration.access', 'system', '{$sBaseUrl}/admin.php', 'redirect');"; + }else{ + $this->menu['administration']['url'] = $sBaseUrl.'/admin.php'; + } } diff --git a/plugins/ktcore/KTPermissions.php b/plugins/ktcore/KTPermissions.php index 5febabf..6ca4138 100644 --- a/plugins/ktcore/KTPermissions.php +++ b/plugins/ktcore/KTPermissions.php @@ -6,31 +6,31 @@ * Document Management Made Simple * Copyright (C) 2008, 2009 KnowledgeTree Inc. * Portions copyright The Jam Warehouse Software (Pty) Limited - * + * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License version 3 as published by the * Free Software Foundation. - * + * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. - * + * * You should have received a copy of the GNU General Public License * along with this program. If not, see . - * - * You can contact KnowledgeTree Inc., PO Box 7775 #87847, San Francisco, + * + * You can contact KnowledgeTree Inc., PO Box 7775 #87847, San Francisco, * California 94120-7775, or email info@knowledgetree.com. - * + * * The interactive user interfaces in modified source and object code versions * of this program must display Appropriate Legal Notices, as required under * Section 5 of the GNU General Public License version 3. - * + * * In accordance with Section 7(b) of the GNU General Public License version 3, * these Appropriate Legal Notices must retain the display of the "Powered by - * KnowledgeTree" logo and retain the original copyright notice. If the display of the + * KnowledgeTree" logo and retain the original copyright notice. If the display of the * logo is not reasonably feasible for technical reasons, the Appropriate Legal Notices - * must display the words "Powered by KnowledgeTree" and retain the original + * must display the words "Powered by KnowledgeTree" and retain the original * copyright notice. * Contributor( s): ______________________________________ * @@ -541,14 +541,16 @@ class KTRoleAllocationPlugin extends KTFolderAction { function do_editRoleUsers() { + $iFolderId = $this->oFolder->getId(); + $role_allocation_id = KTUtil::arrayGet($_REQUEST, 'alloc_id'); - if (($this->oFolder->getId() == 1) && is_null($role_allocation_id)) { + if (($iFolderId == 1) && is_null($role_allocation_id)) { $oRoleAllocation = $this->rootoverride($_REQUEST['role_id']); } else { $oRoleAllocation = RoleAllocation::get($role_allocation_id); } if ((PEAR::isError($oRoleAllocation)) || ($oRoleAllocation=== false)) { - $this->errorRedirectToMain(_kt('No such role allocation.'), sprintf('fFolderId=%d',$this->oFolder->getId())); + $this->errorRedirectToMain(_kt('No such role allocation.'), sprintf('fFolderId=%d',$iFolderId)); } @@ -577,6 +579,17 @@ class KTRoleAllocationPlugin extends KTFolderAction { } } + // Include the electronic signature on the permissions action + global $default; + if($default->enableESignatures){ + $heading = _kt('You are attempting to modify roles'); + $input['type'] = 'button'; + $input['onclick'] = "javascript: showSignatureForm('{$heading}', 'ktcore.transactions.roles_modify_users', 'folder', 'userroleform', 'submit', {$iFolderId});"; + }else{ + $input['type'] = 'submit'; + $input['onclick'] = ''; + } + $oTemplating =& KTTemplating::getSingleton(); $oTemplate = $oTemplating->loadTemplate("ktcore/folder/roles_manageusers"); $aTemplateData = array( @@ -584,20 +597,23 @@ class KTRoleAllocationPlugin extends KTFolderAction { "edit_rolealloc" => $oRoleAllocation, 'unused_users' => $aFreeUsers, 'role_users' => $aRoleUsers, + 'input' => $input ); return $oTemplate->render($aTemplateData); } function do_editRoleGroups() { + $iFolderId = $this->oFolder->getId(); + $role_allocation_id = KTUtil::arrayGet($_REQUEST, 'alloc_id'); - if (($this->oFolder->getId() == 1) && is_null($role_allocation_id)) { + if (($iFolderId == 1) && is_null($role_allocation_id)) { $oRoleAllocation = $this->rootoverride($_REQUEST['role_id']); } else { $oRoleAllocation = RoleAllocation::get($role_allocation_id); } if ((PEAR::isError($oRoleAllocation)) || ($oRoleAllocation=== false)) { - $this->errorRedirectToMain(_kt('No such role allocation.'), sprintf('fFolderId=%d',$this->oFolder->getId())); + $this->errorRedirectToMain(_kt('No such role allocation.'), sprintf('fFolderId=%d',$iFolderId)); } $oRole = Role::get($oRoleAllocation->getRoleId()); @@ -627,7 +643,16 @@ class KTRoleAllocationPlugin extends KTFolderAction { } } - + // Include the electronic signature on the permissions action + global $default; + if($default->enableESignatures){ + $heading = _kt('You are attempting to modify roles'); + $input['type'] = 'button'; + $input['onclick'] = "javascript: showSignatureForm('{$heading}', 'ktcore.transactions.roles_modify_groups', 'folder', 'grouproleform', 'submit', {$iFolderId});"; + }else{ + $input['type'] = 'submit'; + $input['onclick'] = ''; + } $oTemplating =& KTTemplating::getSingleton(); $oTemplate = $oTemplating->loadTemplate("ktcore/folder/roles_managegroups"); @@ -637,6 +662,7 @@ class KTRoleAllocationPlugin extends KTFolderAction { 'unused_groups' => $aFreeUsers, 'role_groups' => $aRoleUsers, 'rolename' => $oRole->getName(), + 'input' => $input ); return $oTemplate->render($aTemplateData); } diff --git a/plugins/ktcore/folder/Permissions.php b/plugins/ktcore/folder/Permissions.php index 5a46108..66b693b 100644 --- a/plugins/ktcore/folder/Permissions.php +++ b/plugins/ktcore/folder/Permissions.php @@ -274,10 +274,11 @@ class KTFolderPermissionsAction extends KTFolderAction { function do_edit() { $this->oPage->setBreadcrumbDetails(_kt('Viewing Permissions')); + $iFolderId = $this->oFolder->getId(); $oPO = KTPermissionObject::get($this->oFolder->getPermissionObjectId()); - $aOptions = array('redirect_to' => array('main', 'fFolderId=' . $this->oFolder->getId())); + $aOptions = array('redirect_to' => array('main', 'fFolderId=' . $iFolderId)); if (!KTBrowseUtil::inAdminMode($this->oUser, $this->oFolder)) { $this->oValidator->userHasPermissionOnItem($this->oUser, $this->_sEditShowPermission, $this->oFolder, $aOptions); @@ -285,10 +286,10 @@ class KTFolderPermissionsAction extends KTFolderAction { // copy permissions if they were inherited $oInherited = KTPermissionUtil::findRootObjectForPermissionObject($oPO); - if ($oInherited->getId() !== $this->oFolder->getId()) { + if ($oInherited->getId() !== $iFolderId) { $override = KTUtil::arrayGet($_REQUEST, 'override', false); if (empty($override)) { - $this->errorRedirectToMain(_kt('This folder does not override its permissions'), sprintf('fFolderId=%d', $this->oFolder->getId())); + $this->errorRedirectToMain(_kt('This folder does not override its permissions'), sprintf('fFolderId=%d', $iFolderId)); } $this->startTransaction(); $this->_copyPermissions(); @@ -314,13 +315,23 @@ class KTFolderPermissionsAction extends KTFolderAction { $oTemplating =& KTTemplating::getSingleton(); $oTemplate = $oTemplating->loadTemplate('ktcore/folder/permissions'); - $bCanInherit = ($this->oFolder->getId() != 1); + $bCanInherit = ($iFolderId != 1); + + global $default; + if($default->enableESignatures){ + $heading = _kt('You are attempting to modify permissions'); + $input['type'] = 'button'; + $input['onclick'] = "javascript: showSignatureForm('{$heading}', 'ktcore.transactions.permissions_change', 'folder', 'update_permissions_form', 'submit', {$iFolderId});"; + }else{ + $input['type'] = 'submit'; + $input['onclick'] = ''; + } $perms = $aPermList; $docperms = KTPermission::getDocumentRelevantList(); $aTemplateData = array( - 'iFolderId' => $this->oFolder->getId(), + 'iFolderId' => $iFolderId, 'roles' => Role::getList(), 'groups' => Group::getList(), 'conditions' => KTSavedSearch::getConditions(), @@ -331,7 +342,8 @@ class KTFolderPermissionsAction extends KTFolderAction { 'edit' => true, 'permissions' => $perms, 'document_permissions' => $docperms, - 'can_inherit' => $bCanInherit + 'can_inherit' => $bCanInherit, + 'input' => $input ); return $oTemplate->render($aTemplateData); } diff --git a/plugins/ktcore/folder/Rename.php b/plugins/ktcore/folder/Rename.php index a7f3bf4..6ecc0ac 100644 --- a/plugins/ktcore/folder/Rename.php +++ b/plugins/ktcore/folder/Rename.php @@ -6,31 +6,31 @@ * Document Management Made Simple * Copyright (C) 2008, 2009 KnowledgeTree Inc. * Portions copyright The Jam Warehouse Software (Pty) Limited - * + * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License version 3 as published by the * Free Software Foundation. - * + * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. - * + * * You should have received a copy of the GNU General Public License * along with this program. If not, see . - * - * You can contact KnowledgeTree Inc., PO Box 7775 #87847, San Francisco, + * + * You can contact KnowledgeTree Inc., PO Box 7775 #87847, San Francisco, * California 94120-7775, or email info@knowledgetree.com. - * + * * The interactive user interfaces in modified source and object code versions * of this program must display Appropriate Legal Notices, as required under * Section 5 of the GNU General Public License version 3. - * + * * In accordance with Section 7(b) of the GNU General Public License version 3, * these Appropriate Legal Notices must retain the display of the "Powered by - * KnowledgeTree" logo and retain the original copyright notice. If the display of the + * KnowledgeTree" logo and retain the original copyright notice. If the display of the * logo is not reasonably feasible for technical reasons, the Appropriate Legal Notices - * must display the words "Powered by KnowledgeTree" and retain the original + * must display the words "Powered by KnowledgeTree" and retain the original * copyright notice. * Contributor( s): ______________________________________ * @@ -51,7 +51,7 @@ class KTFolderRenameAction extends KTFolderAction { function getDisplayName() { return _kt('Rename'); } - + function getInfo() { return parent::getInfo(); } @@ -63,10 +63,21 @@ class KTFolderRenameAction extends KTFolderAction { $fields = array(); $fields[] = new KTStringWidget(_kt('New folder name'), _kt('The name to which the current folder should be renamed.'), 'foldername', $this->oFolder->getName(), $this->oPage, true); - + + global $default; + if($default->enableESignatures){ + $heading = _kt('You are attempting to rename a folder'); + $input['onclick'] = "javascript: showSignatureForm('{$heading}', 'ktcore.transactions.rename', 'folder', 'rename_folder_form', 'submit', {$this->oFolder->getId()});"; + $input['type'] = 'button'; + }else{ + $input['onclick'] = ''; + $input['type'] = 'submit'; + } + $oTemplate->setData(array( 'context' => &$this, 'fields' => $fields, + 'input' => $input, 'folderName' => $this->oFolder->getName(), )); return $oTemplate->render(); diff --git a/plugins/ktstandard/KTElectronicSignatures.php b/plugins/ktstandard/KTElectronicSignatures.php index c59da51..f12b558 100644 --- a/plugins/ktstandard/KTElectronicSignatures.php +++ b/plugins/ktstandard/KTElectronicSignatures.php @@ -113,7 +113,8 @@ class KTElectronicSignatures } if($this->lock){ - return $this->eSignature->getLockMsg(); + $this->error = $this->eSignature->getLockMsg(); + return $this->getError(); } return $oTemplate->render($aTemplateData); } @@ -147,7 +148,7 @@ class KTElectronicSignatures */ public function getError() { - return $this->error; + return '
'.$this->error.'
'; } /** diff --git a/resources/css/kt-framing.css b/resources/css/kt-framing.css index aae45e5..e4a2f38 100644 --- a/resources/css/kt-framing.css +++ b/resources/css/kt-framing.css @@ -2348,7 +2348,7 @@ body #content #add_dashlet color: #666; } -#sign_here #form_actions a { +#sign_here .form_actions a { border: 1px solid #ccc; background: #fdfdfd; color: #333; @@ -2358,6 +2358,17 @@ body #content #add_dashlet text-decoration: none; } +#sign_here .error { + padding: 0.5em 1em; + border: 1px solid #ffc21e; + margin-bottom: 10px; + padding-left: 25px; +} + +#sign_here .error { + background: #ffdd80 url(../../thirdparty/icon-theme/16x16/status/dialog-warning.gif) 2px center no-repeat; +} + .x-window-tl .x-window-header { color: #FFF; } diff --git a/resources/js/signature.js b/resources/js/signature.js index 54919bf..93a2372 100644 --- a/resources/js/signature.js +++ b/resources/js/signature.js @@ -29,7 +29,7 @@ var showSignatureForm = function(head, action, type, request, request_type, deta applyTo : 'signature', layout : 'fit', width : 360, - height : 265, + height : 310, closeAction :'destroy', y : 150, shadow: false, @@ -50,6 +50,7 @@ var showSignatureForm = function(head, action, type, request, request_type, deta }else{ window.document.forms[this.request].submit(); } + return; } info.innerHTML = response.responseText; }, @@ -107,6 +108,7 @@ var submitForm = function() { }else{ window.document.forms[this.request].submit(); } + return; } info.innerHTML = response.responseText; diff --git a/templates/ktcore/folder/permissions.smarty b/templates/ktcore/folder/permissions.smarty index 0a24d15..5377ff3 100644 --- a/templates/ktcore/folder/permissions.smarty +++ b/templates/ktcore/folder/permissions.smarty @@ -84,8 +84,7 @@
- + {/if}
diff --git a/templates/ktcore/folder/rename.smarty b/templates/ktcore/folder/rename.smarty index 777761f..9ea9aa1 100644 --- a/templates/ktcore/folder/rename.smarty +++ b/templates/ktcore/folder/rename.smarty @@ -14,14 +14,9 @@ folder.{/i18n}

{$oWidget->render()} {/foreach}
- +
- - - diff --git a/templates/ktcore/folder/roles_managegroups.smarty b/templates/ktcore/folder/roles_managegroups.smarty index 631c5c6..0edf667 100644 --- a/templates/ktcore/folder/roles_managegroups.smarty +++ b/templates/ktcore/folder/roles_managegroups.smarty @@ -4,15 +4,15 @@

{i18n}Groups must be allocated to roles to ensure that the workflow transition this role is supposed to support can be acted upon by a user.{/i18n}

-
+ - + - - + +
{i18n}Allocate Groups{/i18n}

{i18n}Select the groups which should be part of this role.{/i18n}

@@ -58,7 +58,7 @@
- + {capture assign=link}{addQS}fFolderId={$context->oFolder->getId()}{/addQS}{/capture}
diff --git a/templates/ktcore/folder/roles_manageusers.smarty b/templates/ktcore/folder/roles_manageusers.smarty index f77b546..f4b7bae 100644 --- a/templates/ktcore/folder/roles_manageusers.smarty +++ b/templates/ktcore/folder/roles_manageusers.smarty @@ -4,7 +4,7 @@

{i18n}Add or remove users for this role. {/i18n}

- + @@ -63,7 +63,7 @@ Use the Ctrl key to multi-select user names.{/i18n}

- + {capture assign=link}{addQS}fFolderId={$context->oFolder->getId()}{/addQS}{/capture}
diff --git a/templates/ktstandard/signatures/signature_form.smarty b/templates/ktstandard/signatures/signature_form.smarty index 50c8131..f47a5f5 100644 --- a/templates/ktstandard/signatures/signature_form.smarty +++ b/templates/ktstandard/signatures/signature_form.smarty @@ -22,7 +22,7 @@

-