Go to the documentation of this file.00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00038
00050 function formatDate($timestampStart, $timestampEnd, $singleRotation)
00051 {
00052
00053 $start = new TimestampToDate();
00054 $end = new TimestampToDate();
00055
00056 $start->ttd( $timestampStart );
00057 $end->ttd( $timestampEnd );
00058
00059 if ($start->day_of_year == $end->day_of_year)
00060 {
00061
00062
00063
00064 $timestring = "$start->hour_long:$start->minutes-$end->hour_long:$end->minutes
00065 $start->day_of_month. $start->monthname $start->year_long";
00066 }
00067 else
00068 {
00069 if ( $start->monthnumber == $end->monthnumber)
00070 {
00071
00072
00073
00074
00075 $timestring = "$start->hour_long:$start->minutes-$end->hour_long:$end->minutes<br>
00076 $start->day_of_month. - $end->day_of_month. $start->monthname $start->year_long";
00077 }
00078 else
00079 {
00080
00081
00082
00083
00084
00085 $timestring = "$start->hour_long:$start->minutes-$end->hour_long:$end->minutes<br>
00086 $start->day_of_month. $start->monthname $end->year_long - <br>
00087 $end->day_of_month. $end->monthname $start->year_long";
00088
00089 }
00090 }
00091 if ($singleRotation)
00092 {
00093 $timestring = "$start->hour_long:$end->minutes-$end->hour_long:$end->minutes $end->day_of_month. $end->monthname $end->year_long";
00094
00095 }
00096
00097
00098 return $timestring;
00099 }
00100
00120 function createTable($Dates,$DateID, $Gui , $db, $mode)
00121 {
00122 global $DP_language;
00123 for ( $i = 0; $i < sizeof($Dates); $i++ )
00124 {
00125 if ( $Dates[$i][6] == 0 )
00126 {
00127
00128 $formattedtime = formatDate($Dates[$i][1], $Dates[$i][2], false);
00129 }
00130 else
00131 {
00132
00133 $formattedtime = formatDate($Dates[$i][6], $Dates[$i][2], true);
00134 }
00135
00136 $timestamp = $Dates[$i][6];
00137 $id = $Dates[$i][0];
00138 if ($mode != "0")
00139 {
00140
00141
00142 $col1 = "<input type='radio' name=$DateID value='ok-$id-$timestamp'>";
00143 }
00144 else
00145 {
00146
00147 $col1 = "";
00148 }
00149 $col2 = "<input type='radio' name=$DateID value='del-$id-$timestamp'>";
00150 $col3 = "<input type='radio' checked name=$DateID value='noChange-$id-$timestamp'>";
00151 $col4 = "$formattedtime";
00152 $col5 = $Dates[$i][3];
00153 $col6 = $db->getGroupName($Dates[$i][4]);
00154
00155 if ( $Dates[$i][6] == 0 )
00156 {
00157
00158 switch ($Dates[$i][5])
00159 {
00160
00161 case 0:
00162 $col7 = $DP_language[r_nonrecurring];
00163 break;
00164 case 1:
00165 $col7 = $DP_language[r_day];
00166 break;
00167 case 2:
00168 $col7 = $DP_language[r_week];
00169 break;
00170 case 3:
00171 $col7 = $DP_language[r_14];
00172 break;
00173 case 4:
00174 $col7 = $DP_language[r_4_weeks];
00175 break;
00176 case 5:
00177 $col7 = $DP_language[r_month];
00178 break;
00179 case 6:
00180 $col7 = $DP_language[r_halfyear];
00181 break;
00182 case 7:
00183 $col7 = $DP_language[r_year];
00184 break;
00185 default:
00186 $col7 = " ";
00187 }
00188 }
00189 else
00190 {
00191
00192 $col7 = $DP_language[singleDate];
00193
00194 }
00195
00196
00197 eval ("\$Termine = \"".$Gui->getTemplate("inbox_dates")."\";");
00198 $x = $x.$Termine;
00199
00200 $DateID++;
00201 }
00202 $Termine = $x;
00203 $retArray = array($DateID, $Termine);
00204 return $retArray;
00205 }
00206
00217 function getContent($DB)
00218 {
00219
00220 global $DP_UId;
00221
00222
00223 $newDates = $DB->getchangedDates($DP_UId, 0);
00224 $changedDates = $DB->getchangedDates($DP_UId, 1);
00225 $deletedDates = $DB->getchangedDates($DP_UId, 2);
00226
00227 $DATE[0]=$newDates;
00228 $DATE[1]=$changedDates;
00229 $DATE[2]=$deletedDates;
00230 return $DATE;
00231
00232 }
00233
00251 function setInboxView($Gui, $DB)
00252 {
00253 global $DP_language, $DP_CSS, $_SESSION, $templatefolder , $actualtemplate;
00254
00255 $DATE = getContent($DB);
00256 $newDates = $DATE[0];
00257 $changedDates = $DATE[1];
00258 $deletedDates = $DATE[2];
00259
00260
00261 $DateID = 0;
00262
00263 if ($newDates != false)
00264 {
00265
00266 $array = createTable($newDates, $DateID, $Gui, $DB, 1);
00267 $DateID = $array[0];
00268 $neueTermine = $array[1];
00269 eval ("\$tblhead_newdates = \"".$Gui->getTemplate("inbox_tblheadnewdates")."\";");
00270 }
00271 else
00272 {
00273 $neueTermine = "<tr class='tblrow2'><td align='center' colspan=7 >$DP_language[no_entry]</td></tr>";
00274 }
00275
00276
00277
00278 if ($changedDates != false)
00279 {
00280 $array = createTable($changedDates,$DateID, $Gui, $DB, 1);
00281 $DateID = $array[0];
00282 $geaenderteTermine = $array[1];
00283 eval ("\$tblhead_changeddates = \"".$Gui->getTemplate("inbox_tblheadchangeddates")."\";");
00284 }
00285 else
00286 {
00287 $geaenderteTermine = "<tr class='tblrow2'><td align='center' colspan=7 >$DP_language[no_entry]</td></tr>";
00288 }
00289
00290
00291 if ($deletedDates != false)
00292 {
00293 $array = createTable($deletedDates,$DateID, $Gui, $DB, 0);
00294 $DateID = $array[0];
00295 $geloeschteTermine = $array[1];
00296 eval ("\$tblhead_deleteddates = \"".$Gui->getTemplate("inbox_tblheaddeleteddates")."\";");
00297 }
00298 else
00299 {
00300 $geloeschteTermine = "<tr class='tblrow2'><td align='center' colspan=7 >$DP_language[no_entry]</td></tr>";
00301 }
00302
00303 $tableBorder = 1;
00304
00305 if($tblhead_deleteddates or $tblhead_changeddates or $tblhead_newdates) {
00306 eval ("\$execute = \"".$Gui->getTemplate("inbox_btnexecute")."\";");
00307 }
00308
00309 eval ("\$centertxt = \"".$Gui->getTemplate("inbox_main")."\";");
00310
00311 Return $centertxt;
00312 }
00313 ?>