2
# $Id: seldate.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
3
# ========================================================================
4
# Copyright 2006 University of Washington
6
# Licensed under the Apache License, Version 2.0 (the "License");
7
# you may not use this file except in compliance with the License.
8
# You may obtain a copy of the License at
10
# http://www.apache.org/licenses/LICENSE-2.0
12
# ========================================================================
16
# Purpose: CGI script to generate html form used to gather info
26
# HTML/CSS data representing form for date select input
28
# inherit global config
35
if {[catch {WPCmd PEMessage $uid number} thisnum]} {
48
WPStdHtmlHdr "Search By Date"
52
cgi_body BGCOLOR="$_wp(bordercolor)" {
54
catch {WPCmd PEInfo set wp_index_script fr_seldate.tcl}
55
catch {WPCmd PEInfo set help_context seldate}
57
cgi_form $_wp(appdir)/$_wp(ui1dir)/wp method=get name=auth target=body {
58
cgi_text page=index type=hidden notab
59
cgi_text doselect=1 type=hidden notab
60
cgi_text by=date type=hidden notab
61
if {![WPCmd PEMailbox selected]} {
62
cgi_text result=broad type=hidden notab
65
cgi_table border=0 cellspacing=0 cellpadding=2 width="100%" height="100%" {
67
cgi_table_data align=center valign=top class=dialog {
68
cgi_table width="80%" {
72
cgi_puts "[cgi_nl]This page provides a way to search for messages in [cgi_bold [WPCmd PEMailbox mailboxname]] based on arrival time."
73
cgi_puts "[cgi_nl][cgi_nl]Messages arriving [cgi_italic On] the date entered below will be marked with a check in the box next to their line in the Message List. Choosing [cgi_italic Since] marks messages arriving between today and the giving date (including the given date). Choosing [cgi_italic Before] marks messages arriving before (but not on) the given date."
74
cgi_puts "[cgi_nl][cgi_nl]Choose a date below and click 'Search' to choose messages, or 'Cancel' to return to the Message List.[cgi_nl][cgi_nl]"
79
if {[WPCmd PEMailbox selected]} {
80
cgi_table_row class=dialog {
81
cgi_table_data colspan=2 align=center valign=middle class=dialog {
82
cgi_put [cgi_font face=tahoma,verdana,geneva "Since some messages are already marked, choose whether criteria specified here should "]
84
cgi_option "search all messages in '[WPCmd PEMailbox mailboxname]'" value=broad selected
85
cgi_option "search within marked messages only." value=narrow
86
cgi_option "discard previous marks and search anew." value=new
96
cgi_table_row class=dialog {
97
cgi_table_data valign=top align=center class=dialog {
98
cgi_put [cgi_font face=tahoma,verdana,geneva "Messages dated "]
100
cgi_select datecase {
101
foreach i {On Since Before} {
102
cgi_option $i value=[string tolower $i]
111
set today [string tolower [WPCmd PEMessage $uid date month]]
113
set today [string tolower [clock format [clock seconds] -format %b]]
131
foreach {x y} $months {
133
cgi_option $x value=$y selected
135
cgi_option $x value=$y
142
set today [WPCmd PEMessage $uid date day]
144
set today [clock format [clock seconds] -format %d]
147
for {set i 1} {$i <= 31} {incr i} {
148
set v [format "%.2d" $i]
150
cgi_option $i value=$v selected
152
cgi_option $i value=$v
157
cgi_put ",[cgi_nbspace]"
158
cgi_select dateyear {
160
set now [WPCmd PEMessage $uid date year]
162
set now [clock format [clock seconds] -format "%Y"]
165
cgi_option $now value=$now selected
166
for {set n [expr $now - 1]} {$n >= 1970} {incr n -1} {
167
cgi_option $n value=$n
174
cgi_table_data align=center {
176
cgi_submit_button ok=Search
177
cgi_submit_button cancel=Cancel
181
cgi_table_row class=dialog {
182
cgi_table_data valign=top align=center class=dialog {
183
cgi_puts [cgi_nl][cgi_nl][cgi_font size=-1 "Note, if the number of messages in this folder is larger than the number of lines in the Message List, then some matching messages may not be visible without paging/scrolling."]