diff --git a/htdocs/assets/class/assets.class.php b/htdocs/assets/class/asset.class.php
similarity index 100%
rename from htdocs/assets/class/assets.class.php
rename to htdocs/assets/class/asset.class.php
diff --git a/htdocs/assets/class/assets_type.class.php b/htdocs/assets/class/asset_type.class.php
similarity index 72%
rename from htdocs/assets/class/assets_type.class.php
rename to htdocs/assets/class/asset_type.class.php
index 5dd727ee950..9889ceeb5d1 100644
--- a/htdocs/assets/class/assets_type.class.php
+++ b/htdocs/assets/class/asset_type.class.php
@@ -16,21 +16,21 @@
*/
/**
- * \file htdocs/assets/class/assets_type.class.php
+ * \file htdocs/assets/class/asset_type.class.php
* \ingroup assets
- * \brief File of class to manage assets types
+ * \brief File of class to manage asset types
*/
require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php';
/**
- * Class to manage assets type
+ * Class to manage asset type
*/
-class AssetsType extends CommonObject
+class AssetType extends CommonObject
{
- public $table_element = 'assets_type';
- public $element = 'assets_type';
+ public $table_element = 'asset_type';
+ public $element = 'asset_type';
public $picto = 'group';
public $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
@@ -44,8 +44,8 @@ class AssetsType extends CommonObject
public $accountancy_code_depreciation_expense;
/** @var string Public note */
public $note;
- /** @var array Array of assets */
- public $assets=array();
+ /** @var array Array of asset */
+ public $asset=array();
/**
@@ -76,7 +76,7 @@ class AssetsType extends CommonObject
$this->db->begin();
- $sql = "INSERT INTO ".MAIN_DB_PREFIX."assets_type (";
+ $sql = "INSERT INTO ".MAIN_DB_PREFIX."asset_type (";
$sql.= "label";
$sql.= ", entity";
$sql.= ") VALUES (";
@@ -84,11 +84,11 @@ class AssetsType extends CommonObject
$sql.= ", ".$conf->entity;
$sql.= ")";
- dol_syslog("Assets_type::create", LOG_DEBUG);
+ dol_syslog("Asset_type::create", LOG_DEBUG);
$result = $this->db->query($sql);
if ($result)
{
- $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."assets_type");
+ $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."asset_type");
$result = $this->update($user,1);
if ($result < 0)
@@ -100,7 +100,7 @@ class AssetsType extends CommonObject
if (! $notrigger)
{
// Call trigger
- $result=$this->call_trigger('ASSETS_TYPE_CREATE',$user);
+ $result=$this->call_trigger('ASSET_TYPE_CREATE',$user);
if ($result < 0) { $error++; }
// End call triggers
}
@@ -142,7 +142,7 @@ class AssetsType extends CommonObject
$this->db->begin();
- $sql = "UPDATE ".MAIN_DB_PREFIX."assets_type ";
+ $sql = "UPDATE ".MAIN_DB_PREFIX."asset_type ";
$sql.= "SET ";
$sql.= "label = '".$this->db->escape($this->label) ."',";
$sql.= "accountancy_code_asset = '".$this->db->escape($this->accountancy_code_asset)."',";
@@ -156,8 +156,8 @@ class AssetsType extends CommonObject
$action='update';
// Actions on extra fields (by external module or standard code)
- $hookmanager->initHooks(array('assetstypedao'));
- $parameters=array('assetstype'=>$this->id);
+ $hookmanager->initHooks(array('assettypedao'));
+ $parameters=array('assettype'=>$this->id);
$reshook=$hookmanager->executeHooks('insertExtraFields',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
if (empty($reshook))
{
@@ -175,7 +175,7 @@ class AssetsType extends CommonObject
if (! $error && ! $notrigger)
{
// Call trigger
- $result=$this->call_trigger('ASSETS_TYPE_MODIFY',$user);
+ $result=$this->call_trigger('ASSET_TYPE_MODIFY',$user);
if ($result < 0) { $error++; }
// End call triggers
}
@@ -211,14 +211,14 @@ class AssetsType extends CommonObject
$error = 0;
- $sql = "DELETE FROM ".MAIN_DB_PREFIX."assets_type";
+ $sql = "DELETE FROM ".MAIN_DB_PREFIX."asset_type";
$sql.= " WHERE rowid = ".$this->id;
$resql=$this->db->query($sql);
if ($resql)
{
// Call trigger
- $result=$this->call_trigger('ASSETS_TYPE_DELETE',$user);
+ $result=$this->call_trigger('ASSET_TYPE_DELETE',$user);
if ($result < 0) { $error++; $this->db->rollback(); return -2; }
// End call triggers
@@ -234,7 +234,7 @@ class AssetsType extends CommonObject
}
/**
- * Fonction qui permet de recuperer le status de l'adherent
+ * Fonction qui permet de recuperer le status de l'immobilisation
*
* @param int $rowid Id of member type to load
* @return int <0 if KO, >0 if OK
@@ -242,10 +242,10 @@ class AssetsType extends CommonObject
function fetch($rowid)
{
$sql = "SELECT d.rowid, d.label as label, d.accountancy_code_asset, d.accountancy_code_depreciation_asset, d.accountancy_code_depreciation_expense, d.note";
- $sql .= " FROM ".MAIN_DB_PREFIX."assets_type as d";
+ $sql .= " FROM ".MAIN_DB_PREFIX."asset_type as d";
$sql .= " WHERE d.rowid = ".(int) $rowid;
- dol_syslog("Assets_type::fetch", LOG_DEBUG);
+ dol_syslog("Asset_type::fetch", LOG_DEBUG);
$resql=$this->db->query($sql);
if ($resql)
@@ -273,7 +273,7 @@ class AssetsType extends CommonObject
}
/**
- * Return list of assets' type
+ * Return list of asset's type
*
* @return array List of types of members
*/
@@ -281,11 +281,11 @@ class AssetsType extends CommonObject
{
global $conf,$langs;
- $assetstypes = array();
+ $assettypes = array();
$sql = "SELECT rowid, label as label";
- $sql.= " FROM ".MAIN_DB_PREFIX."assets_type";
- $sql.= " WHERE entity IN (".getEntity('assets_type').")";
+ $sql.= " FROM ".MAIN_DB_PREFIX."asset_type";
+ $sql.= " WHERE entity IN (".getEntity('asset_type').")";
$resql=$this->db->query($sql);
if ($resql)
@@ -299,7 +299,7 @@ class AssetsType extends CommonObject
{
$obj = $this->db->fetch_object($resql);
- $assetstypes[$obj->rowid] = $langs->trans($obj->label);
+ $assettypes[$obj->rowid] = $langs->trans($obj->label);
$i++;
}
}
@@ -308,7 +308,7 @@ class AssetsType extends CommonObject
{
print $this->db->error();
}
- return $assetstypes;
+ return $assettypes;
}
/**
@@ -317,19 +317,19 @@ class AssetsType extends CommonObject
* @param string $excludefilter Filter to exclude
* @param int $mode 0=Return array of asset instance
* 1=Return array of asset instance without extra data
- * 2=Return array of assets id only
- * @return mixed Array of assets or -1 on error
+ * 2=Return array of asset id only
+ * @return mixed Array of asset or -1 on error
*/
- function listAssetsForAssetsType($excludefilter='', $mode=0)
+ function listAssetForAssetType($excludefilter='', $mode=0)
{
global $conf, $user;
$ret=array();
$sql = "SELECT a.rowid";
- $sql.= " FROM ".MAIN_DB_PREFIX."assets as a";
- $sql.= " WHERE a.entity IN (".getEntity('assets').")";
- $sql.= " AND a.fk_assets_type = ".$this->id;
+ $sql.= " FROM ".MAIN_DB_PREFIX."asset as a";
+ $sql.= " WHERE a.entity IN (".getEntity('asset').")";
+ $sql.= " AND a.fk_asset_type = ".$this->id;
if (! empty($excludefilter)) $sql.=' AND ('.$excludefilter.')';
dol_syslog(get_class($this)."::listAssetsForGroup", LOG_DEBUG);
@@ -342,13 +342,13 @@ class AssetsType extends CommonObject
{
if ($mode < 2)
{
- $assetsstatic=new Assets($this->db);
+ $assetstatic=new Asset($this->db);
if ($mode == 1) {
- $assetsstatic->fetch($obj->rowid,'','','',false, false);
+ $assetstatic->fetch($obj->rowid,'','','',false, false);
} else {
- $assetsstatic->fetch($obj->rowid);
+ $assetstatic->fetch($obj->rowid);
}
- $ret[$obj->rowid]=$assetsstatic;
+ $ret[$obj->rowid]=$assetstatic;
}
else $ret[$obj->rowid]=$obj->rowid;
}
@@ -356,7 +356,7 @@ class AssetsType extends CommonObject
$this->db->free($resql);
- $this->assets=$ret;
+ $this->asset=$ret;
return $ret;
}
@@ -367,31 +367,31 @@ class AssetsType extends CommonObject
}
}
- /**
- * Return clicable name (with picto eventually)
- *
- * @param int $withpicto 0=No picto, 1=Include picto into link, 2=Only picto
- * @param int $maxlen length max label
- * @param int $notooltip 1=Disable tooltip
- * @return string String with URL
- */
- function getNomUrl($withpicto=0, $maxlen=0, $notooltip=0)
- {
- global $langs;
+ /**
+ * Return clicable name (with picto eventually)
+ *
+ * @param int $withpicto 0=No picto, 1=Include picto into link, 2=Only picto
+ * @param int $maxlen length max label
+ * @param int $notooltip 1=Disable tooltip
+ * @return string String with URL
+ */
+ function getNomUrl($withpicto=0, $maxlen=0, $notooltip=0)
+ {
+ global $langs;
- $result='';
- $label=$langs->trans("ShowTypeCard",$this->label);
+ $result='';
+ $label=$langs->trans("ShowTypeCard",$this->label);
- $linkstart = '';
- $linkend='';
+ $linkstart = '';
+ $linkend='';
- $result .= $linkstart;
- if ($withpicto) $result.=img_object(($notooltip?'':$label), ($this->picto?$this->picto:'generic'), ($notooltip?(($withpicto != 2) ? 'class="paddingright"' : ''):'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip"'), 0, 0, $notooltip?0:1);
- if ($withpicto != 2) $result.= ($maxlen?dol_trunc($this->label,$maxlen):$this->label);
- $result .= $linkend;
+ $result .= $linkstart;
+ if ($withpicto) $result.=img_object(($notooltip?'':$label), ($this->picto?$this->picto:'generic'), ($notooltip?(($withpicto != 2) ? 'class="paddingright"' : ''):'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip"'), 0, 0, $notooltip?0:1);
+ if ($withpicto != 2) $result.= ($maxlen?dol_trunc($this->label,$maxlen):$this->label);
+ $result .= $linkend;
- return $result;
- }
+ return $result;
+ }
/**
* Initialise an instance with random values.
@@ -409,11 +409,11 @@ class AssetsType extends CommonObject
$this->ref = 'ATSPEC';
$this->specimen=1;
- $this->label='ASSETS TYPE SPECIMEN';
+ $this->label='ASSET TYPE SPECIMEN';
$this->note='This is a note';
// Assets of this asset type is just me
- $this->assets=array(
+ $this->asset=array(
$user->id => $user
);
}
diff --git a/htdocs/assets/type.php b/htdocs/assets/type.php
index e5326029cfc..51445f86254 100644
--- a/htdocs/assets/type.php
+++ b/htdocs/assets/type.php
@@ -23,8 +23,8 @@
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/assets.lib.php';
-require_once DOL_DOCUMENT_ROOT.'/assets/class/assets.class.php';
-require_once DOL_DOCUMENT_ROOT.'/assets/class/assets_type.class.php';
+require_once DOL_DOCUMENT_ROOT.'/assets/class/asset.class.php';
+require_once DOL_DOCUMENT_ROOT.'/assets/class/asset_type.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
$langs->load("assets");
@@ -34,10 +34,7 @@ $action = GETPOST('action','alpha');
$cancel = GETPOST('cancel','alpha');
$backtopage = GETPOST('backtopage','alpha');
-$search_lastname = GETPOST('search_lastname','alpha');
-$search_login = GETPOST('search_login','alpha');
-$search_email = GETPOST('search_email','alpha');
-$type = GETPOST('type','alpha');
+$type = GETPOST('type','alpha');
$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit;
$sortfield = GETPOST("sortfield",'alpha');
@@ -51,33 +48,27 @@ if (! $sortorder) { $sortorder="DESC"; }
if (! $sortfield) { $sortfield="d.lastname"; }
$label=GETPOST("label","alpha");
-$subscription=GETPOST("subscription","int");
-$vote=GETPOST("vote","int");
$comment=GETPOST("comment");
-$mail_valid=GETPOST("mail_valid");
// Security check
-$result=restrictedArea($user,'assets',$rowid,'assets_type');
+$result=restrictedArea($user,'assets',$rowid,'asset_type');
-$object = new AssetsType($db);
+$object = new AssetType($db);
$extrafields = new ExtraFields($db);
// fetch optionals attributes and labels
-$extralabels=$extrafields->fetch_name_optionals_label('assets_type');
+$extralabels=$extrafields->fetch_name_optionals_label('asset_type');
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
{
- $search_lastname="";
- $search_login="";
- $search_email="";
- $type="";
- $sall="";
+ $type="";
+ $sall="";
}
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
-$hookmanager->initHooks(array('assetstypecard','globalcard'));
+$hookmanager->initHooks(array('assettypecard','globalcard'));
/*
@@ -112,7 +103,7 @@ if ($action == 'add' && $user->rights->assets->write)
setEventMessages($langs->trans("ErrorFieldRequired",$langs->transnoentities("Label")), null, 'errors');
}
else {
- $sql = "SELECT label FROM ".MAIN_DB_PREFIX."assets_type WHERE label='".$db->escape($object->label)."'";
+ $sql = "SELECT label FROM ".MAIN_DB_PREFIX."asset_type WHERE label='".$db->escape($object->label)."'";
$result = $db->query($sql);
if ($result) {
$num = $db->num_rows($result);
@@ -203,14 +194,14 @@ $helpurl='';
llxHeader('',$langs->trans("AssetsTypeSetup"),$helpurl);
-// List of assets type
+// List of asset type
if (! $rowid && $action != 'create' && $action != 'edit')
{
//dol_fiche_head('');
$sql = "SELECT d.rowid, d.label as label, d.accountancy_code_asset, d.accountancy_code_depreciation_asset, d.accountancy_code_depreciation_expense, d.note";
- $sql.= " FROM ".MAIN_DB_PREFIX."assets_type as d";
- $sql.= " WHERE d.entity IN (".getEntity('assets_type').")";
+ $sql.= " FROM ".MAIN_DB_PREFIX."asset_type as d";
+ $sql.= " WHERE d.entity IN (".getEntity('asset_type').")";
$result = $db->query($sql);
if ($result)
@@ -228,10 +219,10 @@ if (! $rowid && $action != 'create' && $action != 'edit')
print '';
print '';
print '';
- print '';
+ print '';
print '';
- print_barre_liste($langs->trans("AssetsTypes"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_generic.png', 0, '', '', $limit);
+ print_barre_liste($langs->trans("AssetsTypes"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_generic.png', 0, '', '', $limit);
$moreforfilter = '';
@@ -246,19 +237,19 @@ if (! $rowid && $action != 'create' && $action != 'edit')
print '
| ';
print "\n";
- $assetstype = new AssetsType($db);
+ $assettype = new AssetType($db);
while ($i < $num)
{
$objp = $db->fetch_object($result);
- $assetstype->id = $objp->rowid;
- $assetstype->ref = $objp->rowid;
- $assetstype->label = $objp->rowid;
+ $assettype->id = $objp->rowid;
+ $assettype->ref = $objp->rowid;
+ $assettype->label = $objp->rowid;
print '';
print '| ';
- print $assetstype->getNomUrl(1);
+ print $assettype->getNomUrl(1);
//rowid.'">'.img_object($langs->trans("ShowType"),'group').' '.$objp->rowid.'
print ' | ';
print ''.dol_escape_htmltag($objp->label).' | ';
@@ -298,7 +289,7 @@ if ($action == 'create')
print '';
print '';
- dol_fiche_head('');
+ dol_fiche_head('');
print '';
print '';
@@ -325,7 +316,7 @@ if ($action == 'create')
// Other attributes
$parameters=array();
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$act,$action); // Note that $action and $object may have been modified by hook
- print $hookmanager->resPrint;
+ print $hookmanager->resPrint;
if (empty($reshook) && ! empty($extrafields->attribute_label))
{
print $object->showOptionals($extrafields,'edit');
@@ -426,17 +417,17 @@ if ($rowid > 0)
// Show list of members (nearly same code than in page list.php)
- $assetstypestatic=new AdherentType($db);
+ $assettypestatic=new AssetType($db);
$now=dol_now();
- $sql = "SELECT d.rowid, d.login, d.firstname, d.lastname, d.societe, ";
+ $sql = "SELECT a.rowid, d.login, d.firstname, d.lastname, d.societe, ";
$sql.= " d.datefin,";
- $sql.= " d.email, d.fk_adherent_type as type_id, d.morphy, d.statut,";
- $sql.= " t.libelle as type, t.subscription";
- $sql.= " FROM ".MAIN_DB_PREFIX."adherent as d, ".MAIN_DB_PREFIX."adherent_type as t";
- $sql.= " WHERE d.fk_adherent_type = t.rowid ";
- $sql.= " AND d.entity IN (".getEntity('adherent').")";
+ $sql.= " a.fk_asset_type as type_id,";
+ $sql.= " t.label as type";
+ $sql.= " FROM ".MAIN_DB_PREFIX."asset as a, ".MAIN_DB_PREFIX."asset_type as t";
+ $sql.= " WHERE a.fk_asset_type = t.rowid ";
+ $sql.= " AND a.entity IN (".getEntity('asset').")";
$sql.= " AND t.rowid = ".$object->id;
if ($sall)
{
@@ -444,7 +435,7 @@ if ($rowid > 0)
}
if ($status != '')
{
- $sql.= natural_search('d.statut', $status, 2);
+ $sql.= natural_search('d.statut', $status, 2);
}
if ($action == 'search')
{
@@ -467,19 +458,19 @@ if ($rowid > 0)
}
if ($filter == 'uptodate')
{
- $sql.=" AND datefin >= '".$db->idate($now)."'";
+ $sql.=" AND datefin >= '".$db->idate($now)."'";
}
if ($filter == 'outofdate')
{
- $sql.=" AND datefin < '".$db->idate($now)."'";
+ $sql.=" AND datefin < '".$db->idate($now)."'";
}
// Count total nb of records
$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$resql = $db->query($sql);
- if ($resql) $nbtotalofrecords = $db->num_rows($result);
- else dol_print_error($db);
+ if ($resql) $nbtotalofrecords = $db->num_rows($result);
+ else dol_print_error($db);
}
// Add order and limit
$sql.= " ".$db->order($sortfield,$sortorder);
@@ -488,54 +479,54 @@ if ($rowid > 0)
$resql = $db->query($sql);
if ($resql)
{
- $num = $db->num_rows($resql);
- $i = 0;
+ $num = $db->num_rows($resql);
+ $i = 0;
- $titre=$langs->trans("MembersList");
- if ($status != '')
- {
- if ($status == '-1,1') { $titre=$langs->trans("MembersListQualified"); }
- else if ($status == '-1') { $titre=$langs->trans("MembersListToValid"); }
- else if ($status == '1' && ! $filter) { $titre=$langs->trans("MembersListValid"); }
- else if ($status == '1' && $filter=='uptodate') { $titre=$langs->trans("MembersListUpToDate"); }
- else if ($status == '1' && $filter=='outofdate') { $titre=$langs->trans("MembersListNotUpToDate"); }
- else if ($status == '0') { $titre=$langs->trans("MembersListResiliated"); }
- }
- elseif ($action == 'search')
- {
- $titre=$langs->trans("MembersListQualified");
- }
+ $titre=$langs->trans("AssetsList");
+ if ($status != '')
+ {
+ if ($status == '-1,1') { $titre=$langs->trans("MembersListQualified"); }
+ else if ($status == '-1') { $titre=$langs->trans("MembersListToValid"); }
+ else if ($status == '1' && ! $filter) { $titre=$langs->trans("MembersListValid"); }
+ else if ($status == '1' && $filter=='uptodate') { $titre=$langs->trans("MembersListUpToDate"); }
+ else if ($status == '1' && $filter=='outofdate') { $titre=$langs->trans("MembersListNotUpToDate"); }
+ else if ($status == '0') { $titre=$langs->trans("MembersListResiliated"); }
+ }
+ elseif ($action == 'search')
+ {
+ $titre=$langs->trans("MembersListQualified");
+ }
- if ($type > 0)
- {
- $assetstype=new AdherentType($db);
- $result=$assetstype->fetch($type);
- $titre.=" (".$assetstype->label.")";
- }
+ if ($type > 0)
+ {
+ $assettype=new AssetType($db);
+ $result=$assettype->fetch($type);
+ $titre.=" (".$assettype->label.")";
+ }
- $param="&rowid=".$object->id;
- if (! empty($status)) $param.="&status=".$status;
- if (! empty($search_lastname)) $param.="&search_lastname=".$search_lastname;
- if (! empty($search_firstname)) $param.="&search_firstname=".$search_firstname;
- if (! empty($search_login)) $param.="&search_login=".$search_login;
- if (! empty($search_email)) $param.="&search_email=".$search_email;
- if (! empty($filter)) $param.="&filter=".$filter;
+ $param="&rowid=".$object->id;
+ if (! empty($status)) $param.="&status=".$status;
+ if (! empty($search_lastname)) $param.="&search_lastname=".$search_lastname;
+ if (! empty($search_firstname)) $param.="&search_firstname=".$search_firstname;
+ if (! empty($search_login)) $param.="&search_login=".$search_login;
+ if (! empty($search_email)) $param.="&search_email=".$search_email;
+ if (! empty($filter)) $param.="&filter=".$filter;
- if ($sall)
- {
- print $langs->trans("Filter")." (".$langs->trans("Lastname").", ".$langs->trans("Firstname").", ".$langs->trans("EMail").", ".$langs->trans("Address")." ".$langs->trans("or")." ".$langs->trans("Town")."): ".$sall;
- }
+ if ($sall)
+ {
+ print $langs->trans("Filter")." (".$langs->trans("Lastname").", ".$langs->trans("Firstname").", ".$langs->trans("EMail").", ".$langs->trans("Address")." ".$langs->trans("or")." ".$langs->trans("Town")."): ".$sall;
+ }
print '';
if ($num > $conf->liste_limit)
{
- print_barre_liste('',$page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num,$nbtotalofrecords,'');
+ print_barre_liste('',$page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num,$nbtotalofrecords,'');
}
}
else
{
- dol_print_error($db);
+ dol_print_error($db);
}
}
@@ -723,10 +714,10 @@ if ($rowid > 0)
// Other attributes
$parameters=array();
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$act,$action); // Note that $action and $object may have been modified by hook
- print $hookmanager->resPrint;
+ print $hookmanager->resPrint;
if (empty($reshook) && ! empty($extrafields->attribute_label))
{
- print $object->showOptionals($extrafields,'edit');
+ print $object->showOptionals($extrafields,'edit');
}
print '
';
diff --git a/htdocs/install/mysql/migration/7.0.0-8.0.0.sql b/htdocs/install/mysql/migration/7.0.0-8.0.0.sql
index 9047ab050d3..c9ef9ff828d 100644
--- a/htdocs/install/mysql/migration/7.0.0-8.0.0.sql
+++ b/htdocs/install/mysql/migration/7.0.0-8.0.0.sql
@@ -340,15 +340,16 @@ INSERT INTO llx_c_email_templates (entity,module,type_template,lang,private,fk_u
INSERT INTO llx_c_email_templates (entity,module,type_template,lang,private,fk_user,datec,label,position,enabled,active,topic,content,content_lines,joinfiles) VALUES (0,'adherent','member','',0,null,null,'(SendingAnEMailToMember)' ,60,1,1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(CardContent)__', '__(Hello)__,
\n\n__(ThisIsContentOfYourCard)__
\n__(ID)__ : __ID__
\n__(Civiliyty)__ : __MEMBER_CIVILITY__
\n__(Firstname)__ : __MEMBER_FIRSTNAME__
\n__(Lastname)__ : __MEMBER_LASTNAME__
\n__(Fullname)__ : __MEMBER_FULLNAME__
\n__(Company)__ : __MEMBER_COMPANY__
\n__(Address)__ : __MEMBER_ADDRESS__
\n__(Zip)__ : __MEMBER_ZIP__
\n__(Town)__ : __MEMBER_TOWN__
\n__(Country)__ : __MEMBER_COUNTRY__
\n__(Email)__ : __MEMBER_EMAIL__
\n__(Birthday)__ : __MEMBER_BIRTH__
\n__(Photo)__ : __MEMBER_PHOTO__
\n__(Login)__ : __MEMBER_LOGIN__
\n__(Password)__ : __MEMBER_PASSWORD__
\n__(Phone)__ : __MEMBER_PHONE__
\n__(PhonePerso)__ : __MEMBER_PHONEPRO__
\n__(PhoneMobile)__ : __MEMBER_PHONEMOBILE__
\n__(Sincerely)__
__USER_SIGNATURE__',null, 1);
ALTER TABLE llx_product ADD COLUMN fk_default_warehouse integer DEFAULT NULL;
-ALTER TABLE llx_product ADD CONSTRAINT fk_product_default_warehouse FOREIGN KEY (fk_default_warehouse) REFERENCES llx_entrepot (rowid);
+ALTER TABLE llx_product ADD CONSTRAINT fk_product_default_warehouse FOREIGN KEY (fk_default_warehouse) REFERENCES llx_entrepot (rowid);
-- Assets
-CREATE TABLE llx_assets(
+CREATE TABLE llx_asset(
rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL,
ref varchar(128) NOT NULL,
entity integer DEFAULT 1 NOT NULL,
label varchar(255),
amount double(24,8) DEFAULT NULL,
+ fk_asset_type integer NOT NULL,
fk_soc integer,
description text,
note_public text,
@@ -361,13 +362,15 @@ CREATE TABLE llx_assets(
status integer NOT NULL
) ENGINE=innodb;
-ALTER TABLE llx_assets ADD INDEX idx_assets_rowid (rowid);
-ALTER TABLE llx_assets ADD INDEX idx_assets_ref (ref);
-ALTER TABLE llx_assets ADD INDEX idx_assets_entity (entity);
-ALTER TABLE llx_assets ADD INDEX idx_assets_fk_soc (fk_soc);
-ALTER TABLE llx_assets ADD INDEX idx_assets_status (status);
+ALTER TABLE llx_asset ADD INDEX idx_asset_rowid (rowid);
+ALTER TABLE llx_asset ADD INDEX idx_asset_ref (ref);
+ALTER TABLE llx_asset ADD INDEX idx_asset_entity (entity);
+ALTER TABLE llx_asset ADD INDEX idx_asset_fk_soc (fk_soc);
-create table llx_assets_extrafields
+ALTER TABLE llx_asset ADD INDEX idx_asset_fk_asset_type (fk_asset_type);
+ALTER TABLE llx_asset ADD CONSTRAINT fk_asset_asset_type FOREIGN KEY (fk_asset_type) REFERENCES llx_asset_type (rowid);
+
+create table llx_asset_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
tms timestamp,
@@ -375,12 +378,11 @@ create table llx_assets_extrafields
import_key varchar(14)
) ENGINE=innodb;
-create table llx_assets_type
+create table llx_asset_type
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
entity integer DEFAULT 1 NOT NULL, -- multi company id
tms timestamp,
- statut smallint NOT NULL DEFAULT 0,
label varchar(50) NOT NULL,
accountancy_code_asset varchar(32),
accountancy_code_depreciation_asset varchar(32),
@@ -388,9 +390,9 @@ create table llx_assets_type
note text
)ENGINE=innodb;
-ALTER TABLE llx_assets_type ADD UNIQUE INDEX uk_asset_type_label (label, entity);
+ALTER TABLE llx_asset_type ADD UNIQUE INDEX uk_asset_type_label (label, entity);
-create table llx_assets_type_extrafields
+create table llx_asset_type_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
tms timestamp,
@@ -398,6 +400,6 @@ create table llx_assets_type_extrafields
import_key varchar(14) -- import key
) ENGINE=innodb;
-ALTER TABLE llx_assets_type_extrafields ADD INDEX idx_assets_type_extrafields (fk_object);
+ALTER TABLE llx_asset_type_extrafields ADD INDEX idx_asset_type_extrafields (fk_object);
INSERT INTO llx_accounting_journal (rowid, code, label, nature, active) VALUES (7,'INV', 'Inventory journal', 8, 1);
diff --git a/htdocs/install/mysql/tables/llx_assets.key.sql b/htdocs/install/mysql/tables/llx_asset.key.sql
similarity index 62%
rename from htdocs/install/mysql/tables/llx_assets.key.sql
rename to htdocs/install/mysql/tables/llx_asset.key.sql
index 495a092244b..6befef7455f 100644
--- a/htdocs/install/mysql/tables/llx_assets.key.sql
+++ b/htdocs/install/mysql/tables/llx_asset.key.sql
@@ -14,8 +14,11 @@
-- along with this program. If not, see http://www.gnu.org/licenses/.
-ALTER TABLE llx_assets ADD INDEX idx_assets_rowid (rowid);
-ALTER TABLE llx_assets ADD INDEX idx_assets_ref (ref);
-ALTER TABLE llx_assets ADD INDEX idx_assets_entity (entity);
-ALTER TABLE llx_assets ADD INDEX idx_assets_fk_soc (fk_soc);
-ALTER TABLE llx_assets ADD INDEX idx_assets_status (status);
\ No newline at end of file
+ALTER TABLE llx_asset ADD INDEX idx_asset_rowid (rowid);
+ALTER TABLE llx_asset ADD INDEX idx_asset_ref (ref);
+ALTER TABLE llx_asset ADD INDEX idx_asset_entity (entity);
+ALTER TABLE llx_asset ADD INDEX idx_asset_fk_soc (fk_soc);
+
+ALTER TABLE llx_asset ADD INDEX idx_asset_fk_asset_type (fk_asset_type);
+ALTER TABLE llx_asset ADD CONSTRAINT fk_asset_asset_type FOREIGN KEY (fk_asset_type) REFERENCES llx_asset_type (rowid);
+
diff --git a/htdocs/install/mysql/tables/llx_assets.sql b/htdocs/install/mysql/tables/llx_asset.sql
similarity index 95%
rename from htdocs/install/mysql/tables/llx_assets.sql
rename to htdocs/install/mysql/tables/llx_asset.sql
index 1e72664be95..a583bd9275e 100644
--- a/htdocs/install/mysql/tables/llx_assets.sql
+++ b/htdocs/install/mysql/tables/llx_asset.sql
@@ -14,12 +14,13 @@
-- along with this program. If not, see http://www.gnu.org/licenses/.
-CREATE TABLE llx_assets(
+CREATE TABLE llx_asset(
rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL,
ref varchar(128) NOT NULL,
entity integer DEFAULT 1 NOT NULL,
label varchar(255),
amount double(24,8) DEFAULT NULL,
+ fk_asset_type integer NOT NULL,
fk_soc integer,
description text,
note_public text,
diff --git a/htdocs/install/mysql/tables/llx_assets_extrafields.sql b/htdocs/install/mysql/tables/llx_asset_extrafields.sql
similarity index 96%
rename from htdocs/install/mysql/tables/llx_assets_extrafields.sql
rename to htdocs/install/mysql/tables/llx_asset_extrafields.sql
index dad66c47456..bc5eedae6d6 100644
--- a/htdocs/install/mysql/tables/llx_assets_extrafields.sql
+++ b/htdocs/install/mysql/tables/llx_asset_extrafields.sql
@@ -13,7 +13,7 @@
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see http://www.gnu.org/licenses/.
-create table llx_assets_extrafields
+create table llx_asset_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
tms timestamp,
diff --git a/htdocs/install/mysql/tables/llx_assets_type.key.sql b/htdocs/install/mysql/tables/llx_asset_type.key.sql
similarity index 89%
rename from htdocs/install/mysql/tables/llx_assets_type.key.sql
rename to htdocs/install/mysql/tables/llx_asset_type.key.sql
index 782ae72c083..2186a4aafd2 100644
--- a/htdocs/install/mysql/tables/llx_assets_type.key.sql
+++ b/htdocs/install/mysql/tables/llx_asset_type.key.sql
@@ -13,4 +13,4 @@
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see .
-ALTER TABLE llx_assets_type ADD UNIQUE INDEX uk_asset_type_label (label, entity);
+ALTER TABLE llx_asset_type ADD UNIQUE INDEX uk_asset_type_label (label, entity);
diff --git a/htdocs/install/mysql/tables/llx_assets_type.sql b/htdocs/install/mysql/tables/llx_asset_type.sql
similarity index 97%
rename from htdocs/install/mysql/tables/llx_assets_type.sql
rename to htdocs/install/mysql/tables/llx_asset_type.sql
index d637085488b..6b6a8b23db1 100644
--- a/htdocs/install/mysql/tables/llx_assets_type.sql
+++ b/htdocs/install/mysql/tables/llx_asset_type.sql
@@ -13,7 +13,7 @@
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see .
-create table llx_assets_type
+create table llx_asset_type
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
entity integer DEFAULT 1 NOT NULL, -- multi company id
diff --git a/htdocs/install/mysql/tables/llx_assets_type_extrafields.key.sql b/htdocs/install/mysql/tables/llx_asset_type_extrafields.key.sql
similarity index 88%
rename from htdocs/install/mysql/tables/llx_assets_type_extrafields.key.sql
rename to htdocs/install/mysql/tables/llx_asset_type_extrafields.key.sql
index 461946b9819..dbcc2500df8 100644
--- a/htdocs/install/mysql/tables/llx_assets_type_extrafields.key.sql
+++ b/htdocs/install/mysql/tables/llx_asset_type_extrafields.key.sql
@@ -14,4 +14,4 @@
-- along with this program. If not, see .
-ALTER TABLE llx_assets_type_extrafields ADD INDEX idx_assets_type_extrafields (fk_object);
+ALTER TABLE llx_asset_type_extrafields ADD INDEX idx_asset_type_extrafields (fk_object);
diff --git a/htdocs/install/mysql/tables/llx_assets_type_extrafields.sql b/htdocs/install/mysql/tables/llx_asset_type_extrafields.sql
similarity index 95%
rename from htdocs/install/mysql/tables/llx_assets_type_extrafields.sql
rename to htdocs/install/mysql/tables/llx_asset_type_extrafields.sql
index 8fcb7c51d41..1b98bd3f524 100644
--- a/htdocs/install/mysql/tables/llx_assets_type_extrafields.sql
+++ b/htdocs/install/mysql/tables/llx_asset_type_extrafields.sql
@@ -13,7 +13,7 @@
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see .
-create table llx_assets_type_extrafields
+create table llx_asset_type_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
tms timestamp,