Merge branch 'master' of github.com:easysoft/zentaopms
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
* @copyright Copyright 2009-2015 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com)
|
||||
* @license ZPL (http://zpl.pub/page/zplv12.html)
|
||||
* @author Yidong Wang <yidong@cnezsoft.com>
|
||||
* @package block
|
||||
* @package block
|
||||
* @version $Id$
|
||||
* @link http://www.zentao.net
|
||||
*/
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* @copyright Copyright 2009-2015 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com)
|
||||
* @license ZPL (http://zpl.pub/page/zplv12.html)
|
||||
* @author Yidong Wang <yidong@cnezsoft.com>
|
||||
* @package block
|
||||
* @package block
|
||||
* @version $Id$
|
||||
* @link http://www.zentao.net
|
||||
*/
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* @copyright Copyright 2009-2018 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com)
|
||||
* @license ZPL (http://zpl.pub/page/zplv12.html)
|
||||
* @author Tingting Dai <daitingting@xirangit.com>
|
||||
* @package block
|
||||
* @package block
|
||||
* @version $Id$
|
||||
* @link http://www.zentao.net
|
||||
*/
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* @copyright Copyright 2009-2015 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com)
|
||||
* @license ZPL (http://zpl.pub/page/zplv12.html)
|
||||
* @author Yidong Wang <yidong@cnezsoft.com>
|
||||
* @package block
|
||||
* @package block
|
||||
* @version $Id: html.php 7488 2013-12-26 07:26:10Z zhujinyong $
|
||||
* @link http://www.zentao.net
|
||||
*/
|
||||
|
||||
@@ -73,7 +73,7 @@ if(!$selfCall) die(include('./todolist.html.php'));
|
||||
<div class="col-sm-2"></div>
|
||||
<div class="col-sm-10">
|
||||
<div class="checkbox-primary">
|
||||
<input type="checkbox" name="private" id="private" value="1">
|
||||
<input type="checkbox" name="private" id="private" value="1">
|
||||
<label for="private"><?php echo $lang->todo->private?></label>
|
||||
</div>
|
||||
</div>
|
||||
@@ -124,7 +124,7 @@ if(!$selfCall) die(include('./todolist.html.php'));
|
||||
$block.data('blockTodoes', 1);
|
||||
var $form = $block.find('form');
|
||||
var $titleInput = $form.find('[name="name"]');
|
||||
|
||||
|
||||
var toggleForm = function(toggle)
|
||||
{
|
||||
if(toggle === undefined)
|
||||
@@ -172,7 +172,7 @@ if(!$selfCall) die(include('./todolist.html.php'));
|
||||
var $todoes = $(obj).closest('.block-todoes');
|
||||
var $form = $(obj).closest('form');
|
||||
var $name = $form.find("input[name='name']").val();
|
||||
if($name == '')
|
||||
if($name == '')
|
||||
{
|
||||
$("input[name='name']").addClass('has-error');
|
||||
$('#nameLabel').remove();
|
||||
|
||||
@@ -372,7 +372,7 @@ $lang->admin->menu->safe = array('link' => 'Security|admin|safe', 'alias' =
|
||||
$lang->admin->menu->cron = array('link' => 'Cron|cron|index', 'subModule' => 'cron');
|
||||
$lang->admin->menu->trashes = array('link' => 'Recycle|action|trash', 'subModule' => 'action');
|
||||
$lang->admin->menu->dev = array('link' => 'Develop|dev|api', 'alias' => 'db', 'subModule' => 'dev,editor');
|
||||
$lang->admin->menu->entry = 'Entry|entry|browse';
|
||||
$lang->admin->menu->entry = array('link' => 'Entry|entry|browse', 'subModule' => 'entry');
|
||||
$lang->admin->menu->sso = 'Zdoo|admin|sso';
|
||||
|
||||
$lang->convert = new stdclass();
|
||||
|
||||
@@ -372,7 +372,7 @@ $lang->admin->menu->safe = array('link' => '安全|admin|safe', 'alias' =>
|
||||
$lang->admin->menu->cron = array('link' => '计划任务|cron|index', 'subModule' => 'cron');
|
||||
$lang->admin->menu->trashes = array('link' => '回收站|action|trash', 'subModule' => 'action');
|
||||
$lang->admin->menu->dev = array('link' => '二次开发|dev|api', 'alias' => 'db', 'subModule' => 'dev,editor');
|
||||
$lang->admin->menu->entry = '应用|entry|browse';
|
||||
$lang->admin->menu->entry = array('link' => '应用|entry|browse', 'subModule' => 'entry');
|
||||
$lang->admin->menu->sso = '然之集成|admin|sso';
|
||||
|
||||
$lang->convert = new stdclass();
|
||||
|
||||
+29
-38
@@ -42,6 +42,7 @@ class file extends control
|
||||
/**
|
||||
* AJAX: get upload request from the web editor.
|
||||
*
|
||||
* @param $uid
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
@@ -51,7 +52,17 @@ class file extends control
|
||||
$file = $file[0];
|
||||
if($file)
|
||||
{
|
||||
if($file['size'] == 0) die(json_encode(array('error' => 1, 'message' => $this->lang->file->errorFileUpload)));
|
||||
if($file['size'] == 0)
|
||||
{
|
||||
if(defined('RUN_MODE') && RUN_MODE == 'api')
|
||||
{
|
||||
die(json_encode(array('status' => 'error', 'message' => $this->lang->file->errorFileUpload)));
|
||||
}
|
||||
else
|
||||
{
|
||||
die(json_encode(array('error' => 1, 'message' => $this->lang->file->errorFileUpload)));
|
||||
}
|
||||
}
|
||||
if(@move_uploaded_file($file['tmpname'], $this->file->savePath . $this->file->getSaveName($file['pathname'])))
|
||||
{
|
||||
/* Compress image for jpg and bmp. */
|
||||
@@ -65,47 +76,27 @@ class file extends control
|
||||
$fileID = $this->dao->lastInsertID();
|
||||
$url = $this->createLink('file', 'read', "fileID=$fileID", $file['extension']);
|
||||
if($uid) $_SESSION['album'][$uid][] = $fileID;
|
||||
die(json_encode(array('error' => 0, 'url' => $url)));
|
||||
if(defined('RUN_MODE') && RUN_MODE == 'api')
|
||||
{
|
||||
$_SERVER['SCRIPT_NAME'] = 'index.php';
|
||||
die(json_encode(array('status' => 'success', 'data' => commonModel::getSysURL() . $this->config->webRoot . $url)));
|
||||
}
|
||||
else
|
||||
{
|
||||
die(json_encode(array('error' => 0, 'url' => $url)));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$error = strip_tags(sprintf($this->lang->file->errorCanNotWrite, $this->file->savePath, $this->file->savePath));
|
||||
die(json_encode(array('error' => 1, 'message' => $error)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function apiUpload($uid = '')
|
||||
{
|
||||
$file = $this->file->getUpload('file');
|
||||
$file = $file[0];
|
||||
if($file)
|
||||
{
|
||||
if($file['size'] == 0) die(json_encode(array('status' => 'error', 'message' => $this->lang->file->errorFileUpload)));
|
||||
if(@move_uploaded_file($file['tmpname'], $this->file->savePath . $this->file->getSaveName($file['pathname'])))
|
||||
{
|
||||
/* Compress image for jpg and bmp. */
|
||||
$file = $this->file->compressImage($file);
|
||||
|
||||
$file['addedBy'] = $this->app->user->account;
|
||||
$file['addedDate'] = helper::today();
|
||||
unset($file['tmpname']);
|
||||
$this->dao->insert(TABLE_FILE)->data($file)->exec();
|
||||
|
||||
$_SERVER['SCRIPT_NAME'] = 'index.php';
|
||||
$fileID = $this->dao->lastInsertID();
|
||||
$url = $this->createLink('file', 'read', "fileID=$fileID", $file['extension']);
|
||||
if($uid) $_SESSION['album'][$uid][] = $fileID;
|
||||
die(json_encode(array('status' => 'seccess', 'data' => commonModel::getSysURL() . $this->config->webRoot . $url)));
|
||||
}
|
||||
else
|
||||
{
|
||||
$error = strip_tags(sprintf($this->lang->file->errorCanNotWrite, $this->file->savePath, $this->file->savePath));
|
||||
die(json_encode(array('status' => 'error', 'message' => $error)));
|
||||
if(defined('RUN_MODE') && RUN_MODE == 'api')
|
||||
{
|
||||
die(json_encode(array('status' => 'error', 'message' => $error)));
|
||||
}
|
||||
else
|
||||
{
|
||||
die(json_encode(array('error' => 1, 'message' => $error)));
|
||||
}
|
||||
}
|
||||
}
|
||||
die(json_encode(array('status' => 'error', 'message' => $this->lang->file->uploadImagesExplain)));
|
||||
|
||||
Reference in New Issue
Block a user