issue 70 change list check all, because session not use.

git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@8847 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
ovclas 2011-08-23 11:36:03 +00:00
parent 569e972e07
commit 85f921f9e9
15 changed files with 66 additions and 107 deletions

View file

@ -1747,19 +1747,12 @@ class documentController extends document {
function procDocumentGetList()
{
if(!Context::get('is_logged')) return new Object(-1,'msg_not_permitted');
// Taken from a list of selected sessions
$flagList = $_SESSION['document_management'];
if(count($flagList)) {
foreach($flagList as $key => $val) {
if(!is_bool($val)) continue;
$documentSrlList[] = $key;
}
}
$documentSrls = Context::get('document_srls');
if($documentSrls) $documentSrlList = explode(',', $documentSrls);
if(count($documentSrlList) > 0) {
$oDocumentModel = &getModel('document');
$documentList = $oDocumentModel->getDocuments($documentSrlList, $this->grant->is_admin);
$this->add('document_list', $documentList);
}
else
{
@ -1767,6 +1760,7 @@ class documentController extends document {
$documentList = array();
$this->setMessage($lang->no_documents);
}
$this->add('document_list', $documentList);
}
/**

View file

@ -28,7 +28,7 @@
<th scope="col">{$lang->date}</th>
<th scope="col">{$lang->ipaddress}</th>
<th scope="col">{$lang->status}</th>
<th scope="col"><input type="checkbox" title="Check All" /></th>
<th scope="col"><input type="checkbox" data-name="cart" title="Check All" /></th>
</tr>
</thead>
<tfoot>
@ -40,7 +40,7 @@
<th scope="col">{$lang->date}</th>
<th scope="col">{$lang->ipaddress}</th>
<th scope="col">{$lang->status}</th>
<th scope="col"><input type="checkbox" title="Check All" /></th>
<th scope="col"><input type="checkbox" data-name="cart" title="Check All" /></th>
</tr>
</tfoot>
<tbody>
@ -53,7 +53,7 @@
<td>{$oDocument->getRegdate("Y-m-d H:i")}</td>
<td><a href="{getUrl('search_target','ipaddress','search_keyword',$oDocument->get('ipaddress'))}">{$oDocument->get('ipaddress')}</a></td>
<td>{$status_name_list[$oDocument->get('status')]}</td>
<td><input type="checkbox" name="cart" value="{$oDocument->document_srl}" onclick="doAddDocumentCart(this)" <!--@if($oDocument->isCarted())-->checked="checked"<!--@end--> /></td>
<td><input type="checkbox" name="cart" value="{$oDocument->document_srl}" /></td>
</tr>
<!--@end-->
</tbody>

View file

@ -109,8 +109,15 @@ function completeRestoreTrash(ret_obj) {
}
function getDocumentList() {
var documentListTable = jQuery('#documentListTable');
var cartList = [];
documentListTable.find(':checkbox[name=cart]').each(function(){
if(this.checked) cartList.push(this.value);
});
var params = new Array();
var response_tags = ['error','message', 'document_list'];
params["document_srls"] = cartList.join(",");
exec_xml('document','procDocumentGetList',params, completeGetDocumentList, response_tags);
}