Changeset 372
- Timestamp:
- Jan 19, 2012, 1:58:03 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 1 deleted
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Common/Global.php
r371 r372 9 9 include_once('Error.php'); 10 10 include_once('Code.php'); 11 include_once('Forms.php');12 11 include_once('File.php'); 13 12 include_once('Page.php'); -
trunk/Common/View.php
r370 r372 1 1 <?php 2 2 3 define('View TypeDate', 'Date');4 define('View TypeTime', 'Time');5 define('View TypeDateTime', 'DateTime');6 define('View TypeText', 'Text');7 define('View TypeString', 'String');8 define('View TypeBoolean', 'Boolean');9 define('View TypeInteger', 'Integer');10 define('View TypeFloat', 'Float');11 define('View TypeOneToMany', 'OneToMany');12 define('View TypeManyToOne', 'ManyToOne');13 define('View TypeManyToMany', 'ManyToMany');14 define('View TypeIPv4', 'IPv4');15 define('View TypeIPv6', 'IPv6');16 define('View TypeMACAddrees', 'MACAddress');17 define('View TypeFileName', 'FileName');18 define('View TypePassword', 'Password');19 define('View TypeURL', 'URL');20 define('View TypeImage', 'Image');3 define('ViewItemTypeDate', 'Date'); 4 define('ViewItemTypeTime', 'Time'); 5 define('ViewItemTypeDateTime', 'DateTime'); 6 define('ViewItemTypeText', 'Text'); 7 define('ViewItemTypeString', 'String'); 8 define('ViewItemTypeBoolean', 'Boolean'); 9 define('ViewItemTypeInteger', 'Integer'); 10 define('ViewItemTypeFloat', 'Float'); 11 define('ViewItemTypeOneToMany', 'OneToMany'); 12 define('ViewItemTypeManyToOne', 'ManyToOne'); 13 define('ViewItemTypeManyToMany', 'ManyToMany'); 14 define('ViewItemTypeIPv4', 'IPv4'); 15 define('ViewItemTypeIPv6', 'IPv6'); 16 define('ViewItemTypeMACAddrees', 'MACAddress'); 17 define('ViewItemTypeFileName', 'FileName'); 18 define('ViewItemTypePassword', 'Password'); 19 define('ViewItemTypeURL', 'URL'); 20 define('ViewItemTypeImage', 'Image'); 21 21 22 22 class View … … 27 27 var $ModelName; 28 28 var $SubmitText; 29 var $Values = array(); 30 var $OnSubmit = ''; 31 var $Database; 29 32 33 function __construct($Database) 34 { 35 $this->Database = &$Database; 36 } 37 30 38 function AddItemOneToMany($Name, $Title, $TargetModel, $Default) 31 39 { 32 $this->Items[ ] = array('Name' => 'Name', 'Title' => $Title, 'Type' =>ItemTypeOneToMany, 'Default' => $Default,40 $this->Items[$Name] = array('Name' => $Name, 'Title' => $Title, 'Type' => ViewItemTypeOneToMany, 'Default' => $Default, 33 41 'TargetModel' => $TargetModel); 34 42 } … … 36 44 function AddItemManyToOne($Name, $Title, $TargetModel, $Default) 37 45 { 38 $this->Items[ ] = array('Name' => 'Name', 'Title' => $Title, 'Type' => ItemTypeOneToMany, 'Default' => $Default,46 $this->Items[$Name] = array('Name' => $Name, 'Title' => $Title, 'Type' => ViewItemTypeManyToOne, 'Default' => $Default, 39 47 'TargetModel' => $TargetModel); 40 48 } … … 42 50 function AddItemInteger($Name, $Title, $Default) 43 51 { 44 $this->Items[ ] = array('Name' => 'Name', 'Title' => $Title, 'Type' =>ItemTypeInteger, 'Default' => $Default);52 $this->Items[$Name] = array('Name' => $Name, 'Title' => $Title, 'Type' => ViewItemTypeInteger, 'Default' => $Default); 45 53 } 46 54 47 55 function AddItemFloat($Name, $Title, $Default) 48 56 { 49 $this->Items[ ] = array('Name' => 'Name', 'Title' => $Title, 'Type' =>ItemTypeFloat, 'Default' => $Default);57 $this->Items[$Name] = array('Name' => $Name, 'Title' => $Title, 'Type' => ViewItemTypeFloat, 'Default' => $Default); 50 58 } 51 59 52 60 function AddItemText($Name, $Title, $Default) 53 61 { 54 $this->Items[] = array('Name' => 'Name', 'Title' => $Title, 'Type' => ItemTypeText, 'Default' => $Default); 62 $this->Items[$Name] = array('Name' => $Name, 'Title' => $Title, 'Type' => ViewItemTypeText, 'Default' => $Default); 63 } 64 65 function AddItemString($Name, $Title, $Default) 66 { 67 $this->Items[$Name] = array('Name' => $Name, 'Title' => $Title, 'Type' => ViewItemTypeString, 'Default' => $Default); 55 68 } 56 69 57 70 function AddItemBoolean($Name, $Title, $Default) 58 71 { 59 $this->Items[ ] = array('Name' => 'Name', 'Title' => $Title, 'Type' =>ItemTypeBoolean, 'Default' => $Default);72 $this->Items[$Name] = array('Name' => $Name, 'Title' => $Title, 'Type' => ViewItemTypeBoolean, 'Default' => $Default); 60 73 } 61 74 62 75 function AddItemDate($Name, $Title, $Default) 63 76 { 64 $this->Items[ ] = array('Name' => 'Name', 'Title' => $Title, 'Type' =>ItemTypeDate, 'Default' => $Default);77 $this->Items[$Name] = array('Name' => $Name, 'Title' => $Title, 'Type' => ViewItemTypeDate, 'Default' => $Default); 65 78 } 66 79 67 80 function AddItemTime($Name, $Title, $Default) 68 81 { 69 $this->Items[ ] = array('Name' => 'Name', 'Title' => $Title, 'Type' =>ItemTypeTime, 'Default' => $Default);82 $this->Items[$Name] = array('Name' => $Name, 'Title' => $Title, 'Type' => ViewItemTypeTime, 'Default' => $Default); 70 83 } 71 84 72 85 function AddItemDateTime($Name, $Title, $Default) 73 86 { 74 $this->Items[ ] = array('Name' => 'Name', 'Title' => $Title, 'Type' =>ItemTypeDateTime, 'Default' => $Default);87 $this->Items[$Name] = array('Name' => $Name, 'Title' => $Title, 'Type' => ViewItemTypeDateTime, 'Default' => $Default); 75 88 } 76 89 77 90 function AddItemIPv4($Name, $Title, $Default) 78 91 { 79 $this->Items[ ] = array('Name' => 'Name', 'Title' => $Title, 'Type' =>ItemTypeIPv4, 'Default' => $Default);92 $this->Items[$Name] = array('Name' => $Name, 'Title' => $Title, 'Type' => ViewItemTypeIPv4, 'Default' => $Default); 80 93 } 81 94 82 95 function AddItemIPv6($Name, $Title, $Default) 83 96 { 84 $this->Items[ ] = array('Name' => 'Name', 'Title' => $Title, 'Type' =>ItemTypeIPv6, 'Default' => $Default);97 $this->Items[$Name] = array('Name' => $Name, 'Title' => $Title, 'Type' => ViewItemTypeIPv6, 'Default' => $Default); 85 98 } 86 99 87 100 function AddItemMACAddress($Name, $Title, $Default) 88 101 { 89 $this->Items[ ] = array('Name' => 'Name', 'Title' => $Title, 'Type' =>ItemTypeMACAddress, 'Default' => $Default);102 $this->Items[$Name] = array('Name' => $Name, 'Title' => $Title, 'Type' => ViewItemTypeMACAddress, 'Default' => $Default); 90 103 } 91 104 92 105 function AddItemFileName($Name, $Title, $Default) 93 106 { 94 $this->Items[ ] = array('Name' => 'Name', 'Title' => $Title, 'Type' =>ItemTypeFileName, 'Default' => $Default);107 $this->Items[$Name] = array('Name' => $Name, 'Title' => $Title, 'Type' => ViewItemTypeFileName, 'Default' => $Default); 95 108 } 96 109 97 110 function AddItemURL($Name, $Title, $Default) 98 111 { 99 $this->Items[ ] = array('Name' => 'Name', 'Title' => $Title, 'Type' =>ItemTypeURL, 'Default' => $Default);112 $this->Items[$Name] = array('Name' => $Name, 'Title' => $Title, 'Type' => ViewItemTypeURL, 'Default' => $Default); 100 113 } 101 114 102 115 function AddItemPassword($Name, $Title, $Default) 103 116 { 104 $this->Items[ ] = array('Name' => 'Name', 'Title' => $Title, 'Type' =>ItemTypePassword, 'Default' => $Default);117 $this->Items[$Name] = array('Name' => $Name, 'Title' => $Title, 'Type' => ViewItemTypePassword, 'Default' => $Default); 105 118 } 106 119 107 120 function AddItemImage($Name, $Title, $Default) 108 121 { 109 $this->Items[ ] = array('Name' => 'Name', 'Title' => $Title, 'Type' =>ItemTypeImage, 'Default' => $Default);122 $this->Items[$Name] = array('Name' => $Name, 'Title' => $Title, 'Type' => ViewItemTypeImage, 'Default' => $Default); 110 123 } 124 125 function ShowEditForm() 126 { 127 if($this->SubmitText == '') $this->SubmitText = 'Uložit'; 128 $Output = '<form class="Form" action="'.$this->OnSubmit.'" method="post">'.$this->ShowEditBlock().'<div><input type="submit" value="'.$this->SubmitText.'" /></div></form>'; 129 return($Output); 130 } 131 132 function ShowEditBlock($Context = '') 133 { 134 $Table = array( 135 //'Header' => array('Položka', 'Hodnota'), 136 'Rows' => array(), 137 ); 138 if($Context != '') $Context = $Context.'-'; 139 foreach($this->Items as $Index => $Item) 140 { 141 if(!array_key_exists($Index, $this->Values) and isset($Item['Default'])) $this->Values[$Index] = $Item['Default']; 142 switch($Item['Type']) 143 { 144 case ViewItemTypeBoolean: 145 if($this->Values[$Index] == 0) $Checked = ''; else $Checked = ' CHECKED'; 146 $Edit = '<input type="checkbox" name="'.$Context.$Index.'"'.$Checked.' />'; 147 break; 148 case ViewItemTypeString: 149 $Edit = '<input style="width: 98%;" type="text" name="'.$Context.$Index.'" value="'.$this->Values[$Index].'" />'; 150 break; 151 case ViewItemTypeText: 152 $Edit = '<textarea style="width: 98%; height: 200px;" name="'.$Context.$Index.'">'.$this->Values[$Index].'</textarea>'; 153 break; 154 case ViewItemTypePassword: 155 $Edit = '<input style="width: 98%;" type="password" name="'.$Context.$Index.'" value="'.$this->Values[$Index].'" />'; 156 break; 157 case ViewItemTypeInteger: 158 $Edit = '<input style="width: 98%;" type="text" name="'.$Context.$Index.'" value="'.$this->Values[$Index].'" />'; 159 break; 160 case ViewItemTypeFloat: 161 $Edit = '<input style="width: 98%;" type="text" name="'.$Context.$Index.'" value="'.$this->Values[$Index].'" />'; 162 break; 163 case ViewItemTypeTime: 164 if($this->Values[$Index] == 'Now') $this->Values[$Index] = date('j.n.Y'); 165 $Edit = '<input style="width: 98%;" type="text" name="'.$Context.$Index.'" value="'.$this->Values[$Index].'" />'; 166 break; 167 case ViewItemTypeOneToMany: 168 $Edit = '<select style="width: 100%;" name="'.$Context.$Index.'">'; 169 $DbResult = $this->Database->select($Item['TargetModel'], 'Id, Name', '1 ORDER BY Name'); 170 while($Row = $DbResult->fetch_assoc()) 171 { 172 if($Row['Id'] == $this->Values[$Index]) $Selected = ' selected="selected"'; 173 else $Selected = ''; 174 $Edit .= '<option value="'.$Row['Id'].'"'.$Selected.'>'.$Row['Id'].': '.$Row['Name'].'</option>'; 175 } 176 $Edit .= '</select>'; 177 break; 178 case 'Array': 179 $Form = new Form($Item['ItemClass']); 180 $Edit = '<script type="text/javascript" id="syndication">'. 181 "var Count = 0;". 182 "function AddItem() {". 183 "Count = Count + 1;". 184 "var newcontent = document.createElement('div');". 185 "newcontent.id = '".$Context.$Item['ItemClass']."-' + Count;". 186 "newcontent.innerHTML = '<input type=\"hidden\" name=\"".$Context.$Item['ItemClass']."-' + Count + '\">".$Form->ShowEditBlock($Context.$Item['ItemClass']."-' + Count + '")."';". 187 "var scr = document.getElementById('syndication');". 188 "scr.parentNode.insertBefore(newcontent, scr); }". 189 '</script>'; 190 $Edit .= '<form><input type="button" onclick="AddItem();" value="Přidat položku" /></form>'; 191 break; 192 default: 193 if(array_key_exists($Item['Type'], $FormTypes)) 194 { 195 // Custom types 196 switch($FormTypes[$Item['Type']]['Type']) 197 { 198 case 'Enumeration': 199 $Edit = '<select style="width: 100%;" name="'.$Context.$Index.'">'; 200 foreach($FormTypes[$Item['Type']]['States'] as $StateIndex => $StateName) 201 { 202 if($this->Values[$Index] == $StateIndex) $Selected = 'selected="selected"'; 203 else $Selected = ''; 204 $Edit .= '<option value="'.$StateIndex.'"'.$Selected.'>'.$StateName.'</option>'; 205 } 206 $Edit .= '</select>'; 207 break; 208 default: 209 $Edit = 'Neznámý typ'; 210 } 211 } else $Edit = 'Neznámý typ'; 212 } 213 array_push($Table['Rows'], array($Item['Title'].':', $Edit)); 214 } 215 $Output = '<fieldset><legend>'.$this->Title.'</legend>'.Table($Table). 216 '</fieldset>'; 217 return($Output); 218 } 219 220 function LoadValuesFromDatabase($Id) 221 { 222 $DbResult = $this->Database->query('SELECT T.* FROM '.$this->ModelName.' AS T WHERE T.Id='.$Id); 223 $DbRow = $DbResult->fetch_array(); 224 foreach($this->Items as $Index => $Item) 225 { 226 $this->Values[$Index] = $DbRow[$Index]; 227 switch($Item['Type']) 228 { 229 case ViewItemTypePassword: 230 if($Item['Type'] == ViewItemTypePassword) $this->Values[$Index] = ''; // Dont show password 231 break; 232 case ViewItemTypeTime: 233 $this->Values[$Index] == MysqlDateTimeToTime($this->Values[$Index]); 234 break; 235 } 236 } 237 } 238 239 function SaveValuesToDatabase($Id) 240 { 241 foreach($this->Items as $Index => $Item) 242 { 243 switch($Item['Type']) 244 { 245 case ViewItemTypePassword: 246 if($this->Values[$Index] == '') unset($this->Values[$Index]); // Do not modify empty passwords 247 else $this->Values[$Index] = sha1($this->Values[$Index]); 248 break; 249 case ViewItemTypeTime: 250 $this->Values[$Index] = TimeToMysqlDateTime($this->Values[$Index]); 251 break; 252 } 253 } 254 if($Id == 0) 255 { 256 $this->Values['Id'] = $Id; 257 $DbResult = $this->Database->replace($this->ModelName, $this->Values); 258 } else 259 $DbResult = $this->Database->update($this->ModelName, 'Id='.$Id, $this->Values); 260 //echo($this->Database->LastQuery); 261 } 262 263 function LoadValuesFromForm() 264 { 265 $this->Values = $this->LoadValuesFromFormBlock(); 266 } 267 268 function LoadValuesFromFormBlock($Context = '') 269 { 270 if($Context != '') $Context = $Context.'-'; 271 $Values = array(); 272 foreach($this->Items as $Index => $Item) 273 { 274 if(array_key_exists($Context.$Index, $_POST)) 275 switch($Item['Type']) 276 { 277 case ViewItemTypeBoolean: 278 if(array_key_exists($Context.$Index, $_POST)) $Values[$Index] = 1; 279 else $Values[$Index] = 0; 280 break; 281 case ViewItemTypeString: 282 $Values[$Index] = $_POST[$Context.$Index]; 283 break; 284 case ViewItemTypeText: 285 $Values[$Index] = $_POST[$Context.$Index]; 286 break; 287 case ViewItemTypePassword: 288 $Values[$Index] = $_POST[$Context.$Index]; 289 break; 290 case ViewItemTypeInteger: 291 $Values[$Index] = $_POST[$Context.$Index]; 292 break; 293 case ViewItemTypeFloat: 294 $Values[$Index] = $_POST[$Context.$Index]; 295 break; 296 case ViewItemTypeTime: 297 $Values[$Index] = explode('.', $_POST[$Context.$Index]); 298 $Values[$Index] = mktime(0, 0, 0, $Values[$Index][1], $Values[$Index][0], $Values[$Index][2]); 299 break; 300 case 'Array': 301 $I = 1; 302 //echo('Expect: '.$Context.$Item['ItemClass'].'-'.$I.'<br />'); 303 while(isset($_POST[$Context.$Item['ItemClass'].'-'.$I])) 304 { 305 $Form = new Form($Item['ItemClass']); 306 $Values[$Index][] = $Form->LoadValuesFromFormBlock($Context.$Item['ItemClass'].'-'.$I); 307 $I++; 308 } 309 break; 310 default: 311 if(array_key_exists($Item['Type'], $FormTypes)) 312 { 313 // Custom types 314 switch($FormTypes[$Item['Type']]['Type']) 315 { 316 case 'Enumeration': 317 $Values[$Index] = $_POST[$Context.$Index]; 318 break; 319 case 'Reference': 320 $Values[$Index] = $_POST[$Context.$Index]; 321 break; 322 default: 323 } 324 } 325 } 326 } 327 return($Values); 328 } 111 329 } 112 330 331 function MakeLink($Target, $Title) 332 { 333 return('<a href="'.$Target.'">'.$Title.'</a>'); 334 } 335 336 function Table($Table) 337 { 338 $Result = '<table class="BasicTable">'; 339 if(array_key_exists('Header', $Table)) 340 { 341 $Result .= '<tr>'; 342 foreach($Table['Header'] as $Item) 343 $Result .= '<th>'.$Item.'</th>'; 344 $Result .= '</tr>'; 345 } 346 foreach($Table['Rows'] as $Row) 347 { 348 $Result .= '<tr>'; 349 foreach($Row as $Index => $Item) 350 { 351 if($Index == 0) $Class = ' class="Header"'; else $Class = ''; 352 $Result .= '<td'.$Class.' style="width: '.(floor(100 / count($Row))).'%">'.$Item.'</td>'; 353 } 354 $Result .= '</tr>'; 355 } 356 $Result .= '</table>'; 357 return($Result); 358 } 359 360 function ShowEditTable($ClassName, $Values) 361 { 362 } 363 113 364 ?> -
trunk/Modules/FrontPage/FrontPage.php
r366 r372 139 139 if($_GET['Action'] == 'LoginForm') 140 140 { 141 $Form = new Form('UserLogin');141 $Form = new UserLoginView($this->Database); 142 142 $Form->OnSubmit = '?Action=Login'; 143 143 $Output .= $Form->ShowEditForm(); … … 147 147 if($_GET['Action'] == 'Login') 148 148 { 149 $Form = new Form('UserLogin');149 $Form = new UserLoginView($this->Database); 150 150 $Form->OnSubmit = '?Action=Login'; 151 151 $Result = $this->System->Models['User']->Login($_POST['Username'], $_POST['Password']); … … 166 166 if($_GET['Action'] == 'UserOptions') 167 167 { 168 $UserOptions = new Form('UserOptions');168 $UserOptions = new UserOptionsView($this->Database); 169 169 $UserOptions->LoadValuesFromDatabase($this->System->Models['User']->User['Id']); 170 170 $UserOptions->OnSubmit = '?Action=UserOptionsSave'; … … 173 173 if($_GET['Action'] == 'UserOptionsSave') 174 174 { 175 $UserOptions = new Form('UserOptions', array());175 $UserOptions = new UserOptionsView($this->Dstabase, array()); 176 176 $UserOptions->LoadValuesFromForm(); 177 177 $UserOptions->SaveValuesToDatabase($this->System->Models['User']->User['Id']); … … 184 184 if($_GET['Action'] == 'UserRegister') 185 185 { 186 $Form = new Form('UserRegister');186 $Form = new UserRegisterView($this->Database); 187 187 $Form->LoadValuesFromForm(); 188 188 $Form->OnSubmit = '?Action=UserRegisterSave'; … … 195 195 if($_GET['Action'] == 'PasswordRecovery') 196 196 { 197 $Form = new Form('PasswordRecovery');197 $Form = new PasswordRecoveryView($this->Database); 198 198 $Form->OnSubmit = '?Action=PasswordRecovery2'; 199 199 $Output .= $Form->ShowEditForm(); … … 201 201 if($_GET['Action'] == 'PasswordRecovery2') 202 202 { 203 $Form = new Form('PasswordRecovery');203 $Form = new PasswordRecoveryView($this->Database); 204 204 $Form->LoadValuesFromForm(); 205 205 $Result = $this->System->Models['User']->PasswordRecoveryRequest($Form->Values['Name'], $Form->Values['Email']); … … 216 216 if($_GET['Action'] == 'UserRegisterSave') 217 217 { 218 $Form = new Form('UserRegister', array());218 $Form = new UserRegisterView($this->Database, array()); 219 219 $Form->LoadValuesFromForm(); 220 220 $Result = $this->System->Models['User']->Register($Form->Values['Login'], $Form->Values['Password'], $Form->Values['Password2'], $Form->Values['Email'], $Form->Values['Name'], $Form->Values['PhoneNumber'], $Form->Values['ICQ']); … … 228 228 if($_GET['Action'] == 'MemberOptions') 229 229 { 230 $UserOptions = new Form('MemberOptions');230 $UserOptions = new MemberOptionsView($this->Database); 231 231 $DbResult = $this->Database->query('SELECT Member.Id, Member.InternetTariffNextMonth, Member.FamilyMemberCount, Member.BillingPeriodNext, Subject.Name, Subject.AddressStreet, Subject.AddressTown, Subject.AddressPSC, Subject.IC, Subject.DIC FROM Member JOIN Subject ON Subject.Id = Member.Subject WHERE Member.Id='.$this->System->Models['User']->User['Member']); 232 232 $DbRow = $DbResult->fetch_array(); 233 foreach($UserOptions-> Definition['Items']as $Index => $Item)233 foreach($UserOptions->Items as $Index => $Item) 234 234 { 235 235 $UserOptions->Values[$Index] = $DbRow[$Index]; … … 240 240 if($_GET['Action'] == 'MemberOptionsSave') 241 241 { 242 $UserOptions = new Form('MemberOptions');242 $UserOptions = new MemberOptionsView($this->Database); 243 243 $UserOptions->LoadValuesFromForm(); 244 244 if($UserOptions->Values['FamilyMemberCount'] < 0) … … 255 255 $DbResult = $this->Database->query('SELECT Member.Id, Member.InternetTariffNextMonth, Member.FamilyMemberCount, Member.BillingPeriodNext, Subject.Name, Subject.AddressStreet, Subject.AddressTown, Subject.AddressPSC, Subject.IC, Subject.DIC FROM Member JOIN Subject ON Subject.Id = Member.Subject WHERE Member.Id='.$this->System->Models['User']->User['Member']); 256 256 $DbRow = $DbResult->fetch_array(); 257 foreach($UserOptions-> Definition['Items']as $Index => $Item)257 foreach($UserOptions->Items as $Index => $Item) 258 258 { 259 259 $UserOptions->Values[$Index] = $DbRow[$Index]; -
trunk/Modules/Member/Member.php
r371 r372 3 3 class MemberOptionsView extends View 4 4 { 5 function __construct( )5 function __construct($Database) 6 6 { 7 parent::__construct($Database); 7 8 $this->Title = 'Nastavení domácnosti'; 8 $this-> Table = '(SELECT Member.Id, Member.InternetTariffNextMonth, Member.FamilyMemberCount, Subject.Name, Subject.AddressStreet, Subject.AddressTown, Subject.AddressPSC, Subject.IC, Subject.DIC FROM Member JOIN Subject ON Subject.Id = Member.Subject)';9 AddItemString('Name', 'Fakturační jméno', '');10 AddItemString('AddressStreet', 'Ulice', '');11 AddItemString('AddressTown', 'Město', '');12 AddItemString('PSC', 'PSČ', '');13 AddItemString('IC', 'IČ', '');14 AddItemString('DIC', 'DIČ', '');15 AddItemInteger('FamiltyMemberCount', 'Počet osob v domácnosti', '');16 AddItemOneToMany('BillingPeriodNext', 'Požadované fakturační období', '');17 AddItemOneToMany('InternetTariffNextMonth', 'Tarif internetu od dalšího období', 2);9 $this->ModelName = '(SELECT Member.Id, Member.InternetTariffNextMonth, Member.FamilyMemberCount, Subject.Name, Subject.AddressStreet, Subject.AddressTown, Subject.AddressPSC, Subject.IC, Subject.DIC FROM Member JOIN Subject ON Subject.Id = Member.Subject)'; 10 $this->AddItemString('Name', 'Fakturační jméno', ''); 11 $this->AddItemString('AddressStreet', 'Ulice', ''); 12 $this->AddItemString('AddressTown', 'Město', ''); 13 $this->AddItemString('PSC', 'PSČ', ''); 14 $this->AddItemString('IC', 'IČ', ''); 15 $this->AddItemString('DIC', 'DIČ', ''); 16 $this->AddItemInteger('FamilyMemberCount', 'Počet osob v domácnosti', ''); 17 $this->AddItemOneToMany('BillingPeriodNext', 'Požadované fakturační období', 'FinanceBillingPeriod', ''); 18 $this->AddItemOneToMany('InternetTariffNextMonth', 'Tarif internetu od dalšího období', 'FinanceTariff', 2); 18 19 } 19 20 } -
trunk/Modules/Network/Network.php
r371 r372 136 136 parent::__construct($Database, $System); 137 137 $this->Name = 'NetworkSubnet'; 138 $this->ModelName = 'Subnet'; 138 139 $this->AddPropertyString('Name'); 139 140 $this->AddPropertyString('AddressRange'); … … 155 156 class EmailView extends View 156 157 { 157 function __construct() 158 { 158 function __construct($Database) 159 { 160 parent::__construct($Database); 159 161 $this->Name = 'NewEmail'; 160 162 $this->Title = 'Nový email'; -
trunk/Modules/User/User.php
r370 r372 323 323 class UserOptionsView extends View 324 324 { 325 function __construct() 326 { 325 function __construct($Database) 326 { 327 parent::__construct($Database); 327 328 $this->Name = 'UserOptions'; 328 329 $this->Title = 'Nastavení uživatele'; 329 AddItemString('Login', 'Přihlašovací jméno', ''); 330 AddItemPassword('Password', 'Heslo', ''); 331 AddItemString('Name', 'Zobrazované jméno', ''); 332 AddItemString('Email', 'E-mail', ''); 333 AddItemString('PhoneNumber', 'Telefon', ''); 334 AddItemString('ICQ', 'ICQ', ''); 330 $this->ModelName = 'User'; 331 $this->AddItemString('Login', 'Přihlašovací jméno', ''); 332 $this->AddItemPassword('Password', 'Heslo', ''); 333 $this->AddItemString('Name', 'Zobrazované jméno', ''); 334 $this->AddItemString('Email', 'E-mail', ''); 335 $this->AddItemString('PhoneNumber', 'Telefon', ''); 336 $this->AddItemString('ICQ', 'ICQ', ''); 335 337 } 336 338 } … … 338 340 class UserRegisterView extends View 339 341 { 340 function __construct() 341 { 342 function __construct($Database) 343 { 344 parent::__construct($Database); 342 345 $this->Name = 'UserRegister'; 343 346 $this->Title = 'Registrace uživatele'; 344 347 $this->SubmitText = 'Registrovat'; 345 348 $this->ModelName = 'User'; 346 AddItemString('Login', 'Přihlašovací jméno', '');347 AddItemPassword('Password', 'Heslo', '');348 AddItemPassword('Password2', 'Potvrzení hesla', '');349 AddItemString('Name', 'Zobrazované jméno', '');350 AddItemString('Email', 'E-mail', '');351 AddItemString('PhoneNumber', 'Telefon', '');352 AddItemString('ICQ', 'ICQ', '');349 $this->AddItemString('Login', 'Přihlašovací jméno', ''); 350 $this->AddItemPassword('Password', 'Heslo', ''); 351 $this->AddItemPassword('Password2', 'Potvrzení hesla', ''); 352 $this->AddItemString('Name', 'Zobrazované jméno', ''); 353 $this->AddItemString('Email', 'E-mail', ''); 354 $this->AddItemString('PhoneNumber', 'Telefon', ''); 355 $this->AddItemString('ICQ', 'ICQ', ''); 353 356 } 354 357 } … … 356 359 class PasswordRecoveryView extends View 357 360 { 358 function __construct() 359 { 361 function __construct($Database) 362 { 363 parent::__construct($Database); 360 364 $this->Name = 'PasswordRecovery'; 361 365 $this->Title = 'Obnova hesla'; 362 366 $this->SubmitText = 'Obnovit'; 363 AddItemString('Name', 'Přihlašovací jméno', '');364 AddItemString('Email', 'E-mail', '');367 $this->AddItemString('Name', 'Přihlašovací jméno', ''); 368 $this->AddItemString('Email', 'E-mail', ''); 365 369 } 366 370 } … … 368 372 class UserLoginView extends View 369 373 { 370 function __construct() 371 { 374 function __construct($Database) 375 { 376 parent::__construct($Database); 372 377 $this->Name = 'UserLogin'; 373 378 $this->Title = 'Přihlášení uživatele'; 374 379 $this->SubmitText = 'Přihlásit'; 375 AddItemString('Username', 'Přihlašovací jméno', '');376 AddItemPassword('Password', 'Heslo', '');380 $this->AddItemString('Username', 'Přihlašovací jméno', ''); 381 $this->AddItemPassword('Password', 'Heslo', ''); 377 382 } 378 383 }
Note:
See TracChangeset
for help on using the changeset viewer.