[dev] Ingo: Vacation...

Marc Jauvin marc at register4less.com
Tue Jun 17 10:56:48 PDT 2003


Chuck Hagenbuch <chuck at horde.org> wrote:

> Quoting Marc Jauvin <marc at register4less.com>:
>
> > I propose the addition of two things in the Vacation Form:
> >
> >  - a checkbox that says "keep a copy of the received message?"
> >  - allow the additions of (optional) RULES to trigger the vacation
> > message.
>
> As long as it's all presented only if the backend supports it, sounds fine
> to me...

What about this patch?

--
Marc Jauvin
450-441-5458
http://register4less.com
-------------- next part --------------
Index: vacation.php
===================================================================
RCS file: /repository/ingo/vacation.php,v
retrieving revision 1.13
diff -u -r1.13 vacation.php
--- vacation.php	13 Jun 2003 21:29:40 -0000	1.13
+++ vacation.php	17 Jun 2003 17:53:10 -0000
@@ -33,6 +33,7 @@
     $vacation['addresses'] = Horde::getFormData('addresses');
     $vacation['subject'] = Horde::getFormData('subject', '');
     $vacation['reason'] = Horde::getFormData('reason', '');
+    $vacation['keep'] = Horde::getFormData('keep') == '1';
     
     if (empty($vacation['addresses'])) {
         $notification->push(_("You must specify at least one email address for which the vaction messages should be activated."), 'horde.error');
Index: lib/Script/sieve.php
===================================================================
RCS file: /repository/ingo/lib/Script/sieve.php,v
retrieving revision 1.22
diff -u -r1.22 sieve.php
--- lib/Script/sieve.php	12 Jun 2003 19:30:12 -0000	1.22
+++ lib/Script/sieve.php	17 Jun 2003 17:53:10 -0000
@@ -203,6 +203,9 @@
                               'addresses' => $vacation['addresses'],
                               'reason' => $vacation['reason']);
 
+                if (!empty($vacation['keep'])) {
+                    $action[] = &new Sieve_Action_Fileinto(array('folder' => 'INBOX'));
+                }
                 $action[] = &new Sieve_Action_Vacation($vals);
 
                 $listHeaders = array();
Index: templates/vacation/vacation.inc
===================================================================
RCS file: /repository/ingo/templates/vacation/vacation.inc,v
retrieving revision 1.7
diff -u -r1.7 vacation.inc
--- templates/vacation/vacation.inc	5 Jun 2003 02:35:12 -0000	1.7
+++ templates/vacation/vacation.inc	17 Jun 2003 17:53:10 -0000
@@ -56,6 +56,12 @@
             <br/>
           </td>
         </tr>
+        <tr>
+          <td>
+            <input type="checkbox" name="keep" value="1" <?php echo (array_key_exists('keep', $vacation) && $vacation['keep'] == '1') ? 'checked' : '' ?> />
+            <?php echo _("Keep a copy of the received email") ?>
+          </td>
+        </tr>
       </table>
     </td>
   </tr>


More information about the dev mailing list