Work on recruitment module
This commit is contained in:
parent
cd89538ee9
commit
e830e7f3d3
@ -81,6 +81,7 @@ ALTER TABLE llx_c_incoterms ADD COLUMN label varchar(100) NULL;
|
|||||||
CREATE TABLE llx_recruitment_recruitmentjobposition(
|
CREATE TABLE llx_recruitment_recruitmentjobposition(
|
||||||
rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL,
|
rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL,
|
||||||
ref varchar(128) DEFAULT '(PROV)' NOT NULL,
|
ref varchar(128) DEFAULT '(PROV)' NOT NULL,
|
||||||
|
entity INTEGER DEFAULT 1 NOT NULL,
|
||||||
label varchar(255) NOT NULL,
|
label varchar(255) NOT NULL,
|
||||||
qty integer DEFAULT 1 NOT NULL,
|
qty integer DEFAULT 1 NOT NULL,
|
||||||
fk_soc integer,
|
fk_soc integer,
|
||||||
@ -89,6 +90,7 @@ CREATE TABLE llx_recruitment_recruitmentjobposition(
|
|||||||
fk_user_supervisor integer,
|
fk_user_supervisor integer,
|
||||||
fk_establishment integer,
|
fk_establishment integer,
|
||||||
date_planned date,
|
date_planned date,
|
||||||
|
remuneration_suggested varchar(255),
|
||||||
description text,
|
description text,
|
||||||
note_public text,
|
note_public text,
|
||||||
note_private text,
|
note_private text,
|
||||||
@ -113,6 +115,8 @@ ALTER TABLE llx_recruitment_recruitmentjobposition ADD CONSTRAINT llx_recruitmen
|
|||||||
ALTER TABLE llx_recruitment_recruitmentjobposition ADD INDEX idx_recruitment_recruitmentjobposition_status (status);
|
ALTER TABLE llx_recruitment_recruitmentjobposition ADD INDEX idx_recruitment_recruitmentjobposition_status (status);
|
||||||
|
|
||||||
ALTER TABLE llx_recruitment_recruitmentjobposition ADD COLUMN email_recruiter varchar(255);
|
ALTER TABLE llx_recruitment_recruitmentjobposition ADD COLUMN email_recruiter varchar(255);
|
||||||
|
ALTER TABLE llx_recruitment_recruitmentjobposition ADD COLUMN entity INTEGER DEFAULT 1 NOT NULL;
|
||||||
|
ALTER TABLE llx_recruitment_recruitmentjobposition ADD COLUMN remuneration_suggested varchar(255);
|
||||||
|
|
||||||
create table llx_recruitment_recruitmentjobposition_extrafields
|
create table llx_recruitment_recruitmentjobposition_extrafields
|
||||||
(
|
(
|
||||||
|
|||||||
@ -18,6 +18,7 @@ CREATE TABLE llx_recruitment_recruitmentjobposition(
|
|||||||
-- BEGIN MODULEBUILDER FIELDS
|
-- BEGIN MODULEBUILDER FIELDS
|
||||||
rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL,
|
rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL,
|
||||||
ref varchar(128) DEFAULT '(PROV)' NOT NULL,
|
ref varchar(128) DEFAULT '(PROV)' NOT NULL,
|
||||||
|
entity INTEGER DEFAULT 1 NOT NULL,
|
||||||
label varchar(255) NOT NULL,
|
label varchar(255) NOT NULL,
|
||||||
qty integer DEFAULT 1 NOT NULL,
|
qty integer DEFAULT 1 NOT NULL,
|
||||||
fk_soc integer,
|
fk_soc integer,
|
||||||
@ -27,6 +28,7 @@ CREATE TABLE llx_recruitment_recruitmentjobposition(
|
|||||||
fk_user_supervisor integer,
|
fk_user_supervisor integer,
|
||||||
fk_establishment integer,
|
fk_establishment integer,
|
||||||
date_planned date,
|
date_planned date,
|
||||||
|
remuneration_suggested varchar(255),
|
||||||
description text,
|
description text,
|
||||||
note_public text,
|
note_public text,
|
||||||
note_private text,
|
note_private text,
|
||||||
|
|||||||
@ -83,6 +83,7 @@ BoxTitleLatestModifiedSupplierOrders=Vendor Orders: last %s modified
|
|||||||
BoxTitleLastModifiedCustomerBills=Customer Invoices: last %s modified
|
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
|
||||||
ForCustomersInvoices=Customers invoices
|
ForCustomersInvoices=Customers invoices
|
||||||
ForCustomersOrders=Customers orders
|
ForCustomersOrders=Customers orders
|
||||||
ForProposals=Proposals
|
ForProposals=Proposals
|
||||||
|
|||||||
@ -106,7 +106,7 @@ if (! empty($conf->mymodule->enabled) && $user->rights->mymodule->read)
|
|||||||
|
|
||||||
print '<table class="noborder centpercent">';
|
print '<table class="noborder centpercent">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<th colspan="3">'.$langs->trans("DraftOrders").($num?'<span class="badge marginleftonlyshort">'.$num.'</span>':'').'</th></tr>';
|
print '<th colspan="3">'.$langs->trans("DraftMyObjects").($num?'<span class="badge marginleftonlyshort">'.$num.'</span>':'').'</th></tr>';
|
||||||
|
|
||||||
$var = true;
|
$var = true;
|
||||||
if ($num > 0)
|
if ($num > 0)
|
||||||
@ -117,22 +117,17 @@ if (! empty($conf->mymodule->enabled) && $user->rights->mymodule->read)
|
|||||||
|
|
||||||
$obj = $db->fetch_object($resql);
|
$obj = $db->fetch_object($resql);
|
||||||
print '<tr class="oddeven"><td class="nowrap">';
|
print '<tr class="oddeven"><td class="nowrap">';
|
||||||
$orderstatic->id=$obj->rowid;
|
|
||||||
$orderstatic->ref=$obj->ref;
|
$myobjectstatic->id=$obj->rowid;
|
||||||
$orderstatic->ref_client=$obj->ref_client;
|
$myobjectstatic->ref=$obj->ref;
|
||||||
$orderstatic->total_ht = $obj->total_ht;
|
$myobjectstatic->ref_client=$obj->ref_client;
|
||||||
$orderstatic->total_tva = $obj->total_tva;
|
$myobjectstatic->total_ht = $obj->total_ht;
|
||||||
$orderstatic->total_ttc = $obj->total_ttc;
|
$myobjectstatic->total_tva = $obj->total_tva;
|
||||||
print $orderstatic->getNomUrl(1);
|
$myobjectstatic->total_ttc = $obj->total_ttc;
|
||||||
|
|
||||||
|
print $myobjectstatic->getNomUrl(1);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td class="nowrap">';
|
print '<td class="nowrap">';
|
||||||
$companystatic->id=$obj->socid;
|
|
||||||
$companystatic->name=$obj->name;
|
|
||||||
$companystatic->client=$obj->client;
|
|
||||||
$companystatic->code_client = $obj->code_client;
|
|
||||||
$companystatic->code_fournisseur = $obj->code_fournisseur;
|
|
||||||
$companystatic->canvas=$obj->canvas;
|
|
||||||
print $companystatic->getNomUrl(1,'customer',16);
|
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td class="right" class="nowrap">'.price($obj->total_ttc).'</td></tr>';
|
print '<td class="right" class="nowrap">'.price($obj->total_ttc).'</td></tr>';
|
||||||
$i++;
|
$i++;
|
||||||
@ -171,14 +166,12 @@ $max = 3;
|
|||||||
// Last modified myobject
|
// Last modified myobject
|
||||||
if (! empty($conf->mymodule->enabled) && $user->rights->mymodule->read)
|
if (! empty($conf->mymodule->enabled) && $user->rights->mymodule->read)
|
||||||
{
|
{
|
||||||
$sql = "SELECT s.rowid, s.nom as name, s.client, s.datec, s.tms, s.canvas";
|
$sql = "SELECT s.rowid, s.ref, s.label, s.date_creation, s.tms";
|
||||||
$sql.= ", s.code_client";
|
$sql.= " FROM ".MAIN_DB_PREFIX."mymodule_myobject as s";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
|
//if (! $user->rights->societe->client->voir && ! $socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||||
if (! $user->rights->societe->client->voir && ! $socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
$sql.= " WHERE s.entity IN (".getEntity($myobjectstatic->element).")";
|
||||||
$sql.= " WHERE s.client IN (1, 2, 3)";
|
//if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||||
$sql.= " AND s.entity IN (".getEntity($companystatic->element).")";
|
//if ($socid) $sql.= " AND s.rowid = $socid";
|
||||||
if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
|
|
||||||
if ($socid) $sql.= " AND s.rowid = $socid";
|
|
||||||
$sql .= " ORDER BY s.tms DESC";
|
$sql .= " ORDER BY s.tms DESC";
|
||||||
$sql .= $db->plimit($max, 0);
|
$sql .= $db->plimit($max, 0);
|
||||||
|
|
||||||
@ -191,9 +184,7 @@ if (! empty($conf->mymodule->enabled) && $user->rights->mymodule->read)
|
|||||||
print '<table class="noborder centpercent">';
|
print '<table class="noborder centpercent">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<th colspan="2">';
|
print '<th colspan="2">';
|
||||||
if (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS)) print $langs->trans("BoxTitleLastCustomersOrProspects",$max);
|
print $langs->trans("BoxTitleLatestModifiedMyObjects",$max);
|
||||||
else if (! empty($conf->global->SOCIETE_DISABLE_CUSTOMERS)) print $langs->trans("BoxTitleLastModifiedProspects",$max);
|
|
||||||
else print $langs->trans("BoxTitleLastModifiedCustomers",$max);
|
|
||||||
print '</th>';
|
print '</th>';
|
||||||
print '<th class="right">'.$langs->trans("DateModificationShort").'</th>';
|
print '<th class="right">'.$langs->trans("DateModificationShort").'</th>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
@ -202,22 +193,19 @@ if (! empty($conf->mymodule->enabled) && $user->rights->mymodule->read)
|
|||||||
while ($i < $num)
|
while ($i < $num)
|
||||||
{
|
{
|
||||||
$objp = $db->fetch_object($resql);
|
$objp = $db->fetch_object($resql);
|
||||||
$companystatic->id=$objp->rowid;
|
|
||||||
$companystatic->name=$objp->name;
|
$myobjectstatic->id=$objp->rowid;
|
||||||
$companystatic->client=$objp->client;
|
$myobjectstatic->ref=$objp->ref;
|
||||||
$companystatic->code_client = $objp->code_client;
|
$myobjectstatic->label=$objp->label;
|
||||||
$companystatic->code_fournisseur = $objp->code_fournisseur;
|
$myobjectstatic->status = $objp->status;
|
||||||
$companystatic->canvas=$objp->canvas;
|
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
print '<td class="nowrap">'.$companystatic->getNomUrl(1,'customer',48).'</td>';
|
print '<td class="nowrap">'.$myobjectstatic->getNomUrl(1).'</td>';
|
||||||
print '<td class="right nowrap">';
|
print '<td class="right nowrap">';
|
||||||
print $companystatic->getLibCustProspStatut();
|
|
||||||
print "</td>";
|
print "</td>";
|
||||||
print '<td class="right nowrap">'.dol_print_date($db->jdate($objp->tms),'day')."</td>";
|
print '<td class="right nowrap">'.dol_print_date($db->jdate($objp->tms),'day')."</td>";
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
$i++;
|
$i++;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$db->free($resql);
|
$db->free($resql);
|
||||||
|
|||||||
@ -96,15 +96,17 @@ class RecruitmentJobPosition extends CommonObject
|
|||||||
public $fields=array(
|
public $fields=array(
|
||||||
'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>'1', 'position'=>1, 'notnull'=>1, 'visible'=>0, 'noteditable'=>'1', 'index'=>1, 'comment'=>"Id"),
|
'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>'1', 'position'=>1, 'notnull'=>1, 'visible'=>0, 'noteditable'=>'1', 'index'=>1, 'comment'=>"Id"),
|
||||||
'ref' => array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>'1', 'position'=>10, 'notnull'=>1, 'visible'=>4, 'noteditable'=>'1', 'default'=>'(PROV)', 'index'=>1, 'searchall'=>1, 'showoncombobox'=>'1', 'comment'=>"Reference of object"),
|
'ref' => array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>'1', 'position'=>10, 'notnull'=>1, 'visible'=>4, 'noteditable'=>'1', 'default'=>'(PROV)', 'index'=>1, 'searchall'=>1, 'showoncombobox'=>'1', 'comment'=>"Reference of object"),
|
||||||
|
'entity' => array('type'=>'integer', 'label'=>'Entity', 'enabled'=>1, 'visible'=>0, 'position'=>5, 'notnull'=>1, 'default'=>'1', 'index'=>1),
|
||||||
'label' => array('type'=>'varchar(255)', 'label'=>'JobLabel', 'enabled'=>'1', 'position'=>30, 'notnull'=>1, 'visible'=>1, 'searchall'=>1, 'css'=>'minwidth500', 'showoncombobox'=>'1', 'autofocusoncreate'=>1),
|
'label' => array('type'=>'varchar(255)', 'label'=>'JobLabel', 'enabled'=>'1', 'position'=>30, 'notnull'=>1, 'visible'=>1, 'searchall'=>1, 'css'=>'minwidth500', 'showoncombobox'=>'1', 'autofocusoncreate'=>1),
|
||||||
'qty' => array('type'=>'integer', 'label'=>'NbOfEmployeesExpected', 'enabled'=>'1', 'position'=>45, 'notnull'=>1, 'visible'=>1, 'default'=>'1', 'isameasure'=>'1', 'css'=>'maxwidth75imp',),
|
'qty' => array('type'=>'integer', 'label'=>'NbOfEmployeesExpected', 'enabled'=>'1', 'position'=>45, 'notnull'=>1, 'visible'=>1, 'default'=>'1', 'isameasure'=>'1', 'css'=>'maxwidth75imp',),
|
||||||
'fk_project' => array('type'=>'integer:Project:projet/class/project.class.php:1', 'label'=>'Project', 'enabled'=>'1', 'position'=>52, 'notnull'=>-1, 'visible'=>-1, 'index'=>1,),
|
'fk_project' => array('type'=>'integer:Project:projet/class/project.class.php:1', 'label'=>'Project', 'enabled'=>'1', 'position'=>52, 'notnull'=>-1, 'visible'=>-1, 'index'=>1,),
|
||||||
'fk_user_recruiter' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'ResponsibleOfRecruitement', 'enabled'=>'1', 'position'=>54, 'notnull'=>1, 'visible'=>-1, 'foreignkey'=>'user.rowid',),
|
'fk_user_recruiter' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'ResponsibleOfRecruitement', 'enabled'=>'1', 'position'=>54, 'notnull'=>1, 'visible'=>1, 'foreignkey'=>'user.rowid',),
|
||||||
'email_recruiter' => array('type'=>'varchar(255)', 'label'=>'EmailRecruiter', 'enabled'=>'1', 'position'=>54, 'notnull'=>0, 'visible'=>-1, 'help'=>'ToUseAGenericEmail'),
|
'email_recruiter' => array('type'=>'varchar(255)', 'label'=>'EmailRecruiter', 'enabled'=>'1', 'position'=>54, 'notnull'=>0, 'visible'=>-1, 'help'=>'ToUseAGenericEmail'),
|
||||||
'fk_user_supervisor' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'FutureManager', 'enabled'=>'1', 'position'=>55, 'notnull'=>0, 'visible'=>-1, 'foreignkey'=>'user.rowid',),
|
'fk_user_supervisor' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'FutureManager', 'enabled'=>'1', 'position'=>55, 'notnull'=>0, 'visible'=>-1, 'foreignkey'=>'user.rowid',),
|
||||||
'fk_establishment' => array('type'=>'integer:Establishment:hrm/class/establishment.class.php', 'label'=>'Establishment', 'enabled'=>'$conf->hrm->enabled', 'position'=>56, 'notnull'=>0, 'visible'=>-1, 'foreignkey'=>'establishment.rowid',),
|
'fk_establishment' => array('type'=>'integer:Establishment:hrm/class/establishment.class.php', 'label'=>'Establishment', 'enabled'=>'$conf->hrm->enabled', 'position'=>56, 'notnull'=>0, 'visible'=>-1, 'foreignkey'=>'establishment.rowid',),
|
||||||
'fk_soc' => array('type'=>'integer:Societe:societe/class/societe.class.php:1:status=1 AND entity IN (__SHARED_ENTITIES__)', 'label'=>'WorkPlace', 'enabled'=>'1', 'position'=>57, 'notnull'=>-1, 'visible'=>-1, 'index'=>1, 'help'=>"IfJobIsLocatedAtAPartner",),
|
'fk_soc' => array('type'=>'integer:Societe:societe/class/societe.class.php:1:status=1 AND entity IN (__SHARED_ENTITIES__)', 'label'=>'WorkPlace', 'enabled'=>'1', 'position'=>57, 'notnull'=>-1, 'visible'=>-1, 'index'=>1, 'help'=>"IfJobIsLocatedAtAPartner",),
|
||||||
'date_planned' => array('type'=>'date', 'label'=>'DateExpected', 'enabled'=>'1', 'position'=>60, 'notnull'=>0, 'visible'=>1,),
|
'date_planned' => array('type'=>'date', 'label'=>'DateExpected', 'enabled'=>'1', 'position'=>60, 'notnull'=>0, 'visible'=>1,),
|
||||||
|
'remuneration_suggested' => array('type'=>'varchar(255)', 'label'=>'Remuneration', 'enabled'=>'1', 'position'=>62, 'notnull'=>0, 'visible'=>1,),
|
||||||
'description' => array('type'=>'html', 'label'=>'Description', 'enabled'=>'1', 'position'=>65, 'notnull'=>0, 'visible'=>3,),
|
'description' => array('type'=>'html', 'label'=>'Description', 'enabled'=>'1', 'position'=>65, 'notnull'=>0, 'visible'=>3,),
|
||||||
'note_public' => array('type'=>'html', 'label'=>'NotePublic', 'enabled'=>'1', 'position'=>101, 'notnull'=>0, 'visible'=>0,),
|
'note_public' => array('type'=>'html', 'label'=>'NotePublic', 'enabled'=>'1', 'position'=>101, 'notnull'=>0, 'visible'=>0,),
|
||||||
'note_private' => array('type'=>'html', 'label'=>'NotePrivate', 'enabled'=>'1', 'position'=>102, 'notnull'=>0, 'visible'=>0,),
|
'note_private' => array('type'=>'html', 'label'=>'NotePrivate', 'enabled'=>'1', 'position'=>102, 'notnull'=>0, 'visible'=>0,),
|
||||||
@ -119,6 +121,7 @@ class RecruitmentJobPosition extends CommonObject
|
|||||||
);
|
);
|
||||||
public $rowid;
|
public $rowid;
|
||||||
public $ref;
|
public $ref;
|
||||||
|
public $entity;
|
||||||
public $label;
|
public $label;
|
||||||
public $qty;
|
public $qty;
|
||||||
public $fk_soc;
|
public $fk_soc;
|
||||||
@ -801,11 +804,11 @@ class RecruitmentJobPosition extends CommonObject
|
|||||||
$this->labelStatus[self::STATUS_DRAFT] = $langs->trans('Draft');
|
$this->labelStatus[self::STATUS_DRAFT] = $langs->trans('Draft');
|
||||||
$this->labelStatus[self::STATUS_VALIDATED] = $langs->trans('Validated');
|
$this->labelStatus[self::STATUS_VALIDATED] = $langs->trans('Validated');
|
||||||
$this->labelStatus[self::STATUS_RECRUITED] = $langs->trans('Recruited');
|
$this->labelStatus[self::STATUS_RECRUITED] = $langs->trans('Recruited');
|
||||||
$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('Validated');
|
||||||
$this->labelStatusShort[self::STATUS_RECRUITED] = $langs->trans('Recruited');
|
$this->labelStatusShort[self::STATUS_RECRUITED] = $langs->trans('Recruited');
|
||||||
$this->labelStatusShort[self::STATUS_CANCELED] = $langs->trans('Disabled');
|
$this->labelStatusShort[self::STATUS_CANCELED] = $langs->trans('Canceled');
|
||||||
}
|
}
|
||||||
|
|
||||||
$statusType = 'status'.$status;
|
$statusType = 'status'.$status;
|
||||||
|
|||||||
@ -24,25 +24,12 @@
|
|||||||
* \brief Home page of recruitment top menu
|
* \brief Home page of recruitment top menu
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Load Dolibarr environment
|
require '../main.inc.php';
|
||||||
$res = 0;
|
require_once DOL_DOCUMENT_ROOT.'/recruitment/class/recruitmentjobposition.class.php';
|
||||||
// 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/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
|
||||||
$langs->loadLangs(array("recruitment"));
|
$langs->loadLangs(array("recruitment", "boxes"));
|
||||||
|
|
||||||
$action = GETPOST('action', 'alpha');
|
$action = GETPOST('action', 'alpha');
|
||||||
|
|
||||||
@ -73,6 +60,7 @@ $now = dol_now();
|
|||||||
|
|
||||||
$form = new Form($db);
|
$form = new Form($db);
|
||||||
$formfile = new FormFile($db);
|
$formfile = new FormFile($db);
|
||||||
|
$staticrecruitmentjobposition = new RecruitmentJobPosition($db);
|
||||||
|
|
||||||
llxHeader("", $langs->trans("RecruitmentArea"));
|
llxHeader("", $langs->trans("RecruitmentArea"));
|
||||||
|
|
||||||
@ -81,6 +69,91 @@ print load_fiche_titre($langs->trans("RecruitmentArea"), '', 'object_recruitment
|
|||||||
print '<div class="fichecenter"><div class="fichethirdleft">';
|
print '<div class="fichecenter"><div class="fichethirdleft">';
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Statistics
|
||||||
|
*/
|
||||||
|
|
||||||
|
if ($conf->use_javascript_ajax)
|
||||||
|
{
|
||||||
|
$sql = "SELECT COUNT(t.rowid) as nb, status";
|
||||||
|
$sql .= " FROM ".MAIN_DB_PREFIX."recruitment_recruitmentjobposition 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("Recruitment").'</th></tr>'."\n";
|
||||||
|
$listofstatus = array(0, 1, 3, 9);
|
||||||
|
foreach ($listofstatus as $status)
|
||||||
|
{
|
||||||
|
$dataseries[] = array($staticrecruitmentjobposition->LibStatut($status, 1), (isset($vals[$status]) ? (int) $vals[$status] : 0));
|
||||||
|
if ($status == RecruitmentJobPosition::STATUS_DRAFT) $colorseries[$status] = '-'.$badgeStatus0;
|
||||||
|
if ($status == RecruitmentJobPosition::STATUS_VALIDATED) $colorseries[$status] = $badgeStatus1;
|
||||||
|
if ($status == RecruitmentJobPosition::STATUS_RECRUITED) $colorseries[$status] = $badgeStatus4;
|
||||||
|
if ($status == RecruitmentJobPosition::STATUS_CANCELED) $colorseries[$status] = $badgeStatus9;
|
||||||
|
|
||||||
|
if (empty($conf->use_javascript_ajax))
|
||||||
|
{
|
||||||
|
print '<tr class="oddeven">';
|
||||||
|
print '<td>'.$staticrecruitmentjobposition->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('idgraphstatus');
|
||||||
|
print $dolgraph->show($totalnb ? 0 : 1);
|
||||||
|
|
||||||
|
print '</td></tr>';
|
||||||
|
}
|
||||||
|
print "</table>";
|
||||||
|
print "</div>";
|
||||||
|
|
||||||
|
print "<br>";
|
||||||
|
} else {
|
||||||
|
dol_print_error($db);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
print '<br>';
|
||||||
|
|
||||||
/* BEGIN MODULEBUILDER DRAFT MYOBJECT
|
/* BEGIN MODULEBUILDER DRAFT MYOBJECT
|
||||||
// Draft MyObject
|
// Draft MyObject
|
||||||
if (! empty($conf->recruitment->enabled) && $user->rights->recruitment->read)
|
if (! empty($conf->recruitment->enabled) && $user->rights->recruitment->read)
|
||||||
@ -89,7 +162,7 @@ if (! empty($conf->recruitment->enabled) && $user->rights->recruitment->read)
|
|||||||
|
|
||||||
$sql = "SELECT c.rowid, c.ref, c.ref_client, c.total_ht, c.tva as total_tva, c.total_ttc, s.rowid as socid, s.nom as name, s.client, s.canvas";
|
$sql = "SELECT c.rowid, c.ref, c.ref_client, c.total_ht, c.tva as total_tva, c.total_ttc, s.rowid as socid, s.nom as name, s.client, s.canvas";
|
||||||
$sql.= ", s.code_client";
|
$sql.= ", s.code_client";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."commande as c";
|
$sql.= " FROM ".MAIN_DB_PREFIX."recruitment_recruitmentjobposition as c";
|
||||||
$sql.= ", ".MAIN_DB_PREFIX."societe as s";
|
$sql.= ", ".MAIN_DB_PREFIX."societe as s";
|
||||||
if (! $user->rights->societe->client->voir && ! $socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
if (! $user->rights->societe->client->voir && ! $socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||||
$sql.= " WHERE c.fk_soc = s.rowid";
|
$sql.= " WHERE c.fk_soc = s.rowid";
|
||||||
@ -167,18 +240,16 @@ print '</div><div class="fichetwothirdright"><div class="ficheaddleft">';
|
|||||||
$NBMAX = 3;
|
$NBMAX = 3;
|
||||||
$max = 3;
|
$max = 3;
|
||||||
|
|
||||||
/* BEGIN MODULEBUILDER LASTMODIFIED MYOBJECT
|
/* BEGIN MODULEBUILDER LASTMODIFIED MYOBJECT */
|
||||||
// Last modified myobject
|
// Last modified myobject
|
||||||
if (! empty($conf->recruitment->enabled) && $user->rights->recruitment->read)
|
if (! empty($conf->recruitment->enabled) && $user->rights->recruitment->recruitmentjobposition->read)
|
||||||
{
|
{
|
||||||
$sql = "SELECT s.rowid, s.nom as name, s.client, s.datec, s.tms, s.canvas";
|
$sql = "SELECT s.rowid, s.ref, s.label, s.date_creation, s.tms";
|
||||||
$sql.= ", s.code_client";
|
$sql.= " FROM ".MAIN_DB_PREFIX."recruitment_recruitmentjobposition as s";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
|
|
||||||
if (! $user->rights->societe->client->voir && ! $socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
if (! $user->rights->societe->client->voir && ! $socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||||
$sql.= " WHERE s.client IN (1, 2, 3)";
|
$sql.= " WHERE s.entity IN (".getEntity($staticrecruitmentjobposition->element).")";
|
||||||
$sql.= " AND s.entity IN (".getEntity($companystatic->element).")";
|
if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND s.fk_soc = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||||
if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
|
if ($socid) $sql.= " AND s.fk_soc = $socid";
|
||||||
if ($socid) $sql.= " AND s.rowid = $socid";
|
|
||||||
$sql .= " ORDER BY s.tms DESC";
|
$sql .= " ORDER BY s.tms DESC";
|
||||||
$sql .= $db->plimit($max, 0);
|
$sql .= $db->plimit($max, 0);
|
||||||
|
|
||||||
@ -191,9 +262,7 @@ if (! empty($conf->recruitment->enabled) && $user->rights->recruitment->read)
|
|||||||
print '<table class="noborder centpercent">';
|
print '<table class="noborder centpercent">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<th colspan="2">';
|
print '<th colspan="2">';
|
||||||
if (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS)) print $langs->trans("BoxTitleLastCustomersOrProspects",$max);
|
print $langs->trans("BoxTitleLatestModifiedJobPositions",$max);
|
||||||
else if (! empty($conf->global->SOCIETE_DISABLE_CUSTOMERS)) print $langs->trans("BoxTitleLastModifiedProspects",$max);
|
|
||||||
else print $langs->trans("BoxTitleLastModifiedCustomers",$max);
|
|
||||||
print '</th>';
|
print '</th>';
|
||||||
print '<th class="right">'.$langs->trans("DateModificationShort").'</th>';
|
print '<th class="right">'.$langs->trans("DateModificationShort").'</th>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
@ -202,16 +271,15 @@ if (! empty($conf->recruitment->enabled) && $user->rights->recruitment->read)
|
|||||||
while ($i < $num)
|
while ($i < $num)
|
||||||
{
|
{
|
||||||
$objp = $db->fetch_object($resql);
|
$objp = $db->fetch_object($resql);
|
||||||
$companystatic->id=$objp->rowid;
|
$staticrecruitmentjobposition->id=$objp->rowid;
|
||||||
$companystatic->name=$objp->name;
|
$staticrecruitmentjobposition->ref=$objp->ref;
|
||||||
$companystatic->client=$objp->client;
|
$staticrecruitmentjobposition->label=$objp->label;
|
||||||
$companystatic->code_client = $objp->code_client;
|
$staticrecruitmentjobposition->status = $objp->status;
|
||||||
$companystatic->code_fournisseur = $objp->code_fournisseur;
|
$staticrecruitmentjobposition->date_creation = $objp->date_creation;
|
||||||
$companystatic->canvas=$objp->canvas;
|
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
print '<td class="nowrap">'.$companystatic->getNomUrl(1,'customer',48).'</td>';
|
print '<td class="nowrap">'.$staticrecruitmentjobposition->getNomUrl(1, '').'</td>';
|
||||||
print '<td class="right nowrap">';
|
print '<td class="right nowrap">';
|
||||||
print $companystatic->getLibCustProspStatut();
|
|
||||||
print "</td>";
|
print "</td>";
|
||||||
print '<td class="right nowrap">'.dol_print_date($db->jdate($objp->tms),'day')."</td>";
|
print '<td class="right nowrap">'.dol_print_date($db->jdate($objp->tms),'day')."</td>";
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
@ -227,9 +295,11 @@ if (! empty($conf->recruitment->enabled) && $user->rights->recruitment->read)
|
|||||||
print '<tr class="oddeven"><td colspan="3" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
|
print '<tr class="oddeven"><td colspan="3" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
|
||||||
}
|
}
|
||||||
print "</table><br>";
|
print "</table><br>";
|
||||||
|
} else {
|
||||||
|
dol_print_error($db);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
|
|
||||||
print '</div></div></div>';
|
print '</div></div></div>';
|
||||||
|
|
||||||
|
|||||||
@ -503,19 +503,18 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||||||
{
|
{
|
||||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=enable">'.$langs->trans("Enable").'</a>'."\n";
|
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=enable">'.$langs->trans("Enable").'</a>'."\n";
|
||||||
}
|
}
|
||||||
}
|
}*/
|
||||||
if ($permissiontoadd)
|
if ($permissiontoadd)
|
||||||
{
|
{
|
||||||
if ($object->status == $object::STATUS_VALIDATED)
|
if ($object->status == $object::STATUS_VALIDATED)
|
||||||
{
|
{
|
||||||
print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=close">'.$langs->trans("Cancel").'</a>'."\n";
|
print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=confirm_close&confirm=yes">'.$langs->trans("Cancel").'</a>'."\n";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=reopen">'.$langs->trans("Re-Open").'</a>'."\n";
|
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=confirm_reopen&confirm=yes">'.$langs->trans("Re-Open").'</a>'."\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
|
|
||||||
// Delete (need delete permission, or if draft, just need create/modify permission)
|
// Delete (need delete permission, or if draft, just need create/modify permission)
|
||||||
if ($permissiontodelete || ($object->status == $object::STATUS_DRAFT && $permissiontoadd))
|
if ($permissiontodelete || ($object->status == $object::STATUS_DRAFT && $permissiontoadd))
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user