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