Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
I
intranet-invoices
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-invoices
Commits
e5c0343e
Commit
e5c0343e
authored
Apr 03, 2023
by
Frank Bergmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added permission check if a WF is running
parent
877c0709
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
1 deletion
+17
-1
new-2.tcl
www/new-2.tcl
+17
-1
No files found.
www/new-2.tcl
View file @
e5c0343e
...
...
@@ -139,6 +139,7 @@ if {"" == $invoice_currency} { set invoice_currency $default_currency }
set
current_user_id
[
auth::require_login
]
set
admin_p
[
im_user_is_admin_p
$current
_user_id
]
set
user_id
$current
_user_id
set
write_p
[
im_cost_center_write_p
$cost
_center_id
$cost
_type_id
$user
_id
]
# if !$write_p || ![im_permission $user_id add_invoices
]
||
""
==
$cost
_center_id
...
...
@@ -192,10 +193,25 @@ if {$duplicate_p} {
}
}
# ---------------------------------------------------------------
# Check if there is a
single project to which this document refers.
# Check if there is a
workflow ongoing
# ---------------------------------------------------------------
set
wf_case_p
[
db_string wf_case
"select count(*) from wf_cases where object_id = :invoice_id"
]
if
{
$wf
_case_p > 0 && !$admin_p
}
{
ad_return_complaint 1
"<b>
[
lang::message::lookup
""
intranet-invoices.Ongoing_Workflow
"Financial Document Controlled by Workflow"
]
:</b><br>
[
lang::message::lookup
""
intranet-invoices.intranet-invoices.Ongoing_Workflow_msg
"
This financial document is controlled by a workflow,
so normal users are not allowed to change it anymore.<br>
Please notify your system administrator if you think this is not correct.
"
]
"
ad_script_abort
}
# ---------------------------------------------------------------
# Check if there is a single project to which this document refers.
# ---------------------------------------------------------------
# Look for common super-projects for multi-project documents
set
select_project
[
im_invoices_unify_select_projects
$select
_project
]
...
...
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