mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-06 17:48:25 +01:00
Enhance recruitment module
This commit is contained in:
@@ -3070,7 +3070,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
|
|||||||
'error'=>'exclamation-triangle', 'warning'=>'exclamation-triangle',
|
'error'=>'exclamation-triangle', 'warning'=>'exclamation-triangle',
|
||||||
'other'=>'square',
|
'other'=>'square',
|
||||||
'playdisabled'=>'play', 'poll'=>'check-double', 'preview'=>'binoculars', 'project'=>'sitemap', 'projectpub'=>'sitemap', 'projecttask'=>'tasks', 'propal'=>'file-signature',
|
'playdisabled'=>'play', 'poll'=>'check-double', 'preview'=>'binoculars', 'project'=>'sitemap', 'projectpub'=>'sitemap', 'projecttask'=>'tasks', 'propal'=>'file-signature',
|
||||||
'recruitmentjobposition'=>'door-open', 'recruitmentcandidature'=>'door-open',
|
'recruitmentjobposition'=>'id-card-alt', 'recruitmentcandidature'=>'id-badge',
|
||||||
'resize'=>'crop', 'supplier_order'=>'dol-order_supplier', 'supplier_proposal'=>'file-signature',
|
'resize'=>'crop', 'supplier_order'=>'dol-order_supplier', 'supplier_proposal'=>'file-signature',
|
||||||
'payment'=>'money-check-alt', 'phoning'=>'phone', 'phoning_mobile'=>'mobile-alt', 'phoning_fax'=>'fax', 'printer'=>'print', 'product'=>'cube', 'service'=>'concierge-bell',
|
'payment'=>'money-check-alt', 'phoning'=>'phone', 'phoning_mobile'=>'mobile-alt', 'phoning_fax'=>'fax', 'printer'=>'print', 'product'=>'cube', 'service'=>'concierge-bell',
|
||||||
'resource'=>'laptop-house',
|
'resource'=>'laptop-house',
|
||||||
|
|||||||
@@ -43,6 +43,7 @@ class modHRM extends DolibarrModules
|
|||||||
$this->rights_class = 'hrm';
|
$this->rights_class = 'hrm';
|
||||||
|
|
||||||
$this->family = "hr";
|
$this->family = "hr";
|
||||||
|
$this->module_position = '50';
|
||||||
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
|
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
|
||||||
$this->name = preg_replace('/^mod/i', '', get_class($this));
|
$this->name = preg_replace('/^mod/i', '', get_class($this));
|
||||||
$this->description = "Management of employees carrier and feelings (department, employment contract)";
|
$this->description = "Management of employees carrier and feelings (department, employment contract)";
|
||||||
|
|||||||
@@ -2,7 +2,6 @@
|
|||||||
/* Copyright (C) 2004-2018 Laurent Destailleur <eldy@users.sourceforge.net>
|
/* Copyright (C) 2004-2018 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2018-2019 Nicolas ZABOURI <info@inovea-conseil.com>
|
* Copyright (C) 2018-2019 Nicolas ZABOURI <info@inovea-conseil.com>
|
||||||
* Copyright (C) 2019-2020 Frédéric France <frederic.france@netlogic.fr>
|
* Copyright (C) 2019-2020 Frédéric France <frederic.france@netlogic.fr>
|
||||||
* Copyright (C) 2020 Adminson Alicealalalamdskfldmjgdfgdfhfghgfh <testldr9@dolicloud.com>
|
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -28,6 +27,7 @@
|
|||||||
*/
|
*/
|
||||||
include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php';
|
include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php';
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Description and activation class for module Recruitment
|
* Description and activation class for module Recruitment
|
||||||
*/
|
*/
|
||||||
@@ -45,14 +45,14 @@ class modRecruitment extends DolibarrModules
|
|||||||
|
|
||||||
// Id for module (must be unique).
|
// Id for module (must be unique).
|
||||||
// Use here a free id (See in Home -> System information -> Dolibarr for list of used modules id).
|
// Use here a free id (See in Home -> System information -> Dolibarr for list of used modules id).
|
||||||
$this->numero = 750; // TODO Go on page https://wiki.dolibarr.org/index.php/List_of_modules_id to reserve an id number for your module
|
$this->numero = 750;
|
||||||
// Key text used to identify module (for permissions, menus, etc...)
|
// Key text used to identify module (for permissions, menus, etc...)
|
||||||
$this->rights_class = 'recruitment';
|
$this->rights_class = 'recruitment';
|
||||||
// Family can be 'base' (core modules),'crm','financial','hr','projects','products','ecm','technic' (transverse modules),'interface' (link with external tools),'other','...'
|
// Family can be 'base' (core modules),'crm','financial','hr','projects','products','ecm','technic' (transverse modules),'interface' (link with external tools),'other','...'
|
||||||
// It is used to group modules by family in module setup page
|
// It is used to group modules by family in module setup page
|
||||||
$this->family = "hr";
|
$this->family = "hr";
|
||||||
// Module position in the family on 2 digits ('01', '10', '20', ...)
|
// Module position in the family on 2 digits ('01', '10', '20', ...)
|
||||||
$this->module_position = '90';
|
$this->module_position = '51';
|
||||||
// Gives the possibility for the module, to provide his own family info and position of this family (Overwrite $this->family and $this->module_position. Avoid this)
|
// Gives the possibility for the module, to provide his own family info and position of this family (Overwrite $this->family and $this->module_position. Avoid this)
|
||||||
//$this->familyinfo = array('myownfamily' => array('position' => '01', 'label' => $langs->trans("MyOwnFamily")));
|
//$this->familyinfo = array('myownfamily' => array('position' => '01', 'label' => $langs->trans("MyOwnFamily")));
|
||||||
// Module label (no space allowed), used if translation string 'ModuleRecruitmentName' not found (Recruitment is name of module).
|
// Module label (no space allowed), used if translation string 'ModuleRecruitmentName' not found (Recruitment is name of module).
|
||||||
|
|||||||
@@ -91,7 +91,7 @@ print '<div class="tagtr table-border-row">'."\n";
|
|||||||
print '<div class="tagtd tagtdnote tdtop sensiblehtmlcontent table-key-border-col'.(empty($cssclass) ? '' : ' '.$cssclass).'"'.($colwidth ? ' style="width: '.$colwidth.'%"' : '').'>'."\n";
|
print '<div class="tagtd tagtdnote tdtop sensiblehtmlcontent table-key-border-col'.(empty($cssclass) ? '' : ' '.$cssclass).'"'.($colwidth ? ' style="width: '.$colwidth.'%"' : '').'>'."\n";
|
||||||
print $form->editfieldkey("NotePublic", $note_public, $value_public, $object, $permission, $typeofdata, $moreparam, '', 0);
|
print $form->editfieldkey("NotePublic", $note_public, $value_public, $object, $permission, $typeofdata, $moreparam, '', 0);
|
||||||
print '</div>'."\n";
|
print '</div>'."\n";
|
||||||
print '<div class="tagtd table-val-border-col sensiblehtmlcontent">'."\n";
|
print '<div class="tagtd wordbreak table-val-border-col sensiblehtmlcontent">'."\n";
|
||||||
print $form->editfieldval("NotePublic", $note_public, $value_public, $object, $permission, $typeofdata, '', null, null, $moreparam, 1)."\n";
|
print $form->editfieldval("NotePublic", $note_public, $value_public, $object, $permission, $typeofdata, '', null, null, $moreparam, 1)."\n";
|
||||||
print '</div>'."\n";
|
print '</div>'."\n";
|
||||||
print '</div>'."\n";
|
print '</div>'."\n";
|
||||||
@@ -101,7 +101,7 @@ if (empty($user->socid)) {
|
|||||||
print '<div class="tagtd tagtdnote tdtop sensiblehtmlcontent table-key-border-col'.(empty($cssclass) ? '' : ' '.$cssclass).'"'.($colwidth ? ' style="width: '.$colwidth.'%"' : '').'>'."\n";
|
print '<div class="tagtd tagtdnote tdtop sensiblehtmlcontent table-key-border-col'.(empty($cssclass) ? '' : ' '.$cssclass).'"'.($colwidth ? ' style="width: '.$colwidth.'%"' : '').'>'."\n";
|
||||||
print $form->editfieldkey("NotePrivate", $note_private, $value_private, $object, $permission, $typeofdata, $moreparam, '', 0);
|
print $form->editfieldkey("NotePrivate", $note_private, $value_private, $object, $permission, $typeofdata, $moreparam, '', 0);
|
||||||
print '</div>'."\n";
|
print '</div>'."\n";
|
||||||
print '<div class="tagtd table-val-border-col sensiblehtmlcontent">'."\n";
|
print '<div class="tagtd wordbreak table-val-border-col sensiblehtmlcontent">'."\n";
|
||||||
print $form->editfieldval("NotePrivate", $note_private, $value_private, $object, $permission, $typeofdata, '', null, null, $moreparam, 1);
|
print $form->editfieldval("NotePrivate", $note_private, $value_private, $object, $permission, $typeofdata, '', null, null, $moreparam, 1);
|
||||||
print '</div>'."\n";
|
print '</div>'."\n";
|
||||||
print '</div>'."\n";
|
print '</div>'."\n";
|
||||||
|
|||||||
@@ -1448,19 +1448,14 @@ class EmailCollector extends CommonObject
|
|||||||
if ($this->source_directory == 'Sent') $actioncode = 'EMAIL_OUT';
|
if ($this->source_directory == 'Sent') $actioncode = 'EMAIL_OUT';
|
||||||
|
|
||||||
$description = $descriptiontitle = $descriptionmeta = $descriptionfull = '';
|
$description = $descriptiontitle = $descriptionmeta = $descriptionfull = '';
|
||||||
if (in_array($operation['type'], array('recordevent', 'project', 'ticket')))
|
|
||||||
{
|
|
||||||
if ($operation['type'] == 'project') $descriptiontitle = $langs->trans("ProjectCreatedByEmailCollector", $msgid);
|
|
||||||
elseif ($operation['type'] == 'ticket') $descriptiontitle = $langs->trans("TicketCreatedByEmailCollector", $msgid);
|
|
||||||
else $descriptiontitle = $langs->trans("ActionAC_".$actioncode).' - '.$langs->trans("MailFrom").' '.$from;
|
|
||||||
|
|
||||||
$descriptionmeta = dol_concatdesc($descriptionmeta, $langs->trans("MailTopic").' : '.dol_escape_htmltag($subject));
|
$descriptiontitle = $langs->trans("RecordCreatedByEmailCollector", $msgid);
|
||||||
$descriptionmeta = dol_concatdesc($descriptionmeta, $langs->trans("MailFrom").($langs->trans("MailFrom") != 'From' ? ' (From)' : '').' : '.dol_escape_htmltag($fromstring));
|
|
||||||
if ($sender) $descriptionmeta = dol_concatdesc($descriptionmeta, $langs->trans("Sender").($langs->trans("Sender") != 'Sender' ? ' (Sender)' : '').' : '.dol_escape_htmltag($sender));
|
$descriptionmeta = dol_concatdesc($descriptionmeta, $langs->trans("MailTopic").' : '.dol_escape_htmltag($subject));
|
||||||
$descriptionmeta = dol_concatdesc($descriptionmeta, $langs->trans("MailTo").($langs->trans("MailTo") != 'To' ? ' (To)' : '').' : '.dol_escape_htmltag($to));
|
$descriptionmeta = dol_concatdesc($descriptionmeta, $langs->trans("MailFrom").($langs->trans("MailFrom") != 'From' ? ' (From)' : '').' : '.dol_escape_htmltag($fromstring));
|
||||||
if ($sendtocc) $descriptionmeta = dol_concatdesc($descriptionmeta, $langs->trans("MailCC").($langs->trans("MailCC") != 'CC' ? ' (CC)' : '').' : '.dol_escape_htmltag($sendtocc));
|
if ($sender) $descriptionmeta = dol_concatdesc($descriptionmeta, $langs->trans("Sender").($langs->trans("Sender") != 'Sender' ? ' (Sender)' : '').' : '.dol_escape_htmltag($sender));
|
||||||
//if ($bcc) $descriptionmeta = dol_concatdesc($descriptionmeta, $langs->trans("Bcc").' : '.dol_escape_htmltag($bcc));
|
$descriptionmeta = dol_concatdesc($descriptionmeta, $langs->trans("MailTo").($langs->trans("MailTo") != 'To' ? ' (To)' : '').' : '.dol_escape_htmltag($to));
|
||||||
}
|
if ($sendtocc) $descriptionmeta = dol_concatdesc($descriptionmeta, $langs->trans("MailCC").($langs->trans("MailCC") != 'CC' ? ' (CC)' : '').' : '.dol_escape_htmltag($sendtocc));
|
||||||
|
|
||||||
// Search and create thirdparty
|
// Search and create thirdparty
|
||||||
if ($operation['type'] == 'loadthirdparty' || $operation['type'] == 'loadandcreatethirdparty')
|
if ($operation['type'] == 'loadthirdparty' || $operation['type'] == 'loadandcreatethirdparty')
|
||||||
|
|||||||
@@ -255,10 +255,7 @@ YourPasswordHasBeenReset=Your password has been reset successfully
|
|||||||
ApplicantIpAddress=IP address of applicant
|
ApplicantIpAddress=IP address of applicant
|
||||||
SMSSentTo=SMS sent to %s
|
SMSSentTo=SMS sent to %s
|
||||||
MissingIds=Missing ids
|
MissingIds=Missing ids
|
||||||
ThirdPartyCreatedByEmailCollector=Third party created by email collector from email MSGID %s
|
RecordCreatedByEmailCollector=Record created by email collector from email MSGID %s
|
||||||
ContactCreatedByEmailCollector=Contact/address created by email collector from email MSGID %s
|
|
||||||
ProjectCreatedByEmailCollector=Project created by email collector from email MSGID %s
|
|
||||||
TicketCreatedByEmailCollector=Ticket created by email collector from email MSGID %s
|
|
||||||
OpeningHoursFormatDesc=Use a - to separate opening and closing hours.<br>Use a space to enter different ranges.<br>Example: 8-12 14-18
|
OpeningHoursFormatDesc=Use a - to separate opening and closing hours.<br>Use a space to enter different ranges.<br>Example: 8-12 14-18
|
||||||
|
|
||||||
##### Export #####
|
##### Export #####
|
||||||
|
|||||||
@@ -84,6 +84,7 @@ BoxTitleLastModifiedCustomerBills=Customer Invoices: last %s modified
|
|||||||
BoxTitleLastModifiedCustomerOrders=Sales Orders: last %s modified
|
BoxTitleLastModifiedCustomerOrders=Sales Orders: last %s modified
|
||||||
BoxTitleLastModifiedPropals=Latest %s modified proposals
|
BoxTitleLastModifiedPropals=Latest %s modified proposals
|
||||||
BoxTitleLatestModifiedJobPositions=Latest %s modified jobs
|
BoxTitleLatestModifiedJobPositions=Latest %s modified jobs
|
||||||
|
BoxTitleLatestModifiedCandidatures=Latest %s modified candidatures
|
||||||
ForCustomersInvoices=Customers invoices
|
ForCustomersInvoices=Customers invoices
|
||||||
ForCustomersOrders=Customers orders
|
ForCustomersOrders=Customers orders
|
||||||
ForProposals=Proposals
|
ForProposals=Proposals
|
||||||
|
|||||||
@@ -118,7 +118,7 @@ class RecruitmentCandidature extends CommonObject
|
|||||||
'description' => array('type'=>'html', 'label'=>'Description', 'enabled'=>'1', 'position'=>500, 'notnull'=>0, 'visible'=>3,),
|
'description' => array('type'=>'html', 'label'=>'Description', 'enabled'=>'1', 'position'=>500, 'notnull'=>0, 'visible'=>3,),
|
||||||
'import_key' => array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>'1', 'position'=>1000, 'notnull'=>-1, 'visible'=>-2,),
|
'import_key' => array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>'1', 'position'=>1000, 'notnull'=>-1, 'visible'=>-2,),
|
||||||
'model_pdf' => array('type'=>'varchar(255)', 'label'=>'Model pdf', 'enabled'=>'1', 'position'=>1010, 'notnull'=>-1, 'visible'=>0,),
|
'model_pdf' => array('type'=>'varchar(255)', 'label'=>'Model pdf', 'enabled'=>'1', 'position'=>1010, 'notnull'=>-1, 'visible'=>0,),
|
||||||
'status' => array('type'=>'smallint', 'label'=>'Status', 'enabled'=>'1', 'position'=>1000, 'notnull'=>1, 'visible'=>1, 'index'=>1, 'default'=>0, 'arrayofkeyval'=>array('0'=>'Draft', '1'=>'Validated', '3'=>'ContractProposed', '5'=>'ContractSigned', '8'=>'Refused', '9'=>'Canceled')),
|
'status' => array('type'=>'smallint', 'label'=>'Status', 'enabled'=>'1', 'position'=>1000, 'notnull'=>1, 'visible'=>1, 'index'=>1, 'default'=>0, 'arrayofkeyval'=>array('0'=>'Draft', '1'=>'Received', '3'=>'ContractProposed', '5'=>'ContractSigned', '8'=>'Refused', '9'=>'Canceled')),
|
||||||
);
|
);
|
||||||
public $rowid;
|
public $rowid;
|
||||||
public $entity;
|
public $entity;
|
||||||
@@ -804,17 +804,17 @@ class RecruitmentCandidature extends CommonObject
|
|||||||
global $langs;
|
global $langs;
|
||||||
//$langs->load("recruitment@recruitment");
|
//$langs->load("recruitment@recruitment");
|
||||||
$this->labelStatus[self::STATUS_DRAFT] = $langs->trans('Draft');
|
$this->labelStatus[self::STATUS_DRAFT] = $langs->trans('Draft');
|
||||||
$this->labelStatus[self::STATUS_VALIDATED] = $langs->trans('Validated').' ('.$langs->trans("InterviewToDo").')';
|
$this->labelStatus[self::STATUS_VALIDATED] = $langs->trans('Received').' ('.$langs->trans("InterviewToDo").')';
|
||||||
$this->labelStatus[self::STATUS_CONTRACT_PROPOSED] = $langs->trans('ContractProposed');
|
$this->labelStatus[self::STATUS_CONTRACT_PROPOSED] = $langs->trans('ContractProposed');
|
||||||
$this->labelStatus[self::STATUS_CONTRACT_SIGNED] = $langs->trans('ContractSigned');
|
$this->labelStatus[self::STATUS_CONTRACT_SIGNED] = $langs->trans('ContractSigned');
|
||||||
$this->labelStatus[self::STATUS_REFUSED] = $langs->trans('Refused');
|
$this->labelStatus[self::STATUS_REFUSED] = $langs->trans('Refused');
|
||||||
$this->labelStatus[self::STATUS_REFUSED] = $langs->trans('Refused');
|
$this->labelStatus[self::STATUS_REFUSED] = $langs->trans('Refused');
|
||||||
$this->labelStatus[self::STATUS_CANCELED] = $langs->trans('Disabled');
|
$this->labelStatus[self::STATUS_CANCELED] = $langs->trans('Canceled');
|
||||||
$this->labelStatusShort[self::STATUS_DRAFT] = $langs->trans('Draft');
|
$this->labelStatusShort[self::STATUS_DRAFT] = $langs->trans('Draft');
|
||||||
$this->labelStatusShort[self::STATUS_VALIDATED] = $langs->trans('Validated');
|
$this->labelStatusShort[self::STATUS_VALIDATED] = $langs->trans('Received');
|
||||||
$this->labelStatusShort[self::STATUS_CONTRACT_PROPOSED] = $langs->trans('ContractProposed');
|
$this->labelStatusShort[self::STATUS_CONTRACT_PROPOSED] = $langs->trans('ContractProposed');
|
||||||
$this->labelStatusShort[self::STATUS_CONTRACT_SIGNED] = $langs->trans('ContractSigned');
|
$this->labelStatusShort[self::STATUS_CONTRACT_SIGNED] = $langs->trans('ContractSigned');
|
||||||
$this->labelStatusShort[self::STATUS_CANCELED] = $langs->trans('Disabled');
|
$this->labelStatusShort[self::STATUS_CANCELED] = $langs->trans('Canceled');
|
||||||
}
|
}
|
||||||
|
|
||||||
$statusType = 'status'.$status;
|
$statusType = 'status'.$status;
|
||||||
|
|||||||
@@ -812,7 +812,6 @@ class RecruitmentJobPosition extends CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
$statusType = 'status'.$status;
|
$statusType = 'status'.$status;
|
||||||
//if ($status == self::STATUS_VALIDATED) $statusType = 'status1';
|
|
||||||
if ($status == self::STATUS_CANCELED) $statusType = 'status6';
|
if ($status == self::STATUS_CANCELED) $statusType = 'status6';
|
||||||
|
|
||||||
return dolGetStatus($this->labelStatus[$status], $this->labelStatusShort[$status], '', $statusType, $mode);
|
return dolGetStatus($this->labelStatus[$status], $this->labelStatusShort[$status], '', $statusType, $mode);
|
||||||
|
|||||||
254
htdocs/recruitment/recruitmentcandidature_agenda.php
Normal file
254
htdocs/recruitment/recruitmentcandidature_agenda.php
Normal file
@@ -0,0 +1,254 @@
|
|||||||
|
<?php
|
||||||
|
/* Copyright (C) 2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
|
* Copyright (C) ---Put here your own copyright and developer email---
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation; either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \file recruitmentcandidature_agenda.php
|
||||||
|
* \ingroup recruitment
|
||||||
|
* \brief Page of RecruitmentCandidature events
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Load Dolibarr environment
|
||||||
|
$res = 0;
|
||||||
|
// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined)
|
||||||
|
if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php";
|
||||||
|
// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME
|
||||||
|
$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1;
|
||||||
|
while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) { $i--; $j--; }
|
||||||
|
if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) $res = @include substr($tmp, 0, ($i + 1))."/main.inc.php";
|
||||||
|
if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php")) $res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php";
|
||||||
|
// Try main.inc.php using relative path
|
||||||
|
if (!$res && file_exists("../main.inc.php")) $res = @include "../main.inc.php";
|
||||||
|
if (!$res && file_exists("../../main.inc.php")) $res = @include "../../main.inc.php";
|
||||||
|
if (!$res && file_exists("../../../main.inc.php")) $res = @include "../../../main.inc.php";
|
||||||
|
if (!$res) die("Include of main fails");
|
||||||
|
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||||
|
dol_include_once('/recruitment/class/recruitmentcandidature.class.php');
|
||||||
|
dol_include_once('/recruitment/lib/recruitment_recruitmentcandidature.lib.php');
|
||||||
|
|
||||||
|
|
||||||
|
// Load translation files required by the page
|
||||||
|
$langs->loadLangs(array("recruitment", "other"));
|
||||||
|
|
||||||
|
// Get parameters
|
||||||
|
$id = GETPOST('id', 'int');
|
||||||
|
$ref = GETPOST('ref', 'alpha');
|
||||||
|
$action = GETPOST('action', 'alpha');
|
||||||
|
$cancel = GETPOST('cancel', 'aZ09');
|
||||||
|
$backtopage = GETPOST('backtopage', 'alpha');
|
||||||
|
|
||||||
|
if (GETPOST('actioncode', 'array')) {
|
||||||
|
$actioncode = GETPOST('actioncode', 'array', 3);
|
||||||
|
if (!count($actioncode)) $actioncode = '0';
|
||||||
|
} else {
|
||||||
|
$actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT));
|
||||||
|
}
|
||||||
|
$search_agenda_label = GETPOST('search_agenda_label');
|
||||||
|
|
||||||
|
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
|
||||||
|
$sortfield = GETPOST("sortfield", 'alpha');
|
||||||
|
$sortorder = GETPOST("sortorder", 'alpha');
|
||||||
|
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||||
|
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
|
||||||
|
$offset = $limit * $page;
|
||||||
|
$pageprev = $page - 1;
|
||||||
|
$pagenext = $page + 1;
|
||||||
|
if (!$sortfield) $sortfield = 'a.datep,a.id';
|
||||||
|
if (!$sortorder) $sortorder = 'DESC,DESC';
|
||||||
|
|
||||||
|
// Initialize technical objects
|
||||||
|
$object = new RecruitmentCandidature($db);
|
||||||
|
$extrafields = new ExtraFields($db);
|
||||||
|
$diroutputmassaction = $conf->recruitment->dir_output.'/temp/massgeneration/'.$user->id;
|
||||||
|
$hookmanager->initHooks(array('recruitmentcandidatureagenda', 'globalcard')); // Note that conf->hooks_modules contains array
|
||||||
|
// Fetch optionals attributes and labels
|
||||||
|
$extrafields->fetch_name_optionals_label($object->table_element);
|
||||||
|
|
||||||
|
// Load object
|
||||||
|
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals
|
||||||
|
if ($id > 0 || !empty($ref)) $upload_dir = $conf->recruitment->multidir_output[$object->entity]."/".$object->id;
|
||||||
|
|
||||||
|
// Security check - Protection if external user
|
||||||
|
//if ($user->socid > 0) accessforbidden();
|
||||||
|
//if ($user->socid > 0) $socid = $user->socid;
|
||||||
|
//$result = restrictedArea($user, 'recruitment', $object->id);
|
||||||
|
|
||||||
|
$permissiontoadd = $user->rights->recruitment->recruitmentjobposition->write; // Used by the include of actions_addupdatedelete.inc.php
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Actions
|
||||||
|
*/
|
||||||
|
|
||||||
|
$parameters = array('id'=>$id);
|
||||||
|
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||||
|
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||||
|
|
||||||
|
if (empty($reshook))
|
||||||
|
{
|
||||||
|
// Cancel
|
||||||
|
if (GETPOST('cancel', 'alpha') && !empty($backtopage))
|
||||||
|
{
|
||||||
|
header("Location: ".$backtopage);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Purge search criteria
|
||||||
|
if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) // All tests are required to be compatible with all browsers
|
||||||
|
{
|
||||||
|
$actioncode = '';
|
||||||
|
$search_agenda_label = '';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* View
|
||||||
|
*/
|
||||||
|
|
||||||
|
$form = new Form($db);
|
||||||
|
|
||||||
|
if ($object->id > 0)
|
||||||
|
{
|
||||||
|
$title = $langs->trans("Agenda");
|
||||||
|
//if (! empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/',$conf->global->MAIN_HTML_TITLE) && $object->name) $title=$object->name." - ".$title;
|
||||||
|
$help_url = '';
|
||||||
|
llxHeader('', $title, $help_url);
|
||||||
|
|
||||||
|
if (!empty($conf->notification->enabled)) $langs->load("mails");
|
||||||
|
$head = recruitmentCandidaturePrepareHead($object);
|
||||||
|
|
||||||
|
|
||||||
|
dol_fiche_head($head, 'agenda', $langs->trans("RecruitmentCandidature"), -1, $object->picto);
|
||||||
|
|
||||||
|
// Object card
|
||||||
|
// ------------------------------------------------------------
|
||||||
|
$linkback = '<a href="'.dol_buildpath('/recruitment/recruitmentcandidature_list.php', 1).'?restore_lastsearch_values=1'.(!empty($socid) ? '&socid='.$socid : '').'">'.$langs->trans("BackToList").'</a>';
|
||||||
|
|
||||||
|
$morehtmlref = '<div class="refidno">';
|
||||||
|
/*
|
||||||
|
// Ref customer
|
||||||
|
$morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1);
|
||||||
|
$morehtmlref.=$form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', null, null, '', 1);
|
||||||
|
// Thirdparty
|
||||||
|
$morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : '');
|
||||||
|
*/
|
||||||
|
// Project
|
||||||
|
/*if (! empty($conf->projet->enabled))
|
||||||
|
{
|
||||||
|
$langs->load("projects");
|
||||||
|
$morehtmlref .= $langs->trans('Project') . ' ';
|
||||||
|
if ($permissiontoadd)
|
||||||
|
{
|
||||||
|
if ($action != 'classify')
|
||||||
|
//$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
||||||
|
$morehtmlref .=' : ';
|
||||||
|
if ($action == 'classify') {
|
||||||
|
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
|
||||||
|
$morehtmlref .= '<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
||||||
|
$morehtmlref .= '<input type="hidden" name="action" value="classin">';
|
||||||
|
$morehtmlref .= '<input type="hidden" name="token" value="'.newToken().'">';
|
||||||
|
$morehtmlref .= $formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
|
||||||
|
$morehtmlref .= '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
|
||||||
|
$morehtmlref .= '</form>';
|
||||||
|
} else {
|
||||||
|
$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (! empty($object->fk_project)) {
|
||||||
|
$proj = new Project($db);
|
||||||
|
$proj->fetch($object->fk_project);
|
||||||
|
$morehtmlref .= ': '.$proj->getNomUrl();
|
||||||
|
} else {
|
||||||
|
$morehtmlref .= '';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}*/
|
||||||
|
$morehtmlref .= '</div>';
|
||||||
|
|
||||||
|
|
||||||
|
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
|
||||||
|
|
||||||
|
print '<div class="fichecenter">';
|
||||||
|
print '<div class="underbanner clearboth"></div>';
|
||||||
|
|
||||||
|
$object->info($object->id);
|
||||||
|
dol_print_object_info($object, 1);
|
||||||
|
|
||||||
|
print '</div>';
|
||||||
|
|
||||||
|
dol_fiche_end();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Actions buttons
|
||||||
|
|
||||||
|
$objthirdparty = $object;
|
||||||
|
$objcon = new stdClass();
|
||||||
|
|
||||||
|
$out = '&origin='.$object->element.'&originid='.$object->id;
|
||||||
|
$permok = $user->rights->agenda->myactions->create;
|
||||||
|
if ((!empty($objthirdparty->id) || !empty($objcon->id)) && $permok)
|
||||||
|
{
|
||||||
|
//$out.='<a href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create';
|
||||||
|
if (get_class($objthirdparty) == 'Societe') $out .= '&socid='.$objthirdparty->id;
|
||||||
|
$out .= (!empty($objcon->id) ? '&contactid='.$objcon->id : '').'&backtopage=1&percentage=-1';
|
||||||
|
//$out.=$langs->trans("AddAnAction").' ';
|
||||||
|
//$out.=img_picto($langs->trans("AddAnAction"),'filenew');
|
||||||
|
//$out.="</a>";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
print '<div class="tabsAction">';
|
||||||
|
|
||||||
|
if (!empty($conf->agenda->enabled))
|
||||||
|
{
|
||||||
|
if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create))
|
||||||
|
{
|
||||||
|
print '<a class="butAction" href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out.'">'.$langs->trans("AddAction").'</a>';
|
||||||
|
} else {
|
||||||
|
print '<a class="butActionRefused classfortooltip" href="#">'.$langs->trans("AddAction").'</a>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
print '</div>';
|
||||||
|
|
||||||
|
if (!empty($conf->agenda->enabled) && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read)))
|
||||||
|
{
|
||||||
|
$param = '&id='.$object->id.'&socid='.$socid;
|
||||||
|
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param .= '&contextpage='.urlencode($contextpage);
|
||||||
|
if ($limit > 0 && $limit != $conf->liste_limit) $param .= '&limit='.urlencode($limit);
|
||||||
|
|
||||||
|
|
||||||
|
//print load_fiche_titre($langs->trans("ActionsOnRecruitmentJobPosition"), '', '');
|
||||||
|
|
||||||
|
// List of all actions
|
||||||
|
$filters = array();
|
||||||
|
$filters['search_agenda_label'] = $search_agenda_label;
|
||||||
|
|
||||||
|
// TODO Replace this with same code than into list.php
|
||||||
|
show_actions_done($conf, $langs, $db, $object, null, 0, $actioncode, '', $filters, $sortfield, $sortorder, 'recruitment');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// End of page
|
||||||
|
llxFooter();
|
||||||
|
$db->close();
|
||||||
@@ -569,8 +569,8 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||||||
$relativepath = $objref . '/' . $objref . '.pdf';
|
$relativepath = $objref . '/' . $objref . '.pdf';
|
||||||
$filedir = $conf->recruitment->dir_output.'/'.$object->element.'/'.$objref;
|
$filedir = $conf->recruitment->dir_output.'/'.$object->element.'/'.$objref;
|
||||||
$urlsource = $_SERVER["PHP_SELF"] . "?id=" . $object->id;
|
$urlsource = $_SERVER["PHP_SELF"] . "?id=" . $object->id;
|
||||||
$genallowed = $user->rights->recruitment->recruitmentcandidature->read; // If you can read, you can build the PDF to read content
|
$genallowed = $user->rights->recruitment->recruitmentjobposition->read; // If you can read, you can build the PDF to read content
|
||||||
$delallowed = $user->rights->recruitment->recruitmentcandidature->write; // If you can create/edit, you can remove a file on card
|
$delallowed = $user->rights->recruitment->recruitmentjobposition->write; // If you can create/edit, you can remove a file on card
|
||||||
print $formfile->showdocuments('recruitment:RecruitmentCandidature', $object->element.'/'.$objref, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf, 1, 0, 0, 28, 0, '', '', '', $langs->defaultlang);
|
print $formfile->showdocuments('recruitment:RecruitmentCandidature', $object->element.'/'.$objref, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf, 1, 0, 0, 28, 0, '', '', '', $langs->defaultlang);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
205
htdocs/recruitment/recruitmentcandidature_document.php
Normal file
205
htdocs/recruitment/recruitmentcandidature_document.php
Normal file
@@ -0,0 +1,205 @@
|
|||||||
|
<?php
|
||||||
|
/* Copyright (C) 2007-2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
|
* Copyright (C) ---Put here your own copyright and developer email---
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation; either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \file recruitmentcandidature_document.php
|
||||||
|
* \ingroup recruitment
|
||||||
|
* \brief Tab for documents linked to RecruitmentCandidature
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Load Dolibarr environment
|
||||||
|
$res = 0;
|
||||||
|
// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined)
|
||||||
|
if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php";
|
||||||
|
// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME
|
||||||
|
$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1;
|
||||||
|
while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) { $i--; $j--; }
|
||||||
|
if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) $res = @include substr($tmp, 0, ($i + 1))."/main.inc.php";
|
||||||
|
if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php")) $res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php";
|
||||||
|
// Try main.inc.php using relative path
|
||||||
|
if (!$res && file_exists("../main.inc.php")) $res = @include "../main.inc.php";
|
||||||
|
if (!$res && file_exists("../../main.inc.php")) $res = @include "../../main.inc.php";
|
||||||
|
if (!$res && file_exists("../../../main.inc.php")) $res = @include "../../../main.inc.php";
|
||||||
|
if (!$res) die("Include of main fails");
|
||||||
|
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
|
||||||
|
dol_include_once('/recruitment/class/recruitmentcandidature.class.php');
|
||||||
|
dol_include_once('/recruitment/lib/recruitment_recruitmentcandidature.lib.php');
|
||||||
|
|
||||||
|
// Load translation files required by the page
|
||||||
|
$langs->loadLangs(array("recruitment", "companies", "other", "mails"));
|
||||||
|
|
||||||
|
|
||||||
|
$action = GETPOST('action', 'aZ09');
|
||||||
|
$confirm = GETPOST('confirm');
|
||||||
|
$id = (GETPOST('socid', 'int') ? GETPOST('socid', 'int') : GETPOST('id', 'int'));
|
||||||
|
$ref = GETPOST('ref', 'alpha');
|
||||||
|
|
||||||
|
// Get parameters
|
||||||
|
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
|
||||||
|
$sortfield = GETPOST("sortfield", 'alpha');
|
||||||
|
$sortorder = GETPOST("sortorder", 'alpha');
|
||||||
|
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||||
|
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
|
||||||
|
$offset = $liste_limit * $page;
|
||||||
|
$pageprev = $page - 1;
|
||||||
|
$pagenext = $page + 1;
|
||||||
|
if (!$sortorder) $sortorder = "ASC";
|
||||||
|
if (!$sortfield) $sortfield = "name";
|
||||||
|
//if (! $sortfield) $sortfield="position_name";
|
||||||
|
|
||||||
|
// Initialize technical objects
|
||||||
|
$object = new RecruitmentCandidature($db);
|
||||||
|
$extrafields = new ExtraFields($db);
|
||||||
|
$diroutputmassaction = $conf->recruitment->dir_output.'/temp/massgeneration/'.$user->id;
|
||||||
|
$hookmanager->initHooks(array('recruitmentcandidaturedocument', 'globalcard')); // Note that conf->hooks_modules contains array
|
||||||
|
// Fetch optionals attributes and labels
|
||||||
|
$extrafields->fetch_name_optionals_label($object->table_element);
|
||||||
|
|
||||||
|
// Load object
|
||||||
|
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals
|
||||||
|
|
||||||
|
if ($id > 0 || !empty($ref)) $upload_dir = $conf->recruitment->multidir_output[$object->entity ? $object->entity : $conf->entity]."/recruitmentcandidature/".dol_sanitizeFileName($object->ref);
|
||||||
|
|
||||||
|
// Security check - Protection if external user
|
||||||
|
//if ($user->socid > 0) accessforbidden();
|
||||||
|
//if ($user->socid > 0) $socid = $user->socid;
|
||||||
|
//$result = restrictedArea($user, 'recruitment', $object->id);
|
||||||
|
|
||||||
|
$permissiontoadd = $user->rights->recruitment->recruitmentjobposition->write; // Used by the include of actions_addupdatedelete.inc.php
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Actions
|
||||||
|
*/
|
||||||
|
|
||||||
|
include_once DOL_DOCUMENT_ROOT.'/core/actions_linkedfiles.inc.php';
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* View
|
||||||
|
*/
|
||||||
|
|
||||||
|
$form = new Form($db);
|
||||||
|
|
||||||
|
$title = $langs->trans("RecruitmentJobPosition").' - '.$langs->trans("Files");
|
||||||
|
$help_url = '';
|
||||||
|
//$help_url='EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas';
|
||||||
|
llxHeader('', $title, $help_url);
|
||||||
|
|
||||||
|
if ($object->id)
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
* Show tabs
|
||||||
|
*/
|
||||||
|
$head = recruitmentCandidaturePrepareHead($object);
|
||||||
|
|
||||||
|
dol_fiche_head($head, 'document', $langs->trans("RecruitmentCandidature"), -1, $object->picto);
|
||||||
|
|
||||||
|
|
||||||
|
// Build file list
|
||||||
|
$filearray = dol_dir_list($upload_dir, "files", 0, '', '(\.meta|_preview.*\.png)$', $sortfield, (strtolower($sortorder) == 'desc' ?SORT_DESC:SORT_ASC), 1);
|
||||||
|
$totalsize = 0;
|
||||||
|
foreach ($filearray as $key => $file)
|
||||||
|
{
|
||||||
|
$totalsize += $file['size'];
|
||||||
|
}
|
||||||
|
|
||||||
|
// Object card
|
||||||
|
// ------------------------------------------------------------
|
||||||
|
$linkback = '<a href="'.dol_buildpath('/recruitment/recruitmentcandidature_list.php', 1).'?restore_lastsearch_values=1'.(!empty($socid) ? '&socid='.$socid : '').'">'.$langs->trans("BackToList").'</a>';
|
||||||
|
|
||||||
|
$morehtmlref = '<div class="refidno">';
|
||||||
|
/*
|
||||||
|
// Ref customer
|
||||||
|
$morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1);
|
||||||
|
$morehtmlref.=$form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', null, null, '', 1);
|
||||||
|
// Thirdparty
|
||||||
|
$morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : '');
|
||||||
|
*/
|
||||||
|
// Project
|
||||||
|
/*if (! empty($conf->projet->enabled))
|
||||||
|
{
|
||||||
|
$langs->load("projects");
|
||||||
|
$morehtmlref .= $langs->trans('Project') . ' ';
|
||||||
|
if ($permissiontoadd)
|
||||||
|
{
|
||||||
|
if ($action != 'classify')
|
||||||
|
//$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
||||||
|
$morehtmlref .=' : ';
|
||||||
|
if ($action == 'classify') {
|
||||||
|
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
|
||||||
|
$morehtmlref .= '<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
||||||
|
$morehtmlref .= '<input type="hidden" name="action" value="classin">';
|
||||||
|
$morehtmlref .= '<input type="hidden" name="token" value="'.newToken().'">';
|
||||||
|
$morehtmlref .= $formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
|
||||||
|
$morehtmlref .= '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
|
||||||
|
$morehtmlref .= '</form>';
|
||||||
|
} else {
|
||||||
|
$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (! empty($object->fk_project)) {
|
||||||
|
$proj = new Project($db);
|
||||||
|
$proj->fetch($object->fk_project);
|
||||||
|
$morehtmlref .= ': '.$proj->getNomUrl();
|
||||||
|
} else {
|
||||||
|
$morehtmlref .= '';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}*/
|
||||||
|
$morehtmlref .= '</div>';
|
||||||
|
|
||||||
|
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
|
||||||
|
|
||||||
|
print '<div class="fichecenter">';
|
||||||
|
|
||||||
|
print '<div class="underbanner clearboth"></div>';
|
||||||
|
print '<table class="border centpercent tableforfield">';
|
||||||
|
|
||||||
|
// Number of files
|
||||||
|
print '<tr><td class="titlefield">'.$langs->trans("NbOfAttachedFiles").'</td><td colspan="3">'.count($filearray).'</td></tr>';
|
||||||
|
|
||||||
|
// Total size
|
||||||
|
print '<tr><td>'.$langs->trans("TotalSizeOfAttachedFiles").'</td><td colspan="3">'.$totalsize.' '.$langs->trans("bytes").'</td></tr>';
|
||||||
|
|
||||||
|
print '</table>';
|
||||||
|
|
||||||
|
print '</div>';
|
||||||
|
|
||||||
|
dol_fiche_end();
|
||||||
|
|
||||||
|
$modulepart = 'recruitment';
|
||||||
|
$permission = $user->rights->recruitment->recruitmentjobposition->write;
|
||||||
|
$permtoedit = $user->rights->recruitment->recruitmentjobposition->write;
|
||||||
|
$param = '&id='.$object->id;
|
||||||
|
|
||||||
|
$relativepathwithnofile = 'recruitmentcandidature/'.dol_sanitizeFileName($object->ref).'/';
|
||||||
|
|
||||||
|
include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
|
||||||
|
} else {
|
||||||
|
accessforbidden('', 0, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
// End of page
|
||||||
|
llxFooter();
|
||||||
|
$db->close();
|
||||||
163
htdocs/recruitment/recruitmentcandidature_note.php
Normal file
163
htdocs/recruitment/recruitmentcandidature_note.php
Normal file
@@ -0,0 +1,163 @@
|
|||||||
|
<?php
|
||||||
|
/* Copyright (C) 2007-2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
|
* Copyright (C) ---Put here your own copyright and developer email---
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation; either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \file recruitmentcandidature_note.php
|
||||||
|
* \ingroup recruitment
|
||||||
|
* \brief Car with notes on RecruitmentCandidature
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Load Dolibarr environment
|
||||||
|
$res = 0;
|
||||||
|
// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined)
|
||||||
|
if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php";
|
||||||
|
// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME
|
||||||
|
$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1;
|
||||||
|
while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) { $i--; $j--; }
|
||||||
|
if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) $res = @include substr($tmp, 0, ($i + 1))."/main.inc.php";
|
||||||
|
if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php")) $res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php";
|
||||||
|
// Try main.inc.php using relative path
|
||||||
|
if (!$res && file_exists("../main.inc.php")) $res = @include "../main.inc.php";
|
||||||
|
if (!$res && file_exists("../../main.inc.php")) $res = @include "../../main.inc.php";
|
||||||
|
if (!$res && file_exists("../../../main.inc.php")) $res = @include "../../../main.inc.php";
|
||||||
|
if (!$res) die("Include of main fails");
|
||||||
|
|
||||||
|
dol_include_once('/recruitment/class/recruitmentcandidature.class.php');
|
||||||
|
dol_include_once('/recruitment/lib/recruitment_recruitmentcandidature.lib.php');
|
||||||
|
|
||||||
|
// Load translation files required by the page
|
||||||
|
$langs->loadLangs(array("recruitment", "companies"));
|
||||||
|
|
||||||
|
// Get parameters
|
||||||
|
$id = GETPOST('id', 'int');
|
||||||
|
$ref = GETPOST('ref', 'alpha');
|
||||||
|
$action = GETPOST('action', 'alpha');
|
||||||
|
$cancel = GETPOST('cancel', 'aZ09');
|
||||||
|
$backtopage = GETPOST('backtopage', 'alpha');
|
||||||
|
|
||||||
|
// Initialize technical objects
|
||||||
|
$object = new RecruitmentCandidature($db);
|
||||||
|
$extrafields = new ExtraFields($db);
|
||||||
|
$diroutputmassaction = $conf->recruitment->dir_output.'/temp/massgeneration/'.$user->id;
|
||||||
|
$hookmanager->initHooks(array('recruitmentjobpositionnote', 'globalcard')); // Note that conf->hooks_modules contains array
|
||||||
|
// Fetch optionals attributes and labels
|
||||||
|
$extrafields->fetch_name_optionals_label($object->table_element);
|
||||||
|
|
||||||
|
// Security check - Protection if external user
|
||||||
|
//if ($user->socid > 0) accessforbidden();
|
||||||
|
//if ($user->socid > 0) $socid = $user->socid;
|
||||||
|
//$result = restrictedArea($user, 'recruitment', $id);
|
||||||
|
|
||||||
|
// Load object
|
||||||
|
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals
|
||||||
|
if ($id > 0 || !empty($ref)) $upload_dir = $conf->recruitment->multidir_output[$object->entity]."/".$object->id;
|
||||||
|
|
||||||
|
$permissionnote = $user->rights->recruitment->recruitmentjobposition->write; // Used by the include of actions_setnotes.inc.php
|
||||||
|
$permissiontoadd = $user->rights->recruitment->recruitmentjobposition->write; // Used by the include of actions_addupdatedelete.inc.php
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Actions
|
||||||
|
*/
|
||||||
|
|
||||||
|
include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* View
|
||||||
|
*/
|
||||||
|
|
||||||
|
$form = new Form($db);
|
||||||
|
|
||||||
|
//$help_url='EN:Customers_Orders|FR:Commandes_Clients|ES:Pedidos de clientes';
|
||||||
|
$help_url = '';
|
||||||
|
llxHeader('', $langs->trans('RecruitmentCandidature'), $help_url);
|
||||||
|
|
||||||
|
if ($id > 0 || !empty($ref))
|
||||||
|
{
|
||||||
|
$object->fetch_thirdparty();
|
||||||
|
|
||||||
|
$head = recruitmentCandidaturePrepareHead($object);
|
||||||
|
|
||||||
|
dol_fiche_head($head, 'note', $langs->trans("RecruitmentCandidature"), -1, $object->picto);
|
||||||
|
|
||||||
|
// Object card
|
||||||
|
// ------------------------------------------------------------
|
||||||
|
$linkback = '<a href="'.dol_buildpath('/recruitment/recruitmentjobposition_list.php', 1).'?restore_lastsearch_values=1'.(!empty($socid) ? '&socid='.$socid : '').'">'.$langs->trans("BackToList").'</a>';
|
||||||
|
|
||||||
|
$morehtmlref = '<div class="refidno">';
|
||||||
|
/*
|
||||||
|
// Ref customer
|
||||||
|
$morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1);
|
||||||
|
$morehtmlref.=$form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', null, null, '', 1);
|
||||||
|
// Thirdparty
|
||||||
|
$morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : '');
|
||||||
|
*/
|
||||||
|
// Project
|
||||||
|
/*if (! empty($conf->projet->enabled))
|
||||||
|
{
|
||||||
|
$langs->load("projects");
|
||||||
|
$morehtmlref .= $langs->trans('Project') . ' ';
|
||||||
|
if ($permissiontoadd)
|
||||||
|
{
|
||||||
|
if ($action != 'classify')
|
||||||
|
//$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
||||||
|
$morehtmlref .=' : ';
|
||||||
|
if ($action == 'classify') {
|
||||||
|
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
|
||||||
|
$morehtmlref .= '<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
||||||
|
$morehtmlref .= '<input type="hidden" name="action" value="classin">';
|
||||||
|
$morehtmlref .= '<input type="hidden" name="token" value="'.newToken().'">';
|
||||||
|
$morehtmlref .= $formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
|
||||||
|
$morehtmlref .= '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
|
||||||
|
$morehtmlref .= '</form>';
|
||||||
|
} else {
|
||||||
|
$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (! empty($object->fk_project)) {
|
||||||
|
$proj = new Project($db);
|
||||||
|
$proj->fetch($object->fk_project);
|
||||||
|
$morehtmlref .= ': '.$proj->getNomUrl();
|
||||||
|
} else {
|
||||||
|
$morehtmlref .= '';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}*/
|
||||||
|
$morehtmlref .= '</div>';
|
||||||
|
|
||||||
|
|
||||||
|
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
|
||||||
|
|
||||||
|
|
||||||
|
print '<div class="fichecenter">';
|
||||||
|
print '<div class="underbanner clearboth"></div>';
|
||||||
|
|
||||||
|
|
||||||
|
$cssclass = "titlefield";
|
||||||
|
include DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php';
|
||||||
|
|
||||||
|
print '</div>';
|
||||||
|
|
||||||
|
dol_fiche_end();
|
||||||
|
}
|
||||||
|
|
||||||
|
// End of page
|
||||||
|
llxFooter();
|
||||||
|
$db->close();
|
||||||
@@ -26,6 +26,7 @@
|
|||||||
|
|
||||||
require '../main.inc.php';
|
require '../main.inc.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/recruitment/class/recruitmentjobposition.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/recruitment/class/recruitmentjobposition.class.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/recruitment/class/recruitmentcandidature.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
|
||||||
|
|
||||||
// Load translation files required by the page
|
// Load translation files required by the page
|
||||||
@@ -61,6 +62,7 @@ $now = dol_now();
|
|||||||
$form = new Form($db);
|
$form = new Form($db);
|
||||||
$formfile = new FormFile($db);
|
$formfile = new FormFile($db);
|
||||||
$staticrecruitmentjobposition = new RecruitmentJobPosition($db);
|
$staticrecruitmentjobposition = new RecruitmentJobPosition($db);
|
||||||
|
$staticrecruitmentcandidature = new RecruitmentCandidature($db);
|
||||||
|
|
||||||
llxHeader("", $langs->trans("RecruitmentArea"));
|
llxHeader("", $langs->trans("RecruitmentArea"));
|
||||||
|
|
||||||
@@ -108,11 +110,11 @@ if ($conf->use_javascript_ajax)
|
|||||||
|
|
||||||
print '<div class="div-table-responsive-no-min">';
|
print '<div class="div-table-responsive-no-min">';
|
||||||
print '<table class="noborder nohover centpercent">';
|
print '<table class="noborder nohover centpercent">';
|
||||||
print '<tr class="liste_titre"><th colspan="2">'.$langs->trans("Statistics").' - '.$langs->trans("Recruitment").'</th></tr>'."\n";
|
print '<tr class="liste_titre"><th colspan="2">'.$langs->trans("Statistics").' - '.$langs->trans("JobPositions").'</th></tr>'."\n";
|
||||||
$listofstatus = array(0, 1, 3, 9);
|
$listofstatus = array(0, 1, 3, 9);
|
||||||
foreach ($listofstatus as $status)
|
foreach ($listofstatus as $status)
|
||||||
{
|
{
|
||||||
$dataseries[] = array($staticrecruitmentjobposition->LibStatut($status, 1), (isset($vals[$status]) ? (int) $vals[$status] : 0));
|
$dataseries[] = array(dol_html_entity_decode($staticrecruitmentjobposition->LibStatut($status, 1), ENT_QUOTES), (isset($vals[$status]) ? (int) $vals[$status] : 0));
|
||||||
if ($status == RecruitmentJobPosition::STATUS_DRAFT) $colorseries[$status] = '-'.$badgeStatus0;
|
if ($status == RecruitmentJobPosition::STATUS_DRAFT) $colorseries[$status] = '-'.$badgeStatus0;
|
||||||
if ($status == RecruitmentJobPosition::STATUS_VALIDATED) $colorseries[$status] = $badgeStatus1;
|
if ($status == RecruitmentJobPosition::STATUS_VALIDATED) $colorseries[$status] = $badgeStatus1;
|
||||||
if ($status == RecruitmentJobPosition::STATUS_RECRUITED) $colorseries[$status] = $badgeStatus4;
|
if ($status == RecruitmentJobPosition::STATUS_RECRUITED) $colorseries[$status] = $badgeStatus4;
|
||||||
@@ -150,6 +152,84 @@ if ($conf->use_javascript_ajax)
|
|||||||
} else {
|
} else {
|
||||||
dol_print_error($db);
|
dol_print_error($db);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$sql = "SELECT COUNT(t.rowid) as nb, status";
|
||||||
|
$sql .= " FROM ".MAIN_DB_PREFIX."recruitment_recruitmentcandidature as t";
|
||||||
|
$sql .= " GROUP BY t.status";
|
||||||
|
$sql .= " ORDER BY t.status ASC";
|
||||||
|
$resql = $db->query($sql);
|
||||||
|
|
||||||
|
if ($resql)
|
||||||
|
{
|
||||||
|
$num = $db->num_rows($resql);
|
||||||
|
$i = 0;
|
||||||
|
|
||||||
|
$totalnb = 0;
|
||||||
|
$dataseries = array();
|
||||||
|
$colorseries = array();
|
||||||
|
$vals = array();
|
||||||
|
|
||||||
|
include_once DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/theme_vars.inc.php';
|
||||||
|
|
||||||
|
while ($i < $num)
|
||||||
|
{
|
||||||
|
$obj = $db->fetch_object($resql);
|
||||||
|
if ($obj)
|
||||||
|
{
|
||||||
|
$vals[$obj->status] = $obj->nb;
|
||||||
|
|
||||||
|
$totalnb += $obj->nb;
|
||||||
|
}
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
|
$db->free($resql);
|
||||||
|
|
||||||
|
print '<div class="div-table-responsive-no-min">';
|
||||||
|
print '<table class="noborder nohover centpercent">';
|
||||||
|
print '<tr class="liste_titre"><th colspan="2">'.$langs->trans("Statistics").' - '.$langs->trans("Candidatures").'</th></tr>'."\n";
|
||||||
|
$listofstatus = array(0, 1, 3, 5, 8, 9);
|
||||||
|
foreach ($listofstatus as $status)
|
||||||
|
{
|
||||||
|
$dataseries[] = array(dol_html_entity_decode($staticrecruitmentcandidature->LibStatut($status, 1), ENT_QUOTES), (isset($vals[$status]) ? (int) $vals[$status] : 0));
|
||||||
|
if ($status == RecruitmentCandidature::STATUS_DRAFT) $colorseries[$status] = '-'.$badgeStatus0;
|
||||||
|
if ($status == RecruitmentCandidature::STATUS_VALIDATED) $colorseries[$status] = $badgeStatus1;
|
||||||
|
if ($status == RecruitmentCandidature::STATUS_CONTRACT_PROPOSED) $colorseries[$status] = $badgeStatus4;
|
||||||
|
if ($status == RecruitmentCandidature::STATUS_CONTRACT_SIGNED) $colorseries[$status] = $badgeStatus5;
|
||||||
|
if ($status == RecruitmentCandidature::STATUS_REFUSED) $colorseries[$status] = $badgeStatus8;
|
||||||
|
if ($status == RecruitmentCandidature::STATUS_CANCELED) $colorseries[$status] = $badgeStatus9;
|
||||||
|
|
||||||
|
if (empty($conf->use_javascript_ajax))
|
||||||
|
{
|
||||||
|
print '<tr class="oddeven">';
|
||||||
|
print '<td>'.$staticrecruitmentcandidature->LibStatut($status, 0).'</td>';
|
||||||
|
print '<td class="right"><a href="list.php?statut='.$status.'">'.(isset($vals[$status]) ? $vals[$status] : 0).'</a></td>';
|
||||||
|
print "</tr>\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ($conf->use_javascript_ajax)
|
||||||
|
{
|
||||||
|
print '<tr><td class="center" colspan="2">';
|
||||||
|
|
||||||
|
include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php';
|
||||||
|
$dolgraph = new DolGraph();
|
||||||
|
$dolgraph->SetData($dataseries);
|
||||||
|
$dolgraph->SetDataColor(array_values($colorseries));
|
||||||
|
$dolgraph->setShowLegend(2);
|
||||||
|
$dolgraph->setShowPercent(1);
|
||||||
|
$dolgraph->SetType(array('pie'));
|
||||||
|
$dolgraph->SetHeight('200');
|
||||||
|
$dolgraph->draw('idgraphstatuscandidature');
|
||||||
|
print $dolgraph->show($totalnb ? 0 : 1);
|
||||||
|
|
||||||
|
print '</td></tr>';
|
||||||
|
}
|
||||||
|
print "</table>";
|
||||||
|
print "</div>";
|
||||||
|
|
||||||
|
print "<br>";
|
||||||
|
} else {
|
||||||
|
dol_print_error($db);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
print '<br>';
|
print '<br>';
|
||||||
@@ -240,8 +320,7 @@ print '</div><div class="fichetwothirdright"><div class="ficheaddleft">';
|
|||||||
$NBMAX = 3;
|
$NBMAX = 3;
|
||||||
$max = 3;
|
$max = 3;
|
||||||
|
|
||||||
/* BEGIN MODULEBUILDER LASTMODIFIED MYOBJECT */
|
// Last modified job position
|
||||||
// Last modified myobject
|
|
||||||
if (! empty($conf->recruitment->enabled) && $user->rights->recruitment->recruitmentjobposition->read)
|
if (! empty($conf->recruitment->enabled) && $user->rights->recruitment->recruitmentjobposition->read)
|
||||||
{
|
{
|
||||||
$sql = "SELECT s.rowid, s.ref, s.label, s.date_creation, s.tms";
|
$sql = "SELECT s.rowid, s.ref, s.label, s.date_creation, s.tms";
|
||||||
@@ -264,7 +343,7 @@ if (! empty($conf->recruitment->enabled) && $user->rights->recruitment->recruitm
|
|||||||
print '<th colspan="2">';
|
print '<th colspan="2">';
|
||||||
print $langs->trans("BoxTitleLatestModifiedJobPositions", $max);
|
print $langs->trans("BoxTitleLatestModifiedJobPositions", $max);
|
||||||
print '</th>';
|
print '</th>';
|
||||||
print '<th class="right">'.$langs->trans("DateModificationShort").'</th>';
|
print '<th class="right"><a href="'.DOL_URL_ROOT.'/recruitment/recruitmentjobposition_list.php?sortfield=t.tms&sortorder=DESC">'.$langs->trans("FullList").'</th>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
if ($num)
|
if ($num)
|
||||||
{
|
{
|
||||||
@@ -296,6 +375,60 @@ if (! empty($conf->recruitment->enabled) && $user->rights->recruitment->recruitm
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Last modified job position
|
||||||
|
if (! empty($conf->recruitment->enabled) && $user->rights->recruitment->recruitmentjobposition->read)
|
||||||
|
{
|
||||||
|
$sql = "SELECT rc.rowid, rc.ref, rc.date_creation, rc.tms";
|
||||||
|
$sql.= " FROM ".MAIN_DB_PREFIX."recruitment_recruitmentcandidature as rc";
|
||||||
|
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."recruitment_recruitmentjobposition as s ON rc.fk_recruitmentjobposition = s.rowid";
|
||||||
|
if (! $user->rights->societe->client->voir && ! $socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||||
|
$sql.= " WHERE rc.entity IN (".getEntity($staticrecruitmentjobposition->element).")";
|
||||||
|
if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND s.fk_soc = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||||
|
if ($socid) $sql.= " AND s.fk_soc = $socid";
|
||||||
|
$sql .= " ORDER BY rc.tms DESC";
|
||||||
|
$sql .= $db->plimit($max, 0);
|
||||||
|
|
||||||
|
$resql = $db->query($sql);
|
||||||
|
if ($resql)
|
||||||
|
{
|
||||||
|
$num = $db->num_rows($resql);
|
||||||
|
$i = 0;
|
||||||
|
|
||||||
|
print '<table class="noborder centpercent">';
|
||||||
|
print '<tr class="liste_titre">';
|
||||||
|
print '<th colspan="2">';
|
||||||
|
print $langs->trans("BoxTitleLatestModifiedCandidatures", $max);
|
||||||
|
print '</th>';
|
||||||
|
print '<th class="right"><a href="'.DOL_URL_ROOT.'/recruitment/recruitmentcandidature_list.php?sortfield=t.tms&sortorder=DESC">'.$langs->trans("FullList").'</th>';
|
||||||
|
print '</tr>';
|
||||||
|
if ($num)
|
||||||
|
{
|
||||||
|
while ($i < $num)
|
||||||
|
{
|
||||||
|
$objp = $db->fetch_object($resql);
|
||||||
|
$staticrecruitmentcandidature->id=$objp->rowid;
|
||||||
|
$staticrecruitmentcandidature->ref=$objp->ref;
|
||||||
|
$staticrecruitmentcandidature->status = $objp->status;
|
||||||
|
$staticrecruitmentcandidature->date_creation = $objp->date_creation;
|
||||||
|
|
||||||
|
print '<tr class="oddeven">';
|
||||||
|
print '<td class="nowrap">'.$staticrecruitmentcandidature->getNomUrl(1, '').'</td>';
|
||||||
|
print '<td class="right nowrap">';
|
||||||
|
print "</td>";
|
||||||
|
print '<td class="right nowrap">'.dol_print_date($db->jdate($objp->tms), 'day')."</td>";
|
||||||
|
print '</tr>';
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
|
|
||||||
|
$db->free($resql);
|
||||||
|
} else {
|
||||||
|
print '<tr class="oddeven"><td colspan="3" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
|
||||||
|
}
|
||||||
|
print "</table><br>";
|
||||||
|
} else {
|
||||||
|
dol_print_error($db);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
print '</div></div></div>';
|
print '</div></div></div>';
|
||||||
|
|
||||||
|
|||||||
@@ -77,7 +77,6 @@ $extrafields->fetch_name_optionals_label($object->table_element);
|
|||||||
// Load object
|
// Load object
|
||||||
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals
|
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals
|
||||||
|
|
||||||
//if ($id > 0 || ! empty($ref)) $upload_dir = $conf->recruitment->multidir_output[$object->entity?$object->entity:$conf->entity] . "/recruitmentjobposition/" . dol_sanitizeFileName($object->id);
|
|
||||||
if ($id > 0 || !empty($ref)) $upload_dir = $conf->recruitment->multidir_output[$object->entity ? $object->entity : $conf->entity]."/recruitmentjobposition/".dol_sanitizeFileName($object->ref);
|
if ($id > 0 || !empty($ref)) $upload_dir = $conf->recruitment->multidir_output[$object->entity ? $object->entity : $conf->entity]."/recruitmentjobposition/".dol_sanitizeFileName($object->ref);
|
||||||
|
|
||||||
// Security check - Protection if external user
|
// Security check - Protection if external user
|
||||||
@@ -190,10 +189,8 @@ if ($object->id)
|
|||||||
dol_fiche_end();
|
dol_fiche_end();
|
||||||
|
|
||||||
$modulepart = 'recruitment';
|
$modulepart = 'recruitment';
|
||||||
//$permission = $user->rights->recruitment->recruitmentjobposition->write;
|
$permission = $user->rights->recruitment->recruitmentjobposition->write;
|
||||||
$permission = 1;
|
$permtoedit = $user->rights->recruitment->recruitmentjobposition->write;
|
||||||
//$permtoedit = $user->rights->recruitment->recruitmentjobposition->write;
|
|
||||||
$permtoedit = 1;
|
|
||||||
$param = '&id='.$object->id;
|
$param = '&id='.$object->id;
|
||||||
|
|
||||||
//$relativepathwithnofile='recruitmentjobposition/' . dol_sanitizeFileName($object->id).'/';
|
//$relativepathwithnofile='recruitmentjobposition/' . dol_sanitizeFileName($object->id).'/';
|
||||||
|
|||||||
@@ -58,8 +58,6 @@ $linkback = '';
|
|||||||
print load_fiche_titre($transAreaType, $linkback, 'companies');
|
print load_fiche_titre($transAreaType, $linkback, 'companies');
|
||||||
|
|
||||||
|
|
||||||
//print '<table border="0" width="100%" class="notopnoleftnoright">';
|
|
||||||
//print '<tr><td valign="top" width="30%" class="notopnoleft">';
|
|
||||||
print '<div class="fichecenter"><div class="fichethirdleft">';
|
print '<div class="fichecenter"><div class="fichethirdleft">';
|
||||||
|
|
||||||
|
|
||||||
@@ -220,7 +218,6 @@ if (!empty($conf->categorie->enabled) && !empty($conf->global->CATEGORY_GRAPHSTA
|
|||||||
print '</div>';
|
print '</div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
//print '</td><td valign="top" width="70%" class="notopnoleftnoright">';
|
|
||||||
print '</div><div class="fichetwothirdright"><div class="ficheaddleft">';
|
print '</div><div class="fichetwothirdright"><div class="ficheaddleft">';
|
||||||
|
|
||||||
|
|
||||||
@@ -331,7 +328,6 @@ if ($result)
|
|||||||
dol_print_error($db);
|
dol_print_error($db);
|
||||||
}
|
}
|
||||||
|
|
||||||
//print '</td></tr></table>';
|
|
||||||
print '</div></div></div>';
|
print '</div></div></div>';
|
||||||
|
|
||||||
$parameters = array('user' => $user);
|
$parameters = array('user' => $user);
|
||||||
|
|||||||
Reference in New Issue
Block a user