CC-2951: Allow users to select the starting day of the week

Added system preference in Preference page for user to select the start day of a week
(defaults to Sunday).

Calendar will utilize this information and update the calendar UI accordingly.
This commit is contained in:
Yuchen Wang 2011-10-19 12:42:22 -04:00
parent 0989a1c13f
commit d9186a3bf2
6 changed files with 70 additions and 3 deletions

View file

@ -72,7 +72,7 @@
<?php endforeach; ?>
</ul>
<?php endif; ?>
</dd>
</dd>
<dt id="timezone-label" class="block-display">
<label class="required" for="timezone"><?php echo $this->element->getElement('timezone')->getLabel() ?>
<span class="info-text-small">(Required)</span> :
@ -88,5 +88,32 @@
</ul>
<?php endif; ?>
</dd>
<!-- Week Start Day option -->
<dt id="weekStartDay-label" class="block-display">
<label class="required" for="timezone"><?php echo $this->element->getElement('weekStartDay')->getLabel() ?>:
</label>
</dt>
<dd id="weekStartDay-element" class="block-display">
<?php $i=0;
$value = $this->element->getElement('weekStartDay')->getValue();
?>
<select id="weekStartDay" name="weekStartDay">
<?php foreach ($this->element->getElement('weekStartDay')->getMultiOptions() as $option) : ?>
<option value="<?php echo $i ?>" <?php if($i == $value){echo 'selected="selected"';}?> >
<?php echo $option ?>
</option>
<?php $i = $i + 1; ?>
<?php endforeach; ?>
</select>
<?php if($this->element->getElement('weekStartDay')->hasErrors()) : ?>
<ul class='errors'>
<?php foreach($this->element->getElement('weekStartDay')->getMessages() as $error): ?>
<li><?php echo $error; ?></li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
</dd>
</dl>
</fieldset>