To participate you must create an account on apostrophenow.com. If you have already done so, click Login.

Changeset 1866

Show
Ignore:
Timestamp:
07/30/2010 08:44:58 PM (6 weeks ago)
Author:
dordille
Message:

Made new fields start_time and end_time for events.
Added new time widget.

Location:
plugins/apostropheBlogPlugin/trunk
Files:
2 added
4 modified

Legend:

Unmodified
Added
Removed
  • plugins/apostropheBlogPlugin/trunk/config/doctrine/schema.yml

    r1291 r1866  
    221221    keyValue: 'event' 
    222222  columns: 
    223     start_date: timestamp 
    224     end_date: timestamp 
     223    start_date: date 
     224    start_time: time 
     225    end_date: date 
     226    end_time: time 
    225227     
    226228aEventSlot: 
  • plugins/apostropheBlogPlugin/trunk/lib/form/doctrine/PluginaEventForm.class.php

    r1576 r1866  
    1919    parent::setup(); 
    2020 
    21     $this->setWidget('start_date', new sfWidgetFormJQueryDateTime( 
    22                         array('date' => array('image' => '/apostrophePlugin/images/a-icon-datepicker.png')) 
    23                 )); 
    24      
    25     $this->setValidator('start_date', new sfValidatorDateTime( 
     21    $this->setWidget('start_date', new sfWidgetFormJQueryDate( 
     22                        array('image' => '/apostrophePlugin/images/a-icon-datepicker.png')) 
     23                ); 
     24 
     25    $this->setValidator('start_date', new sfValidatorDate( 
    2626      array( 
    2727        'required' => true, 
    2828      ))); 
    2929 
    30     $this->setWidget('end_date', new sfWidgetFormJQueryDateTime( 
    31                         array('date' => array('image' => '/apostrophePlugin/images/a-icon-datepicker.png')) 
    32                 )); 
     30    $this->setWidget('start_time', new aWidgetFormJQueryTime(array(), array('size' => 8))); 
     31    $this->setValidator('start_time', new sfValidatorTime(array('required' => false, 'time_output' => 'g:iA'))); 
    3332 
    34     $this->setValidator('end_date', new sfValidatorDateTime( 
     33    $this->setWidget('end_date', new sfWidgetFormJQueryDate( 
     34                        array('image' => '/apostrophePlugin/images/a-icon-datepicker.png')) 
     35                ); 
     36 
     37    $this->setValidator('end_date', new sfValidatorDate( 
    3538      array( 
    3639        'required' => true, 
    3740      ))); 
    3841 
    39     if($this->getObject()->getStartDate() == $this->getObject()->getEndDate()) 
    40     { 
    41       $this->getWidget('start_date')->addOption('with_time', false); 
    42       $this->getWidget('end_date')->addOption('with_time', false); 
    43     } 
     42    $this->setWidget('end_time', new aWidgetFormJQueryTime(array(), array('size' => 8))); 
     43    $this->setValidator('end_time', new sfValidatorTime(array('required' => false, 'time_output' => 'g:iA'))); 
    4444 
    4545    $this->getWidgetSchema()->setDefault('start_date', date('Y/m/d')); 
  • plugins/apostropheBlogPlugin/trunk/modules/aEventAdmin/templates/_form.php

    r1816 r1866  
    11<?php use_helper('I18N','jQuery') ?> 
     2<?php $sf_response->addJavascript('/apostropheBlogPlugin/js/timepicker.js', 'last') ?> 
     3 
    24 
    35<?php echo jq_form_remote_tag(array('url' => url_for('a_event_admin_update',$a_event) , 'update' => 'a-admin-blog-post-form'), array('id'=>'a-admin-form', 'class' => 'blog')) ?> 
     
    4749                <?php echo $form['start_date']->render(array('beforeShow' => 'aBlogSetDateRange', 'onClose' => 'aBlogUpdateMulti')) ?> 
    4850                <?php echo $form['start_date']->renderError() ?> 
     51    <?php echo $form['start_time'] ?> 
     52    <?php echo $form['start_time']->renderError() ?> 
    4953        </div> 
    5054        <h4>End Date</h4> 
     
    5256                <?php echo $form['end_date']->render(array('beforeShow' => 'aBlogSetDateRange', 'onClose' => 'aBlogUpdateMulti')) ?> 
    5357                <?php echo $form['end_date']->renderError() ?> 
     58    <?php echo $form['end_time'] ?> 
     59    <?php echo $form['end_time']->renderError() ?> 
    5460        </div> 
    5561</div> 
  • plugins/apostropheBlogPlugin/trunk/web/css/aBlog.css

    r1816 r1866  
    870870        color: #999; 
    871871} 
     872 
     873#timepicker 
     874{ 
     875  position: absolute; 
     876  display: none; 
     877  padding: 0; 
     878  margin: 0; 
     879  float: left; 
     880  overflow: auto; 
     881  height: 100px; 
     882  background-color: #ffffff; 
     883} 
     884 
     885#timepicker .time-item 
     886{ 
     887  padding: 3px; 
     888} 
     889#timepicker .time-item:hover 
     890{ 
     891  background-color: #ddddff; 
     892}