Skip to content

Commit

Permalink
bug:2822 editing photo replaces date_creation time to 00:00:00
Browse files Browse the repository at this point in the history
git-svn-id: http://piwigo.org/svn/trunk@20531 68402e56-0260-453c-a942-63ccdbb3a9ee
  • Loading branch information
mistic100 committed Feb 3, 2013
1 parent 5b22fce commit f7d9501
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
10 changes: 7 additions & 3 deletions admin/picture_modify.php
Expand Up @@ -146,7 +146,8 @@
$data{'date_creation'} =
$_POST['date_creation_year']
.'-'.$_POST['date_creation_month']
.'-'.$_POST['date_creation_day'];
.'-'.$_POST['date_creation_day']
.' '.$_POST['date_creation_time'];
}
else
{
Expand Down Expand Up @@ -349,18 +350,20 @@
if (isset($_POST['date_creation_action'])
and 'set' == $_POST['date_creation_action'])
{
foreach (array('day', 'month', 'year') as $varname)
foreach (array('day', 'month', 'year', 'time') as $varname)
{
$$varname = $_POST['date_creation_'.$varname];
}
}
else if (isset($row['date_creation']) and !empty($row['date_creation']))
{
list($year, $month, $day) = explode('-', $row['date_creation']);
list($year, $month, $day) = explode('-', substr($row['date_creation'],0,10));
$time = substr($row['date_creation'],11);
}
else
{
list($year, $month, $day) = array('', 0, 0);
$time = '00:00:00';
}


Expand All @@ -373,6 +376,7 @@
'DATE_CREATION_DAY_VALUE' => $day,
'DATE_CREATION_MONTH_VALUE' => $month,
'DATE_CREATION_YEAR_VALUE' => $year,
'DATE_CREATION_TIME_VALUE' => $time,
'month_list' => $month_list,
)
);
Expand Down
3 changes: 2 additions & 1 deletion admin/themes/default/template/picture_modify.tpl
Expand Up @@ -104,7 +104,8 @@ pwg_initialization_datepicker("#date_creation_day", "#date_creation_month", "#da

<input id="date_creation_year" name="date_creation_year" type="text" size="4" maxlength="4" value="{$DATE_CREATION_YEAR_VALUE}">
<input id="date_creation_linked_date" name="date_creation_linked_date" type="hidden" size="10" disabled="disabled">
<a href="#" id="unset_date_creation" style="display:none">unset</a>
<input name="date_creation_time" type="hidden" value="{$DATE_CREATION_TIME_VALUE}">
<a href="#" id="unset_date_creation" style="display:none">unset</a>
</p>

<p>
Expand Down

0 comments on commit f7d9501

Please sign in to comment.