diff --git a/module/bug/css/create.css b/module/bug/css/create.css index 205ebf08f7..a33cd477b8 100644 --- a/module/bug/css/create.css +++ b/module/bug/css/create.css @@ -4,3 +4,7 @@ #story {width:605px} #steps {width:100%} .text-1 {width: 85%} + +/* The build template setting. */ +.button-c {padding:2px} +.ke-icon-savetemplate {background-image: url(theme/default/images/kindeditor/save.gif); background-position: center; width: 56px; height: 20px;} diff --git a/module/bug/js/create.js b/module/bug/js/create.js index dbe894d787..424d560eba 100644 --- a/module/bug/js/create.js +++ b/module/bug/js/create.js @@ -149,3 +149,34 @@ $(function() { $("#mailto").autocomplete(userList, { multiple: true, mustMatch: true}); setAssignedTo(); }) + +/* Save template. */ +KE.plugin.savetemplate = { + click: function(id) { + content = KE.html('steps'); + jPrompt(setTemplateTitle, '','', function(r) + { + if(!r || !content) return; + saveTemplateLink = createLink('bug', 'saveTemplate'); + $.post(saveTemplateLink, {title:r, content:content}, function(data) + { + $('#tplBox').html(data); + }); + }); + } +} +/* Set template. */ +function setTemplate(templateID) +{ + $('#tplTitleBox' + templateID).attr('style', 'text-decoration:underline; color:#8B008B'); + steps = $('#template' + templateID).html(); + KE.html('steps', steps); +} + +/* Delete template. */ +function deleteTemplate(templateID) +{ + if(!templateID) return; + hiddenwin.location.href = createLink('bug', 'deleteTemplate', 'templateID=' + templateID); + $('#tplBox' + templateID).addClass('hidden'); +} diff --git a/module/bug/view/activate.html.php b/module/bug/view/activate.html.php index d6d5a265c0..92a2809775 100644 --- a/module/bug/view/activate.html.php +++ b/module/bug/view/activate.html.php @@ -12,7 +12,6 @@ ?>
diff --git a/module/bug/view/buildtemplates.html.php b/module/bug/view/buildtemplates.html.php index 011b652292..cd04e8e75c 100644 --- a/module/bug/view/buildtemplates.html.php +++ b/module/bug/view/buildtemplates.html.php @@ -1,46 +1,6 @@ - $template) diff --git a/module/bug/view/create.html.php b/module/bug/view/create.html.php index 7e55f4bf71..c9b75d032a 100644 --- a/module/bug/view/create.html.php +++ b/module/bug/view/create.html.php @@ -14,6 +14,9 @@ +