Commit 85f1e3148b1d7d9fbf88bff621121fe5e06f17d1
1 parent
4c26bee8
KTS-1627
"Can move a folder onto itself." Fixed. KTS-1687 "Double quote to single quote conversion" Fixed. Reviewed by: Kevin Fourie git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@6255 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
1 changed file
with
22 additions
and
10 deletions
plugins/ktcore/KTBulkActions.php
| @@ -24,12 +24,12 @@ | @@ -24,12 +24,12 @@ | ||
| 24 | */ | 24 | */ |
| 25 | 25 | ||
| 26 | require_once(KT_LIB_DIR . '/actions/bulkaction.php'); | 26 | require_once(KT_LIB_DIR . '/actions/bulkaction.php'); |
| 27 | -require_once(KT_LIB_DIR . "/widgets/forms.inc.php"); | 27 | +require_once(KT_LIB_DIR . '/widgets/forms.inc.php'); |
| 28 | 28 | ||
| 29 | 29 | ||
| 30 | class KTBulkDeleteAction extends KTBulkAction { | 30 | class KTBulkDeleteAction extends KTBulkAction { |
| 31 | var $sName = 'ktcore.actions.bulk.delete'; | 31 | var $sName = 'ktcore.actions.bulk.delete'; |
| 32 | - var $_sPermission = "ktcore.permissions.delete"; | 32 | + var $_sPermission = 'ktcore.permissions.delete'; |
| 33 | var $_bMutator = true; | 33 | var $_bMutator = true; |
| 34 | 34 | ||
| 35 | function getDisplayName() { | 35 | function getDisplayName() { |
| @@ -40,8 +40,8 @@ class KTBulkDeleteAction extends KTBulkAction { | @@ -40,8 +40,8 @@ class KTBulkDeleteAction extends KTBulkAction { | ||
| 40 | $oForm = new KTForm; | 40 | $oForm = new KTForm; |
| 41 | $oForm->setOptions(array( | 41 | $oForm->setOptions(array( |
| 42 | 'identifier' => 'ktcore.actions.bulk.delete.form', | 42 | 'identifier' => 'ktcore.actions.bulk.delete.form', |
| 43 | - 'label' => _kt("Delete Items"), | ||
| 44 | - 'submit_label' => _kt("Delete"), | 43 | + 'label' => _kt('Delete Items'), |
| 44 | + 'submit_label' => _kt('Delete'), | ||
| 45 | 'action' => 'performaction', | 45 | 'action' => 'performaction', |
| 46 | 'fail_action' => 'collectinfo', | 46 | 'fail_action' => 'collectinfo', |
| 47 | 'cancel_action' => 'main', | 47 | 'cancel_action' => 'main', |
| @@ -50,7 +50,7 @@ class KTBulkDeleteAction extends KTBulkAction { | @@ -50,7 +50,7 @@ class KTBulkDeleteAction extends KTBulkAction { | ||
| 50 | $oForm->setWidgets(array( | 50 | $oForm->setWidgets(array( |
| 51 | array('ktcore.widgets.reason',array( | 51 | array('ktcore.widgets.reason',array( |
| 52 | 'name' => 'reason', | 52 | 'name' => 'reason', |
| 53 | - 'label' => _kt("Reason"), | 53 | + 'label' => _kt('Reason'), |
| 54 | 'description' => _kt('The reason for the deletion of these documents and folders for historical purposes.'), | 54 | 'description' => _kt('The reason for the deletion of these documents and folders for historical purposes.'), |
| 55 | 'value' => null, | 55 | 'value' => null, |
| 56 | 'required' => true, | 56 | 'required' => true, |
| @@ -108,7 +108,7 @@ class KTBulkDeleteAction extends KTBulkAction { | @@ -108,7 +108,7 @@ class KTBulkDeleteAction extends KTBulkAction { | ||
| 108 | 108 | ||
| 109 | class KTBulkMoveAction extends KTBulkAction { | 109 | class KTBulkMoveAction extends KTBulkAction { |
| 110 | var $sName = 'ktcore.actions.bulk.move'; | 110 | var $sName = 'ktcore.actions.bulk.move'; |
| 111 | - var $_sPermission = "ktcore.permissions.write"; | 111 | + var $_sPermission = 'ktcore.permissions.write'; |
| 112 | var $_bMutator = true; | 112 | var $_bMutator = true; |
| 113 | 113 | ||
| 114 | function getDisplayName() { | 114 | function getDisplayName() { |
| @@ -119,8 +119,8 @@ class KTBulkMoveAction extends KTBulkAction { | @@ -119,8 +119,8 @@ class KTBulkMoveAction extends KTBulkAction { | ||
| 119 | $oForm = new KTForm; | 119 | $oForm = new KTForm; |
| 120 | $oForm->setOptions(array( | 120 | $oForm->setOptions(array( |
| 121 | 'identifier' => 'ktcore.actions.bulk.move.form', | 121 | 'identifier' => 'ktcore.actions.bulk.move.form', |
| 122 | - 'label' => _kt("Move Items"), | ||
| 123 | - 'submit_label' => _kt("Move"), | 122 | + 'label' => _kt('Move Items'), |
| 123 | + 'submit_label' => _kt('Move'), | ||
| 124 | 'action' => 'performaction', | 124 | 'action' => 'performaction', |
| 125 | 'fail_action' => 'collectinfo', | 125 | 'fail_action' => 'collectinfo', |
| 126 | 'cancel_action' => 'main', | 126 | 'cancel_action' => 'main', |
| @@ -139,6 +139,18 @@ class KTBulkMoveAction extends KTBulkAction { | @@ -139,6 +139,18 @@ class KTBulkMoveAction extends KTBulkAction { | ||
| 139 | $collection->addColumn($col); | 139 | $collection->addColumn($col); |
| 140 | 140 | ||
| 141 | $qObj = new FolderBrowseQuery(1); | 141 | $qObj = new FolderBrowseQuery(1); |
| 142 | + | ||
| 143 | + $exclude=array(); | ||
| 144 | + | ||
| 145 | + foreach( $this->oEntityList->aFolderIds as $folderid) | ||
| 146 | + { | ||
| 147 | + $exclude[] = $folderid+0; | ||
| 148 | + } | ||
| 149 | + | ||
| 150 | + $qObj->exclude_folders = $exclude; | ||
| 151 | + | ||
| 152 | + | ||
| 153 | + | ||
| 142 | $collection->setQueryObject($qObj); | 154 | $collection->setQueryObject($qObj); |
| 143 | 155 | ||
| 144 | $aOptions = $collection->getEnvironOptions(); | 156 | $aOptions = $collection->getEnvironOptions(); |
| @@ -164,7 +176,7 @@ class KTBulkMoveAction extends KTBulkAction { | @@ -164,7 +176,7 @@ class KTBulkMoveAction extends KTBulkAction { | ||
| 164 | $oForm->addWidget( | 176 | $oForm->addWidget( |
| 165 | array('ktcore.widgets.reason',array( | 177 | array('ktcore.widgets.reason',array( |
| 166 | 'name' => 'reason', | 178 | 'name' => 'reason', |
| 167 | - 'label' => _kt("Reason"), | 179 | + 'label' => _kt('Reason'), |
| 168 | 'description' => _kt('The reason for moving these documents and folders, for historical purposes.'), | 180 | 'description' => _kt('The reason for moving these documents and folders, for historical purposes.'), |
| 169 | 'value' => null, | 181 | 'value' => null, |
| 170 | 'required' => true, | 182 | 'required' => true, |
| @@ -221,7 +233,7 @@ class KTBulkMoveAction extends KTBulkAction { | @@ -221,7 +233,7 @@ class KTBulkMoveAction extends KTBulkAction { | ||
| 221 | 233 | ||
| 222 | // does the user have write permission | 234 | // does the user have write permission |
| 223 | if(!Permission::userHasFolderWritePermission($this->oTargetFolder)) { | 235 | if(!Permission::userHasFolderWritePermission($this->oTargetFolder)) { |
| 224 | - $this->errorRedirectTo('collectinfo', _kt("You do not have permission to move items to this location")); | 236 | + $this->errorRedirectTo('collectinfo', _kt('You do not have permission to move items to this location')); |
| 225 | } | 237 | } |
| 226 | 238 | ||
| 227 | return parent::do_performaction(); | 239 | return parent::do_performaction(); |