Skip to content

Commit

Permalink
fix as advised
Browse files Browse the repository at this point in the history
  • Loading branch information
Hystepik committed Feb 2, 2024
1 parent 7774ad7 commit aea10bd
Showing 1 changed file with 19 additions and 26 deletions.
45 changes: 19 additions & 26 deletions htdocs/core/tpl/contacts.tpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,35 +113,28 @@

<div class="tagtd"><?php echo $conf->global->MAIN_INFO_SOCIETE_NOM; ?></div>
<!-- <div class="nowrap tagtd"><?php echo img_object('', 'user').' '.$langs->trans("Users"); ?></div> -->
<div class="tagtd maxwidthonsmartphone"><?php echo img_object('', 'user', 'class="pictofixedwidth"').$form->select_dolusers($user->id, 'userid', 0, (!empty($userAlreadySelected) ? $userAlreadySelected : null), 0, null, null, 0, 56, 0, '', 0, '', 'minwidth100imp widthcentpercentminusxx maxwidth400'); ?></div>
<div class="tagtd maxwidthonsmartphone">
<?php
$tmpobject = $object;
if (($object->element == 'shipping' || $object->element == 'reception') && is_object($objectsrc)) {
$tmpobject = $objectsrc;
<?php echo img_object('', 'user', 'class="pictofixedwidth"').$form->select_dolusers($user->id, 'userid', 1, (!empty($userAlreadySelected) ? $userAlreadySelected : null), 0, null, null, 0, 56, 0, '', 0, '', 'minwidth100imp widthcentpercentminusxx maxwidth400 userselectcontact');
if (empty($hideaddcontactforgroups) && $module == 'project') {
print '<span> '.$langs->trans("or").' </span>';
echo img_object('', 'group', 'class="pictofixedwidth"').$form->select_dolgroups(0, 'groupid', 1, '', 0, '', array(), '0', false, 'minwidth100imp widthcentpercentminusxx maxwidth400 groupselectcontact');
}
$formcompany->selectTypeContact($tmpobject, '', 'type', 'internal', 'position', 0, 'minwidth125imp widthcentpercentminusx maxwidth400'); ?></div>
<div class="tagtd">&nbsp;</div>
<div class="tagtd center"><input type="submit" class="button small" value="<?php echo $langs->trans("Add"); ?>"></div>
</form>

<?php
}

if (empty($hideaddcontactforgroups) && $module == 'project') {
?>
<form class="tagtr impair nohover" action="<?php echo $_SERVER["PHP_SELF"].'?id='.$object->id; ?>" method="POST">
<input type="hidden" name="token" value="<?php echo newToken(); ?>" />
<input type="hidden" name="id" value="<?php echo $object->id; ?>" />
<input type="hidden" name="action" value="addcontact" />
<input type="hidden" name="source" value="internal" />
<input type="hidden" name="page_y" value="" />
<?php if (!empty($withproject)) {
print '<input type="hidden" name="withproject" value="'.$withproject.'">';
} ?>
<div class="tagtd"><?php echo $conf->global->MAIN_INFO_SOCIETE_NOM; ?></div>
<!-- <div class="nowrap tagtd"><?php echo img_object('', 'group').' '.$langs->trans("Groups"); ?></div> -->
<div class="tagtd maxwidthonsmartphone"><?php echo img_object('', 'group', 'class="pictofixedwidth"').$form->select_dolgroups(0, 'groupid', 0, '', 0, '', array(), '0', false, 'minwidth100imp widthcentpercentminusxx maxwidth400'); ?></div>
<script>
jQuery(document).ready(function(){
$(".userselectcontact").on("change", function(){
if ($(this).val() != -1) {
$(".groupselectcontact").val(-1).change();
}
});
$(".groupselectcontact").on("change", function(){
if ($(this).val() != -1) {
$(".userselectcontact").val(-1).change();
}
});
});
</script>
</div>
<div class="tagtd maxwidthonsmartphone">
<?php
$tmpobject = $object;
Expand Down

0 comments on commit aea10bd

Please sign in to comment.