organizationInterface.php 9.95 KB
Newer Older
Prosper De Laure's avatar
Prosper De Laure committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?php
/*
 * Copyright (C) 2015 Maarch
 *
 * This file is part of bundle organization.
 *
 * Bundle organization is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * Bundle organization is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with bundle organization.  If not, see <http://www.gnu.org/licenses/>.
 */
namespace bundle\organization;
/**
 * Interface for organiaztion administration
 */
interface organizationInterface
{

    /**
     * Index of organizations
     *
     * @return organization/organization[] An array of organization
     *
     * @action organization/organization/index
33
     *
Prosper De Laure's avatar
Prosper De Laure committed
34
     */
35
    public function readIndex($limit = null, $query = null);
Prosper De Laure's avatar
Prosper De Laure committed
36
37
38
39
40
41
42
43
44
45
46
47

    /**
     * Tree of organizations
     *
     * @return organization/organizationTree[] An array of organization
     *
     * @action organization/organization/getTree
     */
    public function readTree();

    /**
     * Search organization
48
49
     * @param string $term
     * @param string $enabled
Prosper De Laure's avatar
Prosper De Laure committed
50
51
52
53
54
     *
     * @return organization/organization[] An array of organizations
     *
     * @action organization/organization/search
     */
55
    public function readSearch($term = null, $enabled = "all");
Prosper De Laure's avatar
Prosper De Laure committed
56
57
58
59
60
61
62
63

    /**
     * Create an organization
     * @param organization/organization $organization The organization object to create
     *
     * @return string the new organization's Id
     *
     * @action organization/organization/create
64
65
     * @example /public/tests/organizationCreate-max.json example-max
     * @example /public/tests/organizationCreate-min.json example-min
Prosper De Laure's avatar
Prosper De Laure committed
66
67
68
69
70
71
72
73
74
75
     */
    public function create($organization);

    /**
     * Get an organization by his regitration number
     *
     * @return organization/organization the organization
     *
     * @action organization/organization/getOrgByRegNumber
     */
76
    public function readByregnumber($registrationNumber);
Prosper De Laure's avatar
Prosper De Laure committed
77
78
79
80
81

    /**
     * Get organizations by role
     *
     * @return organization/organization[] the organizations
82
     *
Prosper De Laure's avatar
Prosper De Laure committed
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
     * @action organization/organization/getOrgsByRole
     */
    public function readByrole_role_();

    /**
     * List organisations
     * @param string $role The role of organizations
     *
     * @return array The organizations list
     *
     * @action organization/organization/orgList
     */
    public function readOrgList($role = null);

    /**
     * List organisations units
     * @param string $role The role of organizations
     *
     * @return array The organizations list
     *
     * @action organization/organization/orgUnitList
     */
    public function readOrgunitList($role = null);

    /**
     * Get organization's user positions
     *
     * @return organization/userPositionTree[] The list of user position
     *
     * @action organization/organization/readUserPositions
     */
    public function readUserpositions_orgId_();

    /**
     * Add a user position to an organization
     * @param string $function      The function of the user
     *
     * @return boolean The result of the operation
     *
     * @action organization/organization/addUserPosition
     */
    public function createUserposition_orgId__userAccountId_($function = null);

    /**
     * Add a service position to an organization
     *
     * @return boolean The result of the operation
     *
     * @action organization/organization/addServicePosition
     */
133
    public function createServiceposition_orgId__serviceAccountId_();
Prosper De Laure's avatar
Prosper De Laure committed
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187

    /**
     * Set default user position for an user
     * @param string $orgId         The organization identifier
     * @param string $userAccountId The service account identifier
     *
     * @return boolean The result of the operation
     *
     * @action organization/organization/setDefaultUserPosition
     */
    public function updateSetdefaultposition_orgId__userAccountId_();

    /**
     * Add a user position to an organization
     *
     * @return boolean The result of the operation
     *
     * @action organization/organization/deleteUserPosition
     */
    public function deleteUserposition_orgId__userAccountId_();

    /**
     * Delete a service position to an organization
     *
     * @return boolean The result of the operation
     *
     * @action organization/organization/deleteServicePosition
     */
    public function deleteServiceposition_orgId__serviceAccountId_();

    /**
     * Delete a contact position to an organization
     *
     * @return boolean The result of the operation
     *
     * @action organization/organization/deleteContactPosition
     */
    public function deleteContactposition_orgId__contactId_();

    /**
     * Get organization's service positions
     *
     * @return organization/servicePosition[] The list of service position
     *
     * @action organization/organization/readServicepositions
     */
    public function readServicepositions_orgId_();

    /**
     * Update an organization
     * @param organization/organization $organization The organization object to update
     *
     * @return boolean The result of the operation
     *
188
     * @action organization/organization/update
Prosper De Laure's avatar
Prosper De Laure committed
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
     */
    public function update_orgId_($organization);

    /**
     * Move an organization to a new ownerOrg
     * @param string $newParentOrgId The new parent organization identifier
     * @param string $newOwnerOrgId  The new owner organization identifier
     *
     * @return boolean The result of the operation
     *
     * @action organization/organization/move
     */
    public function updateMove_orgId_($newParentOrgId = null, $newOwnerOrgId = null);

    /**
     * Delete an organization
     *
     * @return boolean The result of the operation
     *
     * @action organization/organization/delete
     */
    public function delete_orgId_();

    /**
     * Get an organization addresses
214
     *
Prosper De Laure's avatar
Prosper De Laure committed
215
216
217
218
219
220
221
222
     * @return contact/address[]
     *
     * @action organization/organization/getAddresses
     */
    public function read_orgId_Addresses();

    /**
     * Get an organization communications
223
     *
Prosper De Laure's avatar
Prosper De Laure committed
224
225
226
227
228
229
230
231
     * @return contact/communication[]
     *
     * @action organization/organization/getCommunications
     */
    public function read_orgId_Communications();

    /**
     * Get an organization contacts
232
     *
Prosper De Laure's avatar
Prosper De Laure committed
233
234
235
236
237
238
239
240
241
242
     * @return contact/contact[]
     *
     * @action organization/organization/getContacts
     */
    public function read_orgId_Contacts();

    /**
     * Add an organization contact
     * @param object $contact
     * @param string $isSelf
243
     *
Prosper De Laure's avatar
Prosper De Laure committed
244
245
246
247
248
     * @return bool
     *
     * @action organization/organization/addContact
     */
    public function create_orgId_Contact($contact, $isSelf);
249

250
251
252
253
254
255
256
257
258
259
260
    /**
     * Create an organization archival profile access
     *
     * @param organization/archivalProfileAccess $archivalProfileAccess
     *
     * @action organization/organization/createArchivalprofileaccess
     *
     * @return  organization/archivalProfileAccess
     */
    public function createArchivalprofileaccess($archivalProfileAccess);

261
262
    /**
     * Add an organization archival profile access
263
264
     *
     * @param organization/archivalProfileAccess $archivalProfileAccess
265
     *
266
     * @action organization/organization/updateArchivalprofileaccess
267
268
     *
     * @return organization/archivalProfileAccess
269
     */
270
    public function updateArchivalprofileaccess($archivalProfileAccess);
271

Jerome Boucher's avatar
Jerome Boucher committed
272
273
274
    /**
     * Add an organization archival profile access
     *
275
276
     * @param string $orgId                    id of organization of archivalProfileAccess to delete
     * @param string $archivalProfileReference archival profile reference of archivalProfileAccess
Jerome Boucher's avatar
Jerome Boucher committed
277
278
279
280
281
     *
     * @action organization/organization/deleteArchivalProfileAccess
     *
     * @return organization/archivalProfileAccess
     */
282
    public function deleteArchivalprofileaccess($orgId, $archivalProfileReference);
Jerome Boucher's avatar
Jerome Boucher committed
283

284
285
    /**
     * Get the profiles by orgRegNumber
286
     *
287
288
     * @param string $orgRegNumber
     * @param string $originatorAccess
289
     *
290
291
292
     * @return array
     * @action organization/organization/getOrgUnitArchivalProfiles
     */
293
    public function readOrgunitprofiles($orgRegNumber, $originatorAccess=null);
Dylan's avatar
Dylan committed
294

295
296
297
298
299
300
    /**
     * Get the user postions by accountId
     *
     * @return array
     * @action organization/organization/readUserOrgs
     */
301
    public function readAccountpositions_accountId_();
302

Dylan's avatar
Dylan committed
303
304
305
    /**
     * List of organizations
     *
306
307
308
     * @param bool $ownerOrg
     * @param bool $orgUnit
     *
309
     * @return array An array of organization and service
Dylan's avatar
Dylan committed
310
311
312
     *
     * @action organization/organization/todisplay
     */
Arnaud Pauget's avatar
Arnaud Pauget committed
313
    public function readTodisplay($ownerOrg = false, $orgUnit = false, $term = "");
Dylan's avatar
#6295    
Dylan committed
314

Dylan's avatar
#6998    
Dylan committed
315
    /**
316
     * Get originator
Dylan's avatar
#6998    
Dylan committed
317
     *
318
     * @action organization/organization/getOriginator
Dylan's avatar
#6998    
Dylan committed
319
     */
320
    public function readOriginator();
Dylan's avatar
#6998    
Dylan committed
321

322
323
324
    /**
     * Create a csv file
     *
325
326
     * @param  integer $limit Max number of results to display
     *
327
328
329
     * @action organization/organization/exportCsv
     *
     */
330
    public function readExport($limit = null);
331

Dylan's avatar
#6295    
Dylan committed
332
    /**
333
     * Read an organization by his orgId
Dylan's avatar
#6295    
Dylan committed
334
     *
335
336
337
     * @return organization/organization the organization
     *
     * @action organization/organization/read
Dylan's avatar
#6295    
Dylan committed
338
     */
339
    public function read_orgId_();
340
341
342
343
344
345

    /**
     * Change status of organization
     *
     * @action organization/organization/changeStatus
     */
346
347
348
    public function read_orgId_ChangeStatus_status_();

    /**
nicolas.diril's avatar
nicolas.diril committed
349
     * @param resource  $data     Data base64 encoded or not
350
     * @param boolean   $isReset  Reset tables or not
351
352
353
354
355
356
     *
     * @action organization/organization/import
     *
     * @return boolean        Import with reset of table data or not
     */
    public function createImport($data, $isReset);
357
}