diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php
index 97d61cfdce1..7f4fe6f66c2 100644
--- a/htdocs/comm/card.php
+++ b/htdocs/comm/card.php
@@ -531,11 +531,12 @@ if ($object->id > 0)
print '
';
print '';
- if ($action == 'edittransportmode')
- {
+ if ($action == 'edittransportmode') {
$form->formSelectTransportMode($_SERVER['PHP_SELF'].'?socid='.$object->id, $object->fk_transport_mode, 'fk_transport_mode', 1);
}
else {
@@ -562,8 +563,7 @@ if ($object->id > 0)
include DOL_DOCUMENT_ROOT.'/societe/tpl/linesalesrepresentative.tpl.php';
// Module Adherent
- if (!empty($conf->adherent->enabled))
- {
+ if (!empty($conf->adherent->enabled)) {
$langs->load("members");
$langs->load("users");
@@ -571,10 +571,9 @@ if ($object->id > 0)
print ' | ';
$adh = new Adherent($db);
$result = $adh->fetch('', '', $object->id);
- if ($result > 0)
- {
+ if ($result > 0) {
$adh->ref = $adh->getFullName($langs);
- print $adh->getNomUrl(1);
+ print $adh->getNomUrl(-1);
} else {
print ''.$langs->trans("ThirdpartyNotLinkedToMember").'';
}
diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php
index 1e3f4080678..07ff1c64dbb 100644
--- a/htdocs/comm/propal/list.php
+++ b/htdocs/comm/propal/list.php
@@ -1259,15 +1259,13 @@ if ($resql)
$listsalesrepresentatives = $companystatic->getSalesRepresentatives($user);
if ($listsalesrepresentatives < 0) dol_print_error($db);
$nbofsalesrepresentative = count($listsalesrepresentatives);
- if ($nbofsalesrepresentative > 3) // We print only number
- {
+ if ($nbofsalesrepresentative > 6) {
+ // We print only number
print $nbofsalesrepresentative;
- } elseif ($nbofsalesrepresentative > 0)
- {
+ } elseif ($nbofsalesrepresentative > 0) {
$userstatic = new User($db);
$j = 0;
- foreach ($listsalesrepresentatives as $val)
- {
+ foreach ($listsalesrepresentatives as $val) {
$userstatic->id = $val['id'];
$userstatic->lastname = $val['lastname'];
$userstatic->firstname = $val['firstname'];
@@ -1275,11 +1273,16 @@ if ($resql)
$userstatic->statut = $val['statut'];
$userstatic->entity = $val['entity'];
$userstatic->photo = $val['photo'];
-
+ $userstatic->login = $val['login'];
+ $userstatic->phone = $val['phone'];
+ $userstatic->job = $val['job'];
+ $userstatic->gender = $val['gender'];
//print ' ':
- print $userstatic->getNomUrl(-2);
+ print ($nbofsalesrepresentative < 3) ? $userstatic->getNomUrl(-1, '', 0, 0, 12) : $userstatic->getNomUrl(-2);
$j++;
- if ($j < $nbofsalesrepresentative) print ' ';
+ if ($j < $nbofsalesrepresentative) {
+ print ' ';
+ }
//print ' ';
}
}
diff --git a/htdocs/contrat/list.php b/htdocs/contrat/list.php
index c05953f498b..5b208f34ff7 100644
--- a/htdocs/contrat/list.php
+++ b/htdocs/contrat/list.php
@@ -716,15 +716,13 @@ while ($i < min($num, $limit))
$listsalesrepresentatives = $socstatic->getSalesRepresentatives($user);
if ($listsalesrepresentatives < 0) dol_print_error($db);
$nbofsalesrepresentative = count($listsalesrepresentatives);
- if ($nbofsalesrepresentative > 3) {
+ if ($nbofsalesrepresentative > 6) {
// We print only number
print $nbofsalesrepresentative;
- } elseif ($nbofsalesrepresentative > 0)
- {
+ } elseif ($nbofsalesrepresentative > 0) {
$userstatic = new User($db);
$j = 0;
- foreach ($listsalesrepresentatives as $val)
- {
+ foreach ($listsalesrepresentatives as $val) {
$userstatic->id = $val['id'];
$userstatic->lastname = $val['lastname'];
$userstatic->firstname = $val['firstname'];
@@ -732,11 +730,17 @@ while ($i < min($num, $limit))
$userstatic->statut = $val['statut'];
$userstatic->entity = $val['entity'];
$userstatic->photo = $val['photo'];
+ $userstatic->login = $val['login'];
+ $userstatic->phone = $val['phone'];
+ $userstatic->job = $val['job'];
+ $userstatic->gender = $val['gender'];
//print '':
- print $userstatic->getNomUrl(-2);
+ print ($nbofsalesrepresentative < 3) ? $userstatic->getNomUrl(-1, '', 0, 0, 12) : $userstatic->getNomUrl(-2);
$j++;
- if ($j < $nbofsalesrepresentative) print ' ';
+ if ($j < $nbofsalesrepresentative) {
+ print ' ';
+ }
//print ' ';
}
}
diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php
index b246d88de93..76697359299 100644
--- a/htdocs/projet/list.php
+++ b/htdocs/projet/list.php
@@ -766,8 +766,7 @@ while ($i < min($num, $limit))
if (!empty($arrayfields['s.nom']['checked']))
{
print ' | ';
- if ($obj->socid)
- {
+ if ($obj->socid) {
print $socstatic->getNomUrl(1);
} else {
print ' ';
@@ -776,24 +775,20 @@ while ($i < min($num, $limit))
if (!$i) $totalarray['nbfield']++;
}
// Sales Representatives
- if (!empty($arrayfields['commercial']['checked']))
- {
+ if (!empty($arrayfields['commercial']['checked'])) {
print ' | ';
- if ($obj->socid)
- {
+ if ($obj->socid) {
$socstatic->id = $obj->socid;
$socstatic->name = $obj->name;
$listsalesrepresentatives = $socstatic->getSalesRepresentatives($user);
$nbofsalesrepresentative = count($listsalesrepresentatives);
- if ($nbofsalesrepresentative > 3) // We print only number
- {
+ if ($nbofsalesrepresentative > 6) {
+ // We print only number
print $nbofsalesrepresentative;
- } elseif ($nbofsalesrepresentative > 0)
- {
+ } elseif ($nbofsalesrepresentative > 0) {
$userstatic = new User($db);
$j = 0;
- foreach ($listsalesrepresentatives as $val)
- {
+ foreach ($listsalesrepresentatives as $val) {
$userstatic->id = $val['id'];
$userstatic->lastname = $val['lastname'];
$userstatic->firstname = $val['firstname'];
@@ -801,10 +796,15 @@ while ($i < min($num, $limit))
$userstatic->statut = $val['statut'];
$userstatic->entity = $val['entity'];
$userstatic->photo = $val['photo'];
- print $userstatic->getNomUrl(1, '', 0, 0, 12);
- //print $userstatic->getNomUrl(-2);
+ $userstatic->login = $val['login'];
+ $userstatic->phone = $val['phone'];
+ $userstatic->job = $val['job'];
+ $userstatic->gender = $val['gender'];
+ print ($nbofsalesrepresentative < 3) ? $userstatic->getNomUrl(-1, '', 0, 0, 12) : $userstatic->getNomUrl(-2);
$j++;
- if ($j < $nbofsalesrepresentative) print ' ';
+ if ($j < $nbofsalesrepresentative) {
+ print ' ';
+ }
}
}
//else print $langs->trans("NoSalesRepresentativeAffected");
diff --git a/htdocs/societe/canvas/actions_card_common.class.php b/htdocs/societe/canvas/actions_card_common.class.php
index 83309e0faf1..5686b3660d1 100644
--- a/htdocs/societe/canvas/actions_card_common.class.php
+++ b/htdocs/societe/canvas/actions_card_common.class.php
@@ -303,8 +303,7 @@ abstract class ActionsCardCommon
if ($nbofsalesrepresentative > 3) // We print only number
{
$this->tpl['sales_representatives'] .= $nbofsalesrepresentative;
- } elseif ($nbofsalesrepresentative > 0)
- {
+ } elseif ($nbofsalesrepresentative > 0) {
$userstatic = new User($this->db);
$i = 0;
foreach ($listsalesrepresentatives as $val)
diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php
index 0d8a92c1cf3..35670bb252e 100644
--- a/htdocs/societe/card.php
+++ b/htdocs/societe/card.php
@@ -2753,11 +2753,12 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action))
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
// Parent company
- if (empty($conf->global->SOCIETE_DISABLE_PARENTCOMPANY))
- {
+ if (empty($conf->global->SOCIETE_DISABLE_PARENTCOMPANY)) {
print ' | | ';
print '';
print ' | ';
$html_name = ($action == 'editparentcompany') ? 'parent_id' : 'none';
@@ -2769,17 +2770,15 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action))
include DOL_DOCUMENT_ROOT.'/societe/tpl/linesalesrepresentative.tpl.php';
// Module Adherent
- if (!empty($conf->adherent->enabled))
- {
+ if (!empty($conf->adherent->enabled)) {
$langs->load("members");
print ' |
| '.$langs->trans("LinkedToDolibarrMember").' | ';
print '';
$adh = new Adherent($db);
$result = $adh->fetch('', '', $object->id);
- if ($result > 0)
- {
+ if ($result > 0) {
$adh->ref = $adh->getFullName($langs);
- print $adh->getNomUrl(1);
+ print $adh->getNomUrl(-1);
} else {
print ''.$langs->trans("ThirdpartyNotLinkedToMember").'';
}
diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php
index 35e656a83b5..9c8e93b6567 100644
--- a/htdocs/societe/class/societe.class.php
+++ b/htdocs/societe/class/societe.class.php
@@ -2197,7 +2197,7 @@ class Societe extends CommonObject
$reparray = array();
- $sql = "SELECT DISTINCT u.rowid, u.login, u.lastname, u.firstname, u.office_phone, u.job, u.email, u.statut as status, u.entity, u.photo";
+ $sql = "SELECT DISTINCT u.rowid, u.login, u.lastname, u.firstname, u.office_phone, u.job, u.email, u.statut as status, u.entity, u.photo, u.gender";
$sql .= " FROM ".MAIN_DB_PREFIX."societe_commerciaux as sc, ".MAIN_DB_PREFIX."user as u";
if (!empty($conf->multicompany->enabled) && !empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) {
$sql .= ", ".MAIN_DB_PREFIX."usergroup_user as ug";
@@ -2234,6 +2234,7 @@ class Societe extends CommonObject
$reparray[$i]['entity'] = $obj->entity;
$reparray[$i]['login'] = $obj->login;
$reparray[$i]['photo'] = $obj->photo;
+ $reparray[$i]['gender'] = $obj->gender;
} else {
$reparray[] = $obj->rowid;
}
diff --git a/htdocs/societe/tpl/linesalesrepresentative.tpl.php b/htdocs/societe/tpl/linesalesrepresentative.tpl.php
index 4f09bebfe71..1eca5b22623 100644
--- a/htdocs/societe/tpl/linesalesrepresentative.tpl.php
+++ b/htdocs/societe/tpl/linesalesrepresentative.tpl.php
@@ -16,8 +16,7 @@
*/
// Protection to avoid direct call of template
-if (empty($conf) || !is_object($conf))
-{
+if (empty($conf) || !is_object($conf)) {
print "Error, template page can't be called as URL";
exit;
}
@@ -42,7 +41,9 @@ if ($action == 'editsalesrepresentatives') {
print '';
$userlist = $form->select_dolusers('', '', 0, null, 0, '', '', 0, 0, 0, '', 0, '', '', 0, 1);
$arrayselected = GETPOST('commercial', 'array');
- if (empty($arrayselected)) $arrayselected = $object->getSalesRepresentatives($user, 1);
+ if (empty($arrayselected)) {
+ $arrayselected = $object->getSalesRepresentatives($user, 1);
+ }
print $form->multiselectarray('commercial', $userlist, $arrayselected, null, null, null, null, "90%");
print '';
print '';
@@ -62,6 +63,7 @@ if ($action == 'editsalesrepresentatives') {
$userstatic->phone = $val['phone'];
$userstatic->job = $val['job'];
$userstatic->entity = $val['entity'];
+ $userstatic->gender = $val['gender'];
print $userstatic->getNomUrl(-1);
print ' ';
}
|