Merge branch 'master' of https://github.com/ksjdragon/hourglass
This commit is contained in:
commit
bc3aa5ce81
@ -27,6 +27,7 @@ classes.schema = new SimpleSchema({
|
|||||||
});
|
});
|
||||||
|
|
||||||
work.schema = new SimpleSchema({
|
work.schema = new SimpleSchema({
|
||||||
|
name: {type: String},
|
||||||
class: {type: String},
|
class: {type: String},
|
||||||
dueDate: {type: Date},
|
dueDate: {type: Date},
|
||||||
aliases: {type: [String], optional: true},
|
aliases: {type: [String], optional: true},
|
||||||
|
|||||||
@ -66,12 +66,13 @@ Meteor.methods({
|
|||||||
found = Meteor.findOne({_id: input.class})
|
found = Meteor.findOne({_id: input.class})
|
||||||
if (Meteor.user() != null && found != null && found.subscribers.indexOf(Meteor.userId()) != -1
|
if (Meteor.user() != null && found != null && found.subscribers.indexOf(Meteor.userId()) != -1
|
||||||
&& found.banned.indexOf(Meteor.userId()) === -1 && found.blockEdit.indexOf(Meteor.userId()) === -1
|
&& found.banned.indexOf(Meteor.userId()) === -1 && found.blockEdit.indexOf(Meteor.userId()) === -1
|
||||||
&& input.dueDate.getTime() >= ref && worktype.indexOf(type) != -1) {
|
&& input.dueDate.getTime() >= ref && worktype.indexOf(type) != -1 && input.name.length <= 50) {
|
||||||
input.submittor = Meteor.userId();
|
input.submittor = Meteor.userId();
|
||||||
input.confirmations = [Meteor.userId()];
|
input.confirmations = [Meteor.userId()];
|
||||||
input.reports = [];
|
input.reports = [];
|
||||||
input.done = [];
|
input.done = [];
|
||||||
input.numberdone = 0;
|
input.numberdone = 0;
|
||||||
|
work.insert(input);
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user