Changeset 887 for trunk/Common/Form/Types/Time.php
- Timestamp:
- Nov 20, 2020, 12:08:12 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Common/Form/Types/Time.php
r874 r887 5 5 class TypeTime extends TypeBase 6 6 { 7 var $DatabaseCompareOperators = array('Rovno' => '=', 'Nerovno' => '!=', 'Menší' => '<', 'Větší' => '>'); 7 function __construct(FormManager $FormManager) 8 { 9 parent::__construct($FormManager); 10 $this->DatabaseCompareOperators = array('Rovno' => '=', 'Nerovno' => '!=', 'Menší' => '<', 'Větší' => '>'); 11 } 8 12 9 function OnView( $Item)13 function OnView(array $Item): ?string 10 14 { 11 15 if ($Item['Value'] == 0) return ''; … … 17 21 } 18 22 19 function OnEdit( $Item)23 function OnEdit(array $Item): string 20 24 { 21 25 if (($Item['Value'] == null) or (($Item['Value'] !== null) and ((strtolower($Item['Value']) == 'now') or (strtolower($Item['Value']) == '')))) … … 24 28 $IsNull = true; 25 29 } else $IsNull = false; 26 $ Parts = getdate($Item['Value']);30 $TimeParts = getdate($Item['Value']); 27 31 28 32 $Output = ''; … … 70 74 } 71 75 72 function OnLoad( $Item)76 function OnLoad(array $Item): ?string 73 77 { 74 78 if (!array_key_exists($Item['Name'].'-null', $_POST) and array_key_exists('Null', $Item) and ($Item['Null'] == true)) return null; … … 76 80 } 77 81 78 function OnLoadDb( $Item)82 function OnLoadDb(array $Item): ?string 79 83 { 80 84 return MysqlTimeToTime($Item['Value']); 81 85 } 82 86 83 function OnSaveDb( $Item)87 function OnSaveDb(array $Item): ?string 84 88 { 85 89 if ($Item['Value'] == null) return null; … … 87 91 } 88 92 89 function DatabaseEscape( $Value)93 function DatabaseEscape(string $Value): string 90 94 { 91 95 return '"'.addslashes($Value).'"';
Note:
See TracChangeset
for help on using the changeset viewer.