1 | <?php |
---|
2 | /***************************************************************************\ |
---|
3 | * eGroupWare - Contacts Center * |
---|
4 | * http://www.egroupware.org * |
---|
5 | * * |
---|
6 | * Storage Object Classes * |
---|
7 | * Written by: * |
---|
8 | * - Raphael Derosso Pereira <raphaelpereira@users.sourceforge.net> * |
---|
9 | * sponsored by Thyamad - http://www.thyamad.com * |
---|
10 | * ------------------------------------------------------------------------- * |
---|
11 | * This program is free software; you can redistribute it and/or modify it * |
---|
12 | * under the terms of the GNU General Public License as published by the * |
---|
13 | * Free Software Foundation; either version 2 of the License, or (at your * |
---|
14 | * option) any later version. * |
---|
15 | \***************************************************************************/ |
---|
16 | |
---|
17 | |
---|
18 | include_once( "class.so_relation_type.inc.php" ); |
---|
19 | |
---|
20 | class so_company_relation_type extends so_relation_type |
---|
21 | { |
---|
22 | |
---|
23 | function so_company_relation_type ( $id = false ) |
---|
24 | { |
---|
25 | $this->init(); |
---|
26 | |
---|
27 | $this->main_fields = array( |
---|
28 | 'id_typeof_company_relation' => array( |
---|
29 | 'name' => 'id_typeof_company_relation', |
---|
30 | 'type' => 'primary', |
---|
31 | 'state' => 'empty', |
---|
32 | 'value' => &$this->id |
---|
33 | ), |
---|
34 | 'company_relation_type_name' => array( |
---|
35 | 'name' => 'company_relation_type_name', |
---|
36 | 'type' => false, |
---|
37 | 'state' => 'empty', |
---|
38 | 'value' => false |
---|
39 | ), |
---|
40 | 'company_relation_is_subordinated' => array( |
---|
41 | 'name' => 'company_relation_is_subordinated', |
---|
42 | 'type' => false, |
---|
43 | 'state' => 'empty', |
---|
44 | 'value' => false |
---|
45 | ) |
---|
46 | ); |
---|
47 | |
---|
48 | $this->type_name = & $this->main_fields['company_relation_type_name']; |
---|
49 | $this->is_subordinated = & $this->main_fields['company_relation_is_subordinated']; |
---|
50 | |
---|
51 | $this->db_tables = array( |
---|
52 | 'phpgw_cc_typeof_co_rels' => array( |
---|
53 | 'type' => 'main', |
---|
54 | 'keys' => array( |
---|
55 | 'primary' => array(&$this->main_fields['id_typeof_company_relation']), |
---|
56 | 'foreign' => false |
---|
57 | ), |
---|
58 | 'fields' => & $this->main_fields |
---|
59 | ) |
---|
60 | ); |
---|
61 | |
---|
62 | if ($id) |
---|
63 | { |
---|
64 | if (!$this->checkout($id)) |
---|
65 | { |
---|
66 | $this->reset_values(); |
---|
67 | $this->state = 'new'; |
---|
68 | } |
---|
69 | } |
---|
70 | else |
---|
71 | { |
---|
72 | $this->state = 'new'; |
---|
73 | } |
---|
74 | } |
---|
75 | } |
---|
76 | ?> |
---|