diff --git a/htdocs/core/modules/modHRM.class.php b/htdocs/core/modules/modHRM.class.php
index 68549d2cd10..c63fa04f65e 100644
--- a/htdocs/core/modules/modHRM.class.php
+++ b/htdocs/core/modules/modHRM.class.php
@@ -62,7 +62,7 @@ class modHRM extends DolibarrModules
$this->dirs = array ();
// Config pages
- $this->config_page_url = array('admin_hrm.php');
+ $this->config_page_url = array('admin_hrm.php@hrm');
// Dependencies
$this->depends = array();
diff --git a/htdocs/hrm/admin/admin_establishment.php b/htdocs/hrm/admin/admin_establishment.php
new file mode 100644
index 00000000000..2fb6507d0ba
--- /dev/null
+++ b/htdocs/hrm/admin/admin_establishment.php
@@ -0,0 +1,126 @@
+
+ *
+ * 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 .
+ */
+
+/**
+ * \file htdocs/hrm/admin/admin_establishment.php
+ * \ingroup HRM
+ * \brief HRM Establishment module setup page
+ */
+require('../../main.inc.php');
+require_once DOL_DOCUMENT_ROOT.'/core/lib/hrm.lib.php';
+require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
+require_once DOL_DOCUMENT_ROOT.'/hrm/class/establishment.class.php';
+
+$langs->load("admin");
+$langs->load('hrm');
+
+if (! $user->admin)
+ accessforbidden();
+
+$error=0;
+
+$action = GETPOST('action', 'alpha');
+
+$object = new Establishment($db);
+
+/*
+ * Actions
+ */
+
+/*
+ * View
+ */
+$page_name = "Establishments";
+llxHeader('', $langs->trans($page_name));
+
+$form = new Form($db);
+
+dol_htmloutput_mesg($mesg);
+
+// Subheader
+$linkback = '' . $langs->trans("BackToModuleList") . '';
+print load_fiche_titre($langs->trans($page_name), $linkback);
+
+// Configuration header
+$head = hrm_admin_prepare_head();
+dol_fiche_head($head, 'establishments', $langs->trans("HRM"), 0, "user");
+
+$sql = "SELECT e.rowid, e.name, e.address, e.zip, e.town, e.statut";
+$sql.= " FROM ".MAIN_DB_PREFIX."establishment as e";
+$sql.= " WHERE e.entity = ".$conf->entity;
+
+$result = $db->query($sql);
+if ($result)
+{
+ $var=false;
+ $num = $db->num_rows($result);
+
+ $i = 0;
+
+ // Load attribute_label
+ print '
';
+ print '';
+ print '| '.$langs->trans("Ref").' | ';
+ print ''.$langs->trans("Name").' | ';
+ print ''.$langs->trans("Address").' | ';
+ print ''.$langs->trans("Zipcode").' | ';
+ print ''.$langs->trans("Town").' | ';
+ print ''.$langs->trans("Statut").' | ';
+ print '
';
+
+ if ($num)
+ {
+ $establishmentstatic=new Establishment($db);
+
+ while ($i < $num && $i < $max)
+ {
+ $obj = $db->fetch_object($result);
+ $fiscalyearstatic->id=$obj->rowid;
+ print '';
+ print '| '.img_object($langs->trans("ShowEstablishment"),"building").' '.$obj->rowid.' | ';
+ print ''.$obj->name.' | ';
+ print ''.$obj->address.' | ';
+ print ''.$obj->zip.' | ';
+ print ''.$obj->town.' | ';
+ print ''.$establishmentstatic->LibStatut($obj->statut,5).' | ';
+ print '
';
+ $var=!$var;
+ $i++;
+ }
+
+ }
+ else
+ {
+ print '| '.$langs->trans("None").' |
';
+ }
+
+ print '
';
+}
+else
+{
+ dol_print_error($db);
+}
+
+dol_fiche_end();
+
+// Buttons
+print '';
+
+llxFooter();
+$db->close();
diff --git a/htdocs/hrm/admin/admin_hrm.php b/htdocs/hrm/admin/admin_hrm.php
new file mode 100644
index 00000000000..d66185315eb
--- /dev/null
+++ b/htdocs/hrm/admin/admin_hrm.php
@@ -0,0 +1,58 @@
+
+ *
+ * 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 .
+ */
+
+/**
+ * \file htdocs/hrm/admin/admin_ihrm.php
+ * \ingroup HRM
+ * \brief HRM module setup page
+ */
+require('../../main.inc.php');
+require_once DOL_DOCUMENT_ROOT.'/core/lib/hrm.lib.php';
+require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
+
+$langs->load("admin");
+$langs->load('hrm');
+
+if (! $user->admin)
+ accessforbidden();
+
+$action = GETPOST('action', 'alpha');
+
+/*
+ * Actions
+ */
+
+/*
+ * View
+ */
+$page_name = "Parameters";
+llxHeader('', $langs->trans($page_name));
+
+$form = new Form($db);
+
+dol_htmloutput_mesg($mesg);
+
+// Subheader
+$linkback = '' . $langs->trans("BackToModuleList") . '';
+print load_fiche_titre($langs->trans($page_name), $linkback);
+
+// Configuration header
+$head = hrm_admin_prepare_head();
+dol_fiche_head($head, 'parameters', $langs->trans("HRM"), 0, "user");
+
+llxFooter();
+$db->close();
diff --git a/htdocs/hrm/admin/index.html b/htdocs/hrm/admin/index.html
new file mode 100644
index 00000000000..e69de29bb2d
diff --git a/htdocs/hrm/class/establishment.class.php b/htdocs/hrm/class/establishment.class.php
new file mode 100644
index 00000000000..208d38c1fd1
--- /dev/null
+++ b/htdocs/hrm/class/establishment.class.php
@@ -0,0 +1,324 @@
+
+ *
+ * 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 .
+ */
+
+/**
+ * \file htdocs/custom/ihrm/class/establishment.class.php
+ * \ingroup iHRM
+ * \brief File of class to manage establishments
+ */
+
+require_once DOL_DOCUMENT_ROOT .'/core/class/commonobject.class.php';
+
+/**
+ * Class to manage establishments
+ */
+class Establishment extends CommonObject
+{
+ public $element='establishment';
+ public $table_element='ihrm_establishment';
+ public $table_element_line = '';
+ public $fk_element = 'fk_establishment';
+ protected $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
+
+ var $rowid;
+
+ var $name;
+ var $address;
+ var $zip;
+ var $town;
+ var $statut; // 0=open, 1=closed
+ var $entity;
+
+ var $statuts=array();
+ var $statuts_short=array();
+
+ /**
+ * Constructor
+ *
+ * @param DoliDB $db Database handler
+ */
+ function __construct($db)
+ {
+ $this->db = $db;
+
+ $this->statuts_short = array(0 => 'Opened', 1 => 'Closed');
+ $this->statuts = array(0 => 'Opened', 1 => 'Closed');
+
+ return 1;
+ }
+
+ /**
+ * Create object in database
+ *
+ * @param User $user User making creation
+ * @return int <0 if KO, >0 if OK
+ */
+ function create($user)
+ {
+ global $conf;
+
+ $error = 0;
+
+ $now=dol_now();
+
+ $this->db->begin();
+
+ $sql = "INSERT INTO ".MAIN_DB_PREFIX."ihrm_establishment (";
+ $sql.= "name";
+ $sql.= ", address";
+ $sql.= ", zip";
+ $sql.= ", town";
+ $sql.= ", statut";
+ $sql.= ", entity";
+ $sql.= ", datec";
+ $sql.= ", fk_user_author";
+ $sql.= ") VALUES (";
+ $sql.= " '".$this->name."'";
+ $sql.= ", '".$this->address."'";
+ $sql.= ", '".$this->zip."'";
+ $sql.= ", '".$this->town."'";
+ $sql.= ", ".$this->statut;
+ $sql.= ", ".$conf->entity;
+ $sql.= ", '".$this->db->idate($now)."'";
+ $sql.= ", ". $user->id;
+ $sql.= ")";
+
+ $this->db->begin();
+
+ dol_syslog(get_class($this)."::create", LOG_DEBUG);
+ $resql = $this->db->query($sql);
+ if (! $resql) {
+ $error ++;
+ $this->errors[] = "Error " . $this->db->lasterror();
+ }
+
+ if (! $error) {
+ $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX . "ihrm_establishment");
+ }
+
+ // Commit or rollback
+ if ($error) {
+ foreach ( $this->errors as $errmsg ) {
+ dol_syslog(get_class($this) . "::create " . $errmsg, LOG_ERR);
+ $this->error .= ($this->error ? ', ' . $errmsg : $errmsg);
+ }
+ $this->db->rollback();
+ return - 1 * $error;
+ } else {
+ $this->db->commit();
+ return $this->id;
+ }
+ }
+
+ /**
+ * Update record
+ *
+ * @param User $user User making update
+ * @return int <0 if KO, >0 if OK
+ */
+ function update($user)
+ {
+ global $langs;
+
+ // Check parameters
+ if (empty($this->name))
+ {
+ $this->error='ErrorBadParameter';
+ return -1;
+ }
+
+ $this->db->begin();
+
+ $sql = "UPDATE ".MAIN_DB_PREFIX."ihrm_establishment";
+ $sql .= " SET name = '".$this->name."'";
+ $sql .= ", address = '".$this->address."'";
+ $sql .= ", zip = '".$this->zip."'";
+ $sql .= ", town = '".$this->town."'";
+ $sql .= ", statut = '".$this->statut."'";
+ $sql .= ", fk_user_mod = " . $user->id;
+ $sql .= " WHERE rowid = ".$this->id;
+
+ dol_syslog(get_class($this) . "::update sql=" . $sql, LOG_DEBUG);
+ $result = $this->db->query($sql);
+ if ($result) {
+ $this->db->commit();
+ return 1;
+ } else {
+ $this->error = $this->db->lasterror();
+ $this->db->rollback();
+ return - 1;
+ }
+ }
+
+ /**
+ * Load an object from database
+ *
+ * @param int $id Id of record to load
+ * @return int <0 if KO, >0 if OK
+ */
+ function fetch($id)
+ {
+ $sql = "SELECT rowid, name, address, zip, town, statut";
+ $sql.= " FROM ".MAIN_DB_PREFIX."ihrm_establishment";
+ $sql.= " WHERE rowid = ".$id;
+
+ dol_syslog(get_class($this)."::fetch", LOG_DEBUG);
+ $result = $this->db->query($sql);
+ if ( $result )
+ {
+ $obj = $this->db->fetch_object($result);
+
+ $this->id = $obj->rowid;
+ $this->name = $obj->name;
+ $this->address = $obj->address;
+ $this->zip = $obj->zip;
+ $this->town = $obj->town;
+ $this->statut = $obj->statut;
+
+ return 1;
+ }
+ else
+ {
+ $this->error=$this->db->lasterror();
+ return -1;
+ }
+ }
+
+ /**
+ * Delete record
+ *
+ * @param int $id Id of record to delete
+ * @return int <0 if KO, >0 if OK
+ */
+ function delete($id)
+ {
+ $this->db->begin();
+
+ $sql = "DELETE FROM ".MAIN_DB_PREFIX."ihrm_establishment WHERE rowid = ".$id;
+
+ dol_syslog(get_class($this)."::delete", LOG_DEBUG);
+ $result = $this->db->query($sql);
+ if ($result)
+ {
+ $this->db->commit();
+ return 1;
+ }
+ else
+ {
+ $this->error=$this->db->lasterror();
+ $this->db->rollback();
+ return -1;
+ }
+ }
+
+ /**
+ * Give a label from a status
+ *
+ * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto
+ * @return string Label
+ */
+ function getLibStatut($mode=0)
+ {
+ return $this->LibStatut($this->statut,$mode);
+ }
+
+ /**
+ * Give a label from a status
+ *
+ * @param int $statut Id status
+ * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto
+ * @return string Label
+ */
+ function LibStatut($statut,$mode=0)
+ {
+ global $langs;
+
+ if ($mode == 0)
+ {
+ return $langs->trans($this->statuts[$statut]);
+ }
+ if ($mode == 1)
+ {
+ return $langs->trans($this->statuts_short[$statut]);
+ }
+ if ($mode == 2)
+ {
+ if ($statut==0) return img_picto($langs->trans($this->statuts_short[$statut]),'statut4').' '.$langs->trans($this->statuts_short[$statut]);
+ if ($statut==1) return img_picto($langs->trans($this->statuts_short[$statut]),'statut8').' '.$langs->trans($this->statuts_short[$statut]);
+ }
+ if ($mode == 3)
+ {
+ if ($statut==0 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]),'statut4');
+ if ($statut==1 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]),'statut8');
+ }
+ if ($mode == 4)
+ {
+ if ($statut==0 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]),'statut4').' '.$langs->trans($this->statuts[$statut]);
+ if ($statut==1 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]),'statut8').' '.$langs->trans($this->statuts[$statut]);
+ }
+ if ($mode == 5)
+ {
+ if ($statut==0 && ! empty($this->statuts_short[$statut])) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut4');
+ if ($statut==1 && ! empty($this->statuts_short[$statut])) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut8');
+ }
+ }
+
+ /**
+ * Information on record
+ *
+ * @param int $id Id of record
+ * @return void
+ */
+ function info($id)
+ {
+ $sql = 'SELECT e.rowid, e.datec, e.fk_user_author, e.tms, e.fk_user_mod';
+ $sql.= ' FROM '.MAIN_DB_PREFIX.'ihrm_establishment as e';
+ $sql.= ' WHERE e.rowid = '.$id;
+
+ dol_syslog(get_class($this)."::fetch info", LOG_DEBUG);
+ $result = $this->db->query($sql);
+
+ if ($result)
+ {
+ if ($this->db->num_rows($result))
+ {
+ $obj = $this->db->fetch_object($result);
+ $this->id = $obj->rowid;
+ if ($obj->fk_user_author)
+ {
+ $cuser = new User($this->db);
+ $cuser->fetch($obj->fk_user_author);
+ $this->user_creation = $cuser;
+ }
+ if ($obj->fk_user_modif)
+ {
+ $muser = new User($this->db);
+ $muser->fetch($obj->fk_user_mod);
+ $this->user_modification = $muser;
+ }
+ $this->date_creation = $this->db->jdate($obj->datec);
+ $this->date_modification = $this->db->jdate($obj->tms);
+ }
+ $this->db->free($result);
+ }
+ else
+ {
+ dol_print_error($this->db);
+ }
+ }
+
+}
diff --git a/htdocs/hrm/class/index.html b/htdocs/hrm/class/index.html
new file mode 100644
index 00000000000..e69de29bb2d
diff --git a/htdocs/hrm/establishment/card.php b/htdocs/hrm/establishment/card.php
new file mode 100644
index 00000000000..dc3b29225c2
--- /dev/null
+++ b/htdocs/hrm/establishment/card.php
@@ -0,0 +1,415 @@
+
+ *
+ * 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 .
+ */
+
+/**
+ * \file htdocs/custom/ihrm/establishment/card.php
+ * \brief Page to show an establishment
+ */
+$res = @include ("../../main.inc.php"); // For root directory
+if (! $res)
+ $res = @include ("../../../main.inc.php"); // For "custom" directory
+if (! $res)
+ die("Include of main fails");
+
+require_once ('../core/lib/ihrm.lib.php');
+require_once ('../class/establishment.class.php');
+require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
+
+$langs->load("admin");
+$langs->load("compta");
+
+// Security check
+if (! $user->admin) accessforbidden();
+
+$error=0;
+
+$action = GETPOST('action','alpha');
+$cancel = GETPOST('cancel', 'alpha');
+$confirm = GETPOST('confirm','alpha');
+$id = GETPOST('id','int');
+
+// List of statut
+static $tmpstatut2label=array(
+ '0'=>'OpenEtablishment',
+ '1'=>'CloseEtablishment'
+);
+$statut2label=array('');
+foreach ($tmpstatut2label as $key => $val) $statut2label[$key]=$langs->trans($val);
+
+$object = new Establishment($db);
+
+/*
+ * Actions
+ */
+
+if ($action == 'confirm_delete' && $confirm == "yes")
+{
+ $result=$object->delete($id);
+ if ($result >= 0)
+ {
+ header("Location: ../admin/admin_establishment.php");
+ exit;
+ }
+ else
+ {
+ setEventMessage($object->error, 'errors');
+ }
+}
+
+else if ($action == 'add')
+{
+ if (! $cancel)
+ {
+ $error=0;
+
+ $object->name = GETPOST('name', 'alpha');
+ if (empty($object->name))
+ {
+ setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Name")), 'errors');
+ $error++;
+ }
+
+ if (empty($error))
+ {
+ $tmparray=getCountry(GETPOST('country_id','int'),'all',$db,$langs,0);
+ if (! empty($tmparray['id']))
+ {
+ $object->country_id =$tmparray['id'];
+ $object->country_code =$tmparray['code'];
+ $object->country_label=$tmparray['label'];
+ }
+
+ $object->address = GETPOST('address', 'alpha');
+ $object->zip = GETPOST('zipcode', 'alpha');
+ $object->town = GETPOST('town', 'alpha');
+ $object->fk_pays = $object->country_id;
+ $object->statut = GETPOST('statut','int');
+ $object->fk_user_author = $user->id;
+ $object->datec = dol_now();
+
+ $id = $object->create($user);
+
+ if ($id > 0)
+ {
+ header("Location: " . $_SERVER["PHP_SELF"] . "?id=" . $id);
+ exit;
+ }
+ else
+ {
+ setEventMessage($object->error, 'errors');
+ $action='create';
+ }
+ }
+ else
+ {
+ $action='create';
+ }
+ }
+ else
+ {
+ header("Location: ../admin/admin_establishment.php");
+ exit;
+ }
+}
+
+// Update record
+else if ($action == 'update')
+{
+ $error = 0;
+
+ if (! $cancel) {
+
+ $name = GETPOST('name', 'alpha');
+ if (empty($name)) {
+ setEventMessage($langs->trans('ErrorFieldRequired', $langs->trans('NameProperty')), 'errors');
+ $error ++;
+ }
+ $typeid = GETPOST('typeid', 'int');
+ if (empty($typeid)) {
+ setEventMessage($langs->trans('ErrorFieldRequired', $langs->trans('TypeProperty')), 'errors');
+ $error ++;
+ }
+
+ if (empty($error)) {
+ $object->name = GETPOST('name', 'alpha');
+ $object->address = GETPOST('address', 'alpha');
+ $object->zip = GETPOST('zipcode', 'alpha');
+ $object->town = GETPOST('town', 'alpha');
+ $object->fk_pays = GETPOST('country_id', 'int');
+ $object->rowid = GETPOST('id');
+ $object->fk_user_mod = $user->id;
+
+ $id = $object->update();
+
+ if ($id > 0)
+ {
+ header("Location: " . $_SERVER["PHP_SELF"] . "?id=" . $id);
+ exit;
+ }
+ else
+ {
+ setEventMessage($object->error, 'errors');
+ $action='create';
+ }
+ }
+ } else {
+ header("Location: card.php?id=" . $id);
+ exit;
+ }
+}
+
+/*
+ * View
+ */
+
+llxHeader();
+
+$form = new Form($db);
+$formcompany = new FormCompany($db);
+
+/*
+ * Action create
+ */
+if ($action == 'create')
+{
+ print load_fiche_titre($langs->trans("NewEstablishment"));
+
+ print '';
+}
+else if ($id)
+{
+ $result = $object->fetch($id);
+ if ($result > 0)
+ {
+ $head = establishment_prepare_head($object);
+
+ if ($action == 'edit')
+ {
+ dol_fiche_head($head, 'card', $langs->trans("Establishment"), 0, 'building@ihrm');
+
+ print '';
+ }
+ else
+ {
+ /*
+ * Confirm delete
+ */
+ if ($action == 'delete')
+ {
+ print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$id,$langs->trans("DeleteEstablishment"),$langs->trans("ConfirmDeleteEstablishment"),"confirm_delete");
+
+ }
+
+ dol_fiche_head($head, 'card', $langs->trans("Establishment"), 0, 'building@ihrm');
+
+ print '';
+
+ $linkback = ''.$langs->trans("BackToList").'';
+
+ // Ref
+ print '| '.$langs->trans("Ref").' | ';
+ print $object->rowid;
+ print ' | ';
+ print $linkback;
+ print ' |
';
+
+ // Name
+ print '';
+ print '| '.$langs->trans("Name").' | ';
+ print ''.$object->name.' | ';
+ print '
';
+
+ // Address
+ print '';
+ print '| '.$langs->trans("Address").' | ';
+ print ''.$object->address.' | ';
+ print '
';
+
+ // Zipcode
+ print '';
+ print '| '.$langs->trans("Zipcode").' | ';
+ print ''.$object->zip.' | ';
+ print '
';
+
+ // Town
+ print '';
+ print '| '.$langs->trans("Town").' | ';
+ print ''.$object->town.' | ';
+ print '
';
+
+ // Country
+ print '';
+ print '| '.$langs->trans("Country").' | ';
+ print ''.getCountry($object->fk_pays,1).' | ';
+ print '
';
+
+ // Statut
+ print '| '.$langs->trans("Status").' | '.$object->getLibStatut(4).' |
';
+
+ print "
";
+
+ dol_fiche_end();
+
+ /*
+ * Barre d'actions
+ */
+
+ print '';
+ }
+ }
+ else
+ {
+ dol_print_error($db);
+ }
+}
+
+llxFooter();
+
+$db->close();
diff --git a/htdocs/hrm/establishment/index.html b/htdocs/hrm/establishment/index.html
new file mode 100644
index 00000000000..e69de29bb2d
diff --git a/htdocs/hrm/establishment/info.php b/htdocs/hrm/establishment/info.php
new file mode 100644
index 00000000000..06ba9875e58
--- /dev/null
+++ b/htdocs/hrm/establishment/info.php
@@ -0,0 +1,59 @@
+
+ *
+ * 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 .
+ */
+
+/**
+ * \file htdocs/custom/ihrm/establishment/info.php
+ * \brief Page to show info of an establishment
+ */
+
+require '../../main.inc.php';
+
+require_once ('../core/lib/ihrm.lib.php');
+require_once ('../class/establishment.class.php');
+require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
+
+$langs->load("admin");
+$langs->load("compta");
+
+// Security check
+if (! $user->admin) accessforbidden();
+
+$id = GETPOST('id','int');
+
+// View
+llxHeader();
+
+if ($id)
+{
+ $object = new Establishment($db);
+ $object->fetch($id);
+ $object->info($id);
+
+ $head = establishment_prepare_head($object);
+
+ dol_fiche_head($head, 'info', $langs->trans("Establishment"), 0, 'building@ihrm');
+
+ print '| ';
+ dol_print_object_info($object);
+ print ' |
';
+
+ print '';
+}
+
+$db->close();
+
+llxFooter();
diff --git a/htdocs/hrm/index.html b/htdocs/hrm/index.html
new file mode 100644
index 00000000000..e69de29bb2d
diff --git a/htdocs/theme/eldy/img/object_building.png b/htdocs/theme/eldy/img/object_building.png
new file mode 100644
index 00000000000..c9d1539dddc
Binary files /dev/null and b/htdocs/theme/eldy/img/object_building.png differ
diff --git a/htdocs/theme/md/img/object_building.png b/htdocs/theme/md/img/object_building.png
new file mode 100644
index 00000000000..c9d1539dddc
Binary files /dev/null and b/htdocs/theme/md/img/object_building.png differ