Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
X
xnat-web
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
dhcp
xnat-web
Commits
31872caa
Commit
31872caa
authored
8 years ago
by
Mike McKay
Browse files
Options
Downloads
Patches
Plain Diff
XNAT-4436 Fixed bulk delete.
parent
725abd0f
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main/java/org/nrg/xnat/turbine/modules/screens/BulkDeleteActionScreen.java
+6
-5
6 additions, 5 deletions
.../xnat/turbine/modules/screens/BulkDeleteActionScreen.java
src/main/webapp/scripts/restDeleter.js
+18
-16
18 additions, 16 deletions
src/main/webapp/scripts/restDeleter.js
with
24 additions
and
21 deletions
src/main/java/org/nrg/xnat/turbine/modules/screens/BulkDeleteActionScreen.java
+
6
−
5
View file @
31872caa
...
@@ -10,10 +10,6 @@
...
@@ -10,10 +10,6 @@
*/
*/
package
org.nrg.xnat.turbine.modules.screens
;
package
org.nrg.xnat.turbine.modules.screens
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.Hashtable
;
import
org.apache.turbine.util.RunData
;
import
org.apache.turbine.util.RunData
;
import
org.apache.velocity.context.Context
;
import
org.apache.velocity.context.Context
;
import
org.nrg.xdat.search.DisplaySearch
;
import
org.nrg.xdat.search.DisplaySearch
;
...
@@ -23,6 +19,10 @@ import org.nrg.xdat.turbine.utils.TurbineUtils;
...
@@ -23,6 +19,10 @@ import org.nrg.xdat.turbine.utils.TurbineUtils;
import
org.nrg.xft.XFTTable
;
import
org.nrg.xft.XFTTable
;
import
org.nrg.xft.security.UserI
;
import
org.nrg.xft.security.UserI
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.Hashtable
;
public
class
BulkDeleteActionScreen
extends
SecureScreen
{
public
class
BulkDeleteActionScreen
extends
SecureScreen
{
// Enumeration to determine what type of item is stored in an ItemContainer object.
// Enumeration to determine what type of item is stored in an ItemContainer object.
...
@@ -81,6 +81,7 @@ public class BulkDeleteActionScreen extends SecureScreen {
...
@@ -81,6 +81,7 @@ public class BulkDeleteActionScreen extends SecureScreen {
}
else
{
}
else
{
context
.
put
(
"errMsg"
,
"There is nothing to delete."
);
context
.
put
(
"errMsg"
,
"There is nothing to delete."
);
}
}
context
.
put
(
"turbineUtils"
,
TurbineUtils
.
GetInstance
());
}
}
/**
/**
...
@@ -225,7 +226,7 @@ public class BulkDeleteActionScreen extends SecureScreen {
...
@@ -225,7 +226,7 @@ public class BulkDeleteActionScreen extends SecureScreen {
public
String
canDelete
(
UserI
u
,
String
searchType
){
public
String
canDelete
(
UserI
u
,
String
searchType
){
try
{
try
{
// Is the user allowed to delete this item
// Is the user allowed to delete this item
boolean
canDelete
=
Permissions
.
canAny
(
u
,
this
.
xsi
+
"/project"
,
this
.
project
,
"delete"
);
boolean
canDelete
=
Permissions
.
canAny
(
u
,
this
.
xsi
,
this
.
project
,
"delete"
);
// The search type determines which items a user is allowed to delete.
// The search type determines which items a user is allowed to delete.
if
(
searchType
.
equals
(
"subject"
)){
if
(
searchType
.
equals
(
"subject"
)){
...
...
This diff is collapsed.
Click to expand it.
src/main/webapp/scripts/restDeleter.js
+
18
−
16
View file @
31872caa
...
@@ -20,22 +20,24 @@ RestDeleter = function(_array,_config) {
...
@@ -20,22 +20,24 @@ RestDeleter = function(_array,_config) {
t
.
width
=
"
100%
"
;
t
.
width
=
"
100%
"
;
var
tb
=
t
.
appendChild
(
document
.
createElement
(
"
tbody
"
));
var
tb
=
t
.
appendChild
(
document
.
createElement
(
"
tbody
"
));
for
(
var
aC
=
0
;
aC
<
this
.
a
.
length
;
aC
++
){
for
(
var
aC
=
0
;
aC
<
this
.
a
.
length
;
aC
++
){
if
(
this
.
a
[
aC
].
canRead
&&
(
this
.
a
[
aC
].
allowDelete
==
undefined
||
this
.
a
[
aC
].
allowDelete
==
true
)){
if
(
this
.
a
[
aC
].
canRead
&&
(
this
.
a
[
aC
].
allowDelete
==
undefined
||
this
.
a
[
aC
].
allowDelete
==
true
))
{
var
tr
=
tb
.
appendChild
(
document
.
createElement
(
"
tr
"
));
if
(
!
(
this
.
a
[
aC
].
label
==
"
Select All
"
&&
this
.
a
[
aC
].
xsiType
==
null
))
{
tr
.
entry
=
this
.
a
[
aC
];
var
tr
=
tb
.
appendChild
(
document
.
createElement
(
"
tr
"
));
tr
.
entry
=
this
.
a
[
aC
];
var
td1
=
tr
.
appendChild
(
document
.
createElement
(
"
td
"
));
var
td2
=
tr
.
appendChild
(
document
.
createElement
(
"
td
"
));
var
td1
=
tr
.
appendChild
(
document
.
createElement
(
"
td
"
));
tr
.
td1
=
td1
;
var
td2
=
tr
.
appendChild
(
document
.
createElement
(
"
td
"
));
tr
.
td2
=
td2
;
tr
.
td1
=
td1
;
tr
.
td2
=
td2
;
td1
.
innerHTML
=
this
.
a
[
aC
].
label
;
tr
.
pDivColor
=
td2
.
appendChild
(
document
.
createElement
(
"
div
"
));
td1
.
innerHTML
=
this
.
a
[
aC
].
label
;
tr
.
pDivColor
.
style
.
width
=
"
100%
"
;
tr
.
pDivColor
=
td2
.
appendChild
(
document
.
createElement
(
"
div
"
));
tr
.
pDivColor
.
style
.
backgroundColor
=
"
gray
"
;
tr
.
pDivColor
.
style
.
width
=
"
100%
"
;
tr
.
pDivColor
.
style
.
color
=
"
white
"
;
tr
.
pDivColor
.
style
.
backgroundColor
=
"
gray
"
;
tr
.
pDivColor
.
innerHTML
=
"
waiting...
"
;
tr
.
pDivColor
.
style
.
color
=
"
white
"
;
this
.
trArray
.
push
(
tr
);
tr
.
pDivColor
.
innerHTML
=
"
waiting...
"
;
this
.
trArray
.
push
(
tr
);
}
}
}
}
}
var
NUMSPACES
=
(
this
.
config
.
defaultHeight
/
25
)
-
4
;
var
NUMSPACES
=
(
this
.
config
.
defaultHeight
/
25
)
-
4
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment