Christian Stimming's report patch.

* src/scm/report/account-piecharts.scm: Simplified anchors for
	other reports by using gnc:make-report-anchor.

	* src/scm/html-utilities.scm (gnc:make-report-anchor): New
	function.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@3935 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Dave Peticolas
2001-04-11 09:57:15 +00:00
parent 287fbee535
commit aeff5bc299
3 changed files with 35 additions and 14 deletions

View File

@@ -17,6 +17,12 @@
2001-04-11 Christian Stimming <stimming@tuhh.de>
* src/scm/report/account-piecharts.scm: Simplified anchors for
other reports by using gnc:make-report-anchor.
* src/scm/html-utilities.scm (gnc:make-report-anchor): New
function.
* src/scm/options.scm (gnc:options-copy-values): New function.
* src/scm/report/account-piecharts.scm: Added anchors to yet other

View File

@@ -52,6 +52,27 @@
"gnc-report:id="
(number->string report-id)))
;; Make a new report and return the anchor to it. The new report of
;; type 'reportname' will have the option values copied from
;; 'src-options', and additionally this function sets all options
;; according to 'optionlist'. Each element of optionlist is a list of
;; section, name, and value of the function.
(define (gnc:make-report-anchor reportname
src-options optionlist)
(let ((options (gnc:make-report-options reportname)))
(gnc:options-copy-values src-options options)
(for-each
(lambda (l)
(let ((o (gnc:lookup-option options (car l) (cadr l))))
(if o
(gnc:option-set-value o (caddr l))
(warn "gnc:make-report-anchor:" reportname
" No such option: " (car l) (cadr l)))))
optionlist)
(gnc:report-anchor-text
(gnc:make-report reportname options))))
;; returns the account name as html-text and anchor to the register.
(define (gnc:html-account-anchor acct)
(gnc:make-html-text (gnc:html-markup-anchor

View File

@@ -287,20 +287,14 @@
;; to another report which is run on the
;; immediate subaccounts of this account
;; (and including this account).
(let ((options (gnc:make-report-options
reportname)))
(gnc:options-copy-values
(gnc:report-options report-obj) options)
(gnc:option-set-value
(gnc:lookup-option options pagename-accounts
optname-accounts)
(cons acct subaccts))
(gnc:option-set-value
(gnc:lookup-option options pagename-accounts
optname-levels)
(+ 1 tree-depth))
(gnc:report-anchor-text
(gnc:make-report reportname options)))))))
(gnc:make-report-anchor
reportname
(gnc:report-options report-obj)
(list
(list pagename-accounts optname-accounts
(cons acct subaccts))
(list pagename-accounts optname-levels
(+ 1 tree-depth))))))))
combined)))
(gnc:html-piechart-set-button-1-slice-urls! chart urls)
(gnc:html-piechart-set-button-1-legend-urls! chart urls))