@@ -48,22 +48,22 @@ discard block |
||
48 | 48 | // Get parameters |
49 | 49 | $action = GETPOST('action', 'aZ09'); |
50 | 50 | $cancel = GETPOST('cancel', 'alpha'); |
51 | -$backtopage = GETPOST('backtopage', 'alpha'); |
|
51 | +$backtopage = GETPOST('backtopage', 'alpha'); |
|
52 | 52 | |
53 | 53 | $id = GETPOSTINT('id'); |
54 | 54 | $ref = GETPOST('ref', 'alpha'); |
55 | -$address = GETPOST('address', 'alpha'); |
|
55 | +$address = GETPOST('address', 'alpha'); |
|
56 | 56 | $zip = GETPOST('zipcode', 'alpha'); |
57 | -$town = GETPOST('town', 'alpha'); |
|
57 | +$town = GETPOST('town', 'alpha'); |
|
58 | 58 | $country_id = GETPOSTINT('country_id'); |
59 | -$state_id = GETPOSTINT('state_id'); |
|
59 | +$state_id = GETPOSTINT('state_id'); |
|
60 | 60 | $description = GETPOST('description', 'restricthtml'); |
61 | 61 | $phone = GETPOST('phone', 'alpha'); |
62 | 62 | $email = GETPOST('email', 'alpha'); |
63 | -$max_users = GETPOSTINT('max_users'); |
|
64 | -$url = GETPOST('url', 'alpha'); |
|
65 | -$confirm = GETPOST('confirm', 'aZ09'); |
|
66 | -$fk_code_type_resource = GETPOST('fk_code_type_resource', 'aZ09'); |
|
63 | +$max_users = GETPOSTINT('max_users'); |
|
64 | +$url = GETPOST('url', 'alpha'); |
|
65 | +$confirm = GETPOST('confirm', 'aZ09'); |
|
66 | +$fk_code_type_resource = GETPOST('fk_code_type_resource', 'aZ09'); |
|
67 | 67 | |
68 | 68 | // Protection if external user |
69 | 69 | if ($user->socid > 0) { |
@@ -118,18 +118,18 @@ discard block |
||
118 | 118 | setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Ref")), null, 'errors'); |
119 | 119 | $action = 'create'; |
120 | 120 | } else { |
121 | - $object->ref = $ref; |
|
122 | - $object->address = $address; |
|
123 | - $object->zip = $zip; |
|
124 | - $object->town = $town; |
|
121 | + $object->ref = $ref; |
|
122 | + $object->address = $address; |
|
123 | + $object->zip = $zip; |
|
124 | + $object->town = $town; |
|
125 | 125 | $object->country_id = $country_id; |
126 | - $object->state_id = $state_id; |
|
126 | + $object->state_id = $state_id; |
|
127 | 127 | $object->description = $description; |
128 | 128 | $object->phone = $phone; |
129 | 129 | $object->email = $email; |
130 | - $object->max_users = $max_users; |
|
131 | - $object->url = $url; |
|
132 | - $object->fk_code_type_resource = $fk_code_type_resource; |
|
130 | + $object->max_users = $max_users; |
|
131 | + $object->url = $url; |
|
132 | + $object->fk_code_type_resource = $fk_code_type_resource; |
|
133 | 133 | |
134 | 134 | // Fill array 'array_options' with data from add form |
135 | 135 | $ret = $extrafields->setOptionalsFromPost(null, $object); |
@@ -168,18 +168,18 @@ discard block |
||
168 | 168 | if ($res > 0) { |
169 | 169 | $oldref = $object->ref; |
170 | 170 | |
171 | - $object->ref = $ref; |
|
172 | - $object->address = $address; |
|
173 | - $object->zip = $zip; |
|
174 | - $object->town = $town; |
|
175 | - $object->country_id = $country_id; |
|
176 | - $object->state_id = $state_id; |
|
177 | - $object->description = $description; |
|
171 | + $object->ref = $ref; |
|
172 | + $object->address = $address; |
|
173 | + $object->zip = $zip; |
|
174 | + $object->town = $town; |
|
175 | + $object->country_id = $country_id; |
|
176 | + $object->state_id = $state_id; |
|
177 | + $object->description = $description; |
|
178 | 178 | $object->phone = $phone; |
179 | 179 | $object->email = $email; |
180 | - $object->max_users = $max_users; |
|
181 | - $object->url = $url; |
|
182 | - $object->fk_code_type_resource = $fk_code_type_resource; |
|
180 | + $object->max_users = $max_users; |
|
181 | + $object->url = $url; |
|
182 | + $object->fk_code_type_resource = $fk_code_type_resource; |
|
183 | 183 | |
184 | 184 | // Fill array 'array_options' with data from add form |
185 | 185 | $ret = $extrafields->setOptionalsFromPost(null, $object, '@GETPOSTISSET'); |
@@ -263,7 +263,7 @@ discard block |
||
263 | 263 | print '$(document).ready(function () { |
264 | 264 | $("#selectcountry_id").change(function() { |
265 | 265 | console.log("selectcountry_id change"); |
266 | - document.formresource.action.value="' . ($action == 'create' ? 'create' : 'edit') . '"; |
|
266 | + document.formresource.action.value="' . ($action == 'create' ? 'create' : 'edit').'"; |
|
267 | 267 | document.formresource.submit(); |
268 | 268 | }); |
269 | 269 | });'; |