Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cloud-3265587
Manage
Activity
Members
Labels
Plan
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Issue forks
cloud-3265587
Commits
1a2d7ca4
Commit
1a2d7ca4
authored
7 years ago
by
Yas Naoi
Browse files
Options
Downloads
Patches
Plain Diff
Added confirmation form to activity audit
parent
ab659eb8
Branches
7.x-1.x
Tags
7.x-1.7
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
modules/cloud_activity_audit/cloud_activity_audit.module
+16
-11
16 additions, 11 deletions
modules/cloud_activity_audit/cloud_activity_audit.module
with
16 additions
and
11 deletions
modules/cloud_activity_audit/cloud_activity_audit.module
+
16
−
11
View file @
1a2d7ca4
...
...
@@ -66,8 +66,8 @@ function cloud_activity_audit_menu() {
);
$items
[
'reports/activity_audit/%/delete'
]
=
array
(
'title'
=>
'Delete'
,
'page callback'
=>
'
_cloud_activity_audit_delete
'
,
'page arguments'
=>
array
(
2
),
'page callback'
=>
'
drupal_get_form
'
,
'page arguments'
=>
array
(
'_cloud_activity_audit_delete'
,
2
),
'access arguments'
=>
array
(
'access audit report'
),
'file'
=>
''
,
'type'
=>
MENU_CALLBACK
,
...
...
@@ -324,14 +324,21 @@ function cloud_activity_audit_get_entry($sort_column, $query_args) {
}
/**
* Delete an Audit entry
*
redirect to audit listing page
* Delete
s
an Audit entry
via confirm_form.
*
* @param $audit_id
* This is audit-id
* @return return a form
* Id of activity audit.
*/
function
_cloud_activity_audit_delete
(
$audit_id
=
''
)
{
$id
=
$audit_id
;
function
_cloud_activity_audit_delete
(
$form
,
$form_state
,
$audit_id
=
''
)
{
$form
[
'audit_id'
]
=
array
(
'#type'
=>
'hidden'
,
'#value'
=>
$audit_id
);
return
confirm_form
(
$form
,
t
(
'Are you sure you want to delete this item?'
),
CLOUD_ACTIVITY_AUDIT_PATH
.
'/report'
);
}
/**
* Submit of delete form.
*/
function
_cloud_activity_audit_delete_submit
(
$form
,
&
$form_state
)
{
$id
=
$form_state
[
'values'
][
'audit_id'
];
cloud_activity_audit_log
(
array
(
'type'
=>
'user_activity'
,
...
...
@@ -345,9 +352,7 @@ function _cloud_activity_audit_delete($audit_id = '') {
->
execute
();
drupal_set_message
(
t
(
'Audit has been deleted successfully.'
));
drupal_goto
(
CLOUD_ACTIVITY_AUDIT_PATH
.
'/report'
);
return
;
$form_state
[
'redirect'
]
=
CLOUD_ACTIVITY_AUDIT_PATH
.
'/report'
;
}
/**
...
...
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