Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
I
intranet-core
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
project-open
intranet-core
Commits
ed388088
Commit
ed388088
authored
Aug 17, 2018
by
Frank Bergmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Now rejecting to nuke an office if it's referenced by a company
parent
44c4b36e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
1 deletion
+8
-1
intranet-office-procs.tcl
tcl/intranet-office-procs.tcl
+8
-1
No files found.
tcl/intranet-office-procs.tcl
View file @
ed388088
...
...
@@ -444,6 +444,13 @@ ad_proc im_office_nuke {
im_office_permissions
$current
_user_id
$office
_id view read write admin
if
{
!$admin
}
{
return
}
# Check if referenced by a company
set company_p
[
db_string company_p
"select count(*) from im_companies where main_office_id = :office_id"
]
if
{
$company
_p
}
{
ns_log Warning
"offices/nuke-2: Can't delee office #
$office
_id because is referenced by a company"
return
}
im_audit -user_id
$current
_user_id -object_type
"im_office"
-object_id
$office
_id -action before_nuke
# Permissions
...
...
@@ -517,7 +524,7 @@ ad_proc im_office_nuke {
db_dml party_approved_member_map
"
delete from party_approved_member_map
where member_id = :office_id"
db_dml delete_offices
"
delete from im_offices
where office_id = :office_id"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment