* convert to unix format.
This commit is contained in:
+420
-420
@@ -1,420 +1,420 @@
|
||||
<?php
|
||||
/**
|
||||
* The control file of doc module of ZenTaoPMS.
|
||||
*
|
||||
* @copyright Copyright 2009-2012 青岛易软天创网络科技有限公司 (QingDao Nature Easy Soft Network Technology Co,LTD www.cnezsoft.com)
|
||||
* @license LGPL (http://www.gnu.org/licenses/lgpl.html)
|
||||
* @author Chunsheng Wang <chunsheng@cnezsoft.com>
|
||||
* @package doc
|
||||
* @version $Id: control.php 933 2010-07-06 06:53:40Z wwccss $
|
||||
* @link http://www.zentao.net
|
||||
*/
|
||||
class doc extends control
|
||||
{
|
||||
/**
|
||||
* Construct function, load user, tree, action auto.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->loadModel('user');
|
||||
$this->loadModel('tree');
|
||||
$this->loadModel('action');
|
||||
$this->loadModel('product');
|
||||
$this->loadModel('project');
|
||||
$this->libs = $this->doc->getLibs();
|
||||
}
|
||||
|
||||
/**
|
||||
* Go to browse page.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$this->locate(inlink('browse'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Browse docs.
|
||||
*
|
||||
* @param string|int $libID product|project or the int id of custom library
|
||||
* @param int $moduleID
|
||||
* @param int $productID
|
||||
* @param int $projectID
|
||||
* @param string $orderBy
|
||||
* @param int $recTotal
|
||||
* @param int $recPerPage
|
||||
* @param int $pageID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function browse($libID = 'product', $moduleID = 0, $productID = 0, $projectID = 0, $browseType = 'byModule', $param = 0, $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1)
|
||||
{
|
||||
/* Set browseType.*/
|
||||
$browseType = strtolower($browseType);
|
||||
$queryID = ($browseType == 'bysearch') ? (int)$param : 0;
|
||||
|
||||
/* Set menu, save session. */
|
||||
$this->doc->setMenu($this->libs, $libID, 'doc');
|
||||
$this->session->set('docList', $this->app->getURI(true));
|
||||
|
||||
/* Set header and position. */
|
||||
$this->view->header->title = $this->lang->doc->index . $this->lang->colon . $this->libs[$libID];
|
||||
$this->view->position[] = $this->libs[$libID];
|
||||
|
||||
/* Load pager. */
|
||||
$this->app->loadClass('pager', $static = true);
|
||||
$pager = new pager($recTotal, $recPerPage, $pageID);
|
||||
|
||||
/* Get docs. */
|
||||
$modules = 0;
|
||||
$docs=array();
|
||||
if($browseType == "bymodule")
|
||||
{
|
||||
if($moduleID) $modules = $this->tree->getAllChildID($moduleID);
|
||||
$docs = $this->doc->getDocs($libID, $productID, $projectID, $modules, $orderBy, $pager);
|
||||
}
|
||||
elseif($browseType == "bysearch")
|
||||
{
|
||||
if($queryID)
|
||||
{
|
||||
$query = $this->loadModel('search')->getQuery($queryID);
|
||||
if($query)
|
||||
{
|
||||
$this->session->set('docQuery', $query->sql);
|
||||
$this->session->set('docForm', $query->form);
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->session->set('docQuery', ' 1 = 1');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if($this->session->docQuery == false) $this->session->set('docQuery', ' 1 = 1');
|
||||
}
|
||||
$docQuery = str_replace("`product` = 'all'", '1', $this->session->docQuery); // Search all producti.
|
||||
$docQuery = str_replace("`project` = 'all'", '1', $docQuery); // Search all project.
|
||||
$docs = $this->dao->select('*')->from(TABLE_DOC)->where($docQuery)
|
||||
->andWhere('deleted')->eq(0)
|
||||
->orderBy($orderBy)->page($pager)->fetchAll();
|
||||
}
|
||||
|
||||
/* Get the tree menu. */
|
||||
if($libID == 'product')
|
||||
{
|
||||
$moduleTree = $this->tree->getProductDocTreeMenu();
|
||||
}
|
||||
elseif($libID == 'project')
|
||||
{
|
||||
$moduleTree = $this->tree->getProjectDocTreeMenu();
|
||||
}
|
||||
else
|
||||
{
|
||||
$moduleTree = $this->tree->getTreeMenu($libID, $viewType = 'customdoc', $startModuleID = 0, array('treeModel', 'createDocLink'));
|
||||
}
|
||||
|
||||
/* Build the search form. */
|
||||
$this->config->doc->search['actionURL'] = $this->createLink('doc', 'browse', "libID=$libID&moduleID=$moduleID&procuctID=$productID&projectID=$projectID&browseType=bySearch&queryID=myQueryID");
|
||||
$this->config->doc->search['queryID'] = $queryID;
|
||||
$this->config->doc->search['params']['product']['values'] = array(''=>'') + $this->product->getPairs() + array('all'=>$this->lang->doc->allProduct);
|
||||
$this->config->doc->search['params']['project']['values'] = array(''=>'') + $this->project->getPairs() + array('all'=>$this->lang->doc->allProject);
|
||||
$this->config->doc->search['params']['lib']['values'] = array(''=>'') + $this->libs;
|
||||
$this->config->doc->search['params']['type']['values'] = array(''=>'') + $this->config->doc->search['params']['type']['values'];
|
||||
|
||||
/* Get the modules. */
|
||||
if($libID == 'product' or $libID == 'project')
|
||||
{
|
||||
$moduleOptionMenu = $this->tree->getOptionMenu(0, $libID . 'doc', $startModuleID = 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
$moduleOptionMenu = $this->tree->getOptionMenu($libID, 'customdoc', $startModuleID = 0);
|
||||
}
|
||||
$this->config->doc->search['params']['module']['values'] = array(''=>'') + $moduleOptionMenu;
|
||||
$this->view->searchForm = $this->fetch('search', 'buildForm', $this->config->doc->search);
|
||||
|
||||
$this->view->libID = $libID;
|
||||
$this->view->libName = $this->libs[$libID];
|
||||
$this->view->moduleID = $moduleID;
|
||||
$this->view->moduleTree = $moduleTree;
|
||||
$this->view->parentModules = $this->tree->getParents($moduleID);
|
||||
$this->view->docs = $docs;
|
||||
$this->view->pager = $pager;
|
||||
$this->view->users = $this->loadModel('user')->getPairs('noletter');
|
||||
$this->view->orderBy = $orderBy;
|
||||
$this->view->productID = $productID;
|
||||
$this->view->projectID = $projectID;
|
||||
$this->view->browseType = $browseType;
|
||||
$this->view->param = $param;
|
||||
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a library.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function createLib()
|
||||
{
|
||||
if(!empty($_POST))
|
||||
{
|
||||
$libID = $this->doc->createLib();
|
||||
if(!dao::isError())
|
||||
{
|
||||
$this->loadModel('action')->create('docLib', $libID, 'Created');
|
||||
die(js::locate($this->createLink($this->moduleName, 'browse', "libID=$libID"), 'parent'));
|
||||
}
|
||||
else
|
||||
{
|
||||
echo js::error(dao::getError());
|
||||
}
|
||||
}
|
||||
die($this->display());
|
||||
}
|
||||
|
||||
/**
|
||||
* Edit a library.
|
||||
*
|
||||
* @param int $libID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function editLib($libID)
|
||||
{
|
||||
if(!empty($_POST))
|
||||
{
|
||||
$changes = $this->doc->updateLib($libID);
|
||||
if(dao::isError()) die(js::error(dao::getError()));
|
||||
if($changes)
|
||||
{
|
||||
$actionID = $this->loadModel('action')->create('docLib', $libID, 'edited');
|
||||
$this->action->logHistory($actionID, $changes);
|
||||
}
|
||||
die(js::locate($this->createLink($this->moduleName, 'browse', "libID=$libID"), 'parent'));
|
||||
}
|
||||
|
||||
$lib = $this->doc->getLibByID($libID);
|
||||
$this->view->libName = empty($lib) ? $libID : $lib->name;
|
||||
$this->view->libID = $libID;
|
||||
|
||||
die($this->display());
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete a library.
|
||||
*
|
||||
* @param int $libID
|
||||
* @param string $confirm yes|no
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function deleteLib($libID, $confirm = 'no')
|
||||
{
|
||||
if($libID == 'product' or $libID == 'project') die();
|
||||
if($confirm == 'no')
|
||||
{
|
||||
die(js::confirm($this->lang->doc->confirmDeleteLib, $this->createLink('doc', 'deleteLib', "libID=$libID&confirm=yes")));
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->doc->delete(TABLE_DOCLIB, $libID);
|
||||
die(js::locate($this->createLink('doc', 'browse'), 'parent'));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a doc.
|
||||
*
|
||||
* @param int|string $libID
|
||||
* @param int $moduleID
|
||||
* @param int $productID
|
||||
* @param int $projectID
|
||||
* @param string $from
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function create($libID, $moduleID = 0, $productID = 0, $projectID = 0, $from = 'doc')
|
||||
{
|
||||
$projectID = (int)$projectID;
|
||||
if(!empty($_POST))
|
||||
{
|
||||
$docID = $this->doc->create();
|
||||
if(dao::isError()) die(js::error(dao::getError()));
|
||||
$this->action->create('doc', $docID, 'Created');
|
||||
|
||||
if($from == 'product') $link = $this->createLink('product', 'doc', "productID={$this->post->product}");
|
||||
if($from == 'project') $link = $this->createLink('project', 'doc', "projectID={$this->post->project}");
|
||||
if($from == 'doc')
|
||||
{
|
||||
$productID = intval($this->post->product);
|
||||
$projectID = intval($this->post->project);
|
||||
$vars = "libID=$libID&moduleID={$this->post->module}&productID=$productID&projectID=$projectID";
|
||||
$link = $this->createLink('doc', 'browse', $vars);
|
||||
}
|
||||
die(js::locate($link, 'parent'));
|
||||
}
|
||||
|
||||
$this->loadModel('product');
|
||||
$this->loadModel('project');
|
||||
|
||||
/* According the from, set menus. */
|
||||
if($from == 'product')
|
||||
{
|
||||
$this->lang->doc->menu = $this->lang->product->menu;
|
||||
$this->product->setMenu($this->product->getPairs(), $productID);
|
||||
$this->lang->set('menugroup.doc', 'product');
|
||||
}
|
||||
elseif($from == 'project')
|
||||
{
|
||||
$this->lang->doc->menu = $this->lang->project->menu;
|
||||
$this->project->setMenu($this->project->getPairs('nocode'), $projectID);
|
||||
$this->lang->set('menugroup.doc', 'project');
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->doc->setMenu($this->libs, $libID);
|
||||
}
|
||||
|
||||
/* Get the modules. */
|
||||
if($libID == 'product' or $libID == 'project')
|
||||
{
|
||||
$moduleOptionMenu = $this->tree->getOptionMenu(0, $libID . 'doc', $startModuleID = 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
$moduleOptionMenu = $this->tree->getOptionMenu($libID, 'customdoc', $startModuleID = 0);
|
||||
}
|
||||
|
||||
$this->view->header->title = $this->libs[$libID] . $this->lang->colon . $this->lang->doc->create;
|
||||
$this->view->position[] = html::a($this->createLink('doc', 'browse', "libID=$libID"), $this->libs[$libID]);
|
||||
$this->view->position[] = $this->lang->doc->create;
|
||||
|
||||
$this->view->libID = $libID;
|
||||
$this->view->moduleOptionMenu = $moduleOptionMenu;
|
||||
$this->view->moduleID = $moduleID;
|
||||
$this->view->productID = $productID;
|
||||
$this->view->projectID = $projectID;
|
||||
$this->view->products = $projectID == 0 ? $this->product->getPairs() : $this->project->getProducts($projectID);
|
||||
$this->view->projects = $this->loadModel('project')->getPairs('all');
|
||||
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Edit a doc.
|
||||
*
|
||||
* @param int $docID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function edit($docID)
|
||||
{
|
||||
if(!empty($_POST))
|
||||
{
|
||||
$changes = $this->doc->update($docID);
|
||||
if(dao::isError()) die(js::error(dao::getError()));
|
||||
$files = $this->loadModel('file')->saveUpload('doc', $docID);
|
||||
if($this->post->comment != '' or !empty($changes) or !empty($files))
|
||||
{
|
||||
$action = !empty($changes) ? 'Edited' : 'Commented';
|
||||
$fileAction = '';
|
||||
if(!empty($files)) $fileAction = $this->lang->addFiles . join(',', $files) . "\n" ;
|
||||
$actionID = $this->action->create('doc', $docID, $action, $fileAction . $this->post->comment);
|
||||
$this->action->logHistory($actionID, $changes);
|
||||
}
|
||||
die(js::locate($this->createLink('doc', 'view', "docID=$docID"), 'parent'));
|
||||
}
|
||||
|
||||
/* Get doc and set menu. */
|
||||
$doc = $this->doc->getById($docID);
|
||||
$libID = $doc->lib;
|
||||
$this->doc->setMenu($this->libs, $libID);
|
||||
|
||||
/* Get modules. */
|
||||
if($libID == 'product' or $libID == 'project')
|
||||
{
|
||||
$moduleOptionMenu = $this->tree->getOptionMenu(0, $libID . 'doc', $startModuleID = 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
$moduleOptionMenu = $this->tree->getOptionMenu($libID, 'customdoc', $startModuleID = 0);
|
||||
}
|
||||
|
||||
$this->view->header->title = $this->libs[$libID] . $this->lang->colon . $this->lang->doc->create;
|
||||
$this->view->position[] = html::a($this->createLink('doc', 'browse', "libID=$libID"), $this->libs[$libID]);
|
||||
$this->view->position[] = $this->lang->doc->edit;
|
||||
|
||||
$this->view->doc = $doc;
|
||||
$this->view->libID = $libID;
|
||||
$this->view->users = $this->user->getPairs('noclosed,nodeleted');
|
||||
$this->view->moduleOptionMenu = $moduleOptionMenu;
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* View a doc.
|
||||
*
|
||||
* @param int $docID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function view($docID)
|
||||
{
|
||||
/* Get doc. */
|
||||
$doc = $this->doc->getById($docID);
|
||||
if(!$doc) die(js::error($this->lang->notFound) . js::locate('back'));
|
||||
if($doc->project != 0 and !$this->project->checkPriv($this->project->getById($doc->project)))
|
||||
{
|
||||
echo(js::alert($this->lang->error->accessDenied));
|
||||
die(js::locate('back'));
|
||||
}
|
||||
|
||||
/* Get library. */
|
||||
$lib = $doc->libName;
|
||||
if($doc->lib == 'product') $lib = $doc->productName;
|
||||
if($doc->lib == 'project') $lib = $doc->productName . $this->lang->arrow . $doc->projectName;
|
||||
|
||||
/* Set menu. */
|
||||
$this->doc->setMenu($this->libs, $doc->lib);
|
||||
|
||||
$this->view->header->title = $this->libs[$doc->lib] . $this->lang->colon . $this->lang->doc->view;
|
||||
$this->view->position[] = html::a($this->createLink('doc', 'browse', "libID=$doc->lib"), $this->libs[$doc->lib]);
|
||||
$this->view->position[] = $this->lang->doc->view;
|
||||
|
||||
$this->view->doc = $doc;
|
||||
$this->view->lib = $lib;
|
||||
$this->view->actions = $this->loadModel('action')->getList('doc', $docID);
|
||||
$this->view->users = $this->user->getPairs('noclosed,nodeleted');
|
||||
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete a doc.
|
||||
*
|
||||
* @param int $docID
|
||||
* @param string $confirm yes|no
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function delete($docID, $confirm = 'no')
|
||||
{
|
||||
if($confirm == 'no')
|
||||
{
|
||||
die(js::confirm($this->lang->doc->confirmDelete, inlink('delete', "docID=$docID&confirm=yes")));
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->doc->delete(TABLE_DOC, $docID);
|
||||
die(js::locate($this->session->docList, 'parent'));
|
||||
}
|
||||
}
|
||||
}
|
||||
<?php
|
||||
/**
|
||||
* The control file of doc module of ZenTaoPMS.
|
||||
*
|
||||
* @copyright Copyright 2009-2012 青岛易软天创网络科技有限公司 (QingDao Nature Easy Soft Network Technology Co,LTD www.cnezsoft.com)
|
||||
* @license LGPL (http://www.gnu.org/licenses/lgpl.html)
|
||||
* @author Chunsheng Wang <chunsheng@cnezsoft.com>
|
||||
* @package doc
|
||||
* @version $Id: control.php 933 2010-07-06 06:53:40Z wwccss $
|
||||
* @link http://www.zentao.net
|
||||
*/
|
||||
class doc extends control
|
||||
{
|
||||
/**
|
||||
* Construct function, load user, tree, action auto.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->loadModel('user');
|
||||
$this->loadModel('tree');
|
||||
$this->loadModel('action');
|
||||
$this->loadModel('product');
|
||||
$this->loadModel('project');
|
||||
$this->libs = $this->doc->getLibs();
|
||||
}
|
||||
|
||||
/**
|
||||
* Go to browse page.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$this->locate(inlink('browse'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Browse docs.
|
||||
*
|
||||
* @param string|int $libID product|project or the int id of custom library
|
||||
* @param int $moduleID
|
||||
* @param int $productID
|
||||
* @param int $projectID
|
||||
* @param string $orderBy
|
||||
* @param int $recTotal
|
||||
* @param int $recPerPage
|
||||
* @param int $pageID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function browse($libID = 'product', $moduleID = 0, $productID = 0, $projectID = 0, $browseType = 'byModule', $param = 0, $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1)
|
||||
{
|
||||
/* Set browseType.*/
|
||||
$browseType = strtolower($browseType);
|
||||
$queryID = ($browseType == 'bysearch') ? (int)$param : 0;
|
||||
|
||||
/* Set menu, save session. */
|
||||
$this->doc->setMenu($this->libs, $libID, 'doc');
|
||||
$this->session->set('docList', $this->app->getURI(true));
|
||||
|
||||
/* Set header and position. */
|
||||
$this->view->header->title = $this->lang->doc->index . $this->lang->colon . $this->libs[$libID];
|
||||
$this->view->position[] = $this->libs[$libID];
|
||||
|
||||
/* Load pager. */
|
||||
$this->app->loadClass('pager', $static = true);
|
||||
$pager = new pager($recTotal, $recPerPage, $pageID);
|
||||
|
||||
/* Get docs. */
|
||||
$modules = 0;
|
||||
$docs=array();
|
||||
if($browseType == "bymodule")
|
||||
{
|
||||
if($moduleID) $modules = $this->tree->getAllChildID($moduleID);
|
||||
$docs = $this->doc->getDocs($libID, $productID, $projectID, $modules, $orderBy, $pager);
|
||||
}
|
||||
elseif($browseType == "bysearch")
|
||||
{
|
||||
if($queryID)
|
||||
{
|
||||
$query = $this->loadModel('search')->getQuery($queryID);
|
||||
if($query)
|
||||
{
|
||||
$this->session->set('docQuery', $query->sql);
|
||||
$this->session->set('docForm', $query->form);
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->session->set('docQuery', ' 1 = 1');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if($this->session->docQuery == false) $this->session->set('docQuery', ' 1 = 1');
|
||||
}
|
||||
$docQuery = str_replace("`product` = 'all'", '1', $this->session->docQuery); // Search all producti.
|
||||
$docQuery = str_replace("`project` = 'all'", '1', $docQuery); // Search all project.
|
||||
$docs = $this->dao->select('*')->from(TABLE_DOC)->where($docQuery)
|
||||
->andWhere('deleted')->eq(0)
|
||||
->orderBy($orderBy)->page($pager)->fetchAll();
|
||||
}
|
||||
|
||||
/* Get the tree menu. */
|
||||
if($libID == 'product')
|
||||
{
|
||||
$moduleTree = $this->tree->getProductDocTreeMenu();
|
||||
}
|
||||
elseif($libID == 'project')
|
||||
{
|
||||
$moduleTree = $this->tree->getProjectDocTreeMenu();
|
||||
}
|
||||
else
|
||||
{
|
||||
$moduleTree = $this->tree->getTreeMenu($libID, $viewType = 'customdoc', $startModuleID = 0, array('treeModel', 'createDocLink'));
|
||||
}
|
||||
|
||||
/* Build the search form. */
|
||||
$this->config->doc->search['actionURL'] = $this->createLink('doc', 'browse', "libID=$libID&moduleID=$moduleID&procuctID=$productID&projectID=$projectID&browseType=bySearch&queryID=myQueryID");
|
||||
$this->config->doc->search['queryID'] = $queryID;
|
||||
$this->config->doc->search['params']['product']['values'] = array(''=>'') + $this->product->getPairs() + array('all'=>$this->lang->doc->allProduct);
|
||||
$this->config->doc->search['params']['project']['values'] = array(''=>'') + $this->project->getPairs() + array('all'=>$this->lang->doc->allProject);
|
||||
$this->config->doc->search['params']['lib']['values'] = array(''=>'') + $this->libs;
|
||||
$this->config->doc->search['params']['type']['values'] = array(''=>'') + $this->config->doc->search['params']['type']['values'];
|
||||
|
||||
/* Get the modules. */
|
||||
if($libID == 'product' or $libID == 'project')
|
||||
{
|
||||
$moduleOptionMenu = $this->tree->getOptionMenu(0, $libID . 'doc', $startModuleID = 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
$moduleOptionMenu = $this->tree->getOptionMenu($libID, 'customdoc', $startModuleID = 0);
|
||||
}
|
||||
$this->config->doc->search['params']['module']['values'] = array(''=>'') + $moduleOptionMenu;
|
||||
$this->view->searchForm = $this->fetch('search', 'buildForm', $this->config->doc->search);
|
||||
|
||||
$this->view->libID = $libID;
|
||||
$this->view->libName = $this->libs[$libID];
|
||||
$this->view->moduleID = $moduleID;
|
||||
$this->view->moduleTree = $moduleTree;
|
||||
$this->view->parentModules = $this->tree->getParents($moduleID);
|
||||
$this->view->docs = $docs;
|
||||
$this->view->pager = $pager;
|
||||
$this->view->users = $this->loadModel('user')->getPairs('noletter');
|
||||
$this->view->orderBy = $orderBy;
|
||||
$this->view->productID = $productID;
|
||||
$this->view->projectID = $projectID;
|
||||
$this->view->browseType = $browseType;
|
||||
$this->view->param = $param;
|
||||
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a library.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function createLib()
|
||||
{
|
||||
if(!empty($_POST))
|
||||
{
|
||||
$libID = $this->doc->createLib();
|
||||
if(!dao::isError())
|
||||
{
|
||||
$this->loadModel('action')->create('docLib', $libID, 'Created');
|
||||
die(js::locate($this->createLink($this->moduleName, 'browse', "libID=$libID"), 'parent'));
|
||||
}
|
||||
else
|
||||
{
|
||||
echo js::error(dao::getError());
|
||||
}
|
||||
}
|
||||
die($this->display());
|
||||
}
|
||||
|
||||
/**
|
||||
* Edit a library.
|
||||
*
|
||||
* @param int $libID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function editLib($libID)
|
||||
{
|
||||
if(!empty($_POST))
|
||||
{
|
||||
$changes = $this->doc->updateLib($libID);
|
||||
if(dao::isError()) die(js::error(dao::getError()));
|
||||
if($changes)
|
||||
{
|
||||
$actionID = $this->loadModel('action')->create('docLib', $libID, 'edited');
|
||||
$this->action->logHistory($actionID, $changes);
|
||||
}
|
||||
die(js::locate($this->createLink($this->moduleName, 'browse', "libID=$libID"), 'parent'));
|
||||
}
|
||||
|
||||
$lib = $this->doc->getLibByID($libID);
|
||||
$this->view->libName = empty($lib) ? $libID : $lib->name;
|
||||
$this->view->libID = $libID;
|
||||
|
||||
die($this->display());
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete a library.
|
||||
*
|
||||
* @param int $libID
|
||||
* @param string $confirm yes|no
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function deleteLib($libID, $confirm = 'no')
|
||||
{
|
||||
if($libID == 'product' or $libID == 'project') die();
|
||||
if($confirm == 'no')
|
||||
{
|
||||
die(js::confirm($this->lang->doc->confirmDeleteLib, $this->createLink('doc', 'deleteLib', "libID=$libID&confirm=yes")));
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->doc->delete(TABLE_DOCLIB, $libID);
|
||||
die(js::locate($this->createLink('doc', 'browse'), 'parent'));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a doc.
|
||||
*
|
||||
* @param int|string $libID
|
||||
* @param int $moduleID
|
||||
* @param int $productID
|
||||
* @param int $projectID
|
||||
* @param string $from
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function create($libID, $moduleID = 0, $productID = 0, $projectID = 0, $from = 'doc')
|
||||
{
|
||||
$projectID = (int)$projectID;
|
||||
if(!empty($_POST))
|
||||
{
|
||||
$docID = $this->doc->create();
|
||||
if(dao::isError()) die(js::error(dao::getError()));
|
||||
$this->action->create('doc', $docID, 'Created');
|
||||
|
||||
if($from == 'product') $link = $this->createLink('product', 'doc', "productID={$this->post->product}");
|
||||
if($from == 'project') $link = $this->createLink('project', 'doc', "projectID={$this->post->project}");
|
||||
if($from == 'doc')
|
||||
{
|
||||
$productID = intval($this->post->product);
|
||||
$projectID = intval($this->post->project);
|
||||
$vars = "libID=$libID&moduleID={$this->post->module}&productID=$productID&projectID=$projectID";
|
||||
$link = $this->createLink('doc', 'browse', $vars);
|
||||
}
|
||||
die(js::locate($link, 'parent'));
|
||||
}
|
||||
|
||||
$this->loadModel('product');
|
||||
$this->loadModel('project');
|
||||
|
||||
/* According the from, set menus. */
|
||||
if($from == 'product')
|
||||
{
|
||||
$this->lang->doc->menu = $this->lang->product->menu;
|
||||
$this->product->setMenu($this->product->getPairs(), $productID);
|
||||
$this->lang->set('menugroup.doc', 'product');
|
||||
}
|
||||
elseif($from == 'project')
|
||||
{
|
||||
$this->lang->doc->menu = $this->lang->project->menu;
|
||||
$this->project->setMenu($this->project->getPairs('nocode'), $projectID);
|
||||
$this->lang->set('menugroup.doc', 'project');
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->doc->setMenu($this->libs, $libID);
|
||||
}
|
||||
|
||||
/* Get the modules. */
|
||||
if($libID == 'product' or $libID == 'project')
|
||||
{
|
||||
$moduleOptionMenu = $this->tree->getOptionMenu(0, $libID . 'doc', $startModuleID = 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
$moduleOptionMenu = $this->tree->getOptionMenu($libID, 'customdoc', $startModuleID = 0);
|
||||
}
|
||||
|
||||
$this->view->header->title = $this->libs[$libID] . $this->lang->colon . $this->lang->doc->create;
|
||||
$this->view->position[] = html::a($this->createLink('doc', 'browse', "libID=$libID"), $this->libs[$libID]);
|
||||
$this->view->position[] = $this->lang->doc->create;
|
||||
|
||||
$this->view->libID = $libID;
|
||||
$this->view->moduleOptionMenu = $moduleOptionMenu;
|
||||
$this->view->moduleID = $moduleID;
|
||||
$this->view->productID = $productID;
|
||||
$this->view->projectID = $projectID;
|
||||
$this->view->products = $projectID == 0 ? $this->product->getPairs() : $this->project->getProducts($projectID);
|
||||
$this->view->projects = $this->loadModel('project')->getPairs('all');
|
||||
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Edit a doc.
|
||||
*
|
||||
* @param int $docID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function edit($docID)
|
||||
{
|
||||
if(!empty($_POST))
|
||||
{
|
||||
$changes = $this->doc->update($docID);
|
||||
if(dao::isError()) die(js::error(dao::getError()));
|
||||
$files = $this->loadModel('file')->saveUpload('doc', $docID);
|
||||
if($this->post->comment != '' or !empty($changes) or !empty($files))
|
||||
{
|
||||
$action = !empty($changes) ? 'Edited' : 'Commented';
|
||||
$fileAction = '';
|
||||
if(!empty($files)) $fileAction = $this->lang->addFiles . join(',', $files) . "\n" ;
|
||||
$actionID = $this->action->create('doc', $docID, $action, $fileAction . $this->post->comment);
|
||||
$this->action->logHistory($actionID, $changes);
|
||||
}
|
||||
die(js::locate($this->createLink('doc', 'view', "docID=$docID"), 'parent'));
|
||||
}
|
||||
|
||||
/* Get doc and set menu. */
|
||||
$doc = $this->doc->getById($docID);
|
||||
$libID = $doc->lib;
|
||||
$this->doc->setMenu($this->libs, $libID);
|
||||
|
||||
/* Get modules. */
|
||||
if($libID == 'product' or $libID == 'project')
|
||||
{
|
||||
$moduleOptionMenu = $this->tree->getOptionMenu(0, $libID . 'doc', $startModuleID = 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
$moduleOptionMenu = $this->tree->getOptionMenu($libID, 'customdoc', $startModuleID = 0);
|
||||
}
|
||||
|
||||
$this->view->header->title = $this->libs[$libID] . $this->lang->colon . $this->lang->doc->create;
|
||||
$this->view->position[] = html::a($this->createLink('doc', 'browse', "libID=$libID"), $this->libs[$libID]);
|
||||
$this->view->position[] = $this->lang->doc->edit;
|
||||
|
||||
$this->view->doc = $doc;
|
||||
$this->view->libID = $libID;
|
||||
$this->view->users = $this->user->getPairs('noclosed,nodeleted');
|
||||
$this->view->moduleOptionMenu = $moduleOptionMenu;
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* View a doc.
|
||||
*
|
||||
* @param int $docID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function view($docID)
|
||||
{
|
||||
/* Get doc. */
|
||||
$doc = $this->doc->getById($docID);
|
||||
if(!$doc) die(js::error($this->lang->notFound) . js::locate('back'));
|
||||
if($doc->project != 0 and !$this->project->checkPriv($this->project->getById($doc->project)))
|
||||
{
|
||||
echo(js::alert($this->lang->error->accessDenied));
|
||||
die(js::locate('back'));
|
||||
}
|
||||
|
||||
/* Get library. */
|
||||
$lib = $doc->libName;
|
||||
if($doc->lib == 'product') $lib = $doc->productName;
|
||||
if($doc->lib == 'project') $lib = $doc->productName . $this->lang->arrow . $doc->projectName;
|
||||
|
||||
/* Set menu. */
|
||||
$this->doc->setMenu($this->libs, $doc->lib);
|
||||
|
||||
$this->view->header->title = $this->libs[$doc->lib] . $this->lang->colon . $this->lang->doc->view;
|
||||
$this->view->position[] = html::a($this->createLink('doc', 'browse', "libID=$doc->lib"), $this->libs[$doc->lib]);
|
||||
$this->view->position[] = $this->lang->doc->view;
|
||||
|
||||
$this->view->doc = $doc;
|
||||
$this->view->lib = $lib;
|
||||
$this->view->actions = $this->loadModel('action')->getList('doc', $docID);
|
||||
$this->view->users = $this->user->getPairs('noclosed,nodeleted');
|
||||
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete a doc.
|
||||
*
|
||||
* @param int $docID
|
||||
* @param string $confirm yes|no
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function delete($docID, $confirm = 'no')
|
||||
{
|
||||
if($confirm == 'no')
|
||||
{
|
||||
die(js::confirm($this->lang->doc->confirmDelete, inlink('delete', "docID=$docID&confirm=yes")));
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->doc->delete(TABLE_DOC, $docID);
|
||||
die(js::locate($this->session->docList, 'parent'));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+65
-65
@@ -1,65 +1,65 @@
|
||||
<?php
|
||||
/**
|
||||
* The doc module english file of ZenTaoPMS.
|
||||
*
|
||||
* @copyright Copyright 2009-2012 青岛易软天创网络科技有限公司 (QingDao Nature Easy Soft Network Technology Co,LTD www.cnezsoft.com)
|
||||
* @license LGPL (http://www.gnu.org/licenses/lgpl.html)
|
||||
* @author Chunsheng Wang <chunsheng@cnezsoft.com>
|
||||
* @package doc
|
||||
* @version $Id: en.php 824 2010-05-02 15:32:06Z wwccss $
|
||||
* @link http://www.zentao.net
|
||||
*/
|
||||
/* Fields. */
|
||||
$lang->doc->common = 'Doc';
|
||||
$lang->doc->id = 'ID';
|
||||
$lang->doc->product = 'Product';
|
||||
$lang->doc->project = 'Project';
|
||||
$lang->doc->lib = 'Library';
|
||||
$lang->doc->module = 'Module';
|
||||
$lang->doc->title = 'Title';
|
||||
$lang->doc->digest = 'Digest';
|
||||
$lang->doc->comment = 'Comment';
|
||||
$lang->doc->type = 'Type';
|
||||
$lang->doc->content = 'Content';
|
||||
$lang->doc->keywords = 'Keywords';
|
||||
$lang->doc->url = 'URL';
|
||||
$lang->doc->files = 'File';
|
||||
$lang->doc->views = 'Views';
|
||||
$lang->doc->addedBy = 'Added by';
|
||||
$lang->doc->addedDate = 'Added date';
|
||||
$lang->doc->editedBy = 'Edited by';
|
||||
$lang->doc->editedDate = 'Edited date';
|
||||
|
||||
$lang->doc->moduleDoc = 'By module';
|
||||
$lang->doc->searchDoc = 'By search';
|
||||
//$lang->doc->allDoc = 'All document';
|
||||
|
||||
$lang->doc->moduleName = 'Module name';
|
||||
$lang->doc->moduleOrder = 'Module order';
|
||||
|
||||
/* Actions. */
|
||||
$lang->doc->index = 'Index';
|
||||
$lang->doc->create = 'Create doc';
|
||||
$lang->doc->edit = 'Edit doc';
|
||||
$lang->doc->delete = 'Delete doc';
|
||||
$lang->doc->browse = 'Browse doc';
|
||||
$lang->doc->view = 'View doc';
|
||||
$lang->doc->createLib = 'Create library';
|
||||
$lang->doc->editLib = 'Edit library';
|
||||
$lang->doc->deleteLib = 'Delete library';
|
||||
$lang->doc->libName = 'Library name';
|
||||
|
||||
/* Browse tabs. */
|
||||
$lang->doc->allProduct = 'All products';
|
||||
$lang->doc->allProject = 'All projects';
|
||||
|
||||
$lang->doc->systemLibs['product'] = 'Product doc';
|
||||
$lang->doc->systemLibs['project'] = 'Project doc';
|
||||
|
||||
$lang->doc->types['file'] = 'File';
|
||||
$lang->doc->types['url'] = 'Link';
|
||||
$lang->doc->types['text'] = 'Html';
|
||||
|
||||
$lang->doc->confirmDelete = "Are you sure to delete this doc?";
|
||||
$lang->doc->confirmDeleteLib = " Are you sure to delete this doc library?";
|
||||
$lang->doc->errorEditSystemDoc = "System doc library needn't edit";
|
||||
<?php
|
||||
/**
|
||||
* The doc module english file of ZenTaoPMS.
|
||||
*
|
||||
* @copyright Copyright 2009-2012 青岛易软天创网络科技有限公司 (QingDao Nature Easy Soft Network Technology Co,LTD www.cnezsoft.com)
|
||||
* @license LGPL (http://www.gnu.org/licenses/lgpl.html)
|
||||
* @author Chunsheng Wang <chunsheng@cnezsoft.com>
|
||||
* @package doc
|
||||
* @version $Id: en.php 824 2010-05-02 15:32:06Z wwccss $
|
||||
* @link http://www.zentao.net
|
||||
*/
|
||||
/* Fields. */
|
||||
$lang->doc->common = 'Doc';
|
||||
$lang->doc->id = 'ID';
|
||||
$lang->doc->product = 'Product';
|
||||
$lang->doc->project = 'Project';
|
||||
$lang->doc->lib = 'Library';
|
||||
$lang->doc->module = 'Module';
|
||||
$lang->doc->title = 'Title';
|
||||
$lang->doc->digest = 'Digest';
|
||||
$lang->doc->comment = 'Comment';
|
||||
$lang->doc->type = 'Type';
|
||||
$lang->doc->content = 'Content';
|
||||
$lang->doc->keywords = 'Keywords';
|
||||
$lang->doc->url = 'URL';
|
||||
$lang->doc->files = 'File';
|
||||
$lang->doc->views = 'Views';
|
||||
$lang->doc->addedBy = 'Added by';
|
||||
$lang->doc->addedDate = 'Added date';
|
||||
$lang->doc->editedBy = 'Edited by';
|
||||
$lang->doc->editedDate = 'Edited date';
|
||||
|
||||
$lang->doc->moduleDoc = 'By module';
|
||||
$lang->doc->searchDoc = 'By search';
|
||||
//$lang->doc->allDoc = 'All document';
|
||||
|
||||
$lang->doc->moduleName = 'Module name';
|
||||
$lang->doc->moduleOrder = 'Module order';
|
||||
|
||||
/* Actions. */
|
||||
$lang->doc->index = 'Index';
|
||||
$lang->doc->create = 'Create doc';
|
||||
$lang->doc->edit = 'Edit doc';
|
||||
$lang->doc->delete = 'Delete doc';
|
||||
$lang->doc->browse = 'Browse doc';
|
||||
$lang->doc->view = 'View doc';
|
||||
$lang->doc->createLib = 'Create library';
|
||||
$lang->doc->editLib = 'Edit library';
|
||||
$lang->doc->deleteLib = 'Delete library';
|
||||
$lang->doc->libName = 'Library name';
|
||||
|
||||
/* Browse tabs. */
|
||||
$lang->doc->allProduct = 'All products';
|
||||
$lang->doc->allProject = 'All projects';
|
||||
|
||||
$lang->doc->systemLibs['product'] = 'Product doc';
|
||||
$lang->doc->systemLibs['project'] = 'Project doc';
|
||||
|
||||
$lang->doc->types['file'] = 'File';
|
||||
$lang->doc->types['url'] = 'Link';
|
||||
$lang->doc->types['text'] = 'Html';
|
||||
|
||||
$lang->doc->confirmDelete = "Are you sure to delete this doc?";
|
||||
$lang->doc->confirmDeleteLib = " Are you sure to delete this doc library?";
|
||||
$lang->doc->errorEditSystemDoc = "System doc library needn't edit";
|
||||
|
||||
+65
-65
@@ -1,65 +1,65 @@
|
||||
<?php
|
||||
/**
|
||||
* The doc module zh-cn file of ZenTaoPMS.
|
||||
*
|
||||
* @copyright Copyright 2009-2012 青岛易软天创网络科技有限公司 (QingDao Nature Easy Soft Network Technology Co,LTD www.cnezsoft.com)
|
||||
* @license LGPL (http://www.gnu.org/licenses/lgpl.html)
|
||||
* @author Chunsheng Wang <chunsheng@cnezsoft.com>
|
||||
* @package doc
|
||||
* @version $Id: zh-cn.php 824 2010-05-02 15:32:06Z wwccss $
|
||||
* @link http://www.zentao.net
|
||||
*/
|
||||
/* 字段列表。*/
|
||||
$lang->doc->common = '文档视图';
|
||||
$lang->doc->id = '文档编号';
|
||||
$lang->doc->product = '所属产品';
|
||||
$lang->doc->project = '所属项目';
|
||||
$lang->doc->lib = '所属文档库';
|
||||
$lang->doc->module = '所属分类';
|
||||
$lang->doc->title = '文档标题';
|
||||
$lang->doc->digest = '文档摘要';
|
||||
$lang->doc->comment = '文档备注';
|
||||
$lang->doc->type = '文档类型';
|
||||
$lang->doc->content = '文档正文';
|
||||
$lang->doc->keywords = '关键字';
|
||||
$lang->doc->url = '文档URL';
|
||||
$lang->doc->files = '附件';
|
||||
$lang->doc->views = '查阅次数';
|
||||
$lang->doc->addedBy = '由谁添加';
|
||||
$lang->doc->addedDate = '添加时间';
|
||||
$lang->doc->editedBy = '由谁编辑';
|
||||
$lang->doc->editedDate = '编辑时间';
|
||||
|
||||
$lang->doc->moduleDoc = '按模块浏览';
|
||||
$lang->doc->searchDoc = '搜索';
|
||||
//$lang->doc->allDoc = '所有文档';
|
||||
|
||||
$lang->doc->moduleName = '模块名称';
|
||||
$lang->doc->moduleOrder = '模块排序';
|
||||
|
||||
/* 方法列表。*/
|
||||
$lang->doc->index = '首页';
|
||||
$lang->doc->create = '创建文档';
|
||||
$lang->doc->edit = '编辑文档';
|
||||
$lang->doc->delete = '删除文档';
|
||||
$lang->doc->browse = '文档列表';
|
||||
$lang->doc->view = '文档详情';
|
||||
$lang->doc->createLib = '创建文档库';
|
||||
$lang->doc->editLib = '编辑文档库';
|
||||
$lang->doc->deleteLib = '删除文档库';
|
||||
$lang->doc->libName = '文档库名称';
|
||||
|
||||
/* 查询条件列表 */
|
||||
$lang->doc->allProduct = '所有产品';
|
||||
$lang->doc->allProject = '所有项目';
|
||||
|
||||
$lang->doc->systemLibs['product'] = '产品文档库';
|
||||
$lang->doc->systemLibs['project'] = '项目文档库';
|
||||
|
||||
$lang->doc->types['file'] = '文件';
|
||||
$lang->doc->types['url'] = '链接';
|
||||
$lang->doc->types['text'] = '网页';
|
||||
|
||||
$lang->doc->confirmDelete = "您确定删除该文档吗?";
|
||||
$lang->doc->confirmDeleteLib = " 您确定删除该文档库吗?";
|
||||
$lang->doc->errorEditSystemDoc = "系统文档库无需修改。";
|
||||
<?php
|
||||
/**
|
||||
* The doc module zh-cn file of ZenTaoPMS.
|
||||
*
|
||||
* @copyright Copyright 2009-2012 青岛易软天创网络科技有限公司 (QingDao Nature Easy Soft Network Technology Co,LTD www.cnezsoft.com)
|
||||
* @license LGPL (http://www.gnu.org/licenses/lgpl.html)
|
||||
* @author Chunsheng Wang <chunsheng@cnezsoft.com>
|
||||
* @package doc
|
||||
* @version $Id: zh-cn.php 824 2010-05-02 15:32:06Z wwccss $
|
||||
* @link http://www.zentao.net
|
||||
*/
|
||||
/* 字段列表。*/
|
||||
$lang->doc->common = '文档视图';
|
||||
$lang->doc->id = '文档编号';
|
||||
$lang->doc->product = '所属产品';
|
||||
$lang->doc->project = '所属项目';
|
||||
$lang->doc->lib = '所属文档库';
|
||||
$lang->doc->module = '所属分类';
|
||||
$lang->doc->title = '文档标题';
|
||||
$lang->doc->digest = '文档摘要';
|
||||
$lang->doc->comment = '文档备注';
|
||||
$lang->doc->type = '文档类型';
|
||||
$lang->doc->content = '文档正文';
|
||||
$lang->doc->keywords = '关键字';
|
||||
$lang->doc->url = '文档URL';
|
||||
$lang->doc->files = '附件';
|
||||
$lang->doc->views = '查阅次数';
|
||||
$lang->doc->addedBy = '由谁添加';
|
||||
$lang->doc->addedDate = '添加时间';
|
||||
$lang->doc->editedBy = '由谁编辑';
|
||||
$lang->doc->editedDate = '编辑时间';
|
||||
|
||||
$lang->doc->moduleDoc = '按模块浏览';
|
||||
$lang->doc->searchDoc = '搜索';
|
||||
//$lang->doc->allDoc = '所有文档';
|
||||
|
||||
$lang->doc->moduleName = '模块名称';
|
||||
$lang->doc->moduleOrder = '模块排序';
|
||||
|
||||
/* 方法列表。*/
|
||||
$lang->doc->index = '首页';
|
||||
$lang->doc->create = '创建文档';
|
||||
$lang->doc->edit = '编辑文档';
|
||||
$lang->doc->delete = '删除文档';
|
||||
$lang->doc->browse = '文档列表';
|
||||
$lang->doc->view = '文档详情';
|
||||
$lang->doc->createLib = '创建文档库';
|
||||
$lang->doc->editLib = '编辑文档库';
|
||||
$lang->doc->deleteLib = '删除文档库';
|
||||
$lang->doc->libName = '文档库名称';
|
||||
|
||||
/* 查询条件列表 */
|
||||
$lang->doc->allProduct = '所有产品';
|
||||
$lang->doc->allProject = '所有项目';
|
||||
|
||||
$lang->doc->systemLibs['product'] = '产品文档库';
|
||||
$lang->doc->systemLibs['project'] = '项目文档库';
|
||||
|
||||
$lang->doc->types['file'] = '文件';
|
||||
$lang->doc->types['url'] = '链接';
|
||||
$lang->doc->types['text'] = '网页';
|
||||
|
||||
$lang->doc->confirmDelete = "您确定删除该文档吗?";
|
||||
$lang->doc->confirmDeleteLib = " 您确定删除该文档库吗?";
|
||||
$lang->doc->errorEditSystemDoc = "系统文档库无需修改。";
|
||||
|
||||
+65
-65
@@ -1,65 +1,65 @@
|
||||
<?php
|
||||
/**
|
||||
* The doc module zh-tw file of ZenTaoPMS.
|
||||
*
|
||||
* @copyright Copyright 2009-2012 青島易軟天創網絡科技有限公司 (QingDao Nature Easy Soft Network Technology Co,LTD www.cnezsoft.com)
|
||||
* @license LGPL (http://www.gnu.org/licenses/lgpl.html)
|
||||
* @author Chunsheng Wang <chunsheng@cnezsoft.com>
|
||||
* @package doc
|
||||
* @version $Id: zh-tw.php 824 2010-05-02 15:32:06Z wwccss $
|
||||
* @link http://www.zentao.net
|
||||
*/
|
||||
/* 欄位列表。*/
|
||||
$lang->doc->common = '文檔視圖';
|
||||
$lang->doc->id = '文檔編號';
|
||||
$lang->doc->product = '所屬產品';
|
||||
$lang->doc->project = '所屬項目';
|
||||
$lang->doc->lib = '所屬文檔庫';
|
||||
$lang->doc->module = '所屬分類';
|
||||
$lang->doc->title = '文檔標題';
|
||||
$lang->doc->digest = '文檔摘要';
|
||||
$lang->doc->comment = '文檔備註';
|
||||
$lang->doc->type = '文檔類型';
|
||||
$lang->doc->content = '文檔正文';
|
||||
$lang->doc->keywords = '關鍵字';
|
||||
$lang->doc->url = '文檔URL';
|
||||
$lang->doc->files = '附件';
|
||||
$lang->doc->views = '查閲次數';
|
||||
$lang->doc->addedBy = '由誰添加';
|
||||
$lang->doc->addedDate = '添加時間';
|
||||
$lang->doc->editedBy = '由誰編輯';
|
||||
$lang->doc->editedDate = '編輯時間';
|
||||
|
||||
$lang->doc->moduleDoc = '按模組瀏覽';
|
||||
$lang->doc->searchDoc = '搜索';
|
||||
//$lang->doc->allDoc = '所有文檔';
|
||||
|
||||
$lang->doc->moduleName = '模組名稱';
|
||||
$lang->doc->moduleOrder = '模組排序';
|
||||
|
||||
/* 方法列表。*/
|
||||
$lang->doc->index = '首頁';
|
||||
$lang->doc->create = '創建文檔';
|
||||
$lang->doc->edit = '編輯文檔';
|
||||
$lang->doc->delete = '刪除文檔';
|
||||
$lang->doc->browse = '文檔列表';
|
||||
$lang->doc->view = '文檔詳情';
|
||||
$lang->doc->createLib = '創建文檔庫';
|
||||
$lang->doc->editLib = '編輯文檔庫';
|
||||
$lang->doc->deleteLib = '刪除文檔庫';
|
||||
$lang->doc->libName = '文檔庫名稱';
|
||||
|
||||
/* 查詢條件列表 */
|
||||
$lang->doc->allProduct = '所有產品';
|
||||
$lang->doc->allProject = '所有項目';
|
||||
|
||||
$lang->doc->systemLibs['product'] = '產品文檔庫';
|
||||
$lang->doc->systemLibs['project'] = '項目文檔庫';
|
||||
|
||||
$lang->doc->types['file'] = '檔案';
|
||||
$lang->doc->types['url'] = '連結';
|
||||
$lang->doc->types['text'] = '網頁';
|
||||
|
||||
$lang->doc->confirmDelete = "您確定刪除該文檔嗎?";
|
||||
$lang->doc->confirmDeleteLib = " 您確定刪除該文檔庫嗎?";
|
||||
$lang->doc->errorEditSystemDoc = "系統文檔庫無需修改。";
|
||||
<?php
|
||||
/**
|
||||
* The doc module zh-tw file of ZenTaoPMS.
|
||||
*
|
||||
* @copyright Copyright 2009-2012 青島易軟天創網絡科技有限公司 (QingDao Nature Easy Soft Network Technology Co,LTD www.cnezsoft.com)
|
||||
* @license LGPL (http://www.gnu.org/licenses/lgpl.html)
|
||||
* @author Chunsheng Wang <chunsheng@cnezsoft.com>
|
||||
* @package doc
|
||||
* @version $Id: zh-tw.php 824 2010-05-02 15:32:06Z wwccss $
|
||||
* @link http://www.zentao.net
|
||||
*/
|
||||
/* 欄位列表。*/
|
||||
$lang->doc->common = '文檔視圖';
|
||||
$lang->doc->id = '文檔編號';
|
||||
$lang->doc->product = '所屬產品';
|
||||
$lang->doc->project = '所屬項目';
|
||||
$lang->doc->lib = '所屬文檔庫';
|
||||
$lang->doc->module = '所屬分類';
|
||||
$lang->doc->title = '文檔標題';
|
||||
$lang->doc->digest = '文檔摘要';
|
||||
$lang->doc->comment = '文檔備註';
|
||||
$lang->doc->type = '文檔類型';
|
||||
$lang->doc->content = '文檔正文';
|
||||
$lang->doc->keywords = '關鍵字';
|
||||
$lang->doc->url = '文檔URL';
|
||||
$lang->doc->files = '附件';
|
||||
$lang->doc->views = '查閲次數';
|
||||
$lang->doc->addedBy = '由誰添加';
|
||||
$lang->doc->addedDate = '添加時間';
|
||||
$lang->doc->editedBy = '由誰編輯';
|
||||
$lang->doc->editedDate = '編輯時間';
|
||||
|
||||
$lang->doc->moduleDoc = '按模組瀏覽';
|
||||
$lang->doc->searchDoc = '搜索';
|
||||
//$lang->doc->allDoc = '所有文檔';
|
||||
|
||||
$lang->doc->moduleName = '模組名稱';
|
||||
$lang->doc->moduleOrder = '模組排序';
|
||||
|
||||
/* 方法列表。*/
|
||||
$lang->doc->index = '首頁';
|
||||
$lang->doc->create = '創建文檔';
|
||||
$lang->doc->edit = '編輯文檔';
|
||||
$lang->doc->delete = '刪除文檔';
|
||||
$lang->doc->browse = '文檔列表';
|
||||
$lang->doc->view = '文檔詳情';
|
||||
$lang->doc->createLib = '創建文檔庫';
|
||||
$lang->doc->editLib = '編輯文檔庫';
|
||||
$lang->doc->deleteLib = '刪除文檔庫';
|
||||
$lang->doc->libName = '文檔庫名稱';
|
||||
|
||||
/* 查詢條件列表 */
|
||||
$lang->doc->allProduct = '所有產品';
|
||||
$lang->doc->allProject = '所有項目';
|
||||
|
||||
$lang->doc->systemLibs['product'] = '產品文檔庫';
|
||||
$lang->doc->systemLibs['project'] = '項目文檔庫';
|
||||
|
||||
$lang->doc->types['file'] = '檔案';
|
||||
$lang->doc->types['url'] = '連結';
|
||||
$lang->doc->types['text'] = '網頁';
|
||||
|
||||
$lang->doc->confirmDelete = "您確定刪除該文檔嗎?";
|
||||
$lang->doc->confirmDeleteLib = " 您確定刪除該文檔庫嗎?";
|
||||
$lang->doc->errorEditSystemDoc = "系統文檔庫無需修改。";
|
||||
|
||||
+281
-281
@@ -1,281 +1,281 @@
|
||||
<?php
|
||||
/**
|
||||
* The model file of doc module of ZenTaoPMS.
|
||||
*
|
||||
* @copyright Copyright 2009-2012 青岛易软天创网络科技有限公司 (QingDao Nature Easy Soft Network Technology Co,LTD www.cnezsoft.com)
|
||||
* @license LGPL (http://www.gnu.org/licenses/lgpl.html)
|
||||
* @author Chunsheng Wang <chunsheng@cnezsoft.com>
|
||||
* @package doc
|
||||
* @version $Id: model.php 881 2010-06-22 06:50:32Z chencongzhi520 $
|
||||
* @link http://www.zentao.net
|
||||
*/
|
||||
?>
|
||||
<?php
|
||||
class docModel extends model
|
||||
{
|
||||
/**
|
||||
* Set menus
|
||||
*
|
||||
* @param array $libs
|
||||
* @param int $libID
|
||||
* @param string $extra
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function setMenu($libs, $libID, $extra = '')
|
||||
{
|
||||
$currentModule = $this->app->getModuleName();
|
||||
$currentMethod = $this->app->getMethodName();
|
||||
|
||||
$selectHtml = html::select('libID', $libs, $libID, "onchange=\"switchDocLib(this.value, '$currentModule', '$currentMethod', '$extra');\"");
|
||||
common::setMenuVars($this->lang->doc->menu, 'list', $selectHtml . $this->lang->arrow);
|
||||
foreach($this->lang->doc->menu as $key => $menu)
|
||||
{
|
||||
if($key != 'list') common::setMenuVars($this->lang->doc->menu, $key, $libID);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get library by id.
|
||||
*
|
||||
* @param int $libID
|
||||
* @access public
|
||||
* @return object
|
||||
*/
|
||||
public function getLibById($libID)
|
||||
{
|
||||
return $this->dao->findByID($libID)->from(TABLE_DOCLIB)->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get libraries.
|
||||
*
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getLibs()
|
||||
{
|
||||
$libs = $this->dao->select('id, name')->from(TABLE_DOCLIB)->where('deleted')->eq(0)->fetchPairs();
|
||||
return $this->lang->doc->systemLibs + $libs;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a library.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function createLib()
|
||||
{
|
||||
$lib = fixer::input('post')->stripTags('name')->get();
|
||||
$this->dao->insert(TABLE_DOCLIB)
|
||||
->data($lib)
|
||||
->autoCheck()
|
||||
->batchCheck('name', 'notempty')
|
||||
->check('name', 'unique')
|
||||
->exec();
|
||||
return $this->dao->lastInsertID();
|
||||
}
|
||||
|
||||
/**
|
||||
* Update a library.
|
||||
*
|
||||
* @param int $libID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function updateLib($libID)
|
||||
{
|
||||
$libID = (int)$libID;
|
||||
$oldLib = $this->getLibById($libID);
|
||||
$lib = fixer::input('post')->stripTags('name')->get();
|
||||
$this->dao->update(TABLE_DOCLIB)
|
||||
->data($lib)
|
||||
->autoCheck()
|
||||
->batchCheck('name', 'notempty')
|
||||
->check('name', 'unique', "id != $libID")
|
||||
->where('id')->eq($libID)
|
||||
->exec();
|
||||
if(!dao::isError()) return common::createChanges($oldLib, $lib);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get docs.
|
||||
*
|
||||
* @param int|string $libID
|
||||
* @param int $productID
|
||||
* @param int $projectID
|
||||
* @param int $module
|
||||
* @param string $orderBy
|
||||
* @param object $pager
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function getDocs($libID, $productID, $projectID, $module, $orderBy, $pager)
|
||||
{
|
||||
$products = $this->loadModel('product')->getPairs();
|
||||
$projects = $this->loadModel('project')->getPairs();
|
||||
$keysOfProducts = array_keys($products);
|
||||
$keysOfProjects = array_keys($projects);
|
||||
$allKeysOfProjects = $keysOfProjects;
|
||||
$allKeysOfProjects[] = 0;
|
||||
|
||||
return $this->dao->select('*')->from(TABLE_DOC)
|
||||
->where('deleted')->eq(0)
|
||||
->beginIF(is_numeric($libID))->andWhere('lib')->eq($libID)->fi()
|
||||
->beginIF($libID == 'product')->andWhere('product')->in($keysOfProducts)->andWhere('project')->in($allKeysOfProjects)->fi()
|
||||
->beginIF($libID == 'project')->andWhere('project')->in($keysOfProjects)->fi()
|
||||
->beginIF($productID > 0)->andWhere('product')->eq($productID)->fi()
|
||||
->beginIF($projectID > 0)->andWhere('project')->eq($projectID)->fi()
|
||||
->beginIF((string)$projectID == 'int')->andWhere('project')->gt(0)->fi()
|
||||
->beginIF($module)->andWhere('module')->in($module)->fi()
|
||||
->orderBy($orderBy)
|
||||
->page($pager)
|
||||
->fetchAll();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get doc info by id.
|
||||
*
|
||||
* @param int $docID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function getById($docID)
|
||||
{
|
||||
$doc = $this->dao->select('*')
|
||||
->from(TABLE_DOC)
|
||||
->where('id')->eq((int)$docID)
|
||||
->fetch();
|
||||
if(!$doc) return false;
|
||||
$doc->content = $this->loadModel('file')->setImgSize($doc->content);
|
||||
$doc->files = $this->loadModel('file')->getByObject('doc', $docID);
|
||||
|
||||
$doc->libName = '';
|
||||
$doc->productName = '';
|
||||
$doc->projectName = '';
|
||||
$doc->moduleName = '';
|
||||
if($doc->lib) $doc->libName = $this->dao->findByID($doc->lib)->from(TABLE_DOCLIB)->fetch('name');
|
||||
if($doc->product) $doc->productName = $this->dao->findByID($doc->product)->from(TABLE_PRODUCT)->fetch('name');
|
||||
if($doc->project) $doc->projectName = $this->dao->findByID($doc->project)->from(TABLE_PROJECT)->fetch('name');
|
||||
if($doc->module) $doc->moduleName = $this->dao->findByID($doc->module)->from(TABLE_MODULE)->fetch('name');
|
||||
return $doc;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a doc.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
$now = helper::now();
|
||||
$doc = fixer::input('post')
|
||||
->add('addedBy', $this->app->user->account)
|
||||
->add('addedDate', $now)
|
||||
->setDefault('product, project, module', 0)
|
||||
->specialChars('title, digest, keywords')
|
||||
->encodeURL('url')
|
||||
->cleanInt('product, project, module')
|
||||
->remove('files, labels')
|
||||
->get();
|
||||
$condition = "lib = '$doc->lib' AND module = $doc->module";
|
||||
$this->dao->insert(TABLE_DOC)
|
||||
->data($doc)
|
||||
->autoCheck()
|
||||
->batchCheck($this->config->doc->create->requiredFields, 'notempty')
|
||||
->check('title', 'unique', $condition)
|
||||
->exec();
|
||||
if(!dao::isError())
|
||||
{
|
||||
$docID = $this->dao->lastInsertID();
|
||||
$this->loadModel('file')->saveUpload('doc', $docID);
|
||||
return $docID;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Update a doc.
|
||||
*
|
||||
* @param int $docID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function update($docID)
|
||||
{
|
||||
$oldDoc = $this->getById($docID);
|
||||
$now = helper::now();
|
||||
$doc = fixer::input('post')
|
||||
->cleanInt('module')
|
||||
->setDefault('module', 0)
|
||||
->specialChars('title, digest, keywords')
|
||||
->encodeURL('url')
|
||||
->remove('comment,files, labels')
|
||||
->add('editedBy', $this->app->user->account)
|
||||
->add('editedDate', $now)
|
||||
->get();
|
||||
|
||||
$condition = "lib = '$doc->lib' AND module = $doc->module AND id != $docID";
|
||||
$this->dao->update(TABLE_DOC)->data($doc)
|
||||
->autoCheck()
|
||||
->batchCheck($this->config->doc->edit->requiredFields, 'notempty')
|
||||
->check('title', 'unique', $condition)
|
||||
->where('id')->eq((int)$docID)
|
||||
->exec();
|
||||
if(!dao::isError()) return common::createChanges($oldDoc, $doc);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get docs of a product.
|
||||
*
|
||||
* @param int $productID
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getProductDocs($productID)
|
||||
{
|
||||
return $this->dao->select('t1.*, t2.name as module')
|
||||
->from(TABLE_DOC)->alias('t1')
|
||||
->leftjoin(TABLE_MODULE)->alias('t2')->on('t1.module = t2.id')
|
||||
->where('t1.product')->eq($productID)
|
||||
->andWhere('t1.deleted')->eq(0)
|
||||
->orderBy('t1.id_desc')
|
||||
->fetchAll();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get docs of a project.
|
||||
*
|
||||
* @param int $projectID
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getProjectDocs($projectID)
|
||||
{
|
||||
return $this->dao->findByProject($projectID)->from(TABLE_DOC)->andWhere('deleted')->eq(0)->orderBy('id_desc')->fetchAll();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get pairs of product modules.
|
||||
*
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getProductModulePairs()
|
||||
{
|
||||
return $this->dao->findByType('productdoc')->from(TABLE_MODULE)->fetchPairs('id', 'name');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get pairs of project modules.
|
||||
*
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getProjectModulePairs()
|
||||
{
|
||||
return $this->dao->findByType('projectdoc')->from(TABLE_MODULE)->andWhere('type')->eq('projectdoc')->fetchPairs('id', 'name');
|
||||
}
|
||||
}
|
||||
<?php
|
||||
/**
|
||||
* The model file of doc module of ZenTaoPMS.
|
||||
*
|
||||
* @copyright Copyright 2009-2012 青岛易软天创网络科技有限公司 (QingDao Nature Easy Soft Network Technology Co,LTD www.cnezsoft.com)
|
||||
* @license LGPL (http://www.gnu.org/licenses/lgpl.html)
|
||||
* @author Chunsheng Wang <chunsheng@cnezsoft.com>
|
||||
* @package doc
|
||||
* @version $Id: model.php 881 2010-06-22 06:50:32Z chencongzhi520 $
|
||||
* @link http://www.zentao.net
|
||||
*/
|
||||
?>
|
||||
<?php
|
||||
class docModel extends model
|
||||
{
|
||||
/**
|
||||
* Set menus
|
||||
*
|
||||
* @param array $libs
|
||||
* @param int $libID
|
||||
* @param string $extra
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function setMenu($libs, $libID, $extra = '')
|
||||
{
|
||||
$currentModule = $this->app->getModuleName();
|
||||
$currentMethod = $this->app->getMethodName();
|
||||
|
||||
$selectHtml = html::select('libID', $libs, $libID, "onchange=\"switchDocLib(this.value, '$currentModule', '$currentMethod', '$extra');\"");
|
||||
common::setMenuVars($this->lang->doc->menu, 'list', $selectHtml . $this->lang->arrow);
|
||||
foreach($this->lang->doc->menu as $key => $menu)
|
||||
{
|
||||
if($key != 'list') common::setMenuVars($this->lang->doc->menu, $key, $libID);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get library by id.
|
||||
*
|
||||
* @param int $libID
|
||||
* @access public
|
||||
* @return object
|
||||
*/
|
||||
public function getLibById($libID)
|
||||
{
|
||||
return $this->dao->findByID($libID)->from(TABLE_DOCLIB)->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get libraries.
|
||||
*
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getLibs()
|
||||
{
|
||||
$libs = $this->dao->select('id, name')->from(TABLE_DOCLIB)->where('deleted')->eq(0)->fetchPairs();
|
||||
return $this->lang->doc->systemLibs + $libs;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a library.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function createLib()
|
||||
{
|
||||
$lib = fixer::input('post')->stripTags('name')->get();
|
||||
$this->dao->insert(TABLE_DOCLIB)
|
||||
->data($lib)
|
||||
->autoCheck()
|
||||
->batchCheck('name', 'notempty')
|
||||
->check('name', 'unique')
|
||||
->exec();
|
||||
return $this->dao->lastInsertID();
|
||||
}
|
||||
|
||||
/**
|
||||
* Update a library.
|
||||
*
|
||||
* @param int $libID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function updateLib($libID)
|
||||
{
|
||||
$libID = (int)$libID;
|
||||
$oldLib = $this->getLibById($libID);
|
||||
$lib = fixer::input('post')->stripTags('name')->get();
|
||||
$this->dao->update(TABLE_DOCLIB)
|
||||
->data($lib)
|
||||
->autoCheck()
|
||||
->batchCheck('name', 'notempty')
|
||||
->check('name', 'unique', "id != $libID")
|
||||
->where('id')->eq($libID)
|
||||
->exec();
|
||||
if(!dao::isError()) return common::createChanges($oldLib, $lib);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get docs.
|
||||
*
|
||||
* @param int|string $libID
|
||||
* @param int $productID
|
||||
* @param int $projectID
|
||||
* @param int $module
|
||||
* @param string $orderBy
|
||||
* @param object $pager
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function getDocs($libID, $productID, $projectID, $module, $orderBy, $pager)
|
||||
{
|
||||
$products = $this->loadModel('product')->getPairs();
|
||||
$projects = $this->loadModel('project')->getPairs();
|
||||
$keysOfProducts = array_keys($products);
|
||||
$keysOfProjects = array_keys($projects);
|
||||
$allKeysOfProjects = $keysOfProjects;
|
||||
$allKeysOfProjects[] = 0;
|
||||
|
||||
return $this->dao->select('*')->from(TABLE_DOC)
|
||||
->where('deleted')->eq(0)
|
||||
->beginIF(is_numeric($libID))->andWhere('lib')->eq($libID)->fi()
|
||||
->beginIF($libID == 'product')->andWhere('product')->in($keysOfProducts)->andWhere('project')->in($allKeysOfProjects)->fi()
|
||||
->beginIF($libID == 'project')->andWhere('project')->in($keysOfProjects)->fi()
|
||||
->beginIF($productID > 0)->andWhere('product')->eq($productID)->fi()
|
||||
->beginIF($projectID > 0)->andWhere('project')->eq($projectID)->fi()
|
||||
->beginIF((string)$projectID == 'int')->andWhere('project')->gt(0)->fi()
|
||||
->beginIF($module)->andWhere('module')->in($module)->fi()
|
||||
->orderBy($orderBy)
|
||||
->page($pager)
|
||||
->fetchAll();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get doc info by id.
|
||||
*
|
||||
* @param int $docID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function getById($docID)
|
||||
{
|
||||
$doc = $this->dao->select('*')
|
||||
->from(TABLE_DOC)
|
||||
->where('id')->eq((int)$docID)
|
||||
->fetch();
|
||||
if(!$doc) return false;
|
||||
$doc->content = $this->loadModel('file')->setImgSize($doc->content);
|
||||
$doc->files = $this->loadModel('file')->getByObject('doc', $docID);
|
||||
|
||||
$doc->libName = '';
|
||||
$doc->productName = '';
|
||||
$doc->projectName = '';
|
||||
$doc->moduleName = '';
|
||||
if($doc->lib) $doc->libName = $this->dao->findByID($doc->lib)->from(TABLE_DOCLIB)->fetch('name');
|
||||
if($doc->product) $doc->productName = $this->dao->findByID($doc->product)->from(TABLE_PRODUCT)->fetch('name');
|
||||
if($doc->project) $doc->projectName = $this->dao->findByID($doc->project)->from(TABLE_PROJECT)->fetch('name');
|
||||
if($doc->module) $doc->moduleName = $this->dao->findByID($doc->module)->from(TABLE_MODULE)->fetch('name');
|
||||
return $doc;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a doc.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
$now = helper::now();
|
||||
$doc = fixer::input('post')
|
||||
->add('addedBy', $this->app->user->account)
|
||||
->add('addedDate', $now)
|
||||
->setDefault('product, project, module', 0)
|
||||
->specialChars('title, digest, keywords')
|
||||
->encodeURL('url')
|
||||
->cleanInt('product, project, module')
|
||||
->remove('files, labels')
|
||||
->get();
|
||||
$condition = "lib = '$doc->lib' AND module = $doc->module";
|
||||
$this->dao->insert(TABLE_DOC)
|
||||
->data($doc)
|
||||
->autoCheck()
|
||||
->batchCheck($this->config->doc->create->requiredFields, 'notempty')
|
||||
->check('title', 'unique', $condition)
|
||||
->exec();
|
||||
if(!dao::isError())
|
||||
{
|
||||
$docID = $this->dao->lastInsertID();
|
||||
$this->loadModel('file')->saveUpload('doc', $docID);
|
||||
return $docID;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Update a doc.
|
||||
*
|
||||
* @param int $docID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function update($docID)
|
||||
{
|
||||
$oldDoc = $this->getById($docID);
|
||||
$now = helper::now();
|
||||
$doc = fixer::input('post')
|
||||
->cleanInt('module')
|
||||
->setDefault('module', 0)
|
||||
->specialChars('title, digest, keywords')
|
||||
->encodeURL('url')
|
||||
->remove('comment,files, labels')
|
||||
->add('editedBy', $this->app->user->account)
|
||||
->add('editedDate', $now)
|
||||
->get();
|
||||
|
||||
$condition = "lib = '$doc->lib' AND module = $doc->module AND id != $docID";
|
||||
$this->dao->update(TABLE_DOC)->data($doc)
|
||||
->autoCheck()
|
||||
->batchCheck($this->config->doc->edit->requiredFields, 'notempty')
|
||||
->check('title', 'unique', $condition)
|
||||
->where('id')->eq((int)$docID)
|
||||
->exec();
|
||||
if(!dao::isError()) return common::createChanges($oldDoc, $doc);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get docs of a product.
|
||||
*
|
||||
* @param int $productID
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getProductDocs($productID)
|
||||
{
|
||||
return $this->dao->select('t1.*, t2.name as module')
|
||||
->from(TABLE_DOC)->alias('t1')
|
||||
->leftjoin(TABLE_MODULE)->alias('t2')->on('t1.module = t2.id')
|
||||
->where('t1.product')->eq($productID)
|
||||
->andWhere('t1.deleted')->eq(0)
|
||||
->orderBy('t1.id_desc')
|
||||
->fetchAll();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get docs of a project.
|
||||
*
|
||||
* @param int $projectID
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getProjectDocs($projectID)
|
||||
{
|
||||
return $this->dao->findByProject($projectID)->from(TABLE_DOC)->andWhere('deleted')->eq(0)->orderBy('id_desc')->fetchAll();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get pairs of product modules.
|
||||
*
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getProductModulePairs()
|
||||
{
|
||||
return $this->dao->findByType('productdoc')->from(TABLE_MODULE)->fetchPairs('id', 'name');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get pairs of project modules.
|
||||
*
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getProjectModulePairs()
|
||||
{
|
||||
return $this->dao->findByType('projectdoc')->from(TABLE_MODULE)->andWhere('type')->eq('projectdoc')->fetchPairs('id', 'name');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,82 +1,82 @@
|
||||
<?php
|
||||
/**
|
||||
* The browse view file of doc module of ZenTaoPMS.
|
||||
*
|
||||
* @copyright Copyright 2009-2012 青岛易软天创网络科技有限公司 (QingDao Nature Easy Soft Network Technology Co,LTD www.cnezsoft.com)
|
||||
* @license LGPL (http://www.gnu.org/licenses/lgpl.html)
|
||||
* @author Chunsheng Wang <chunsheng@cnezsoft.com>
|
||||
* @package lib
|
||||
* @version $Id: browse.html.php 958 2010-07-22 08:09:42Z wwccss $
|
||||
* @link http://www.zentao.net
|
||||
*/
|
||||
?>
|
||||
<?php include '../../common/view/header.html.php';?>
|
||||
<?php include '../../common/view/treeview.html.php';?>
|
||||
<?php include '../../common/view/colorize.html.php';?>
|
||||
<script language='Javascript'>
|
||||
var browseType = '<?php echo $browseType;?>';
|
||||
</script>
|
||||
<div id='featurebar'>
|
||||
<div class='f-left'>
|
||||
<span id='bymoduleTab' onclick='browseByModule()'><a href='#'><?php echo $lang->doc->moduleDoc;?></a></span>
|
||||
<span id='bysearchTab'><a href='#'><?php echo $lang->doc->searchDoc;?></a></span>
|
||||
</div>
|
||||
<div class='f-right'>
|
||||
<?php common::printLink('doc', 'create', "libID=$libID&moduleID=$moduleID&productID=$productID&projectID=$projectID&from=doc", $lang->doc->create);?>
|
||||
</div>
|
||||
</div>
|
||||
<div id='querybox' class='<?php if($browseType !='bysearch') echo 'hidden';?>'><?php echo $searchForm;?></div>
|
||||
|
||||
<table class='cont-lt3'>
|
||||
<tr valign='top'>
|
||||
<td class='side' id='treebox'>
|
||||
<div class='box-title'><?php echo $libName;?></div>
|
||||
<div class='box-content'>
|
||||
<?php echo $moduleTree;?>
|
||||
<div class='a-right'>
|
||||
<?php common::printLink('tree', 'browse', "rootID=$libID&view=doc", $lang->tree->docManage);?>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td class='divider'></td>
|
||||
<td>
|
||||
<table class='table-1 fixed colored tablesorter datatable'>
|
||||
<thead>
|
||||
<tr class='colhead'>
|
||||
<?php $vars = "libID=$libID&module=$moduleID&productID=$productID&projectID=$projectID&browseType=$browseType¶m=$param&orderBy=%s&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}";?>
|
||||
<th class='w-id'> <?php common::printOrderLink('id', $orderBy, $vars, $lang->idAB);?></th>
|
||||
<th><?php common::printOrderLink('title', $orderBy, $vars, $lang->doc->title);?></th>
|
||||
<th class='w-100px'><?php common::printOrderLink('type', $orderBy, $vars, $lang->doc->type);?></th>
|
||||
<th class='w-100px'><?php common::printOrderLink('addedBy', $orderBy, $vars, $lang->doc->addedBy);?></th>
|
||||
<th class='w-120px'><?php common::printOrderLink('addedDate', $orderBy, $vars, $lang->doc->addedDate);?></th>
|
||||
<th class='w-100px {sorter:false}'><?php echo $lang->actions;?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach($docs as $key => $doc):?>
|
||||
<?php
|
||||
$viewLink = $this->createLink('doc', 'view', "docID=$doc->id");
|
||||
$canView = common::hasPriv('doc', 'view');
|
||||
?>
|
||||
<tr class='a-center'>
|
||||
<td><?php if($canView) echo html::a($viewLink, sprintf('%03d', $doc->id)); else printf('%03d', $doc->id);?></td>
|
||||
<td class='a-left nobr'><nobr><?php echo html::a($viewLink, $doc->title);?></nobr></td>
|
||||
<td><?php echo $lang->doc->types[$doc->type];?></td>
|
||||
<td><?php isset($users[$doc->addedBy]) ? print($users[$doc->addedBy]) : print($doc->addedBy);?></td>
|
||||
<td><?php echo date("m-d H:i", strtotime($doc->addedDate));?></td>
|
||||
<td>
|
||||
<?php
|
||||
$vars = "doc={$doc->id}";
|
||||
if(!common::printLink('doc', 'edit', $vars, $lang->edit)) echo $lang->edit;
|
||||
if(!common::printLink('doc', 'delete', $vars, $lang->delete, 'hiddenwin')) echo $lang->delete;
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach;?>
|
||||
</tbody>
|
||||
<tfoot><tr><td colspan='6'><?php $pager->show();?></td></tr></tfoot>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<?php include './footer.html.php';?>
|
||||
<?php
|
||||
/**
|
||||
* The browse view file of doc module of ZenTaoPMS.
|
||||
*
|
||||
* @copyright Copyright 2009-2012 青岛易软天创网络科技有限公司 (QingDao Nature Easy Soft Network Technology Co,LTD www.cnezsoft.com)
|
||||
* @license LGPL (http://www.gnu.org/licenses/lgpl.html)
|
||||
* @author Chunsheng Wang <chunsheng@cnezsoft.com>
|
||||
* @package lib
|
||||
* @version $Id: browse.html.php 958 2010-07-22 08:09:42Z wwccss $
|
||||
* @link http://www.zentao.net
|
||||
*/
|
||||
?>
|
||||
<?php include '../../common/view/header.html.php';?>
|
||||
<?php include '../../common/view/treeview.html.php';?>
|
||||
<?php include '../../common/view/colorize.html.php';?>
|
||||
<script language='Javascript'>
|
||||
var browseType = '<?php echo $browseType;?>';
|
||||
</script>
|
||||
<div id='featurebar'>
|
||||
<div class='f-left'>
|
||||
<span id='bymoduleTab' onclick='browseByModule()'><a href='#'><?php echo $lang->doc->moduleDoc;?></a></span>
|
||||
<span id='bysearchTab'><a href='#'><?php echo $lang->doc->searchDoc;?></a></span>
|
||||
</div>
|
||||
<div class='f-right'>
|
||||
<?php common::printLink('doc', 'create', "libID=$libID&moduleID=$moduleID&productID=$productID&projectID=$projectID&from=doc", $lang->doc->create);?>
|
||||
</div>
|
||||
</div>
|
||||
<div id='querybox' class='<?php if($browseType !='bysearch') echo 'hidden';?>'><?php echo $searchForm;?></div>
|
||||
|
||||
<table class='cont-lt3'>
|
||||
<tr valign='top'>
|
||||
<td class='side' id='treebox'>
|
||||
<div class='box-title'><?php echo $libName;?></div>
|
||||
<div class='box-content'>
|
||||
<?php echo $moduleTree;?>
|
||||
<div class='a-right'>
|
||||
<?php common::printLink('tree', 'browse', "rootID=$libID&view=doc", $lang->tree->docManage);?>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td class='divider'></td>
|
||||
<td>
|
||||
<table class='table-1 fixed colored tablesorter datatable'>
|
||||
<thead>
|
||||
<tr class='colhead'>
|
||||
<?php $vars = "libID=$libID&module=$moduleID&productID=$productID&projectID=$projectID&browseType=$browseType¶m=$param&orderBy=%s&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}";?>
|
||||
<th class='w-id'> <?php common::printOrderLink('id', $orderBy, $vars, $lang->idAB);?></th>
|
||||
<th><?php common::printOrderLink('title', $orderBy, $vars, $lang->doc->title);?></th>
|
||||
<th class='w-100px'><?php common::printOrderLink('type', $orderBy, $vars, $lang->doc->type);?></th>
|
||||
<th class='w-100px'><?php common::printOrderLink('addedBy', $orderBy, $vars, $lang->doc->addedBy);?></th>
|
||||
<th class='w-120px'><?php common::printOrderLink('addedDate', $orderBy, $vars, $lang->doc->addedDate);?></th>
|
||||
<th class='w-100px {sorter:false}'><?php echo $lang->actions;?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach($docs as $key => $doc):?>
|
||||
<?php
|
||||
$viewLink = $this->createLink('doc', 'view', "docID=$doc->id");
|
||||
$canView = common::hasPriv('doc', 'view');
|
||||
?>
|
||||
<tr class='a-center'>
|
||||
<td><?php if($canView) echo html::a($viewLink, sprintf('%03d', $doc->id)); else printf('%03d', $doc->id);?></td>
|
||||
<td class='a-left nobr'><nobr><?php echo html::a($viewLink, $doc->title);?></nobr></td>
|
||||
<td><?php echo $lang->doc->types[$doc->type];?></td>
|
||||
<td><?php isset($users[$doc->addedBy]) ? print($users[$doc->addedBy]) : print($doc->addedBy);?></td>
|
||||
<td><?php echo date("m-d H:i", strtotime($doc->addedDate));?></td>
|
||||
<td>
|
||||
<?php
|
||||
$vars = "doc={$doc->id}";
|
||||
if(!common::printLink('doc', 'edit', $vars, $lang->edit)) echo $lang->edit;
|
||||
if(!common::printLink('doc', 'delete', $vars, $lang->delete, 'hiddenwin')) echo $lang->delete;
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach;?>
|
||||
</tbody>
|
||||
<tfoot><tr><td colspan='6'><?php $pager->show();?></td></tr></tfoot>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<?php include './footer.html.php';?>
|
||||
|
||||
@@ -1,70 +1,70 @@
|
||||
<?php
|
||||
/**
|
||||
* The create view of doc module of ZenTaoPMS.
|
||||
*
|
||||
* @copyright Copyright 2009-2012 青岛易软天创网络科技有限公司 (QingDao Nature Easy Soft Network Technology Co,LTD www.cnezsoft.com)
|
||||
* @license LGPL (http://www.gnu.org/licenses/lgpl.html)
|
||||
* @author Jia Fu <fujia@cnezsoft.com>
|
||||
* @package doc
|
||||
* @version $Id: create.html.php 975 2010-07-29 03:30:25Z jajacn@126.com $
|
||||
* @link http://www.zentao.net
|
||||
*/
|
||||
?>
|
||||
<?php include '../../common/view/header.html.php';?>
|
||||
<?php include '../../common/view/kindeditor.html.php';?>
|
||||
<form method='post' enctype='multipart/form-data' target='hiddenwin'>
|
||||
<table class='table-1'>
|
||||
<caption><?php echo $lang->doc->create;?></caption>
|
||||
<?php if($libID == 'product'):?>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->doc->product;?></th>
|
||||
<td><?php echo html::select('product', $products, $productID, "class='select-3'");?></td>
|
||||
</tr>
|
||||
<?php elseif($libID == 'project'):?>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->doc->project;?></th>
|
||||
<td><?php echo html::select('project', $projects, $projectID, "class='select-3' onchange=loadProducts(this.value);");?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->doc->product;?></th>
|
||||
<td><span id='productBox'><?php echo html::select('product', $products, '', "class='select-3'");?></span></td>
|
||||
</tr>
|
||||
<?php endif;?>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->doc->module;?></th>
|
||||
<td><?php echo html::select('module', $moduleOptionMenu, $moduleID, "class='select-3'");?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->doc->type;?></th>
|
||||
<td><?php echo html::radio('type', $lang->doc->types, 'file', "onclick=setType(this.value)");?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->doc->title;?></th>
|
||||
<td><?php echo html::input('title', '', "class='text-1'");?></td>
|
||||
</tr>
|
||||
<tr id='urlBox' class='hidden'>
|
||||
<th class='rowhead'><?php echo $lang->doc->url;?></th>
|
||||
<td><?php echo html::input('url', '', "class='text-1'");?></td>
|
||||
</tr>
|
||||
<tr id='contentBox' class='hidden'>
|
||||
<th class='rowhead'><?php echo $lang->doc->content;?></th>
|
||||
<td><?php echo html::textarea('content', '', "class='area-1' style='width:90%; height:200px'");?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->doc->keywords;?></th>
|
||||
<td><?php echo html::input('keywords', '', "class='text-1'");?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->doc->digest;?></th>
|
||||
<td><?php echo html::textarea('digest', '', "class='text-1' rows=3");?></td>
|
||||
</tr>
|
||||
<tr id='fileBox'>
|
||||
<th class='rowhead'><?php echo $lang->doc->files;?></th>
|
||||
<td><?php echo $this->fetch('file', 'buildform', 'fileCount=2');?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan='2' class='a-center'><?php echo html::submitButton() . html::resetButton() . html::hidden('lib', $libID);?></td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
<?php include './footer.html.php';?>
|
||||
<?php
|
||||
/**
|
||||
* The create view of doc module of ZenTaoPMS.
|
||||
*
|
||||
* @copyright Copyright 2009-2012 青岛易软天创网络科技有限公司 (QingDao Nature Easy Soft Network Technology Co,LTD www.cnezsoft.com)
|
||||
* @license LGPL (http://www.gnu.org/licenses/lgpl.html)
|
||||
* @author Jia Fu <fujia@cnezsoft.com>
|
||||
* @package doc
|
||||
* @version $Id: create.html.php 975 2010-07-29 03:30:25Z jajacn@126.com $
|
||||
* @link http://www.zentao.net
|
||||
*/
|
||||
?>
|
||||
<?php include '../../common/view/header.html.php';?>
|
||||
<?php include '../../common/view/kindeditor.html.php';?>
|
||||
<form method='post' enctype='multipart/form-data' target='hiddenwin'>
|
||||
<table class='table-1'>
|
||||
<caption><?php echo $lang->doc->create;?></caption>
|
||||
<?php if($libID == 'product'):?>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->doc->product;?></th>
|
||||
<td><?php echo html::select('product', $products, $productID, "class='select-3'");?></td>
|
||||
</tr>
|
||||
<?php elseif($libID == 'project'):?>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->doc->project;?></th>
|
||||
<td><?php echo html::select('project', $projects, $projectID, "class='select-3' onchange=loadProducts(this.value);");?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->doc->product;?></th>
|
||||
<td><span id='productBox'><?php echo html::select('product', $products, '', "class='select-3'");?></span></td>
|
||||
</tr>
|
||||
<?php endif;?>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->doc->module;?></th>
|
||||
<td><?php echo html::select('module', $moduleOptionMenu, $moduleID, "class='select-3'");?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->doc->type;?></th>
|
||||
<td><?php echo html::radio('type', $lang->doc->types, 'file', "onclick=setType(this.value)");?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->doc->title;?></th>
|
||||
<td><?php echo html::input('title', '', "class='text-1'");?></td>
|
||||
</tr>
|
||||
<tr id='urlBox' class='hidden'>
|
||||
<th class='rowhead'><?php echo $lang->doc->url;?></th>
|
||||
<td><?php echo html::input('url', '', "class='text-1'");?></td>
|
||||
</tr>
|
||||
<tr id='contentBox' class='hidden'>
|
||||
<th class='rowhead'><?php echo $lang->doc->content;?></th>
|
||||
<td><?php echo html::textarea('content', '', "class='area-1' style='width:90%; height:200px'");?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->doc->keywords;?></th>
|
||||
<td><?php echo html::input('keywords', '', "class='text-1'");?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->doc->digest;?></th>
|
||||
<td><?php echo html::textarea('digest', '', "class='text-1' rows=3");?></td>
|
||||
</tr>
|
||||
<tr id='fileBox'>
|
||||
<th class='rowhead'><?php echo $lang->doc->files;?></th>
|
||||
<td><?php echo $this->fetch('file', 'buildform', 'fileCount=2');?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan='2' class='a-center'><?php echo html::submitButton() . html::resetButton() . html::hidden('lib', $libID);?></td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
<?php include './footer.html.php';?>
|
||||
|
||||
@@ -1,26 +1,26 @@
|
||||
<?php
|
||||
/**
|
||||
* The createlib view of doc module of ZenTaoPMS.
|
||||
*
|
||||
* @copyright Copyright 2009-2012 青岛易软天创网络科技有限公司 (QingDao Nature Easy Soft Network Technology Co,LTD www.cnezsoft.com)
|
||||
* @license LGPL (http://www.gnu.org/licenses/lgpl.html)
|
||||
* @author Jia Fu <fujia@cnezsoft.com>
|
||||
* @package doc
|
||||
* @version $Id: createlib.html.php 975 2010-07-29 03:30:25Z jajacn@126.com $
|
||||
* @link http://www.zentao.net
|
||||
*/
|
||||
?>
|
||||
<?php include '../../common/view/header.lite.html.php';?>
|
||||
<form method='post'>
|
||||
<table class='table-1'>
|
||||
<caption><?php echo $lang->doc->createLib;?></caption>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->doc->libName;?></th>
|
||||
<td><?php echo html::input('name', '', "class='text-1'");?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan='2' class='a-center'><?php echo html::submitButton();?></td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
<?php include '../../common/view/footer.lite.html.php';?>
|
||||
<?php
|
||||
/**
|
||||
* The createlib view of doc module of ZenTaoPMS.
|
||||
*
|
||||
* @copyright Copyright 2009-2012 青岛易软天创网络科技有限公司 (QingDao Nature Easy Soft Network Technology Co,LTD www.cnezsoft.com)
|
||||
* @license LGPL (http://www.gnu.org/licenses/lgpl.html)
|
||||
* @author Jia Fu <fujia@cnezsoft.com>
|
||||
* @package doc
|
||||
* @version $Id: createlib.html.php 975 2010-07-29 03:30:25Z jajacn@126.com $
|
||||
* @link http://www.zentao.net
|
||||
*/
|
||||
?>
|
||||
<?php include '../../common/view/header.lite.html.php';?>
|
||||
<form method='post'>
|
||||
<table class='table-1'>
|
||||
<caption><?php echo $lang->doc->createLib;?></caption>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->doc->libName;?></th>
|
||||
<td><?php echo html::input('name', '', "class='text-1'");?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan='2' class='a-center'><?php echo html::submitButton();?></td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
<?php include '../../common/view/footer.lite.html.php';?>
|
||||
|
||||
@@ -1,68 +1,68 @@
|
||||
<?php
|
||||
/**
|
||||
* The edit view of doc module of ZenTaoPMS.
|
||||
*
|
||||
* @copyright Copyright 2009-2012 青岛易软天创网络科技有限公司 (QingDao Nature Easy Soft Network Technology Co,LTD www.cnezsoft.com)
|
||||
* @license LGPL (http://www.gnu.org/licenses/lgpl.html)
|
||||
* @author Jia Fu <fujia@cnezsoft.com>
|
||||
* @package doc
|
||||
* @version $Id: edit.html.php 975 2010-07-29 03:30:25Z jajacn@126.com $
|
||||
* @link http://www.zentao.net
|
||||
*/
|
||||
?>
|
||||
<?php include '../../common/view/header.html.php';?>
|
||||
<?php include '../../common/view/kindeditor.html.php';?>
|
||||
<script language='javascript'>
|
||||
var type = '<?php echo $doc->type;?>';
|
||||
$(document).ready(function()
|
||||
{
|
||||
setType(type);
|
||||
});
|
||||
</script>
|
||||
<form method='post' enctype='multipart/form-data' target='hiddenwin'>
|
||||
<table class='table-1'>
|
||||
<caption><?php echo $lang->doc->edit;?></caption>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->doc->module;?></th>
|
||||
<td><?php echo html::select('module', $moduleOptionMenu, $doc->module, "class='select-3'");?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->doc->type;?></th>
|
||||
<td><?php echo $lang->doc->types[$doc->type];?></td>
|
||||
</tr>
|
||||
<th class='rowhead'><?php echo $lang->doc->title;?></th>
|
||||
<td><?php echo html::input('title', $doc->title, "class='text-1'");?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->doc->keywords;?></th>
|
||||
<td><?php echo html::input('keywords', $doc->keywords, "class='text-1'");?></td>
|
||||
</tr>
|
||||
<tr id='urlBox' class='hidden'>
|
||||
<th class='rowhead'><?php echo $lang->doc->url;?></th>
|
||||
<td><?php echo html::input('url', urldecode($doc->url), "class='text-1'");?></td>
|
||||
</tr>
|
||||
<tr id='contentBox' class='hidden'>
|
||||
<th class='rowhead'><?php echo $lang->doc->content;?></th>
|
||||
<td><?php echo html::textarea('content', htmlspecialchars($doc->content), "class='text-1' rows='8' style='width:90%; height:200px'");?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->doc->digest;?></th>
|
||||
<td><?php echo html::textarea('digest', $doc->digest, "class='text-1' rows=3");?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->doc->comment;?></th>
|
||||
<td><?php echo html::textarea('comment','', "class='text-1' rows=3");?></td>
|
||||
</tr>
|
||||
<tr id='fileBox' class='hidden'>
|
||||
<th class='rowhead'><?php echo $lang->doc->files;?></th>
|
||||
<td><?php echo $this->fetch('file', 'buildform', 'fileCount=2');?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan='2' class='a-center'>
|
||||
<?php echo html::submitButton() . html::resetButton() . html::hidden('lib', $libID);?>
|
||||
<?php echo html::hidden('product', $doc->product) . html::hidden('project', $doc->project);?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
<?php include './footer.html.php';?>
|
||||
<?php
|
||||
/**
|
||||
* The edit view of doc module of ZenTaoPMS.
|
||||
*
|
||||
* @copyright Copyright 2009-2012 青岛易软天创网络科技有限公司 (QingDao Nature Easy Soft Network Technology Co,LTD www.cnezsoft.com)
|
||||
* @license LGPL (http://www.gnu.org/licenses/lgpl.html)
|
||||
* @author Jia Fu <fujia@cnezsoft.com>
|
||||
* @package doc
|
||||
* @version $Id: edit.html.php 975 2010-07-29 03:30:25Z jajacn@126.com $
|
||||
* @link http://www.zentao.net
|
||||
*/
|
||||
?>
|
||||
<?php include '../../common/view/header.html.php';?>
|
||||
<?php include '../../common/view/kindeditor.html.php';?>
|
||||
<script language='javascript'>
|
||||
var type = '<?php echo $doc->type;?>';
|
||||
$(document).ready(function()
|
||||
{
|
||||
setType(type);
|
||||
});
|
||||
</script>
|
||||
<form method='post' enctype='multipart/form-data' target='hiddenwin'>
|
||||
<table class='table-1'>
|
||||
<caption><?php echo $lang->doc->edit;?></caption>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->doc->module;?></th>
|
||||
<td><?php echo html::select('module', $moduleOptionMenu, $doc->module, "class='select-3'");?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->doc->type;?></th>
|
||||
<td><?php echo $lang->doc->types[$doc->type];?></td>
|
||||
</tr>
|
||||
<th class='rowhead'><?php echo $lang->doc->title;?></th>
|
||||
<td><?php echo html::input('title', $doc->title, "class='text-1'");?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->doc->keywords;?></th>
|
||||
<td><?php echo html::input('keywords', $doc->keywords, "class='text-1'");?></td>
|
||||
</tr>
|
||||
<tr id='urlBox' class='hidden'>
|
||||
<th class='rowhead'><?php echo $lang->doc->url;?></th>
|
||||
<td><?php echo html::input('url', urldecode($doc->url), "class='text-1'");?></td>
|
||||
</tr>
|
||||
<tr id='contentBox' class='hidden'>
|
||||
<th class='rowhead'><?php echo $lang->doc->content;?></th>
|
||||
<td><?php echo html::textarea('content', htmlspecialchars($doc->content), "class='text-1' rows='8' style='width:90%; height:200px'");?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->doc->digest;?></th>
|
||||
<td><?php echo html::textarea('digest', $doc->digest, "class='text-1' rows=3");?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->doc->comment;?></th>
|
||||
<td><?php echo html::textarea('comment','', "class='text-1' rows=3");?></td>
|
||||
</tr>
|
||||
<tr id='fileBox' class='hidden'>
|
||||
<th class='rowhead'><?php echo $lang->doc->files;?></th>
|
||||
<td><?php echo $this->fetch('file', 'buildform', 'fileCount=2');?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan='2' class='a-center'>
|
||||
<?php echo html::submitButton() . html::resetButton() . html::hidden('lib', $libID);?>
|
||||
<?php echo html::hidden('product', $doc->product) . html::hidden('project', $doc->project);?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
<?php include './footer.html.php';?>
|
||||
|
||||
@@ -1,28 +1,28 @@
|
||||
<?php
|
||||
/**
|
||||
* The editlib file of doc module of ZenTaoPMS.
|
||||
*
|
||||
* @copyright Copyright 2009-2012 青岛易软天创网络科技有限公司 (QingDao Nature Easy Soft Network Technology Co,LTD www.cnezsoft.com)
|
||||
* @license LGPL (http://www.gnu.org/licenses/lgpl.html)
|
||||
* @author Jia Fu <fujia@cnezsoft.com>
|
||||
* @package doc
|
||||
* @version $Id: editlib.html.php 975 2010-07-29 03:30:25Z jajacn@126.com $
|
||||
* @link http://www.zentao.net
|
||||
*/
|
||||
?>
|
||||
<?php include '../../common/view/header.lite.html.php';?>
|
||||
<?php if($libID == 'product' or $libID == 'project'):?>
|
||||
<p class='a-center strong mt-10px'><?php echo $lang->doc->errorEditSystemDoc;?></p>
|
||||
<?php else:?>
|
||||
<form method='post'>
|
||||
<table class='table-1'>
|
||||
<caption><?php echo $lang->doc->editLib;?></caption>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->doc->libName;?></th>
|
||||
<td><?php echo html::input('name', $libName, "class='text-1'");?></td>
|
||||
</tr>
|
||||
<tr><td colspan='2' class='a-center'><?php echo html::submitButton();?></td></tr>
|
||||
</table>
|
||||
</form>
|
||||
<?php endif;?>
|
||||
<?php include '../../common/view/footer.lite.html.php';?>
|
||||
<?php
|
||||
/**
|
||||
* The editlib file of doc module of ZenTaoPMS.
|
||||
*
|
||||
* @copyright Copyright 2009-2012 青岛易软天创网络科技有限公司 (QingDao Nature Easy Soft Network Technology Co,LTD www.cnezsoft.com)
|
||||
* @license LGPL (http://www.gnu.org/licenses/lgpl.html)
|
||||
* @author Jia Fu <fujia@cnezsoft.com>
|
||||
* @package doc
|
||||
* @version $Id: editlib.html.php 975 2010-07-29 03:30:25Z jajacn@126.com $
|
||||
* @link http://www.zentao.net
|
||||
*/
|
||||
?>
|
||||
<?php include '../../common/view/header.lite.html.php';?>
|
||||
<?php if($libID == 'product' or $libID == 'project'):?>
|
||||
<p class='a-center strong mt-10px'><?php echo $lang->doc->errorEditSystemDoc;?></p>
|
||||
<?php else:?>
|
||||
<form method='post'>
|
||||
<table class='table-1'>
|
||||
<caption><?php echo $lang->doc->editLib;?></caption>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->doc->libName;?></th>
|
||||
<td><?php echo html::input('name', $libName, "class='text-1'");?></td>
|
||||
</tr>
|
||||
<tr><td colspan='2' class='a-center'><?php echo html::submitButton();?></td></tr>
|
||||
</table>
|
||||
</form>
|
||||
<?php endif;?>
|
||||
<?php include '../../common/view/footer.lite.html.php';?>
|
||||
|
||||
@@ -1,75 +1,75 @@
|
||||
<?php
|
||||
/**
|
||||
* The view of doc module of ZenTaoPMS.
|
||||
*
|
||||
* @copyright Copyright 2009-2012 青岛易软天创网络科技有限公司 (QingDao Nature Easy Soft Network Technology Co,LTD www.cnezsoft.com)
|
||||
* @license LGPL (http://www.gnu.org/licenses/lgpl.html)
|
||||
* @author Jia Fu <fujia@cnezsoft.com>
|
||||
* @package doc
|
||||
* @version $Id: view.html.php 975 2010-07-29 03:30:25Z jajacn@126.com $
|
||||
* @link http://www.zentao.net
|
||||
*/
|
||||
?>
|
||||
<?php include '../../common/view/header.html.php';?>
|
||||
<script language='javascript'>
|
||||
var type = '<?php echo $doc->type;?>';
|
||||
$(document).ready(function()
|
||||
{
|
||||
setType(type);
|
||||
});
|
||||
</script>
|
||||
<table class='table-1'>
|
||||
<caption><?php echo $doc->title . $lang->colon . $lang->doc->view;?></caption>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->doc->title;?></th>
|
||||
<td <?php if($doc->deleted) echo "class='deleted'";?>><?php echo $doc->title;?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->doc->lib;?></th>
|
||||
<td><?php echo $lib;?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->doc->module;?></th>
|
||||
<td><?php echo $doc->moduleName;?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->doc->type;?></th>
|
||||
<td><?php echo $lang->doc->types[$doc->type];?></td>
|
||||
</tr>
|
||||
<th class='rowhead'><?php echo $lang->doc->title;?></th>
|
||||
<td><?php echo $doc->title;?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->doc->keywords;?></th>
|
||||
<td><?php echo $doc->keywords;?></td>
|
||||
</tr>
|
||||
<tr id='urlBox' class='hidden'>
|
||||
<th class='rowhead'><?php echo $lang->doc->url;?></th>
|
||||
<td><?php echo html::a(urldecode($doc->url), '', '_blank');?></td>
|
||||
</tr>
|
||||
<tr id='contentBox' class='hidden'>
|
||||
<th class='rowhead'><?php echo $lang->doc->content;?></th>
|
||||
<td class='content'><?php echo $doc->content;?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->doc->digest;?></th>
|
||||
<td><?php echo nl2br($doc->digest);?></td>
|
||||
</tr>
|
||||
<tr id='fileBox' class='hidden'>
|
||||
<th class='rowhead'><?php echo $lang->files;?></th>
|
||||
<td><?php echo $this->fetch('file', 'printFiles', array('files' => $doc->files, 'fieldset' => 'false'));?></td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class='a-center f-16px strong'>
|
||||
<?php
|
||||
$browseLink = $this->session->docList ? $this->session->docList : inlink('browse');
|
||||
if(!$doc->deleted)
|
||||
{
|
||||
common::printLink('doc', 'edit', "docID=$doc->id", $lang->edit);
|
||||
common::printLink('doc', 'delete', "docID=$doc->id", $lang->delete, 'hiddenwin');
|
||||
}
|
||||
echo html::a($browseLink, $lang->goback);
|
||||
?>
|
||||
</div>
|
||||
<?php include '../../common/view/action.html.php';?>
|
||||
<?php include './footer.html.php';?>
|
||||
<?php
|
||||
/**
|
||||
* The view of doc module of ZenTaoPMS.
|
||||
*
|
||||
* @copyright Copyright 2009-2012 青岛易软天创网络科技有限公司 (QingDao Nature Easy Soft Network Technology Co,LTD www.cnezsoft.com)
|
||||
* @license LGPL (http://www.gnu.org/licenses/lgpl.html)
|
||||
* @author Jia Fu <fujia@cnezsoft.com>
|
||||
* @package doc
|
||||
* @version $Id: view.html.php 975 2010-07-29 03:30:25Z jajacn@126.com $
|
||||
* @link http://www.zentao.net
|
||||
*/
|
||||
?>
|
||||
<?php include '../../common/view/header.html.php';?>
|
||||
<script language='javascript'>
|
||||
var type = '<?php echo $doc->type;?>';
|
||||
$(document).ready(function()
|
||||
{
|
||||
setType(type);
|
||||
});
|
||||
</script>
|
||||
<table class='table-1'>
|
||||
<caption><?php echo $doc->title . $lang->colon . $lang->doc->view;?></caption>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->doc->title;?></th>
|
||||
<td <?php if($doc->deleted) echo "class='deleted'";?>><?php echo $doc->title;?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->doc->lib;?></th>
|
||||
<td><?php echo $lib;?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->doc->module;?></th>
|
||||
<td><?php echo $doc->moduleName;?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->doc->type;?></th>
|
||||
<td><?php echo $lang->doc->types[$doc->type];?></td>
|
||||
</tr>
|
||||
<th class='rowhead'><?php echo $lang->doc->title;?></th>
|
||||
<td><?php echo $doc->title;?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->doc->keywords;?></th>
|
||||
<td><?php echo $doc->keywords;?></td>
|
||||
</tr>
|
||||
<tr id='urlBox' class='hidden'>
|
||||
<th class='rowhead'><?php echo $lang->doc->url;?></th>
|
||||
<td><?php echo html::a(urldecode($doc->url), '', '_blank');?></td>
|
||||
</tr>
|
||||
<tr id='contentBox' class='hidden'>
|
||||
<th class='rowhead'><?php echo $lang->doc->content;?></th>
|
||||
<td class='content'><?php echo $doc->content;?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->doc->digest;?></th>
|
||||
<td><?php echo nl2br($doc->digest);?></td>
|
||||
</tr>
|
||||
<tr id='fileBox' class='hidden'>
|
||||
<th class='rowhead'><?php echo $lang->files;?></th>
|
||||
<td><?php echo $this->fetch('file', 'printFiles', array('files' => $doc->files, 'fieldset' => 'false'));?></td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class='a-center f-16px strong'>
|
||||
<?php
|
||||
$browseLink = $this->session->docList ? $this->session->docList : inlink('browse');
|
||||
if(!$doc->deleted)
|
||||
{
|
||||
common::printLink('doc', 'edit', "docID=$doc->id", $lang->edit);
|
||||
common::printLink('doc', 'delete', "docID=$doc->id", $lang->delete, 'hiddenwin');
|
||||
}
|
||||
echo html::a($browseLink, $lang->goback);
|
||||
?>
|
||||
</div>
|
||||
<?php include '../../common/view/action.html.php';?>
|
||||
<?php include './footer.html.php';?>
|
||||
|
||||
Reference in New Issue
Block a user