dt_widget_week (public, deprecated)

 dt_widget_week [ -calendar_details calendar_details ] [ -date date ] \
    [ -large_calendar_p large_calendar_p ] \
    [ -master_bgcolor master_bgcolor ] \
    [ -header_bgcolor header_bgcolor ] \
    [ -header_text_color header_text_color ] \
    [ -header_text_size header_text_size ] \
    [ -day_template day_template ] \
    [ -day_header_size day_header_size ] \
    [ -day_header_bgcolor day_header_bgcolor ] \
    [ -calendar_width calendar_width ] [ -day_bgcolor day_bgcolor ] \
    [ -today_bgcolor today_bgcolor ] \
    [ -day_text_color day_text_color ] \
    [ -empty_bgcolor empty_bgcolor ] \
    [ -next_week_template next_week_template ] \
    [ -prev_week_template prev_week_template ] \
    [ -prev_next_links_in_title prev_next_links_in_title ] \
    [ -fill_all_days fill_all_days ]

Defined in packages/acs-datetime/tcl/acs-calendar-2-procs.tcl

Deprecated. Invoking this procedure generates a warning.

Returns a calendar for a specific week, with details supplied by Julian date. Defaults to this week. To specify details for the individual days (if large_calendar_p is set) put data in an ns_set calendar_details. The key is the Julian date of the day, and the value is a string (possibly with HTML formatting) that represents the details. The variables in the templates are: - day_template: julian,day,date,pretty_date - next_week_template: - prev_week_template: DEPRECATED: this proc uses hardcoded markup and is therefore difficult to style. It is also not localized. Many of the date operations happening here have now good tcl support through the clock api, which would make this code probably faster and certainly portable (Oracle query is missing). Future reimplementations should leverage the templating system more.

Switches:
-calendar_details (optional)
-date (optional)
-large_calendar_p (optional, defaults to "1")
-master_bgcolor (optional)
-header_bgcolor (optional)
-header_text_color (optional, defaults to "white")
-header_text_size (optional, defaults to "+2")
-day_template (optional, defaults to "<!--$julian-->$day")
-day_header_size (optional, defaults to "2")
-day_header_bgcolor (optional, defaults to "#666666")
-calendar_width (optional, defaults to "100%")
-day_bgcolor (optional, defaults to "#DCDCDC")
-today_bgcolor (optional, defaults to "#FFF8DC")
-day_text_color (optional, defaults to "white")
-empty_bgcolor (optional, defaults to "white")
-next_week_template (optional)
-prev_week_template (optional)
-prev_next_links_in_title (optional, defaults to "0")
-fill_all_days (optional, defaults to "0")
See Also:

Partial Call Graph (max 5 caller/called nodes):
%3 ad_log_deprecated ad_log_deprecated (public) db_1row db_1row (public) dt_sysdate dt_sysdate (public) util_AnsiDatetoPrettyDate util_AnsiDatetoPrettyDate (public, deprecated) dt_widget_week dt_widget_week dt_widget_week->ad_log_deprecated dt_widget_week->db_1row dt_widget_week->dt_sysdate dt_widget_week->util_AnsiDatetoPrettyDate

Testcases:
No testcase defined.
Source code:
ad_log_deprecated proc dt_widget_week

    set today_date [dt_sysdate]

    if {$date eq ""} {
        set date $today_date
    }

    set current_date $date

    # Get information for the week
    db_1row select_week_info {}

    # Initialize the ns_set
    if {$calendar_details eq ""} {
        set calendar_details [ns_set create calendar_details]
    }

    # Loop through the days of the week
    set julian $sunday_julian
    set return_html "<table CELLPADDING=0 CELLSPACING=0 BORDER=0 width=95%>\n"

    # Navigation Bar
    append return_html [subst {<tr><td>
    <table cellpadding="3" cellspacing="0" border="0" width="90%" class="table-display">
    <tr class="table-header" bgcolor="lavender">
    <td align="center">
    [subst $prev_week_template]
    <span style="font-family:Arial,Helvetica; size: smaller">
    <b>[util_AnsiDatetoPrettyDate $sunday_date] - [util_AnsiDatetoPrettyDate $saturday_date]</b>
    </span>
    [subst $next_week_template]
    </td>
    </tr>
    </table></td></tr>
    }]

    append return_html [subst {<tr>
    <td>
        <table class="table-display" cellpadding="0" cellspacing="0" border="0" width="90%">}]

    set days_of_week {Sunday Monday Tuesday Wednesday Thursday Friday Saturday}
    foreach day $days_of_week {

        set lower_day [string tolower $day]
        set julian [set ${lower_day}_julian]
        set date [set ${lower_day}_date]
        set pretty_date [util_AnsiDatetoPrettyDate $date]
        set day_html [subst $day_template]

        if {$date == $today_date} {
            set bgcolor $today_bgcolor
        } else {
            set bgcolor $day_bgcolor
        }

        append return_html [subst {<tr><td class="cal-week" bgcolor="$bgcolor">$day_html &nbsp;</td>
        </tr>
        <tr>
        <td class="cal-week-event">
        <table cellpadding="0" cellspacing="0" border="0" width="100%">}]

        # Go through events
        while {1} {
            set index [ns_set find $calendar_details $julian]
            if {$index == -1} {
                break
            }

            append return_html [subst {
                <tr><td class="cal-week-event">
                <span style="font-size: smaller">[ns_set value $calendar_details $index]</span>
                </td></tr>
            }]

            ns_set delete $calendar_details $index
        }

        append return_html "</table></td></tr>"


        append return_html "</td></tr>\n"
        incr julian
    }

    append return_html "</table></td></tr></table>"

    return $return_html
XQL Not present:
Generic
PostgreSQL XQL file:
<fullquery name="dt_widget_week.select_week_info">
    <querytext>
select   to_char(to_date(:current_date, 'yyyy-mm-dd'), 'D') 
as day_of_the_week,
cast(next_day(to_date(:current_date, 'yyyy-mm-dd') - cast('7 days' as interval), 'Sunday') as date)
as sunday_date,
to_char(next_day(to_date(:current_date, 'yyyy-mm-dd') - cast('7 days' as interval), 'Sunday'),'J') 
as sunday_julian,
cast(next_day(to_date(:current_date, 'yyyy-mm-dd') - cast('7 days' as interval), 'Sunday') + cast('1 day' as interval) as date)
as monday_date,
to_char(next_day(to_date(:current_date, 'yyyy-mm-dd') - cast('7 days' as interval), 'Sunday') + cast('1 day' as interval),'J')
as monday_julian,
cast(next_day(to_date(:current_date, 'yyyy-mm-dd') - cast('7 days' as interval), 'Sunday') + cast('2 days' as interval) as date)
as tuesday_date,
to_char(next_day(to_date(:current_date, 'yyyy-mm-dd') - cast('7 days' as interval), 'Sunday') + cast('2 days' as interval),'J') 
as tuesday_julian,
cast(next_day(to_date(:current_date, 'yyyy-mm-dd') - cast('7 days' as interval), 'Sunday') + cast('3 days' as interval) as date)
as wednesday_date,
to_char(next_day(to_date(:current_date, 'yyyy-mm-dd') - cast('7 days' as interval), 'Sunday') + cast('3 days' as interval),'J') 
as wednesday_julian,
cast(next_day(to_date(:current_date, 'yyyy-mm-dd') - cast('7 days' as interval), 'Sunday') + cast('4 days' as interval) as date)
as thursday_date,
to_char(next_day(to_date(:current_date, 'yyyy-mm-dd') - cast('7 days' as interval), 'Sunday') + cast('4 days' as interval),'J') 
as thursday_julian,
cast(next_day(to_date(:current_date, 'yyyy-mm-dd') - cast('7 days' as interval), 'Sunday') + cast('5 days' as interval) as date)
as friday_date,
to_char(next_day(to_date(:current_date, 'yyyy-mm-dd') - cast('7 days' as interval), 'Sunday') + cast('5 days' as interval),'J') 
as friday_julian,
cast(next_day(to_date(:current_date, 'yyyy-mm-dd') - cast('7 days' as interval), 'Sunday') + cast('6 days' as interval) as date)
as saturday_date,
to_char(next_day(to_date(:current_date, 'yyyy-mm-dd') - cast('7 days' as interval), 'Sunday') + cast('6 days' as interval),'J') 
as saturday_julian,
cast(:current_date::timestamptz - cast('7 days' as interval) as date) as last_week,
to_char(:current_date::timestamptz - cast('7 days' as interval), 'Month DD, YYYY') as last_week_pretty,
cast(:current_date::timestamptz + cast('7 days' as interval) as date) as next_week,
to_char(:current_date::timestamptz + cast('7 days' as interval), 'Month DD, YYYY') as next_week_pretty
from     dual
</querytext>
</fullquery>
packages/acs-datetime/tcl/acs-calendar-2-procs-postgresql.xql

Oracle XQL file:
packages/acs-datetime/tcl/acs-calendar-2-procs-oracle.xql

[ hide source ] | [ make this the default ]
Show another procedure: