2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-12 16:46:35 +00:00

98_todoist: better move to other project in widget

git-svn-id: https://svn.fhem.de/fhem/trunk@20970 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
marvin78 2020-01-14 10:33:12 +00:00
parent 3dce8d1c7c
commit 8ff0b19927
3 changed files with 11 additions and 7 deletions

View File

@ -1,6 +1,7 @@
# Add changes at the top of the list. Keep it in ASCII, and 80-char wide.
# Do not insert empty lines here, update check depends on it.
- change: 98_todoist: removed Attribute "sortTasks" / better commandref
better move in widget (not delete and add)
- change: 93_DbLog: change datetime pattern in valueFn of addCacheLine
Forum: #107285
- change: 98_todoist: reorder tasks - widget reorder

View File

@ -17,7 +17,7 @@ eval "use Date::Parse;1" or $missingModule .= "Date::Parse ";
#######################
# Global variables
my $version = "1.3.1";
my $version = "1.3.2";
my $srandUsed;
@ -2136,14 +2136,14 @@ sub todoist_Html(;$$$) {
$ret .= "<tr class=\"devTypeTr\">\n".
" <td colspan=\"3\">\n".
" <div class=\"todoist_devType todoist_devType_".$name." col_header\">\n".
" <div class=\"todoist_devType todoist_devType_".$name." col_header\" data-id=\"".$hash->{PID}."\">\n".
(!$FW_hiddenroom{detail}?"<a title=\"".$todoist_tt->{'gotodetail'}."\" href=\"/fhem?detail=".$name."\">":"").
AttrVal($name,"alias",$name).
(!$FW_hiddenroom{detail}?"</a>":"").
" </div>\n".
" </td>\n".
"</tr>\n";
$ret .= "<tr><td colspan=\"3\"><table class=\"block wide sortable\" id=\"todoistTable_".$name."\">\n";
$ret .= "<tr><td colspan=\"3\"><table class=\"block wide sortable\" id=\"todoistTable_".$name."\" data-project-name=\"".$name."\" data-project-id=\"".$hash->{PID}."\">\n";
}
@ -2166,7 +2166,7 @@ sub todoist_Html(;$$$) {
$ret .= "<tr id=\"".$name."_".$_."\" data-data=\"true\" data-line-id=\"".$_."\" class=\"sortit todoist_data ".$eo."\">\n".
$ret .= "<tr id=\"".$name."_".$_."\" data-data=\"true\" data-project-name=\"".$name."\" data-project-id=\"".$hash->{PID}."\" data-line-id=\"".$_."\" class=\"sortit todoist_data ".$eo."\">\n".
" <td class=\"col1 todoist_col1\">\n".
" <div class=\"todoist_move\"></div>\n".
" <input title=\"".$todoist_tt->{'check'}."\" class=\"todoist_checkbox_".$name."\" type=\"checkbox\" id=\"check_".$_."\" data-id=\"".$_."\" />\n".
@ -2333,12 +2333,13 @@ sub todoist_genUUID() {
<code>set &lt;DEVICE&gt; updateTask ID:12345678 dueDate=2017-01-15 priority=1</code><br />
<code>set &lt;DEVICE&gt; updateTask 1 dueDate=übermorgen</code><br />
<code>set &lt;DEVICE&gt; updateTask TITLE:Brot dueDate=übermorgen</code><br /><br /></li>
<li><b>moveTask</b> - move a task to another parent or project.
<li><b>moveTask</b> - move a task to another parent, section or project.
Expects Task-ID or todoist-Task-ID as parameter<br /><br />
Possible additional parameters are:<br />
<ul>
<li>parentID=todoist-ID of the new parent task.</li>
<li>projectID=todoist-ID of the receiving project.</li>
<li>sectionID=todoist-ID of the receiving section.</li>
</ul><br /><br /></li>
<li><b>completeTask</b> - completes a task. Needs number of task (reading 'Task_NUMBER'), the title (TITLE:&lt;TITLE&gt;) or the
todoist-Task-ID (ID:&lt;ID&gt;) as parameter<br /><br />

View File

@ -322,7 +322,7 @@ if (typeof todoist_checkVar === 'undefined') {
var nameHT = tid.split("_");
var lastVal = nameHT.pop(); // Get last element
var nameH = nameHT.join("_");
todoist_sendCommand('set ' + nameH + ' deleteTask ID:'+ id);
//todoist_sendCommand('set ' + nameH + ' deleteTask ID:'+ id);
},
over: function (event,ui) {
var width = ui.item.innerWidth();
@ -343,10 +343,12 @@ if (typeof todoist_checkVar === 'undefined') {
receive: function (event,ui) {
var parent = ui.item.parent().parent();
var id = ui.item.attr('data-line-id');
var nameF = ui.item.data('project-name');
var tid = parent.attr('id');
var nameR = tid.split(/_(.+)/)[1];
var pid = parent.data('project-id');
var value = ui.item.find('span').html();
todoist_sendCommand('set '+ nameR +' addTask ' + value);
todoist_sendCommand('set '+ nameF +' moveTask ID:' + id + ' projectID=' + pid);
ui.item.attr('data-remove','1');
}
}).disableSelection();