diff --git a/.gitignore b/.gitignore index c5228c10818cfc95246df96efc3eb6df3d6d9d41..e165debb0cdeeb24866a96ae30f9abf20b97b7e8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,12 +1,47 @@ +# phpstorm project files .idea -assets/ -protected/runtime/ -themes/classic/views/ -/nbproject/private/ -/data/attachment -/data/backup -/data/runtime -/data/temp +# netbeans project files +nbproject +# zend studio for eclipse project files +.buildpath +.project +.settings +# windows thumbnail cache +Thumbs.db +# composer vendor dir +/vendor +# composer itself is not needed +composer.phar +# Mac DS_Store Files +.DS_Store + +node_modules + data/aes.key +data/update/patch/ +data/licence.key data/install.lock -!system/config \ No newline at end of file +data/avatar/ +data/org/* +data/avatar/* +data/runtime/ +data/editor/ +data/backup/ +data/attachment/* +data/avatar/* +!data/attachment/article/201406/ +!data/attachment/article/index.html +!data/attachment/vote/201406/ +!data/attachment/vote/index.html +!data/org/data.js +static/* +!static/css/ +!static/font/ +!static/image/ +!static/js/ +!static/login/ +!static/office/ +system/config/config.php +system/defines.php +saas_config.php +mobile \ No newline at end of file diff --git a/api/co/sync.php b/api/co/sync.php index cc021a261f589fddc30bc571d40f1014b04e9021..91352b81a08940adc1f24499241fd9db65c4a895 100644 --- a/api/co/sync.php +++ b/api/co/sync.php @@ -415,13 +415,26 @@ function syncUser($msgData, $msgPlatform) ->execute(); } if (true === $writeBind) { - $connection->schema->commandBuilder - ->createInsertCommand('{{user_binding}}', array( - 'uid' => $uid, - 'bindvalue' => $row['guid'], - 'app' => $msgPlatform, - )) - ->execute(); + //检测绑定表是否存在绑定 + $criteria = new CDbCriteria(); + $criteria->condition = " `uid` = :uid AND `app` = :app"; + $criteria->params = array( + ':uid' => $uid, + ':app' => $msgPlatform, + ); + $bindingValue = $connection->schema->commandBuilder + ->createFindCommand('{{user_binding}}', $criteria) + ->queryRow(); + //没有的话就绑定 + if (empty($bindingValue)){ + $connection->schema->commandBuilder + ->createInsertCommand('{{user_binding}}', array( + 'uid' => $uid, + 'bindvalue' => $row['guid'], + 'app' => $msgPlatform, + )) + ->execute(); + } $bindArray[$row['guid']] = $uid; $return['bind'][$row['uid']] = $uid; } else { @@ -464,15 +477,20 @@ function syncUser($msgData, $msgPlatform) } if (isset($delete)) { foreach ($delete as $_delete) { - $uid = $bindArray[$_delete['guid']]; - UserBinding::model()->deleteAll('uid = :uid AND bindvalue = :bindvalue AND app = :app', array( - 'uid' => $uid, - 'bindvalue' => $_delete['guid'], - 'app' => $msgPlatform, - )); - User::model()->updateAll(array('status' => User::USER_STATUS_ABANDONED), 'uid = :uid', array('uid' => $uid)); - unset($bindArray[$_delete['guid']]); - $return['delete'][$_delete['uid']] = $uid; + if (isset($bindArray[$_delete['guid']])){ + $uid = $bindArray[$_delete['guid']]; + UserBinding::model()->deleteAll('uid = :uid AND bindvalue = :bindvalue AND app = :app', array( + 'uid' => $uid, + 'bindvalue' => $_delete['guid'], + 'app' => $msgPlatform, + )); + User::model()->updateAll(array('status' => User::USER_STATUS_ABANDONED), 'uid = :uid', array('uid' => $uid)); + unset($bindArray[$_delete['guid']]); + $return['delete'][$_delete['uid']] = $uid; + }else{ + unset($bindArray[$_delete['guid']]); + $return['delete'][$_delete['uid']] = $_delete['uid']; + } } } $transaction->commit(); @@ -522,7 +540,6 @@ function ibosSync($msgPlatform) $offset += $limit; } } - return array( 'isSuccess' => true, 'msg' => '成功', @@ -595,7 +612,7 @@ function deptBind($msgPlatform, $array) function getUrl($type) { - $api = 'http://www.kubangong.com/api/sync/' . $type; + $api = 'https://www.ibos.cn/api/sync/' . $type; $time = time(); return Api::getInstance()->buildUrl($api, array( 'signature' => sha1(AESKEY . $time), diff --git a/api/login.php b/api/login.php index fb1873b73d0042f9ae528ad6cf5a7a4e8971abbe..ea52d55401fff22e033ec367166e7063e8b0f614 100644 --- a/api/login.php +++ b/api/login.php @@ -48,50 +48,43 @@ function doLogin($uid, $terminalName = '') $identity = new UserIdentity($curUser['username'], $curUser['password'], UserIdentity::LOGIN_BY_USERNAME); $ip = Ibos::app()->setting->get('clientip'); - if (Ibos::app()->user->isGuest || Ibos::app()->user->uid != $uid) { - $identity->setId($uid); - $identity->setPersistentStates($curUser); - // 先删除cookie,否则初始化user组件会出错 - foreach ($_COOKIE as $k => $v) { - $cookiePath = $config['cookie']['cookiepath']; - $cookieDomain = $config['cookie']['cookiedomain']; - $secure = $_SERVER['SERVER_PORT'] == 443 ? 1 : 0; - @setcookie($k, "", time() - 86400, $cookiePath, $cookieDomain, $secure, false); - } - // 是否允许多个账户同时登录 - $account = Ibos::app()->setting->get('setting/account'); - $user = Ibos::app()->user; - if ($account['allowshare'] != 1) { - $user->setStateKeyPrefix(Ibos::app()->setting->get('sid')); - } - $loginStatus = $user->login($identity); - if (!empty($terminalName)) { - $logArr = array( - 'terminal' => $terminalName, - 'password' => '', - 'ip' => $ip, - 'user' => $curUser['username'], - 'loginType' => $identity::LOGIN_BY_USERNAME, - 'address' => '', - 'gps' => '' - ); - Log::write($logArr, 'login', sprintf('module.user.%d', $uid)); - $rule = UserUtil::updateCreditByAction('daylogin', $uid); - if (!$rule['updateCredit']) { - UserUtil::checkUserGroup($uid); - } - } - return array( - 'code' => $loginStatus, - 'msg' => $loginStatus ? '登录成功' : '登录失败', - ); - } else { - return array( - 'code' => $uid, - 'msg' => '已登录' + $identity->setId($uid); + $identity->setPersistentStates($curUser); + // 先删除cookie,否则初始化user组件会出错 + foreach ($_COOKIE as $k => $v) { + $cookiePath = $config['cookie']['cookiepath']; + $cookieDomain = $config['cookie']['cookiedomain']; + $secure = $_SERVER['SERVER_PORT'] == 443 ? 1 : 0; + @setcookie($k, "", time() - 86400, $cookiePath, $cookieDomain, $secure, false); + } + // 是否允许多个账户同时登录 + $account = Ibos::app()->setting->get('setting/account'); + $user = Ibos::app()->user; + if ($account['allowshare'] != 1) { + $user->setStateKeyPrefix(Ibos::app()->setting->get('sid')); + } + $loginStatus = $user->login($identity); + if (!empty($terminalName)) { + $logArr = array( + 'terminal' => $terminalName, + 'password' => '', + 'ip' => $ip, + 'user' => $curUser['username'], + 'loginType' => $identity::LOGIN_BY_USERNAME, + 'address' => '', + 'gps' => '' ); + Log::write($logArr, 'login', sprintf('module.user.%d', $uid)); + $rule = UserUtil::updateCreditByAction('daylogin', $uid); + if (!$rule['updateCredit']) { + UserUtil::checkUserGroup($uid); + } } + return array( + 'code' => $loginStatus, + 'msg' => $loginStatus ? '登录成功' : '登录失败', + ); } /** diff --git a/api/wxqy/oauth/index.php b/api/wxqy/oauth/index.php index dda88e126df4aca16d2ee42f11d34e8b4cbb55db..e6532296f1bbe2639e48c5d9537e278acd8d2e10 100644 --- a/api/wxqy/oauth/index.php +++ b/api/wxqy/oauth/index.php @@ -57,6 +57,7 @@ if (!$isPost && strcmp($signature, md5($aeskey . $userId)) != 0) { Env::iExit("签名错误:" . $text); } $msg = ''; + if ($isPost) { $cookies = Ibos::app()->getRequest()->cookies['userid']; $userId = $cookies->value; @@ -75,16 +76,8 @@ if ($isPost) { if (!empty($user)) { $password = md5(md5($password) . $user['salt']); if (strcmp($user['password'], $password) == 0) { - $list = UserBinding::model()->fetchAll('(uid = :uid OR bindvalue = :bindvalue ) AND app = :app', array(':uid' => $user['uid'], ':app' => 'wxqy', ':bindvalue' => $userId)); - $count = count($list); - //如果根据uid或者绑定值找到记录并且超过一条记录,就全部删除 - if ($count >= 2) { - UserBinding::model()->deleteAll('(uid = :uid OR bindvalue = :bindvalue ) AND app = :app', array(':uid' => $user['uid'], ':app' => 'wxqy', ':bindvalue' => $userId)); - } - //如果记录不是一条,就添加(0条或者超过1的) - if ($count != 1) { - UserBinding::model()->add(array('uid' => $user['uid'], 'bindvalue' => $userId, 'app' => 'wxqy')); - } + UserBinding::model()->deleteAll('(uid = :uid OR bindvalue = :bindvalue ) AND app = :app', array(':uid' => $user['uid'], ':app' => 'wxqy', ':bindvalue' => $userId)); + UserBinding::model()->add(array('uid' => $user['uid'], 'bindvalue' => $userId, 'app' => 'wxqy')); } else { $msg = 'IBOS账号或者密码错误'; } @@ -104,6 +97,11 @@ if (!empty($userId)) { $url = base64_decode($redirect); $parse = parse_url($url); if (isset($parse['scheme'])) { + // 如果为 pc 的企业微信浏览器 + if (!empty($_SERVER['HTTP_USER_AGENT']) && (strpos($_SERVER['HTTP_USER_AGENT'], 'WindowsWechat') !== false || strpos($_SERVER['HTTP_USER_AGENT'], 'Macintosh') !== false) && $parse['path'] == '/mobile/') { + $ret = pcWeChetUrl($parse); + $url = empty($ret) ? $url : $ret; + } header('Location:' . $url, true); exit(); } else { @@ -153,3 +151,141 @@ function showBind($msg = '') $str .= ''; echo $str; } + +function pcWeChetUrl($parse) +{ +// var_dump($parse);die; + $url = $parse['scheme'] . '://' . $parse['host']; + if (!empty($parse['port']) && $parse['port'] != 80) { + $url.= ':'.$parse['port']; + } + switch ($parse['fragment']) { + case '/workflow/index': // 工作流 + $url .= '/?r=workflow/list/index'; + break; + case strpos($parse['fragment'], '/workflow/handle/') === 0: // 工作流处理 + $param = explode('/', $parse['fragment']); + if (!empty($param[3])) { + $url .= '/?r=workflow/form/index&key=' . $param[3]; + } else { + $url = ''; + } + break; + case strpos($parse['fragment'], '/workflow/detail/') === 0: // 工作流详情 + $param = explode('/', $parse['fragment']); + if (!empty($param[3])) { + $url .= '/?r=workflow/preview/print&key=' . $param[3]; + } else { + $url = ''; + } + break; + case '/vote/index': // 调查投票 + $url .= '/?r=vote/default/index'; + break; + case strpos($parse['fragment'], '/vote/view/') === 0: // 调查投票,查看 + $param = explode('/', $parse['fragment']); + if (!empty($param[3])) { + $url .= '/?r=vote/default/show&id=' . $param[3]; + } else { + $url = ''; + } + break; + case '/diary/index': // 工作日志 + $url .= '/?r=diary/default/index'; + break; + case strpos($parse['fragment'], '/diary/detail/') === 0: // 工作日志,查看 + $param = explode('/', $parse['fragment']); + if (!empty($param[3])) { + $url .= '/?r=diary/review/show&diaryid=' . $param[3]; + } else { + $url = ''; + } + break; + case '/activity/index': // 活动中心 + $url .= '/?r=activity/manage/index'; + break; + case strpos($parse['fragment'], '/activity/view/') === 0: // 活动中心,查看 + $param = explode('/', $parse['fragment']); + if (!empty($param[3])) { + $url .= '/?r=activity/manage/detail&id=' . $param[3]; + } else { + $url = ''; + } + break; + case '/crm/index': // CRM + $url .= '/?r=crm/index/index'; + break; + case '/assignment/index': // 任务指派 + $url .= '/?r=assignment/unfinished/index'; + break; + case strpos($parse['fragment'], '/assignment/detail/') === 0: // 任务指派,查看 + $param = explode('/', $parse['fragment']); + if (!empty($param[3])) { + $url .= '/?r=assignment/default/show&assignmentId=' . $param[3]; + } else { + $url = ''; + } + break; + case '/calendar': // 日程 + $url .= '/?r=calendar/schedule/index'; + break; + case '/contacts': // 通讯录 + $url .= '/?r=contact/default/index'; + break; + case '/docs/published': // 通知公告 + $url .= '/?r=officialdoc/officialdoc/index'; + break; + case strpos($parse['fragment'], '/docs/detail/') === 0: // 通知公告,查看 + $param = explode('/', $parse['fragment']); + if (!empty($param[3])) { + $url .= '/?r=officialdoc/officialdoc/show&docid=' . $param[3]; + } else { + $url = ''; + } + break; + case '/cabinet/personal': // 文件柜 + $url .= '/?r=file/default/index'; + break; + case '/news/published': // 信息中心 + $url .= '/?r=article/default/index'; + break; + case strpos($parse['fragment'], '/news/detail/') === 0: // 通知公告,查看 + $param = explode('/', $parse['fragment']); + if (!empty($param[3])) { + $url .= '/?r=article/default/show&articleid=' . $param[3]; + } else { + $url = ''; + } + break; + case '/email/index': // 邮件 + $url .= '/?r=email/list/index'; + break; + case strpos($parse['fragment'], '/email/detail/') === 0: // 通知公告,查看 + $param = explode('/', $parse['fragment']); + if (!empty($param[3])) { + $url .= '/?r=email/content/show&id=' . $param[3]; + } else { + $url = ''; + } + break; + case strpos($parse['fragment'], '/crm/clientview/') === 0: // 客户,查看 + $param = explode('/', $parse['fragment']); + if (!empty($param[3])) { + $url .= '/?r=crm/client/detail&id=' . $param[3]; + } else { + $url = ''; + } + break; + case strpos($parse['fragment'], '/crm/opportunityview/') === 0: // 商机,查看 + $param = explode('/', $parse['fragment']); + if (!empty($param[3])) { + $url .= '/?r=crm/opportunity/detail&id=' . $param[3]; + } else { + $url = ''; + } + break; + default : + $url = ''; + } + return $url; +} diff --git a/expire.html b/expire.html index 0ecb768dfafbae4a2d0859a37a63e2d6272c2a44..fafec09ba4bc516b578eed078a6a32e1163da19b 100644 --- a/expire.html +++ b/expire.html @@ -15,23 +15,27 @@

很抱歉,当前使用的IBOS已过期

- 试用期间所产生的企业数据,我们只会为您保留5天,5天后将会删除,如需继续使用,请管理员尽快联系我们续费呦! + 试用期间所产生的企业数据,我们只会为您保留7天,7天后将会删除,如需继续使用,请管理员尽快联系我们续费呦!

- + +

+
+ 管理员登录 +
- + diff --git a/install/static/css/sys_expire.css b/install/static/css/sys_expire.css index 47f19ea95ba6d8d47452d9c8163a6c8017fb3a39..a47d243355d6b578e4b86b8bce60577be94905d2 100644 --- a/install/static/css/sys_expire.css +++ b/install/static/css/sys_expire.css @@ -44,4 +44,7 @@ } #topqq { cursor: pointer; +} +.login-dashboard-btn { + margin-top: 5px; } \ No newline at end of file diff --git a/static/css/base.css b/static/css/base.css index 46b7c5d40eadbbf1e1abf43f795e491fd8b3623d..558a9de80f9be245e230ab07a0a8c5fb62dd2728 100644 --- a/static/css/base.css +++ b/static/css/base.css @@ -6008,7 +6008,7 @@ div.jGrowl div.jGrowl-notification.primary { -moz-transform: translate(0, 0)\9; -ms-transform: translate(0, 0)\9; transform: translate(0, 0)\9; - /* IE8+ - must be on one line, unfortunately */ + /* IE8+ - must be on one line, unfortunately */ -ms-filter: "progid:DXImageTransform.Microsoft.Matrix(M11=1, M12=0, M21=0, M22=1, SizingMethod='auto expand')"; /* * To make the transform-origin be the middle of @@ -6016,7 +6016,7 @@ div.jGrowl div.jGrowl-notification.primary { * are approximations. For more accurate results, * use Internet Explorer with this tool. */ - margin-left: -350px\0; + margin-left: -350px\0; margin-top: -300px\0; -webkit-box-shadow: 0 0 20px rgba(0, 0, 0, 0.1); @@ -6307,6 +6307,7 @@ div.jGrowl div.jGrowl-notification.primary { .o-download, .o-chain, .o-message, +.o-assign, .o-manager, .o-print, .o-print-bk, @@ -6350,6 +6351,14 @@ div.jGrowl div.jGrowl-notification.primary { .o-message:hover{ background-position: 0 -120px; } +.o-assign{ + background-position: -280px -120px; + direction: ltr; + text-indent: -9999px; +} +.o-assign:hover{ + background-position: -280px -160px; +} .o-manager{ background-position: -360px 0; direction: ltr; @@ -6785,3 +6794,35 @@ input.xcgn{ color: #7CB81C; } /*Green*/ .o16{ width: 16px; height: 16px; } .o20{ width: 20px; height: 20px; } .o30{ width: 30px; height: 30px; } + +.paginate_page{ + display: none; +} +input[type="text"].paginate_input{ + width: 40px; + min-height: 30px; + padding: 0; + text-align: center; +} +.wx-login-btn{ + background-image: url('../image/wx-link-btns.png'); + background-position: 0 0; + display: block; + width: 260px; + height: 40px; + margin: 0 auto; + margin-top: 20px; +} +.all-msg-read { + background-color:#2081c7; + color: #FFF; + padding: 5px; + box-shadow: inset 0 1px 0 #75b8e7; + transition: background linear 0.1s; + border: 1px solid #dadce6; + font-size: 14px; + font-family: Arial, "Microsoft Yahei"; + border-radius: 4px; + text-align: center; + cursor: pointer; +} \ No newline at end of file diff --git a/static/css/common.css b/static/css/common.css index 9fd4051648606951a95c0956ac8832d394d53447..4739bcd89ea1edcbb17fed316d119b7fcc76df7a 100644 --- a/static/css/common.css +++ b/static/css/common.css @@ -127,11 +127,67 @@ body > div.jGrowl.center { top: 60px; padding: 0; } .swfupload{ vertical-align: middle; } .swfupload-wrap{ position: relative; } .swfupload-wrap .swfupload{ position: absolute; top: 0; left: 0; width: 100%; height: 100%; } + +.webuploader-wrap{ + overflow: hidden; + position: relative; +} +.webuploader-container { + width: 40px; + height: 40px; + display: inline-block; + background: url(../image/upload_btn_attach.png); + background-repeat: no-repeat; + position: relative; + border: none; + background-color: transparent; + box-shadow: none; + transition: none; + vertical-align: middle; + box-sizing: border-box; +} +.webuploader-container_nobg { + background: none; + width: 100%; + height: 100%; +} +.webuploader-container:hover{ + background-position-y: -40px; +} +.webuploader-container:active{ + background-position-y: -80px; +} +.webuploader-container input{ + width: 100%; + height: 100%; +} +.webuploader-element-invisible { + position: absolute !important; + clip: rect(1px 1px 1px 1px); /* IE6, IE7 */ + clip: rect(1px, 1px, 1px, 1px); +} +.webuploader-pick { + display: none; +} +.webuploader-pick + div{ + top: 0 !important; + left: 0 !important; +} +.webuploader-pick-hover { + background: #00a2d4; +} +.webuploader-pick-disable { + opacity: 0.6; + pointer-events: none; +} .progressContainer { position: relative; padding: 10px 20px; } .progressContainer .progress{ margin-bottom: 0; } .progressContainer .progressCancel{ position: absolute; top: 10px; right: 20px; width: 20px; height: 20px; background: url(../image/global.png) 0 -80px no-repeat; } .progressContainer .progressCancel:hover{ background-position: -30px -80px; } +.progressContainer.red .progressBarStatus{ + color: #e26f50; +} .art-autoheight .aui_content, .art-autoheight .aui_content_wrap{ max-height: none; } .art-ifame-top iframe{ vertical-align: middle; } @@ -1707,7 +1763,7 @@ body > div.jGrowl.center { top: 60px; padding: 0; } } .img-reupload{ bottom: 0; visibility: hidden; z-index: 3; } .img-reupload-bg{ background-color: #000; opacity: .5; filter: Alpha(opacity=50); height: 20px;} -.img-reupload-text{ color: #FFF; text-align: center; font-size: 12px; top: 0;} +.img-reupload-text{ color: #FFF; text-align: center; font-size: 12px; top: 0; cursor: pointer;} /* 上传后,无论成功还是失败都显示重新上传 */ .img-upload-success .img-reupload, .img-upload-error .img-reupload{ visibility: visible; } @@ -1892,6 +1948,8 @@ body > div.jGrowl.center { top: 60px; padding: 0; } top: 0; left: 0; z-index: 6002; + right: 0; + bottom: 0; } .import-btn:link, .import-btn:visited{ diff --git a/static/image/btn_icon.png b/static/image/btn_icon.png index 10ba47ee0340e5cf8b08f71294a169d13c919f9f..b54c3ff78281ac8f07adfaa6cf41b52bcd6eda58 100644 Binary files a/static/image/btn_icon.png and b/static/image/btn_icon.png differ diff --git a/static/js/app/dialogUpload/ibos.dialogUpload.js b/static/js/app/dialogUpload/ibos.dialogUpload.js index 38b8799bc9b2b931baa869de1d80b93dc2c9baf7..7f210bb6721a38fc08c53c539101280f2743c43d 100644 --- a/static/js/app/dialogUpload/ibos.dialogUpload.js +++ b/static/js/app/dialogUpload/ibos.dialogUpload.js @@ -3,8 +3,7 @@ * @version $Id$ */ (function(){ - var DProgress = function(file, targetId, opts){ - var swfupload = SWFUpload.instances[file.id.substr(0, file.id.lastIndexOf("_"))]; + var DProgress = function (uploader, file, targetId, opts){ var _this = this; var _template = '
' + '<%= name %> - <%= size %>' + @@ -21,7 +20,7 @@ this.element.html($.template(_template, { icon: "", name: Ibos.string.ellipsis(file.name, 20, 10), - size: SWFUpload.speed.formatBytes(file.size), + size: WebUploader.Base.formatSize(file.size), status: " " })); @@ -30,10 +29,7 @@ // 从视图删除文件 this.element.find(".o-trash").on("click", function(){ // 获取得到 crFile 时,此时文件状态为上传中或等待中,先取消上传 - var crFile = swfupload.getFile(file.id); - if(crFile) { - swfupload.cancelUpload(crFile.id, false); - } + uploader.cancelFile(file.id); $("#" + file.id).remove(); }); } else { @@ -72,58 +68,53 @@ var _upload = Ibos.dialogUpload = function(opts) { var swfPath, uploadInstance;uploadInstance - if(typeof SWFUpload !== "undefined") { + if (typeof WebUploader !== "undefined") { Ibos.dialogUploadInstance = Ibos.upload.attach($.extend(true, { - button_image_url: "", - - swfupload_loaded_handler: null, - - file_queued_handler: function(file){ - var progress = new DProgress(file, this.customSettings.containerId); + fileQueued: function(file){ + var progress = new DProgress(this, file, this.options.custom_settings.containerId); progress.setStatus(U.lang("UPLOAD.WAITING")); }, - file_queue_error_handler: function(file, error, message){ - try{ - SWFUpload.defaults.file_queue_error_handler.apply(this, arguments); - var progress = new DProgress(file, this.customSettings.containerId); - progress.setError(); - progress.setStatus(SWFUpload.getErrorInfo(error, message)); - } catch(e){ - this.debug(e); - } - }, - - upload_progress_handler: function(file, loaded, total){ + // file_queue_error_handler: function(file, error, message){ + // try{ + // SWFUpload.defaults.file_queue_error_handler.apply(this, arguments); + // var progress = new DProgress(file, this.options.custom_settings.containerId); + // progress.setError(); + // progress.setStatus(SWFUpload.getErrorInfo(error, message)); + // } catch(e){ + // console.err(e); + // } + // }, + + uploadProgress: function (file, percent){ try { - var percent = Math.ceil((loaded / total) * 100), - progress = new DProgress(file, this.customSettings.containerId); + var progress = new DProgress(this, file, this.options.custom_settings.containerId); + percent = Math.ceil(percent * 100) progress.setProgress(percent); progress.setStatus(percent + " %..."); } catch(e){ - this.debug(e); + console.err(e); } }, - upload_error_handler: function(file, error, message){ + uploadError: function(file, error, message){ try { - SWFUpload.defaults.upload_error_handler.apply(this, arguments); - var progress = new DProgress(file, this.customSettings.containerId); + var progress = new DProgress(this, file, this.options.custom_settings.containerId); progress.setError(); - progress.setStatus(SWFUpload.getErrorInfo(error, message)); + // progress.setStatus(SWFUpload.getErrorInfo(error, message)); } catch (e) { - this.debug(e); + console.err(e); } }, - upload_success_handler: function(file, serverData, response){ + uploadSuccess: function(file, serverData, response){ try { var that = this, - cs = this.customSettings, - data = serverData && eval('('+serverData+')'); + cs = this.options.custom_settings, + data = serverData; - var progress = new DProgress(file, cs.containerId); + var progress = new DProgress(this, file, cs.containerId); if (data.aid && data.url) { progress.setComplete(); @@ -136,15 +127,15 @@ progress.setStatus(data.msg); } } catch(e){ - this.debug(e); + console.err(e); } } }, opts)); } else { - swfPath = Ibos.app.getStaticUrl("/js/lib/SWFUpload"); + swfPath = Ibos.app.getStaticUrl("/js/lib/webuploader"); - $.getScript(swfPath + "/swfupload.packaged.js") + $.getScript(swfPath + "/webuploader.js") .done(function(){ $.getScript(swfPath + "/handlers.js") diff --git a/static/js/app/ibos.importData.js b/static/js/app/ibos.importData.js index f8dc2a8e1abd3edf23728c4b459146470c10007d..ae166b2ec31f44c86711f5b223276333715d9106 100644 --- a/static/js/app/ibos.importData.js +++ b/static/js/app/ibos.importData.js @@ -27,7 +27,7 @@ '

请导入文件

', '
', '
', - '', + '
', '
', '', '
', @@ -449,21 +449,22 @@ that.$upload = $('.import-upload-tips'); Ibos.upload.attach({ - post_params: { + formData: { module: 'temp' }, - file_upload_limit: 1, + fileNumLimit: 1, file_size_limit: "1024", - file_types: '*.xls;*.xlsx;*.csv;', - file_types_description: 'only support csv/xls(x)', - button_placeholder_id: "import_btn", - button_width: "100", - button_height: "40", - button_image_url: "", + accept: { + title: 'Images', + extensions: 'csv,xls,xlsx', + mimeTypes: 'application/vnd.ms-excel,text/csv,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' + }, + pick: "#import_btn", custom_settings: { containerId: "file_target", inputId: "attachmentid", success: function(file, data) { + console.log(file, data) // aid为0时,表示上传不成功,通用上传 if (data.aid !== 0) { that.parseFile(data, 1); @@ -686,7 +687,7 @@ mx = e.pageX; //点击时鼠标X坐标 my = e.pageY; //点击时鼠标Y坐标 dx = $this.offset().left; - dy = $this.offset().top; + dy = $this.get(0).offsetTop; isDraging = true; //标记对话框可拖动 // console.log(index,"按住") }) @@ -710,6 +711,7 @@ moveY = Math.min(Math.max(0,moveY),maxY); //Y轴可拖动范围 // console.log({"pageW":pageW,"pageH":pageH,"dialogW":dialogW,"dialogH":dialogH},{"left":moveX + 'px',"top":moveY + 'px'}) //重新设置对话框的left、top + console.log(moveX, moveY) $this.css({"left":moveX + 'px',"top":moveY + 'px'}); }; }); @@ -724,4 +726,4 @@ } return importDialog; -}, jQuery, undefined); \ No newline at end of file +}, jQuery, undefined); diff --git a/static/js/app/ibos.userSelect.js b/static/js/app/ibos.userSelect.js index 19259c4f6a96f437402be9281f681539d637b9bb..41b409ac636ace2833d384d675675066da283b17 100644 --- a/static/js/app/ibos.userSelect.js +++ b/static/js/app/ibos.userSelect.js @@ -290,7 +290,7 @@ '
', '
', '
', - ' ', + ' ', '
', '
', '
', @@ -400,8 +400,9 @@ } else { collectionDept = Ibos.data.get('department'); } - - this.uids = _getUnique(uids); + // 人数多时(5万),这里性能消耗很大,为排序和去重的功能,去掉没发现有影响,先去掉 + // this.uids = _getUnique(uids); + this.uids = uids; this.depts = collectionDept; return this; }, @@ -1394,4 +1395,4 @@ multiple: true, clearable: true }; -})(document, Ibos); \ No newline at end of file +})(document, Ibos); diff --git a/static/js/app/remind/remind.html b/static/js/app/remind/remind.html index 0b2aa19d55850b76bd849aebcfaaaeb4be4025fd..b7a71ce87593a209b795df7f497a412e66c9cb71 100644 --- a/static/js/app/remind/remind.html +++ b/static/js/app/remind/remind.html @@ -4,15 +4,15 @@
-