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
40c3a1cd
Commit
40c3a1cd
authored
Apr 21, 2023
by
Frank Bergmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Dependency Tree now trying to get locale from calling page, otherwise using user locale
parent
34a904dd
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
31 deletions
+42
-31
dependency-tree.adp
lib/dependency-tree.adp
+31
-1
dependency-tree.tcl
lib/dependency-tree.tcl
+11
-30
No files found.
lib/dependency-tree.adp
View file @
40c3a1cd
@html;noquote@
\ No newline at end of file
<h1>'@locale@'</h1>
<if 1 eq @show_html_p@>
<table>
<tr valign=top>
<td width='70%'>
<table cellspaing=2 cellpadding=2>
<tr>
<td class=rowtitle>Name</td>
<td class=rowtitle>Amount</td>
<td class=rowtitle>Type</td>
<td class=rowtitle>Status</td>
</tr>
<tr><td colspan=99><h1>Predecessors</h1></td></tr>
@predecessor_html;noquote@
<tr><td colspan=99><h1>Successors</h1></td></tr>
@successor_html;noquote@
</table>
</td>
<td width='30%'>
<p>This portlet shows predecessors (= financial documents from which this document was created)
and successors (= financial documents created based on this one).</p>
</td>
</td>
</table>
</if>
lib/dependency-tree.tcl
View file @
40c3a1cd
...
...
@@ -3,7 +3,7 @@
# Expected variables:
# invoice_id
#
project_id set by portlet TCL
#
Try behaving like a page if not called as a portlet (may not work yet
)
if
{
!
[
info
exists invoice_id
]}
{
ad_page_contract
{}
{
invoice_id:integer
""
}
}
...
...
@@ -20,6 +20,13 @@ if {!$read_p} {
set
invoice_base_url
"/intranet-invoices/view"
# Check if the calling page (invoices/view?invoice_id=123
)
has a locale set
set
locale
[
uplevel
2
{
if
{[
info
exists locale
]}
{
set locale
}}]
if
{
""
eq
$locale
}
{
set locale
[
lang::user::locale
]
}
# -------------------------------------------------------------
# Main project
# -------------------------------------------------------------
...
...
@@ -92,7 +99,7 @@ db_foreach costs $costs_sql {
set name_hash
(
$cost
_id
)
$cost
_name
set type_hash
(
$cost
_id
)
$cost
_type_id
set status_hash
(
$cost
_id
)
$cost
_status_id
set amount_hash
(
$cost
_id
)
"
$cost
_amount
$cost
_currency"
set amount_hash
(
$cost
_id
)
"
[
lc_numeric
$cost
_amount
"%.2f"
$locale
]
$cost
_currency"
if
{
""
ne
$source
_id
}
{
set predecessors
{}
...
...
@@ -255,36 +262,10 @@ while {[llength $list] > 0 && $cnt < 100} {
# -------------------------------------------------------------
#
#
Output HTML
# -------------------------------------------------------------
if {"" eq
$predecessor
_html} { set predecessor_html "
<tr><td colspan=99>No predecessors found</td></tr>
" }
if {"" eq
$successor
_html} { set successor_html "
<tr><td colspan=99>No successors found</td></tr>
" }
set html "
<table><tr valign=top>
<td width='70%'>
<table cellspaing=2 cellpadding=2>
<tr>
<td class=rowtitle>Name</td>
<td class=rowtitle>Amount</td>
<td class=rowtitle>Type</td>
<td class=rowtitle>Status</td>
</tr>
<tr><td colspan=99><h1>Predecessors</h1></td></tr>
$predecessor
_html
<tr><td colspan=99><h1>Successors</h1></td></tr>
$successor
_html
</table>
</td>
<td width='30%'>
<p>This portlet shows predecessors
(
= financial documents from which this document was created
)
and successors
(
= financial documents created based on this one
)
.</p>
</td>
</td></table>
"
if {
[
expr
$predecessor
_num +
$successor
_num
]
< 1} { set html "" }
set show_html_p
[
expr
(
$predecessor
_num +
$successor
_num
)
> 0
]
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