Ignore:
Timestamp:
May 18, 2014, 12:04:36 AM (10 years ago)
Author:
mistic100
Message:

feature 3080 : simpler date inputs (one input + fontello + picker selects)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/batch_manager_global.php

    r28490 r28497  
    287287  if ('date_creation' == $action)
    288288  {
    289     $date_creation = sprintf(
    290       '%u-%u-%u',
    291       $_POST['date_creation_year'],
    292       $_POST['date_creation_month'],
    293       $_POST['date_creation_day']
    294       );
    295 
    296     if (isset($_POST['remove_date_creation']))
     289    if (isset($_POST['remove_date_creation']) || empty($_POST['date_creation']))
    297290    {
    298291      $date_creation = null;
     292    }
     293    else
     294    {
     295      $date_creation = $_POST['date_creation'].' 00:00:00';
    299296    }
    300297
     
    568565
    569566// creation date
    570 $day =
    571 empty($_POST['date_creation_day']) ? date('j') : $_POST['date_creation_day'];
    572 
    573 $month =
    574 empty($_POST['date_creation_month']) ? date('n') : $_POST['date_creation_month'];
    575 
    576 $year =
    577 empty($_POST['date_creation_year']) ? date('Y') : $_POST['date_creation_year'];
    578 
    579 $month_list = $lang['month'];
    580 $month_list[0]='------------';
    581 ksort($month_list);
    582 $template->assign( array(
    583       'month_list'         => $month_list,
    584       'DATE_CREATION_DAY'  => (int)$day,
    585       'DATE_CREATION_MONTH'=> (int)$month,
    586       'DATE_CREATION_YEAR' => (int)$year,
    587     )
     567$template->assign('DATE_CREATION',
     568  empty($_POST['date_creation']) ? date('y-n-j') : $_POST['date_creation']
    588569  );
    589570
Note: See TracChangeset for help on using the changeset viewer.