|
183 | 183 | } |
184 | 184 |
|
185 | 185 | if (isModEnabled('societe')) { |
186 | | - /* |
187 | | - *** Labour Doctor -- Médecin du travail *** |
188 | | - */ |
189 | | - |
190 | | - print '<tr class="liste_titre"><th class="titlefield wordbreak">' . $langs->trans("LabourDoctor") . '</th><th><i class="fas fa-briefcase-medical"></i></th></tr>' . "\n"; |
191 | | - print '<tr class="oddeven"><td class="titlefieldcreate nowrap">' . $langs->trans("ActionOnCompany") . '</td><td>'; |
192 | | - |
193 | | - $labourdDoctorSociety = $allLinks['LabourDoctorSociety']; |
194 | | - |
195 | | - // * Third party concerned - Tiers concerné * |
196 | | - |
197 | | - if ($labourdDoctorSociety->ref == 'LabourDoctorSociety') { |
198 | | - $events = []; |
199 | | - $events[] = array('method' => 'getContacts', 'url' => dol_buildpath('/core/ajax/contacts.php?showempty=1', 1), 'htmlname' => 'labourdoctor_contactid', 'params' => array('add-customer-contact' => 'disabled')); |
200 | | - $societe->fetch($labourdDoctorSociety->id[0]); |
201 | | - |
202 | | - if ($action == 'create_soc' && $type == $labourdDoctorSociety->ref) { |
203 | | - $labourdDoctorSociety->id[0] = array_key_first($lastSocietyCreated); |
204 | | - } |
205 | | - |
206 | | - print $form->select_company($labourdDoctorSociety->id[0], 'labourdoctor_socid', '', 'SelectThirdParty', 1, 0, $events, 0, 'minwidth300'); |
207 | | - } else { |
208 | | - $events = []; |
209 | | - $events[] = array('method' => 'getContacts', 'url' => dol_buildpath('/core/ajax/contacts.php?showempty=1', 1), 'htmlname' => 'labourdoctor_contactid', 'params' => array('add-customer-contact' => 'disabled')); |
210 | | - |
211 | | - //For external user force the company to user company |
212 | | - if ( ! empty($user->socid)) { |
213 | | - print $form->select_company($user->socid, 'labourdoctor_socid', '', 0, 1, 0, $events, 0, 'minwidth300'); |
214 | | - } else { |
215 | | - print $form->select_company('', 'labourdoctor_socid', '', 'SelectThirdParty', 1, 0, $events, 0, 'minwidth300'); |
216 | | - } |
217 | | - } |
218 | | - if (!GETPOSTISSET('backtopage')) { |
219 | | - print ' <a href="' . DOL_URL_ROOT . '/societe/card.php?action=create&backtopage=' . urlencode($_SERVER["PHP_SELF"] . '?action=create_soc&type=' . $labourdDoctorSociety->ref) . '"><span class="fa fa-plus-circle valignmiddle paddingleft" title="' . $langs->trans("AddThirdParty") . '"></span></a>'; |
220 | | - } |
221 | | - print '</td></tr>'; |
222 | | - |
223 | | - // * Related contacts - Contacts associés * |
224 | | - print '<tr class="oddeven"><td class="nowrap">' . $langs->trans("ActionOnContact") . '</td><td>'; |
225 | | - |
226 | | - $labourdDoctorContact = $allLinks['LabourDoctorContact']; |
227 | | - $labourDoctorPreselectedIds = $labourdDoctorContact->id ?: []; |
228 | | - |
229 | | - if ($action == 'create_contact' && $contact->fk_soc == $societe->id) { |
230 | | - $labourDoctorPreselectedIds = array_merge($labourDoctorPreselectedIds, [$lastContactId]); |
231 | | - } |
232 | | - |
233 | | - if ($labourdDoctorContact->id) { |
234 | | - print $form->selectcontacts(empty($labourdDoctorSociety->id[0]) ? -1 : $labourdDoctorSociety->id[0], $labourDoctorPreselectedIds, 'labourdoctor_contactid[]', 0, '', '', 0, 'minwidth500', false, 0, [], false, 'multiple', 'labourdoctor_contactid'); |
235 | | - } else { |
236 | | - $labourDoctorPreselectedIds = array_merge($labourDoctorPreselectedIds, GETPOST('labourdoctor_contactid', 'array')); |
237 | | - if (GETPOST('labourdoctor_contactid', 'array')) { |
238 | | - $labourDoctorPreselectedIds[GETPOST('labourdoctor_contactid', 'array')] = GETPOST('labourdoctor_contactid', 'array'); |
| 186 | + $securityArray = [ |
| 187 | + 'LabourDoctor' => ['labourdoctor', 'fa-briefcase-medical'], |
| 188 | + 'LabourInspector' => ['labourinspector', 'fa-search'], |
| 189 | + 'SAMU' => ['samu', 'fa-hospital-alt'], |
| 190 | + 'Pompiers' => ['pompiers', 'fa-ambulance'], |
| 191 | + 'Police' => ['police', 'fa-car'], |
| 192 | + 'AllEmergencies' => ['touteurgence', 'fa-phone'], |
| 193 | + 'RightsDefender' => ['defenseur', 'fa-gavel'], |
| 194 | + 'PoisonControlCenter' => ['antipoison', 'fa-skull-crossbones'], |
| 195 | + ]; |
| 196 | + |
| 197 | + foreach($securityArray as $title => $infos) { |
| 198 | + $prefix = $infos[0]; |
| 199 | + $icon = 'fas ' . $infos[1]; |
| 200 | + |
| 201 | + print '<tr class="liste_titre"><th class="titlefield wordbreak">' . $langs->trans($title) . '</th><th><i class="'. $icon .'"></i></th></tr>' . "\n"; |
| 202 | + print '<tr class="oddeven"><td class="titlefieldcreate nowrap">' . $langs->trans("ActionOnCompany") . '</td><td>'; |
| 203 | + |
| 204 | + // Exceptions for labour doctor and inspector |
| 205 | + $labourSociety = ($prefix == 'labourdoctor' || $prefix == 'labourinspector' ? $allLinks[$title . 'Society'] : $allLinks[$title]); |
| 206 | + |
| 207 | + // * Third party concerned - Tiers concerné * |
| 208 | + $events[] = ['method' => 'getContacts', 'url' => dol_buildpath('/core/ajax/contacts.php?showempty=1', 1), 'htmlname' => $prefix . '_contactid', 'params' => ['add-customer-contact' => 'disabled']]; |
| 209 | + if ($labourSociety->ref == $title || $labourSociety->ref == $title . 'Society') { |
| 210 | + $societe->fetch($labourSociety->id[0]); |
| 211 | + |
| 212 | + if ($action == 'create_soc' && $type == $labourSociety->ref) { |
| 213 | + $labourSociety->id[0] = array_key_first($lastSocietyCreated); |
| 214 | + } |
| 215 | + |
| 216 | + print $form->select_company($labourSociety->id[0], $prefix . '_socid', '', 'SelectThirdParty', 1, 0, $events, 0, 'minwidth300'); |
| 217 | + } else { |
| 218 | + //For external user force the company to user company |
| 219 | + if (!empty($user->socid)) { |
| 220 | + print $form->select_company($user->socid, $prefix . '_socid', '', 0, 1, 0, $events, 0, 'minwidth300'); |
| 221 | + } else { |
| 222 | + print $form->select_company('', $prefix . '_socid', '', 'SelectThirdParty', 1, 0, $events, 0, 'minwidth300'); |
| 223 | + } |
239 | 224 | } |
240 | | - print $form->selectcontacts(empty(GETPOST('labourdoctor_socid', 'int')) ? $labourdDoctorSociety->id[0] : GETPOST('labourdoctor_socid', 'int'), $labourDoctorPreselectedIds, 'labourdoctor_contactid[]', 0, '', '', 0, 'minwidth500', false, 0, [], false, 'multiple', 'labourdoctor_contactid'); |
241 | | - } |
242 | | - if (!GETPOSTISSET('backtopage')) { |
243 | | - print ' <a href="' . DOL_URL_ROOT . '/contact/card.php?action=create&socid='. $labourdDoctorSociety->id[0] .'&backtopage=' . urlencode($_SERVER["PHP_SELF"] . '?action=create_contact') . '"><span class="fa fa-plus-circle valignmiddle paddingleft" title="' . $langs->trans("AddContact") . '"></span></a>'; |
244 | | - } |
245 | | - print '</td></tr>'; |
246 | | - |
247 | | - /* |
248 | | - *** Labour Inspector -- Inspecteur du travail *** |
249 | | - */ |
250 | | - |
251 | | - print '<tr class="liste_titre"><th class="titlefield wordbreak">' . $langs->trans("LabourInspector") . '</th><th><i class="fas fa-search"></i></th></tr>' . "\n"; |
252 | | - print '<tr class="oddeven"><td class="titlefieldcreate nowrap">' . $langs->trans("ActionOnCompany") . '</td><td>'; |
253 | | - |
254 | | - $labourdInspectorSociete = $allLinks['LabourInspectorSociety']; |
255 | | - |
256 | | - // * Third party concerned - Tiers concerné * |
257 | | - |
258 | | - if ($labourdInspectorSociete->ref == 'LabourInspectorSociety') { |
259 | | - $events = []; |
260 | | - $events[] = array('method' => 'getContacts', 'url' => dol_buildpath('/core/ajax/contacts.php?showempty=1', 1), 'htmlname' => 'labourinspector_contactid', 'params' => array('add-customer-contact' => 'disabled')); |
261 | | - $societe->fetch($labourdInspectorSociete->id[0]); |
262 | | - |
263 | | - if ($action == 'create_soc' && $type == $labourdInspectorSociete->ref) { |
264 | | - $labourdInspectorSociete->id[0] = array_key_first($lastSocietyCreated); |
| 225 | + if (!GETPOSTISSET('backtopage')) { |
| 226 | + print ' <a href="' . DOL_URL_ROOT . '/societe/card.php?action=create&backtopage=' . urlencode($_SERVER["PHP_SELF"] . '?action=create_soc&type=' . $labourSociety->ref) . '"><span class="fa fa-plus-circle valignmiddle paddingleft" title="' . $langs->trans("AddThirdParty") . '"></span></a>'; |
265 | 227 | } |
266 | | - |
267 | | - print $form->select_company($labourdInspectorSociete->id[0], 'labourinspector_socid', '', 0, 1, 0, $events, 0, 'minwidth300'); |
268 | | - } else { |
269 | | - $events = []; |
270 | | - $events[] = array('method' => 'getContacts', 'url' => dol_buildpath('/core/ajax/contacts.php?showempty=1', 1), 'htmlname' => 'labourinspector_contactid', 'params' => array('add-customer-contact' => 'disabled')); |
271 | | - //For external user force the company to user company |
272 | | - if ( ! empty($user->socid)) { |
273 | | - print $form->select_company($user->socid, 'labourinspector_socid', '', 0, 1, 0, $events, 0, 'minwidth300'); |
274 | | - } else { |
275 | | - print $form->select_company('', 'labourinspector_socid', '', 'SelectThirdParty', 1, 0, $events, 0, 'minwidth300'); |
276 | | - } |
277 | | - } |
278 | | - if (!GETPOSTISSET('backtopage')) { |
279 | | - print ' <a href="' . DOL_URL_ROOT . '/societe/card.php?action=create&backtopage=' . urlencode($_SERVER["PHP_SELF"] . '?action=create_soc&type=' . $labourdInspectorSociete->ref) . '"><span class="fa fa-plus-circle valignmiddle paddingleft" title="' . $langs->trans("AddThirdParty") . '"></span></a>'; |
280 | | - } |
281 | | - print '</td></tr>'; |
282 | | - |
283 | | - // * Related contacts - Contacts associés * |
284 | | - |
285 | | - print '<tr class="oddeven"><td class="nowrap">' . $langs->trans("ActionOnContact") . '</td><td>'; |
286 | | - |
287 | | - $labourInspectorContacts = $allLinks['LabourInspectorContact']; |
288 | | - $labourInspectorPreselectedIds = $labourInspectorContacts->id ?: []; |
289 | | - |
290 | | - if ($action == 'create_contact' && $contact->fk_soc == $societe->id) { |
291 | | - $labourInspectorPreselectedIds = array_merge($labourInspectorPreselectedIds, [$lastContactId]); |
292 | | - } |
293 | | - |
294 | | - if ($labourInspectorContacts->id) { |
295 | | - print $form->selectcontacts(empty($labourdInspectorSociete->id[0]) ? -1 : $labourdInspectorSociete->id[0], $labourInspectorPreselectedIds, 'labourinspector_contactid[]', 0, '', '', 0, 'minwidth500', false, 0, [], false, 'multiple', 'labourinspector_contactid'); |
296 | | - } else { |
297 | | - $labourInspectorPreselectedIds = array_merge($labourInspectorPreselectedIds, GETPOST('labourinspector_contactid', 'array')); |
298 | | - if (GETPOST('labourinspector_contactid', 'array')) { |
299 | | - $labourInspectorPreselectedIds[GETPOST('labourinspector_contactid', 'array')] = GETPOST('labourinspector_contactid', 'array'); |
| 228 | + print '</td></tr>'; |
| 229 | + |
| 230 | + // * Related contacts - Contacts associés * for labour doctor and inspector |
| 231 | + if ($prefix == 'labourdoctor' || $prefix == 'labourinspector') { |
| 232 | + print '<tr class="oddeven"><td class="nowrap">' . $langs->trans("ActionOnContact") . '</td><td>'; |
| 233 | + |
| 234 | + $labourContact = $allLinks[$title . 'Contact']; |
| 235 | + $labourPreselectedIds = $labourContact->id ?: []; |
| 236 | + |
| 237 | + if ($action == 'create_contact' && $contact->fk_soc == $societe->id) { |
| 238 | + $labourPreselectedIds = array_merge($labourPreselectedIds, [$lastContactId]); |
| 239 | + } |
| 240 | + |
| 241 | + if ($labourContact->id) { |
| 242 | + print $form->selectcontacts(empty($labourSociety->id[0]) ? -1 : $labourSociety->id[0], $labourPreselectedIds, $prefix . '_contactid[]', 0, '', '', 0, 'minwidth500', false, 0, [], false, 'multiple', $prefix . '_contactid'); |
| 243 | + } else { |
| 244 | + $labourPreselectedIds = array_merge($labourPreselectedIds, GETPOST($prefix . '_contactid', 'array')); |
| 245 | + if (GETPOST($prefix . '_contactid', 'array')) { |
| 246 | + $labourPreselectedIds[GETPOST($prefix . '_contactid', 'array')] = GETPOST($prefix . '_contactid', 'array'); |
| 247 | + } |
| 248 | + print $form->selectcontacts(empty(GETPOST($prefix . '_socid', 'int')) ? $labourSociety->id[0] : GETPOST($prefix . '_socid', 'int'), $labourPreselectedIds, $prefix . '_contactid[]', 0, '', '', 0, 'minwidth500', false, 0, [], false, 'multiple', 'labourdoctor_contactid'); |
| 249 | + } |
| 250 | + if (!GETPOSTISSET('backtopage')) { |
| 251 | + print ' <a href="' . DOL_URL_ROOT . '/contact/card.php?action=create&socid=' . $labourSociety->id[0] . '&backtopage=' . urlencode($_SERVER["PHP_SELF"] . '?action=create_contact') . '"><span class="fa fa-plus-circle valignmiddle paddingleft" title="' . $langs->trans("AddContact") . '"></span></a>'; |
| 252 | + } |
| 253 | + print '</td></tr>'; |
300 | 254 | } |
301 | | - print $form->selectcontacts(empty(GETPOST('labourinspector_socid', 'int')) ? $labourdInspectorSociete->id[0] : GETPOST('labourinspector_socid', 'int'), $labourInspectorPreselectedIds, 'labourinspector_contactid[]', 0, '', '', 0, 'minwidth500', false, 0, [], false, 'multiple', 'labourinspector_contactid'); |
302 | | - } |
303 | | - if (!GETPOSTISSET('backtopage')) { |
304 | | - print ' <a href="' . DOL_URL_ROOT . '/contact/card.php?action=create&socid='. $labourdInspectorSociete->id[0] .'&backtopage=' . urlencode($_SERVER["PHP_SELF"] . '?action=create_contact') . '"><span class="fa fa-plus-circle valignmiddle paddingleft" title="' . $langs->trans("AddContact") . '"></span></a>'; |
305 | 255 | } |
306 | | - print '</td></tr>'; |
307 | | - |
308 | | - /* |
309 | | - *** Emergencies -- SAMU *** |
310 | | - */ |
311 | | - |
312 | | - print '<tr class="liste_titre"><th class="titlefield wordbreak">' . $langs->trans("SAMU") . '</th><th><i class="fas fa-hospital-alt"></i></th></tr>' . "\n"; |
313 | | - print '<tr class="oddeven"><td class="titlefieldcreate nowrap">' . $langs->trans("ActionOnCompany") . '</td><td>'; |
314 | | - |
315 | | - $samuResources = $allLinks['SAMU']; |
316 | | - |
317 | | - // * Third party concerned - Tiers concerné * |
318 | | - |
319 | | - if ($samuResources->ref == 'SAMU') { |
320 | | - $societe->fetch($samuResources->id[0]); |
321 | | - |
322 | | - print $form->select_company($samuResources->id[0], 'samu_socid', '', 'SelectThirdParty', 1, 0, 0, 0, 'minwidth300'); |
323 | | - } else { |
324 | | - //For external user force the company to user company |
325 | | - if ( ! empty($user->socid)) { |
326 | | - print $form->select_company($user->socid, 'samu_socid', '', 1, 1, 0, 0, 0, 'minwidth300'); |
327 | | - } else { |
328 | | - print $form->select_company('', 'samu_socid', '', 'SelectThirdParty', 1, 0, 0, 0, 'minwidth300'); |
329 | | - } |
330 | | - } |
331 | | - if ( ! GETPOSTISSET('backtopage')) print ' <a href="' . DOL_URL_ROOT . '/societe/card.php?action=create&backtopage=' . urlencode($_SERVER["PHP_SELF"] . '?action=create') . '"><span class="fa fa-plus-circle valignmiddle paddingleft" title="' . $langs->trans("AddThirdParty") . '"></span></a>'; |
332 | | - print '</td></tr>'; |
333 | | - |
334 | | - /* |
335 | | - *** Fire Brigade -- Pompiers *** |
336 | | - */ |
337 | | - |
338 | | - print '<tr class="liste_titre"><th class="titlefield wordbreak">' . $langs->trans("FireBrigade") . '</th><th><i class="fas fa-ambulance"></i></th></tr>' . "\n"; |
339 | | - print '<tr class="oddeven"><td class="titlefieldcreate nowrap">' . $langs->trans("ActionOnCompany") . '</td><td>'; |
340 | | - |
341 | | - $pompiersResources = $allLinks['Pompiers']; |
342 | | - |
343 | | - // * Third party concerned - Tiers concerné * |
344 | | - |
345 | | - if ($pompiersResources->ref == 'Pompiers') { |
346 | | - $societe->fetch($pompiersResources->id[0]); |
347 | | - print $form->select_company($pompiersResources->id[0], 'pompiers_socid', '', 'SelectThirdParty', 1, 0, 0, 0, 'minwidth300'); |
348 | | - } else { |
349 | | - //For external user force the company to user company |
350 | | - if ( ! empty($user->socid)) { |
351 | | - print $form->select_company($user->socid, 'pompiers_socid', '', 1, 1, 0, 0, 0, 'minwidth300'); |
352 | | - } else { |
353 | | - print $form->select_company('', 'pompiers_socid', '', 'SelectThirdParty', 1, 0, 0, 0, 'minwidth300'); |
354 | | - } |
355 | | - } |
356 | | - if ( ! GETPOSTISSET('backtopage')) print ' <a href="' . DOL_URL_ROOT . '/societe/card.php?action=create&backtopage=' . urlencode($_SERVER["PHP_SELF"] . '?action=create') . '"><span class="fa fa-plus-circle valignmiddle paddingleft" title="' . $langs->trans("AddThirdParty") . '"></span></a>'; |
357 | | - print '</td></tr>'; |
358 | | - |
359 | | - /* |
360 | | - *** Police -- Police *** |
361 | | - */ |
362 | | - |
363 | | - print '<tr class="liste_titre"><th class="titlefield wordbreak">' . $langs->trans("Police") . '</th><th><i class="fas fa-car"></i></th></tr>' . "\n"; |
364 | | - print '<tr class="oddeven"><td class="titlefieldcreate nowrap">' . $langs->trans("ActionOnCompany") . '</td><td>'; |
365 | | - |
366 | | - $policeResources = $allLinks['Police']; |
367 | | - |
368 | | - // * Third party concerned - Tiers concerné * |
369 | | - |
370 | | - if ($policeResources->ref == 'Police') { |
371 | | - $societe->fetch($policeResources->id[0]); |
372 | | - print $form->select_company($policeResources->id[0], 'police_socid', '', 'SelectThirdParty', 1, 0, 0, 0, 'minwidth300'); |
373 | | - } else { |
374 | | - //For external user force the company to user company |
375 | | - if ( ! empty($user->socid)) { |
376 | | - print $form->select_company($user->socid, 'police_socid', '', 1, 1, 0, 0, 0, 'minwidth300'); |
377 | | - } else { |
378 | | - print $form->select_company('', 'police_socid', '', 'SelectThirdParty', 1, 0, 0, 0, 'minwidth300'); |
379 | | - } |
380 | | - } |
381 | | - if ( ! GETPOSTISSET('backtopage')) print ' <a href="' . DOL_URL_ROOT . '/societe/card.php?action=create&backtopage=' . urlencode($_SERVER["PHP_SELF"] . '?action=create') . '"><span class="fa fa-plus-circle valignmiddle paddingleft" title="' . $langs->trans("AddThirdParty") . '"></span></a>'; |
382 | | - print '</td></tr>'; |
383 | | - |
384 | | - /* |
385 | | - *** For any emergency -- Pour toute urgence *** |
386 | | - */ |
387 | | - |
388 | | - print '<tr class="liste_titre"><th class="titlefield wordbreak">' . $langs->trans("AllEmergencies") . '</th><th><i class="fas fa-phone"></i></th></tr>' . "\n"; |
389 | | - print '<tr class="oddeven"><td class="titlefieldcreate nowrap">' . $langs->trans("ActionOnCompany") . '</td><td>'; |
390 | | - |
391 | | - $touteUrgenceResources = $allLinks['AllEmergencies']; |
392 | | - |
393 | | - // * Third party concerned - Tiers concerné * |
394 | | - |
395 | | - if ($touteUrgenceResources->ref == 'AllEmergencies') { |
396 | | - $societe->fetch($touteUrgenceResources->id[0]); |
397 | | - print $form->select_company($touteUrgenceResources->id[0], 'touteurgence_socid', '', 'SelectThirdParty', 1, 0, 0, 0, 'minwidth300'); |
398 | | - } else { |
399 | | - //For external user force the company to user company |
400 | | - if ( ! empty($user->socid)) { |
401 | | - print $form->select_company($user->socid, 'touteurgence_socid', '', 1, 1, 0, 0, 0, 'minwidth300'); |
402 | | - } else { |
403 | | - print $form->select_company('', 'touteurgence_socid', '', 'SelectThirdParty', 1, 0, 0, 0, 'minwidth300'); |
404 | | - } |
405 | | - } |
406 | | - if ( ! GETPOSTISSET('backtopage')) print ' <a href="' . DOL_URL_ROOT . '/societe/card.php?action=create&backtopage=' . urlencode($_SERVER["PHP_SELF"] . '?action=create') . '"><span class="fa fa-plus-circle valignmiddle paddingleft" title="' . $langs->trans("AddThirdParty") . '"></span></a>'; |
407 | | - print '</td></tr>'; |
408 | | - |
409 | | - /* |
410 | | - *** Rights defender -- Défenseur des droits *** |
411 | | - */ |
412 | | - |
413 | | - print '<tr class="liste_titre"><th class="titlefield wordbreak">' . $langs->trans("RightsDefender") . '</th><th><i class="fas fa-gavel"></i></th></tr>' . "\n"; |
414 | | - print '<tr class="oddeven"><td class="titlefieldcreate nowrap">' . $langs->trans("ActionOnCompany") . '</td><td>'; |
415 | | - |
416 | | - $defenseurResources = $allLinks['RightsDefender']; |
417 | | - |
418 | | - // * Third party concerned - Tiers concerné * |
419 | | - |
420 | | - if ($defenseurResources->ref == 'RightsDefender') { |
421 | | - $societe->fetch($defenseurResources->id[0]); |
422 | | - print $form->select_company($defenseurResources->id[0], 'defenseur_socid', '', 'SelectThirdParty', 1, 0, 0, 0, 'minwidth300'); |
423 | | - } else { |
424 | | - //For external user force the company to user company |
425 | | - if ( ! empty($user->socid)) { |
426 | | - print $form->select_company($user->socid, 'defenseur_socid', '', 1, 1, 0, 0, 0, 'minwidth300'); |
427 | | - } else { |
428 | | - print $form->select_company('', 'defenseur_socid', '', 'SelectThirdParty', 1, 0, 0, 0, 'minwidth300'); |
429 | | - } |
430 | | - } |
431 | | - if ( ! GETPOSTISSET('backtopage')) print ' <a href="' . DOL_URL_ROOT . '/societe/card.php?action=create&backtopage=' . urlencode($_SERVER["PHP_SELF"] . '?action=create') . '"><span class="fa fa-plus-circle valignmiddle paddingleft" title="' . $langs->trans("AddThirdParty") . '"></span></a>'; |
432 | | - print '</td></tr>'; |
433 | | - |
434 | | - /* |
435 | | - *** Poison control center -- Centre antipoison *** |
436 | | - */ |
437 | | - |
438 | | - print '<tr class="liste_titre"><th class="titlefield wordbreak">' . $langs->trans("PoisonControlCenter") . '</th><th><i class="fas fa-skull-crossbones"></i></th></tr>' . "\n"; |
439 | | - |
440 | | - print '<tr class="oddeven"><td class="titlefieldcreate nowrap">' . $langs->trans("ActionOnCompany") . '</td><td>'; |
441 | | - $poisonControlCenterResources = $allLinks['PoisonControlCenter']; |
442 | | - |
443 | | - // * Third party concerned - Tiers concerné * |
444 | | - |
445 | | - if ($poisonControlCenterResources->ref == 'PoisonControlCenter') { |
446 | | - $societe->fetch($poisonControlCenterResources->id[0]); |
447 | | - print $form->select_company($poisonControlCenterResources->id[0], 'antipoison_socid', '', 'SelectThirdParty', 1, 0, 0, 0, 'minwidth300'); |
448 | | - } else { |
449 | | - //For external user force the company to user company |
450 | | - if ( ! empty($user->socid)) { |
451 | | - print $form->select_company($user->socid, 'antipoison_socid', '', 1, 1, 0, 0, 0, 'minwidth300'); |
452 | | - } else { |
453 | | - print $form->select_company('', 'antipoison_socid', '', 'SelectThirdParty', 1, 0, 0, 0, 'minwidth300'); |
454 | | - } |
455 | | - } |
456 | | - if ( ! GETPOSTISSET('backtopage')) print ' <a href="' . DOL_URL_ROOT . '/societe/card.php?action=create&backtopage=' . urlencode($_SERVER["PHP_SELF"] . '?action=create') . '"><span class="fa fa-plus-circle valignmiddle paddingleft" title="' . $langs->trans("AddThirdParty") . '"></span></a>'; |
457 | | - print '</td></tr>'; |
458 | 256 | } |
459 | 257 |
|
460 | 258 | /* |
|
0 commit comments