Changeset 737 for trunk/Modules/Portal
- Timestamp:
- Apr 14, 2015, 10:16:16 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/Portal/Portal.php
r686 r737 14 14 $this->Description = 'Community portal.'; 15 15 $this->Dependencies = array('News'); 16 } 16 } 17 17 18 18 function DoInstall() 19 19 { 20 20 } 21 21 22 22 function DoUninstall() 23 { 24 } 25 23 { 24 } 25 26 26 function DoStart() 27 27 { … … 29 29 $this->System->FormManager->RegisterClass('MemberOptions', array( 30 30 'Title' => 'Nastavení domácnosti', 31 'Table' => '(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)', 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 'Table' => 'MemberOptions', 32 33 'Items' => array( 33 34 'Name' => array('Type' => 'String', 'Caption' => 'Fakturační jméno', 'Default' => ''), … … 43 44 )); 44 45 $this->System->ModuleManager->Modules['User']->UserPanel[] = array('PagePortal', 'UserPanel'); 45 } 46 46 } 47 47 48 function DoStop() 48 { 49 } 49 { 50 } 50 51 } 51 52 … … 54 55 var $FullTitle = 'Zděchovský rozcestník'; 55 56 var $ShortTitle = 'Rozcestník'; 56 57 57 58 function ShowActions($ActionGroup) 58 59 { 59 $Output = ''; 60 $DbResult = $this->Database->query('SELECT `Id` FROM `Action` '. 60 $Output = ''; 61 $DbResult = $this->Database->query('SELECT `Id` FROM `Action` '. 61 62 'WHERE (`Action`.`Group`='.$ActionGroup['Id'].') AND (`Action`.`Enable` = 1)'); 62 63 while($Action = $DbResult->fetch_assoc()) … … 76 77 77 78 $DbResult = $this->Database->query('SELECT COUNT(*) FROM NetworkDevice LEFT JOIN NetworkDeviceType ON NetworkDeviceType.Id = NetworkDevice.Type WHERE (NetworkDeviceType.ShowOnline = 1) AND (NetworkDevice.Online = 1)'); 78 $DbRow = $DbResult->fetch_array(); 79 $DbRow = $DbResult->fetch_array(); 79 80 $OnlineComputers = $DbRow[0]; 80 81 … … 115 116 { 116 117 $Output = '<a href="'.$this->System->Link('/user/?Action=UserOptions').'">Profil</a><br />'; 117 if($this->System->User->CheckPermission('Finance', 'MemberOptions')) 118 if($this->System->User->CheckPermission('Finance', 'MemberOptions')) 118 119 $Output .= '<a href="'.$this->System->Link('/?Action=MemberOptions').'">Domácnost</a><br />'; 119 if($this->System->User->CheckPermission('Finance', 'DisplaySubjectState')) 120 if($this->System->User->CheckPermission('Finance', 'DisplaySubjectState')) 120 121 $Output .= '<a href="'.$this->System->Link('/finance/platby/').'">Finance</a><br />'; 121 if($this->System->User->CheckPermission('Network', 'RegistredHostList')) 122 if($this->System->User->CheckPermission('Network', 'RegistredHostList')) 122 123 $Output .= '<a href="'.$this->System->Link('/network/user-hosts/').'">Počítače</a><br />'; 123 if($this->System->User->CheckPermission('News', 'Insert')) 124 if($this->System->User->CheckPermission('News', 'Insert')) 124 125 $Output .= '<a href="'.$this->System->Link('/aktuality/?action=add').'">Vložení aktuality</a><br />'; 125 126 if($this->System->User->CheckPermission('EatingPlace', 'Edit')) … … 143 144 return($Output); 144 145 } 145 146 146 147 function OnlineHostList() 147 148 { … … 167 168 return($Output); 168 169 } 169 170 170 171 function Panel($Title, $Content, $Menu = array()) 171 172 { 172 if(count($Menu) > 0) 173 if(count($Menu) > 0) 173 174 foreach($Menu as $Item) 174 175 $Title .= '<div class="Action">'.$Item.'</div>'; … … 197 198 'Member.FamilyMemberCount, Member.BillingPeriodNext, Subject.Name, Subject.AddressStreet, '. 198 199 '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 'ON Subject.Id = Member.Subject WHERE Member.Id='.$CustomerUserRel['Customer']); 200 201 $DbRow = $DbResult->fetch_array(); 201 202 foreach($Form->Definition['Items'] as $Index => $Item) … … 216 217 if($Form->Values['BillingPeriodNext'] < 2) 217 218 $Form->Values['BillingPeriodNext'] = 2; 218 219 $DbResult = $this->Database->update('Member', 'Id='.$this->System->User->User['Member'], 220 array('FamilyMemberCount' => $Form->Values['FamilyMemberCount'], 219 220 $DbResult = $this->Database->update('Member', 'Id='.$this->System->User->User['Member'], 221 array('FamilyMemberCount' => $Form->Values['FamilyMemberCount'], 221 222 'BillingPeriodNext' => $Form->Values['BillingPeriodNext'])); 222 223 $DbResult = $this->Database->query('SELECT Subject FROM Member WHERE Id='.$this->System->User->User['Member']); 223 224 $Member = $DbResult->fetch_assoc(); 224 $DbResult = $this->Database->update('Subject', 'Id='.$Member['Subject'], 225 array('Name' => $Form->Values['Name'], 'AddressStreet' => $Form->Values['AddressStreet'], 225 $DbResult = $this->Database->update('Subject', 'Id='.$Member['Subject'], 226 array('Name' => $Form->Values['Name'], 'AddressStreet' => $Form->Values['AddressStreet'], 226 227 'AddressTown' => $Form->Values['AddressTown'], 'AddressCountry' => $Form->Values['AddressCountry'], 227 'AddressPSC' => $Form->Values['AddressPSC'], 'IC' => $Form->Values['IC'], 228 'AddressPSC' => $Form->Values['AddressPSC'], 'IC' => $Form->Values['IC'], 228 229 'DIC' => $Form->Values['DIC'])); 229 230 $Output .= $this->SystemMessage('Nastavení', 'Nastavení domácnosti uloženo.'); 230 $this->System->ModuleManager->Modules['Log']->NewRecord('Member+Subject', 'Nastavení člena/subjektu změněno', 231 $this->System->ModuleManager->Modules['Log']->NewRecord('Member+Subject', 'Nastavení člena/subjektu změněno', 231 232 $Form->Values['Name']); 232 233 $DbResult = $this->Database->query('SELECT Member.Id, Member.FamilyMemberCount, Member.BillingPeriodNext, '. … … 241 242 $Form->OnSubmit = '?Action=MemberOptionsSave'; 242 243 $Output .= $Form->ShowEditForm(); 243 } 244 } 244 245 } else $Output = $this->ShowMain(); 245 246 return($Output); 246 247 } 247 248 248 249 function ShowMain() 249 250 { … … 260 261 while($PanelColumn = $DbResult->fetch_assoc()) 261 262 { 262 if($PanelColumn != '') $Width = ' width="'.$PanelColumn['Width'].'"'; 263 if($PanelColumn != '') $Width = ' width="'.$PanelColumn['Width'].'"'; 263 264 else $Width = ''; 264 265 $Output .= '<td valign="top"'.$Width.'>'; … … 268 269 if($Panel['Module'] == 'ActionGroup') $Output .= $this->ShowActions($ActionGroups[$Panel['Parameters']]); 269 270 else if($Panel['Module'] == 'OnlineHostList') $Output .= $this->Panel('Online počítače', $this->OnlineHostList()); 270 else if($Panel['Module'] == 'UserOptions') 271 else if($Panel['Module'] == 'UserOptions') 271 272 { 272 273 //if($this->System->User->User['Id'] != null) $Output .= $this->Panel('Přihlášený uživatel', $this->UserPanel()); … … 274 275 if($Panel['Module'] == 'Webcam') $Output .= $this->Panel('Kamery', $this->WebcamPanel()); 275 276 if($Panel['Module'] == 'Meteo') $Output .= $this->Panel('Meteostanice', $this->MeteoPanel()); 276 else if($Panel['Module'] == 'NewsGroupList') 277 else if($Panel['Module'] == 'NewsGroupList') 277 278 $Output .= $this->Panel('Aktuality', $this->System->ModuleManager->Modules['News']->Show(), array('<a href="?Action=CustomizeNews">Upravit</a>')); 278 279 } 279 280 $Output .= '</td>'; 280 } 281 } 281 282 $Output .= '</tr></table>'; 282 283 return($Output); 283 } 284 } 284 285 }
Note:
See TracChangeset
for help on using the changeset viewer.