Add llx_entity for better management entities
This commit is contained in:
parent
421d0fcd5d
commit
1383e9c2e1
@ -42,6 +42,7 @@ $mc = new Multicompany($db);
|
||||
if ($_GET["action"] == 'setactive')
|
||||
{
|
||||
$mc->setEntity($_GET['id'],'active',$_GET["value"]);
|
||||
if ($_GET["value"] == 0) $mc->setEntity($_GET['id'],'visible',$_GET["value"]);
|
||||
}
|
||||
|
||||
if ($_GET["action"] == 'setvisible')
|
||||
|
||||
@ -158,7 +158,7 @@ function dol_loginfunction($langs,$conf,$mysoc)
|
||||
require_once(DOL_DOCUMENT_ROOT.'/multicompany/multicompany.class.php');
|
||||
|
||||
$mc = new Multicompany($db);
|
||||
$mc->getEntities();
|
||||
$mc->getEntities(0,1);
|
||||
|
||||
$select_entity=$mc->select_entities($mc->entities,$lastentity,'tabindex="3"');
|
||||
}
|
||||
|
||||
@ -131,12 +131,13 @@ class Multicompany
|
||||
/**
|
||||
* \brief List of entities
|
||||
*/
|
||||
function getEntities($details=0)
|
||||
function getEntities($details=0,$visible=0)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
$sql = "SELECT rowid, label, description, visible, active";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."entity";
|
||||
if ($visible) $sql.= " WHERE visible = 1";
|
||||
|
||||
$result = $this->db->query($sql);
|
||||
if ($result)
|
||||
|
||||
@ -44,7 +44,11 @@
|
||||
{if $entities[mc].visible}
|
||||
<a href="{$smarty.server.SCRIPT_NAME}?id={$entities[mc].id}&action=setvisible&value=0">{$img_on}</a>
|
||||
{else}
|
||||
<a href="{$smarty.server.SCRIPT_NAME}?id={$entities[mc].id}&action=setvisible&value=1">{$img_off}</a>
|
||||
{if $entities[mc].active}
|
||||
<a href="{$smarty.server.SCRIPT_NAME}?id={$entities[mc].id}&action=setvisible&value=1">{$img_off}</a>
|
||||
{else}
|
||||
{$img_off}
|
||||
{/if}
|
||||
{/if}
|
||||
|
||||
</td>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user