]> git.mjollnir.org Git - moodle.git/commitdiff
Importing fixes from MOODLE_14_STABLE
authordefacer <defacer>
Thu, 26 Aug 2004 10:52:00 +0000 (10:52 +0000)
committerdefacer <defacer>
Thu, 26 Aug 2004 10:52:00 +0000 (10:52 +0000)
calendar/event.php
calendar/lib.php

index 1b44b1da7631e4406d776fa5578e08cd70a4ad33..ec1af92eedf5bddae9c40f5dda2aacb37045df55 100644 (file)
             if($form = data_submitted()) {
 
                 $form->name = strip_tags($form->name);  // Strip all tags
-                $form->description = clean_text($form->description , $form->format);   // Clean up any bad tags
+                //$form->description = clean_text($form->description , $form->format);   // Clean up any bad tags
 
                 $form->timestart = make_timestamp($form->startyr, $form->startmon, $form->startday, $form->starthr, $form->startmin);
                 if($form->duration == 1) {
             if(!empty($form) && $form->type == 'defined') {
 
                 $form->name = strip_tags($form->name);  // Strip all tags
-                $form->description = clean_text($form->description , $form->format);   // Clean up any bad tags
+                //$form->description = clean_text($form->description , $form->format);   // Clean up any bad tags
 
                 $form->timestart = make_timestamp($form->startyr, $form->startmon, $form->startday, $form->starthr, $form->startmin);
                 if($form->duration == 1) {
index 95fbbf60441752fa4673ed5c5239a5372de6c302..4701fecf68fdb17e6db3cad2e3e44d988822021c 100644 (file)
@@ -410,10 +410,7 @@ function calendar_sql_where($tstart, $tend, $users, $groups, $courses, $withdura
     }
     else if($users === false) {
         // No user at all
-        if(!empty($whereclause)) {
-            $whereclause .= ' OR';
-        }
-        $whereclause .= ' 0';
+        // No need to do anything
     }
     if(is_array($groups) && !empty($groups)) {
         // Events from a number of groups
@@ -440,10 +437,7 @@ function calendar_sql_where($tstart, $tend, $users, $groups, $courses, $withdura
         }
         else {
             // This means NO courses, not that we don't care!
-            if(!empty($whereclause)) {
-                $whereclause .= ' OR';
-            }
-            $whereclause .= ' 0';
+            // No need to do anything
         }
     }
     else if(is_numeric($courses)) {
@@ -477,7 +471,7 @@ function calendar_sql_where($tstart, $tend, $users, $groups, $courses, $withdura
         $whereclause = $timeclause;
     }
 
-    return $whereclause;
+    return empty($whereclause) ? false : $whereclause;
 }
 
 function calendar_top_controls($type, $data) {
@@ -1169,10 +1163,10 @@ function calendar_format_event_time($event, $now, $morehref, $usecommonwords = t
         // Set printable representation
         $eventtime = calendar_get_link_tag($day, CALENDAR_URL.'view.php?view=day'.$morehref.'&amp;', $startdate['mday'], $startdate['mon'], $startdate['year']).' ('.$time.')';
     }
-    
+
     return $eventtime;
 }
-            
+
 if(!function_exists('array_diff_assoc')) {
     // PHP < 4.3.0
     function array_diff_assoc($source, $diff) {