Changeset 895 for trunk/Modules/Portal/Portal.php
- Timestamp:
- Jan 12, 2021, 10:29:50 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/Portal/Portal.php
r893 r895 14 14 $this->Description = 'Community portal.'; 15 15 $this->Dependencies = array('News', 'User'); 16 } 17 18 function GetModels(): array 19 { 20 return array(Panel::GetClassName(), PanelColumn::GetClassName()); 21 } 22 23 function DoInstall(): void 24 { 25 /* $this->Database->query("INSERT INTO `PanelColumn` (`Id`, `Width`) VALUES 26 (1, ''), 27 (2, ''), 28 (3, '70%');"); 29 $this->Database->query("INSERT INTO `Panel` (`Id`, `Module`, `Parameters`, `Order`, `PanelColumn`) VALUES 30 (1, 'ActionGroup', 1, 2, 1), 31 (2, 'ActionGroup', 4, 1, 2), 32 (3, 'ActionGroup', 5, 2, 2), 33 (4, 'ActionGroup', 6, 3, 2), 34 (5, 'ActionGroup', 2, 4, 2), 35 (6, 'ActionGroup', 3, 5, 2), 36 (7, 'NewsGroupList', '', 2, 3), 37 (8, 'Webcam', '', 3, 1), 38 (9, 'UserOptions', '', 1, 3), 39 (10, 'ActionGroup', 9, 1, 1), 40 (11, 'Meteo', '', 4, 1);");*/ 16 41 } 17 42 … … 35 60 )); 36 61 ModuleUser::Cast($this->System->GetModule('User'))->UserPanel[] = array('PagePortal', 'UserPanel'); 62 } 63 } 64 65 class PanelColumn extends Model 66 { 67 static function GetDesc(): ModelDesc 68 { 69 $Desc = new ModelDesc(self::GetClassName()); 70 $Desc->AddString('Width'); 71 return $Desc; 72 } 73 } 74 75 class Panel extends Model 76 { 77 static function GetDesc(): ModelDesc 78 { 79 $Desc = new ModelDesc(self::GetClassName()); 80 $Desc->AddString('Module'); 81 $Desc->AddString('Parameters'); 82 $Desc->AddInteger('Order'); 83 $Desc->AddInteger('PanelColumn'); 84 return $Desc; 37 85 } 38 86 } … … 216 264 217 265 $User = &ModuleUser::Cast($this->System->GetModule('User'))->User; 218 $DbResult = $this->Database->update('Member', 'Id='.$User->User['Member'], 266 $DbResult = $this->Database->query('SELECT `Customer` FROM `UserCustomerRel` '. 267 'WHERE `User`='.ModuleUser::Cast($this->System->GetModule('User'))->User->User['Id']); 268 $CustomerUserRel = $DbResult->fetch_assoc(); 269 $CustomerId = $CustomerUserRel['Member']; 270 271 $DbResult = $this->Database->update('Member', 'Id='.$CustomerId, 219 272 array('FamilyMemberCount' => $Form->Values['FamilyMemberCount'])); 220 $DbResult = $this->Database->query('SELECT Subject FROM Member WHERE Id='.$ User->User['Member']);273 $DbResult = $this->Database->query('SELECT Subject FROM Member WHERE Id='.$CustomerId); 221 274 $Member = $DbResult->fetch_assoc(); 222 275 $DbResult = $this->Database->update('Subject', 'Id='.$Member['Subject'], … … 231 284 'Subject.Name, Subject.AddressStreet, Subject.AddressTown, Subject.AddressPSC, '. 232 285 'Subject.AddressCountry, Subject.IC, Subject.DIC FROM Member JOIN Subject '. 233 'ON Subject.Id = Member.Subject WHERE Member.Id='.$ User->User['Member']);286 'ON Subject.Id = Member.Subject WHERE Member.Id='.$CustomerId); 234 287 $DbRow = $DbResult->fetch_array(); 235 288 foreach ($Form->Definition['Items'] as $Index => $Item)
Note:
See TracChangeset
for help on using the changeset viewer.