mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-03-03 10:46:53 +00:00
98_todoist: user information in FHEMWEB widget
git-svn-id: https://svn.fhem.de/fhem/trunk@21042 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
4871e2c57d
commit
ecf3022abd
@ -1,5 +1,6 @@
|
||||
# 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: user information in FHEMWEB widget
|
||||
- change: 72_TA_CMI_JSON: added new API versions
|
||||
- bugfix: 88_Timer: fix list "Probably associated with" Forum: #1015549
|
||||
- bugfix: 74_NUKIDevice: fix FHEM Crash
|
||||
|
@ -17,7 +17,7 @@ eval "use Date::Parse;1" or $missingModule .= "Date::Parse ";
|
||||
|
||||
#######################
|
||||
# Global variables
|
||||
my $version = "1.3.4";
|
||||
my $version = "1.3.5";
|
||||
|
||||
my $srandUsed;
|
||||
|
||||
@ -39,6 +39,10 @@ my %todoist_transtable_EN = (
|
||||
"newentry" => "Add new task to list",
|
||||
"nolistdata" => "No data for this list",
|
||||
"idnotfound" => "Could not find the task",
|
||||
"today" => "today",
|
||||
"tomorrow" => "tomorrow",
|
||||
"dayaftertomorrow" => "the day after tomorrow",
|
||||
"yesterday" => "yesterday",
|
||||
);
|
||||
|
||||
my %todoist_transtable_DE = (
|
||||
@ -54,6 +58,10 @@ my %todoist_transtable_DE = (
|
||||
"newentry" => "Neuen Eintrag zur Liste hinzufügen",
|
||||
"nolistdata" => "List ist leer",
|
||||
"idnotfound" => "Task konnte nicht gefundern werden",
|
||||
"today" => "heute",
|
||||
"tomorrow" => "morgen",
|
||||
"dayaftertomorrow" => "übermorgen",
|
||||
"yesterday" => "gestern",
|
||||
);
|
||||
|
||||
my $todoist_tt;
|
||||
@ -461,6 +469,17 @@ sub todoist_UpdateTask($$$) {
|
||||
}
|
||||
## move a task
|
||||
elsif ($type eq "move") {
|
||||
|
||||
|
||||
# we can avoid duplicates in FHEM. There may still come duplicates coming from another app
|
||||
if ($h->{"parent_id"}) {
|
||||
#if (AttrVal($name,"avoidDuplicates",0) == 1 && todoist_inArray(\@{$hash->{helper}{"TITS"}},$title)) {
|
||||
# map {FW_directNotify("#FHEMWEB:$_", "if (typeof todoist_ErrorDialog === \"function\") todoist_ErrorDialog('$name','$title ".$todoist_tt->{"alreadythere"}."','".$todoist_tt->{"error"}."')", "")} devspec2array("TYPE=FHEMWEB");
|
||||
# todoist_ErrorReadings($hash,"duplicate detected","duplicate detected");
|
||||
# return undef;
|
||||
#}
|
||||
}
|
||||
|
||||
$tType = "item_move";
|
||||
%args = (
|
||||
id => $taskId,
|
||||
@ -902,7 +921,7 @@ sub todoist_GetTasks($;$) {
|
||||
if (AttrVal($name,"getCompleted",0)==1 && $completed != 1) {
|
||||
InternalTimer(gettimeofday()+0.5, "todoist_doGetCompTasks", $hash, 0);
|
||||
}
|
||||
InternalTimer(gettimeofday()+2, "todoist_GetUsers", $hash, 0) if ($completed != 1 && AttrVal($name,"autoGetUsers",1) == 1);
|
||||
InternalTimer(gettimeofday()+0.3, "todoist_GetUsers", $hash, 0) if ($completed != 1 && AttrVal($name,"autoGetUsers",1) == 1);
|
||||
|
||||
return undef;
|
||||
}
|
||||
@ -1278,6 +1297,7 @@ sub todoist_GetUsersCallback($$$){
|
||||
}
|
||||
}
|
||||
readingsEndUpdate( $hash, 1 );
|
||||
todoist_ReloadTable($name);
|
||||
}
|
||||
|
||||
|
||||
@ -2015,6 +2035,10 @@ sub todoist_Html(;$$$) {
|
||||
todoist_tt.delconfirm='".$todoist_tt->{'delconfirm'}."';
|
||||
todoist_tt.check='".$todoist_tt->{'check'}."';
|
||||
todoist_tt.delete='".$todoist_tt->{'delete'}."';
|
||||
todoist_tt.today='".$todoist_tt->{'today'}."';
|
||||
todoist_tt.tomorrow='".$todoist_tt->{'tomorrow'}."';
|
||||
todoist_tt.dayaftertomorrow='".$todoist_tt->{'dayaftertomorrow'}."';
|
||||
todoist_tt.yesterday='".$todoist_tt->{'yesterday'}."';
|
||||
</script>";
|
||||
# Javascript and CSS
|
||||
$rot .= " <script type=\"text/javascript\" src=\"$FW_ME/www/pgm2/todoist.js?version=".$version."\"></script>
|
||||
@ -2102,7 +2126,8 @@ sub todoist_Html(;$$$) {
|
||||
height: 12px!important;
|
||||
width: 12px!important;
|
||||
}
|
||||
.todoist_dueDateButton svg {
|
||||
.todoist_dueDateButton svg,
|
||||
.todoist_responsibleUidButton svg {
|
||||
margin-top:-2px!important;
|
||||
}
|
||||
";
|
||||
@ -2169,19 +2194,24 @@ sub todoist_Html(;$$$) {
|
||||
my $ind=0;
|
||||
|
||||
|
||||
my $dueDate = defined($hash->{helper}{DUE_DATE}{$_})?$hash->{helper}{DUE_DATE}{$_}:"";
|
||||
my $dueDate = defined($hash->{helper}{DUE_DATE}{$_})?$hash->{helper}{DUE_DATE}{$_}:"";
|
||||
my $responsibleUid = defined($hash->{helper}{RESPONSIBLE_UID}{$_})?$hash->{helper}{RESPONSIBLE_UID}{$_}:"";
|
||||
|
||||
my $dueDateClass = $dueDate!=""?" todoist_dueDate":"";
|
||||
$responsibleUid = $hash->{helper}{USER}{NAME}{$responsibleUid} if ($responsibleUid ne "");
|
||||
|
||||
my $dueDateClass = $dueDate ne ""?" todoist_dueDate":"";
|
||||
my $responsibleUidClass = $responsibleUid ne ""?" todoist_responsibleUid":"";
|
||||
|
||||
$ret .= "<tr id=\"".$name."_".$_."\" data-due-date=\"".$dueDate."\" 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".
|
||||
" </td>\n".
|
||||
" <td class=\"col1 todoist_input".$dueDateClass."\">\n".
|
||||
" <td class=\"col1 todoist_input".$dueDateClass.$responsibleUidClass."\">\n".
|
||||
" <span class=\"todoist_task_text\" data-id=\"".$_."\">".$hash->{helper}{TITLE}{$_}."</span>\n".
|
||||
" <input type=\"text\" data-id=\"".$_."\" style=\"display:none;\" class=\"todoist_input_".$name."\" value=\"".$hash->{helper}{TITLE}{$_}."\" />\n".
|
||||
" <div class='todoist_dueDateButton todoist_icon' title='".$dueDate."'> </div>".
|
||||
" <div class='todoist_responsibleUidButton todoist_icon' title='".$responsibleUid."'> </div>".
|
||||
" </td>\n";
|
||||
|
||||
$ret .= "<td class=\"col2 todoist_delete\">\n".
|
||||
|
@ -13,6 +13,7 @@ if (typeof todoist_checkVar === 'undefined') {
|
||||
|
||||
var todoist_svgPrefix='<svg viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg"><path ';
|
||||
|
||||
todoist_icon.user = todoist_svgPrefix+'d="M 468.13,393.70 C 467.44,383.73 466.04,372.84 463.98,361.35 461.90,349.77 459.23,338.83 456.02,328.82 452.71,318.48 448.21,308.27 442.65,298.49 436.88,288.33 430.10,279.49 422.49,272.21 414.53,264.60 404.79,258.48 393.52,254.01 382.30,249.57 369.86,247.32 356.55,247.32 351.32,247.32 346.27,249.46 336.50,255.82 330.50,259.74 323.47,264.27 315.62,269.28 308.92,273.55 299.83,277.56 288.61,281.18 277.66,284.73 266.54,286.52 255.57,286.52 244.60,286.52 233.48,284.73 222.52,281.18 211.31,277.56 202.23,273.56 195.53,269.28 187.76,264.32 180.73,259.79 174.63,255.82 164.88,249.46 159.82,247.32 154.59,247.32 141.28,247.32 128.84,249.57 117.62,254.01 106.36,258.47 96.62,264.59 88.65,272.21 81.05,279.50 74.26,288.33 68.50,298.49 62.94,308.27 58.44,318.48 55.12,328.83 51.93,338.83 49.25,349.77 47.17,361.35 45.11,372.83 43.71,383.71 43.02,393.71 42.34,403.51 42.00,413.68 42.00,423.95 42.00,450.67 50.50,472.31 67.25,488.27 83.80,504.01 105.69,512.00 132.32,512.00 132.32,512.00 378.85,512.00 378.85,512.00 405.47,512.00 427.36,504.02 443.91,488.27 460.67,472.32 469.16,450.68 469.16,423.94 469.16,413.63 468.81,403.45 468.13,393.70 468.13,393.70 468.13,393.70 468.13,393.70 Z M 468.13,393.70M 252.35,246.63 C 286.23,246.63 315.57,234.48 339.55,210.50 363.52,186.53 375.67,157.20 375.67,123.31 375.67,89.44 363.52,60.10 339.54,36.12 315.57,12.15 286.23,0.00 252.35,0.00 218.46,0.00 189.13,12.15 165.16,36.12 141.19,60.10 129.03,89.43 129.03,123.31 129.03,157.20 141.19,186.53 165.16,210.51 189.14,234.48 218.48,246.63 252.35,246.63 252.35,246.63 252.35,246.63 252.35,246.63 Z M 252.35,246.63"/></svg>';
|
||||
todoist_icon.alarm = todoist_svgPrefix+'d="M 225.68,131.09 C 225.68,131.09 193.65,131.09 193.65,131.09 193.65,131.09 193.65,259.20 193.65,259.20 193.65,259.20 294.96,320.15 294.96,320.15 294.96,320.15 311.08,293.78 311.08,293.78 311.08,293.78 225.68,243.18 225.68,243.18 225.68,243.18 225.68,131.09 225.68,131.09 Z M 214.89,45.69 C 108.67,45.69 22.85,131.73 22.85,237.84 22.85,343.96 108.67,430.00 214.89,430.00 321.11,430.00 407.16,343.96 407.16,237.84 407.16,131.73 321.11,45.69 214.89,45.69 Z M 215.00,387.30 C 132.48,387.30 65.55,320.37 65.55,237.85 65.55,155.33 132.48,88.39 215.00,88.39 297.52,88.39 364.45,155.33 364.45,237.84 364.45,320.36 297.63,387.30 215.00,387.30 Z M 428.51,82.41 C 428.51,82.41 330.40,0.11 330.40,0.11 330.40,0.11 302.96,32.77 302.96,32.77 302.96,32.77 401.07,115.08 401.07,115.08 401.07,115.08 428.51,82.41 428.51,82.41 Z M 127.04,32.67 C 127.04,32.67 99.60,0.00 99.60,0.00 99.60,0.00 1.49,82.31 1.49,82.31 1.49,82.31 28.93,114.97 28.93,114.97 28.93,114.97 127.04,32.67 127.04,32.67 Z"/></svg>';
|
||||
todoist_icon.ref = todoist_svgPrefix+'d="M440.935 12.574l3.966 82.766C399.416 41.904 331.674 8 256 8 134.813 8 33.933 94.924 12.296 209.824 10.908 217.193 16.604 224 24.103 224h49.084c5.57 0 10.377-3.842 11.676-9.259C103.407 137.408 172.931 80 256 80c60.893 0 114.512 30.856 146.104 77.801l-101.53-4.865c-6.845-.328-12.574 5.133-12.574 11.986v47.411c0 6.627 5.373 12 12 12h200.333c6.627 0 12-5.373 12-12V12c0-6.627-5.373-12-12-12h-47.411c-6.853 0-12.315 5.729-11.987 12.574zM256 432c-60.895 0-114.517-30.858-146.109-77.805l101.868 4.871c6.845.327 12.573-5.134 12.573-11.986v-47.412c0-6.627-5.373-12-12-12H12c-6.627 0-12 5.373-12 12V500c0 6.627 5.373 12 12 12h47.385c6.863 0 12.328-5.745 11.985-12.599l-4.129-82.575C112.725 470.166 180.405 504 256 504c121.187 0 222.067-86.924 243.704-201.824 1.388-7.369-4.308-14.176-11.807-14.176h-49.084c-5.57 0-10.377 3.842-11.676 9.259C408.593 374.592 339.069 432 256 432z"/></svg>';
|
||||
todoist_icon.del = todoist_svgPrefix+'d="M0 84V56c0-13.3 10.7-24 24-24h112l9.4-18.7c4-8.2 12.3-13.3 21.4-13.3h114.3c9.1 0 17.4 5.1 21.5 13.3L312 32h112c13.3 0 24 10.7 24 24v28c0 6.6-5.4 12-12 12H12C5.4 96 0 90.6 0 84zm416 56v324c0 26.5-21.5 48-48 48H80c-26.5 0-48-21.5-48-48V140c0-6.6 5.4-12 12-12h360c6.6 0 12 5.4 12 12zm-272 68c0-8.8-7.2-16-16-16s-16 7.2-16 16v224c0 8.8 7.2 16 16 16s16-7.2 16-16V208zm96 0c0-8.8-7.2-16-16-16s-16 7.2-16 16v224c0 8.8 7.2 16 16 16s16-7.2 16-16V208zm96 0c0-8.8-7.2-16-16-16s-16 7.2-16 16v224c0 8.8 7.2 16 16 16s16-7.2 16-16V208z"/></svg>';
|
||||
@ -87,7 +88,7 @@ if (typeof todoist_checkVar === 'undefined') {
|
||||
$('#todoistTable_' + name).find('tr.todoist_data').remove();
|
||||
$('#todoistTable_' + name).find('#newEntry_'+name).parent().parent().before(val);
|
||||
todoist_refreshTable(name);
|
||||
if (!todoist_small) $('#newEntry_' + name).focus();
|
||||
//if (!todoist_small) $('#newEntry_' + name).focus();
|
||||
}
|
||||
|
||||
function refreshInputs(name) {
|
||||
@ -209,12 +210,20 @@ if (typeof todoist_checkVar === 'undefined') {
|
||||
|
||||
function todoist_addAlarmClock() {
|
||||
$('td.todoist_dueDate .todoist_dueDateButton').html(todoist_icon.alarm);
|
||||
$('td.todoist_responsibleUid .todoist_responsibleUidButton').html(todoist_icon.user);
|
||||
}
|
||||
|
||||
function todoist_getDateString(date) {
|
||||
|
||||
}
|
||||
|
||||
$(document).ready(function(){
|
||||
todoist_getSizes();
|
||||
todoist_addHeaders();
|
||||
todoist_addAlarmClock();
|
||||
$( function() {
|
||||
$( document ).tooltip();
|
||||
} );
|
||||
$('.todoist_name').each(function() {
|
||||
var name = $(this).val();
|
||||
todoist_refreshTable(name);
|
||||
|
Loading…
x
Reference in New Issue
Block a user