Changeset 639 for trunk/Common/Form/Types
- Timestamp:
- Mar 16, 2014, 1:33:22 AM (11 years ago)
- Location:
- trunk/Common/Form/Types
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Common/Form/Types/Date.php
r616 r639 22 22 { 23 23 global $MonthNames; 24 24 25 25 if(($Item['Value'] !== null) and ((strtolower($Item['Value']) == 'now') or (strtolower($Item['Value']) == ''))) $Item['Value'] = time(); 26 26 $Parts = getdate($Item['Value']); … … 28 28 $Output = ''; 29 29 $Style = ''; 30 if(array_key_exists('Null', $Item) and $Item['Null']) 30 if(array_key_exists('Null', $Item) and $Item['Null']) 31 31 { 32 if($Item['Value'] != null) 32 if($Item['Value'] != null) 33 33 { 34 34 $Checked = ' checked="1"'; 35 35 $Style = 'style="display:inline;"'; 36 } else 36 } else 37 37 { 38 38 $Checked = ''; 39 $Style = 'style="display:none;"'; 39 $Style = 'style="display:none;"'; 40 40 } 41 41 $Output .= '<input type="checkbox" name="'.$Item['Name'].'-null"'.$Checked.' onclick="toggle(\''. 42 $Item['Name'].'-day\');toggle(\''.$Item['Name'].'-month\');toggle(\''.$Item['Name'].'-year\');"/>'; 42 $Item['Name'].'-day\');toggle(\''.$Item['Name'].'-month\');toggle(\''.$Item['Name'].'-year\');"/>'; 43 43 } 44 44 45 45 // Day 46 46 $Output .= '<select name="'.$Item['Name'].'-day" id="'.$Item['Name'].'-day" '.$Style.'>'; … … 72 72 function OnLoad($Item) 73 73 { 74 if(!array_key_exists($Item['Name'].'-null', $_POST) and array_key_exists('Null', $Item) and ($Item['Null'] == true)) return(null); 74 if(!array_key_exists($Item['Name'].'-null', $_POST) and array_key_exists('Null', $Item) and ($Item['Null'] == true)) return(null); 75 75 else return(mktime(0, 0, 0, $_POST[$Item['Name'].'-month'], $_POST[$Item['Name'].'-day'], $_POST[$Item['Name'].'-year'])); 76 76 } 77 77 78 78 function OnLoadDb($Item) 79 79 { … … 81 81 } 82 82 83 function OnSaveDb($Item) 83 function OnSaveDb($Item) 84 84 { 85 85 if($Item['Value'] == null) return(null); -
trunk/Common/Form/Types/OneToMany.php
r548 r639 6 6 { 7 7 var $EditActions; 8 8 9 9 function OnView($Item) 10 10 { … … 14 14 $Output = '<a href="?t='.$Type['Parameters']['Table'].'&a='. 15 15 'view'.'&i='.$Item['Value'].'">'.$Item['Filter'].'</a>'; 16 } else $Output = ''; 16 } else $Output = ''; 17 17 return($Output); 18 18 } … … 24 24 if(array_key_exists('Condition', $Type['Parameters'])) $Where = ' WHERE '.$Type['Parameters']['Condition']; 25 25 else $Where = ''; 26 if(array_key_exists('Null', $Item) and $Item['Null']) 26 if(array_key_exists('Null', $Item) and $Item['Null']) 27 27 { 28 28 if($Item['Value'] == NULL) $Selected = ' selected="1"'; else $Selected = ''; … … 39 39 $Output .= '</select>'; 40 40 if($this->FormManager->ShowRelation) 41 { 42 $URL = ''; 43 if(array_key_exists('OnPreset', $Item)) 44 { 45 $Preset = call_user_func($Item['OnPreset'], $Item['Values']); 46 $URL = str_replace('&', '&', '&'.http_build_query($Preset)); 47 } 48 $Output .= '<img src="'.$this->FormManager->Root.'/images/add.png" alf="Přidat" language="javascript" '. 49 'onclick="return popupwindow("'.$this->FormManager->Root.'/is/?a=addsub&t='.$Table.'&r='.$Item['Name'].'&rt='.$Item['Type'].$URL.'","test");" style="cursor:hand;cursor:pointer"/>'; 41 50 $Output .= '<img src="'.$this->FormManager->Root.'/images/select.png" alf="Vybrat" language="javascript" '. 42 51 'onclick="return popupwindow("'.$this->FormManager->Root.'/is/?a=select&t='.$Table.'&r='.$Item['Name'].'","test");" style="cursor:hand;cursor:pointer"/>'; 52 } 43 53 return($Output); 44 54 } … … 55 65 else return($Item['Value']); 56 66 } 57 67 58 68 function OnFilterName($Item) 59 69 { 60 70 return('`'.$Item['Name'].'_Filter`'); 61 71 } 62 72 63 73 function OnFilterNameQuery($Item) 64 74 { … … 72 82 $Type['Parameters']['Id'].'`=`'.$Item['Name'].'`) AS `'.$Item['Name'].'_Filter`'; 73 83 //} else $Output = '`'.$Item['Name'].'`, `'.$Item['Name'].'` AS `'.$Item['Name'].'_Filter`'; 74 return($Output); 84 return($Output); 75 85 } 76 86 }
Note:
See TracChangeset
for help on using the changeset viewer.