Patch title: Release 94 bulk changes
Abstract:
File: /pliant/appli/mail.pli
Key:
    Removed line
    Added line
   
module "/pliant/language/unsafe.pli"
module "/pliant/language/context.pli"
module "/pliant/language/stream.pli"
module "/pliant/admin/file.pli"
module "/pliant/fullpliant/this_computer.pli"
module "/pliant/fullpliant/user.pli"
module "/pliant/appli/mail/database.pli"
module "/pliant/protocol/smtp/mail.pli"
module "/pliant/protocol/smtp/meta.pli"
module "/pliant/protocol/smtp/forward.pli"
module "/pliant/protocol/smtp/spam.pli"
module "/pliant/protocol/http/server.pli"
module "/pliant/protocol/http/style/default.style"
module "/pliant/util/encoding/base64.pli"
module "/pliant/util/encoding/date.pli"
module "/pliant/util/encoding/http.pli"
module "/pliant/util/encoding/qp.pli"
module "/pliant/util/crypto/random.pli"
module "/pliant/language/schedule/resourcesem.pli"
module "/pliant/protocol/smtp/mime.pli"
module "/pliant/protocol/common/mime.pli"


method page mail_edit user
  arg_rw HtmlPage page ; arg Str user
  mail_database2:data:current create user
  var Data:MailCurrent current :> mail_database2:data:curren
  implicit page
    title "Send a mail"
    table columns 3 border 0
      cell [From]
      cell
        each umb user:user:mailbox
          if current:from=""
            current:from := umb
        select "" current:from
          each umb user:user:mailbox
            option umb umb
      cell void
      each t current:target
        if t:box<>"" and keyof:t<>""
          cell
            text t:mode
          cell
            text t:box
          cell
            button "Delete"
              current:target delete keyof:t
              reload_page
      current:target create ""
      cell
        select "" current:target:"":mode
          option "To" "to"
          option "Cc" "cc"
      cell
        var Str cvalue := current:target:"":box
        select "" current:target:"":box noeol
          option "" ""
          var CBool already := false
          each ubm user_database2:data:user:user:bookmark fi
            var Str blabel := (shunt ubm:first_name<>"" ubm:
            var Str bvalue := blabel+" <"+ubm:mailbox+">"
            option blabel bvalue
          if current:keyword<>""
            option "all "+current:keyword "all "+current:key
        input "" current:target:"":box length 30 noeol
      cell
        button "One more line"
          var Str id := string datetime:seconds
          current:target create id
          data_copy current:target:"" current:target:id
          current:target delete ""
          reload_page
      cell [Subject]
      cell
        input "" current:subject length 40
      cell void
    text_input "Message:[lf]" current:body columns 80 rows 2
    var Array:FileInfo files := file_list mail_path+"attach/
    if files:size>0
      var Intn total := 0
      table columns 3
        cell header [Attached file]
        cell header [Size in bytes]
        cell void
        for (var Int i) 0 files:size-1
          cell
            text files:i:name
          cell
            text (string files:i:size)
          cell
            var Str attached_file := files:i:name
            small
              button "discard"
                file_delete mail_path+"attach/"+user+"/"+att
                reload_page
          total += files:i:size
        cell header [Total]
        cell
          text string:total+" ("+(string (total+2^19)\2^20)+
        cell void
    file_upload "File name: " (var Str attach) noeol
    button "Attach the file"
      var Str remote := attach option "remote_name" Str
      file_move attach mail_path+"attach/"+user+"/"+remote
      reload_page
    para
      button "Reset the mail" noeol
        title "Reset the mail"
        [Are you sure you want to reset the mail content wit
        button "Yes" noeol
          mail_reset user
          goto_backward
        button "No"
          goto_backward
      button "Save the current content" noeol
        reload_page
      button "Preview then send"
module "/pliant/language/unsafe.pli"
module "/pliant/language/context.pli"
module "/pliant/language/stream.pli"
module "/pliant/admin/file.pli"
module "/pliant/fullpliant/this_computer.pli"
module "/pliant/fullpliant/user.pli"
module "/pliant/appli/mail/database.pli"
module "/pliant/protocol/smtp/mail.pli"
module "/pliant/protocol/smtp/meta.pli"
module "/pliant/protocol/smtp/forward.pli"
module "/pliant/protocol/smtp/spam.pli"
module "/pliant/protocol/http/server.pli"
module "/pliant/protocol/http/style/default.style"
module "/pliant/util/encoding/base64.pli"
module "/pliant/util/encoding/date.pli"
module "/pliant/util/encoding/http.pli"
module "/pliant/util/encoding/qp.pli"
module "/pliant/util/crypto/random.pli"
module "/pliant/language/schedule/resourcesem.pli"
module "/pliant/protocol/smtp/mime.pli"
module "/pliant/protocol/common/mime.pli"


method page mail_edit user
  arg_rw HtmlPage page ; arg Str user
  mail_database2:data:current create user
  var Data:MailCurrent current :> mail_database2:data:curren
  implicit page
    title "Send a mail"
    table columns 3 border 0
      cell [From]
      cell
        each umb user:user:mailbox
          if current:from=""
            current:from := umb
        select "" current:from
          each umb user:user:mailbox
            option umb umb
      cell void
      each t current:target
        if t:box<>"" and keyof:t<>""
          cell
            text t:mode
          cell
            text t:box
          cell
            button "Delete"
              current:target delete keyof:t
              reload_page
      current:target create ""
      cell
        select "" current:target:"":mode
          option "To" "to"
          option "Cc" "cc"
      cell
        var Str cvalue := current:target:"":box
        select "" current:target:"":box noeol
          option "" ""
          var CBool already := false
          each ubm user_database2:data:user:user:bookmark fi
            var Str blabel := (shunt ubm:first_name<>"" ubm:
            var Str bvalue := blabel+" <"+ubm:mailbox+">"
            option blabel bvalue
          if current:keyword<>""
            option "all "+current:keyword "all "+current:key
        input "" current:target:"":box length 30 noeol
      cell
        button "One more line"
          var Str id := string datetime:seconds
          current:target create id
          data_copy current:target:"" current:target:id
          current:target delete ""
          reload_page
      cell [Subject]
      cell
        input "" current:subject length 40
      cell void
    text_input "Message:[lf]" current:body columns 80 rows 2
    var Array:FileInfo files := file_list mail_path+"attach/
    if files:size>0
      var Intn total := 0
      table columns 3
        cell header [Attached file]
        cell header [Size in bytes]
        cell void
        for (var Int i) 0 files:size-1
          cell
            text files:i:name
          cell
            text (string files:i:size)
          cell
            var Str attached_file := files:i:name
            small
              button "discard"
                file_delete mail_path+"attach/"+user+"/"+att
                reload_page
          total += files:i:size
        cell header [Total]
        cell
          text string:total+" ("+(string (total+2^19)\2^20)+
        cell void
    file_upload "File name: " (var Str attach) noeol
    button "Attach the file"
      var Str remote := attach option "remote_name" Str
      file_move attach mail_path+"attach/"+user+"/"+remote
      reload_page
    para
      button "Reset the mail" noeol
        title "Reset the mail"
        [Are you sure you want to reset the mail content wit
        button "Yes" noeol
          mail_reset user
          goto_backward
        button "No"
          goto_backward
      button "Save the current content" noeol
        reload_page
      button "Preview then send"
        plugin outgoing_mail_control
        var CBool some := false
        each t current:target
          if t:box<>""
            some := true
        if not some
          [You have not set any recipient for the mail !]
          para
            button "edit again"
              goto_backward
        else
          goto_url "preview" no_extension
    para
      input "Keyword: " current:keyword noeol
      button "Select bookmarks matching the keyword"
        reload_page
      


        var CBool some := false
        each t current:target
          if t:box<>""
            some := true
        if not some
          [You have not set any recipient for the mail !]
          para
            button "edit again"
              goto_backward
        else
          goto_url "preview" no_extension
    para
      input "Keyword: " current:keyword noeol
      button "Select bookmarks matching the keyword"
        reload_page