\Corps
Corporate aka enterprise users implementation
Synopsis
class Corps
{
- // constants
- const ROUTE_PREFIX = 'show';
- const URL_TAXTYPE = 'taxtypes';
- const URL_TAXTYPE_LIST = '?module=corps&show=taxtypes';
- const URL_TAXTYPE_DEL = '?module=corps&show=taxtypes&deltaxtypeid=';
- const URL_CORPS = 'corps';
- const URL_CORPS_LIST = '?module=corps&show=corps';
- const URL_SEARCH = 'search';
- const URL_CORPS_SEARCH = '?module=corps&show=search';
- const URL_CORPS_EDIT = '?module=corps&show=corps&editid=';
- const URL_CORPS_ADD = '?module=corps&show=corps&add=true';
- const URL_CORPS_DEL = '?module=corps&show=corps&deleteid=';
- const URL_USER = 'user';
- const URL_USER_MANAGE = '?module=corps&show=user&username=';
- const URL_AJDT = 'ajax';
- const TABLE_DATA = 'corp_data';
- const TABLE_TAXTYPES = 'corp_taxtypes';
- const TABLE_PERSONS = 'corp_persons';
- const TABLE_USERS = 'corp_users';
- // members
- protected array $altCfg = ;
- protected bool $ibanFlag = false;
- protected array $users = ;
- protected array $corps = ;
- protected array $persons = ;
- protected array $taxtypes = ;
- protected bool $rfCorpsFlag = false;
- protected array $doctypes = ;
- protected $corpsDb = '';
- protected $taxtypesDb = '';
- protected $personsDb = '';
- protected $usersDb = '';
- // methods
- public void __construct()
- protected void loadConfigs()
- protected void initDb()
- protected void loadCorps()
- protected void loadTaxtypes()
- protected void loadPersons()
- protected void loadUsers()
- protected string taxtypeEditForm()
- protected string taxtypeCreateForm()
- public void taxtypeCreate()
- protected string alertDelete()
- public string taxtypesList()
- public void taxtypeDelete()
- public void taxtypeEdit()
- public string corpsList()
- public void corpsListAjax()
- public string corpPreview()
- protected string doctypeSelector()
- protected string corpListUsers()
- protected array filterArray()
- public string corpEditForm()
- public string corpCreateForm()
- public void corpDelete()
- public void corpSave()
- public int corpCreate()
- public string corpsPanel()
- protected string personsList()
- protected string personsControl()
- public string personCreateForm()
- protected string personEditForm()
- public void personSave()
- public void personCreate()
- public bool taxtypeProtected()
- public void personDelete()
- public void userBind()
- public void userUnbind()
- public int/bool userIsCorporate()
- public string userUnbindForm()
- public string corpsBindForm()
- public string corpCreateAndBindForm()
- public bool corpProtected()
- public array corpGetDataByLogin()
- public array getCorps()
- public array getUsers()
- protected int searchCorpIdbyName()
- protected array searchUsersByCorpId()
- public string searchUsersByCorpName()
Constants
Name | Value |
---|---|
ROUTE_PREFIX | 'show' |
URL_TAXTYPE | 'taxtypes' |
URL_TAXTYPE_LIST | '?module=corps&show=taxtypes' |
URL_TAXTYPE_DEL | '?module=corps&show=taxtypes&deltaxtypeid=' |
URL_CORPS | 'corps' |
URL_CORPS_LIST | '?module=corps&show=corps' |
URL_SEARCH | 'search' |
URL_CORPS_SEARCH | '?module=corps&show=search' |
URL_CORPS_EDIT | '?module=corps&show=corps&editid=' |
URL_CORPS_ADD | '?module=corps&show=corps&add=true' |
URL_CORPS_DEL | '?module=corps&show=corps&deleteid=' |
URL_USER | 'user' |
URL_USER_MANAGE | '?module=corps&show=user&username=' |
URL_AJDT | 'ajax' |
TABLE_DATA | 'corp_data' |
TABLE_TAXTYPES | 'corp_taxtypes' |
TABLE_PERSONS | 'corp_persons' |
TABLE_USERS | 'corp_users' |
Members
protected
- $altCfg
—
array
Contains system alter config as key=>value - $corps
—
array
Contains available corps as id=>corpData - $corpsDb
—
Contains corps data database abstraction layer - $doctypes
—
array
Contains available document types - $ibanFlag
—
bool
Display IBAN label instead of bank account in some forms/preview. - $persons
—
array
Contains available corps contact persons as id=>personData - $personsDb
—
Contains persons database abstraction layer - $rfCorpsFlag
—
bool
Use bank/taxes field names for RF flag - $taxtypes
—
array
Contains existing tax types as id=>type - $taxtypesDb
—
Contains taxtypes database abstraction layer - $users
—
array
Contains available corps to normal users bindings as login=>corpId - $usersDb
—
Contains users database abstraction layer
Methods
protected
- alertDelete() — returns standard localized deletion alert
- corpListUsers() — returns list of users which linked with this corp
- doctypeSelector() — returns selector of existing doctypes
- filterArray() — filter array for unacceptable entities
- initDb() — Inits all required database abstraction layers
- loadConfigs() — Loads required configs and sets some object properties
- loadCorps() — loads available corps from database into private prop
- loadPersons() — loads contact persons from database
- loadTaxtypes() — loads taxtypes from database
- loadUsers() — loads user bindings from database and store it into private prop users
- personEditForm() — returns conact person creation form
- personsControl() — returns contact persons edit control for some corp
- personsList() — returns contact persons list for some corp
- searchCorpIdbyName() — Rerurns corp id by name part
- searchUsersByCorpId() — returns users array by some corp ID
- taxtypeCreateForm() — returns new taxtype creation form
- taxtypeEditForm() — returns existing taxtype edit form
public
- __construct() — Creates new corps object instance
- corpCreate() — Creates new corp in database
- corpCreateAndBindForm() — returns user binding form
- corpCreateForm() — Returns corp creation form
- corpDelete() — deletes existing corp by ID
- corpEditForm() — returns corp edit form
- corpGetDataByLogin() — Gets corp data by associated username
- corpPreview() — show existing corp preview
- corpProtected() — checks is corp used by something or not?
- corpSave() — edits corp in database
- corpsBindForm() — returns existing coorps selector
- corpsList() — list available corps list container
- corpsListAjax() — list available corps JSON data with some controls
- corpsPanel() — returns corps link panel
- getCorps() — Returns array of available corps
- getUsers() — Returns array of available corps users
- personCreate() — creates new contact person in database
- personCreateForm() — returns conact person creation form
- personDelete() — deletes an existing contact person
- personSave() — edits contact person in database
- searchUsersByCorpName() — Returns standard user list of users assigned for some corp
- taxtypeCreate() — creates new taxtype
- taxtypeDelete() — deletes existing tax type from database
- taxtypeEdit() — edits existing tax type
- taxtypeProtected() — check is taxtype used by someone?
- taxtypesList() — return existing taxtypes list with edit controls
- userBind() — binds user login to existing corp ID
- userIsCorporate() — checks is user associated with some corp or not? If associated - returns corp ID
- userUnbind() — unbinds user login from any corp and sets him as just private user
- userUnbindForm() — returns user unbind form