Merge branch 'master' of github.com:easysoft/zentaopms
This commit is contained in:
@@ -3,10 +3,4 @@ $(document).ready(function()
|
||||
$('#' + browseType + 'Tab').addClass('active');
|
||||
$('#module' + moduleID).addClass('active');
|
||||
if(browseType == 'bysearch') ajaxGetSearchForm();
|
||||
|
||||
/* If customed and the browse is ie6, remove the ie6.css. */
|
||||
if(customed && $.browser.msie && Math.floor(parseInt($.browser.version)) == 6)
|
||||
{
|
||||
$("#browsecss").attr('href', '');
|
||||
}
|
||||
});
|
||||
|
||||
@@ -569,7 +569,7 @@ class commonModel extends model
|
||||
$notifyFile = $app->getBasePath() . 'www/data/notify/notify.zip';
|
||||
|
||||
if(!file_exists($notifyFile)) return false;
|
||||
echo html::a(helper::createLink('misc', 'downNotify'), "<i class='icon-bell'></i> " . $lang->downNotify) . ' ';
|
||||
echo html::a(helper::createLink('misc', 'downNotify'), "<i class='icon-bell'></i>", '', "title='$lang->downNotify'") . ' ';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+26
-17
@@ -94,30 +94,39 @@ class misc extends control
|
||||
{
|
||||
$notifyDir = $this->app->getBasePath() . 'www/data/notify/';
|
||||
$packageFile = $notifyDir . 'notify.zip';
|
||||
$tmpDir = $notifyDir . 'notify';
|
||||
$loginFile = $tmpDir . '/tmp/.logininfo';
|
||||
|
||||
$this->app->loadClass('pclzip', true);
|
||||
$sourceZip = new pclzip($packageFile);
|
||||
$files = $sourceZip->extract(PCLZIP_OPT_PATH, $notifyDir);
|
||||
if($files == 0) die("Error : ".$sourceZip->errorInfo(true));
|
||||
$loginFile = $notifyDir . 'config.json';
|
||||
|
||||
/* write login info into tmp file. */
|
||||
$loginInfo = new stdclass();
|
||||
$loginInfo->account = $this->app->user->account;
|
||||
$loginInfo->password = $this->app->user->password;
|
||||
$loginInfo->zentaourl = common::getSysURL() . $this->config->webRoot;
|
||||
$userInfo = new stdclass();
|
||||
$userInfo->Account = $this->app->user->account;
|
||||
$userInfo->Url = common::getSysURL() . $this->config->webRoot;
|
||||
$userInfo->PassMd5 = $this->app->user->password;
|
||||
$userInfo->Role = $this->app->user->role;
|
||||
$userInfo->AutoSignIn = true;
|
||||
$userInfo->Lang = $this->cookie->lang;
|
||||
$loginInfo->User = $userInfo;
|
||||
$loginInfo->LastLoginTime = time() / 86400 + 25569;
|
||||
$loginInfo = json_encode($loginInfo);
|
||||
|
||||
file_put_contents($loginFile, $loginInfo);
|
||||
|
||||
unlink($packageFile);
|
||||
$newZip = new pclzip($packageFile);
|
||||
if($newZip->create($tmpDir, PCLZIP_OPT_REMOVE_PATH, $notifyDir))
|
||||
{
|
||||
$this->zfile = $this->app->loadClass('zfile');
|
||||
$this->zfile->removeDir($tmpDir);
|
||||
}
|
||||
define('PCLZIP_TEMPORARY_DIR', $notifyDir);
|
||||
$this->app->loadClass('pclzip', true);
|
||||
|
||||
/* remove the old config.json, add a new one. */
|
||||
$archive = new pclzip($packageFile);
|
||||
$result = $archive->delete(PCLZIP_OPT_BY_NAME, 'config.json');
|
||||
if($result == 0) die("Error : " . $archive->errorInfo(true));
|
||||
|
||||
$result = $archive->add($loginFile, PCLZIP_OPT_REMOVE_ALL_PATH);
|
||||
if($result == 0) die("Error : " . $archive->errorInfo(true));
|
||||
|
||||
unlink($loginFile);
|
||||
|
||||
$this->fetch('file', 'sendDownHeader', array('fileName' => 'notify.zip', 'zip', file_get_contents($packageFile)));
|
||||
$result = $archive->delete(PCLZIP_OPT_BY_NAME, 'config.json');
|
||||
if($result == 0) die("Error : " . $archive->errorInfo(true));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+42
-2
@@ -320,7 +320,7 @@ class treeModel extends model
|
||||
foreach($products as $id => $product)
|
||||
{
|
||||
$extra['productID'] = $id;
|
||||
if($userFunc[1] == 'createTaskManageLink')
|
||||
if($manage)
|
||||
{
|
||||
$menu .= "<li>" . $product;
|
||||
}
|
||||
@@ -332,7 +332,7 @@ class treeModel extends model
|
||||
/* tree menu. */
|
||||
$treeMenu = array();
|
||||
$query = $this->dao->select('*')->from(TABLE_MODULE)
|
||||
->where("((root = $rootID and type = 'task') OR (root = $id and type = 'story'))")
|
||||
->where("((root = $rootID and type = 'task' and parent != 0) OR (root = $id and type = 'story'))")
|
||||
->beginIF($startModulePath)->andWhere('path')->like($startModulePath)->fi()
|
||||
->orderBy('grade desc, type, `order`')
|
||||
->get();
|
||||
@@ -368,6 +368,46 @@ class treeModel extends model
|
||||
$lastMenu = "<ul class='tree'>" . $tree . "</ul>\n";
|
||||
$menu .= $lastMenu . '</li>';
|
||||
}
|
||||
|
||||
if($startModule == 0)
|
||||
{
|
||||
/* tree menu. */
|
||||
$treeMenu = array();
|
||||
$query = $this->dao->select('*')->from(TABLE_MODULE)
|
||||
->where("root = $rootID and type = 'task'")
|
||||
->orderBy('grade desc, type, `order`')
|
||||
->get();
|
||||
$stmt = $this->dbh->query($query);
|
||||
while($module = $stmt->fetch())
|
||||
{
|
||||
/* if not manage, ignore unused modules. */
|
||||
if(!$manage and !isset($projectModules[$module->id])) continue;
|
||||
|
||||
$linkHtml = call_user_func($userFunc, 'task', $module, $extra);
|
||||
|
||||
if(isset($treeMenu[$module->id]) and !empty($treeMenu[$module->id]))
|
||||
{
|
||||
if(!isset($treeMenu[$module->parent])) $treeMenu[$module->parent] = '';
|
||||
$treeMenu[$module->parent] .= "<li class='closed'>$linkHtml";
|
||||
$treeMenu[$module->parent] .= "<ul>" . $treeMenu[$module->id] . "</ul>\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
if(isset($treeMenu[$module->parent]) and !empty($treeMenu[$module->parent]))
|
||||
{
|
||||
$treeMenu[$module->parent] .= "<li>$linkHtml\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
$treeMenu[$module->parent] = "<li>$linkHtml\n";
|
||||
}
|
||||
}
|
||||
$treeMenu[$module->parent] .= "</li>\n";
|
||||
}
|
||||
|
||||
$tree = isset($treeMenu[0]) ? $treeMenu[0] : '';
|
||||
$menu .= $tree . '</li>';
|
||||
}
|
||||
return $menu;
|
||||
}
|
||||
|
||||
|
||||
@@ -65,31 +65,23 @@
|
||||
echo '<span>' . html::input("products[id$id]", $product, 'class=form-control disabled="true"') . '</span>';
|
||||
}
|
||||
}
|
||||
else
|
||||
foreach($sons as $sonModule)
|
||||
{
|
||||
echo '<div id="sonModule">';
|
||||
foreach($sons as $sonModule)
|
||||
{
|
||||
if($sonModule->order > $maxOrder) $maxOrder = $sonModule->order;
|
||||
$disabled = $sonModule->type == 'task' ? '' : 'disabled="true"';
|
||||
echo '<span>' . html::input("modules[id$sonModule->id]", $sonModule->name, 'class=form-control ' . $disabled) . '</span>';
|
||||
}
|
||||
for($i = 0; $i < TREE::NEW_CHILD_COUNT ; $i ++) echo '<span>' . html::input("modules[]", '', 'class=form-control') . '</span>';
|
||||
if($sonModule->order > $maxOrder) $maxOrder = $sonModule->order;
|
||||
$disabled = $sonModule->type == 'task' ? '' : 'disabled="true"';
|
||||
echo '<span>' . html::input("modules[id$sonModule->id]", $sonModule->name, 'class=form-control ' . $disabled) . '</span>';
|
||||
}
|
||||
for($i = 0; $i < TREE::NEW_CHILD_COUNT ; $i ++) echo '<span>' . html::input("modules[]", '', 'class=form-control') . '</span>';
|
||||
?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td colspan='2'>
|
||||
<?php
|
||||
if(!$newModule or $productID)
|
||||
{
|
||||
echo html::submitButton() . html::backButton();
|
||||
echo html::hidden('parentModuleID', $currentModuleID);
|
||||
echo html::hidden('maxOrder', $maxOrder);
|
||||
}
|
||||
echo html::submitButton() . html::backButton();
|
||||
echo html::hidden('parentModuleID', $currentModuleID);
|
||||
echo html::hidden('maxOrder', $maxOrder);
|
||||
?>
|
||||
<input type='hidden' value='<?php echo $currentModuleID;?>' name='parentModuleID' />
|
||||
</td>
|
||||
|
||||
Reference in New Issue
Block a user