Changeset 788
- Timestamp:
- Jan 15, 2016, 10:54:40 PM (9 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Application/Version.php
r785 r788 1 1 <?php 2 2 3 $Revision = 78 6; // Subversion revision3 $Revision = 788; // Subversion revision 4 4 $DatabaseRevision = 785; // SQL structure revision 5 $ReleaseTime = strtotime('2016-01- 09');5 $ReleaseTime = strtotime('2016-01-15'); -
trunk/Modules/Customer/Customer.php
r786 r788 24 24 'ResponsibleUser' => array('Type' => 'TUser', 'Caption' => 'Zodpovědný uživatel', 'Default' => ''), 25 25 'Subject' => array('Type' => 'TSubject', 'Caption' => 'Subjekt', 'Default' => ''), 26 'FamilyMemberCount' => array('Type' => 'String', 'Caption' => ' Osob v domácnosti', 'Default' => '0', 'Suffix' => 'osob'),26 'FamilyMemberCount' => array('Type' => 'String', 'Caption' => 'Bydlících osob', 'Default' => '0', 'Suffix' => 'osob'), 27 27 'MembershipDate' => array('Type' => 'Date', 'Caption' => 'Datum členství', 'Default' => ''), 28 28 'BillingPeriod' => array('Type' => 'TFinanceBillingPeriod', 'Caption' => 'Fakturační období aktuální', 'Default' => ''), -
trunk/Modules/Portal/Portal.php
r786 r788 28 28 $this->System->RegisterPage('', 'PagePortal'); 29 29 $this->System->FormManager->RegisterClass('MemberOptions', array( 30 'Title' => 'Nastavení domácnosti',30 'Title' => 'Nastavení zákazníka', 31 31 'SQL' => '(SELECT Member.Id, Member.FamilyMemberCount, Subject.Name, Subject.AddressStreet, Subject.AddressTown, Subject.AddressPSC, Subject.IC, Subject.DIC FROM Member JOIN Subject ON Subject.Id = Member.Subject)', 32 32 'Table' => 'MemberOptions', … … 39 39 'IC' => array('Type' => 'String', 'Caption' => 'IČ', 'Default' => ''), 40 40 'DIC' => array('Type' => 'String', 'Caption' => 'DIČ', 'Default' => ''), 41 'FamilyMemberCount' => array('Type' => 'Integer', 'Caption' => 'Počet osob v domácnosti', 'Default' => '', 'Suffix' => 'osob'),41 'FamilyMemberCount' => array('Type' => 'Integer', 'Caption' => 'Počet bydlících osob', 'Default' => '', 'Suffix' => 'osob'), 42 42 ), 43 43 )); … … 116 116 $Output = '<a href="'.$this->System->Link('/user/?Action=UserOptions').'">Profil</a><br />'; 117 117 if($this->System->User->CheckPermission('Finance', 'MemberOptions')) 118 $Output .= '<a href="'.$this->System->Link('/?Action=MemberOptions').'"> Domácnost</a><br />';118 $Output .= '<a href="'.$this->System->Link('/?Action=MemberOptions').'">Fakturační adresa</a><br />'; 119 119 if($this->System->User->CheckPermission('Finance', 'DisplaySubjectState')) 120 120 $Output .= '<a href="'.$this->System->Link('/finance/platby/').'">Finance</a><br />'; … … 147 147 { 148 148 $Output = '<span style="font-size: smaller;">'; 149 $DbResult = $this->Database->query('SELECT NetworkDevice.Name FROM NetworkDevice LEFT JOIN NetworkDeviceType ON NetworkDeviceType.Id = NetworkDevice.Type WHERE (NetworkDeviceType.ShowOnline = 1) AND (NetworkDevice.Online = 1) ORDER BY NetworkDevice.Name'); 149 $DbResult = $this->Database->query('SELECT `NetworkDevice`.`Name` FROM `NetworkDevice` '. 150 'LEFT JOIN `NetworkDeviceType` ON `NetworkDeviceType`.`Id` = `NetworkDevice`.`Type` '. 151 'WHERE (`NetworkDeviceType`.`ShowOnline` = 1) AND (`NetworkDevice`.`Online` = 1) ORDER BY `NetworkDevice`.`Name`'); 150 152 while($Device = $DbResult->fetch_array()) 151 153 { … … 188 190 if($Action == 'MemberOptions') 189 191 { 190 $Form = new Form($this->System->FormManager); 191 $Form->SetClass('MemberOptions'); 192 $DbResult = $this->Database->query('SELECT Customer FROM UserCustomerRel WHERE User='.$this->System->User->User['Id']); 193 if($DbResult->num_rows > 0) 192 $DbResult = $this->Database->query('SELECT `Customer` FROM `UserCustomerRel` '. 193 'WHERE `User`='.$this->System->User->User['Id']); 194 while($CustomerUserRel = $DbResult->fetch_assoc()) 194 195 { 195 $CustomerUserRel = $DbResult->fetch_assoc(); 196 $DbResult = $this->Database->query('SELECT Member.Id, '. 197 'Member.FamilyMemberCount, Subject.Name, Subject.AddressStreet, '. 198 'Subject.AddressTown, Subject.AddressPSC, Subject.AddressCountry, Subject.IC, Subject.DIC FROM Member JOIN Subject '. 199 'ON Subject.Id = Member.Subject WHERE Member.Id='.$CustomerUserRel['Customer']); 200 $DbRow = $DbResult->fetch_array(); 196 $DbResult2 = $this->Database->query('SELECT `Member`.`Id`, '. 197 '`Member`.`FamilyMemberCount`, `Subject`.`Name`, `Subject`.`AddressStreet`, '. 198 '`Subject`.`AddressTown`, `Subject`.`AddressPSC`, `Subject`.`AddressCountry`, '. 199 '`Subject`.`IC`, `Subject`.`DIC` FROM `Member` JOIN `Subject` '. 200 'ON `Subject`.`Id` = `Member`.`Subject` WHERE `Member`.`Id`='.$CustomerUserRel['Customer']); 201 $Form = new Form($this->System->FormManager); 202 $Form->SetClass('MemberOptions'); 203 $DbRow = $DbResult2->fetch_array(); 201 204 foreach($Form->Definition['Items'] as $Index => $Item) 202 205 { 203 206 $Form->Values[$Index] = $DbRow[$Index]; 204 207 } 205 $Form->OnSubmit = '?Action=MemberOptionsSave ';208 $Form->OnSubmit = '?Action=MemberOptionsSave&Id='.$CustomerUserRel['Customer']; 206 209 $Output .= $Form->ShowEditForm(); 207 } else $Output .= $this->SystemMessage('Chyba', 'Nejste zákazníkem');210 } 208 211 } else 209 212 if($Action == 'MemberOptionsSave') … … 224 227 'AddressPSC' => $Form->Values['AddressPSC'], 'IC' => $Form->Values['IC'], 225 228 'DIC' => $Form->Values['DIC'])); 226 $Output .= $this->SystemMessage('Nastavení', 'Nastavení domácnostiuloženo.');227 $this->System->ModuleManager->Modules['Log']->NewRecord('Member+Subject', 'Nastavení člena/subjektu změněno',229 $Output .= $this->SystemMessage('Nastavení', 'Nastavení zákazníka uloženo.'); 230 $this->System->ModuleManager->Modules['Log']->NewRecord('Member+Subject', 'Nastavení zákazníka/subjektu změněno', 228 231 $Form->Values['Name']); 229 232 $DbResult = $this->Database->query('SELECT Member.Id, Member.FamilyMemberCount, '.
Note:
See TracChangeset
for help on using the changeset viewer.