32 print
"Error, template page can't be called as URL";
37@phan-var-force Societe $object
40print
'<!-- linesalesrepresentative.tpl.php -->';
44print
'<table class="nobordernopadding centpercent"><tr><td>';
45print $langs->trans(
'SalesRepresentatives');
47if ($action !=
'editsalesrepresentatives' && $user->hasRight(
'societe',
'creer')) {
48 print
'<td class="right">';
49 print
'<a class="editfielda reposition" href="' .
dolBuildUrl($_SERVER[
"PHP_SELF"], [
'action' =>
'editsalesrepresentatives',
'socid' =>
$object->id],
true) .
'">'.img_edit($langs->transnoentitiesnoconv(
'Edit'), 1).
'</a>';
55if ($action ==
'editsalesrepresentatives') {
56 print
'<form method="post" action="'.$_SERVER[
'PHP_SELF'].
'">';
57 print
'<input type="hidden" name="action" value="set_salesrepresentatives" />';
58 print
'<input type="hidden" name="token" value="'.newToken().
'" />';
59 print
'<input type="hidden" name="socid" value="'.$object->id.
'" />';
60 $arrayselected =
GETPOST(
'commercial',
'array');
61 if (empty($arrayselected)) {
62 $arrayselected =
$object->getSalesRepresentatives($user, 1);
64 print $form->select_dolusers($arrayselected,
'commercial', 0,
null, 0,
'',
'',
'0', 0, 0,
'', 0,
'',
'quatrevingtpercent widthcentpercentminusx', 1, 0,
true);
65 print
'<input type="submit" class="button valignmiddle smallpaddingimp" value="'.$langs->trans(
"Modify").
'" />';
68 $listsalesrepresentatives =
$object->getSalesRepresentatives($user);
70 $nbofsalesrepresentative = is_array($listsalesrepresentatives) ? count($listsalesrepresentatives) : 0;
71 if ($nbofsalesrepresentative > 0) {
72 $userstatic =
new User($db);
73 foreach ($listsalesrepresentatives as $val) {
74 $userstatic->id = $val[
'id'];
75 $userstatic->login = $val[
'login'];
76 $userstatic->lastname = $val[
'lastname'];
77 $userstatic->firstname = $val[
'firstname'];
78 $userstatic->status = $val[
'statut'];
79 $userstatic->photo = $val[
'photo'];
80 $userstatic->email = $val[
'email'];
81 $userstatic->office_phone = $val[
'office_phone'];
82 $userstatic->user_mobile = $val[
'user_mobile'];
83 $userstatic->job = $val[
'job'];
84 $userstatic->entity = $val[
'entity'];
85 $userstatic->gender = $val[
'gender'];
86 print $userstatic->getNomUrl(-1,
'', 0, 0, ($nbofsalesrepresentative > 1 ? 16 : (empty(
$conf->dol_optimize_smallscreen) ? 24 : 20)));
if(! $sortfield) if(! $sortorder) $object
Class to manage Dolibarr users.
dolBuildUrl($url, $params=[], $addtoken=false, $anchor='')
Return path of url.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0, $nodefault=0)
Return value of a param into GET or POST supervariable.