Revision: 1394
          http://mrbs.svn.sourceforge.net/mrbs/?rev=1394&view=rev
Author:   cimorrison
Date:     2010-07-26 15:49:33 +0000 (Mon, 26 Jul 2010)

Log Message:
-----------
Deletion emails now support custom fields

Modified Paths:
--------------
    mrbs/branches/custom_entry_fields/web/functions_mail.inc

Modified: mrbs/branches/custom_entry_fields/web/functions_mail.inc
===================================================================
--- mrbs/branches/custom_entry_fields/web/functions_mail.inc    2010-07-26 
15:36:51 UTC (rev 1393)
+++ mrbs/branches/custom_entry_fields/web/functions_mail.inc    2010-07-26 
15:49:33 UTC (rev 1394)
@@ -652,7 +652,7 @@
 function notifyAdminOnDelete($mail_previous)
 {
   global $typel, $enable_periods, $auth;
-  global $mail_settings;
+  global $mail_settings, $standard_fields, $tbl_entry;
   
   // Get any extra arguments
   $action = (func_num_args() > 1) ? func_get_arg(1) : "delete";
@@ -763,6 +763,25 @@
     $mail_previous['type'] . "?" : $typel[$mail_previous['type']];
   $body .= "\n" . get_mail_vocab("createdby") . ": ";
   $body .= convertToMailCharset($mail_previous['createdby']) . "\n";
+  
+  // Custom fields
+  $fields = sql_field_info($tbl_entry);
+  foreach ($fields as $field)
+  {
+    if (!in_array($field['name'], $standard_fields['entry']))
+    {
+      $key = $field['name'];
+      // Convert any booleans or pseudo-booleans to text strings (in the mail 
language)
+      if (($field['nature'] == 'boolean') || 
+          (($field['nature'] == 'integer') && isset($field['length']) && 
($field['length'] <= 2)) )
+      {
+        $mail_previous[$key] = ($mail_previous[$key]) ? get_mail_vocab("yes") 
: get_mail_vocab("no");
+      }
+      $body .= get_mail_field_name($tbl_entry, $key) . ": ";
+      $body .= convertToMailCharset($mail_previous[$key]) . "\n";
+    }
+  }
+    
   $body .= get_mail_vocab("lastupdate") . ": " . 
convertToMailCharset($mail_previous['updated']);
   $body .= "\n" . get_mail_vocab("rep_type");
   $temp = $mail_previous['rep_type'];


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share 
of $1 Million in cash or HP Products. Visit us here for more details:
http://ad.doubleclick.net/clk;226879339;13503038;l?
http://clk.atdmt.com/CRS/go/247765532/direct/01/
_______________________________________________
Mrbs-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mrbs-commits

Reply via email to