Changeset 665 for trunk/expressoCalendar/inc/class.uicalendar.inc.php
- Timestamp:
- 02/06/09 08:41:18 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/expressoCalendar/inc/class.uicalendar.inc.php
r656 r665 98 98 99 99 $retorno = "<today>".date('Ydm',$dayViewTime)."</today>"; 100 101 $fromBo = $this->db_obj->requestDayCal($dayViewTime);102 100 // Printing results in XML 103 101 for($i = $this->workdaystarts; $i <= $this->workdayends; $i = $i + 0.5) … … 109 107 110 108 $retorno .= "</workday>"; 111 } 112 if (is_array($fromBo)) 113 foreach ($fromBo as $line){ 114 $retorno .= "<calEvent>"; 115 $retorno .= "<id>".$line['cal_id']."</id>"; 116 $retorno .= "<title>".htmlspecialchars($line['title'])."</title>"; 117 $retorno .= "<description>".htmlspecialchars($line['description'])."</description>"; 118 $retorno .= "<edatetime>".($line['edatetime']*1000)."</edatetime>"; 119 $retorno .= "<datetime>".($line['datetime']*1000)."</datetime>"; 120 $retorno .= "</calEvent>"; 121 } 122 123 return $retorno; 124 } 109 } 110 return $retorno; 111 } 112 function getEventsDay () { 113 $dayTime = isset ($_REQUEST["time"]) ? strtotime(substr($_REQUEST["time"],0,4)."-".substr($_REQUEST["time"],6,2)."-".substr($_REQUEST["time"],4,2)) : strtotime(date('Y-m-d', time())); 114 if (isset ($_REQUEST["uid"])) 115 $this->db_obj->user_id = $_REQUEST["uid"]; 116 $fromBo = $this->db_obj->requestDayCal($dayTime); 117 118 if (is_array($fromBo)) 119 foreach ($fromBo as $line){ 120 $retorno .= "<calevent>"; 121 $retorno .= "<id>".$line['cal_id']."</id>"; 122 $retorno .= "<title>".htmlspecialchars($line['title'])."</title>"; 123 $retorno .= "<description>".htmlspecialchars($line['description'])."</description>"; 124 $retorno .= "<edatetime>".($line['edatetime']*1000)."</edatetime>"; 125 $retorno .= "<datetime>".($line['datetime']*1000)."</datetime>"; 126 $retorno .= "</calevent>"; 127 } 128 return $retorno; 129 } 130 125 131 function getViewWeek () { 126 132 $dayViewTime = isset ($_REQUEST["time"]) ? strtotime(substr($_REQUEST["time"],0,4)."-".substr($_REQUEST["time"],6,2)."-".substr($_REQUEST["time"],4,2)) : strtotime(date('Y-m-d', time())); … … 129 135 if (isset ($_REQUEST["uid"])) 130 136 $this->db_obj->user_id = $_REQUEST["uid"]; 131 132 133 $fromBo = $this->db_obj->requestWeekCal($dayViewTime);134 137 135 138 for($i = $this->workdaystarts; $i <= $this->workdayends; $i = $i + 0.5){ … … 146 149 } 147 150 151 return $retorno; 152 } 153 function getEventsWeek () { 154 $dayViewTime = isset ($_REQUEST["time"]) ? strtotime(substr($_REQUEST["time"],0,4)."-".substr($_REQUEST["time"],6,2)."-".substr($_REQUEST["time"],4,2)) : strtotime(date('Y-m-d', time())); 155 if (isset($_REQUEST["uid"])) 156 $this->db_obj->user_id = $_REQUEST["uid"]; 157 158 $dayViewTime -= (date('N', $dayViewTime)%7)*86400; 159 $retorno = "<today>".date('Ydm', $dayViewTime)."</today>"; 160 if (isset ($_REQUEST["uid"])) 161 $this->db_obj->user_id = $_REQUEST["uid"]; 162 163 164 $fromBo = $this->db_obj->requestWeekCal($dayViewTime); 165 148 166 149 167 // Printing results in XML … … 151 169 foreach ($fromBo as $line) { 152 170 if ($line['datetime'] > 0){ 153 $retorno .= "<cal Event>";171 $retorno .= "<calevent>"; 154 172 $retorno .= "<id>".$line['cal_id']."</id>"; 155 173 $retorno .= "<title>".htmlspecialchars($line['title'])."</title>"; … … 157 175 $retorno .= "<edatetime>".($line['edatetime']*1000)."</edatetime>"; 158 176 $retorno .= "<datetime>".($line['datetime']*1000)."</datetime>"; 159 $retorno .= "</cal Event>";177 $retorno .= "</calevent>"; 160 178 } 161 179 } 162 180 return $retorno; 163 181 } 182 164 183 165 184 function getDetails (){ … … 171 190 return $buff; 172 191 } 173 192 function getEventsMonth () { 193 $monthViewTime = isset ($_REQUEST["time"]) ? strtotime(substr($_REQUEST["time"],0,4)."-".substr($_REQUEST["time"],6,2)."-".substr($_REQUEST["time"],4,2)) : strtotime(date('Y-m-d', time())); 194 $todayTime = strtotime(date('Y-m', $monthViewTime)."-01"); 195 if (isset($_REQUEST["uid"])) 196 $this->db_obj->user_id = $_REQUEST["uid"]; 197 198 $fromBo = $this->db_obj->requestMonthCal($todayTime); 199 200 // Printing results in XML 201 if (is_array($fromBo)) 202 foreach ($fromBo as $line) { 203 if ($line['datetime'] > 0){ 204 $retorno .= "<calevent>"; 205 $retorno .= "<id>".$line['cal_id']."</id>"; 206 $retorno .= "<title>".htmlspecialchars($line['title'])."</title>"; 207 $retorno .= "<edatetime>".($line['edatetime']*1000)."</edatetime>"; 208 $retorno .= "<datetime>".($line['datetime']*1000)."</datetime>"; 209 $retorno .= "</calevent>"; 210 } 211 } 212 return $retorno; 213 } 214 174 215 function getViewMonth () { 175 216 $monthViewTime = isset ($_REQUEST["time"]) ? strtotime(substr($_REQUEST["time"],0,4)."-".substr($_REQUEST["time"],6,2)."-".substr($_REQUEST["time"],4,2)) : strtotime(date('Y-m-d', time())); … … 179 220 $todayTime = strtotime(date('Y-m', $monthViewTime)."-01"); 180 221 $retorno = "<today>".date('Ydm', $monthViewTime)."</today>"; 181 $fromBo = $this->db_obj->requestMonthCal($todayTime);182 222 183 223 for ($i=1;$i<=date('t',$monthViewTime);$i++){ … … 199 239 } 200 240 201 241 return $retorno; 242 } 243 function getViewYear () { 244 $monthViewTime = isset ($_REQUEST["time"]) ? strtotime(substr($_REQUEST["time"],0,4)."-".substr($_REQUEST["time"],6,2)."-".substr($_REQUEST["time"],4,2)) : strtotime(date('Y-m-d', time())); 245 246 $todayTime = strtotime(date('Y-m', $monthViewTime)."-01"); 247 $retorno = "<today>".date('Ydm', $monthViewTime)."</today>"; 248 249 $fromBo = $this->db_obj->requestYearCal($todayTime); 202 250 // Printing results in XML 203 251 if (is_array($fromBo)) 204 252 foreach ($fromBo as $line) { 205 253 if ($line['datetime'] > 0){ 206 $retorno .= "<calEvent>"; 207 $retorno .= "<id>".$line['cal_id']."</id>"; 208 $retorno .= "<title>".htmlspecialchars($line['title'])."</title>"; 209 $retorno .= "<edatetime>".($line['edatetime']*1000)."</edatetime>"; 210 $retorno .= "<datetime>".($line['datetime']*1000)."</datetime>"; 211 $retorno .= "</calEvent>"; 212 } 213 } 214 return $retorno; 215 } 216 function getViewYear () { 217 $monthViewTime = isset ($_REQUEST["time"]) ? strtotime(substr($_REQUEST["time"],0,4)."-".substr($_REQUEST["time"],6,2)."-".substr($_REQUEST["time"],4,2)) : strtotime(date('Y-m-d', time())); 218 219 $todayTime = strtotime(date('Y-m', $monthViewTime)."-01"); 220 $retorno = "<today>".date('Ydm', $monthViewTime)."</today>"; 221 222 $fromBo = $this->db_obj->requestYearCal($todayTime); 223 // Printing results in XML 224 if (is_array($fromBo)) 225 foreach ($fromBo as $line) { 226 if ($line['datetime'] > 0){ 227 $retorno .= "<calEvent>"; 254 $retorno .= "<calevent>"; 228 255 $retorno .= "<id>".$line['cal_id']."</id>"; 229 256 $retorno .= "<datetime>".($line['datetime']*1000)."</datetime>"; 230 $retorno .= "</cal Event>";257 $retorno .= "</calevent>"; 231 258 } 232 259 }
Note: See TracChangeset
for help on using the changeset viewer.