#!./tclsh
# $Id: select.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
# ========================================================================
# Copyright 2006 University of Washington
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# ========================================================================
# select.tcl
#
# Purpose: CGI script to generate html form used to gather info
# for message searching selection
# Input:
set select_vars {
}
# Output:
#
# HTML/CSS data representing form for text select input
# inherit global config
source ./alpine.tcl
source cmdfunc.tcl
WPEval $select_vars {
set selcount [WPCmd PEMailbox selected]
# given a uid, called from View page so use it for defaults
# otherwise if only one selected, use it for defaults
set thisuid 0
# leave disabled for now
if {0 && $uid > 0} {
set thisuid $uid
} elseif {$selcount == 1} {
}
if {$thisuid} {
if {[catch {WPCmd PEMessage $thisuid number} thisnum]} {
set thisuid 0
}
} else {
set thisnum ""
}
cgi_http_head {
WPStdHttpHdrs
}
cgi_html {
cgi_head {
WPStdHtmlHdr "Select By Text"
WPStyleSheets
cgi_put ""
}
cgi_body BGCOLOR="$_wp(bordercolor)" class=dialog "style=\"padding-left: 8%; padding-right: 8%\"" {
#catch {WPCmd PEInfo set wp_index_script fr_select.tcl}
catch {WPCmd PEInfo set help_context select}
cgi_form $_wp(appdir)/$_wp(ui1dir)/wp method=get name=auth target=body {
cgi_text "page=index" type=hidden notab
cgi_text "doselect=1" type=hidden notab
set mailboxname [WPCmd PEMailbox mailboxname]
cgi_division align=center class=dialog "style=\"padding-top:6; padding-bottom:8\"" {
cgi_puts "This page provides a way to search for specific messages within the currently open folder, [cgi_bold $mailboxname]. Simply fill in the criteria below and click the associated [cgi_italic Search] button. All messages matching the criteria will be marked with a check in the box next to their line in the Message List.[cgi_nl][cgi_nl]"
cgi_puts "Click [cgi_italic Cancel] to return to the Message List without searching."
}
if {$selcount > 0} {
cgi_center {
cgi_division class=standout {
cgi_put "The folder '$mailboxname' has ${selcount} message"
if {[string length [WPplural $selcount]]} {
cgi_put "s with their checkboxes marked."
} else {
cgi_put " with its checkbox marked."
}
cgi_put "[cgi_nl]The Search specified below should"
cgi_select result {
cgi_option "apply to entire folder, adding result to those now marked" value=broad selected
cgi_option "apply only to marked messages, unmarking messages not matched" value=narrow
cgi_option "discard previous marks and search anew" value=new
}
}
}
} else {
cgi_text result=broad type=hidden notab
}
cgi_put "
"
cgi_put ""
cgi_put ""
cgi_center {
cgi_division class=standout {
cgi_puts "Note, if the number of messages in this folder is larger than the number of lines in the Message[cgi_nbspace]List, then some matching messages may not be visible without paging/scrolling."
}
}
}
}
}
}