diff --git a/module/my/view/bug.html.php b/module/my/view/bug.html.php index 7975c1c2ff..c09768d83d 100644 --- a/module/my/view/bug.html.php +++ b/module/my/view/bug.html.php @@ -60,7 +60,7 @@ common::printIcon('bug', 'confirmBug', $params, $bug, 'list', 'search', '', 'iframe', true); common::printIcon('bug', 'assignTo', $params, '', 'list', 'hand-right', '', 'iframe', true); common::printIcon('bug', 'resolve', $params, $bug, 'list', 'ok-sign', '', 'iframe', true); - common::printIcon('bug', 'close', $params, $bug, 'list', 'off', '', 'iframe text-danger', true); + common::printIcon('bug', 'close', $params, $bug, 'list', 'off', '', 'iframe', true); common::printIcon('bug', 'edit', $params, '', 'list', 'pencil'); ?> diff --git a/module/my/view/task.html.php b/module/my/view/task.html.php index f81d0e48e7..bff9d1cb80 100644 --- a/module/my/view/task.html.php +++ b/module/my/view/task.html.php @@ -65,7 +65,7 @@ common::printIcon('task', 'start', "taskID=$task->id", $task, 'list', 'play', '', 'iframe', true); common::printIcon('task', 'recordEstimate', "taskID=$task->id", $task, 'list', 'time', '', 'iframe', true); common::printIcon('task', 'finish', "taskID=$task->id", $task, 'list', 'ok-sign', '', 'iframe', true); - common::printIcon('task', 'close', "taskID=$task->id", $task, 'list', 'off', '', 'iframe text-danger', true); + common::printIcon('task', 'close', "taskID=$task->id", $task, 'list', 'off', '', 'iframe', true); common::printIcon('task', 'edit', "taskID=$task->id", '', 'list', 'pencil'); ?> diff --git a/module/project/view/bug.html.php b/module/project/view/bug.html.php index 1caebe9d9a..2791b091ba 100644 --- a/module/project/view/bug.html.php +++ b/module/project/view/bug.html.php @@ -52,7 +52,7 @@ common::printIcon('bug', 'confirmBug', $params, $bug, 'list', 'search', '', 'iframe', true); common::printIcon('bug', 'assignTo', $params, '', 'list', '', '', 'iframe', true); common::printIcon('bug', 'resolve', $params, $bug, 'list', '', '', 'iframe', true); - common::printIcon('bug', 'close', $params, $bug, 'list', '', '', 'iframe text-danger', true); + common::printIcon('bug', 'close', $params, $bug, 'list', '', '', 'iframe', true); common::printIcon('bug', 'edit', $params, $bug, 'list'); common::printIcon('bug', 'create', "product=$bug->product&extra=bugID=$bug->id", $bug, 'list', 'copy'); ?> diff --git a/www/js/my.min.js b/www/js/my.min.js index 7298533e4a..0d4e328994 120000 --- a/www/js/my.min.js +++ b/www/js/my.min.js @@ -1 +1,1199 @@ -my.full.js \ No newline at end of file +/** + * Create link. + * + * @param string $moduleName + * @param string $methodName + * @param string $vars + * @param string $viewType + * @access public + * @return string + */ +function createLink(moduleName, methodName, vars, viewType, isOnlyBody) +{ + if(!viewType) viewType = config.defaultView; + if(!isOnlyBody) isOnlyBody = false; + if(vars) + { + vars = vars.split('&'); + for(i = 0; i < vars.length; i ++) vars[i] = vars[i].split('='); + } + if(config.requestType == 'PATH_INFO') + { + link = config.webRoot + moduleName + config.requestFix + methodName; + if(vars) + { + if(config.pathType == "full") + { + for(i = 0; i < vars.length; i ++) link += config.requestFix + vars[i][0] + config.requestFix + vars[i][1]; + } + else + { + for(i = 0; i < vars.length; i ++) link += config.requestFix + vars[i][1]; + } + } + link += '.' + viewType; + } + else + { + link = config.router + '?' + config.moduleVar + '=' + moduleName + '&' + config.methodVar + '=' + methodName + '&' + config.viewVar + '=' + viewType; + if(vars) for(i = 0; i < vars.length; i ++) link += '&' + vars[i][0] + '=' + vars[i][1]; + } + + /* if page has onlybody param then add this param in all link. the param hide header and footer. */ + if(onlybody == 'yes' || isOnlyBody) + { + var onlybody = config.requestType == 'PATH_INFO' ? "?onlybody=yes" : '&onlybody=yes'; + link = link + onlybody; + } + return link; +} + +/** + * Bind Event for searchbox + * + */ +function setSearchBox() +{ + $('#typeSelector a').click(function() + { + $('#typeSelector li.active').removeClass('active'); + var $this = $(this); + $this.closest('li').addClass('active'); + $("#searchType").val($this.data('value')); + $("#searchTypeName").text($this.text()); + }); +} + +/** + * Go to the view page of one object. + * + * @access public + * @return void + */ +function shortcut() +{ + objectType = $('#searchType').attr('value'); + objectValue = $('#searchQuery').attr('value'); + if(objectType && objectValue) + { + location.href=createLink(objectType, 'view', "id=" + objectValue); + } +} + +/** + * Show drop menu. + * + * @param string $objectType product|project + * @param int $objectID + * @param string $module + * @param string $method + * @param string $extra + * @access public + * @return void + */ +function showDropMenu(objectType, objectID, module, method, extra) +{ + var li = $('#currentItem').closest('li'); + if(li.hasClass('show')) {li.removeClass('show'); return;} + + if(!li.data('showagain')) + { + li.data('showagain', true); + $(document).click(function() {li.removeClass('show');}); + $('#dropMenu, #currentItem').click(function(e){e.stopPropagation();}); + } + $.get(createLink(objectType, 'ajaxGetDropMenu', "objectID=" + objectID + "&module=" + module + "&method=" + method + "&extra=" + extra), function(data){ $('#dropMenu').html(data).find('#search').focus();}); + + li.addClass('show'); +} + +/** + * Show drop result. + * + * @param objectType $objectType + * @param objectID $objectID + * @param module $module + * @param method $method + * @param extra $extra + * @access public + * @return void + */ +function showDropResult(objectType, objectID, module, method, extra) +{ + $.get(createLink(objectType, 'ajaxGetDropMenu', "objectID=" + objectID + "&module=" + module + "&method=" + method + "&extra=" + extra), function(data){ $('#dropMenu').html(data).find('#search').focus();}); +} + +/** + * Search items. + * + * @param string $keywords + * @param string $objectType + * @param int $objectID + * @param string $module + * @param string $method + * @param string $extra + * @access public + * @return void + */ +function searchItems(keywords, objectType, objectID, module, method, extra) +{ + if(keywords == '') + { + showMenu = 0; + showDropResult(objectType, objectID, module, method, extra); + } + else + { + keywords = encodeURI(keywords); + if(keywords != '-') $.get(createLink(objectType, 'ajaxGetMatchedItems', "keywords=" + keywords + "&module=" + module + "&method=" + method + "&extra=" + extra), function(data){$('#searchResult').html(data);}); + } +} + +/** + * Show or hide more items. + * + * @access public + * @return void + */ +function switchMore() +{ + $('#search').width($('#search').width()).focus(); + $('#moreMenu').width($('#defaultMenu').outerWidth()); + $('#searchResult').toggleClass('show-more'); +} + +/** + * Switch doc library. + * + * @param int $libID + * @param string $module + * @param string $method + * @param string $extra + * @access public + * @return void + */ +function switchDocLib(libID, module, method, extra) +{ + if(module == 'doc') + { + if(method != 'view' && method != 'edit') + { + link = createLink(module, method, "rootID=" + libID); + } + else + { + link = createLink('doc', 'browse'); + } + } + else if(module == 'tree') + { + link = createLink(module, method, "rootID=" + libID + '&type=' + extra); + } + location.href=link; +} + +/** + * Set the ping url. + * + * @access public + * @return void + */ +function setPing() +{ + $('#hiddenwin').attr('src', createLink('misc', 'ping')); +} + +/** + * Set required fields, add star class to them. + * + * @access public + * @return void + */ +function setRequiredFields() +{ + if(!config.requiredFields) return false; + requiredFields = config.requiredFields.split(','); + for(i = 0; i < requiredFields.length; i++) + { + $('#' + requiredFields[i]).closest('td,th').prepend("
"); + var colEle = $('#' + requiredFields[i]).closest('[class*="col-"]'); + if(colEle.parent().hasClass('form-group')) colEle.addClass('required'); + } +} + +/** + * Set the help links of forum's items. + * + * @access public + * @return void + */ +function setHelpLink() +{ + if(!$.cookie('help')) $.cookie('help', 'off', {expires:config.cookieLife, path:config.webRoot}); + className = $.cookie('help') == 'off' ? 'hidden' : ''; + + $('form input[id], form select[id], form textarea[id]').each(function() + { + if($(this).attr('type') == 'hidden' || $(this).attr('type') == 'file') return; + currentFieldName = $(this).attr('name') ? $(this).attr('name') : $(this).attr('id'); + if(currentFieldName == 'submit' || currentFieldName == 'reset') return; + if(currentFieldName.indexOf('[') > 0) currentFieldName = currentFieldName.substr(0, currentFieldName.indexOf('[')); + currentFieldName = currentFieldName.toLowerCase(); + helpLink = createLink('help', 'field', 'module=' + config.currentModule + '&method=' + config.currentMethod + '&field=' + currentFieldName); + $(this).after(' ? '); + }); + + $("a.helplink").modalTrigger({width:600, type:'iframe'}); +} + +/** + * Set paceholder. + * + * @access public + * @return void + */ +function setPlaceholder() +{ + if(typeof(holders) != "undefined") + { + for(var key in holders) + { + if($('#' + key).prop('tagName') == 'INPUT') + { + $("#" + key).attr('placeholder', holders[key]); + } + else + { + $("#" + key).parent().append("" + holders[key] + ''); + } + } + } +} + +/** + * Toggle the help links. + * + * @access public + * @return void + */ +function toggleHelpLink() +{ + $('.helplink').toggle(); + if($.cookie('help') == 'off') return $.cookie('help', 'on', {expires:config.cookieLife, path:config.webRoot}); + if($.cookie('help') == 'on') return $.cookie('help', 'off', {expires:config.cookieLife, path:config.webRoot}); +} + +/** + * Hide tree box + * + * @param string $treeType + * @access public + * @return void + */ +function hideTreeBox(treeType) +{ + $.cookie(treeType, 'hide', {expires:config.cookieLife, path:config.webRoot}); + $('.outer').addClass('hide-side'); + $('.side-handle .icon-caret-left').removeClass('icon-caret-left').addClass('icon-caret-right'); +} + +/** + * Show tree box + * + * @param string $treeType + * @access public + * @return void + */ +function showTreeBox(treeType) +{ + $.cookie(treeType, 'show', {expires:config.cookieLife, path:config.webRoot}); + $('.outer').removeClass('hide-side'); + $('.side-handle .icon-caret-right').removeClass('icon-caret-right').addClass('icon-caret-left'); +} + +/** + * Toggle tree menu. + + * @access public + * @return void + */ +function toggleTreeBox() +{ + var treeType = $('.side-handle').data('id'); + if(typeof treeType == 'undefined' || treeType == null) return; + if($.cookie(treeType) == 'hide') hideTreeBox(treeType); + + $('.side-handle').toggle + ( + function() + { + if($.cookie(treeType) == 'hide') return showTreeBox(treeType); + hideTreeBox(treeType); + }, + function() + { + if($.cookie(treeType) == 'show') return hideTreeBox(treeType); + showTreeBox(treeType); + } + ); + + setTimeout(function(){$('.outer.with-side').addClass('with-transition')}, 1000); +} + +/** + * Set language. + * + * @access public + * @return void + */ +function selectLang(lang) +{ + $.cookie('lang', lang, {expires:config.cookieLife, path:config.webRoot}); + location.href = removeAnchor(location.href); +} + +/** + * Set theme. + * + * @access public + * @return void + */ +function selectTheme(theme) +{ + $.cookie('theme', theme, {expires:config.cookieLife, path:config.webRoot}); + location.href = removeAnchor(location.href); +} + +/** + * Remove anchor from the url. + * + * @param string $url + * @access public + * @return string + */ +function removeAnchor(url) +{ + pos = url.indexOf('#'); + if(pos > 0) return url.substring(0, pos); + return url; +} + +/** + * Get the window size and save to cookie. + * + * @access public + * @return void + */ +function saveWindowSize() +{ + width = $(window).width(); + height = $(window).height(); + $.cookie('windowWidth', width) + $.cookie('windowHeight', height) +} + +/** + * Set Outer box's width and height. + * + * @access public + * @return void + */ +function setOuterBox() +{ + if($('.outer > .side').length) $('.outer').addClass('with-side'); + if($('.sub-featurebar').length) $('#featurebar').addClass('with-sub'); + + var side = $('#wrap .outer > .side'); + var resetOuterHeight = function() + { + var sideH = side.length ? (side.outerHeight() + $('#featurebar').outerHeight() + 20) : 0; + var height = Math.max(sideH, $(window).height() - $('#header').height() - $('#footer').height() - 33); + if(navigator.userAgent.indexOf("MSIE 8.0") >= 0) height -= 40; + $('#wrap .outer').css('min-height', height); + } + + side.resize(resetOuterHeight); + $(window).resize(resetOuterHeight); + resetOuterHeight(); +} + +/** + * Disable the submit button when submit form. + * + * @access public + * @return void + */ +function setForm() +{ + var formClicked = false; + $('form').submit(function() + { + submitObj = $(this).find(':submit'); + if($(submitObj).size() == 1) + { + var isBtn = submitObj.prop('tagName') == "BUTTON"; + submitLabel = isBtn ? $(submitObj).text() : $(submitObj).attr('value'); + $(submitObj).attr('disabled', 'disabled'); + var submitting = submitObj.attr('data-submitting') || config.submitting; + if(isBtn) submitObj.text(submitting); + else $(submitObj).attr('value', submitting); + formClicked = true; + } + }); + + $("body").click(function() + { + if(formClicked) + { + $(submitObj).removeAttr('disabled'); + if(submitObj.prop('tagName') == "BUTTON") submitObj.text(submitLabel); + else $(submitObj).attr('value', submitLabel); + $(submitObj).removeClass('button-d'); + } + formClicked = false; + }); +} + +/** + * Set form action and submit. + * + * @param url $actionLink + * @param string $hiddenwin 'hiddenwin' + * @access public + * @return void + */ +function setFormAction(actionLink, hiddenwin) +{ + if(hiddenwin) $('form').attr('target', hiddenwin); + else $('form').removeAttr('target'); + + $('form').attr('action', actionLink).submit(); +} + +/** + * Set the max with of image. + * + * @access public + * @return void + */ +function setImageSize(image, maxWidth) +{ + /* If not set maxWidth, set it auto. */ + if(!maxWidth) + { + bodyWidth = $('body').width(); + maxWidth = bodyWidth - 470; // The side bar's width is 336, and add some margins. + } + + if($(image).width() > maxWidth) $(image).attr('width', maxWidth); + $(image).wrap(''); +} + +/** + * Set the repo link. + * + * @access public + * @return void + */ +function setRepoLink() +{ + $('.repolink').modalTrigger({width:960, type:'iframe'}); +} + +/* Set the modal dialog of export. */ +function setExport() +{ + $(".export").modalTrigger({width:650, type:'iframe'}); +} + +/** + * Set mailto list from a contact list.. + * + * @param string $mailto + * @param int $contactListID + * @access public + * @return void + */ +function setMailto(mailto, contactListID) +{ + link = createLink('user', 'ajaxGetContactUsers', 'listID=' + contactListID); + $.get(link, function(users) + { + $('#' + mailto).replaceWith(users); + $('#' + mailto + '_chosen').remove(); + $('#' + mailto).chosen(defaultChosenOptions); + }); +} + +/** + * Set comment. + * + * @access public + * @return void + */ +function setComment() +{ + $('#commentBox').toggle(); + $('.ke-container').css('width', '100%'); + setTimeout(function() { $('#commentBox textarea').focus(); }, 50); +} + +/** + * Auto checked the checkbox of a row. + * + * @access public + * @return void + */ +function autoCheck() +{ + $('.tablesorter tr :checkbox').click(function(){clickInCheckbox = 1;}); + + $('.tablesorter tr').click(function() + { + if(document.activeElement.type != 'select-one' && document.activeElement.type != 'text') + { + if(typeof(clickInCheckbox) != 'undefined' && clickInCheckbox == 1) + { + clickInCheckbox = 0; + } + else + { + if($(this).find(':checkbox').attr('checked')) + { + $(this).find(':checkbox').attr('checked', false); + } + else + { + $(this).find(':checkbox').attr('checked', true); + } + } + } + }); +} + +/** + * Toogle the search form. + * + * @access public + * @return void + */ +function toggleSearch() +{ + $("#bysearchTab").toggle + ( + function() + { + if(browseType == 'bymodule') + { + $('#bymoduleTab').removeClass('active'); + } + else + { + $('#' + browseType + 'Tab').removeClass('active'); + } + $('#bysearchTab').addClass('active'); + ajaxGetSearchForm(); + $('#querybox').addClass('show'); + }, + function() + { + if(browseType == 'bymodule') + { + $('#bymoduleTab').addClass('active'); + } + else + { + $('#' + browseType +'Tab').addClass('active'); + } + $('#bysearchTab').removeClass('active'); + $('#querybox').removeClass('show'); + } + ); +} + +/** + * Ajax get search form + * + * @access public + * @return void + */ +function ajaxGetSearchForm() +{ + if($('#querybox').html() == '') + { + $.get(createLink('search', 'buildForm'), function(data) + { + $('#querybox').html(data); + }); + } +} + +/** + * Hide the link of clearData. + * + * @access public + * @return void + */ +function hideClearDataLink() +{ + if(typeof showDemoUsers == 'undefined' || !showDemoUsers) $('#submenuclearData').addClass('hidden'); +} + +/** + * add one option of a select to another select. + * + * @param string $SelectID + * @param string $TargetID + * @access public + * @return void + */ +function addItem(SelectID,TargetID) +{ + ItemList = document.getElementById(SelectID); + Target = document.getElementById(TargetID); + for(var x = 0; x < ItemList.length; x++) + { + var opt = ItemList.options[x]; + if (opt.selected) + { + flag = true; + for (var y=0;y