* Finish task #68707.
This commit is contained in:
@@ -105,6 +105,45 @@ class zahost extends control
|
||||
$this->display();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Delete host.
|
||||
*
|
||||
* @param int $assetID
|
||||
* @param string $confirm
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function delete($assetID, $confirm = 'no')
|
||||
{
|
||||
if($confirm == 'no')
|
||||
{
|
||||
die(js::confirm($this->lang->zahost->confirmDelete, inlink('delete', "assetID=$assetID&confirm=yes")));
|
||||
}
|
||||
|
||||
$this->dao->update(TABLE_ASSET)->set('deleted')->eq(1)->where('id')->eq($assetID)->exec();
|
||||
$this->loadModel('action')->create('zahost', $assetID, 'deleted');
|
||||
|
||||
/* if ajax request, send result. */
|
||||
if($this->server->ajax)
|
||||
{
|
||||
if(dao::isError())
|
||||
{
|
||||
$response['result'] = 'fail';
|
||||
$response['message'] = dao::getError();
|
||||
}
|
||||
else
|
||||
{
|
||||
$response['result'] = 'success';
|
||||
$response['message'] = '';
|
||||
}
|
||||
$this->send($response);
|
||||
}
|
||||
|
||||
if(isonlybody())die(js::reload('parent.parent'));
|
||||
die(js::locate($this->createLink('zahost', 'browse'), 'parent'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Create template.
|
||||
*
|
||||
|
||||
@@ -72,7 +72,7 @@
|
||||
<td><?php echo $host->registerDate;?></td>
|
||||
<td class='c-actions'>
|
||||
<?php common::printIcon('zahost', 'edit', "hostID={$host->hostID}", $host, 'list');?>
|
||||
<?php if(common::hasPriv('zahost', 'delete')) echo html::a($this->createLink('zahost', 'delete', "hostID={$host->hostID}"), '<i class="icon-trash"></i>', 'hiddenwin', "title='{$lang->zahost->delete}' class='btn'");;?>
|
||||
<?php if(common::hasPriv('zahost', 'delete')) echo html::a($this->createLink('zahost', 'delete', "hostID={$host->id}"), '<i class="icon-trash"></i>', 'hiddenwin', "title='{$lang->zahost->delete}' class='btn'");;?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach;?>
|
||||
|
||||
Reference in New Issue
Block a user