19if (empty($conf) || !is_object($conf)) {
 
   20  print 
"Error, template page can't be called as URL";
 
   24print 
'<!-- linesalesrepresentative.tpl.php -->';
 
   28print 
'<table class="nobordernopadding" width="100%"><tr><td>';
 
   29print $langs->trans(
'SalesRepresentatives');
 
   31if ($action != 
'editsalesrepresentatives' && $user->hasRight(
'societe', 
'creer')) {
 
   32  print 
'<td class="right">';
 
   33  print 
'<a class="editfielda reposition" href="'.$_SERVER[
"PHP_SELF"].
'?action=editsalesrepresentatives&token='.newToken().
'&socid='.$object->id.
'">'.
img_edit($langs->transnoentitiesnoconv(
'Edit'), 1).
'</a>';
 
   37print 
'</td><td colspan="3">';
 
   39if ($action == 
'editsalesrepresentatives') {
 
   40  print 
'<form method="post" action="'.$_SERVER[
'PHP_SELF'].
'">';
 
   41  print 
'<input type="hidden" name="action" value="set_salesrepresentatives" />';
 
   42  print 
'<input type="hidden" name="token" value="'.newToken().
'" />';
 
   43  print 
'<input type="hidden" name="socid" value="'.$object->id.
'" />';
 
   44  $userlist = $form->select_dolusers(
'', 
'', 0, 
null, 0, 
'', 
'', 0, 0, 0, 
'', 0, 
'', 
'', 0, 1);
 
   45  $arrayselected = 
GETPOST(
'commercial', 
'array');
 
   46  if (empty($arrayselected)) {
 
   47    $arrayselected = $object->getSalesRepresentatives($user, 1);
 
   49  print $form->multiselectarray(
'commercial', $userlist, $arrayselected, 
null, 
null, 
null, 
null, 
"90%");
 
   50  print 
'<input type="submit" class="button valignmiddle small" value="'.$langs->trans(
"Modify").
'" />';
 
   53  $listsalesrepresentatives = $object->getSalesRepresentatives($user);
 
   54  $nbofsalesrepresentative = count($listsalesrepresentatives);
 
   55  if ($nbofsalesrepresentative > 0 && is_array($listsalesrepresentatives)) {
 
   56    $userstatic = 
new User($db);
 
   57    foreach ($listsalesrepresentatives as $val) {
 
   58      $userstatic->id = $val[
'id'];
 
   59      $userstatic->login = $val[
'login'];
 
   60      $userstatic->lastname = $val[
'lastname'];
 
   61      $userstatic->firstname = $val[
'firstname'];
 
   62      $userstatic->statut = $val[
'statut'];
 
   63      $userstatic->photo = $val[
'photo'];
 
   64      $userstatic->email = $val[
'email'];
 
   65      $userstatic->office_phone = $val[
'office_phone'];
 
   66      $userstatic->user_mobile = $val[
'user_mobile'];
 
   67      $userstatic->job = $val[
'job'];
 
   68      $userstatic->entity = $val[
'entity'];
 
   69      $userstatic->gender = $val[
'gender'];
 
   70      print $userstatic->getNomUrl(-1);
 
   74    print 
'<span class="opacitymedium">'.$langs->trans(
"NoSalesRepresentativeAffected").
'</span>';
 
Class to manage Dolibarr users.
 
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
 
img_edit($titlealt='default', $float=0, $other='')
Show logo editer/modifier fiche.