Merge branch 'master' of https://github.com/ksjdragon/hourglass
This commit is contained in:
commit
83214bec01
@ -29,8 +29,9 @@ work.schema = new SimpleSchema({
|
|||||||
name: {type: String},
|
name: {type: String},
|
||||||
class: {type: String},
|
class: {type: String},
|
||||||
dueDate: {type: Date},
|
dueDate: {type: Date},
|
||||||
|
description: {type: String},
|
||||||
creator: {type: String},
|
creator: {type: String},
|
||||||
comments: {type: [String]},
|
comments: {type: [String], optional: true},
|
||||||
confirmations: {type: [String], optional: true},
|
confirmations: {type: [String], optional: true},
|
||||||
reports: {type: [String], optional: true},
|
reports: {type: [String], optional: true},
|
||||||
attachments: {type: [String], optional: true},
|
attachments: {type: [String], optional: true},
|
||||||
|
|||||||
@ -163,13 +163,13 @@ Meteor.methods({
|
|||||||
var ref = new Date().getTime();
|
var ref = new Date().getTime();
|
||||||
input.creator = Meteor.userId();
|
input.creator = Meteor.userId();
|
||||||
work.schema.validate(input);
|
work.schema.validate(input);
|
||||||
var found = Meteor.findOne({
|
var found = classes.findOne({
|
||||||
_id: input.class
|
_id: input.class
|
||||||
});
|
});
|
||||||
|
console.log(input);
|
||||||
if (Meteor.user() !== null &&
|
if (Meteor.user() !== null &&
|
||||||
found !== null &&
|
found !== null &&
|
||||||
found.subscribers.indexOf(Meteor.userId()) != -1 &&
|
Meteor.user().profile.classes.indexOf(input.class) !== -1 &&
|
||||||
found.banned.indexOf(Meteor.userId()) === -1 &&
|
found.banned.indexOf(Meteor.userId()) === -1 &&
|
||||||
found.blockEdit.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 &&
|
||||||
@ -180,6 +180,7 @@ Meteor.methods({
|
|||||||
input.done = [];
|
input.done = [];
|
||||||
input.numberdone = 0;
|
input.numberdone = 0;
|
||||||
input.comments = [];
|
input.comments = [];
|
||||||
|
console.log(input);
|
||||||
work.insert(input);
|
work.insert(input);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -207,6 +208,7 @@ Meteor.methods({
|
|||||||
$set: {
|
$set: {
|
||||||
name: change.name,
|
name: change.name,
|
||||||
dueDate: change.dueDate,
|
dueDate: change.dueDate,
|
||||||
|
description: change.description,
|
||||||
comments: change.comments,
|
comments: change.comments,
|
||||||
attachments: change.attachments,
|
attachments: change.attachments,
|
||||||
type: change.type,
|
type: change.type,
|
||||||
@ -224,6 +226,7 @@ Meteor.methods({
|
|||||||
$set: {
|
$set: {
|
||||||
name: change.name,
|
name: change.name,
|
||||||
dueDate: change.dueDate,
|
dueDate: change.dueDate,
|
||||||
|
description: change.description,
|
||||||
attachments: change.attachments,
|
attachments: change.attachments,
|
||||||
type: change.type
|
type: change.type
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user