function print_form_filter($userid) { global $db, $langs; $langs->load('users'); $form = new Form($db); print '<form name="filter" methode="GET" action="' . $_SERVER['PHP_SELF'] . '">'; print $langs->trans('HierarchicalResponsible'); print $form->select_dolusers($userid, 'userid', 1, '', 0, '', '', 0, 0, 0, '', 0, '', '', 1); print '<br /><br />'; $date_deb = explode('/', $_REQUEST['date_deb']); $date_deb = implode('/', array_reverse($date_deb)); $date_fin = explode('/', $_REQUEST['date_fin']); $date_fin = implode('/', array_reverse($date_fin)); print 'Du '; $form->select_date(strtotime($date_deb), 'date_deb'); print 'Au '; $form->select_date(strtotime($date_fin), 'date_fin'); print '<input type="SUBMIT" class="butAction" value="Filtrer" />'; print '</form>'; print '<br />'; }
// Ligne ajout pour contact interne print "<tr " . $bc[$var] . ">"; print '<td class="nowrap">'; print img_object('', 'user') . ' ' . $langs->trans("Users"); print '</td>'; print '<td colspan="1">'; print $conf->global->MAIN_INFO_SOCIETE_NOM; print '</td>'; print '<td colspan="1">'; // On recupere les id des users deja selectionnes if ($object->project->public) { $contactsofproject = ''; } else { $contactsofproject = $projectstatic->getListContactId('internal'); } print $form->select_dolusers(GETPOST('contactid') ? GETPOST('contactid') : $user->id, 'contactid', 0, '', 0, '', $contactsofproject, 0, 0, 0, '', 1, $langs->trans("ResourceNotAssignedToProject")); print '</td>'; print '<td>'; $formcompany->selectTypeContact($object, '', 'type', 'internal', 'rowid'); print '</td>'; print '<td align="right" colspan="3" ><input type="submit" class="button" value="' . $langs->trans("Add") . '"></td>'; print '</tr>'; print '</form>'; // Line to add an external contact. Only if project linked to a third party. if ($projectstatic->socid) { print '<form action="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '" method="POST">'; print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">'; print '<input type="hidden" name="action" value="addcontact">'; print '<input type="hidden" name="source" value="external">'; print '<input type="hidden" name="id" value="' . $object->id . '">'; if ($withproject) {
$listofuserid = json_decode($_SESSION['assignedtouser'], true); } } print '<div class="assignedtouser">'; print $form->select_dolusers_forevent($action == 'create' ? 'add' : 'update', 'assignedtouser', 1, '', 0, '', '', 0, 0, 0, 'AND u.statut != 0'); print '</div>'; if (in_array($user->id, array_keys($listofuserid))) { print '<div class="myavailability">'; print $langs->trans("MyAvailability") . ': <input id="transparency" type="checkbox" name="transparency"' . (!isset($_GET['transparency']) && !isset($_POST['transparency']) || GETPOST('transparency') ? ' checked' : '') . '> ' . $langs->trans("Busy"); print '</div>'; } print '</td></tr>'; // Realised by if (!empty($conf->global->AGENDA_ENABLE_DONEBY)) { print '<tr><td class="nowrap">' . $langs->trans("ActionDoneBy") . '</td><td>'; print $form->select_dolusers(GETPOST("doneby") ? GETPOST("doneby") : (!empty($object->userdoneid) && $percent == 100 ? $object->userdoneid : 0), 'doneby', 1); print '</td></tr>'; } print '</table>'; print '<br><br>'; print '<table class="border" width="100%">'; // Societe, contact print '<tr><td width="30%" class="nowrap">' . $langs->trans("ActionOnCompany") . '</td><td>'; if (GETPOST('socid', 'int') > 0) { $societe = new Societe($db); $societe->fetch(GETPOST('socid', 'int')); print $societe->getNomUrl(1); print '<input type="hidden" id="socid" name="socid" value="' . GETPOST('socid', 'int') . '">'; } else { $events = array(); $events[] = array('method' => 'getContacts', 'url' => dol_buildpath('/core/ajax/contacts.php?showempty=1', 1), 'htmlname' => 'contactid', 'params' => array('add-customer-contact' => 'disabled'));
print '<table class="noborder" width="100%">'; print '<tr class="liste_titre"><td class="liste_titre" colspan="2">' . $langs->trans("Filter") . '</td></tr>'; // Company /* print '<tr><td>'.$langs->trans("ThirdParty").'</td><td>'; $filter=''; print $form->select_company($socid,'socid',$filter,1,1); print '</td></tr>'; */ // User print '<tr><td>' . $langs->trans("User") . '</td><td>'; $include = ''; if (empty($user->rights->expensereport->readall) && empty($user->rights->expensereport->lire_tous)) { $include = 'hierarchy'; } print $form->select_dolusers($userid, 'userid', 1, '', 0, $include, '', 0, 0, 0, '', 0, '', 'maxwidth300'); print '</td></tr>'; // Year print '<tr><td>' . $langs->trans("Year") . '</td><td>'; if (!in_array($year, $arrayyears)) { $arrayyears[$year] = $year; } arsort($arrayyears); print $form->selectarray('year', $arrayyears, $year, 0); print '</td></tr>'; print '<tr><td align="center" colspan="2"><input type="submit" name="submit" class="button" value="' . $langs->trans("Refresh") . '"></td></tr>'; print '</table>'; print '</form>'; print '<br><br>'; print '<table class="noborder" width="100%">'; print '<tr class="liste_titre" height="24">';
$companystatic = new Societe($db); $invoicestatic = new Facture($db); $form = new Form($db); llxHeader('', $langs->trans("Margins") . ' - ' . $langs->trans("Agents")); $text = $langs->trans("Margins"); print_fiche_titre($text); // Show tabs $head = marges_prepare_head($user); $titre = $langs->trans("Margins"); $picto = 'margin'; dol_fiche_head($head, 'agentMargins', $titre, 0, $picto); print '<form method="post" name="sel" action="' . $_SERVER['PHP_SELF'] . '">'; print '<table class="border" width="100%">'; print '<tr><td width="20%">' . $langs->trans('SalesRepresentative') . '</td>'; print '<td colspan="4">'; print $form->select_dolusers($agentid, 'agentid', 1); print '</td></tr>'; // Start date print '<td>' . $langs->trans('StartDate') . ' (' . $langs->trans("DateValidation") . ')</td>'; print '<td width="20%">'; $form->select_date($startdate, 'startdate', '', '', 1, "sel", 1, 1); print '</td>'; print '<td width="20%">' . $langs->trans('EndDate') . ' (' . $langs->trans("DateValidation") . ')</td>'; print '<td width="20%">'; $form->select_date($enddate, 'enddate', '', '', 1, "sel", 1, 1); print '</td>'; print '<td style="text-align: center;">'; print '<input type="submit" class="button" value="' . dol_escape_htmltag($langs->trans('Launch')) . '" />'; print '</td></tr>'; print "</table>"; print '</form>';
print '<td width="80"> </td>'; print "</tr>\n"; print '<tr ' . $bc[false] . '>'; // Date print '<td class="nowrap">'; $newdate = dol_mktime(12, 0, 0, $_POST["timemonth"], $_POST["timeday"], $_POST["timeyear"]); print $form->select_date($newdate, 'time', '', '', '', "timespent_date"); print '</td>'; // Contributor print '<td class="nowrap">'; $restrictaddtimetocontactoftask = 0; if (empty($conf->global->PROJECT_TIME_ON_ALL_TASKS_MY_PROJECTS)) { $restrictaddtimetocontactoftask = $object->getListContactId('internal'); } print img_object('', 'user'); print $form->select_dolusers($_POST["userid"] ? $_POST["userid"] : $user->id, 'userid', 0, '', 0, '', $restrictaddtimetocontactoftask); // Note: If user is not allowed it will be disabled into combo list and userid not posted print '</td>'; // Note print '<td class="nowrap">'; print '<textarea name="timespent_note" cols="80" rows="' . ROWS_3 . '">' . ($_POST['timespent_note'] ? $_POST['timespent_note'] : '') . '</textarea>'; print '</td>'; // Duration print '<td class="nowrap" align="right">'; print $form->select_duration('timespent_duration', $_POST['timespent_duration'] ? $_POST['timespent_duration'] : '', 0, 'text'); print '</td>'; print '<td align="center">'; print '<input type="submit" class="button" value="' . $langs->trans("Add") . '">'; print '</td></tr>'; print '</table></form>'; }
print '<input type="hidden" name="mode" value="' . $mode . '">'; print '<table class="border" width="100%">'; print '<tr class="liste_titre"><td class="liste_titre" colspan="2">' . $langs->trans("Filter") . '</td></tr>'; // Company print '<tr><td align="left">' . $langs->trans("ThirdParty") . '</td><td align="left">'; if ($mode == 'customer') { $filter = 's.client in (1,2,3)'; } if ($mode == 'supplier') { $filter = 's.fournisseur = 1'; } print $form->select_company($socid, 'socid', $filter, 1); print '</td></tr>'; // User print '<tr><td align="left">' . $langs->trans("CreatedBy") . '</td><td align="left">'; print $form->select_dolusers($userid, 'userid', 1); print '</td></tr>'; // Year print '<tr><td align="left">' . $langs->trans("Year") . '</td><td align="left">'; if (!in_array($year, $arrayyears)) { $arrayyears[$year] = $year; } if (!in_array($nowyear, $arrayyears)) { $arrayyears[$nowyear] = $nowyear; } arsort($arrayyears); print $form->selectarray('year', $arrayyears, $year, 0); print '</td></tr>'; print '<tr><td align="center" colspan="2"><input type="submit" name="submit" class="button" value="' . $langs->trans("Refresh") . '"></td></tr>'; print '</table>'; print '</form>';
print '<input type="hidden" name="type" value="' . $type . '">'; if ($search_all) { foreach ($fieldstosearchall as $key => $val) { $fieldstosearchall[$key] = $langs->trans($val); } print $langs->trans("FilterOnInto", $search_all, join(', ', $fieldstosearchall)); } // If the user can view users //if ($mine) $search_project_user=$user->id; // We want by default all project. "mine" is a filter for task contact on this page $moreforfilter .= '<div class="divsearchfield">'; $moreforfilter .= $langs->trans('ProjectsWithThisUserAsContact') . ' '; $includeonly = ''; if (empty($user->rights->user->user->lire)) { $includeonly = array($user->id); } $moreforfilter .= $form->select_dolusers($search_project_user, 'search_project_user', 1, '', 0, $includeonly, '', 0, 0, 0, '', 0, '', 'maxwidth300'); $moreforfilter .= '</div>'; // If the user can view users $moreforfilter .= '<div class="divsearchfield">'; $moreforfilter .= $langs->trans('TasksWithThisUserAsContact') . ': '; $includeonly = ''; if (empty($user->rights->user->user->lire)) { $includeonly = array($user->id); } $moreforfilter .= $form->select_dolusers($search_task_user, 'search_task_user', 1, '', 0, $includeonly, '', 0, 0, 0, '', 0, '', 'maxwidth300'); $moreforfilter .= '</div>'; if (!empty($moreforfilter)) { print '<div class="liste_titre liste_titre_bydiv centpercent">'; print $moreforfilter; $parameters = array(); $reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters);
$nb_holiday += $nb_type; $out .= ' - ' . $val['label'] . ': <strong>' . ($nb_type ? price2num($nb_type) : 0) . '</strong><br>'; } print $langs->trans('SoldeCPUser', round($nb_holiday, 5)) . '<br>'; print $out; dol_fiche_end(); dol_fiche_head(); //print '<span>'.$langs->trans('DelayToRequestCP',$cp->getConfCP('delayForRequest')).'</span><br /><br />'; print '<table class="border" width="100%">'; print '<tbody>'; // User print '<tr>'; print '<td class="fieldrequired">' . $langs->trans("User") . '</td>'; print '<td>'; if (empty($user->rights->holiday->write_all)) { print $form->select_dolusers($userid, 'useridbis', 0, '', 1, '', '', 0, 0, 0, '', 0, '', 'maxwidth300'); print '<input type="hidden" name="userid" value="' . $userid . '">'; } else { print $form->select_dolusers(GETPOST('userid') ? GETPOST('userid') : $user->id, 'userid', 0, '', 0); } print '</td>'; print '</tr>'; // Type print '<tr>'; print '<td class="fieldrequired">' . $langs->trans("Type") . '</td>'; print '<td>'; $typeleaves = $cp->getTypes(1, 1); $arraytypeleaves = array(); foreach ($typeleaves as $key => $val) { $labeltoshow = $val['label']; $labeltoshow .= $val['delay'] > 0 ? ' (' . $langs->trans("NoticePeriod") . ': ' . $val['delay'] . ' ' . $langs->trans("days") . ')' : '';
$exclude = array(); if (!empty($object->members)) { if (!(!empty($conf->multicompany->enabled) && !empty($conf->multicompany->transverse_mode))) { foreach ($object->members as $useringroup) { $exclude[] = $useringroup->id; } } } if ($caneditperms) { print '<form action="' . $_SERVER['PHP_SELF'] . '?id=' . $object->id . '" method="POST">' . "\n"; print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">'; print '<input type="hidden" name="action" value="adduser">'; print '<table class="noborder" width="100%">' . "\n"; print '<tr class="liste_titre"><td class="liste_titre" width="25%">' . $langs->trans("NonAffectedUsers") . '</td>' . "\n"; print '<td>'; print $form->select_dolusers('', 'user', 1, $exclude, 0, '', '', $object->entity); print ' '; // Multicompany if (!empty($conf->multicompany->enabled)) { if ($conf->entity == 1 && $conf->multicompany->transverse_mode) { print '</td><td valign="top">' . $langs->trans("Entity") . '</td>'; print "<td>" . $mc->select_entities($conf->entity); } else { print '<input type="hidden" name="entity" value="' . $conf->entity . '" />'; } } else { print '<input type="hidden" name="entity" value="' . $conf->entity . '">'; } print '<input type="submit" class="button" value="' . $langs->trans("Add") . '">'; print '</td></tr>' . "\n"; print '</table></form>' . "\n";
print '<form name="stats" method="POST" action="' . $_SERVER["PHP_SELF"] . '">'; print '<table class="border" width="100%">'; print '<tr class="liste_titre"><td class="liste_titre" colspan="2">' . $langs->trans("Filter") . '</td></tr>'; // Company print '<tr><td>' . $langs->trans("ThirdParty") . '</td><td>'; if ($mode == 'customer') { $filter = 's.client in (1,2,3)'; } if ($mode == 'supplier') { $filter = 's.fournisseur = 1'; } print $form->select_company($socid, 'socid', $filter, 1); print '</td></tr>'; // User print '<tr><td>' . $langs->trans("LeadCommercial") . '</td><td>'; print $form->select_dolusers($userid, 'userid', 1, array(), 0, $includeuserlist); print '</td></tr>'; // Year print '<tr><td>' . $langs->trans("Year") . '</td><td>'; if (!in_array($year, $arrayyears)) { $arrayyears[$year] = $year; } if (!in_array($nowyear, $arrayyears)) { $arrayyears[$nowyear] = $nowyear; } arsort($arrayyears); print $form->selectarray('year', $arrayyears, $year, 0); print '</td></tr>'; print '<tr><td align="center" colspan="2"><input type="submit" name="submit" class="button" value="' . $langs->trans("Refresh") . '"></td></tr>'; print '</table>'; print '</form>';
$holiday->updateSoldeCP($userCP, $new_holiday); setEventMessage($langs->trans('AddEventToUserOkCP')); } } $langs->load('users'); $var = true; $i = 0; $cp_events = $holiday->fetchEventsCP(); if ($cp_events == 1) { print '<br><form method="POST" action="' . $_SERVER["PHP_SELF"] . '">' . "\n"; print '<input type="hidden" name="action" value="add_event" />'; print_fiche_titre($langs->trans('DefineEventUserCP'), '', ''); print $langs->trans('MotifCP') . ' : '; print $holiday->selectEventCP(); print ' ' . $langs->trans('UserCP') . ' : '; print $form->select_dolusers('', "userCP", 1, "", 0, ''); print ' <input type="submit" value="' . $langs->trans("addEventToUserCP") . '" name="bouton" class="button"/>'; print '</form><br>'; } print '<form method="POST" action="' . $_SERVER["PHP_SELF"] . '">' . "\n"; print '<input type="hidden" name="action" value="update" />'; print '<table class="noborder" width="100%;">'; print "<tr class=\"liste_titre\">"; print '<td width="55%">' . $langs->trans('Employee') . '</td>'; print '<td width="20%" style="text-align:center">' . $langs->trans('Available') . '</td>'; print '<td width="20%" style="text-align:center">' . $langs->trans('Note') . '</td>'; print '<td></td>'; print '</tr>'; foreach ($listUsers as $users) { $var = !$var; print '<tr ' . $bc[$var] . ' style="height: 20px;">';
// Create users into table holiday if they don't exists. TODO Remove this whif we use field into table user. if ($result < 0) { setEventMessages($holiday->error, $holiday->errors, 'errors'); } $listUsers = $holiday->fetchUsers(false, true); $var = true; $i = 0; $cp_events = $holiday->fetchEventsCP(); if ($cp_events == 1) { print '<br><form method="POST" action="' . $_SERVER["PHP_SELF"] . '">' . "\n"; print '<input type="hidden" name="action" value="add_event" />'; print load_fiche_titre($langs->trans('DefineEventUserCP'), '', ''); print $langs->trans('MotifCP') . ' : '; print $holiday->selectEventCP(); print ' ' . $langs->trans('UserCP') . ' : '; print $form->select_dolusers('', 'userCP', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300'); print ' <input type="submit" value="' . $langs->trans("addEventToUserCP") . '" name="bouton" class="button"/>'; print '</form><br>'; } $typeleaves = $holiday->getTypes(1, 1); print '<form method="POST" action="' . $_SERVER["PHP_SELF"] . '">' . "\n"; print '<input type="hidden" name="action" value="update" />'; print '<table class="noborder" width="100%;">'; print "<tr class=\"liste_titre\">"; print '<td width="55%">' . $langs->trans('Employee') . '</td>'; foreach ($typeleaves as $key => $val) { print '<td width="20%" style="text-align:center">' . $val['label'] . '</td>'; } print '<td width="20%" style="text-align:center">' . $langs->trans('Note') . '</td>'; print '<td></td>'; print '</tr>';
llxHeader('', $langs->trans("WithdrawalsSetup")); $linkback = '<a href="' . DOL_URL_ROOT . '/admin/modules.php">' . $langs->trans("BackToModuleList") . '</a>'; print_fiche_titre($langs->trans("WithdrawalsSetup"), $linkback, 'title_setup'); print '<br>'; print '<form method="post" action="prelevement.php?action=set">'; print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">'; print '<table class="noborder" width="100%">'; print '<tr class="liste_titre">'; print '<td width="30%">' . $langs->trans("Parameter") . '</td>'; print '<td width="40%">' . $langs->trans("Value") . '</td>'; print "</tr>"; //User print '<tr class="impair"><td>' . $langs->trans("ResponsibleUser") . '</td>'; print '<td align="left">'; print '<input type="hidden" name="nom0" value="PRELEVEMENT_USER">'; print $form->select_dolusers($conf->global->PRELEVEMENT_USER, 'value0', 1); print '</td>'; print '</tr>'; //Profid1 of Transmitter print '<tr class="pair"><td>' . $langs->trans("NumeroNationalEmetter") . ' - ' . $langs->transcountry('ProfId1', $mysoc->country_code) . '</td>'; print '<td align="left">'; print '<input type="hidden" name="nom1" value="PRELEVEMENT_NUMERO_NATIONAL_EMETTEUR">'; print '<input type="text" name="value1" value="' . $conf->global->PRELEVEMENT_NUMERO_NATIONAL_EMETTEUR . '" size="9" ></td>'; print '</tr>'; // Bank account (from Banks module) print '<tr class="impair"><td>' . $langs->trans("BankToReceiveWithdraw") . '</td>'; print '<td align="left">'; $form->select_comptes($conf->global->PRELEVEMENT_ID_BANKACCOUNT, 'PRELEVEMENT_ID_BANKACCOUNT', 0, "courant=1", 1); print '</td></tr>'; // ICS print '<tr class="pair"><td>' . $langs->trans("ICS") . '</td>';
$formlead = new FormLead($db); $now = dol_now(); // Add new proposal if ($action == 'create' && $user->rights->lead->write) { print_fiche_titre($langs->trans("LeadCreate"), '', dol_buildpath('/lead/img/object_lead.png', 1), 1); print '<form name="addlead" action="' . $_SERVER["PHP_SELF"] . '" method="POST">'; print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">'; print '<input type="hidden" name="propalid" value="' . GETPOST('propalid', 'int') . '">'; print '<input type="hidden" name="action" value="add">'; print '<table class="border" width="100%">'; print '<tr>'; print '<td class="fieldrequired" width="20%">'; print $langs->trans('LeadCommercial'); print '</td>'; print '<td>'; print $form->select_dolusers(empty($userid) ? $user->id : $userid, 'userid', 0, array(), 0, $includeuserlist); print '</td>'; print '</tr>'; print '<tr>'; print '<td class="fieldrequired" width="20%">'; print $langs->trans('LeadRefInt'); print '</td>'; print '<td>'; print '<input type="text" name="ref_int" size="10" value="' . $ref_int . '"/>'; print '</td>'; print '</tr>'; print '<tr>'; print '<td class="fieldrequired" width="20%">'; print $langs->trans('LeadStatus'); print '</td>'; print '<td>';
llxHeader('', $langs->trans("WithdrawalsSetup")); $linkback = '<a href="' . DOL_URL_ROOT . '/admin/modules.php">' . $langs->trans("BackToModuleList") . '</a>'; print load_fiche_titre($langs->trans("WithdrawalsSetup"), $linkback, 'title_setup'); print '<br>'; print '<form method="post" action="prelevement.php?action=set">'; print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">'; print '<table class="noborder" width="100%">'; print '<tr class="liste_titre">'; print '<td width="30%">' . $langs->trans("Parameter") . '</td>'; print '<td width="40%">' . $langs->trans("Value") . '</td>'; print "</tr>"; //User print '<tr class="impair"><td>' . $langs->trans("ResponsibleUser") . '</td>'; print '<td align="left">'; print '<input type="hidden" name="nom0" value="PRELEVEMENT_USER">'; print $form->select_dolusers($conf->global->PRELEVEMENT_USER, 'value0', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300'); print '</td>'; print '</tr>'; //Profid1 of Transmitter print '<tr class="pair"><td>' . $langs->trans("NumeroNationalEmetter") . ' - ' . $langs->transcountry('ProfId1', $mysoc->country_code) . '</td>'; print '<td align="left">'; print '<input type="hidden" name="nom1" value="PRELEVEMENT_NUMERO_NATIONAL_EMETTEUR">'; print '<input type="text" name="value1" value="' . $conf->global->PRELEVEMENT_NUMERO_NATIONAL_EMETTEUR . '" size="9" ></td>'; print '</tr>'; // Bank account (from Banks module) print '<tr class="impair"><td>' . $langs->trans("BankToReceiveWithdraw") . '</td>'; print '<td align="left">'; $form->select_comptes($conf->global->PRELEVEMENT_ID_BANKACCOUNT, 'PRELEVEMENT_ID_BANKACCOUNT', 0, "courant=1", 1); print '</td></tr>'; // ICS print '<tr class="pair"><td>' . $langs->trans("ICS") . '</td>';
print_liste_field_titre('', $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'maxwidthsearch '); print "</tr>\n"; // FILTRES print '<tr class="liste_titre">'; print '<td class="liste_titre" align="left" width="50">'; print '<input class="flat" size="4" type="text" name="search_ref" value="' . dol_escape_htmltag($search_ref) . '">'; print '</td>'; // DATE CREATE print '<td class="liste_titre" colspan="1" align="center">'; print '<input class="flat" type="text" size="1" maxlength="2" name="month_create" value="' . $month_create . '">'; $formother->select_year($year_create, 'year_create', 1, $min_year, 0); print '</td>'; // UTILISATEUR if ($user->rights->holiday->write_all) { print '<td class="liste_titre" align="left">'; print $form->select_dolusers($search_employe, "search_employe", 1, "", 0, '', '', 0, 32); print '</td>'; } else { //print '<td class="liste_titre"> </td>'; print '<td class="liste_titre" align="left">'; print $form->select_dolusers($user->id, "search_employe", 1, "", 1, '', '', 0, 32); print '</td>'; } // VALIDEUR if ($user->rights->holiday->write_all) { print '<td class="liste_titre" align="left">'; $validator = new UserGroup($db); $excludefilter = $user->admin ? '' : 'u.rowid <> ' . $user->id; $valideurobjects = $validator->listUsersForGroup($excludefilter); $valideurarray = array(); foreach ($valideurobjects as $val) {
print '<td>' . $langs->trans("ProgressDeclared") . '</td>'; print '<td align="right" colspan="2">' . $langs->trans("NewTimeSpent") . '</td>'; print "</tr>\n"; print '<tr ' . $bc[false] . '>'; // Date print '<td class="nowrap">'; $newdate = dol_mktime(12, 0, 0, $_POST["timemonth"], $_POST["timeday"], $_POST["timeyear"]); print $form->select_date($newdate, 'time', '', '', '', "timespent_date"); print '</td>'; // Contributor print '<td class="nowrap">'; print img_object('', 'user', 'class="hideonsmartphone"'); $contactsoftask = $object->getListContactId('internal'); if (count($contactsoftask) > 0) { $userid = $contactsoftask[0]; print $form->select_dolusers(GETPOST('userid') ? GETPOST('userid') : $userid, 'userid', 0, '', 0, '', $contactsoftask); } else { print img_error($langs->trans('FirstAddRessourceToAllocateTime')) . $langs->trans('FirstAddRessourceToAllocateTime'); } print '</td>'; // Note print '<td class="nowrap">'; print '<textarea name="timespent_note" cols="80" rows="' . ROWS_2 . '">' . ($_POST['timespent_note'] ? $_POST['timespent_note'] : '') . '</textarea>'; print '</td>'; // Progress declared print '<td class="nowrap">'; print $formother->select_percent(GETPOST('progress') ? GETPOST('progress') : $object->progress, 'progress'); print '</td>'; // Duration - Time spent print '<td class="nowrap" align="right">'; print $form->select_duration('timespent_duration', $_POST['timespent_duration'] ? $_POST['timespent_duration'] : '', 0, 'text');
print '</td>'; print '</tr>'; print '<tr>'; print '<td>' . $langs->trans("VALIDATOR") . '</td>'; print '<td>'; $object = new ExpenseReport($db); $include_users = $object->fetch_users_approver_expensereport(); $defaultselectuser = $user->fk_user; // Will work only if supervisor has permission to approve so is inside include_users if (!empty($conf->global->EXPENSEREPORT_DEFAULT_VALIDATOR)) { $defaultselectuser = $conf->global->EXPENSEREPORT_DEFAULT_VALIDATOR; } if (GETPOST('fk_user_validator') > 0) { $defaultselectuser = GETPOST('fk_user_validator'); } $s = $form->select_dolusers($defaultselectuser, "fk_user_validator", 1, "", 0, $include_users); print $form->textwithpicto($s, $langs->trans("AnyOtherInThisListCanValidate")); print '</td>'; print '</tr>'; if (!empty($conf->global->EXPENSEREPORT_ASK_PAYMENTMODE_ON_CREATION)) { print '<tr>'; print '<td>' . $langs->trans("ModePaiement") . '</td>'; print '<td>'; $form->select_types_paiements(2, 'fk_c_paiement'); print '</td>'; print '</tr>'; } // Public note print '<tr>'; print '<td class="border" valign="top">' . $langs->trans('NotePublic') . '</td>'; print '<td valign="top" colspan="2">';
$exclude = array(); if (!empty($object->members)) { if (!(!empty($conf->multicompany->enabled) && !empty($conf->multicompany->transverse_mode))) { foreach ($object->members as $useringroup) { $exclude[] = $useringroup->id; } } } if ($caneditperms) { print '<form action="' . $_SERVER['PHP_SELF'] . '?id=' . $object->id . '" method="POST">' . "\n"; print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">'; print '<input type="hidden" name="action" value="adduser">'; print '<table class="noborder" width="100%">' . "\n"; print '<tr class="liste_titre"><td class="liste_titre" width="25%">' . $langs->trans("NonAffectedUsers") . '</td>' . "\n"; print '<td>'; print $form->select_dolusers('', 'user', 1, $exclude, 0, '', '', $object->entity, 0, 0, '', 0, '', 'maxwidth300'); print ' '; // Multicompany if (!empty($conf->multicompany->enabled) && is_object($mc)) { if ($conf->entity == 1 && $conf->multicompany->transverse_mode) { print '</td><td valign="top">' . $langs->trans("Entity") . '</td>'; print "<td>" . $mc->select_entities($conf->entity); } else { print '<input type="hidden" name="entity" value="' . $conf->entity . '" />'; } } else { print '<input type="hidden" name="entity" value="' . $conf->entity . '">'; } print '<input type="submit" class="button" value="' . $langs->trans("Add") . '">'; print '</td></tr>' . "\n"; print '</table></form>' . "\n";
// Lignes des champs de filtre print '<form method="GET" action="' . $_SERVER["PHP_SELF"] . '">'; $i = 0; print '<table class="liste" width="100%">'; $moreforfilter = ''; // If the user can view prospects other than his' if ($user->rights->societe->client->voir || $socid) { $langs->load("commercial"); $moreforfilter .= $langs->trans('ThirdPartiesOfSaleRepresentative') . ': '; $moreforfilter .= $formother->select_salesrepresentatives($search_sale, 'search_sale', $user); $moreforfilter .= ' '; } // If the user can view prospects other than his' if ($user->rights->societe->client->voir || $socid) { $moreforfilter .= $langs->trans('LinkedToSpecificUsers') . ': '; $moreforfilter .= $form->select_dolusers($search_user, 'search_user', 1); } if (!empty($moreforfilter)) { print '<tr class="liste_titre">'; print '<td class="liste_titre" colspan="10">'; print $moreforfilter; print '</td></tr>'; } print '<tr class="liste_titre">'; print_liste_field_titre($langs->trans('Ref'), $_SERVER["PHP_SELF"], 'p.ref', '', $param, '', $sortfield, $sortorder); print_liste_field_titre($langs->trans('Company'), $_SERVER["PHP_SELF"], 's.nom', '', $param, '', $sortfield, $sortorder); print_liste_field_titre($langs->trans('AskPriceSupplierDate'), $_SERVER["PHP_SELF"], 'p.date_livraison', '', $param, 'align="center"', $sortfield, $sortorder); print_liste_field_titre($langs->trans('AmountHT'), $_SERVER["PHP_SELF"], 'p.total_ht', '', $param, 'align="right"', $sortfield, $sortorder); print_liste_field_titre($langs->trans('Author'), $_SERVER["PHP_SELF"], 'u.login', '', $param, 'align="center"', $sortfield, $sortorder); print_liste_field_titre($langs->trans('Status'), $_SERVER["PHP_SELF"], 'p.fk_statut', '', $param, 'align="right"', $sortfield, $sortorder); print_liste_field_titre('', $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'maxwidthsearch ');
if (empty($conf->multicompany->transverse_mode) && $conf->entity == 1 && $user->admin && ! $user->entity && is_object($mc)) { print "<tr>".'<td>'.$langs->trans("Entity").'</td>'; print "<td>".$mc->select_entities($conf->entity); print "</td></tr>\n"; } else { print '<input type="hidden" name="entity" value="'.$conf->entity.'" />'; } } // Hierarchy print '<tr><td>'.$langs->trans("HierarchicalResponsible").'</td>'; print '<td>'; print $form->select_dolusers($object->fk_user, 'fk_user', 1, array($object->id), 0, '', 0, $conf->entity, 0, 0, '', 0, '', 'maxwidth300'); print '</td>'; print "</tr>\n"; if ($conf->salaries->enabled && ! empty($user->rights->salaries->read)) { $langs->load("salaries"); // THM print '<tr><td>'; $text=$langs->trans("THM"); print $form->textwithpicto($text, $langs->trans("THMDescription"), 1, 'help', 'classthm'); print '</td>'; print '<td>'; print '<input size="8" type="text" name="thm" value="'.GETPOST('thm').'">'; print '</td>';
} else { print $langs->trans("CompanyHasNoRelativeDiscount"); } print '. '; $absolute_discount = $soc->getAvailableDiscounts(); if ($absolute_discount) { print $langs->trans("CompanyHasAbsoluteDiscount", price($absolute_discount), $langs->trans("Currency" . $conf->currency)); } else { print $langs->trans("CompanyHasNoAbsoluteDiscount"); } print '.'; print '</td></tr>'; } // Commercial suivi print '<tr><td width="20%" class="nowrap"><span class="fieldrequired">' . $langs->trans("TypeContact_contrat_internal_SALESREPFOLL") . '</span></td><td>'; print $form->select_dolusers(GETPOST("commercial_suivi_id") ? GETPOST("commercial_suivi_id") : $user->id, 'commercial_suivi_id', 1, ''); print '</td></tr>'; // Commercial signature print '<tr><td width="20%" class="nowrap"><span class="fieldrequired">' . $langs->trans("TypeContact_contrat_internal_SALESREPSIGN") . '</span></td><td>'; print $form->select_dolusers(GETPOST("commercial_signature_id") ? GETPOST("commercial_signature_id") : $user->id, 'commercial_signature_id', 1, ''); print '</td></tr>'; print '<tr><td><span class="fieldrequired">' . $langs->trans("Date") . '</span></td><td>'; $form->select_date($datecontrat, '', 0, 0, '', "contrat"); print "</td></tr>"; if (!empty($conf->projet->enabled)) { $formproject = new FormProjets($db); print '<tr><td>' . $langs->trans("Project") . '</td><td>'; $formproject->select_projects($soc->id, $projectid, "projectid"); print "</td></tr>"; } print '<tr><td>' . $langs->trans("NotePublic") . '</td><td valign="top">';
* Fact bookmark creation mode */ print '<form action="' . $_SERVER["PHP_SELF"] . '" method="POST" enctype="multipart/form-data">' . "\n"; print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">'; print '<input type="hidden" name="action" value="add">'; print load_fiche_titre($langs->trans("NewBookmark")); dol_fiche_head($head, $hselected, $langs->trans("Bookmark"), 0, 'bookmark'); print '<table class="border" width="100%">'; print '<tr><td width="25%" class="fieldrequired">' . $langs->trans("BookmarkTitle") . '</td><td><input class="flat" name="title" size="30" value="' . $title . '"></td><td class="hideonsmartphone">' . $langs->trans("SetHereATitleForLink") . '</td></tr>'; print '<tr><td class="fieldrequired">' . $langs->trans("UrlOrLink") . '</td><td><input class="flat" name="url" size="50" value="' . $url . '"></td><td class="hideonsmartphone">' . $langs->trans("UseAnExternalHttpLinkOrRelativeDolibarrLink") . '</td></tr>'; print '<tr><td>' . $langs->trans("BehaviourOnClick") . '</td><td>'; $liste = array(0 => $langs->trans("ReplaceWindow"), 1 => $langs->trans("OpenANewWindow")); print $form->selectarray('target', $liste, 1); print '</td><td class="hideonsmartphone">' . $langs->trans("ChooseIfANewWindowMustBeOpenedOnClickOnBookmark") . '</td></tr>'; print '<tr><td>' . $langs->trans("Owner") . '</td><td>'; print $form->select_dolusers(isset($_POST['userid']) ? $_POST['userid'] : $user->id, 'userid', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300'); print '</td><td class="hideonsmartphone"> </td></tr>'; // Position print '<tr><td>' . $langs->trans("Position") . '</td><td>'; print '<input class="flat" name="position" size="5" value="' . (isset($_POST["position"]) ? $_POST["position"] : $bookmark->position) . '">'; print '</td><td class="hideonsmartphone"> </td></tr>'; print '</table>'; dol_fiche_end(); print '<div align="center">'; print '<input type="submit" class="button" value="' . $langs->trans("CreateBookmark") . '" name="create"> '; print '<input type="submit" class="button" value="' . $langs->trans("Cancel") . '" name="cancel">'; print '</div>'; print '</form>'; } if ($id > 0 && !preg_match('/^add/i', $action)) { /*
print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">'; print '<input type="hidden" name="action" value="add">'; print_fiche_titre($langs->trans("NewSalaryPayment"), '', 'title_accountancy.png'); dol_fiche_head('', ''); print '<table class="border" width="100%">'; print "<tr>"; print '<td class="fieldrequired">' . $langs->trans("DatePayment") . '</td><td>'; print $form->select_date(empty($datep) ? -1 : $datep, "datep", '', '', '', 'add', 1, 1); print '</td></tr>'; print '<tr><td>' . $langs->trans("DateValue") . '</td><td>'; print $form->select_date(empty($datev) ? -1 : $datev, "datev", '', '', '', 'add', 1, 1); print '</td></tr>'; // Employee print "<tr>"; print '<td class="fieldrequired">' . $langs->trans("Employee") . '</td><td>'; print $form->select_dolusers(GETPOST('fk_user', 'int'), 'fk_user', 1); print '</td></tr>'; // Label print '<tr><td class="fieldrequired">' . $langs->trans("Label") . '</td><td><input name="label" size="40" value="' . ($_POST["label"] ? $_POST["label"] : $langs->trans("SalaryPayment")) . '"></td></tr>'; print "<tr>"; print '<td class="fieldrequired">' . $langs->trans("DateStartPeriod") . '</td><td>'; print $form->select_date($datesp, "datesp", '', '', '', 'add'); print '</td></tr>'; print '<tr><td class="fieldrequired">' . $langs->trans("DateEndPeriod") . '</td><td>'; print $form->select_date($dateep, "dateep", '', '', '', 'add'); print '</td></tr>'; // Amount print '<tr><td class="fieldrequired">' . $langs->trans("Amount") . '</td><td><input name="amount" size="10" value="' . GETPOST("amount") . '"></td></tr>'; // Bank if (!empty($conf->banque->enabled)) { print '<tr><td class="fieldrequired">' . $langs->trans("Account") . '</td><td>';
print $form->selectarray('endhalfday', $listhalfday, GETPOST('endhalfday') ? GETPOST('endhalfday') : 'afternoon'); print '</td>'; print '</tr>'; // Approved by print '<tr>'; print '<td class="fieldrequired">' . $langs->trans("ReviewedByCP") . '</td>'; // Liste des utiliseurs du groupe choisi dans la config $validator = new UserGroup($db); $excludefilter = $user->admin ? '' : 'u.rowid <> ' . $user->id; $valideurobjects = $validator->listUsersForGroup($excludefilter); $valideurarray = array(); foreach ($valideurobjects as $val) { $valideurarray[$val->id] = $val->id; } print '<td>'; print $form->select_dolusers($user->fk_user, "valideur", 1, "", 0, $valideurarray); // By default, hierarchical parent print '</td>'; print '</tr>'; // Description print '<tr>'; print '<td>' . $langs->trans("DescCP") . '</td>'; print '<td>'; print '<textarea name="description" class="flat" rows="' . ROWS_3 . '" cols="70"></textarea>'; print '</td>'; print '</tr>'; print '</tbody>'; print '</table>'; print '<div style="clear: both;"></div>'; print '</div>'; print '</from>' . "\n";
if ($action == 'create') { //WYSIWYG Editor require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php'; print load_fiche_titre($langs->trans("NewTrip")); $datec = dol_mktime(12, 0, 0, GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int')); print '<form name="add" action="' . $_SERVER["PHP_SELF"] . '" method="POST">' . "\n"; print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">'; print '<input type="hidden" name="action" value="add">'; print '<table class="border" width="100%">'; print "<tr>"; print '<td width="25%" class="fieldrequired">' . $langs->trans("Type") . '</td><td>'; $form->select_type_fees(GETPOST('type', 'int'), 'type', 1); print '</td></tr>'; print "<tr>"; print '<td class="fieldrequired">' . $langs->trans("Person") . '</td><td>'; print $form->select_dolusers(GETPOST('fk_user', 'int'), 'fk_user', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300'); print '</td></tr>'; print "<tr>"; print '<td class="fieldrequired">' . $langs->trans("Date") . '</td><td>'; print $form->select_date($datec ? $datec : -1, '', '', '', '', 'add', 1, 1, 1); print '</td></tr>'; // Km print '<tr><td class="fieldrequired">' . $langs->trans("FeesKilometersOrAmout") . '</td><td><input name="km" size="10" value="' . GETPOST("km") . '"></td></tr>'; // Company print "<tr>"; print '<td>' . $langs->trans("CompanyVisited") . '</td><td>'; print $form->select_company(GETPOST('socid', 'int'), 'socid', '', 1); print '</td></tr>'; // Public note print '<tr>'; print '<td class="border" valign="top">' . $langs->trans('NotePublic') . '</td>';
/* * View */ $userstatic = new User($db); $companystatic = new Societe($db); $invoicestatic = new Facture($db); $form = new Form($db); llxHeader('', $langs->trans("Commissions")); $text = $langs->trans("Commissions"); print_fiche_titre($text); print '<form method="post" name="sel">'; print '<table class="border" width="100%">'; if ($agentid > 0) { print '<tr><td width="20%">' . $langs->trans('CommercialAgent') . '</td>'; print '<td colspan="4">'; print $form->select_dolusers($selected = $agentid, $htmlname = 'agentid', $show_empty = 1, $exclude = '', $disabled = 0, $include = '', $enableonly = ''); print '</td></tr>'; if (!$sortorder) { $sortorder = "ASC"; } if (!$sortfield) { $sortfield = "s.nom"; } } else { print '<tr><td width="20%">' . $langs->trans('CommercialAgent') . '</td>'; print '<td colspan="4">'; print $form->select_dolusers($selected = '', $htmlname = 'agentid', $show_empty = 1, $exclude = '', $disabled = 0, $include = '', $enableonly = ''); print '</td></tr>'; if (!$sortorder) { $sortorder = "ASC"; }
$i = 0; print '<table class="liste" width="100%">'; $moreforfilter = ''; // If the user can view prospects other than his' if ($user->rights->societe->client->voir || $socid) { $langs->load("commercial"); $moreforfilter .= '<div class="divsearchfield">'; $moreforfilter .= $langs->trans('ThirdPartiesOfSaleRepresentative') . ': '; $moreforfilter .= $formother->select_salesrepresentatives($search_sale, 'search_sale', $user, 0, 1, 'maxwidth300'); $moreforfilter .= '</div>'; } // If the user can view prospects other than his' if ($user->rights->societe->client->voir || $socid) { $moreforfilter .= '<div class="divsearchfield">'; $moreforfilter .= $langs->trans('LinkedToSpecificUsers') . ': '; $moreforfilter .= $form->select_dolusers($search_user, 'search_user', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300'); $moreforfilter .= '</div>'; } // If the user can view prospects other than his' if ($conf->categorie->enabled && $user->rights->produit->lire) { include_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; $moreforfilter .= '<div class="divsearchfield">'; $moreforfilter .= $langs->trans('IncludingProductWithTag') . ': '; $cate_arbo = $form->select_all_categories(Categorie::TYPE_PRODUCT, null, 'parent', null, null, 1); $moreforfilter .= $form->selectarray('search_product_category', $cate_arbo, $search_product_category, 1, 0, 0, '', 0, 0, 0, 0, '', 1); $moreforfilter .= '</div>'; } if (!empty($moreforfilter)) { print '<tr class="liste_titre">'; print '<td class="liste_titre" colspan="10">'; print $moreforfilter;
if ($action == 'create') { //WYSIWYG Editor require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php'; print_fiche_titre($langs->trans("NewTrip")); $datec = dol_mktime(12, 0, 0, GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int')); print '<form name="add" action="' . $_SERVER["PHP_SELF"] . '" method="POST">' . "\n"; print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">'; print '<input type="hidden" name="action" value="add">'; print '<table class="border" width="100%">'; print "<tr>"; print '<td width="25%" class="fieldrequired">' . $langs->trans("Type") . '</td><td>'; $form->select_type_fees(GETPOST('type', 'int'), 'type', 1); print '</td></tr>'; print "<tr>"; print '<td class="fieldrequired">' . $langs->trans("Person") . '</td><td>'; print $form->select_dolusers(GETPOST('fk_user', 'int'), 'fk_user', 1); print '</td></tr>'; print "<tr>"; print '<td class="fieldrequired">' . $langs->trans("Date") . '</td><td>'; print $form->select_date($datec ? $datec : -1, '', '', '', '', 'add', 1, 1, 1); print '</td></tr>'; // Km print '<tr><td class="fieldrequired">' . $langs->trans("FeesKilometersOrAmout") . '</td><td><input name="km" size="10" value="' . GETPOST("km") . '"></td></tr>'; // Company print "<tr>"; print '<td>' . $langs->trans("CompanyVisited") . '</td><td>'; print $form->select_company(GETPOST('socid', 'int'), 'socid', '', 1); print '</td></tr>'; // Public note print '<tr>'; print '<td class="border" valign="top">' . $langs->trans('NotePublic') . '</td>';