24 if (!defined(
'NOCSRFCHECK')) {
25 define(
'NOCSRFCHECK',
'1');
28 if (!defined(
'NOREQUIREMENU')) {
29 define(
'NOREQUIREMENU',
'1');
32 if (!defined(
"NOLOGIN")) {
33 define(
"NOLOGIN",
'1');
35 if (!defined(
'NOIPCHECK')) define(
'NOIPCHECK',
'1');
36 if (!defined(
'NOBROWSERNOTIF')) define(
'NOBROWSERNOTIF',
'1');
39 require
'../../main.inc.php';
40 require_once DOL_DOCUMENT_ROOT.
'/recruitment/class/recruitmentjobposition.class.php';
41 require_once DOL_DOCUMENT_ROOT.
'/core/class/CMailFile.class.php';
42 require_once DOL_DOCUMENT_ROOT.
'/core/lib/security.lib.php';
43 require_once DOL_DOCUMENT_ROOT.
'/core/lib/company.lib.php';
46 $langs->loadLangs(array(
"companies",
"other",
"recruitment"));
49 $action =
GETPOST(
'action',
'aZ09');
50 $email =
GETPOST(
'email',
'alpha');
69 $form =
new Form($db);
70 $user_assign =
new User($db);
71 $user_create =
new User($db);
73 if (!$conf->global->RECRUITMENT_ENABLE_PUBLIC_INTERFACE) {
74 $langs->load(
"errors");
75 print '<div class="error">'.$langs->trans(
'ErrorPublicInterfaceNotEnabled').
'</div>';
81 $arrayofcss = array();
83 llxHeaderTicket($langs->trans(
"Jobs"),
"", 0, 0, $arrayofjs, $arrayofcss);
86 print '<div class="ticketpublicarealist">';
88 $display_ticket_list = 1;
91 if ($display_ticket_list) {
93 $search_fk_status =
GETPOST(
"search_fk_status",
'alpha');
94 $search_subject =
GETPOST(
"search_subject",
'alpha');
95 $search_type =
GETPOST(
"search_type",
'alpha');
96 $search_category =
GETPOST(
"search_category",
'alpha');
97 $search_severity =
GETPOST(
"search_severity",
'alpha');
98 $search_fk_user_create =
GETPOST(
"search_fk_user_create",
'int');
99 $search_fk_user_assign =
GETPOST(
"search_fk_user_assign",
'int');
102 $url_page_current =
dol_buildpath(
'/public/ticket/list.php', 1);
105 if (
GETPOST(
"button_removefilter_x")) {
106 $search_fk_status =
'';
107 $search_subject =
'';
109 $search_category =
'';
110 $search_severity =
'';
111 $search_fk_user_create =
'';
112 $search_fk_user_assign =
'';
117 $extrafields->fetch_name_optionals_label($object->table_element);
119 $search_array_options = $extrafields->getOptionalsFromPost($object->table_element,
'',
'search_');
122 $param =
'action=viewlist';
125 $arrayfields = array(
126 't.datec' => array(
'label' => $langs->trans(
"Date"),
'checked' => 1),
127 't.date_read' => array(
'label' => $langs->trans(
"TicketReadOn"),
'checked' => 0),
128 't.date_close' => array(
'label' => $langs->trans(
"TicketCloseOn"),
'checked' => 0),
129 't.ref' => array(
'label' => $langs->trans(
"Ref"),
'checked' => 1),
131 't.fk_statut' => array(
'label' => $langs->trans(
"Status"),
'checked' => 1),
132 't.subject' => array(
'label' => $langs->trans(
"Subject"),
'checked' => 1),
133 'type.code' => array(
'label' => $langs->trans(
"Type"),
'checked' => 1),
134 'category.code' => array(
'label' => $langs->trans(
"Category"),
'checked' => 1),
135 'severity.code' => array(
'label' => $langs->trans(
"Severity"),
'checked' => 1),
136 't.progress' => array(
'label' => $langs->trans(
"Progression"),
'checked' => 0),
138 't.fk_user_create' => array(
'label' => $langs->trans(
"Author"),
'checked' => 1),
139 't.fk_user_assign' => array(
'label' => $langs->trans(
"AssignedTo"),
'checked' => 0),
148 if (is_array($extrafields->attributes[$object->table_element][
'label']) && count($extrafields->attributes[$object->table_element][
'label'])) {
149 foreach ($extrafields->attributes[$object->table_element][
'label'] as $key => $val) {
150 if ($extrafields->attributes[$object->table_element][
'type'][$key] !=
'separate') {
151 $arrayfields[
"ef.".$key] = array(
'label' => $extrafields->attributes[$object->table_element][
'label'][$key],
'checked' => ($extrafields->attributes[$object->table_element][
'list'][$key] < 0) ? 0 : 1,
'position' => $extrafields->attributes[$object->table_element][
'pos'][$key],
'enabled' =>(abs($extrafields->attributes[$object->table_element][
'list'][$key]) != 3) && $extrafields->attributes[$object->table_element][
'perms'][$key]);
155 if (!empty($search_subject)) {
156 $filter[
't.subject'] = $search_subject;
157 $param .=
'&search_subject='.urlencode($search_subject);
159 if (!empty($search_type)) {
160 $filter[
't.type_code'] = $search_type;
161 $param .=
'&search_type='.urlencode($search_type);
163 if (!empty($search_category)) {
164 $filter[
't.category_code'] = $search_category;
165 $param .=
'&search_category='.urlencode($search_category);
167 if (!empty($search_severity)) {
168 $filter[
't.severity_code'] = $search_severity;
169 $param .=
'&search_severity='.urlencode($search_severity);
171 if (!empty($search_fk_user_assign)) {
173 if ($search_fk_user_assign > 0) {
174 $filter[
't.fk_user_assign'] = $search_fk_user_assign;
175 $param .=
'&search_fk_user_assign='.urlencode($search_fk_user_assign);
178 if (!empty($search_fk_user_create)) {
180 if ($search_fk_user_create > 0) {
181 $filter[
't.fk_user_create'] = $search_fk_user_create;
182 $param .=
'&search_fk_user_create='.urlencode($search_fk_user_create);
185 if ((isset($search_fk_status) && $search_fk_status !=
'') && $search_fk_status !=
'-1' && $search_fk_status !=
'non_closed') {
186 $filter[
't.fk_statut'] = $search_fk_status;
187 $param .=
'&search_fk_status='.urlencode($search_fk_status);
189 if (isset($search_fk_status) && $search_fk_status ==
'non_closed') {
190 $filter[
't.fk_statut'] = array(0, 1, 3, 4, 5, 6);
191 $param .=
'&search_fk_status=non_closed';
194 require DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
196 $sortfield =
GETPOST(
"sortfield",
'alpha');
197 $sortorder =
GETPOST(
"sortorder",
'alpha');
200 $sortfield =
't.datec';
206 $limit = $conf->liste_limit;
209 if (empty($page) || $page == -1) { $page = 0; }
210 $offset = $limit * $page;
211 $pageprev = $page - 1;
212 $pagenext = $page + 1;
215 $sql =
"SELECT DISTINCT";
218 $sql .=
" t.track_id,";
219 $sql .=
" t.fk_soc,";
220 $sql .=
" t.fk_project,";
221 $sql .=
" t.origin_email,";
222 $sql .=
" t.fk_user_create, uc.lastname as user_create_lastname, uc.firstname as user_create_firstname,";
223 $sql .=
" t.fk_user_assign, ua.lastname as user_assign_lastname, ua.firstname as user_assign_firstname,";
224 $sql .=
" t.subject,";
225 $sql .=
" t.message,";
226 $sql .=
" t.fk_statut,";
227 $sql .=
" t.resolution,";
228 $sql .=
" t.progress,";
229 $sql .=
" t.timing,";
230 $sql .=
" t.type_code,";
231 $sql .=
" t.category_code,";
232 $sql .=
" t.severity_code,";
234 $sql .=
" t.date_read,";
235 $sql .=
" t.date_close,";
237 $sql .=
" type.label as type_label, category.label as category_label, severity.label as severity_label";
239 if (is_array($extrafields->attributes[$object->table_element][
'label']) && count($extrafields->attributes[$object->table_element][
'label'])) {
240 foreach ($extrafields->attributes[$object->table_element][
'label'] as $key => $val)
241 $sql .= ($extrafields->attributes[$object->table_element][
'type'][$key] !=
'separate' ?
", ef.".$key.
' as options_'.$key :
'');
243 $sql .=
" FROM ".MAIN_DB_PREFIX.
"recruitment_recruitmentjobposition as t";
244 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"societe as s ON s.rowid=t.fk_soc";
245 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"user as uc ON uc.rowid=t.fk_user_create";
246 if (is_array($extrafields->attributes[$object->table_element][
'label']) && count($extrafields->attributes[$object->table_element][
'label'])) {
247 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"recruitment_recruitmentjobposition_extrafields as ef on (t.rowid = ef.fk_object)";
249 $sql .=
" WHERE t.entity IN (".getEntity(
'recruitmentjobposition').
")";
251 if (!empty($filter)) {
252 foreach ($filter as $key => $value) {
253 if (strpos($key,
'date')) {
254 $sql .=
' AND '.$key.
' = \''.$value.
'\'';
255 } elseif ($key ==
't.fk_statut') {
256 if (is_array($value) && count($value) > 0) {
257 $sql .=
'AND '.$key.
' IN ('.implode(
',', $value).
')';
259 $sql .=
' AND '.$key.
' = '.$db->escape($value);
262 $sql .=
' AND '.$key.
' LIKE \'%'.$value.
'%\'';
266 $sql .=
" ORDER BY ".$sortfield.
' '.$sortorder;
268 $resql = $db->query($sql);
270 $num_total = $db->num_rows(
$resql);
271 if (!empty($limit)) {
272 $sql .=
' '.$db->plimit($limit + 1, $offset);
275 $resql = $db->query($sql);
277 $num = $db->num_rows(
$resql);
278 print_barre_liste($langs->trans(
'JobList'), $page,
'public/recruitment/list.php', $param, $sortfield, $sortorder,
'', $num, $num_total,
'ticket');
281 print
'<form method="get" action="'.$url_form.
'" id="searchFormList" >'.
"\n";
282 print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
283 print
'<input type="hidden" name="action" value="viewlist">';
284 print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
285 print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
287 $varpage = empty($contextpage) ? $url_page_current : $contextpage;
288 $selectedfields = $form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage);
290 print
'<table class="liste '.($moreforfilter ?
"listwithfilterbefore" :
"").
'">';
293 print
'<tr class="liste_titre">';
295 if (!empty($arrayfields[
't.datec'][
'checked'])) {
296 print
'<td class="liste_titre"></td>';
299 if (!empty($arrayfields[
't.ref'][
'checked'])) {
300 print
'<td class="liste_titre"></td>';
303 if (!empty($arrayfields[
't.fk_user_create'][
'checked'])) {
304 print
'<td class="liste_titre"></td>';
307 if (!empty($arrayfields[
't.tms'][
'checked'])) {
308 print
'<td class="liste_titre"></td>';
312 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_input.tpl.php';
315 $parameters = array(
'arrayfields'=>$arrayfields);
316 $reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters, $object);
317 print $hookmanager->resPrint;
320 if (!empty($arrayfields[
't.fk_statut'][
'checked'])) {
321 print
'<td class="liste_titre">';
322 $selected = ($search_fk_status !=
"non_closed" ? $search_fk_status :
'');
328 print
'<td class="liste_titre maxwidthsearch">';
329 $searchpicto = $form->showFilterButtons();
335 print
'<tr class="liste_titre">';
336 if (!empty($arrayfields[
't.datec'][
'checked'])) {
337 print_liste_field_titre($arrayfields[
't.datec'][
'label'], $url_page_current,
't.datec',
'', $param,
'', $sortfield, $sortorder);
339 if (!empty($arrayfields[
't.ref'][
'checked'])) {
340 print_liste_field_titre($arrayfields[
't.ref'][
'label'], $url_page_current,
't.ref',
'', $param,
'', $sortfield, $sortorder);
342 if (!empty($arrayfields[
't.fk_user_create'][
'checked'])) {
343 print_liste_field_titre($arrayfields[
't.fk_user_create'][
'label'], $url_page_current,
't.fk_user_create',
'', $param,
'', $sortfield, $sortorder);
345 if (!empty($arrayfields[
't.tms'][
'checked'])) {
346 print_liste_field_titre($arrayfields[
't.tms'][
'label'], $url_page_current,
't.tms',
'', $param,
'', $sortfield, $sortorder);
350 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_title.tpl.php';
353 $parameters = array(
'arrayfields'=>$arrayfields,
'param'=>$param,
'sortfield'=>$sortfield,
'sortorder'=>$sortorder);
354 $reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters, $object);
355 print $hookmanager->resPrint;
357 if (!empty($arrayfields[
't.fk_statut'][
'checked'])) {
358 print_liste_field_titre($arrayfields[
't.fk_statut'][
'label'], $url_page_current,
't.fk_statut',
'', $param,
'', $sortfield, $sortorder);
360 print_liste_field_titre($selectedfields, $url_page_current,
"",
'',
'',
'align="right"', $sortfield, $sortorder,
'center maxwidthsearch ');
363 while ($obj = $db->fetch_object(
$resql))
365 print
'<tr class="oddeven">';
368 if (!empty($arrayfields[
't.datec'][
'checked'])) {
375 if (!empty($arrayfields[
't.ref'][
'checked'])) {
376 print
'<td class="nowraponall">';
382 if (!empty($arrayfields[
't.fk_user_create'][
'checked'])) {
384 if ($obj->fk_user_create > 0) {
385 $user_create->firstname = (!empty($obj->user_create_firstname) ? $obj->user_create_firstname :
'');
386 $user_create->name = (!empty($obj->user_create_lastname) ? $obj->user_create_lastname :
'');
387 $user_create->id = (!empty($obj->fk_user_create) ? $obj->fk_user_create :
'');
388 print $user_create->getFullName($langs);
390 print $langs->trans(
'Email');
395 if (!empty($arrayfields[
't.tms'][
'checked'])) {
396 print
'<td>'.dol_print_date($db->jdate($obj->tms),
'dayhour').
'</td>';
400 if (is_array($extrafields->attributes[$object->table_element][
'label']) && count($extrafields->attributes[$object->table_element][
'label'])) {
401 foreach ($extrafields->attributes[$object->table_element][
'label'] as $key => $val) {
402 if (!empty($arrayfields[
"ef.".$key][
'checked'])) {
404 $align = $extrafields->getAlignFlag($key);
406 print
' align="'.$align.
'"';
409 $tmpkey =
'options_'.$key;
410 print $extrafields->showOutputField($key, $obj->$tmpkey,
'', 1);
417 if (!empty($arrayfields[
't.fk_statut'][
'checked'])) {
418 print
'<td class="nowraponall">';
419 $object->fk_statut = $obj->fk_statut;
420 print $object->getLibStatut(2);
433 print
'<form method="post" id="form_view" name="form_view" enctype="multipart/form-data" action="'.dol_buildpath(
'/public/recruitment/view.php', 1).
'" style="display:none;">';
434 print
'<input type="hidden" name="token" value="'.newToken().
'">';
435 print
'<input type="hidden" name="action" value="view">';
436 print
'<input type="hidden" name="btn_view_list" value="1">';
437 print
'<input type="hidden" name="track_id" value="">';
438 print
'<input type="hidden" name="email" value="">';
440 print
'<script type="text/javascript">
441 function viewticket(ticket_id, email) {
442 var form = $("#form_view");
449 print
'<div class="error">Not Allowed<br><a href="'.$_SERVER[
'PHP_SELF'].
'?ref='.$object->ref.
'">'.$langs->trans(
'Back').
'</a></div>';
456 htmlPrintOnlinePaymentFooter($mysoc, $langs, 0, $suffix, $object);
GETPOST($paramname, $check= 'alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
Class to manage Dolibarr users.
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
print_barre_liste($titre, $page, $file, $options= '', $sortfield= '', $sortorder= '', $morehtmlcenter= '', $num=-1, $totalnboflines= '', $picto= 'generic', $pictoisfullpath=0, $morehtmlright= '', $morecss= '', $limit=-1, $hideselectlimit=0, $hidenavigation=0, $pagenavastextinput=0, $morehtmlrightbeforearrow= '')
Print a title with navigation controls for pagination.
GETPOSTISSET($paramname)
Return true if we are in a context of submitting the parameter $paramname.
print_liste_field_titre($name, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $tooltip="", $forcenowrapcolumntitle=0)
Show title line of an array.
llxHeaderTicket($title, $head="", $disablejs=0, $disablehead=0, $arrayofjs= '', $arrayofcss= '')
Show header for public pages.
Class for RecruitmentJobPosition.
print
Draft customers invoices.
dol_print_date($time, $format= '', $tzoutput= 'auto', $outputlangs= '', $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
if(!empty($conf->facture->enabled)&&$user->rights->facture->lire) if((!empty($conf->fournisseur->enabled)&&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)||!empty($conf->supplier_invoice->enabled))&&$user->rights->fournisseur->facture->lire) if(!empty($conf->don->enabled)&&$user->rights->don->lire) if(!empty($conf->tax->enabled)&&$user->rights->tax->charges->lire) if(!empty($conf->facture->enabled)&&!empty($conf->commande->enabled)&&$user->rights->commande->lire &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) if(!empty($conf->facture->enabled)&&$user->rights->facture->lire) if((!empty($conf->fournisseur->enabled)&&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)||!empty($conf->supplier_invoice->enabled))&&$user->rights->fournisseur->facture->lire) $resql
Social contributions to pay.