Merge branch 'master' of github.com:easysoft/zentaopms

This commit is contained in:
xia0ta0
2014-06-18 16:34:17 +08:00
36 changed files with 7 additions and 1470 deletions
+1 -59
View File
@@ -630,25 +630,6 @@ CREATE TABLE IF NOT EXISTS `zt_userTPL` (
PRIMARY KEY (`id`),
KEY `account` (`account`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- DROP TABLE IF EXISTS `zt_webapp`;
CREATE TABLE IF NOT EXISTS `zt_webapp` (
`id` mediumint(9) NOT NULL auto_increment,
`appid` mediumint(9) NOT NULL,
`module` mediumint(9) NOT NULL,
`name` varchar(100) NOT NULL,
`author` varchar(30) NOT NULL,
`url` varchar(255) NOT NULL,
`icon` varchar(100) NOT NULL,
`target` varchar(50) NOT NULL,
`size` varchar(20) NOT NULL,
`abstract` varchar(255) NOT NULL,
`desc` text NOT NULL,
`addedBy` char(30) NOT NULL,
`addedDate` datetime NOT NULL,
`addType` varchar(20) NOT NULL default 'system',
`views` mediumint(9) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
INSERT INTO `zt_group` (`id`, `name`, `role`, `desc`) VALUES
(1, 'ADMIN', 'admin', 'for administrator'),
@@ -935,13 +916,6 @@ INSERT INTO `zt_groupPriv` (`group`, `module`, `method`) VALUES
(1, 'user', 'todo'),
(1, 'user', 'unlock'),
(1, 'user', 'view'),
(1, 'webapp', 'create'),
(1, 'webapp', 'edit'),
(1, 'webapp', 'index'),
(1, 'webapp', 'install'),
(1, 'webapp', 'obtain'),
(1, 'webapp', 'uninstall'),
(1, 'webapp', 'view'),
(2, 'api', 'getModel'),
(2, 'bug', 'activate'),
(2, 'bug', 'assignTo'),
@@ -1088,9 +1062,6 @@ INSERT INTO `zt_groupPriv` (`group`, `module`, `method`) VALUES
(2, 'user', 'testTask'),
(2, 'user', 'todo'),
(2, 'user', 'view'),
(2, 'webapp', 'index'),
(2, 'webapp', 'obtain'),
(2, 'webapp', 'view'),
(3, 'api', 'getModel'),
(3, 'bug', 'activate'),
(3, 'bug', 'assignTo'),
@@ -1257,9 +1228,6 @@ INSERT INTO `zt_groupPriv` (`group`, `module`, `method`) VALUES
(3, 'user', 'testTask'),
(3, 'user', 'todo'),
(3, 'user', 'view'),
(3, 'webapp', 'index'),
(3, 'webapp', 'obtain'),
(3, 'webapp', 'view'),
(4, 'action', 'hideAll'),
(4, 'action', 'hideOne'),
(4, 'action', 'trash'),
@@ -1444,9 +1412,6 @@ INSERT INTO `zt_groupPriv` (`group`, `module`, `method`) VALUES
(4, 'user', 'testTask'),
(4, 'user', 'todo'),
(4, 'user', 'view'),
(4, 'webapp', 'index'),
(4, 'webapp', 'obtain'),
(4, 'webapp', 'view'),
(5, 'action', 'hideAll'),
(5, 'action', 'hideOne'),
(5, 'action', 'trash'),
@@ -1622,9 +1587,6 @@ INSERT INTO `zt_groupPriv` (`group`, `module`, `method`) VALUES
(5, 'user', 'testTask'),
(5, 'user', 'todo'),
(5, 'user', 'view'),
(5, 'webapp', 'index'),
(5, 'webapp', 'obtain'),
(5, 'webapp', 'view'),
(6, 'action', 'hideAll'),
(6, 'action', 'hideOne'),
(6, 'action', 'trash'),
@@ -1802,9 +1764,6 @@ INSERT INTO `zt_groupPriv` (`group`, `module`, `method`) VALUES
(6, 'user', 'testTask'),
(6, 'user', 'todo'),
(6, 'user', 'view'),
(6, 'webapp', 'index'),
(6, 'webapp', 'obtain'),
(6, 'webapp', 'view'),
(7, 'action', 'hideAll'),
(7, 'action', 'hideOne'),
(7, 'action', 'trash'),
@@ -1982,9 +1941,6 @@ INSERT INTO `zt_groupPriv` (`group`, `module`, `method`) VALUES
(7, 'user', 'testTask'),
(7, 'user', 'todo'),
(7, 'user', 'view'),
(7, 'webapp', 'index'),
(7, 'webapp', 'obtain'),
(7, 'webapp', 'view'),
(8, 'action', 'hideAll'),
(8, 'action', 'hideOne'),
(8, 'action', 'trash'),
@@ -2165,7 +2121,6 @@ INSERT INTO `zt_groupPriv` (`group`, `module`, `method`) VALUES
(8, 'user', 'testTask'),
(8, 'user', 'todo'),
(8, 'user', 'view'),
(8, 'webapp', 'index'),
(9, 'action', 'hideAll'),
(9, 'action', 'hideOne'),
(9, 'action', 'trash'),
@@ -2293,13 +2248,6 @@ INSERT INTO `zt_groupPriv` (`group`, `module`, `method`) VALUES
(9, 'user', 'testTask'),
(9, 'user', 'todo'),
(9, 'user', 'view'),
(9, 'webapp', 'create'),
(9, 'webapp', 'edit'),
(9, 'webapp', 'index'),
(9, 'webapp', 'install'),
(9, 'webapp', 'obtain'),
(9, 'webapp', 'uninstall'),
(9, 'webapp', 'view'),
(10, 'api', 'getModel'),
(10, 'bug', 'activate'),
(10, 'bug', 'browse'),
@@ -2387,9 +2335,6 @@ INSERT INTO `zt_groupPriv` (`group`, `module`, `method`) VALUES
(10, 'user', 'testTask'),
(10, 'user', 'todo'),
(10, 'user', 'view'),
(10, 'webapp', 'index'),
(10, 'webapp', 'obtain'),
(10, 'webapp', 'view'),
(11, 'bug', 'browse'),
(11, 'bug', 'index'),
(11, 'bug', 'report'),
@@ -2462,7 +2407,4 @@ INSERT INTO `zt_groupPriv` (`group`, `module`, `method`) VALUES
(11, 'user', 'testCase'),
(11, 'user', 'testTask'),
(11, 'user', 'todo'),
(11, 'user', 'view'),
(11, 'webapp', 'index'),
(11, 'webapp', 'obtain'),
(11, 'webapp', 'view');
(11, 'user', 'view');
-8
View File
@@ -91,7 +91,6 @@ $lang->menu->project = 'Project|project|index';
$lang->menu->qa = 'Test|qa|index';
$lang->menu->doc = 'Doc|doc|index';
$lang->menu->report = 'Report|report|index';
$lang->menu->webapp = 'App|webapp|index';
$lang->menu->company = 'Company|company|index';
$lang->menu->admin = 'Admin|admin|index';
@@ -247,13 +246,6 @@ $lang->report->menu->prj = array('link' => 'Project|report|projectdeviation'
$lang->report->menu->test = array('link' => 'Test|report|bugsummary', 'alias' => 'bugassign');
$lang->report->menu->staff = array('link' => 'Company|report|workload');
/* Resource menu. */
$lang->webapp = new stdclass();
$lang->webapp->menu = new stdclass();
$lang->webapp->menu->obtain = array('link' => '<span class="icon-webapp-obtain">&nbsp;</span>Store|webapp|obtain', 'float' => 'right');
$lang->webapp->menu->manageTree = array('link' => "<span class='icon-webapp-manage'>&nbsp;</span>Catetory|tree|browse|rootID=0&view=webapp", 'float' => 'right');
$lang->webapp->menu->create = array('link' => "<span class='icon-webapp-create'>&nbsp;</span>Create|webapp|create", 'float' => 'right');
/* Company menu. */
$lang->company = new stdclass();
$lang->company->menu = new stdclass();
-1
View File
@@ -6,7 +6,6 @@ $lang->menuOrder[15] = 'project';
$lang->menuOrder[20] = 'qa';
$lang->menuOrder[25] = 'doc';
$lang->menuOrder[30] = 'report';
$lang->menuOrder[32] = 'webapp';
$lang->menuOrder[35] = 'company';
$lang->menuOrder[40] = 'admin';
-8
View File
@@ -91,7 +91,6 @@ $lang->menu->project = '项目|project|index';
$lang->menu->qa = '测试|qa|index';
$lang->menu->doc = '文档|doc|index';
$lang->menu->report = '统计|report|index';
$lang->menu->webapp = '应用|webapp|index';
$lang->menu->company = '组织|company|index';
$lang->menu->admin = '后台|admin|index';
@@ -247,13 +246,6 @@ $lang->report->menu->prj = array('link' => '项目|report|projectdeviation')
$lang->report->menu->test = array('link' => '测试|report|bugsummary', 'alias' => 'bugassign');
$lang->report->menu->staff = array('link' => '组织|report|workload');
/* 资源视图菜单设置。*/
$lang->webapp = new stdclass();
$lang->webapp->menu = new stdclass();
$lang->webapp->menu->obtain = array('link' => '<span class="icon-shopping-cart">&nbsp;</span>应用商店|webapp|obtain', 'float' => 'right');
$lang->webapp->menu->manageTree = array('link' => "<span class='icon-cogs'>&nbsp;</span>维护分类|tree|browse|rootID=0&view=webapp", 'float' => 'right');
$lang->webapp->menu->create = array('link' => "<span class='icon-plus'>&nbsp;</span>创建应用|webapp|create", 'float' => 'right');
/* 组织结构视图菜单设置。*/
$lang->company = new stdclass();
$lang->company->menu = new stdclass();
-25
View File
@@ -53,7 +53,6 @@ $lang->moduleOrder[155] = 'api';
$lang->moduleOrder[160] = 'file';
$lang->moduleOrder[165] = 'misc';
$lang->moduleOrder[170] = 'sso';
$lang->moduleOrder[175] = 'webapp';
$lang->resource = new stdclass();
@@ -740,23 +739,6 @@ $lang->convert->methodOrder[45] = 'execute';
$lang->convert->methodOrder[50] = 'convertBugFree';
$lang->convert->methodOrder[55] = 'convertRedmine';
$lang->resource->webapp = new stdclass();
$lang->resource->webapp->index = 'index';
$lang->resource->webapp->obtain = 'obtain';
$lang->resource->webapp->create = 'create';
$lang->resource->webapp->edit = 'edit';
$lang->resource->webapp->view = 'view';
$lang->resource->webapp->install = 'install';
$lang->resource->webapp->uninstall = 'uninstall';
$lang->webapp->methodOrder[5] = 'index';
$lang->webapp->methodOrder[10] = 'obtain';
$lang->webapp->methodOrder[15] = 'create';
$lang->webapp->methodOrder[20] = 'edit';
$lang->webapp->methodOrder[25] = 'view';
$lang->webapp->methodOrder[30] = 'install';
$lang->webapp->methodOrder[35] = 'uninstall';
/* Others. */
$lang->resource->api = new stdclass();
$lang->resource->api->getModel = 'getModel';
@@ -886,12 +868,6 @@ $lang->changelog['3.3'][] = 'report-bugAssign';
$lang->changelog['4.0.beta1'][] = 'user-batchCreate';
$lang->changelog['4.0.beta1'][] = 'user-unlock';
$lang->changelog['4.0.beta1'][] = 'admin-checkDB';
$lang->changelog['4.0.beta1'][] = 'webapp-index';
$lang->changelog['4.0.beta1'][] = 'webapp-obtain';
$lang->changelog['4.0.beta1'][] = 'webapp-create';
$lang->changelog['4.0.beta1'][] = 'webapp-edit';
$lang->changelog['4.0.beta1'][] = 'webapp-install';
$lang->changelog['4.0.beta1'][] = 'webapp-uninstall';
$lang->changelog['4.0.beta2'][] = 'todo-batchEdit';
$lang->changelog['4.0.beta2'][] = 'story-batchEdit';
@@ -912,7 +888,6 @@ $lang->changelog['4.0'][] = 'project-close';
$lang->changelog['4.0'][] = 'task-record';
$lang->changelog['4.0'][] = 'testtask-start';
$lang->changelog['4.0'][] = 'testtask-close';
$lang->changelog['4.0'][] = 'webapp-view';
$lang->changelog['4.0'][] = 'action-hideOne';
$lang->changelog['4.0'][] = 'action-hideAll';
$lang->changelog['4.0'][] = 'task-editEstimate';
+3 -12
View File
@@ -30,7 +30,7 @@
</tr>
<tr>
<th><?php echo $lang->task->module;?></th>
<td id='moduleIdBox' class='w-p25-f'><?php echo html::select('module', $moduleOptionMenu, $task->module, "class='form-control' onchange='setStories(this.value,$project->id)'");?></td><td class='w-p40'></td><td></td>
<td id='moduleIdBox' class='w-p25-f'><?php echo html::select('module', $moduleOptionMenu, $task->module, "class='form-control' onchange='setStories(this.value,$project->id)'");?></td><td></td><td class='w-150px'></td>
</tr>
<tr>
<th><?php echo $lang->task->assignedTo;?></th>
@@ -85,17 +85,8 @@
</tr>
<tr>
<th><?php echo $lang->task->mailto;?></th>
<td colspan='2'>
<?php
echo html::select('mailto[]', $project->acl == 'private' ? $members : $users, str_replace(' ', '', $task->mailto), "multiple class='form-control'");
if($contactLists) echo html::select('', $contactLists, '', "class='form-control' onchange=\"setMailto('mailto', this.value)\"");
?>
</td>
<td class='text-top'>
<?php
if($contactLists) echo html::select('', $contactLists, '', "class='form-control' onchange=\"setMailto('mailto', this.value)\"");
?>
</td>
<td colspan='2'><?php echo html::select('mailto[]', $project->acl == 'private' ? $members : $users, str_replace(' ', '', $task->mailto), "multiple class='form-control'");?></td>
<td class='text-top'><?php if($contactLists) echo html::select('', $contactLists, '', "class='form-control' onchange=\"setMailto('mailto', this.value)\"");?></td>
</tr>
<tr>
<th><?php echo $lang->files;?></th>
+2
View File
@@ -0,0 +1,2 @@
<?php
$config->tree->noBrowse = ',productdoc,projectdoc,';
-15
View File
@@ -31,7 +31,6 @@ class tree extends control
$this->view->root = $product;
$this->view->productModules = $this->tree->getOptionMenu($rootID, 'story');
}
/* The viewType is doc. */
elseif(strpos($viewType, 'doc') !== false)
{
@@ -104,20 +103,6 @@ class tree extends control
$position[] = html::a($this->createLink('doc', 'browse', "libID=$rootID"), $lib->name);
$position[] = $this->lang->tree->manageCustomDoc;
}
elseif(strpos($viewType, 'webapp') !== false)
{
$this->loadModel('webapp')->setMenu();
$this->lang->tree->menu = $this->lang->webapp->menu;
$this->lang->set('menugroup.tree', 'webapp');
$title = $this->lang->tree->manageWebapp;
$position[] = $this->lang->tree->manageWebapp;
$root = new stdclass();
$root->name = $this->lang->tree->manageWebapp;
$root->id = 0;
$this->view->root = $root;
}
$parentModules = $this->tree->getParents($currentModuleID);
$this->view->title = $title;
-2
View File
@@ -23,7 +23,6 @@ $lang->tree->manageProduct = 'Mange product module';
$lang->tree->manageProject = 'Manage project module';
$lang->tree->manageBug = 'Manage bug module';
$lang->tree->manageCase = 'Manage case module';
$lang->tree->manageWebapp = 'Manage web app category';
$lang->tree->manageCustomDoc = 'Manage doc library type';
$lang->tree->updateOrder = 'Update order';
$lang->tree->manageChild = 'Manage child';
@@ -31,7 +30,6 @@ $lang->tree->manageStoryChild = 'Manage child';
$lang->tree->manageBugChild = 'Manage bug child';
$lang->tree->manageCaseChild = 'Manage case child';
$lang->tree->manageTaskChild = 'Manage project child';
$lang->tree->manageWebappChild = 'Manage webapp child';
$lang->tree->syncFromProduct = 'Copy';
$lang->tree->ajaxGetOptionMenu = 'API: Get select menu';
$lang->tree->ajaxGetSonModules = 'API: Get son modules';
-2
View File
@@ -23,7 +23,6 @@ $lang->tree->manageProduct = '维护产品视图模块';
$lang->tree->manageProject = '维护项目视图模块';
$lang->tree->manageBug = '维护测试视图模块';
$lang->tree->manageCase = '维护用例视图模块';
$lang->tree->manageWebapp = '维护WEB应用分类';
$lang->tree->manageCustomDoc = '维护文档库分类';
$lang->tree->updateOrder = '更新排序';
$lang->tree->manageChild = '维护子模块';
@@ -31,7 +30,6 @@ $lang->tree->manageStoryChild = '维护子模块';
$lang->tree->manageBugChild = '维护Bug子模块';
$lang->tree->manageCaseChild = '维护用例子模块';
$lang->tree->manageTaskChild = '维护项目子模块';
$lang->tree->manageWebappChild = '维护WEB应用子模块';
$lang->tree->syncFromProduct = '复制';
$lang->tree->ajaxGetOptionMenu = '接口:获取下拉列表';
$lang->tree->ajaxGetSonModules = '接口:获得子菜单列表';
+1 -15
View File
@@ -586,7 +586,7 @@ class treeModel extends model
else
{
if(common::hasPriv('tree', 'edit')) $linkHtml .= ' ' . html::a(helper::createLink('tree', 'edit', "module={$module->id}&type=$type"), $this->lang->tree->edit, '', 'class="iframe" data-width="400"');
if(common::hasPriv('tree', 'browse') and strpos('productdoc,projectdoc', $module->type) === false and $module->type != 'webapp') $linkHtml .= ' ' . html::a(helper::createLink('tree', 'browse', "root={$module->root}&type=$type&module={$module->id}"), $this->lang->tree->child);
if(common::hasPriv('tree', 'browse') and strpos($this->config->tree->noBrowse, ",$module->type,") === false) $linkHtml .= ' ' . html::a(helper::createLink('tree', 'browse', "root={$module->root}&type=$type&module={$module->id}"), $this->lang->tree->child);
if(common::hasPriv('tree', 'delete')) $linkHtml .= ' ' . html::a(helper::createLink('tree', 'delete', "root={$module->root}&module={$module->id}"), $this->lang->delete, 'hiddenwin');
if(common::hasPriv('tree', 'updateorder')) $linkHtml .= ' ' . html::input("orders[$module->id]", $module->order, 'class="text-center w-30px form-control inline input-sm"');
}
@@ -661,20 +661,6 @@ class treeModel extends model
return $linkHtml;
}
/**
* Create Webapp Link
*
* @param int $module
* @param int $extra
* @access public
* @return void
*/
public function createWebappLink($type, $module, $extra)
{
$linkHtml = html::a(helper::createLink('webapp', 'index', "module={$module->id}"), $module->name, '_self', "id='module{$module->id}'");
return $linkHtml;
}
/**
* Get sons of a module.
*
-7
View File
@@ -1,7 +0,0 @@
<?php
$config->webapp = new stdClass();
$config->webapp->url = 'http://api.zentao.net';
$config->webapp->apiRoot = $config->webapp->url . '/webapp-';
$config->webapp->create = new stdClass();
$config->webapp->create->requiredFields = 'name,url,target';
-197
View File
@@ -1,197 +0,0 @@
<?php
/**
* The control file of webapp of ZenTaoPMS.
*
* @copyright Copyright 2009-2013 QingDao Nature Easy Soft Network Technology Co,LTD (www.cnezsoft.com)
* @license LGPL (http://www.gnu.org/licenses/lgpl.html)
* @author Yidong Wang <Yidong@cnezsoft.com>
* @package webapp
* @version $Id$
* @link http://www.zentao.net
*/
class webapp extends control
{
/**
* Index for webapp.
*
* @param int $module
* @access public
* @return void
*/
public function index($module = 0)
{
$module = (int)$module;
$webapps = $this->webapp->getLocalApps('id', $module);
$this->webapp->setMenu($module);
$this->view->title = $this->lang->webapp->common;
$this->view->webapps = $webapps;
$this->view->moduleTree = $this->loadModel('tree')->getTreeMenu(0, 'webapp', 0, array('treeModel', 'createWebappLink'));
$this->view->module = $module;
$this->display();
}
/**
* Obtain web app.
*
* @param string $type
* @param string $param
* @param int $recTotal
* @param int $recPerPage
* @param int $pageID
* @access public
* @return void
*/
public function obtain($type = 'byUpdatedTime', $param = '', $recTotal = 0, $recPerPage = 20, $pageID = 1)
{
$this->webapp->setMenu();
/* Init vars. */
$type = strtolower($type);
$moduleID = $type == 'bymodule' ? (int)$param : 0;
$webapps = array();
$pager = null;
/* Set the key. */
if($type == 'bysearch') $param = helper::safe64Encode($this->post->key);
/* Get results from the api. */
$recPerPage = $this->cookie->pagerWebappObtain ? $this->cookie->pagerWebappObtain : $recPerPage;
$results = $this->webapp->getAppsByAPI($type, $param, $recTotal, $recPerPage, $pageID);
if($results)
{
$this->app->loadClass('pager', $static = true);
$pager = new pager($results->dbPager->recTotal, $results->dbPager->recPerPage, $results->dbPager->pageID);
$webapps = $results->webapps;
}
$this->view->title = $this->lang->webapp->common . $this->lang->colon . $this->lang->webapp->obtain;
$this->view->position[] = $this->lang->webapp->obtain;
$this->view->moduleTree = $this->webapp->getModulesByAPI();
$this->view->webapps = $webapps;
$this->view->installeds = $this->webapp->getLocalApps('appid');
$this->view->pager = $pager;
$this->view->tab = 'obtain';
$this->view->type = $type;
$this->view->moduleID = $moduleID;
$this->display();
}
/**
* Edit web app.
*
* @param int $webappID
* @access public
* @return void
*/
public function edit($webappID)
{
if($_POST)
{
$this->webapp->update($webappID);
if(dao::isError())die(js::error(dao::getError()));
die(js::reload('parent.parent'));
}
$this->view->title = $this->lang->webapp->common . $this->lang->colon . $this->lang->webapp->edit;
$this->view->modules = $this->loadModel('tree')->getOptionMenu(0, 'webapp');
$this->view->webapp = $this->webapp->getLocalAppByID($webappID);
$this->display();
}
/**
* Create web app.
*
* @access public
* @return void
*/
public function create()
{
if($_POST)
{
$webappID = $this->webapp->create();
if(dao::isError())die(js::error(dao::getError()));
die(js::locate(inlink('index'), 'parent'));
}
$this->webapp->setMenu();
$this->view->title = $this->lang->webapp->common . $this->lang->colon . $this->lang->webapp->create;
$this->view->position[] = $this->lang->webapp->create;
$this->view->modules = $this->loadModel('tree')->getOptionMenu(0, 'webapp');
$this->display();
}
/**
* View app.
*
* @param int $webappID
* @param string $type
* @access public
* @return void
*/
public function view($webappID, $type = 'local')
{
$this->view->title = $this->lang->webapp->common . $this->lang->colon . $this->lang->webapp->edit;
$this->view->modules = $this->loadModel('tree')->getOptionMenu(0, 'webapp');
$this->view->users = $this->loadModel('user')->getPairs('noletter');
$this->view->webapp = $type == 'local' ? $this->webapp->getLocalAppByID($webappID) : $this->webapp->getAppInfoByAPI($webappID)->webapp;
$this->view->type = $type;
$this->display();
}
/**
* Install web app.
*
* @param int $webappID
* @access public
* @return void
*/
public function install($webappID)
{
if($_POST)
{
$result = $this->webapp->install($webappID);
if(dao::isError())
{
echo js::error(dao::getError());
die(js::reload('parent'));
}
echo js::alert($this->lang->webapp->successInstall);
die(js::closeModal('parent.parent'));
}
$this->view->title = $this->lang->webapp->common . $this->lang->colon . $this->lang->webapp->install;
$this->view->modules = $this->webapp->getModules();
$this->display();
}
/**
* uninstall web app.
*
* @param int $webappID
* @param string $confirm
* @access public
* @return void
*/
public function uninstall($webappID, $confirm = 'no')
{
if($confirm == 'no') die(js::confirm($this->lang->webapp->confirmDelete, inlink('uninstall', "webappID=$webappID&confirm=yes")));
$this->dao->delete()->from(TABLE_WEBAPP)->where('id')->eq($webappID)->exec();
die(js::reload('parent'));
}
/**
* Views add one by ajax.
*
* @param int $webappID
* @access public
* @return void
*/
public function ajaxAddView($webappID)
{
$this->dao->update(TABLE_WEBAPP)->set('views=views+1')->where('id')->eq($webappID)->exec();
}
}
-9
View File
@@ -1,9 +0,0 @@
.webapps .card {position: relative; padding-left: 85px;}
.webapps .card > .card-content {height: 20px; overflow: hidden; text-overflow:ellipsis; padding-bottom: 0;margin-bottom: 5px;}
.webapps.webstore .card > .card-content {height: 40px; overflow: hidden; text-overflow:ellipsis; padding-bottom: 0;margin-bottom: 5px;}
.webapps .card > .card-actions .btn {padding: 3px 12px; min-width: 70px}
.webapps .card > .media {position: absolute; left: 10px; top: 10px;}
.webapps .card > .card-heading strong {font-size: 14px}
.webapps .card > .card-heading > .pull-right {display: none}
.webapps .card:hover > .card-heading > .pull-right {display: block;}
.webapp-icon img {width: 72px; min-width: 72px}
-1
View File
@@ -1 +0,0 @@
form {margin-bottom: 70px;}
-1
View File
@@ -1 +0,0 @@
.outer.with-side .main {margin-left: 196px; margin-right: -15px;}
View File
View File
View File
View File
View File
View File
View File
-77
View File
@@ -1,77 +0,0 @@
function popup(width, height)
{
if(width != 0 && height != 0) $("a.popup").modalTrigger({width:width, height:height});
}
var show = new Array();
var url = new Array();
function toggleShowapp(webappID, webappName)
{
if(show[webappID] == undefined)
{
height = document.documentElement.clientHeight - 110;
if(url[webappID] == undefined) url[webappID] = $('#useapp' + webappID).attr('href');
$('#useapp' + webappID).attr('href', '#iframe' + webappID);
var html = "<tr id='iframe" + webappID + "'><td><p>" + webappName + "<span class='text-right'><button class='btn' onclick='toggleShowapp(" + webappID + ", \" " + webappName + "\")'>" + packup + "</button></span></p><iframe src='" + url[webappID] + "' height='" + height + "' width='100%' style='border:1px solid #999;'></iframe></td></tr>";
$('#webapps').parent().parent().after(html);
show[webappID] = true;
}
else if(show[webappID])
{
$('#iframe' + webappID).hide();
show[webappID] = false;
}
else
{
$('#iframe' + webappID).show();
show[webappID] = true;
}
}
function setSize(target)
{
$('.size').hide();
$('.customSize').hide();
if(target == 'popup')
{
$('.size').show();
customSize($('#size').val());
}
}
function addView(webappID)
{
$.get(createLink('webapp', 'ajaxAddView', 'webappID=' + webappID));
}
function customSize(value)
{
$('.customSize').hide();
if(value == 'custom') $('.customSize').removeClass('hidden').show();
}
$(function()
{
if($('a.iframe').length)
{
$("a.iframe").modalTrigger({width:450, type:'iframe', afterHide:function()
{
var selfClose = $.cookie('selfClose');
if(selfClose != 1) return;
$(this).replaceWith("<input type='button' value='" + installed + "' disabled='disabled' style='color:gray' class='btn'>");
$.cookie('selfClose', 0);
}});
}
$("a.webapp").modalTrigger({width:700, type:'iframe', icon: 'th-large'});
$("a.apiapp").modalTrigger({width:700, type:'iframe', icon: 'th-large'});
$('.runapp.popup').modalTrigger({type:'iframe', icon: 'th-large', waittime: 1000});
$('.runapp:not(.popup)').modalTrigger({size:'fullscreen', type:'iframe', cssClass:'app-inside', waittime: 1000});
setSize($('#target').val());
$('#target').change(function(){setSize($(this).val())});
$('#size').change(function(){customSize($(this).val())});
$('#modulemenu ul li').removeClass('active');
if(typeof(module) == "string") $('#modulemenu ul li #submenu' + module).parent().addClass('active');
})
-82
View File
@@ -1,82 +0,0 @@
<?php
/**
* The webapp module en file of ZenTaoPMS.
*
* @copyright Copyright 2009-2013 青岛易软天创网络科技有限公司 (QingDao Nature Easy Soft Network Technology Co,LTD www.cnezsoft.com)
* @license LGPL (http://www.gnu.org/licenses/lgpl.html)
* @author Yidong Wang <yidong@cnezsoft.com>
* @package webapp
* @version $Id$
* @link http://www.zentao.net
*/
$lang->webapp->common = 'App';
$lang->webapp->index = 'Added App';
$lang->webapp->obtain = 'Obtain App';
$lang->webapp->install = 'Install';
$lang->webapp->uninstall = 'Remove';
$lang->webapp->useapp = 'Run';
$lang->webapp->view = 'Info';
$lang->webapp->preview = 'Preview';
$lang->webapp->installed = 'Installed';
$lang->webapp->edit = 'Edit App';
$lang->webapp->create = 'Create App';
$lang->webapp->manageTree = 'Category';
$lang->webapp->id = 'ID';
$lang->webapp->name = 'Name';
$lang->webapp->url = 'URL';
$lang->webapp->icon = 'Icon';
$lang->webapp->module = 'Category';
$lang->webapp->author = 'Author';
$lang->webapp->abstract = 'Abstract';
$lang->webapp->desc = 'Desc';
$lang->webapp->target = 'How';
$lang->webapp->size = 'Size';
$lang->webapp->height = 'Height';
$lang->webapp->addedTime = 'Add Time';
$lang->webapp->updatedTime = 'Update Time';
$lang->webapp->downloads = 'Installs';
$lang->webapp->grade = 'Grade';
$lang->webapp->addType = 'Add Type';
$lang->webapp->addedBy = 'Added By';
$lang->webapp->addedDate = 'Added date';
$lang->webapp->views = 'Views';
$lang->webapp->packup = 'Fold';
$lang->webapp->custom = 'Custom';
$lang->webapp->byDownloads = 'Most Downloads';
$lang->webapp->byAddedTime = 'New Add';
$lang->webapp->byUpdatedTime = 'New Update';
$lang->webapp->bySearch = 'Search';
$lang->webapp->byCategory = 'Category';
$lang->webapp->selectModule = 'Select Category:';
$lang->webapp->allModule = 'All';
$lang->webapp->noModule = 'Uncategorized';
$lang->webapp->targetList[''] = '';
$lang->webapp->targetList['popup'] = 'Popup';
$lang->webapp->targetList['iframe'] = 'Iframe';
$lang->webapp->targetList['blank'] = 'New Window';
$lang->webapp->width = 'Width';
$lang->webapp->height = 'Height';
$lang->webapp->sizeList[''] = "";
$lang->webapp->sizeList['1024x600'] = "1024 x 600";
$lang->webapp->sizeList['900x600'] = "900 x 600";
$lang->webapp->sizeList['700x600'] = "700 x 600";
$lang->webapp->sizeList['600x500'] = "600 x 500";
$lang->webapp->sizeList['custom'] = "Custom size";
$lang->webapp->addTypeList['system'] = 'System App';
$lang->webapp->addTypeList['custom'] = 'Custom App';
$lang->webapp->errorOccurs = 'Error:';
$lang->webapp->errorGetModules = "Get extensions' categories data from the www.zentao.net failed. ";
$lang->webapp->errorGetExtensions = 'Get extensions from www.zentao.net failed. You can visit “<a href="' . inlink('create') . '">Create webapp</a>” to create it.';
$lang->webapp->successInstall = 'Success Install App.';
$lang->webapp->confirmDelete = 'Are you sure delete this app?';
$lang->webapp->noticeAbstract = 'Sentence describes the application, not more than 30 words';
$lang->webapp->noticeIcon = 'The size of icon is 72x72.';
-82
View File
@@ -1,82 +0,0 @@
<?php
/**
* The webapp module zh-cn file of ZenTaoPMS.
*
* @copyright Copyright 2009-2013 青岛易软天创网络科技有限公司 (QingDao Nature Easy Soft Network Technology Co,LTD www.cnezsoft.com)
* @license LGPL (http://www.gnu.org/licenses/lgpl.html)
* @author Yidong Wang <yidong@cnezsoft.com>
* @package webapp
* @version $Id$
* @link http://www.zentao.net
*/
$lang->webapp->common = 'WEB应用';
$lang->webapp->index = '已加应用';
$lang->webapp->obtain = '获得应用';
$lang->webapp->install = '安装';
$lang->webapp->uninstall = '删除';
$lang->webapp->useapp = '运行';
$lang->webapp->view = '详情';
$lang->webapp->preview = '预览';
$lang->webapp->installed = '已添加';
$lang->webapp->edit = '编辑应用';
$lang->webapp->create = '创建应用';
$lang->webapp->manageTree = '维护分类';
$lang->webapp->id = '编号';
$lang->webapp->name = '名称';
$lang->webapp->url = '网址';
$lang->webapp->icon = '图标';
$lang->webapp->module = '分类';
$lang->webapp->author = '作者';
$lang->webapp->abstract = '简介';
$lang->webapp->desc = '描述';
$lang->webapp->target = '打开方式';
$lang->webapp->size = '大小';
$lang->webapp->height = '高度';
$lang->webapp->addedTime = '添加时间';
$lang->webapp->updatedTime = '更新时间';
$lang->webapp->downloads = '安装量';
$lang->webapp->grade = '评分';
$lang->webapp->addType = '添加类型';
$lang->webapp->addedBy = '安装人';
$lang->webapp->addedDate = '安装日期';
$lang->webapp->views = '使用次数';
$lang->webapp->packup = '收起';
$lang->webapp->custom = '自定义';
$lang->webapp->byDownloads = '最多下载';
$lang->webapp->byAddedTime = '最新添加';
$lang->webapp->byUpdatedTime = '最近更新';
$lang->webapp->bySearch = '搜索';
$lang->webapp->byCategory = '分类浏览';
$lang->webapp->selectModule = '选择分类:';
$lang->webapp->allModule = '所有';
$lang->webapp->noModule = '所有';
$lang->webapp->targetList[''] = '';
$lang->webapp->targetList['popup'] = '弹窗';
$lang->webapp->targetList['iframe'] = '内嵌';
$lang->webapp->targetList['blank'] = '新窗口';
$lang->webapp->width = '宽度';
$lang->webapp->height = '高度';
$lang->webapp->sizeList[''] = "";
$lang->webapp->sizeList['1024x600'] = "1024 x 600";
$lang->webapp->sizeList['900x600'] = "900 x 600";
$lang->webapp->sizeList['700x600'] = "700 x 600";
$lang->webapp->sizeList['600x500'] = "600 x 500";
$lang->webapp->sizeList['custom'] = "自定义尺寸";
$lang->webapp->addTypeList['system'] = '系统应用';
$lang->webapp->addTypeList['custom'] = '自定义应用';
$lang->webapp->errorOccurs = '错误:';
$lang->webapp->errorGetModules = '从www.zentao.net获得插件分类失败。可能是因为网络方面的原因,请检查后重新刷新页面。';
$lang->webapp->errorGetExtensions = '从www.zentao.net获得插件失败。可能是因为网络方面的原因,你可以到 “<a href="' . inlink('create') . '">创建应用</a>” 中自行创建。';
$lang->webapp->successInstall = '成功安装应用!';
$lang->webapp->confirmDelete = '是否删除该应用?';
$lang->webapp->noticeAbstract = '用一句话介绍应用,不多于30个字';
$lang->webapp->noticeIcon = '图标大小建议为72x72';
-82
View File
@@ -1,82 +0,0 @@
<?php
/**
* The webapp module zh-tw file of ZenTaoPMS.
*
* @copyright Copyright 2009-2013 青島易軟天創網絡科技有限公司 (QingDao Nature Easy Soft Network Technology Co,LTD www.cnezsoft.com)
* @license LGPL (http://www.gnu.org/licenses/lgpl.html)
* @author Yidong Wang <yidong@cnezsoft.com>
* @package webapp
* @version $Id$
* @link http://www.zentao.net
*/
$lang->webapp->common = 'WEB應用';
$lang->webapp->index = '已加應用';
$lang->webapp->obtain = '獲得應用';
$lang->webapp->install = '安裝';
$lang->webapp->uninstall = '刪除';
$lang->webapp->useapp = '運行';
$lang->webapp->view = '詳情';
$lang->webapp->preview = '預覽';
$lang->webapp->installed = '已添加';
$lang->webapp->edit = '編輯應用';
$lang->webapp->create = '創建應用';
$lang->webapp->manageTree = '維護分類';
$lang->webapp->id = '編號';
$lang->webapp->name = '名稱';
$lang->webapp->url = '網址';
$lang->webapp->icon = '表徵圖';
$lang->webapp->module = '分類';
$lang->webapp->author = '作者';
$lang->webapp->abstract = '簡介';
$lang->webapp->desc = '描述';
$lang->webapp->target = '打開方式';
$lang->webapp->size = '大小';
$lang->webapp->height = '高度';
$lang->webapp->addedTime = '添加時間';
$lang->webapp->updatedTime = '更新時間';
$lang->webapp->downloads = '安裝量';
$lang->webapp->grade = '評分';
$lang->webapp->addType = '添加類型';
$lang->webapp->addedBy = '安裝人';
$lang->webapp->addedDate = '安裝日期';
$lang->webapp->views = '使用次數';
$lang->webapp->packup = '收起';
$lang->webapp->custom = '自定義';
$lang->webapp->byDownloads = '最多下載';
$lang->webapp->byAddedTime = '最新添加';
$lang->webapp->byUpdatedTime = '最近更新';
$lang->webapp->bySearch = '搜索';
$lang->webapp->byCategory = '分類瀏覽';
$lang->webapp->selectModule = '選擇分類:';
$lang->webapp->allModule = '所有';
$lang->webapp->noModule = '所有';
$lang->webapp->targetList[''] = '';
$lang->webapp->targetList['popup'] = '彈窗';
$lang->webapp->targetList['iframe'] = '內嵌';
$lang->webapp->targetList['blank'] = '新窗口';
$lang->webapp->width = '寬度';
$lang->webapp->height = '高度';
$lang->webapp->sizeList[''] = "";
$lang->webapp->sizeList['1024x600'] = "1024 x 600";
$lang->webapp->sizeList['900x600'] = "900 x 600";
$lang->webapp->sizeList['700x600'] = "700 x 600";
$lang->webapp->sizeList['600x500'] = "600 x 500";
$lang->webapp->sizeList['custom'] = "自定義尺寸";
$lang->webapp->addTypeList['system'] = '系統應用';
$lang->webapp->addTypeList['custom'] = '自定義應用';
$lang->webapp->errorOccurs = '錯誤:';
$lang->webapp->errorGetModules = '從www.zentao.net獲得插件分類失敗。可能是因為網絡方面的原因,請檢查後重新刷新頁面。';
$lang->webapp->errorGetExtensions = '從www.zentao.net獲得插件失敗。可能是因為網絡方面的原因,你可以到 “<a href="' . inlink('create') . '">創建應用</a>” 中自行創建。';
$lang->webapp->successInstall = '成功安裝應用!';
$lang->webapp->confirmDelete = '是否刪除該應用?';
$lang->webapp->noticeAbstract = '用一句話介紹應用,不多於30個字';
$lang->webapp->noticeIcon = '表徵圖大小建議為72x72';
-338
View File
@@ -1,338 +0,0 @@
<?php
/**
* The model file of webapp module of ZenTaoCMS.
*
* @copyright Copyright 2009-2013 青岛易软天创网络科技有限公司 (QingDao Nature Easy Soft Network Technology Co,LTD www.cnezsoft.com)
* @license LGPL (http://www.gnu.org/licenses/lgpl.html)
* @author Yidong Wang <Yidong@cnezsoft.com>
* @package webapp
* @version $Id$
* @link http://www.zentao.net
*/
class webappModel extends model
{
/**
* The api agent(use snoopy).
*
* @var object
* @access public
*/
public $agent;
/**
* The api root.
*
* @var string
* @access public
*/
public $apiRoot;
/**
* The construct function.
*
* @access public
* @return void
*/
public function __construct()
{
parent::__construct();
$this->setAgent();
$this->setApiRoot();
$this->loadModel('tree');
}
/**
* Set menu.
*
* @param array $projects
* @param int $projectID
* @param string $extra
* @access public
* @return void
*/
public function setMenu($module = null)
{
$modules = $this->getModules();
$moduleName = $this->app->getModuleName();
$methodName = $this->app->getMethodName();
foreach($modules as $moduleID => $module)
{
$module = trim($module, '/');
$this->lang->webapp->menu->$moduleID = array('link' => "$module|webapp|index|module=$moduleID");
}
}
/**
* Set the api agent.
*
* @access public
* @return void
*/
public function setAgent()
{
$this->agent = $this->app->loadClass('snoopy');
}
/**
* Set the apiRoot.
*
* @access public
* @return void
*/
public function setApiRoot()
{
$this->apiRoot = $this->config->webapp->apiRoot;
}
/**
* Fetch data from an api.
*
* @param string $url
* @access public
* @return mixed
*/
public function fetchAPI($url)
{
$url .= '?lang=' . str_replace('-', '_', $this->app->getClientLang());
$this->agent->fetch($url);
$result = json_decode($this->agent->results);
if(!isset($result->status)) return false;
if($result->status != 'success') return false;
if(isset($result->data) and md5($result->data) != $result->md5) return false;
if(isset($result->data)) return json_decode($result->data);
}
/**
* Get webapp modules from the api.
*
* @access public
* @return string|bool
*/
public function getModulesByAPI()
{
$requestType = $this->config->requestType;
$webRoot = helper::safe64Encode($this->config->webRoot);
$apiURL = $this->apiRoot . 'apiGetmodules-' . $requestType . '-' . $webRoot . '.json';
$data = $this->fetchAPI($apiURL);
if(isset($data->modules)) return $data->modules;
return false;
}
/**
* Get webapps by some condition.
*
* @param string $type
* @param mixed $param
* @access public
* @return array|bool
*/
public function getAppsByAPI($type, $param, $recTotal = 0, $recPerPage = 20, $pageID = 1)
{
$apiURL = $this->apiRoot . "apiGetApps-$type-$param-$recTotal-$recPerPage-$pageID.json";
$data = $this->fetchAPI($apiURL);
return $data;
}
/**
* Get a app info by API
*
* @param int $webappID
* @access public
* @return void
*/
public function getAppInfoByAPI($webappID)
{
$apiURL = $this->apiRoot . "apiGetAppInfo-$webappID.json";
$data = $this->fetchAPI($apiURL);
return $data;
}
/**
* Add downloads of webapp by api.
*
* @param int $webappID
* @access public
* @return void
*/
public function addDownloadByAPI($webappID)
{
$apiURL = $this->apiRoot . "downloadApp-$webappID.json";
$data = $this->fetchAPI($apiURL);
return $data;
}
/**
* Get webapps by status.
*
* @param string $status
* @access public
* @return array
*/
public function getLocalApps($key = 'id', $module = 0)
{
$webapps = $this->dao->select('*')->from(TABLE_WEBAPP)
->beginIF($module != 0)->where('module')->eq($module)->fi()
->fetchAll($key);
$localIcons = array();
foreach($webapps as $webapp)
{
if($webapp->addType == 'custom') $localIcons[$webapp->id] = $webapp->icon;
}
if($localIcons)
{
$files = $this->dao->select('*')->from(TABLE_FILE)->where('id')->in($localIcons)->fetchAll('id');
$fileWebPath = $this->loadModel('file')->webPath;
foreach($localIcons as $webappID => $icon)
{
if(isset($files[$icon])) $webapps[$webappID]->icon = $fileWebPath . $files[$icon]->pathname;
}
}
return $webapps;
}
/**
* Get webapp info from database.
*
* @param string $webapp
* @access public
* @return object
*/
public function getLocalAppByID($webappID)
{
$webapp = $this->dao->select('*')->from(TABLE_WEBAPP)->where('id')->eq($webappID)->fetch();
if($webapp and is_numeric($webapp->icon)) $webapp->icon = $this->loadModel('file')->getByID($webapp->icon);
return $webapp;
}
/**
* Install web app.
*
* @param int $webappID
* @access public
* @return void
*/
public function install($webappID)
{
$data = $this->getAppInfoByAPI($webappID);
$webapp = $data->webapp;
$installWebapp = new stdclass();
$installWebapp->appid = $webapp->id;
$installWebapp->module = $this->post->module;
$installWebapp->name = $webapp->name;
$installWebapp->author = $webapp->author;
$installWebapp->url = $webapp->url;
$installWebapp->icon = $webapp->icon ? $this->config->webapp->url . $webapp->icon : '';
$installWebapp->target = empty($webapp->target) ? 'blank' : $webapp->target;
$installWebapp->size = $webapp->size;
$installWebapp->abstract = $webapp->abstract;
$installWebapp->desc = $webapp->desc;
$installWebapp->addedBy = $this->app->user->account;
$installWebapp->addedDate = helper::now();
$this->dao->insert(TABLE_WEBAPP)->data($installWebapp)->autocheck()->exec();
if(!dao::isError())
{
$this->addDownloadByAPI($webappID);
return $this->dao->lastInsertID();
}
}
/**
* Update app.
*
* @param int $webappID
* @access public
* @return void
*/
public function update($webappID)
{
$webapp = $this->getLocalAppByID($webappID);
$data = fixer::input('post')->remove('files,customWidth,customHeight')->get();
if(isset($data->url))
{
$data->url = trim($data->url);
if(!preg_match('/^https?:\/\//', $data->url)) $data->url = 'http://' . $data->url;
}
if($data->size == 'custom') $data->size = (float)$this->post->customWidth . 'x' . (float)$this->post->customHeight;
$this->dao->update(TABLE_WEBAPP)->data($data)->where('id')->eq($webappID)->check('url', 'unique', "id != $webappID")->exec();
if(!dao::isError())
{
if($_FILES)
{
$this->loadModel('file');
if(empty($webapp->icon))
{
$icon = $this->file->saveUpload('webapp', $webappID);
$this->dao->update(TABLE_WEBAPP)->set('icon')->eq(key($icon))->where('id')->eq($webappID)->exec();
}
else
{
$this->file->replaceFile($webapp->icon->id, 'files');
}
}
}
}
/**
* Create a web app.
*
* @access public
* @return void
*/
public function create()
{
$data = fixer::input('post')
->add('addedBy', $this->app->user->account)
->add('addType', 'custom')
->add('addedDate', helper::now())
->add('author', $this->app->user->account)
->remove('files,customWidth,customHeight')->get();
$data->url = trim($data->url);
if(!preg_match('/^https?:\/\//', $data->url)) $data->url = 'http://' . $data->url;
if($data->size == 'custom') $data->size = (float)$this->post->customWidth . 'x' . (float)$this->post->customHeight;
$this->dao->insert(TABLE_WEBAPP)->data($data)
->autocheck()
->batchCheck($this->config->webapp->create->requiredFields, 'notempty')
->exec();
if(!dao::isError())
{
$webappID = $this->dao->lastInsertID();
if($_FILES)
{
$fileTitle = $this->loadModel('file')->saveUpload('webapp', $webappID);
$this->dao->update(TABLE_WEBAPP)->set('icon')->eq(key($fileTitle))->where('id')->eq($webappID)->exec();
}
return $webappID;
}
}
/**
* Get app modules.
*
* @access public
* @return void
*/
public function getModules()
{
$modules = $this->tree->getOptionMenu(0, 'webapp');
$modules[0] = (count($modules) == 1) ? $this->lang->webapp->noModule : $this->lang->webapp->allModule;
return $modules;
}
}
-70
View File
@@ -1,70 +0,0 @@
<?php
/**
* The edit view file of webapp module of ZenTaoPMS.
*
* @copyright Copyright 2009-2013 QingDao Nature Easy Soft Network Technology Co,LTD (www.cnezsoft.com)
* @license LGPL (http://www.gnu.org/licenses/lgpl.html)
* @author Yidong Wang <yidong@cnezsoft.com>
* @package webapp
* @version $Id$
* @link http://www.zentao.net
*/
?>
<?php include '../../common/view/header.html.php';?>
<div class='container mw-600px'>
<div id='titlebar'>
<div class='heading'>
<span class='prefix'><?php echo html::icon($lang->icons['app']);?></span>
<strong><small class='text-muted'><?php echo html::icon($lang->icons['create']);?></small> <?php echo $lang->webapp->create;?></strong>
</div>
</div>
<form class='form-condensed mw-500px' method='post' target='hiddenwin' enctype='multipart/form-data'>
<table class='table table-form'>
<tr>
<th class='w-100px'><?php echo $lang->webapp->module?></th>
<td><?php echo html::select('module', $modules, '', "class='form-control'")?></td>
</tr>
<tr>
<th><?php echo $lang->webapp->name?></th>
<td><?php echo html::input('name', '', "class='form-control'")?></td>
</tr>
<tr>
<th><?php echo $lang->webapp->url?></th>
<td><?php echo html::input('url', '', "class='form-control'")?></td>
</tr>
<tr>
<th><?php echo $lang->webapp->target?></th>
<td><?php echo html::select('target', $lang->webapp->targetList, '', "class='form-control'")?></td>
</tr>
<tr class="size hide">
<th><?php echo $lang->webapp->size?></th>
<td><?php echo html::select('size', $lang->webapp->sizeList, '', "class='form-control'")?></td>
</tr>
<tr class="customSize hide">
<th><?php echo $lang->webapp->custom?></th>
<td>
<div class='input-group'>
<?php echo html::input('customWidth', '', "class='w-40px form-control'");?>
<span class='input-group-addon'>X</span>
<?php echo html::input('customHeight', '', "class='w-40px form-control'");?>
<span class='input-group-addon'>px</span>
</div>
</td>
</tr>
<tr>
<th><?php echo $lang->webapp->abstract?></th>
<td><?php echo html::input('abstract', '', "class='form-control' maxlength='30'")?> <span class='help-block'><?php echo $lang->webapp->noticeAbstract?></span></td>
</tr>
<tr>
<th><?php echo $lang->webapp->desc?></th>
<td><?php echo html::textarea('desc', '', "class='form-control' rows='5'")?></td>
</tr>
<tr>
<th><?php echo $lang->webapp->icon?></th>
<td><?php echo html::file('files', "class='form-control' size='57'")?><span class='help-block'><?php echo $lang->webapp->noticeIcon?></span></td>
</tr>
<tr><td colspan='2' align='center'><?php echo html::submitButton()?></td></tr>
</table>
</form>
</div>
<?php include '../../common/view/footer.html.php';?>
-98
View File
@@ -1,98 +0,0 @@
<?php
/**
* The edit view file of webapp module of ZenTaoPMS.
*
* @copyright Copyright 2009-2013 QingDao Nature Easy Soft Network Technology Co,LTD (www.cnezsoft.com)
* @license LGPL (http://www.gnu.org/licenses/lgpl.html)
* @author Yidong Wang <yidong@cnezsoft.com>
* @package webapp
* @version $Id$
* @link http://www.zentao.net
*/
?>
<?php include '../../common/view/header.lite.html.php';?>
<div id='titlebar'>
<div class='heading'>
<span class='prefix' title='WEBAPP'><?php echo html::icon($lang->icons['app']);?> <strong><?php echo $webapp->id;?></strong></span>
<strong><?php echo $webapp->name;?></strong>
<small class='text-muted'> <i class='icon-pencil'></i> <?php echo $lang->webapp->edit?></small>
</div>
</div>
<div class='main'>
<form class='form-condensed' method='post' target='hiddenwin' enctype='multipart/form-data'>
<table class='table table-form'>
<tr>
<th class='w-80px'><?php echo $lang->webapp->module?></th>
<td class='w-p45'><?php echo html::select('module', $modules, $webapp->module, "class='form-control'")?></td><td></td>
</tr>
<?php if($webapp->addType != 'system'):?>
<tr>
<th><?php echo $lang->webapp->name?></th>
<td><?php echo html::input('name', $webapp->name, "class='form-control'")?></td>
</tr>
<tr>
<th><?php echo $lang->webapp->url?></th>
<td><?php echo html::input('url', $webapp->url, "class='form-control'")?></td>
</tr>
<?php endif;?>
<tr>
<th><?php echo $lang->webapp->target?></th>
<td><?php echo html::select('target', $lang->webapp->targetList, $webapp->target, "class='form-control'")?></td>
</tr>
<?php
$customWidth = '';
$customHeight = '';
if(!array_key_exists($webapp->size, $lang->webapp->sizeList))
{
$size = $webapp->size;
$webapp->size = 'custom';
if(strpos($size, 'x') !== false) list($customWidth, $customHeight) = explode('x', $size);
}
?>
<tr class="size">
<th><?php echo $lang->webapp->size?></th>
<td><?php echo html::select('size', $lang->webapp->sizeList, $webapp->size, "class='form-control'")?></td>
</tr>
<tr class="customSize <?php if($webapp->size != 'custom') echo 'hide'?>">
<th><?php echo $lang->webapp->custom?></th>
<td>
<div class='input-group'>
<span class='input-group-addon'><?php echo $lang->webapp->width;?></span>
<?php echo html::input('customWidth', $customWidth, "class='form-control'");?>
<span class='input-group-addon'>px</span>
</div>
</td>
<td>
<div class='input-group'>
<span class='input-group-addon'><?php echo $lang->webapp->height;?></span>
<?php echo html::input('customHeight', $customHeight, "class='form-control'");?>
<span class='input-group-addon'>px</span>
</div>
</td>
</tr>
<tr>
<th><?php echo $lang->webapp->abstract?></th>
<td colspan='2'><?php echo html::input('abstract', $webapp->abstract, "class='form-control' maxlength='30'")?><span class='help-block'><?php echo $lang->webapp->noticeAbstract?></span></td>
</tr>
<tr>
<th><?php echo $lang->webapp->desc?></th>
<td colspan='2'><?php echo html::textarea('desc', $webapp->desc, "class='form-control' rows='5'")?></td>
</tr>
<?php if($webapp->addType == 'custom'):?>
<tr>
<th><?php echo $lang->webapp->icon?></th>
<td>
<?php
if($webapp->icon) echo "<p><img src='{$webapp->icon->webPath}' width='72' height='72' /></p>";
echo html::file('files', "class='form-control' size='57'");
?>
</td>
<td><span class='help-block'><?php echo $lang->webapp->noticeIcon?></span></td>
</tr>
<?php endif;?>
<tr><th></th><td colspan='2'><?php echo html::submitButton()?></td></tr>
</table>
</form>
</div>
<?php include '../../common/view/footer.lite.html.php';?>
-56
View File
@@ -1,56 +0,0 @@
<?php
/**
* The browse view file of webapp module of ZenTaoPMS.
*
* @copyright Copyright 2009-2013 青岛易软天创网络科技有限公司 (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 webapp
* @version $Id$
* @link http://www.zentao.net
*/
?>
<?php include '../../common/view/header.html.php';?>
<?php include '../../common/view/treeview.html.php';?>
<div class='container bd-0'>
<div class='cards webapps' id='webapps'>
<?php foreach($webapps as $webapp):?>
<div class='col-md-4 col-sm-6'><div class='card' id='webapp<?php echo $webapp->id?>'>
<div class='media webapp-icon'><img src='<?php echo empty($webapp->icon) ? $config->webRoot . 'theme/default/images/main/webapp-default.png' : $webapp->icon?>' width='72' height='72' /></div>
<div class='card-heading' class='webapp-name' title='<?php echo $webapp->name?>'>
<div class='pull-right'>
<?php common::printLink('webapp', 'uninstall', "webapp=$webapp->id", "<i class='icon-remove'></i> " . $lang->webapp->uninstall, 'hiddenwin', "class='text-muted'"); ?>
</div>
<strong><?php common::printLink('webapp', 'view', "webappID=$webapp->id", $webapp->name, '', "class='webapp'");?></strong> <small class='text-muted'><?php echo $webapp->author;?></small>
</div>
<div class='card-content text-muted' title='<?php echo $webapp->abstract?>'><?php echo $webapp->abstract;?></div>
<div class='card-actions webapp-actions'>
<div class='pull-right'>
<?php
$url = $webapp->addType == 'custom' ? $webapp->url : $config->webapp->url . "/webapp-showapp-{$webapp->appid}.html";
$popup = '';
$target = '_self';
$misc = '';
if($webapp->target == 'blank') $target = '_blank';
if($webapp->target == 'popup')
{
$width = 0;
$height = 0;
if($webapp->size) list($width, $height) = explode('x', $webapp->size);
$misc = "data-width='" . $width . "' data-height='" . $height . "'";
$popup = 'popup';
}
echo html::a($url, $lang->webapp->useapp, $target, "id='useapp$webapp->id' class='btn btn-success runapp $popup' onclick='addView($webapp->id);' data-title='$webapp->name' $misc");
?>
</div>
</div>
</div></div>
<?php endforeach;?>
</div>
</div>
<script type='text/javascript'>
var packup = '<?php echo $lang->webapp->packup?>';
var useapp = '<?php echo $lang->webapp->useapp?>';
var module = '<?php echo $module?>';
</script>
<?php include '../../common/view/footer.html.php';?>
-35
View File
@@ -1,35 +0,0 @@
<?php
/**
* The install view file of webapp module of ZenTaoPMS.
*
* @copyright Copyright 2009-2013 QingDao Nature Easy Soft Network Technology Co,LTD (www.cnezsoft.com)
* @license LGPL (http://www.gnu.org/licenses/lgpl.html)
* @author Yidong Wang <Yidong@cnezsoft.com>
* @package webapp
* @version $Id$
* @link http://www.zentao.net
*/
?>
<?php include '../../common/view/header.lite.html.php';?>
<div id='titlebar'>
<div class='heading'>
<span class='prefix' title='WEBAPP'><?php echo html::icon($lang->icons['app']);?></span>
<strong><small class='text-muted'> <i class='icon-cog'></i></small> <?php echo $lang->webapp->install;?></strong>
</div>
</div>
<form class='form-condensed' method='post' target='hiddenwin' style='padding: 40px 5%'>
<table class='table table-form'>
<tr>
<td>
<div class='input-group'>
<span class='input-group-addon'><?php echo $lang->webapp->selectModule?></span>
<?php echo html::select('module', $modules, '', "class='form-control'");?>
</div>
</td>
<td><?php echo html::submitButton();?></td>
<td class='w-80px'><?php common::printLink('tree', 'browse', "rootID=0&view=webapp", $lang->tree->manage, '_parent');?></td>
</tr>
</table>
</form>
<?php include '../../common/view/footer.lite.html.php';?>
-91
View File
@@ -1,91 +0,0 @@
<?php
/**
* The obtain view file of webapp module of ZenTaoPMS.
*
* @copyright Copyright 2009-2013 青岛易软天创网络科技有限公司 (QingDao Nature Easy Soft Network Technology Co,LTD www.cnezsoft.com)
* @license LGPL (http://www.gnu.org/licenses/lgpl.html)
* @author Yidong Wang <Yidong@cnezsoft.com>
* @package webapp
* @version $Id$
* @link http://www.zentao.net
*/
?>
<?php include '../../common/view/header.html.php';?>
<?php include '../../common/view/treeview.html.php';?>
<div class='side'>
<form class='side-search mgb-20' method='post' action='<?php echo inlink('obtain', 'type=bySearch');?>'>
<div class="input-group">
<?php echo html::input('key', $this->post->key, "class='form-control' placeholder='{$lang->webapp->bySearch}'");?>
<span class="input-group-btn">
<?php echo html::submitButton('<i class="icon-search"></i>', '', ''); ?>
</span>
</div>
</form>
<div class='list-group'>
<?php
echo html::a(inlink('obtain', 'type=byUpdatedTime'), $lang->webapp->byUpdatedTime, '', "class='list-group-item' id='byupdatedtime'");
echo html::a(inlink('obtain', 'type=byAddedTime'), $lang->webapp->byAddedTime, '', "class='list-group-item' id='byaddedtime'");
echo html::a(inlink('obtain', 'type=byDownloads'), $lang->webapp->byDownloads, '', "class='list-group-item' id='bydownloads'");
?>
</div>
<div class='panel panel-sm'>
<div class='panel-heading'><?php echo $lang->webapp->byCategory;?></div>
<div class='panel-body'>
<?php $moduleTree ? print($moduleTree) : print($lang->webapp->errorGetModules);?>
</div>
</div>
</div>
<div class='main'>
<?php if($webapps):?>
<div id='webapps' class='cards webstore webapps pd-0 mg-0'>
<?php foreach($webapps as $webapp):?>
<div class='col-md-6 col-sm-6'><div class='card' id='webapp<?php echo $webapp->id?>'>
<div class='media webapp-icon'><img src='<?php echo empty($webapp->icon) ? '/theme/default/images/main/webapp-default.png' : $config->webapp->url . $webapp->icon?>' width='72' height='72' /></div>
<div class='card-heading' class='webapp-name' title='<?php echo $webapp->name?>'>
<strong><?php common::printLink('webapp', 'view', "webappID=$webapp->id&type=api", $webapp->name, '', "class='apiapp'");?></strong> <small class='text-muted'><?php echo $webapp->author;?></small>
</div>
<div class='card-content text-muted' title='<?php echo $webapp->abstract?>'><?php echo $webapp->abstract;?></div>
<div class='card-actions webapp-actions'>
<div class='pull-right'>
<div class='btn-group'>
<?php
$url = $webapp->url;
$popup = '';
$target = '_self';
$misc = '';
if($webapp->target == 'popup')
{
$width = 0;
$height = 0;
if($webapp->size) list($width, $height) = explode('x', $webapp->size);
$misc = "data-width='" . $width . "' data-height='" . $height . "'";
$popup = 'popup';
}
else
{
$method = "popup(1024, 600);";
$misc = "data-width='1024' data-height='600'";
$popup = 'popup';
}
echo isset($installeds[$webapp->id]) ? html::commonButton("<i class='icon-ok'></i> " . $lang->webapp->installed, "disabled='disabled'", 'btn-success') : html::a(inLink('install', "webappID={$webapp->id}"), $lang->webapp->install, '_self', "class='btn btn-primary iframe'");
echo html::a($url, $lang->webapp->preview, '', "id='useapp$webapp->id' class='btn runapp $popup' data-title='$webapp->name' $misc");
?>
</div>
</div>
</div>
</div></div>
<?php endforeach;?>
</div>
<div class='clearfix'><?php if($pager) $pager->show();?></div>
<?php else:?>
<div class='box-title'><?php echo $lang->webapp->errorOccurs;?></div>
<div class='box-content'><?php echo $lang->webapp->errorGetExtensions;?></div>
<?php endif;?>
</div>
<?php js::set('installed', $lang->webapp->installed)?>
<script>
$('#<?php echo $type;?>').addClass('active')
$('#module<?php echo $moduleID;?>').addClass('active')
</script>
<?php include '../../common/view/footer.html.php';?>
-97
View File
@@ -1,97 +0,0 @@
<?php
/**
* The view view file of webapp module of ZenTaoPMS.
*
* @copyright Copyright 2009-2013 QingDao Nature Easy Soft Network Technology Co,LTD (www.cnezsoft.com)
* @license LGPL (http://www.gnu.org/licenses/lgpl.html)
* @author Yidong Wang <yidong@cnezsoft.com>
* @package webapp
* @version $Id$
* @link http://www.zentao.net
*/
?>
<?php include '../../common/view/header.lite.html.php';?>
<div id='titlebar'>
<div class='heading'>
<span class='prefix' title='WEBAPP'><?php echo html::icon($lang->icons['app']);?> <strong><?php echo $webapp->id;?></strong></span>
<strong><?php echo $webapp->name;?></strong>
<small class='text-muted'> <i class='icon-file-text'></i> <?php echo $lang->webapp->view?></small>
</div>
<div class='actions'>
<?php if($type =='local') common::printLink('webapp', 'edit', "webappID=$webapp->id", "<i class='icon-pencil'></i> " . $lang->edit, '', "class='btn btn-primary'");?>
</div>
</div>
<div class='main'>
<table class='table table-data table-condensed table-borderless'>
<?php if($type == 'local'):?>
<tr>
<th><?php echo $lang->webapp->module?></th>
<td><?php echo $modules[$webapp->module]?></td>
</tr>
<?php endif;?>
<tr>
<th class='w-100px'><?php echo $lang->webapp->name?></th>
<td><?php echo $webapp->name?></td>
</tr>
<tr>
<th><?php echo $lang->webapp->url?></th>
<td><?php echo $webapp->url?></td>
</tr>
<tr>
<th><?php echo $lang->webapp->author?></th>
<td><?php echo $webapp->author?></td>
</tr>
<tr>
<th><?php echo $lang->webapp->target?></th>
<td><?php echo $lang->webapp->targetList[$webapp->target]?></td>
</tr>
<?php if($webapp->target == 'popup'):?>
<?php
if(!array_key_exists($webapp->size, $lang->webapp->sizeList))
{
$size = $webapp->size;
$webapp->size = 'custom';
}
?>
<tr>
<th><?php echo $lang->webapp->size?></th>
<td>
<?php
echo $lang->webapp->sizeList[$webapp->size];
if(isset($size)) echo ' ' . $size;
?>
</td>
</tr>
<?php endif;?>
<tr>
<th><?php echo $lang->webapp->abstract?></th>
<td><?php echo $webapp->abstract?></td>
</tr>
<tr>
<th><?php echo $lang->webapp->desc?></th>
<td><?php echo $webapp->desc?></td>
</tr>
<?php if($type == 'local'):?>
<tr>
<th><?php echo $lang->webapp->addType?></th>
<td><?php echo $lang->webapp->addTypeList[$webapp->addType]?></td>
</tr>
<tr>
<th><?php echo $lang->webapp->addedBy?></th>
<td><?php echo $users[$webapp->addedBy]?></td>
</tr>
<tr>
<th><?php echo $lang->webapp->addedDate?></th>
<td><?php echo $webapp->addedDate?></td>
</tr>
<?php endif;?>
<?php if($type == 'api'):?>
<tr>
<th><?php echo $lang->webapp->downloads?></th>
<td><?php echo $webapp->downloads?></td>
</tr>
<?php endif;?>
</table>
</div>
<?php include '../../common/view/footer.lite.html.php';?>