Changeset 445
- Timestamp:
- Oct 15, 2012, 6:41:56 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Common/Error.php
r443 r445 3 3 class ErrorHandler extends Module 4 4 { 5 var $Encoding; 6 7 function __construct() 8 { 9 $this->Encoding = 'utf-8'; 10 } 11 5 12 function Init() 6 13 { … … 31 38 if(($UserErrors & $Number)) 32 39 { 33 $Error = '# '.$Date. ' : '.$Message.' on line '.$LineNumber.' in '.$FileName."\n";40 $Error = '# '.$Date."\n"; 34 41 $Backtrace = debug_backtrace(); 35 $Backtrace[0]['function'] = '';42 $Backtrace[0]['function'] = $Message; 36 43 $Backtrace[0]['args'] = ''; 37 $Backtrace[0]['file'] = '';38 $Backtrace[0]['line'] = '';44 $Backtrace[0]['file'] = $FileName; 45 $Backtrace[0]['line'] = $LineNumber; 39 46 //$First = array_shift($Backtrace); 40 //print_r($ First);47 //print_r($Backtrace); 41 48 42 49 //array_unshift($Backtrace, $First); … … 70 77 echo('<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head>'."\n". 71 78 '<meta http-equiv="Content-Language" content="cs">'."\n". 72 '<meta http-equiv="Content-Type" content="text/html; charset= iso-8859-2"></head><body>'."\n".79 '<meta http-equiv="Content-Type" content="text/html; charset='.$this->Encoding.'"></head><body>'."\n". 73 80 'Došlo k vnitřní chybě!<br/> O chybě byl uvědoměn správce webu a chybu brzy odstraní.<br/><br/>'); 74 81 echo('<pre>'.$Error.'</pre><br/>'); // V případě ladění chybu i zobraz -
trunk/Common/Forms.php
r442 r445 168 168 $Values = array(); 169 169 foreach($this->Definition['Items'] as $Index => $Item) 170 if(!array_key_exists($Item['Type'], $FormTypes) or 171 (array_key_exists($Item['Type'], $FormTypes) and ($FormTypes[$Item['Type']]['Type'] != 'ManyToOne'))) 170 172 { 171 173 //if(array_key_exists($Context.$Index, $_POST)) -
trunk/Common/Types/Date.php
r442 r445 11 11 global $MonthNames; 12 12 13 if( strtolower($Item['Value']) == 'now') $Item['Value'] = time();13 if((strtolower($Item['Value']) == 'now') or (strtolower($Item['Value']) == '')) $Item['Value'] = time(); 14 14 $Parts = getdate($Item['Value']); 15 15 … … 22 22 global $MonthNames; 23 23 24 if( strtolower($Item['Value']) == 'now') $Item['Value'] = time();24 if((strtolower($Item['Value']) == 'now') or (strtolower($Item['Value']) == '')) $Item['Value'] = time(); 25 25 $Parts = getdate($Item['Value']); 26 26 -
trunk/Common/Types/DateTime.php
r442 r445 11 11 global $MonthNames; 12 12 13 if( strtolower($Item['Value']) == 'now') $Item['Value'] = time();13 if((strtolower($Item['Value']) == 'now') or (strtolower($Item['Value']) == '')) $Item['Value'] = time(); 14 14 $Parts = getdate($Item['Value']); 15 15 $Output = $Parts['mday'].'.'.$Parts['mon'].'.'.$Parts['year'].' '. … … 22 22 global $MonthNames; 23 23 24 if( strtolower($Item['Value']) == 'now') $Item['Value'] = time();24 if((strtolower($Item['Value']) == 'now') or (strtolower($Item['Value']) == '')) $Item['Value'] = time(); 25 25 $Parts = getdate($Item['Value']); 26 26 -
trunk/Common/Types/Enumeration.php
r435 r445 18 18 $Type = $this->System->Type->GetTypeDefinition($Item['Type']); 19 19 $Output = '<select name="'.$Item['Name'].'">'; 20 foreach($Type['Parameters'] as $Index => $StateName)20 foreach($Type['Parameters']['States'] as $Index => $StateName) 21 21 { 22 22 if($Item['Value'] == $Index) $Selected = ' selected="1"'; else $Selected = ''; -
trunk/Common/Types/Time.php
r442 r445 9 9 function OnView($Item) 10 10 { 11 if( strtolower($Item['Value']) == 'now') $Item['Value'] = time();11 if((strtolower($Item['Value']) == 'now') or (strtolower($Item['Value']) == '')) $Item['Value'] = time(); 12 12 $TimeParts = getdate($Item['Value']); 13 13 … … 18 18 function OnEdit($Item) 19 19 { 20 if( strtolower($Item['Value']) == 'now') $Item['Value'] = time();20 if((strtolower($Item['Value']) == 'now') or (strtolower($Item['Value']) == '')) $Item['Value'] = time(); 21 21 $TimeParts = getdate($Item['Value']); 22 22 -
trunk/form_classes.php
r442 r445 2 2 3 3 $FormClasses = array( 4 'Task' => array( 5 'Title' => 'Úkoly', 6 'Table' => 'Task', 7 'DefaultSortColumn' => 'Name', 8 'Items' => array( 9 'Name' => array('Type' => 'String', 'Caption' => 'Jméno', 'Default' => ''), 10 'Description' => array('Type' => 'Text', 'Caption' => 'Popis', 'Default' => ''), 11 'TimeCreate' => array('Type' => 'Date', 'Caption' => 'Datum zadání', 'Default' => ''), 12 'TimeDue' => array('Type' => 'Date', 'Caption' => 'Termín', 'Default' => ''), 13 'TimeClose' => array('Type' => 'Date', 'Caption' => 'Datum uzavření', 'Default' => ''), 14 'Priority' => array('Type' => 'TPriority', 'Caption' => 'Důležitost', 'Default' => '0'), 15 'Conclusion' => array('Type' => 'Text', 'Caption' => 'Vyhodnocení', 'Default' => ''), 16 'Public' => array('Type' => 'Boolean', 'Caption' => 'Veřejné', 'Default' => '0'), 17 'Progress' => array('Type' => 'Integer', 'Caption' => 'Průběh', 'Default' => '0'), 18 'Group' => array('Type' => 'TTaskGroup', 'Caption' => 'Kategorie', 'Default' => ''), 19 ), 20 ), 21 'TaskGroup' => array( 22 'Title' => 'Kategorie úkolu', 23 'Table' => 'TaskGroup', 24 'DefaultSortColumn' => 'Name', 25 'Items' => array( 26 'Name' => array('Type' => 'String', 'Caption' => 'Jméno', 'Default' => ''), 27 'Description' => array('Type' => 'Text', 'Caption' => 'Popis', 'Default' => ''), 28 'Parent' => array('Type' => 'TTaskGroup', 'Caption' => 'Kategorie', 'Default' => ''), 29 'Tasks' => array('Type' => 'TTaskList', 'Caption' => 'Úkoly', 'Default' => ''), 30 ), 31 ), 4 32 'Product' => array( 5 33 'Title' => 'Zboží', … … 86 114 'Blocked' => array('Type' => 'Boolean', 'Caption' => 'Blokování', 'Default' => '0'), 87 115 'PayDay' => array('Type' => 'Integer', 'Caption' => 'Den placení', 'Default' => '0'), 116 'Devices' => array('Type' => 'TDeviceList', 'Caption' => 'Registrovaná zařízení', 'Default' => ''), 88 117 ), 89 118 ), … … 430 459 'States' => array('Neurčeno', 'Běžné', 'Hosting', 'Zdarma'), 431 460 ), 461 'TPriority' => array( 462 'Type' => 'Enumeration', 463 'States' => array('Nízká', 'Střední', 'Vysoká'), 464 ), 432 465 'TNetworkDeviceState' => array( 433 466 'Type' => 'Enumeration', … … 564 597 'Filter' => '1', 565 598 ), 599 'TTaskList' => array( 600 'Type' => 'ManyToOne', 601 'Table' => 'Task', 602 'Id' => 'Id', 603 'Ref' => 'Group', 604 'Filter' => '1', 605 ), 606 'TDeviceList' => array( 607 'Type' => 'ManyToOne', 608 'Table' => 'NetworkDevice', 609 'Id' => 'Id', 610 'Ref' => 'Member', 611 'Filter' => '1', 612 ), 566 613 'TInterfaceList' => array( 567 614 'Type' => 'ManyToOne', … … 574 621 'Type' => 'Reference', 575 622 'Table' => 'StockCard', 623 'Id' => 'Id', 624 'Name' => 'Name', 625 'Filter' => '1', 626 ), 627 'TTaskGroup' => array( 628 'Type' => 'Reference', 629 'Table' => 'TaskGroup', 576 630 'Id' => 'Id', 577 631 'Name' => 'Name', -
trunk/is/index.php
r442 r445 100 100 $Id = $this->Database->insert_id; 101 101 $_SESSION['Id'] = $Id; 102 $this->Database->update($Table, 'Id='.$Id,103 array('UserCreate' => $this->System->Modules['User']->User['Id'],104 'TimeCreate' => 'NOW()'));102 //$this->Database->update($Table, 'Id='.$Id, 103 // array('UserCreate' => $this->System->Modules['User']->User['Id'], 104 // 'TimeCreate' => 'NOW()')); 105 105 $Output .= $this->ShowView($Table, $Id); 106 106 } … … 139 139 if((array_key_exists($Item['Type'], $FormTypes) and ($FormTypes[$Item['Type']]['Type'] == 'ManyToOne'))) 140 140 { 141 $Output .= '<div style="text-align: center;">'.$Form->Definition['Title'].'</div>'; 142 $Output .= $this->ShowList($FormTypes[$Item['Type']]['Table'], '`'.$FormTypes[$Item['Type']]['Ref'].'`='.$Id).'<br/>'; 141 $Output .= $this->ShowList($FormTypes[$Item['Type']]['Table'], '`'.$FormTypes[$Item['Type']]['Ref'].'`='.$Id, $Item['Caption']).'<br/>'; 143 142 } 144 143 return($Output); 145 144 } 146 145 147 function ShowList($Table, $Filter = '' )146 function ShowList($Table, $Filter = '', $Title = '') 148 147 { 149 148 global $Type, $FormTypes, $FormClasses; … … 156 155 $PageList = GetPageList($DbRow[0]); 157 156 158 $Output = $PageList['Output']; 157 $Output = '<div style="text-align: center;">'.$FormClass['Title'].'</div>'; 158 $Output .= $PageList['Output']; 159 159 $Output .= '<table class="WideTable" style="font-size: small;">'; 160 160
Note:
See TracChangeset
for help on using the changeset viewer.