~ubuntu-branches/debian/stretch/alpine/stretch

« back to all changes in this revision

Viewing changes to web/cgi/alpine/selstat.tcl

  • Committer: Bazaar Package Importer
  • Author(s): Asheesh Laroia
  • Date: 2010-10-03 15:31:55 UTC
  • mfrom: (1.1.8 upstream)
  • Revision ID: james.westby@ubuntu.com-20101003153155-2exypc96j1e8tw0p
Tags: 2.02-1
* New upstream release, based on re-alpine project
* Updated debian/copyright to reflect this fact
* re-alpine removed the non-free from the tarball, so now
  we do not repack the upstream tarball. (Yay!)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!./tclsh
2
 
# $Id: selstat.tcl 391 2007-01-25 03:53:59Z mikes@u.washington.edu $
3
 
# ========================================================================
4
 
# Copyright 2006 University of Washington
5
 
#
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
9
 
#
10
 
#     http://www.apache.org/licenses/LICENSE-2.0
11
 
#
12
 
# ========================================================================
13
 
 
14
 
#  selstat.tcl
15
 
#
16
 
#  Purpose:  CGI script to generate html form used to gather info
17
 
#            for status selection
18
 
 
19
 
#  Input:
20
 
set select_vars {
21
 
  {uid          ""                      0}
22
 
}
23
 
 
24
 
#  Output:
25
 
#
26
 
#       HTML/CSS data representing form for status select input
27
 
 
28
 
# inherit global config
29
 
source ./alpine.tcl
30
 
source cmdfunc.tcl
31
 
 
32
 
WPEval $select_vars {
33
 
  if {$uid} {
34
 
    if {[catch {WPCmd PEMessage $uid number} thisnum]} {
35
 
      set uid 0
36
 
    }
37
 
  } else {
38
 
    set thisnum ""
39
 
  }
40
 
 
41
 
 
42
 
  cgi_http_head {
43
 
    WPStdHttpHdrs
44
 
  }
45
 
 
46
 
  cgi_html {
47
 
    cgi_head {
48
 
      WPStdHtmlHdr "Search By Status"
49
 
      WPStyleSheets
50
 
    }
51
 
 
52
 
    cgi_body BGCOLOR="$_wp(bordercolor)" {
53
 
 
54
 
      catch {WPCmd PEInfo set help_context selstat}
55
 
      catch {WPCmd PEInfo set wp_index_script fr_selstat.tcl}
56
 
 
57
 
      cgi_form $_wp(appdir)/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=status type=hidden notab
61
 
        cgi_table border=0 cellspacing=0 cellpadding=2 width="100%" height="100%" {
62
 
          cgi_table_row {
63
 
            cgi_table_data align=center valign=top class=dialog {
64
 
              cgi_table width="80%" {
65
 
                cgi_table_row {
66
 
                  cgi_table_data colspan=2 {
67
 
                    cgi_center {
68
 
                      cgi_puts "[cgi_nl][cgi_nl]This page provides a way to search for messages in [cgi_bold [WPCmd PEMailbox mailboxname]] based on their status flags. Messages matching the status selected below will be marked with a check in the box next to their line in the Message List."
69
 
                      cgi_puts "[cgi_nl][cgi_nl]Choose the status criteria below and click 'Search', or 'Cancel' to return to the Message List.[cgi_nl][cgi_nl]"
70
 
                    }
71
 
                  }
72
 
 
73
 
                  if {[WPCmd PEMailbox selected]} {
74
 
                    cgi_table_row class=dialog {
75
 
                      cgi_table_data colspan=2 align=center valign=middle class=dialog colspan=2 {
76
 
                        cgi_put [cgi_font face=tahoma,verdana,geneva "Since some messages are already marked, choose whether criteria specified here should "]
77
 
                        cgi_select result {
78
 
                          cgi_option "search all messages in '[WPCmd PEMailbox mailboxname]'" value=broad selected
79
 
                          cgi_option "search within marked messages only." value=narrow
80
 
                          cgi_option "discard previous marks and search anew." value=new
81
 
                        }
82
 
 
83
 
                        cgi_br
84
 
                        cgi_br
85
 
                      }
86
 
                    }
87
 
                  } else {
88
 
                    cgi_text result=broad type=hidden notab
89
 
                  }
90
 
 
91
 
                  cgi_table_row class=dialog {
92
 
                    cgi_table_data valign=top align=center nowrap class=dialog colspan=2 {
93
 
                      cgi_puts [cgi_font face=tahoma,verdana,geneva "Search for messages "]
94
 
                      cgi_select statcase {
95
 
                        cgi_option "flagged" value=ton
96
 
                        cgi_option "NOT flagged" value=not
97
 
                      }
98
 
 
99
 
                      cgi_puts [cgi_font face=tahoma,verdana,geneva " :"]
100
 
                    }
101
 
                  }
102
 
 
103
 
                  set statuses {
104
 
                    Important imp
105
 
                    New new
106
 
                    Answered ans
107
 
                    Deleted del
108
 
                  }
109
 
 
110
 
                  if {0} {
111
 
                    cgi_table_row {
112
 
                      cgi_table_data align=center colspan=2 {
113
 
                        cgi_select flag {
114
 
                          foreach {x y} $statuses {
115
 
                            cgi_option $x value=$y
116
 
                          }
117
 
                        }
118
 
                      }
119
 
                    }
120
 
                  } else {
121
 
                    foreach {x y} $statuses {
122
 
                      cgi_table_row {
123
 
                        cgi_table_data align=right width="42%" {
124
 
                          cgi_radio_button flag=$y
125
 
                        }
126
 
 
127
 
                        cgi_table_data align=left {
128
 
                          cgi_put $x
129
 
                        }
130
 
                      }
131
 
                    }
132
 
                  }
133
 
 
134
 
                  cgi_table_row {
135
 
                    cgi_table_data class=dialog align=center colspan=2 {
136
 
                      cgi_br
137
 
                      cgi_submit_button ok=Search
138
 
                      cgi_submit_button cancel=Cancel
139
 
                    }
140
 
                  }
141
 
                }
142
 
 
143
 
                cgi_table_row class=dialog {
144
 
                  cgi_table_data valign=top align=center class=dialog colspan=2 {
145
 
                    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."]
146
 
                  }
147
 
                }
148
 
              }
149
 
            }
150
 
          }
151
 
        }
152
 
      }
153
 
    }
154
 
  }
155
 
}
156