Fixed default view not showing your currently selected view, fix defaultcalendar not being deleted from the preferences table, added in lang() for default view

This commit is contained in:
jengo 2000-12-08 03:30:25 +00:00
parent 12aa79761b
commit 3ed5f3f280

View File

@ -19,6 +19,7 @@
if ($submit) { if ($submit) {
$phpgw->preferences->preferences_delete("byapp",$phpgw_info["user"]["account_id"],"calendar"); $phpgw->preferences->preferences_delete("byapp",$phpgw_info["user"]["account_id"],"calendar");
$phpgw->preferences->preferences_delete("byappvar",$phpgw_info["user"]["account_id"],"common|defaultcalendar");
$phpgw->preferences->preferences_add($phpgw_info["user"]["account_id"],"weekdaystarts","calendar"); $phpgw->preferences->preferences_add($phpgw_info["user"]["account_id"],"weekdaystarts","calendar");
$phpgw->preferences->preferences_add($phpgw_info["user"]["account_id"],"workdaystarts","calendar"); $phpgw->preferences->preferences_add($phpgw_info["user"]["account_id"],"workdaystarts","calendar");
@ -48,7 +49,7 @@
</tr> </tr>
<?php $tr_color = $phpgw->nextmatchs->alternate_row_color($tr_color); ?> <?php $tr_color = $phpgw->nextmatchs->alternate_row_color($tr_color); ?>
<tr bgcolor="<?php echo $tr_color; ?>"> <tr bgcolor="<?php echo $tr_color; ?>">
<td><?php echo lang("show high priority events on main screen"); ?> ?</td> <td><?php echo lang("show day view on main screen"); ?> ?</td>
<td align="center"><input type="checkbox" name="mainscreen_showevents" value="Y" <?php <td align="center"><input type="checkbox" name="mainscreen_showevents" value="Y" <?php
if ($phpgw_info["user"]["preferences"]["calendar"]["mainscreen_showevents"] == "Y") echo " checked"; if ($phpgw_info["user"]["preferences"]["calendar"]["mainscreen_showevents"] == "Y") echo " checked";
?>> ?>>
@ -107,15 +108,17 @@
<td><?php echo lang("default calendar view"); ?></td> <td><?php echo lang("default calendar view"); ?></td>
<td align="center"> <td align="center">
<select name="defaultcalendar"> <select name="defaultcalendar">
<option value="year.php"<?php if($phpgw_info["user"]["preferences"]["common"]["defaultcalendar"] == "year.php") " selected"; ?>>Yearly</option> <?php
<?php $selected = array();
echo "<option value=\"index.php\""; $selected[$phpgw_info["user"]["preferences"]["common"]["defaultcalendar"]] = " selected";
if(!isset($phpgw_info["user"]["preferences"]["common"]["defaultcalendar"]) || $phpgw_info["user"]["preferences"]["common"]["defaultcalendar"] == "index.php") if (! isset($phpgw_info["user"]["preferences"]["common"]["defaultcalendar"]) || $phpgw_info["user"]["preferences"]["common"]["defaultcalendar"] == "index.php") {
echo " selected"; $selected["index.php"] = " selected";
echo ">Monthly</option>"; }
?> ?>
<option value="week.php"<?php if($phpgw_info["user"]["preferences"]["common"]["defaultcalendar"] == "week.php") " selected"; ?>>Weekly</option> <option value="year.php"<?php echo $selected["year.php"] . ">" . lang("Yearly"); ?></option>
<option value="day.php"<?php if($phpgw_info["user"]["preferences"]["common"]["defaultcalendar"] == "day.php") " selected"; ?>>Daily</option> <option value="month.php"<?php echo $selected["month.php"] . ">" . lang("Monthly"); ?></option>
<option value="week.php"<?php echo $selected["week.php"] . ">" . lang("Weekly"); ?></option>
<option value="day.php"<?php echo $selected["day.php"] . ">" . lang("Daily"); ?></option>
</select> </select>
</td> </td>
</tr> </tr>