'Company', 'DatasetName' => 'models', 'Entity' => '\Company\Entity\Company', 'References' => array( 'region' => '\Location\Entity\Region', 'city' => '\Location\Entity\Town', 'billingCity' => '\Location\Entity\Town', 'auctionCity' => '\Location\Entity\Town', 'tradeCenter' => '\Company\Entity\Company', 'group' => '\Company\Entity\Group', 'groupDivision' => '\Company\Entity\GroupDivision', 'regionalManager' => '\Config\Entity\RegionalManager', 'contact' => '\Person\Entity\Contact', 'billingContact' => '\Person\Entity\Contact', 'foundMethod' => '\Company\Entity\FoundMethod', 'foundMethodDetail' => '\Company\Entity\FoundMethodDetail', 'dealershipPhoto' => '\Utility\Entity\Image', 'docStockCertificate' => '\Utility\Entity\Document', 'docAddressProof' => '\Utility\Entity\Document', 'docCopyOfId' => '\Utility\Entity\Document', 'docCopyOfDirectorId' => '\Utility\Entity\Document', 'docCompanyRegistration' => '\Utility\Entity\Document' ), 'Dependants' => array() ); /** * @var array */ protected $metaSelectList = array( 'Type' => 'SelectList', 'Contract' => 'Recurring', 'RequiredInput' => array(), 'OptionalInput' => array( 'Filter' => array( 'company' => 'Id', 'id' => 'Id', 'name' => 'String50', 'group' => 'Id', 'groupDivision' => 'Id', 'region' => 'Id', 'publicCentre' => 'Boolean', 'regionalManager' => 'Array' ) ), 'Filter' => array(), 'Label' => array( 'Format' => '[name]', 'Fields' => array('name') ) ); /** * @var array */ /* protected $metaInviteSelectList = array( 'Type' => 'SelectList', 'Contract' => 'Recurring', 'RequiredInput' => array(), 'OptionalInput' => array( 'Filter' => array( 'company' => 'Id', 'name' => 'String50', 'group' => 'Id', 'groupDivision' => 'Id' ) ), 'Filter' => array( 'priceGuide' => true ), 'Label' => array( 'Format' => '[name]', 'Fields' => array('name') ) ); */ /** * @var array */ protected $metaTradeCenterSelectList = array( 'Type' => 'SelectList', 'Contract' => 'Recurring', 'RequiredInput' => array(), 'OptionalInput' => array( 'Filter' => array( 'company' => 'Id', 'name' => 'String50', 'group' => 'Id', 'groupDivision' => 'Id' ) ), 'Filter' => array( 'dealerType' => \Company\Entity\Company::DEALERTYPE_TRADE_CENTER ), 'Label' => array( 'Format' => '[name]', 'Fields' => array('name') ) ); /** * @var array */ protected $metaTcDealerSelectList = array( 'Type' => 'SelectList', 'Contract' => 'Recurring', 'RequiredInput' => array(), 'OptionalInput' => array( 'Filter' => array( 'tradeCenter' => 'Id' ) ), 'Filter' => array(), 'Label' => array( 'Format' => '[name]', 'Fields' => array('name') ) ); /** * @var array */ protected $metaStockAuctionReportSelectList = array( 'Type' => 'SelectList', 'Contract' => 'Recurring', 'RequiredInput' => array(), 'OptionalInput' => array( 'Filter' => array( 'tradeCenter' => 'Id' ) ), 'Filter' => array(), 'Label' => array( 'Format' => '[name]', 'Fields' => array('name') ) ); /** * @var array */ protected $metaSelectGrid = array( 'Type' => 'Grid', 'Contract' => 'Recurring', 'Options' => array(), 'RequiredInput' => array(), 'OptionalInput' => array( 'Grid' => array( 'NumberOfRecords' => 'Integer', 'Page' => 'Integer', 'Filter' => 'Array', 'OrderBy' => 'Array', ) ), 'Base' => 'company', 'NumberOfRecords' => 1000, 'Query' => 'SELECT [SELECTION] FROM \Company\Entity\Company company JOIN company.city city JOIN city.region region [WHERE] [ORDER]', 'Selection' => 'company, city, region', 'Filter' => array( 'company.archived' => false, 'company.publicCentre' => true ), 'OrderBy' => array('company.name' => 'ASC'), 'Fields' => array( 'id', 'name', 'city' => array( 'name', 'region' => array( 'id', 'name' ) ) ) ); /** * @var array */ protected $metaGrid = array( 'Type' => 'Grid', 'Contract' => 'Recurring', 'Export' => true, 'Builder' => '\Company\Report\CompanyGrid', 'Writer' => '\Utility\Export\ExcelReport', 'Output' => 'Download', 'Options' => array( 'Boolean' => array( 'ExportToExcel' => false ) ), 'RequiredInput' => array(), 'OptionalInput' => array( 'Grid' => array( 'NumberOfRecords' => 'Integer', 'Page' => 'Integer', 'Filter' => 'Array', 'OrderBy' => 'Array', ) ), 'Base' => 'company', 'NumberOfRecords' => 10, 'Query' => 'SELECT [SELECTION] FROM \Company\Entity\Company company JOIN company.contact contact LEFT JOIN company.group grp LEFT JOIN company.groupDivision division LEFT JOIN company.tradeCenter tradeCenter LEFT JOIN company.city city LEFT JOIN city.region region [WHERE] [ORDER]', 'Selection' => 'company, grp, division, contact, tradeCenter, city, region', 'Filter' => array( 'company.archived' => false ), 'OrderBy' => array('company.name' => 'ASC'), 'Fields' => array( 'id', 'name', 'jobState', 'created' => 'DateTime', 'group' => array( 'name' ), 'groupDivision' => array( 'name' ), 'contact' => array( 'firstName', 'familyName', 'email', 'office', 'mobile', 'fax' ), 'tradeCenter' => array( 'name' ) ) ); /** * @var array */ protected $metaUpdate = array( 'Type' => 'Update', 'Contract' => 'UseOnce', 'ExecuteAfter' => array( 'updateAuthSession', 'PublicCentreClubs' ), 'Expand' => array( 'contact', 'city', 'region', 'country', 'tradeCenter', 'group', 'groupDivision', 'regionalManager', 'docStockCertificate', 'docAddressProof', 'docCopyOfId', 'docCopyOfDirectorId', 'docCompanyRegistration' ), 'RelatedEntityFromInput' => array( 'Contact' => array( 'Workflow' => '\Person\Workflow', 'Service' => '\Person\Service\Contact', 'Field' => 'contact' ) ), 'RequiredInput' => array( 'Company' => array( 'name' => 'String100', 'region' => 'Id', 'city' => 'Id', 'street' => 'String75', 'postalCode' => 'String10' ), 'Contact' => array( 'firstName' => 'String50', 'familyName' => 'String50', 'mobile' => 'String20', 'office' => 'String20', 'email' => 'Email' ) ), 'OptionalInput' => array( 'Company' => array( 'owners' => 'Array', 'businessName' => 'String100', 'group' => 'Id', 'groupDivision' => 'Id', 'regionalManager' => 'Id', 'companyRegistrationNumber' => 'String50', 'vatNumber' => 'String20', 'dealerStockNumber' => 'String50', 'companyType' => 'String25', 'docStockCertificate' => 'Id', 'docAddressProof' => 'Id', 'docCopyOfId' => 'Id', 'docCopyOfDirectorId' => 'Id', 'docCompanyRegistration' => 'Id', 'dealerType' => 'String50', 'tradeCenter' => 'String20', 'priceGuide' => 'Boolean', 'statusReason' => 'String250', 'automateFile' => 'String64', 'automateDealerCode' => 'String20', 'autolineFile' => 'String64', 'autolineDealerCode' => 'String20', 'amhgroupFile' => 'String64', 'amhgroupDealerCode' => 'String20', 'publicCentre' => 'Boolean', ), 'Contact' => array( 'fax' => 'String20' ) ) ); /** * @var array */ protected $metaAdminUpdate = array( 'Type' => 'Update', 'Contract' => 'UseOnce', 'ExecuteAfter' => array( 'updateAuthSession', 'PublicCentreClubs' ), 'Expand' => array( 'contact', 'city', 'region', 'country', 'tradeCenter', 'group', 'groupDivision', 'regionalManager', 'docStockCertificate', 'docAddressProof', 'docCopyOfId', 'docCopyOfDirectorId', 'docCompanyRegistration' ), 'RelatedEntityFromInput' => array( 'Contact' => array( 'Workflow' => '\Person\Workflow', 'Service' => '\Person\Service\Contact', 'Field' => 'contact' ) ), 'RequiredInput' => array( 'Company' => array( 'name' => 'String100', 'region' => 'Id', 'city' => 'Id', 'street' => 'String75', 'postalCode' => 'String10' ), 'Contact' => array( 'firstName' => 'String50', 'familyName' => 'String50', 'mobile' => 'String20', 'office' => 'String20', 'email' => 'Email' ) ), 'OptionalInput' => array( 'Company' => array( 'owners' => 'Array', 'businessName' => 'String100', 'group' => 'Id', 'groupDivision' => 'Id', 'regionalManager' => 'Id', 'companyRegistrationNumber' => 'String50', 'vatNumber' => 'String20', 'dealerStockNumber' => 'String50', 'companyType' => 'String25', 'docStockCertificate' => 'Id', 'docAddressProof' => 'Id', 'docCopyOfId' => 'Id', 'docCopyOfDirectorId' => 'Id', 'docCompanyRegistration' => 'Id', 'dealerType' => 'String50', 'tradeCenter' => 'String20', 'priceGuide' => 'Boolean', 'statusReason' => 'String250', 'automateFile' => 'String64', 'automateDealerCode' => 'String20', 'autolineFile' => 'String64', 'autolineDealerCode' => 'String20', 'amhgroupFile' => 'String64', 'amhgroupDealerCode' => 'String20', 'publicCentre' => 'Boolean', ), 'Contact' => array( 'fax' => 'String20' ) ) ); /** * Add some dynamic filtering to our grids. */ public function __construct() { $authData = \Utility\Registry::getAuthData(); switch (\Utility\Registry::getUserType()) { case 'B4C User': $divisionFilter = \Utility\Registry::getSudo('Division', false); //$divisionFilter // && $this->metaInviteSelectList['Filter']['groupDivision'] = $divisionFilter; $companyFilter = \Utility\Registry::getSudo('Company', $authData['company']['id']); //$companyFilter // && $this->metaInviteSelectList['Filter']['id'] = '!=' . $companyFilter; $companyFilter && $this->metaTcDealerSelectList['Filter']['tradeCenter'] = $companyFilter; $companyFilter && $this->metaStockAuctionReportSelectList['Filter']['tradeCenter'] = $companyFilter; break; case 'Group User': $divisionFilter = \Utility\Registry::getSudo('Division', false); //$divisionFilter // && $this->metaInviteSelectList['Filter']['groupDivision'] = $divisionFilter; $companyFilter = \Utility\Registry::getSudo('Company', $authData['company']['id']); //$companyFilter // && $this->metaInviteSelectList['Filter']['id'] = '!=' . $companyFilter; $companyFilter && $this->metaTcDealerSelectList['Filter']['tradeCenter'] = $companyFilter; $companyFilter && $this->metaStockAuctionReportSelectList['Filter']['tradeCenter'] = $companyFilter; break; default: //$this->metaInviteSelectList['Filter']['groupDivision'] = $authData['company']['groupDivision']['id']; //$this->metaInviteSelectList['Filter']['id'] = '!=' . $authData['company']['id']; $this->metaTcDealerSelectList['Filter']['tradeCenter'] = $authData['company']['id']; $this->metaStockAuctionReportSelectList['Filter']['tradeCenter'] = $authData['company']['id']; break; } } }