mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-02-08 00:52:01 +01:00
Correct old code
This commit is contained in:
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/hrm/admin/admin_ihrm.php
|
||||
* \file htdocs/hrm/admin/admin_hrm.php
|
||||
* \ingroup HRM
|
||||
* \brief HRM module setup page
|
||||
*/
|
||||
|
||||
@@ -16,8 +16,8 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/custom/ihrm/class/establishment.class.php
|
||||
* \ingroup iHRM
|
||||
* \file htdocs/hrm/class/establishment.class.php
|
||||
* \ingroup HRM
|
||||
* \brief File of class to manage establishments
|
||||
*/
|
||||
|
||||
@@ -29,7 +29,7 @@ require_once DOL_DOCUMENT_ROOT .'/core/class/commonobject.class.php';
|
||||
class Establishment extends CommonObject
|
||||
{
|
||||
public $element='establishment';
|
||||
public $table_element='ihrm_establishment';
|
||||
public $table_element='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
|
||||
@@ -77,7 +77,7 @@ class Establishment extends CommonObject
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."ihrm_establishment (";
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."establishment (";
|
||||
$sql.= "name";
|
||||
$sql.= ", address";
|
||||
$sql.= ", zip";
|
||||
@@ -107,7 +107,7 @@ class Establishment extends CommonObject
|
||||
}
|
||||
|
||||
if (! $error) {
|
||||
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX . "ihrm_establishment");
|
||||
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX . "establishment");
|
||||
}
|
||||
|
||||
// Commit or rollback
|
||||
@@ -143,7 +143,7 @@ class Establishment extends CommonObject
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."ihrm_establishment";
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."establishment";
|
||||
$sql .= " SET name = '".$this->name."'";
|
||||
$sql .= ", address = '".$this->address."'";
|
||||
$sql .= ", zip = '".$this->zip."'";
|
||||
@@ -173,7 +173,7 @@ class Establishment extends CommonObject
|
||||
function fetch($id)
|
||||
{
|
||||
$sql = "SELECT rowid, name, address, zip, town, statut";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."ihrm_establishment";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."establishment";
|
||||
$sql.= " WHERE rowid = ".$id;
|
||||
|
||||
dol_syslog(get_class($this)."::fetch", LOG_DEBUG);
|
||||
@@ -208,7 +208,7 @@ class Establishment extends CommonObject
|
||||
{
|
||||
$this->db->begin();
|
||||
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."ihrm_establishment WHERE rowid = ".$id;
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."establishment WHERE rowid = ".$id;
|
||||
|
||||
dol_syslog(get_class($this)."::delete", LOG_DEBUG);
|
||||
$result = $this->db->query($sql);
|
||||
@@ -286,7 +286,7 @@ class Establishment extends CommonObject
|
||||
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.= ' FROM '.MAIN_DB_PREFIX.'establishment as e';
|
||||
$sql.= ' WHERE e.rowid = '.$id;
|
||||
|
||||
dol_syslog(get_class($this)."::fetch info", LOG_DEBUG);
|
||||
|
||||
@@ -16,22 +16,17 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/custom/ihrm/establishment/card.php
|
||||
* \file htdocs/hrm/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('../../main.inc.php');
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/hrm.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/hrm/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");
|
||||
$langs->load("hrm");
|
||||
|
||||
// Security check
|
||||
if (! $user->admin) accessforbidden();
|
||||
@@ -267,7 +262,7 @@ else if ($id)
|
||||
|
||||
if ($action == 'edit')
|
||||
{
|
||||
dol_fiche_head($head, 'card', $langs->trans("Establishment"), 0, 'building@ihrm');
|
||||
dol_fiche_head($head, 'card', $langs->trans("Establishment"), 0, 'building');
|
||||
|
||||
print '<form name="update" action="' . $_SERVER["PHP_SELF"] . '" method="POST">' . "\n";
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
@@ -344,7 +339,7 @@ else if ($id)
|
||||
|
||||
}
|
||||
|
||||
dol_fiche_head($head, 'card', $langs->trans("Establishment"), 0, 'building@ihrm');
|
||||
dol_fiche_head($head, 'card', $langs->trans("Establishment"), 0, 'building');
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
|
||||
@@ -16,18 +16,16 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/custom/ihrm/establishment/info.php
|
||||
* \file htdocs/hrm/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';
|
||||
require('../../main.inc.php');
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/hrm.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/hrm/class/establishment.class.php';
|
||||
|
||||
$langs->load("admin");
|
||||
$langs->load("compta");
|
||||
$langs->load("hrm");
|
||||
|
||||
// Security check
|
||||
if (! $user->admin) accessforbidden();
|
||||
@@ -45,7 +43,7 @@ if ($id)
|
||||
|
||||
$head = establishment_prepare_head($object);
|
||||
|
||||
dol_fiche_head($head, 'info', $langs->trans("Establishment"), 0, 'building@ihrm');
|
||||
dol_fiche_head($head, 'info', $langs->trans("Establishment"), 0, 'building');
|
||||
|
||||
print '<table width="100%"><tr><td>';
|
||||
dol_print_object_info($object);
|
||||
|
||||
Reference in New Issue
Block a user