--- /tmp/dsg/dolibarr/htdocs/societe/tpl/github_19.0.3_linesalesrepresentative.tpl.php +++ /tmp/dsg/dolibarr/htdocs/societe/tpl/client_linesalesrepresentative.tpl.php @@ -19 +19,2 @@ -if (empty($conf) || !is_object($conf)) { +if (empty($conf) || !is_object($conf)) +{ @@ -24,2 +24,0 @@ -print ''; - @@ -27,2 +26 @@ -print ''; -print ''; +print '
'; +print '
'; @@ -31,4 +29,22 @@ -if ($action != 'editsalesrepresentatives' && $user->hasRight('societe', 'creer')) { - print ''; - print 'id.'">'.img_edit($langs->transnoentitiesnoconv('Edit'), 1).''; - print ''; + +$listsalesrepresentatives = $object->getSalesRepresentatives($user); +$nbofsalesrepresentative = count($listsalesrepresentatives); +if ($nbofsalesrepresentative > 0) +{ + $userstatic = new User($db); + foreach ($listsalesrepresentatives as $val) + { + $userstatic->id = $val['id']; + $userstatic->login = $val['login']; + $userstatic->lastname = $val['lastname']; + $userstatic->firstname = $val['firstname']; + $userstatic->statut = $val['statut']; + $userstatic->photo = $val['photo']; + $userstatic->email = $val['email']; + $userstatic->phone = $val['phone']; + $userstatic->job = $val['job']; + $userstatic->entity = $val['entity']; + print $userstatic->getNomUrl(-1); + print ' '; + } @@ -36,42 +52,2 @@ -print '
'; -print ''; - -if ($action == 'editsalesrepresentatives') { - print '
'; - print ''; - print ''; - 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); - } - print $form->multiselectarray('commercial', $userlist, $arrayselected, null, null, null, null, "90%"); - print ''; - print '
'; -} else { - $listsalesrepresentatives = $object->getSalesRepresentatives($user); - $nbofsalesrepresentative = count($listsalesrepresentatives); - if ($nbofsalesrepresentative > 0 && is_array($listsalesrepresentatives)) { - $userstatic = new User($db); - foreach ($listsalesrepresentatives as $val) { - $userstatic->id = $val['id']; - $userstatic->login = $val['login']; - $userstatic->lastname = $val['lastname']; - $userstatic->firstname = $val['firstname']; - $userstatic->status = $val['statut']; - $userstatic->photo = $val['photo']; - $userstatic->email = $val['email']; - $userstatic->office_phone = $val['office_phone']; - $userstatic->user_mobile = $val['user_mobile']; - $userstatic->job = $val['job']; - $userstatic->entity = $val['entity']; - $userstatic->gender = $val['gender']; - print $userstatic->getNomUrl(-1, '', 0, 0, ($nbofsalesrepresentative > 1 ? 16 : (empty($conf->dol_optimize_smallscreen) ? 24 : 20))); - print ' '; - } - } else { - print ''.$langs->trans("NoSalesRepresentativeAffected").''; - } - print ''; -} +else print ''.$langs->trans("NoSalesRepresentativeAffected").''; +print '';