text changes to registration mail content
[namibia] / module / Company / src / Company / DataBin / Group.php
1 <?php
2 namespace Company\DataBin;
3
4
5
6 /**
7  * Manage Company data.
8  * @author andre.fourie
9  */
10 class Group extends \Workspace\Service\DataBin
11 {
12
13         /**
14          * @var array
15          */
16         protected $meta = array(
17                         'Base'        => 'Group',
18                         'DatasetName' => 'groups',
19                         'Entity'      => '\Company\Entity\Group',
20                         'References'  => array(),
21                         'Dependants'  => array()
22         );
23         /**
24          * @var array
25         */
26         protected $metaSelectList = array(
27                         'Type'          => 'SelectList',
28                         'Contract'      => 'Recurring',
29                         'RequiredInput' => array(),
30                         'OptionalInput' => array(),
31                         'Filter'   => array(),
32                         'Label'    => array(
33                                 'Format' => '[name]',
34                                 'Fields' => array('name')
35                         )
36         );
37
38     /**
39      * @var array
40      */
41     protected $metaStockAuctionSelectList = array(
42         'Type'          => 'SelectList',
43         'Contract'      => 'Recurring',
44         'RequiredInput' => array(),
45         'OptionalInput' => array(
46             'Filter' => array(
47                 'id'         => 'Id'
48             )
49         ),
50         'Filter'   => array(),
51         'Label'    => array(
52             'Format' => '[name]',
53             'Fields' => array('name')
54         )
55     );
56         /**
57          * @var array
58         */
59         protected $metaList = array(
60                         'Type'                  => 'List',
61                         'Contract'      => 'Recurring',
62                         'RequiredInput' => array(),
63                         'OptionalInput' => array(),
64                         'Filter'                => array(),
65                         'OrderBy'               => array(
66                                         'name' => 'ASC'
67                         ),
68                         'Fields' => array(),
69                         'Expand' => array()
70         );
71         /**
72          * @var array
73         */
74         protected $metaCreate = array(
75                         'Type'                  => 'Create',
76                         'Contract'              => 'Recurring',
77                         'RequiredInput' => array(
78                                         'Group' => array(
79                                                         'name'                  => 'String100',
80                                                         'pricingType'   => 'String25'
81                                         )
82                         ),
83                         'OptionalInput' => array(
84                                         'Group' => array(
85                                                         'priceGuide'    => 'Boolean',
86                                                         'fixedPricing'  => 'Integer'
87                                         )
88                         )
89         );
90         /**
91          * @var array
92         */
93         protected $metaUpdate = array(
94                         'Type'                  => 'Update',
95                         'Contract'              => 'UseOnce',
96                         'RequiredInput' => array(
97                                         'Group' => array(
98                                                         'name'                  => 'String100',
99                                                         'pricingType'   => 'String25'
100                                         )
101                         ),
102                         'OptionalInput' => array(
103                                         'Group' => array(
104                                                         'priceGuide'    => 'Boolean',
105                                                         'fixedPricing'  => 'Integer'
106                                         )
107                         )
108         );
109
110 //    /**
111 //     * Add some dynamic filtering to our grids.
112 //     */
113 //    public function __construct()
114 //    {
115 //        $authData = \Utility\Registry::getAuthData();
116 //
117 //        error_log($authData['company']['group']['id']);
118 //
119 //        switch (\Utility\Registry::getUserType())
120 //        {
121 //            case 'B4C User':
122 //                $groupFilter = \Utility\Registry::getSudo('Group', false);
123 //                $groupFilter
124 //                && $this->StockAuctionSelectList['Filter']['group'] = $groupFilter;
125 //
126 //
127 //                break;
128 //            case 'Group User':
129 //
130 //                $this->StockAuctionSelectList['Filter']['group'] = $authData['company']['group']['id'];
131 //
132 ////                $divisionFilter = \Utility\Registry::getSudo('Division', false);
133 ////                //$divisionFilter
134 ////                //  && $this->metaInviteSelectList['Filter']['groupDivision'] = $divisionFilter;
135 ////                $companyFilter = \Utility\Registry::getSudo('Company', $authData['company']['id']);
136 ////                //$companyFilter
137 ////                //  && $this->metaInviteSelectList['Filter']['id'] = '!=' . $companyFilter;
138 ////                $companyFilter
139 ////                && $this->metaTcDealerSelectList['Filter']['tradeCenter'] = $companyFilter;
140 ////                $companyFilter
141 ////                && $this->metaStockAuctionReportSelectList['Filter']['tradeCenter'] = $companyFilter;
142 //                break;
143 //            default:
144 //
145 //                $this->StockAuctionSelectList['Filter']['group'] = $authData['company']['group']['id'];
146 //
147 //
148 ////                //$this->metaInviteSelectList['Filter']['groupDivision'] = $authData['company']['groupDivision']['id'];
149 ////                //$this->metaInviteSelectList['Filter']['id'] = '!=' . $authData['company']['id'];
150 ////                $this->metaTcDealerSelectList['Filter']['tradeCenter'] = $authData['company']['id'];
151 ////                $this->metaStockAuctionReportSelectList['Filter']['tradeCenter'] = $authData['company']['id'];
152 //                break;
153 //        }
154 //    }
155
156 }