[sork] Code submittal for Forwards

davidpcollins at yahoo.com davidpcollins at yahoo.com
Mon Nov 10 05:18:45 PST 2003


 
Just grabbed the CVS of forwards and added some parsing to the address textbox.  This pulls out all occurences of \username (for saving to their inbox) and checks the box for it instead.  My users were getting confused if they were saving a copy or not so they would keep checking the box and then complain it was broken.  Hopefully this will fix that.

Submitted for your review.. and it probably needs it.  Note the timestamp.  Yes, I've been up all night working on various projects (did this to give myself a break) so brain no working right. :)

David



*** main.inc    Mon Nov 10 07:12:56 2003
--- main.inc-new        Mon Nov 10 07:16:37 2003
***************
*** 31,38 ****
          <input type="radio" name="mode" value="set" checked="checked">
          <?php echo _("Set/install a forward to:") ?>&nbsp;
          <input type="text" name="where" value="<?php echo $current_target ?>" size="63" maxlength="150">

          <blockquote>
!             <input type="checkbox" name="metoo">
              <?php echo _("Keep a copy in your local mailbox?") ?>
          </blockquote>
--- 31,47 ----
          <input type="radio" name="mode" value="set" checked="checked">
          <?php echo _("Set/install a forward to:") ?>&nbsp;
+         <?php // FIXME: Check Save instead of displaying it in the textbox. Note
+         // the $checked in "metoo". Stops users from getting confused if they
+         // are saving or not.
+         $checked = "";
+         if( preg_match( "/\\\\${imp['user']}/", $current_target ) ) {
+           $checked = "checked";
+         }
+         $current_target = preg_replace( "/, ?\\\\${imp['user']}/", "", $current_target )
+         ?>
          <input type="text" name="where" value="<?php echo $current_target ?>" size="63" maxlength="150">

          <blockquote>
!             <input type="checkbox" name="metoo" <?php echo $checked ?>>
              <?php echo _("Keep a copy in your local mailbox?") ?>
          </blockquote>



More information about the sork mailing list