Ignore:
Timestamp:
Jan 19, 2012, 12:51:38 PM (13 years ago)
Author:
chronos
Message:
  • Přidáno: Definice modulu a modelu Subject.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Modules/Member/Member.php

    r370 r371  
    11<?php
    22
    3   'MemberOptions' => array(
    4     'Title' => 'Nastavení domácnosti',
    5     '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)',
    6     'Items' => array(
    7       'Name' => array('Type' => 'String', 'Caption' => 'Fakturační jméno', 'Default' => ''),
    8       'AddressStreet' => array('Type' => 'String', 'Caption' => 'Ulice', 'Default' => 'Zděchov'),
    9       'AddressTown' => array('Type' => 'String', 'Caption' => 'Město', 'Default' => 'Zděchov'),
    10       'AddressPSC' => array('Type' => 'String', 'Caption' => 'PSČ', 'Default' => '75607'),
    11       'IC' => array('Type' => 'String', 'Caption' => 'IČ', 'Default' => ''),
    12       'DIC' => array('Type' => 'String', 'Caption' => 'DIČ', 'Default' => ''),
    13       'FamilyMemberCount' => array('Type' => 'Integer', 'Caption' => 'Počet osob v domácnosti', 'Default' => ''),
    14       'BillingPeriodNext' => array('Type' => 'TFinanceBillingPeriod', 'Caption' => 'Požadované fakturované období', 'Default' => ''),
    15       'InternetTariffNextMonth' => array('Type' => 'TFinanceTariff', 'Caption' => 'Tarif internetu od dalšího období', 'Default' => 2),
    16     ),
    17   ),
     3class MemberOptionsView extends View
     4{
     5  function __construct()
     6  {
     7    $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);
     18  }
     19}
     20
     21class Member extends Model
     22{
     23  function __construct($Database, $System)
     24  {
     25    parent::__construct($Database, $System);
     26    $this->Name = 'Member';
     27    $this->AddPropertyDateTime('Time');
     28    $this->AddPropertyOneToMany('User', 'User');
     29    $this->AddPropertyString('Module');
     30    $this->AddPropertyString('Operation');
     31    $this->AddPropertyString('Value');
     32  }
     33}
     34
     35class MemberPayment extends Model
     36{
     37  function __construct($Database, $System)
     38  {
     39    parent::__construct($Database, $System);
     40    $this->Name = 'MemberPayment';
     41    $this->AddPropertyDateTime('Time');
     42    $this->AddPropertyOneToMany('User', 'User');
     43    $this->AddPropertyString('Module');
     44    $this->AddPropertyString('Operation');
     45    $this->AddPropertyString('Value');
     46  }
     47}
     48
     49class ModuleMember extends Module
     50{
     51  function __construct($Database, $System)
     52  {
     53    parent::__construct($Database, $System);
     54    $this->Name = 'Member';
     55    $this->Version = '1.0';
     56    $this->Creator = 'Chronos';
     57    $this->License = 'GNU/GPL';
     58    $this->Description = 'Customer and member management';
     59    $this->Dependencies = array('User', 'Subject');
     60    $this->Models = array('Member', 'MemberPayment');
     61    $this->View = array('MemberOptionsView');
     62  }
     63 
     64  function Install()
     65  {
     66    parent::Install();
     67  }
     68 
     69  function UnInstall()
     70  {
     71    parent::UnInstall();
     72  }
     73
     74  function Init()
     75  {
     76  }
     77}
    1878
    1979?>
Note: See TracChangeset for help on using the changeset viewer.