Revision: 1667
          http://mrbs.svn.sourceforge.net/mrbs/?rev=1667&view=rev
Author:   cimorrison
Date:     2010-12-04 16:38:45 +0000 (Sat, 04 Dec 2010)

Log Message:
-----------
Simplified the code.  No functional change.

Modified Paths:
--------------
    mrbs/branches/ics_attachments/web/approve_entry_handler.php
    mrbs/branches/ics_attachments/web/edit_entry_handler.php
    mrbs/branches/ics_attachments/web/functions_mail.inc
    mrbs/branches/ics_attachments/web/mrbs_sql.inc

Modified: mrbs/branches/ics_attachments/web/approve_entry_handler.php
===================================================================
--- mrbs/branches/ics_attachments/web/approve_entry_handler.php 2010-12-03 
16:46:12 UTC (rev 1666)
+++ mrbs/branches/ics_attachments/web/approve_entry_handler.php 2010-12-04 
16:38:45 UTC (rev 1667)
@@ -119,7 +119,7 @@
     // in an undefined index error.
     $enable_periods ? toPeriodString($start_period, $data['duration'], 
$data['dur_units'], FALSE) : toTimeString($data['duration'], 
$data['dur_units'], FALSE);
 
-    $result = notifyAdminOnBooking($is_new_entry, $id, $series, $action);
+    $result = notifyAdminOnBooking($is_new_entry, $series, $action);
   }
 }
 

Modified: mrbs/branches/ics_attachments/web/edit_entry_handler.php
===================================================================
--- mrbs/branches/ics_attachments/web/edit_entry_handler.php    2010-12-03 
16:46:12 UTC (rev 1666)
+++ mrbs/branches/ics_attachments/web/edit_entry_handler.php    2010-12-04 
16:38:45 UTC (rev 1667)
@@ -646,7 +646,7 @@
           }
         }
         // Send the email
-        $result = notifyAdminOnBooking(!isset($id), $new_id, $is_repeat_table);
+        $result = notifyAdminOnBooking(!isset($id), $is_repeat_table);
       }
     }   
   } // end foreach $rooms

Modified: mrbs/branches/ics_attachments/web/functions_mail.inc
===================================================================
--- mrbs/branches/ics_attachments/web/functions_mail.inc        2010-12-03 
16:46:12 UTC (rev 1666)
+++ mrbs/branches/ics_attachments/web/functions_mail.inc        2010-12-04 
16:38:45 UTC (rev 1667)
@@ -329,7 +329,7 @@
   return $result;
 }
 
-function create_body($data, $compare, $new_id, $series, $action, 
$as_html=FALSE)
+function create_body($data, $compare, $series, $action, $as_html=FALSE)
 {
   global $mail_previous, $note, $returl;
   global $enable_periods, $approval_enabled, $confirmation_enabled;
@@ -406,12 +406,12 @@
     // Set the link to view entry page
     if (isset($url_base) && ($url_base != ""))
     {
-      $body .= "$url_base/view_entry.php?id=$new_id";
+      $body .= "$url_base/view_entry.php?id=" . $data['id'];
     }
     else
     {
       ('' != $returl) ? $url = explode(basename($returl), $returl) : '';
-      $body .= $url[0] . "view_entry.php?id=$new_id";
+      $body .= $url[0] . "view_entry.php?id=" . $data['id'];
     }
     if ($series)
     {
@@ -621,14 +621,13 @@
  * Send email to administrator to notify a new/changed entry.
  *
  * @param bool    $new_entry    to know if this is a new entry or not
- * @param int     $new_id       used for create a link to the new entry
  * @return bool                 TRUE or PEAR error object if fails
  */
-function notifyAdminOnBooking($new_entry, $new_id, $series, $action="book")
+function notifyAdminOnBooking($new_entry, $series, $action="book")
 {
   global $data, $mail_previous;
   global $auth, $mail_settings, $approval_enabled;
-  
+
   $recipients = array();
   $cc = array();
   $cc[] = $mail_settings['cc'];
@@ -663,7 +662,7 @@
     // Look for list of area admins emails addresses
     if ($new_entry)
     {
-      $email = get_area_admin_email($new_id, ($data['rep_type'] != REP_NONE));
+      $email = get_area_admin_email($data['id'], ($data['rep_type'] != 
REP_NONE));
       if (!empty($email))
       {
         $recipients[] = $email;
@@ -682,7 +681,7 @@
     // Look for list of room admins email addresses
     if ($new_entry)
     {
-      $email = get_room_admin_email($new_id, ($data['rep_type'] != REP_NONE));
+      $email = get_room_admin_email($data['id'], ($data['rep_type'] != 
REP_NONE));
       if (!empty($email))
       {
         $recipients[] = $email;
@@ -746,13 +745,14 @@
 
   // Create the text body
   $compare = !$new_entry;
-  $text_body = create_body($data, $compare, $new_id, $series, $action);
+  $text_body = array();
+  $text_body['text'] = create_body($data, $compare, $series, $action);
   
   // Create the HTML body
   $html_body = array();
   if ($mail_settings['html'])
   {
-    $html_body['text'] = create_body($data, $compare, $new_id, $series, 
$action, TRUE);
+    $html_body['text'] = create_body($data, $compare, $series, $action, TRUE);
     $html_body['cid'] = generate_global_uid("html");
   }
   
@@ -861,13 +861,14 @@
   
   // Create the text body
   $data = $mail_previous;
-  $text_body = create_body($data, FALSE, 0, $series, $action, FALSE);
+  $text_body = array();
+  $text_body['text'] = create_body($data, FALSE, $series, $action, FALSE);
   
   // Create the HTML body
   $html_body = array();
   if ($mail_settings['html'])
   {
-    $html_body['text'] = create_body($data, FALSE, $new_id, $series, $action, 
TRUE);
+    $html_body['text'] = create_body($data, FALSE, $series, $action, TRUE);
     $html_body['cid'] = generate_global_uid("html");
   }
   
@@ -1075,7 +1076,7 @@
   $mime_params['content_type'] = "text/plain";
   $mime_params['encoding']     = "7bit";
   $mime_params['charset']      = $charset;
-  $text = $mime->addSubPart($text_body, $mime_params);
+  $text = $mime->addSubPart($text_body['text'], $mime_params);
   
   // Add the HTML mail
   if (!empty($html_body))

Modified: mrbs/branches/ics_attachments/web/mrbs_sql.inc
===================================================================
--- mrbs/branches/ics_attachments/web/mrbs_sql.inc      2010-12-03 16:46:12 UTC 
(rev 1666)
+++ mrbs/branches/ics_attachments/web/mrbs_sql.inc      2010-12-04 16:38:45 UTC 
(rev 1667)
@@ -778,7 +778,6 @@
   {
     switch ($field['name'])
     {
-      case 'id':
       case 'entry_type':
         // Nothing to do
         break;


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

------------------------------------------------------------------------------
What happens now with your Lotus Notes apps - do you make another costly 
upgrade, or settle for being marooned without product support? Time to move
off Lotus Notes and onto the cloud with Force.com, apps are easier to build,
use, and manage than apps on traditional platforms. Sign up for the Lotus 
Notes Migration Kit to learn more. http://p.sf.net/sfu/salesforce-d2d
_______________________________________________
Mrbs-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mrbs-commits

Reply via email to