refresh panel

This commit is contained in:
yuri
2015-02-02 15:35:35 +02:00
parent 9207030ccb
commit c15fc89f52
10 changed files with 57 additions and 22 deletions

View File

@@ -57,8 +57,8 @@
"Unlinking...": "Unlinking...",
"Posting...": "Posting...",
"Username can not be empty!": "Username can not be empty!",
"Cache is not enabled": "Cache is not enabled",
"Cache has been cleared": "Cache has been cleared",
"Cache is not enabled": "Cache is not enabled",
"Cache has been cleared": "Cache has been cleared",
"Rebuild has been done": "Rebuild has been done",
"Saving...": "Saving...",
"Modified": "Modified",
@@ -167,7 +167,8 @@
"noRecordsUpdated": "No records were updated",
"massRemoveResult": "{count} records have been removed",
"massRemoveResultSingle": "{count} record has been removed",
"noRecordsRemoved": "No records were removed"
"noRecordsRemoved": "No records were removed",
"clickToRefresh": "Click to refresh"
},
"boolFilters": {
"onlyMy": "Only My",

View File

@@ -17,7 +17,7 @@
*
* You should have received a copy of the GNU General Public License
* along with EspoCRM. If not, see http://www.gnu.org/licenses/.
************************************************************************/
************************************************************************/
Espo.define('Crm:Views.Lead.Record.DetailSide', 'Views.Record.DetailSide', function (Dep) {
@@ -29,6 +29,7 @@ Espo.define('Crm:Views.Lead.Record.DetailSide', 'Views.Record.DetailSide', funct
name: 'convertedTo',
label: 'Converted To',
view: 'Record.Panels.Side',
notRefreshable: true,
options: {
fields: [],
mode: 'detail',

View File

@@ -287,6 +287,10 @@ Espo.define('Crm:Views.Record.Panels.Activities', 'Views.Record.Panels.Relations
});
},
actionRefresh: function () {
this.collection.fetch();
}
});
});

View File

@@ -116,7 +116,7 @@ Espo.define('Crm:Views.Record.Panels.Tasks', 'Views.Record.Panels.Relationship',
this.$el.find('.list-container').html(this.translate('No Access'));
this.$el.find('.button-container').remove();
return;
};
};
this.getCollectionFactory().create('Task', function (collection) {
this.collection = collection;
@@ -139,11 +139,11 @@ Espo.define('Crm:Views.Record.Panels.Tasks', 'Views.Record.Panels.Relationship',
}, function (view) {
view.render();
});
}.bind(this));
this.collection.fetch();
}.bind(this));
this.collection.fetch();
}, this);
},
actionCreateTask: function (data) {
var self = this;
var link = 'tasks';
@@ -166,7 +166,11 @@ Espo.define('Crm:Views.Record.Panels.Tasks', 'Views.Record.Panels.Relationship',
});
});
}.bind(this));
},
},
actionRefresh: function () {
this.collection.fetch();
}
});
});

View File

@@ -18,7 +18,15 @@
</ul>
{{/if}}
</div>
<h4 class="panel-title">{{title}}</h4>
<h4 class="panel-title">
{{#unless notRefreshable}}
<span style="cursor: pointer;" class="action" title="{{translate 'clickToRefresh' category='messages'}}" data-action="refresh" data-panel="{{name}}">
{{/unless}}
{{title}}
{{#unless notRefreshable}}
</span>
{{/unless}}
</h4>
</div>
<div class="panel-body panel-body-{{toDom name}}">
{{{var name ../this}}}

View File

@@ -14,7 +14,15 @@
</ul>
{{/if}}
</div>
<h4 class="panel-title">{{translate label scope=../../scope}}</h4>
<h4 class="panel-title">
{{#unless notRefreshable}}
<span style="cursor: pointer;" class="action" title="{{translate 'clickToRefresh' category='messages'}}" data-action="refresh" data-panel="{{name}}">
{{/unless}}
{{title}}
{{#unless notRefreshable}}
</span>
{{/unless}}
</h4>
</div>
{{/if}}
<div class="panel-body panel-body-{{name}}">

View File

@@ -98,6 +98,11 @@
if ('getActions' in view) {
p.actions = this.filterActions(view.getActions());
}
if (p.label) {
p.title = this.translate(p.label, 'labels', this.scope);
} else {
p.title = view.title;
}
}.bind(this));
}.bind(this));
},

View File

@@ -17,12 +17,12 @@
*
* You should have received a copy of the GNU General Public License
* along with EspoCRM. If not, see http://www.gnu.org/licenses/.
************************************************************************/
************************************************************************/
Espo.define('Views.Record.EditSide', 'Views.Record.DetailSide', function (Dep) {
return Dep.extend({
mode: 'edit',
panels: [
@@ -33,11 +33,11 @@ Espo.define('Views.Record.EditSide', 'Views.Record.DetailSide', function (Dep) {
options: {
fields: ['assignedUser', 'teams'],
mode: 'edit',
}
}
],
}
}
],
});
});
});

View File

@@ -134,6 +134,10 @@ Espo.define('Views.Record.Panels.Relationship', ['Views.Record.Panels.Bottom', '
return [];
},
actionRefresh: function () {
this.collection.fetch();
},
actionEditRelated: function (id) {
this.notify('Loading...');
this.createView('quickEdit', 'Modals.Edit', {

View File

@@ -17,7 +17,7 @@
*
* You should have received a copy of the GNU General Public License
* along with EspoCRM. If not, see http://www.gnu.org/licenses/.
************************************************************************/
************************************************************************/
Espo.define('Views.Record.Panels.Side', 'View', function (Dep) {
@@ -35,9 +35,9 @@ Espo.define('Views.Record.Panels.Side', 'View', function (Dep) {
},
mode: 'detail',
actions: null,
readOnly: false,
setup: function () {
@@ -49,7 +49,7 @@ Espo.define('Views.Record.Panels.Side', 'View', function (Dep) {
}
this.createFields();
},
getFieldList: function () {
var fields = [];
this.fields.forEach(function (item) {
@@ -107,7 +107,7 @@ Espo.define('Views.Record.Panels.Side', 'View', function (Dep) {
}, this);
return fields;
},
getActions: function () {
return this.actions || [];
},