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

« back to all changes in this revision

Viewing changes to web/cgi/alpine/queryexpunge.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: queryexpunge.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
 
#  queryexpunge.tcl
15
 
#
16
 
#  Purpose:  CGI script to generate html form used to confirm 
17
 
#            deleted message expunge
18
 
 
19
 
#  Input (Assumed set by sourcing script):
20
 
#     fn           : Name of folder getting expunged
21
 
#     delcount     : Number of deleted messages
22
 
 
23
 
#  Output:
24
 
#
25
 
#       HTML/CSS data representing the message specified
26
 
#       by the 'uid' argument
27
 
 
28
 
# inherit global config
29
 
source ./alpine.tcl
30
 
 
31
 
WPEval {} {
32
 
 
33
 
  cgi_http_head {
34
 
    WPStdHttpHdrs
35
 
  }
36
 
 
37
 
  cgi_html {
38
 
    cgi_head {
39
 
      WPStdHtmlHdr "Confirm Expunge"
40
 
      WPStyleSheets
41
 
    }
42
 
 
43
 
    cgi_body BGCOLOR="$_wp(bordercolor)" {
44
 
 
45
 
      catch {WPCmd PEInfo set help_context expunge}
46
 
 
47
 
      cgi_table border=0 cellspacing=0 cellpadding=2 width="100%" height="100%" {
48
 
        cgi_table_row {
49
 
          cgi_table_data valign=top align=center class=dialog {
50
 
            cgi_form $_wp(appdir)/fr_index method=get name=confirm target=spec {
51
 
              cgi_text "cid=[WPCmd PEInfo key]" type=hidden notab
52
 
 
53
 
              set mbn [WPCmd PEMailbox mailboxname]
54
 
              cgi_table border=0 cellspacing=8 cellpadding=8 width="75%" {
55
 
 
56
 
                if {[catch {WPCmd PEMailbox flagcount deleted} delcount] == 0 && $delcount > 0
57
 
                    && [catch {WPCmd PEMailbox messagecount} messcount] == 0} {
58
 
 
59
 
                  cgi_table_row {
60
 
                    cgi_table_data align=center valign=middle height=50 {
61
 
                      cgi_table bgcolor=yellow background=[WPimg dstripe] cellpadding=6 {
62
 
                        cgi_table_row {
63
 
                          cgi_table_data {
64
 
                            cgi_table bgcolor=black cellpadding=6 {
65
 
                              cgi_table_row {
66
 
                                cgi_table_data {
67
 
                                  cgi_puts [cgi_font size=+2 color=yellow [cgi_bold "CAUTION!"]]
68
 
                                }
69
 
                              }
70
 
                            }
71
 
                          }
72
 
                        }
73
 
                      }
74
 
                    }
75
 
                  }
76
 
 
77
 
                  if {$delcount == $messcount} {
78
 
                    switch $delcount {
79
 
                      1 {
80
 
                        set m1 "The [cgi_bold only] message in the folder [cgi_bold $mbn] is deleted."
81
 
                        set m2 "that [cgi_bold single] message"
82
 
                      }
83
 
                      2 {
84
 
                        set m1 "[cgi_bold Both] messages in the folder [cgi_bold $mbn] are deleted."
85
 
                        set m2 "[cgi_bold "both"] messages"
86
 
                      }
87
 
                      default {
88
 
                        set m1 "[cgi_span "style=font-weight: bold; color: red" "All $messcount messages"] in the folder [cgi_bold $mbn] are marked for deletion.  This includes any messages that might <u>not</u> be <u>visible</u> on the screen."
89
 
                        set m2 "[cgi_bold [cgi_span "style=font-size: bigger; color: red; text-decoration: underline" "all messages"]]"
90
 
                      }
91
 
                    }
92
 
 
93
 
                    append m1 "[cgi_nl][cgi_nl]Expunge now will leave this folder "
94
 
                    append m1 "[cgi_span "style=font-weight: bold; color: red" empty]. "
95
 
                    #append m1 "[cgi_nl][cgi_nl]Please acknowledge below that you understand there will be [cgi_span "style=font-weight: bold; color: red" "no more messages"] within this folder when the expunge is complete."
96
 
                    append m1 "[cgi_nl][cgi_nl][cgi_buffer {cgi_checkbox "emptyit=1"}] "
97
 
                    append m1 "I acknowledge expunge will leave folder [cgi_bold $mbn] [cgi_span "style=font-weight: bold; color: red" empty]."
98
 
                    set style "style=\"border: 1px solid #663333; background-color: #ffcc66;\""
99
 
                    set m3 ALL
100
 
                  } else {
101
 
                    if {$delcount > 1} {
102
 
                      set whch are
103
 
                      set plrl "s"
104
 
                    } else {
105
 
                      set whch is
106
 
                      set plrl ""
107
 
                    }
108
 
 
109
 
                    set m1 "Your folder [cgi_bold $mbn] contains $messcount messages, of which [cgi_bold $delcount] $whch deleted."
110
 
                    set m2 "[cgi_span "style=font-size: bigger; font-weight: bold" $delcount] message${plrl}"
111
 
                    set m3 $delcount
112
 
                    set style ""
113
 
                  }
114
 
 
115
 
                  cgi_table_row {
116
 
                    cgi_table_data align=center $style {
117
 
                      cgi_puts $m1
118
 
                    }
119
 
                  }
120
 
 
121
 
                  cgi_table_row {
122
 
                    cgi_table_data align=center {
123
 
                      cgi_puts "Do you wish to [cgi_span "style=color: red ; font-weight: bold" "permanently remove"] $m2 now?"
124
 
                    }
125
 
                  }
126
 
 
127
 
                  cgi_table_row {
128
 
                    cgi_table_data align=center {
129
 
                      cgi_submit_button "expunge=Yes, Remove $m3 message[WPplural $delcount]" tabindex=2
130
 
                    }
131
 
                  }
132
 
 
133
 
                  cgi_table_row {
134
 
                    cgi_table_data align=center {
135
 
                      cgi_submit_button "cancel=No, Return to '$mbn'" tabindex=1 checked selected default
136
 
                    }
137
 
                  }
138
 
                } else {
139
 
                  cgi_table_row {
140
 
                    cgi_table_data align=center {
141
 
                      cgi_puts "There are [cgi_bold no] messages currently marked for deletion in the folder [cgi_bold [WPCmd PEMailbox mailboxname]]."
142
 
                    }
143
 
                  }
144
 
 
145
 
                  if {[WPCmd PEInfo feature enable-aggregate-command-set]} {
146
 
                    switch [WPCmd PEInfo aggtabstate] {
147
 
                      0 {
148
 
                        lappend methods "Click the [cgi_img [WPimg slideout] style=vertical-align:middle] tab to expose aggregate operations"
149
 
                        lappend methods "Place a mark in the checkbox next to each desired message"
150
 
                        lappend methods "Click the [cgi_italic Delete] button"
151
 
                      }
152
 
                      1 {
153
 
                        lappend methods "Place a mark in the checkbox next to each desired message"
154
 
                        lappend methods "Click the [cgi_italic Delete] button"
155
 
                      }
156
 
                      2 {
157
 
                        lappend methods "Place a mark in the checkbox next to each desired message"
158
 
                        lappend methods "Within the Message Status box, choose [cgi_bold Deleted] from the drop-down list of flag choices"
159
 
                        lappend methods "Click the [cgi_italic Set] button"
160
 
                      }
161
 
                    }
162
 
 
163
 
                    cgi_table_row {
164
 
                      cgi_table_data align=center {
165
 
                        cgi_puts "To mark a message for deletion while viewing it, simply click the [cgi_italic Delete] button at the top of the Message View page."
166
 
                      }
167
 
                    }
168
 
 
169
 
                    cgi_table_row {
170
 
                      cgi_table_data align=center {
171
 
                        cgi_puts "To mark messages for deletion in the Message List:"
172
 
                        cgi_number_list {
173
 
                          foreach i $methods {
174
 
                            cgi_li $i
175
 
                          }
176
 
                        }
177
 
                      }
178
 
                    }
179
 
                  } else {
180
 
                    cgi_table_row {
181
 
                      cgi_table_data align=center {
182
 
                        cgi_puts "To mark a message for deletion, click the [cgi_italic Delete] button while viewing the message."
183
 
                      }
184
 
                    }
185
 
                  }
186
 
 
187
 
                  cgi_table_row {
188
 
                    cgi_table_data align=center {
189
 
                      cgi_puts "Click [cgi_italic OK] to return to the Message List."
190
 
                      cgi_br
191
 
                      cgi_br
192
 
                      cgi_submit_button cancel=OK
193
 
                    }
194
 
                  }
195
 
                }
196
 
              }
197
 
            }
198
 
          }
199
 
        }
200
 
      }
201
 
    }
202
 
  }
203
 
}