Changeset 455 for trunk


Ignore:
Timestamp:
Oct 30, 2012, 6:51:08 PM (12 years ago)
Author:
chronos
Message:
  • Opraveno: Pokud je položky v databázi typu čas nastavena na NULL, tak ji zobrazuj jako prázdnou ve výpisech.
Location:
trunk/Common
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Common/Global.php

    r452 r455  
    277277}
    278278
    279 function MysqlDateTimeToTime($Time)
    280 {
    281   $Parts = explode(' ', $Time);
     279function MysqlDateTimeToTime($DateTime)
     280{
     281  if($DateTime == '') return(0);     
     282  $Parts = explode(' ', $DateTime);
    282283  $DateParts = explode('-', $Parts[0]);
    283284  $TimeParts = explode(':', $Parts[1]);
     
    286287}
    287288
    288 function MysqlDateToTime($Time)
    289 {
    290   return(MysqlDateTimeToTime($Time.' 0:0:0')); 
     289function MysqlDateToTime($Date)
     290{
     291  if($Date == '') return(0);
     292  return(MysqlDateTimeToTime($Date.' 0:0:0')); 
    291293}
    292294
    293295function MysqlTimeToTime($Time)
    294296{
     297  if($Time == '') return(0);
    295298  return(MysqlDateTimeToTime('0000-00-00 '.$Time)); 
    296299}
  • trunk/Common/Types/Date.php

    r445 r455  
    1111    global $MonthNames;
    1212
     13    if($Item['Value'] == 0) return('');
    1314    if((strtolower($Item['Value']) == 'now') or (strtolower($Item['Value']) == '')) $Item['Value'] = time();
    1415    $Parts = getdate($Item['Value']);
     
    2526    $Parts = getdate($Item['Value']);
    2627
     28    $Output = '';
     29    //if($Item['Value'] == '') $Checked = ' checked="1"'; else $Checked = '';
     30    //$Output .= '<input type="checkbox" name="'.$Item['Name'].'-null"'.$Checked.'/>';
     31
    2732    // Day
    28     $Output = '<select name="'.$Item['Name'].'-day">';
     33    $Output .= '<select name="'.$Item['Name'].'-day">';
    2934    for($I = 1; $I <= 31; $I++)
    3035    {
  • trunk/Common/Types/DateTime.php

    r445 r455  
    1111    global $MonthNames;
    1212   
     13    if($Item['Value'] == 0) return('');
    1314    if((strtolower($Item['Value']) == 'now') or (strtolower($Item['Value']) == '')) $Item['Value'] = time();
    1415    $Parts = getdate($Item['Value']);
  • trunk/Common/Types/Time.php

    r445 r455  
    99  function OnView($Item)
    1010  {
     11    if($Item['Value'] == 0) return('');
    1112    if((strtolower($Item['Value']) == 'now') or (strtolower($Item['Value']) == '')) $Item['Value'] = time();
    1213    $TimeParts = getdate($Item['Value']);
Note: See TracChangeset for help on using the changeset viewer.