文献入库时删除前后的空格,加大默认页面范围

This commit is contained in:
wlx 2010-07-02 17:39:53 +00:00
parent 877e263f34
commit ded86c30e9
1 changed files with 5 additions and 5 deletions

View File

@ -535,16 +535,16 @@ class Admin_DataController extends Zend_Controller_Action
$formdata=$this->_request->getPost();
if ($form->isValid($formdata)) {
$sql="select id from reference where reference=?";
$row=$this->db->fetchRow($sql,array($formdata['reference']));
$row=$this->db->fetchRow($sql,array(trim($formdata['reference'])));
if (!$row)
{
$sql="insert into reference (reference,link) values(?,?)";
$this->db->query($sql,array($formdata['reference'],$formdata['link']));
$this->db->query($sql,array(trim($formdata['reference']),trim($formdata['link'])));
$sql="select id from reference where reference=?";
$row=$this->db->fetchRow($sql,array($formdata['reference']));
$row=$this->db->fetchRow($sql,array(trim($formdata['reference'])));
}
$sql="insert into mdref (uuid,refid) values(?,?)";
$this->db->query($sql,array($formdata['uuid'],$row['id']));
$this->db->query($sql,array(trim($formdata['uuid']),$row['id']));
$this->messenger->addMessage('提示信息:您已经成功添加该数据文献。');
$this->_redirect('/admin/data/reference');
}else {
@ -606,7 +606,7 @@ class Admin_DataController extends Zend_Controller_Action
->order('metadata.title');
$paginator = Zend_Paginator::factory($select);
$paginator->setCurrentPageNumber($this->_getParam('page'));
$paginator->setItemCountPerPage($this->view->config->page->max);
$paginator->setItemCountPerPage(30);
$paginator->setView($this->view);
Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination.phtml');
$this->view->paginator=$paginator;