evrenvarol / outlook-taskboard

Kanban Board for Microsoft Outlook Tasks
MIT License
205 stars 76 forks source link

taskStatus() is broken. Here's a fix... #61

Open mwherman2000 opened 3 years ago

mwherman2000 commented 3 years ago

I know I should be reporting this as a pull request but I've made too many other changes...

kanban.html

    var taskStatus = function (str) {
        **return str;**
            //str = str.replace(/(?:\r\n|\r|\n)/g, '<br>');
            //if ( str.match(/### STATUS:([\s\S]*?)###/) ) {
            //    var statmatch = str.match(/### STATUS:([\s\S]*?)###/);
            //    // remove empty lines
            //    str = statmatch[1].replace(/^(?=\n)$|^\s*|\s*$|\n\n+/gm, '');
            //    // replace line breaks with html breaks
            //    str = str.replace(/(?:\r\n|\r|\n)/g, '<br>');
            //    // remove multiple html breaks
            //    str = str.replace('<br><br>', '<br>');
            // } else { str = ''; }
            //return str;
    };

app.js

    var getTasksFromOutlook = function (path, restrict, sort, owner) {
            var i, array = [];
            // default restriction is to get only incomplete tasks
            if (restrict === undefined) { restrict = "[Complete] = false"; }

            **var tasks;
            if (restrict === "")
            {
                tasks = getOutlookFolder(path, owner).Items;
            }
            else
            {
                tasks = getOutlookFolder(path, owner).Items.Restrict(restrict);
            }**

            var count = tasks.Count;
            for (i = 1; i <= count; i++) {
                array.push({
                    entryID: tasks(i).EntryID,
                    subject: tasks(i).Subject,
                    priority: tasks(i).Importance,
                    startdate: tasks(i).StartDate,
                    duedate: new Date(tasks(i).DueDate),
                    sensitivity: tasks(i).Sensitivity,
                    categories: tasks(i).Categories,
                    notes: taskExcerpt(tasks(i).Body, GENERAL_CONFIG.TASKNOTE_EXCERPT),
                    **status: taskStatus(tasks(i).Status)**,
                    oneNoteTaskID: getUserProp(tasks(i), "OneNoteTaskID"),
                    oneNoteURL: getUserProp(tasks(i), "OneNoteURL")
                });
            };
...
McLion-Himself commented 4 months ago

... and unfortunately I do not manage to apply this patch. Would be nice to have status updated.