ID |
Date |
Icon |
Author |
Author Email |
Category |
OS |
ELOG Version |
Subject |
68464
|
Mon Nov 21 15:07:05 2016 |
| Stefan Ritt | stefan.ritt@psi.ch | Request | All | 3.1.2 | Re: Cancel button missing when editing an entry | Well, the "undesired effect" you describe is exactly the reason for having drafts. Somebody works on a lengthy message, then the browser dies, or the user by accident hits the "back" button and (by accidnt, ehem...) confirms the dialog popping up which says "changes will be lost". In that case the draft mechanism should take care of that the lengthy message is not lost. That's where it is for. If one does not like it, one can always turn it off. If one now hits "New", there is the option to continue the previous draft message rather than creating a blank message. Originally, draft messages were shown on the list of entries in a different colors, but people got confused by that, since the draft message appears already during the editing of the message by the user writing it. So upon request I removed it from the listing. Actually the system cannot differentiate between "user still has the message open and works on it" and "browser has crashed". So there is no elegant way to make everybody happy. The only option I can think of is to make the listing of draft messages optioinal (with a new flag in the config file). Would that make sense? Or does anybody see another conecpt?
Stefan
Grant Jeffcote wrote: |
Andreas,
Doesn't using the Save Drafts = 0 option result in the old 'Back' button returning (replacing the Delete option) meaning you can revert back to your old (unmodified) version without saving, sure it doesn't save a draft but I'd rather be able to return back and lose the changes I didn't want then mess up an old entry, I guess the back button on the browser could also do what you want?
The issue I had was that entries were being deleted accidently by persons other than those that created them, I reduced the edit time to try and mitigate it but ended up going back to what we had in Ver 2.9.2, a 'Back' button.
Grant
Stefan Ritt wrote: |
The problem is that the elog database does not allow for a copy of an entry before you make modifications (and therefore get a "draft"). This is actually very simila to other note taking programs. I use Evernote, which constantly synchronizes between devices, and there I also cannot go back to the version before I started making modification. What one would need is a version system (and Evernote has one), so you can go back to the previous verison, the pre-previous version and so on. But this requires a complete redesign of the elog database.
A quick and dirty solution would be to store the origianal entry inside the browser (using JavaScript). You could then restore the initial version with a "cancel" button. But this mechanism relies then on the browser. If you just leave the page, there is no way the browser can put back the old version.
Stefan
Andreas Luedeke wrote: |
If I edit an old entry, and do some mistake while editing, then there is currently no way to savely discard the changes.
The problem is that the entry will become a draft: if I close the window without saving, then the whole entry is gone: it will be converted into a draft entry. But the draft does contain my changes, it is not the originally saved entry!
The draft mechanism should keep a copy of the entry before I opened it in edit mode, and allow to go back to that copy. The edit form has currently the buttons "Submit", "Save", "Preview" and "Delete"; it should have in addition the button "Cancel", that just closes the edit window without saving the entry and even deleting the draft that was saved while the entry was modified. This should bring you back to the previous list view.
Is anyone out there in favour of this change?
|
|
|
|
68465
|
Wed Nov 23 09:25:15 2016 |
| Christine Quicot | christine.quicot@meteo.fr | Request | All | 3.1.2 | Re: Cancel button missing when editing an entry | Hello,
In my opinion, there should be a "close/return" button (discard changes), even with the drafts enabled, but effectively there will have to be several saves made (at least before/after).
I chose to unable the drafts because of this unwanted behaviour: when I modify an entry without any change and click on another tab/logbook without saving, then choose to close the window, the entry is deleted.
Chris
Stefan Ritt wrote: |
Well, the "undesired effect" you describe is exactly the reason for having drafts. Somebody works on a lengthy message, then the browser dies, or the user by accident hits the "back" button and (by accidnt, ehem...) confirms the dialog popping up which says "changes will be lost". In that case the draft mechanism should take care of that the lengthy message is not lost. That's where it is for. If one does not like it, one can always turn it off. If one now hits "New", there is the option to continue the previous draft message rather than creating a blank message. Originally, draft messages were shown on the list of entries in a different colors, but people got confused by that, since the draft message appears already during the editing of the message by the user writing it. So upon request I removed it from the listing. Actually the system cannot differentiate between "user still has the message open and works on it" and "browser has crashed". So there is no elegant way to make everybody happy. The only option I can think of is to make the listing of draft messages optioinal (with a new flag in the config file). Would that make sense? Or does anybody see another conecpt?
Stefan
Grant Jeffcote wrote: |
Andreas,
Doesn't using the Save Drafts = 0 option result in the old 'Back' button returning (replacing the Delete option) meaning you can revert back to your old (unmodified) version without saving, sure it doesn't save a draft but I'd rather be able to return back and lose the changes I didn't want then mess up an old entry, I guess the back button on the browser could also do what you want?
The issue I had was that entries were being deleted accidently by persons other than those that created them, I reduced the edit time to try and mitigate it but ended up going back to what we had in Ver 2.9.2, a 'Back' button.
Grant
Stefan Ritt wrote: |
The problem is that the elog database does not allow for a copy of an entry before you make modifications (and therefore get a "draft"). This is actually very simila to other note taking programs. I use Evernote, which constantly synchronizes between devices, and there I also cannot go back to the version before I started making modification. What one would need is a version system (and Evernote has one), so you can go back to the previous verison, the pre-previous version and so on. But this requires a complete redesign of the elog database.
A quick and dirty solution would be to store the origianal entry inside the browser (using JavaScript). You could then restore the initial version with a "cancel" button. But this mechanism relies then on the browser. If you just leave the page, there is no way the browser can put back the old version.
Stefan
Andreas Luedeke wrote: |
If I edit an old entry, and do some mistake while editing, then there is currently no way to savely discard the changes.
The problem is that the entry will become a draft: if I close the window without saving, then the whole entry is gone: it will be converted into a draft entry. But the draft does contain my changes, it is not the originally saved entry!
The draft mechanism should keep a copy of the entry before I opened it in edit mode, and allow to go back to that copy. The edit form has currently the buttons "Submit", "Save", "Preview" and "Delete"; it should have in addition the button "Cancel", that just closes the edit window without saving the entry and even deleting the draft that was saved while the entry was modified. This should bring you back to the previous list view.
Is anyone out there in favour of this change?
|
|
|
|
|
68466
|
Thu Nov 24 07:38:52 2016 |
| Andreas Luedeke | andreas.luedeke@psi.ch | Request | All | 3.1.2 | Re: Cancel button missing when editing an entry | Hi Stefan,
actually what you refer to as the "quick and dirty" solution is probably the only feasible one: to store a copy of the entry in the browser and restore that copy with a "cancel" button.
Otherwise you would need a full-fledged revision management, to deal with multiple copies of the same entry open in several browsers.
Yet, that does not solve the "problem" of a crashed/closed browser: the entries will go back to drafts and might got overlooked. As you rightly say: this is a feature, not a bug.
This is only a problem when editing existing entries, not for new entries. Maybe a note right of the button "delete" would help, in case you edit an old entry: "This entry is now a draft; press Submit to make it a real entry again".
But as a first step, it might be worthwhile to document this behaviour in the ELOG "User's Guide". Drafts are currently only mentioned in the elogd.cfg syntax pages under "Save drafts" and "autosave". I'll try to propose a text :-)
Kind Regards
Andreas
Stefan Ritt wrote: |
The problem is that the elog database does not allow for a copy of an entry before you make modifications (and therefore get a "draft"). This is actually very simila to other note taking programs. I use Evernote, which constantly synchronizes between devices, and there I also cannot go back to the version before I started making modification. What one would need is a version system (and Evernote has one), so you can go back to the previous verison, the pre-previous version and so on. But this requires a complete redesign of the elog database.
A quick and dirty solution would be to store the origianal entry inside the browser (using JavaScript). You could then restore the initial version with a "cancel" button. But this mechanism relies then on the browser. If you just leave the page, there is no way the browser can put back the old version.
Stefan
Andreas Luedeke wrote: |
If I edit an old entry, and do some mistake while editing, then there is currently no way to savely discard the changes.
The problem is that the entry will become a draft: if I close the window without saving, then the whole entry is gone: it will be converted into a draft entry. But the draft does contain my changes, it is not the originally saved entry!
The draft mechanism should keep a copy of the entry before I opened it in edit mode, and allow to go back to that copy. The edit form has currently the buttons "Submit", "Save", "Preview" and "Delete"; it should have in addition the button "Cancel", that just closes the edit window without saving the entry and even deleting the draft that was saved while the entry was modified. This should bring you back to the previous list view.
Is anyone out there in favour of this change?
|
|
|
68467
|
Thu Nov 24 08:40:31 2016 |
| Stefan Ritt | stefan.ritt@psi.ch | Request | All | 3.1.2 | Re: Cancel button missing when editing an entry |
Andreas Luedeke wrote: |
But as a first step, it might be worthwhile to document this behaviour in the ELOG "User's Guide". Drafts are currently only mentioned in the elogd.cfg syntax pages under "Save drafts" and "autosave". I'll try to propose a text :-)
|
Yes, I would be more than happy to include your text in the documentation.
Stefan |
68482
|
Fri Dec 2 13:54:36 2016 |
| Stefan Ritt | stefan.ritt@psi.ch | Info | All | 3.1.2-6ec506b | Display of draft entries in elog | Dear all,
there seems to be still lots of confusion with the new "draft modus" introduced in elog 3.1.2. Here is how it works:
If you edit an old or new entry, your changes are written to the elog server every few seconds. The entry in the elog database is marked as "draft". The idea behind that is that if your browser crashes or you navigate away from the elog page without saving your entry, the "draft" entry is sill in the elog database and can be recovered later. This is typically useful on some shift logbooks, where people keep the entry open for many hours and add things every few minutes. If they have a crash, they would loose a few hours of information.
The draft modus now has a few drawbacks:
- If you have some draft entries in your elog database, you don't see them until you hit "New" the next time. Then the system offers you to continue the open draft entries.
- Once you change an existing entry, you cannot go back to the version of that entry before you started to make modifications. The only option is to keep the current version or delete the whole entry. The old version of your entry in the database is overwritten every few seconds with the current contents of your edit text field.
To fix the first problem, I introduced a new flag "List drafts = 0|1". If this flag is 1, the draft entries are shown in the list view. The default value for this flag is 1, so normally you should see the draft entries in the database. You should refrain from editing these entries if you know that currently somebody else is working on them, otherwise you will overwrite each other's modifications. The modification is in the current git version of elog which is 3.1.2-6ec506b.
The scond drawback is harder to address. In order to go back to previous version, you would need a full version system (ala git), which is far beyond the scope of elog. I'm working on a partial fix by storing the contents on an entry inside the browser when you start editing an entry. You can then "cancel" your modifications by pasting back the original version from your browser. This works of course only if your browser does not crash or you do not navigate away from the elog page, in which case the original version will be lost.
If anybody has a strong opinion about these changes, please post them here.
Stefan |
68483
|
Fri Dec 2 14:54:58 2016 |
| Stefan Ritt | stefan.ritt@psi.ch | Info | All | 3.1.2-6ec506b | Re: Display of draft entries in elog | In version 3.1.2-416db9f I implemented a "Restore" button, which should fix the second drawback. If you press it, you should be able to go back to where you started when editing an entry. |
68667
|
Mon Aug 21 11:45:06 2017 |
| Andreas Luedeke | andreas.luedeke@psi.ch | Bug report | All | 3.1.3-aded4ae | Bug with Drafts and Language German | Hi Stefan,
when one creates a new entry, and a draft entry exists for the logbook, then a menu appears (see attachment).
If one select "Neuen Eintrag anlegen" then it should ignore the draft and create a new entry.
This feat is done by adding a "&ignore=1" to the "new" command: "<URL>/?cmd=New&ignore=1".
The problem is, that it should not be "cmd=New&..." but "cmd=Neu", since the commands are part of the translation.
Due to this, no new entry can be created as long as a draft exists; at least not in any language other than english.
This problem apparently existed since the beginning of drafts, but it only created problems at our site recently.
Kind Regards
Andreas
PS: Here's a patch that works:
diff elogd.c elogd.c-orig
9575,9576c9575,9576
< rsprintf("<input type=button value=\"%s\" onClick=\"window.location.href='?cmd=%s&ignore=1';\">\n", loc("Create new entry"),
< loc("New"));
---
> rsprintf("<input type=button value=\"%s\" onClick=\"window.location.href='%s';\">\n", loc("Create new entry"),
> "?cmd=New&ignore=1"); |
Attachment 1: elog_lang_pending_draft_bug.png
|
|
68668
|
Mon Aug 21 12:16:05 2017 |
| Andreas Luedeke | andreas.luedeke@psi.ch | Bug report | All | 3.1.3-aded4ae | Re: Bug with Drafts and Language German | I've quickly checked: there are a couple more commands in the source code that are not language encoded. I guess some of them needs correction.
> egrep -n "cmd=[A-Za-z]" elogd.c
10293: rsprintf(" r.open('GET', '?jcmd=Unlock&edit_id=%d', true);\n", message_id);
11784: ("<label for=\"ELCode\"><a target=\"_blank\" href=\"?cmd=HelpELCode\">ELCode</a> </label>\n");
13663: "\r\n%s URL : %s?cmd=Config&cfg_user=%s&unm=%s\r\n", loc("Logbook"),
14562: redirect(lbs, "?cmd=Config");
14625: sprintf(str, "../%s/?cmd=Config", getparam("lbname"));
14678: sprintf(str, "../%s/?cmd=Config", lbn);
15703: combine_url(lbs, host, "?cmd=GetMD5", url, sizeof(url), &ssl);
16378: strcat(str, "?cmd=GetConfig"); // request complete config file
16380: strcat(str, "?cmd=Download"); // request config section of logbook
16570: strcat(str, "?cmd=GetPwdFile"); // request password file
17575: rsprintf("<br><b><a href=\"../%s/?cmd=Synchronize&confirm=1\">", lbs->name_enc);
17577: rsprintf("<br><b><a href=\"%s/?cmd=Synchronize&confirm=1\">", lbs->name_enc);
17579: rsprintf("<br><b><a href=\"../%s/?cmd=Synchronize&confirm=1\">", lbs->name_enc);
18959: if (strstr(ref, "cmd=Search&"))
18960: strlcpy(strstr(ref, "cmd=Search&"), strstr(ref, "cmd=Search&") + 11, sizeof(str));
26728: rsprintf("<a href=\"?cmd=Synchronize\">%s</a></td>\n", loc("Synchronize all logbooks"));
Andreas Luedeke wrote: |
Hi Stefan,
when one creates a new entry, and a draft entry exists for the logbook, then a menu appears (see attachment).
If one select "Neuen Eintrag anlegen" then it should ignore the draft and create a new entry.
This feat is done by adding a "&ignore=1" to the "new" command: "<URL>/?cmd=New&ignore=1".
The problem is, that it should not be "cmd=New&..." but "cmd=Neu", since the commands are part of the translation.
Due to this, no new entry can be created as long as a draft exists; at least not in any language other than english.
This problem apparently existed since the beginning of drafts, but it only created problems at our site recently.
Kind Regards
Andreas
PS: Here's a patch that works:
diff elogd.c elogd.c-orig
9575,9576c9575,9576
< rsprintf("<input type=button value=\"%s\" onClick=\"window.location.href='?cmd=%s&ignore=1';\">\n", loc("Create new entry"),
< loc("New"));
---
> rsprintf("<input type=button value=\"%s\" onClick=\"window.location.href='%s';\">\n", loc("Create new entry"),
> "?cmd=New&ignore=1");
|
|
|