Minor Updates
This commit is contained in:
parent
b3fe6a45a7
commit
2ad801cfd8
@ -31,19 +31,19 @@
|
|||||||
|
|
||||||
.timeline-centered {
|
.timeline-centered {
|
||||||
position: relative;
|
position: relative;
|
||||||
margin-bottom: 30px;
|
margin-bottom: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.timeline-centered:before {
|
.timeline-centered:before {
|
||||||
content: '';
|
content: '';
|
||||||
position: absolute;
|
position: absolute;
|
||||||
display: block;
|
display: block;
|
||||||
width: 4px;
|
width: 3px;
|
||||||
background: #f5f5f6;
|
background: #f5f5f6;
|
||||||
/*left: 50%;*/
|
/*left: 50%;*/
|
||||||
top: 20px;
|
top: 0px;
|
||||||
bottom: 20px;
|
bottom: 0px;
|
||||||
margin-left: 30px;
|
margin-left: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.timeline-centered .timeline-entry {
|
.timeline-centered .timeline-entry {
|
||||||
@ -51,37 +51,25 @@
|
|||||||
/*width: 50%;
|
/*width: 50%;
|
||||||
float: right;*/
|
float: right;*/
|
||||||
margin-top: 5px;
|
margin-top: 5px;
|
||||||
margin-left: 30px;
|
margin-left: 10px;
|
||||||
margin-bottom: 10px;
|
margin-bottom: 5px;
|
||||||
clear: both;
|
clear: both;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.timeline-centered .timeline-entry.left-aligned .timeline-entry-inner .timeline-label:after {
|
|
||||||
left: auto;
|
|
||||||
right: 0;
|
|
||||||
margin-left: 0;
|
|
||||||
margin-right: -9px;
|
|
||||||
-moz-transform: rotate(180deg);
|
|
||||||
-o-transform: rotate(180deg);
|
|
||||||
-webkit-transform: rotate(180deg);
|
|
||||||
-ms-transform: rotate(180deg);
|
|
||||||
transform: rotate(180deg);
|
|
||||||
}
|
|
||||||
|
|
||||||
.timeline-centered .timeline-entry .timeline-entry-inner {
|
.timeline-centered .timeline-entry .timeline-entry-inner {
|
||||||
position: relative;
|
position: relative;
|
||||||
margin-left: -20px;
|
margin-left: -3px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.timeline-centered .timeline-entry .timeline-entry-inner .timeline-icon {
|
.timeline-centered .timeline-entry .timeline-entry-inner .timeline-icon {
|
||||||
|
margin-top:10px;
|
||||||
background: #fff;
|
background: #fff;
|
||||||
color: #737881;
|
color: #737881;
|
||||||
display: block;
|
display: block;
|
||||||
width: 40px;
|
width: 10px;
|
||||||
height: 40px;
|
height: 10px;
|
||||||
-webkit-background-clip: padding-box;
|
-webkit-background-clip: padding-box;
|
||||||
-moz-background-clip: padding;
|
-moz-background-clip: padding;
|
||||||
background-clip: padding-box;
|
background-clip: padding-box;
|
||||||
@ -89,17 +77,41 @@ float: right;*/
|
|||||||
-moz-border-radius: 20px;
|
-moz-border-radius: 20px;
|
||||||
border-radius: 20px;
|
border-radius: 20px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
-moz-box-shadow: 0 0 0 5px #f5f5f6;
|
-moz-box-shadow: 0 0 0 2px #f5f5f6;
|
||||||
-webkit-box-shadow: 0 0 0 5px #f5f5f6;
|
-webkit-box-shadow: 0 0 0 2px #f5f5f6;
|
||||||
box-shadow: 0 0 0 5px #f5f5f6;
|
box-shadow: 0 0 0 2px #f5f5f6;
|
||||||
line-height: 40px;
|
line-height: 30px;
|
||||||
font-size: 15px;
|
|
||||||
float: left;
|
float: left;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.timeline-centered .timeline-entry .timeline-entry-inner .timeline-icon.bg-primary {
|
||||||
|
background-color: #303641;
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.timeline-centered .timeline-entry .timeline-entry-inner .timeline-icon.bg-secondary {
|
||||||
|
background-color: #ee4749;
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.timeline-centered .timeline-entry .timeline-entry-inner .timeline-icon.bg-success {
|
||||||
|
background-color: #98d85b;
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.timeline-centered .timeline-entry .timeline-entry-inner .timeline-icon.bg-info {
|
||||||
|
background-color: #21a9e1;
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
.timeline-centered .timeline-entry .timeline-entry-inner .timeline-icon.bg-warning {
|
.timeline-centered .timeline-entry .timeline-entry-inner .timeline-icon.bg-warning {
|
||||||
background-color: #fad839;
|
background-color: #ffa00a;
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.timeline-centered .timeline-entry .timeline-entry-inner .timeline-icon.bg-danger {
|
||||||
|
background-color: #ff5858;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -108,7 +120,7 @@ float: right;*/
|
|||||||
position: relative;
|
position: relative;
|
||||||
background: #f5f5f6;
|
background: #f5f5f6;
|
||||||
padding: 1em;
|
padding: 1em;
|
||||||
margin-left: 60px;
|
margin-left: 40px;
|
||||||
-webkit-background-clip: padding-box;
|
-webkit-background-clip: padding-box;
|
||||||
-moz-background-clip: padding;
|
-moz-background-clip: padding;
|
||||||
background-clip: padding-box;
|
background-clip: padding-box;
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
<div class='row project-item'>
|
<div class='row project-item'>
|
||||||
<div class='col-xs-9'>
|
<div class='col-xs-9'>
|
||||||
<a class="no-decoration" href="/issues-view?name={{ issue.name}}">
|
<a class="no-decoration" href="/issues-view?name={{ issue.name}}">
|
||||||
<span class="indicator {{ "green" if issue.status=="Open" else "darkgrey" }}">
|
<span class="indicator {{ "red" if issue.status=="Open" else "green" }}">
|
||||||
{% if issue.status == "Closed" %}
|
{% if issue.status == "Closed" %}
|
||||||
{{ issue.subject }} resolved {{ frappe.utils.pretty_date(issue.resolution_date) }}
|
{{ issue.subject }} resolved {{ frappe.utils.pretty_date(issue.resolution_date) }}
|
||||||
{% else %}
|
{% else %}
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
<div class='row project-item'>
|
<div class='row project-item'>
|
||||||
<div class='col-xs-9'>
|
<div class='col-xs-9'>
|
||||||
<a class="no-decoration" href="/tasks-view?name={{ task.name}}">
|
<a class="no-decoration" href="/tasks-view?name={{ task.name}}">
|
||||||
<span class="indicator {{ "green" if task.status=="Open" else "darkgrey" }}">
|
<span class="indicator {{ "orange" if task.status=="Open" else "green" }}">
|
||||||
{% if task.status == "Closed" %}
|
{% if task.status == "Closed" %}
|
||||||
{{ task.subject }} completed on {{ task.closing_date }}
|
{{ task.subject }} completed on {{ task.closing_date }}
|
||||||
{% else %}
|
{% else %}
|
||||||
|
|||||||
@ -1,31 +1,8 @@
|
|||||||
{% for timeline in doc.timelines %}
|
{% for timeline in doc.timelines %}
|
||||||
<div class='timeline'>
|
|
||||||
<div class="row project-item">
|
|
||||||
<div class="col-xs-12">
|
|
||||||
<span class="avatar avatar-small" title="{{ timeline.modified_by }}"> <img src="{{ timeline.user_image }}"></span>
|
|
||||||
<span class='indicator'>
|
|
||||||
{{timeline.reference_name}} {{timeline.subject }}
|
|
||||||
</span>
|
|
||||||
<span class='indicator pull-right'>
|
|
||||||
{{ frappe.utils.pretty_date(timeline.creation) }}
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{% endfor %}
|
|
||||||
<!-- <div class="timeline-centered">
|
|
||||||
{% for timeline in doc.timelines %}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<article class="timeline-entry">
|
<article class="timeline-entry">
|
||||||
|
|
||||||
<div class="timeline-entry-inner">
|
<div class="timeline-entry-inner">
|
||||||
|
<div class="timeline-icon {{ "bg-danger" if ((timeline.reference_name).startswith('ISS') and (timeline.subject).startswith('Open')) else "bg-warning" if ((timeline.reference_name).startswith('TASK') and (timeline.subject).startswith('Open')) else "bg-success" if (timeline.subject).startswith('Closed') else "bg-info"}}">
|
||||||
<div class="timeline-icon bg-warning">
|
|
||||||
<i class="entypo-camera"></i>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="timeline-label">
|
<div class="timeline-label">
|
||||||
<span class="avatar avatar-small" title="{{ timeline.modified_by }}"> <img src="{{ timeline.user_image }}"></span>
|
<span class="avatar avatar-small" title="{{ timeline.modified_by }}"> <img src="{{ timeline.user_image }}"></span>
|
||||||
<span class='indicator'>
|
<span class='indicator'>
|
||||||
@ -36,9 +13,5 @@
|
|||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</article>
|
</article>
|
||||||
|
|
||||||
|
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div> -->
|
|
||||||
@ -2,6 +2,17 @@
|
|||||||
|
|
||||||
{% block title %}{{ doc.project_name }}{% endblock %}
|
{% block title %}{{ doc.project_name }}{% endblock %}
|
||||||
|
|
||||||
|
{% block breadcrumbs %}
|
||||||
|
<div class="page-breadcrumbs" data-html-block="breadcrumbs">
|
||||||
|
<ul class="breadcrumb">
|
||||||
|
<li>
|
||||||
|
<span class="icon icon-angle-left"></span>
|
||||||
|
<a href="/project">Projects</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
{% block header %}
|
{% block header %}
|
||||||
<h1 class= "title">
|
<h1 class= "title">
|
||||||
{{ doc.project_name }}
|
{{ doc.project_name }}
|
||||||
@ -24,7 +35,7 @@
|
|||||||
Filtered by "{{ frappe.form_dict.q }}" Clear</a></p>
|
Filtered by "{{ frappe.form_dict.q }}" Clear</a></p>
|
||||||
{% else %}
|
{% else %}
|
||||||
<h3>{{ _("Activity Feed") }}</h3>
|
<h3>{{ _("Activity Feed") }}</h3>
|
||||||
<div class='project-timeline'>
|
<div class='project-timelines timeline-centered'>
|
||||||
{% include "erpnext/templates/includes/projects/timeline.html" %}
|
{% include "erpnext/templates/includes/projects/timeline.html" %}
|
||||||
</div>
|
</div>
|
||||||
{% if doc.timelines|length > 9 %}
|
{% if doc.timelines|length > 9 %}
|
||||||
@ -40,7 +51,7 @@
|
|||||||
<h3>{{ _("Tasks") }}</h3>
|
<h3>{{ _("Tasks") }}</h3>
|
||||||
</div>
|
</div>
|
||||||
<div class="btn-group btn-toggle">
|
<div class="btn-group btn-toggle">
|
||||||
<button class="btn btn-xs btn-open-tasks btn-primary active" style="float:left;">Open</button>
|
<button class="btn btn-xs btn-open-tasks" style="float:left;">Open</button>
|
||||||
<button class="btn btn-xs btn-closed-tasks">Close</button>
|
<button class="btn btn-xs btn-closed-tasks">Close</button>
|
||||||
</div>
|
</div>
|
||||||
<div class='project-tasks'>
|
<div class='project-tasks'>
|
||||||
|
|||||||
@ -1,194 +1,110 @@
|
|||||||
frappe.ready(function() {
|
frappe.ready(function() {
|
||||||
var reload_tasks = function(taskstatus) {
|
$( window ).load(function() {
|
||||||
$.ajax({
|
$(".btn-open-tasks").click();
|
||||||
method: "GET",
|
$(".btn-open-issues").click();
|
||||||
url: "/",
|
|
||||||
dataType: "json",
|
|
||||||
data: {
|
|
||||||
cmd: "erpnext.templates.pages.projects.get_tasks_html",
|
|
||||||
project: '{{ doc.name }}',
|
|
||||||
taskstatus: taskstatus,
|
|
||||||
},
|
|
||||||
dataType: "json",
|
|
||||||
success: function(data) {
|
|
||||||
$('.project-tasks').html(data.message);
|
|
||||||
|
|
||||||
$('.project-tasks-section .btn-group .btn-primary').removeClass('btn-primary');
|
|
||||||
$('.btn-'+ taskstatus +'-tasks').addClass( "btn-primary" );
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
$('.btn-closed-tasks').click(function() {
|
$('.btn-closed-tasks').click(function() {
|
||||||
reload_tasks('closed');
|
reload_items('closed','tasks');
|
||||||
});
|
});
|
||||||
|
|
||||||
$('.btn-open-tasks').click(function() {
|
$('.btn-open-tasks').click(function() {
|
||||||
reload_tasks('open');
|
reload_items('open','tasks');
|
||||||
});
|
});
|
||||||
|
|
||||||
var reload_issues = function(issuestatus) {
|
|
||||||
$.ajax({
|
|
||||||
method: "GET",
|
|
||||||
url: "/",
|
|
||||||
dataType: "json",
|
|
||||||
data: {
|
|
||||||
cmd: "erpnext.templates.pages.projects.get_issues_html",
|
|
||||||
project: '{{ doc.name }}',
|
|
||||||
issuestatus: issuestatus,
|
|
||||||
},
|
|
||||||
dataType: "json",
|
|
||||||
success: function(data) {
|
|
||||||
$('.project-issues').html(data.message);
|
|
||||||
|
|
||||||
$('.project-issues-section .btn-group .btn-primary').removeClass('btn-primary');
|
|
||||||
$('.btn-'+ issuestatus +'-issues').addClass( "btn-primary" );
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
$('.btn-closed-issues').click(function() {
|
$('.btn-closed-issues').click(function() {
|
||||||
reload_issues('closed');
|
reload_items('closed','issues');
|
||||||
});
|
});
|
||||||
|
|
||||||
$('.btn-open-issues').click(function() {
|
$('.btn-open-issues').click(function() {
|
||||||
reload_issues('open');
|
reload_items('open','issues');
|
||||||
});
|
});
|
||||||
|
|
||||||
var taskstart = 5;
|
var start = 10;
|
||||||
$(".more-tasks").click(function() {
|
$(".more-tasks").click(function() {
|
||||||
var task_status = $('.project-tasks-section .btn-group .btn-primary').hasClass('btn-closed-tasks')
|
more_items('tasks', true);
|
||||||
? 'closed' : 'open';
|
|
||||||
|
|
||||||
$.ajax({
|
|
||||||
method: "GET",
|
|
||||||
url: "/",
|
|
||||||
dataType: "json",
|
|
||||||
data: {
|
|
||||||
cmd: "erpnext.templates.pages.projects.get_tasks_html",
|
|
||||||
project: '{{ doc.name }}',
|
|
||||||
start: taskstart,
|
|
||||||
taskstatus: task_status,
|
|
||||||
},
|
|
||||||
dataType: "json",
|
|
||||||
success: function(data) {
|
|
||||||
$(data.message).appendTo('.project-tasks');
|
|
||||||
if(typeof data.message == 'undefined') {
|
|
||||||
$(".more-tasks").toggle(false);
|
|
||||||
}
|
|
||||||
taskstart = taskstart+5;
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
var issuestart = 2;
|
|
||||||
$(".more-issues").click(function() {
|
$(".more-issues").click(function() {
|
||||||
var issue_status = $('.project-issues-section .btn-group .btn-primary').hasClass('btn-closed-issues')
|
more_items('issues', true);
|
||||||
? 'closed' : 'open';
|
|
||||||
|
|
||||||
$.ajax({
|
|
||||||
method: "GET",
|
|
||||||
url: "/",
|
|
||||||
dataType: "json",
|
|
||||||
data: {
|
|
||||||
cmd: "erpnext.templates.pages.projects.get_issues_html",
|
|
||||||
project: '{{ doc.name }}',
|
|
||||||
start: issuestart,
|
|
||||||
issuestatus: issue_status,
|
|
||||||
},
|
|
||||||
dataType: "json",
|
|
||||||
success: function(data) {
|
|
||||||
$(data.message).appendTo('.project-issues');
|
|
||||||
if(typeof data.message == 'undefined')
|
|
||||||
{
|
|
||||||
$(".more-issues").toggle(false);
|
|
||||||
}
|
|
||||||
issuestart = issuestart+5;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
var timelogstart = 2;
|
|
||||||
$(".more-timelogs").click(function() {
|
$(".more-timelogs").click(function() {
|
||||||
$.ajax({
|
more_items('timelogs', false);
|
||||||
method: "GET",
|
|
||||||
url: "/",
|
|
||||||
dataType: "json",
|
|
||||||
data: {
|
|
||||||
cmd: "erpnext.templates.pages.projects.get_timelogs_html",
|
|
||||||
project: '{{ doc.name }}',
|
|
||||||
start: timelogstart,
|
|
||||||
},
|
|
||||||
dataType: "json",
|
|
||||||
success: function(data) {
|
|
||||||
$(data.message).appendTo('.project-timelogs');
|
|
||||||
if(typeof data.message == 'undefined')
|
|
||||||
{
|
|
||||||
$(".more-timelogs").toggle(false);
|
|
||||||
}
|
|
||||||
timelogstart = timelogstart+2;
|
|
||||||
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
var timelinestart = 10;
|
|
||||||
$(".more-timelines").click(function() {
|
$(".more-timelines").click(function() {
|
||||||
$.ajax({
|
more_items('timelines', false);
|
||||||
method: "GET",
|
|
||||||
url: "/",
|
|
||||||
dataType: "json",
|
|
||||||
data: {
|
|
||||||
cmd: "erpnext.templates.pages.projects.get_timeline_html",
|
|
||||||
project: '{{ doc.name }}',
|
|
||||||
start: timelinestart,
|
|
||||||
|
|
||||||
},
|
|
||||||
dataType: "json",
|
|
||||||
success: function(data) {
|
|
||||||
$(data.message).appendTo('.project-timeline');
|
|
||||||
if(typeof data.message == 'undefined')
|
|
||||||
{
|
|
||||||
$(".more-timelines").toggle(false);
|
|
||||||
}
|
|
||||||
timelinestart = timelinestart+10;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
$( ".project-tasks" ).on('click', '.task-x', function() {
|
$( ".project-tasks" ).on('click', '.task-x', function() {
|
||||||
var args = {
|
var item_name = $(this).attr('id');
|
||||||
project: '{{ doc.name }}',
|
close_item('task', item_name);
|
||||||
task_name: $(this).attr('id'),
|
|
||||||
}
|
|
||||||
frappe.call({
|
|
||||||
btn: this,
|
|
||||||
type: "POST",
|
|
||||||
method: "erpnext.templates.pages.projects.set_task_status",
|
|
||||||
args: args,
|
|
||||||
callback: function(r) {
|
|
||||||
if(r.exc) {
|
|
||||||
if(r._server_messages)
|
|
||||||
frappe.msgprint(r._server_messages);
|
|
||||||
} else {
|
|
||||||
$(this).remove();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
return false;
|
|
||||||
});
|
});
|
||||||
|
|
||||||
$( ".project-issues" ).on('click', '.issue-x', function() {
|
$( ".project-issues" ).on('click', '.issue-x', function() {
|
||||||
|
var item_name = $(this).attr('id');
|
||||||
|
close_item('issue', item_name);
|
||||||
|
});
|
||||||
|
|
||||||
|
var reload_items = function(item_status, item) {
|
||||||
|
$.ajax({
|
||||||
|
method: "GET",
|
||||||
|
url: "/",
|
||||||
|
dataType: "json",
|
||||||
|
data: {
|
||||||
|
cmd: "erpnext.templates.pages.projects.get_"+ item +"_html",
|
||||||
|
project: '{{ doc.name }}',
|
||||||
|
item_status: item_status,
|
||||||
|
},
|
||||||
|
dataType: "json",
|
||||||
|
success: function(data) {
|
||||||
|
$('.project-'+ item).html(data.message);
|
||||||
|
|
||||||
|
$('.project-'+ item +'-section .btn-group .btn-primary').removeClass('btn-primary');
|
||||||
|
$('.btn-'+ item_status +'-'+ item).addClass( "btn-primary" );
|
||||||
|
$(".more-"+ item).toggle(true);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
var more_items = function(item, item_status){
|
||||||
|
if(item_status)
|
||||||
|
{
|
||||||
|
var item_status = $('.project-'+ item +'-section .btn-group .btn-primary').hasClass('btn-closed-'+ item)
|
||||||
|
? 'closed' : 'open';
|
||||||
|
}
|
||||||
|
$.ajax({
|
||||||
|
method: "GET",
|
||||||
|
url: "/",
|
||||||
|
dataType: "json",
|
||||||
|
data: {
|
||||||
|
cmd: "erpnext.templates.pages.projects.get_"+ item +"_html",
|
||||||
|
project: '{{ doc.name }}',
|
||||||
|
start: start,
|
||||||
|
item_status: item_status,
|
||||||
|
},
|
||||||
|
dataType: "json",
|
||||||
|
success: function(data) {
|
||||||
|
$(data.message).appendTo('.project-'+ item);
|
||||||
|
if(typeof data.message == 'undefined') {
|
||||||
|
$(".more-"+ item).toggle(false);
|
||||||
|
}
|
||||||
|
start = start+10;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
var close_item = function(item, item_name){
|
||||||
var args = {
|
var args = {
|
||||||
project: '{{ doc.name }}',
|
project: '{{ doc.name }}',
|
||||||
issue_name: $(this).attr('id'),
|
item_name: item_name,
|
||||||
}
|
}
|
||||||
frappe.call({
|
frappe.call({
|
||||||
btn: this,
|
btn: this,
|
||||||
type: "POST",
|
type: "POST",
|
||||||
method: "erpnext.templates.pages.projects.set_issue_status",
|
method: "erpnext.templates.pages.projects.set_"+ item +"_status",
|
||||||
args: args,
|
args: args,
|
||||||
callback: function(r) {
|
callback: function(r) {
|
||||||
if(r.exc) {
|
if(r.exc) {
|
||||||
@ -200,5 +116,5 @@ frappe.ready(function() {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
return false;
|
return false;
|
||||||
});
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@ -32,16 +32,20 @@ def get_context(context):
|
|||||||
def get_timeline(project, start=10):
|
def get_timeline(project, start=10):
|
||||||
issue_names = '({0})'.format(", ".join(["'{0}'".format(i.name) for i in get_issues(project)]))
|
issue_names = '({0})'.format(", ".join(["'{0}'".format(i.name) for i in get_issues(project)]))
|
||||||
|
|
||||||
print issue_names
|
|
||||||
|
|
||||||
timelines = frappe.db.sql("""select sender_full_name,
|
timelines = frappe.db.sql("""
|
||||||
|
select
|
||||||
|
sender_full_name,
|
||||||
subject, communication_date, comment_type, name, creation, modified_by, reference_doctype, reference_name,
|
subject, communication_date, comment_type, name, creation, modified_by, reference_doctype, reference_name,
|
||||||
_liked_by, comment_type, _comments
|
_liked_by, comment_type, _comments
|
||||||
from tabCommunication
|
from
|
||||||
where (reference_doctype='Project' and reference_name=%s)
|
tabCommunication
|
||||||
|
where
|
||||||
|
(reference_doctype='Project' and reference_name=%s)
|
||||||
or (timeline_doctype='Project' and timeline_name=%s)
|
or (timeline_doctype='Project' and timeline_name=%s)
|
||||||
or (reference_doctype='Issue' and reference_name IN {issue_names})
|
or (reference_doctype='Issue' and reference_name IN {issue_names})
|
||||||
order by modified DESC limit {start}, {limit}""".format(
|
order by
|
||||||
|
modified DESC limit {start}, {limit}""".format(
|
||||||
issue_names=issue_names, start=start, limit=10),
|
issue_names=issue_names, start=start, limit=10),
|
||||||
(project, project), as_dict=True);
|
(project, project), as_dict=True);
|
||||||
for timeline in timelines:
|
for timeline in timelines:
|
||||||
@ -49,22 +53,22 @@ def get_timeline(project, start=10):
|
|||||||
return timelines
|
return timelines
|
||||||
|
|
||||||
@frappe.whitelist()
|
@frappe.whitelist()
|
||||||
def get_timeline_html(project, start=0):
|
def get_timelines_html(project, start=0):
|
||||||
return frappe.render_template("erpnext/templates/includes/projects/timeline.html",
|
return frappe.render_template("erpnext/templates/includes/projects/timeline.html",
|
||||||
{"doc": {"timelines": get_timeline(project, start)}}, is_path=True)
|
{"doc": {"timelines": get_timeline(project, start)}}, is_path=True)
|
||||||
|
|
||||||
def get_issue_list(project):
|
def get_issue_list(project):
|
||||||
return [issue.name for issue in get_issues(project)]
|
return [issue.name for issue in get_issues(project)]
|
||||||
|
|
||||||
def get_tasks(project, start=0, search=None, taskstatus=None):
|
def get_tasks(project, start=0, search=None, item_status=None):
|
||||||
filters = {"project": project}
|
filters = {"project": project}
|
||||||
if search:
|
if search:
|
||||||
filters["subject"] = ("like", "%{0}%".format(search))
|
filters["subject"] = ("like", "%{0}%".format(search))
|
||||||
if taskstatus:
|
if item_status:
|
||||||
filters = {"status": taskstatus}
|
filters = {"status": item_status}
|
||||||
tasks = frappe.get_all("Task", filters=filters,
|
tasks = frappe.get_all("Task", filters=filters,
|
||||||
fields=["name", "subject", "status", "exp_start_date", "exp_end_date", "priority"],
|
fields=["name", "subject", "status", "exp_start_date", "exp_end_date", "priority"],
|
||||||
limit_start=start, limit_page_length=5)
|
limit_start=start, limit_page_length=10)
|
||||||
|
|
||||||
for task in tasks:
|
for task in tasks:
|
||||||
task.todo = frappe.get_all('ToDo',filters={'reference_name':task.name, 'reference_type':'Task'},
|
task.todo = frappe.get_all('ToDo',filters={'reference_name':task.name, 'reference_type':'Task'},
|
||||||
@ -76,22 +80,21 @@ def get_tasks(project, start=0, search=None, taskstatus=None):
|
|||||||
return tasks
|
return tasks
|
||||||
|
|
||||||
@frappe.whitelist()
|
@frappe.whitelist()
|
||||||
def get_tasks_html(project, start=0, taskstatus=None):
|
def get_tasks_html(project, start=0, item_status=None):
|
||||||
return frappe.render_template("erpnext/templates/includes/projects/project_tasks.html",
|
return frappe.render_template("erpnext/templates/includes/projects/project_tasks.html",
|
||||||
{"doc": {"tasks": get_tasks(project, start, taskstatus=taskstatus)}}, is_path=True)
|
{"doc": {"tasks": get_tasks(project, start, item_status=item_status)}}, is_path=True)
|
||||||
|
|
||||||
|
|
||||||
def get_issues(project, start=0, search=None, issuestatus=None):
|
def get_issues(project, start=0, search=None, item_status=None):
|
||||||
print issuestatus
|
|
||||||
filters = {"project": project}
|
filters = {"project": project}
|
||||||
if search:
|
if search:
|
||||||
filters["subject"] = ("like", "%{0}%".format(search))
|
filters["subject"] = ("like", "%{0}%".format(search))
|
||||||
if issuestatus:
|
if item_status:
|
||||||
filters = {"status": issuestatus}
|
filters = {"status": item_status}
|
||||||
issues = frappe.get_all("Issue", filters=filters,
|
issues = frappe.get_all("Issue", filters=filters,
|
||||||
fields=["name", "subject", "status", "opening_date", "resolution_date", "resolution_details"],
|
fields=["name", "subject", "status", "opening_date", "resolution_date", "resolution_details"],
|
||||||
order_by='modified desc',
|
order_by='modified desc',
|
||||||
limit_start=start, limit_page_length=5)
|
limit_start=start, limit_page_length=10)
|
||||||
|
|
||||||
for issue in issues:
|
for issue in issues:
|
||||||
issue.todo = frappe.get_all('ToDo',filters={'reference_name':issue.name, 'reference_type':'Issue'},
|
issue.todo = frappe.get_all('ToDo',filters={'reference_name':issue.name, 'reference_type':'Issue'},
|
||||||
@ -103,10 +106,9 @@ def get_issues(project, start=0, search=None, issuestatus=None):
|
|||||||
return issues
|
return issues
|
||||||
|
|
||||||
@frappe.whitelist()
|
@frappe.whitelist()
|
||||||
def get_issues_html(project, start=0, issuestatus=None):
|
def get_issues_html(project, start=0, item_status=None):
|
||||||
print issuestatus
|
|
||||||
return frappe.render_template("erpnext/templates/includes/projects/project_issues.html",
|
return frappe.render_template("erpnext/templates/includes/projects/project_issues.html",
|
||||||
{"doc": {"issues": get_issues(project, start, issuestatus=issuestatus)}}, is_path=True)
|
{"doc": {"issues": get_issues(project, start, item_status=item_status)}}, is_path=True)
|
||||||
|
|
||||||
def get_timelogs(project, start=0, search=None):
|
def get_timelogs(project, start=0, search=None):
|
||||||
filters = {"project": project}
|
filters = {"project": project}
|
||||||
@ -115,7 +117,7 @@ def get_timelogs(project, start=0, search=None):
|
|||||||
|
|
||||||
timelogs = frappe.get_all('Time Log', filters=filters,
|
timelogs = frappe.get_all('Time Log', filters=filters,
|
||||||
fields=['name','title','task','activity_type','from_time','to_time','hours','status','modified','modified_by'],
|
fields=['name','title','task','activity_type','from_time','to_time','hours','status','modified','modified_by'],
|
||||||
limit_start=start, limit_page_length=2)
|
limit_start=start, limit_page_length=10)
|
||||||
for timelog in timelogs:
|
for timelog in timelogs:
|
||||||
timelog.user_image = frappe.db.get_value('User', timelog.modified_by, 'user_image')
|
timelog.user_image = frappe.db.get_value('User', timelog.modified_by, 'user_image')
|
||||||
return timelogs
|
return timelogs
|
||||||
@ -126,14 +128,14 @@ def get_timelogs_html(project, start=0):
|
|||||||
{"doc": {"timelogs": get_timelogs(project, start)}}, is_path=True)
|
{"doc": {"timelogs": get_timelogs(project, start)}}, is_path=True)
|
||||||
|
|
||||||
@frappe.whitelist()
|
@frappe.whitelist()
|
||||||
def set_task_status(project, task_name):
|
def set_task_status(project, item_name):
|
||||||
task = frappe.get_doc("Task", task_name)
|
task = frappe.get_doc("Task", item_name)
|
||||||
task.status = 'Closed'
|
task.status = 'Closed'
|
||||||
task.save(ignore_permissions=True)
|
task.save(ignore_permissions=True)
|
||||||
|
|
||||||
@frappe.whitelist()
|
@frappe.whitelist()
|
||||||
def set_issue_status(project, issue_name):
|
def set_issue_status(project, item_name):
|
||||||
issue = frappe.get_doc("Issue", issue_name)
|
issue = frappe.get_doc("Issue", item_name)
|
||||||
issue.status = 'Closed'
|
issue.status = 'Closed'
|
||||||
issue.save(ignore_permissions=True)
|
issue.save(ignore_permissions=True)
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user