19 if (empty($conf) || !is_object($conf))
21 print "Error, template page can't be called as URL";
27 print '<table class="nobordernopadding" width="100%"><tr><td>';
28 print $langs->trans(
'SalesRepresentatives');
30 if ($action !=
'editsalesrepresentatives' && $user->rights->societe->creer) {
31 print '<td class="right">';
32 print '<a class="editfielda reposition" href="'.$_SERVER[
"PHP_SELF"].
'?action=editsalesrepresentatives&socid='.$object->id.
'">'.
img_edit($langs->transnoentitiesnoconv(
'Edit'), 1).
'</a>';
35 print '</tr></table>';
36 print '</td><td colspan="3">';
38 if ($action ==
'editsalesrepresentatives') {
39 print '<form method="post" action="'.$_SERVER[
'PHP_SELF'].
'">';
40 print '<input type="hidden" name="action" value="set_salesrepresentatives" />';
41 print '<input type="hidden" name="token" value="'.newToken().
'" />';
42 print '<input type="hidden" name="socid" value="'.$object->id.
'" />';
43 $userlist = $form->select_dolusers(
'',
'', 0, null, 0,
'',
'', 0, 0, 0,
'', 0,
'',
'', 0, 1);
44 $arrayselected =
GETPOST(
'commercial',
'array');
45 if (empty($arrayselected)) $arrayselected = $object->getSalesRepresentatives($user, 1);
46 print $form->multiselectarray(
'commercial', $userlist, $arrayselected, null, null, null, null,
"90%");
47 print '<input type="submit" class="button valignmiddle" value="'.$langs->trans(
"Modify").
'" />';
50 $listsalesrepresentatives = $object->getSalesRepresentatives($user);
51 $nbofsalesrepresentative = count($listsalesrepresentatives);
52 if ($nbofsalesrepresentative > 0 && is_array($listsalesrepresentatives)) {
53 $userstatic =
new User($db);
54 foreach ($listsalesrepresentatives as $val) {
55 $userstatic->id = $val[
'id'];
56 $userstatic->login = $val[
'login'];
57 $userstatic->lastname = $val[
'lastname'];
58 $userstatic->firstname = $val[
'firstname'];
59 $userstatic->statut = $val[
'statut'];
60 $userstatic->photo = $val[
'photo'];
61 $userstatic->email = $val[
'email'];
62 $userstatic->phone = $val[
'phone'];
63 $userstatic->job = $val[
'job'];
64 $userstatic->entity = $val[
'entity'];
65 print $userstatic->getNomUrl(-1);
68 }
else print '<span class="opacitymedium">'.$langs->trans(
"NoSalesRepresentativeAffected").
'</span>';
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.
Class to manage Dolibarr users.
print
Draft customers invoices.