* code for task#1657.

This commit is contained in:
xia0ta0
2013-07-31 17:42:11 +08:00
parent d4903c510a
commit 4e787181d7
2 changed files with 5 additions and 38 deletions
-32
View File
@@ -27,35 +27,3 @@ $(function(){
browseBySearch();
}
});
/**
* Delete doc.
*
* @param int $docID
* @access public
* @return void
*/
function deleteDoc(docID)
{
if(confirm(confirmDelete))
{
url = createLink('doc', 'delete','docID=' + docID + '&confrim=yes');
$.ajax(
{
type: 'GET',
url: url,
dataType: 'json',
success: function(data)
{
if(data.result == 'success')
{
$('#docbox').load(request + ' #doclist', function()
{
$('.colored').colorize();
$('tfoot td').css('background', 'white').unbind('click').unbind('hover');
});
}
}
});
}
}
+5 -6
View File
@@ -15,7 +15,6 @@
<?php include '../../common/view/treeview.html.php';?>
<?php include '../../common/view/colorize.html.php';?>
<?php js::set('confirmDelete', $lang->doc->confirmDelete)?>
<?php js::set('request', $this->app->getURI(true))?>
<script language='Javascript'>
var browseType = '<?php echo $browseType;?>';
</script>
@@ -43,8 +42,8 @@ var browseType = '<?php echo $browseType;?>';
</div>
</td>
<td class='divider'></td>
<td id='docbox'>
<table class='table-1 fixed colored tablesorter datatable' id='doclist'>
<td>
<table class='table-1 fixed colored tablesorter datatable' id='docList'>
<thead>
<tr class='colhead'>
<?php $vars = "libID=$libID&module=$moduleID&productID=$productID&projectID=$projectID&browseType=$browseType&param=$param&orderBy=%s&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}";?>
@@ -70,9 +69,9 @@ var browseType = '<?php echo $browseType;?>';
<td><?php echo date("m-d H:i", strtotime($doc->addedDate));?></td>
<td>
<?php
$vars = "doc={$doc->id}";
common::printIcon('doc', 'edit', $vars, '', 'list');
echo html::a("javascript:deleteDoc($doc->id)", '&nbsp;', '', "class='icon-green-common-delete' title='{$lang->doc->delete}'");
common::printIcon('doc', 'edit', "doc={$doc->id}", '', 'list');
$deleteURL = $this->createLink('doc', 'delete', "docID=$doc->id&confirm=yes");
echo html::a("javascript:ajaxDelete(\"$deleteURL\",\"docList\",confirmDelete)", '&nbsp;', '', "class='icon-green-common-delete' title='{$lang->doc->delete}'");
?>
</td>
</tr>