Author Topic: edit current timesheet record  (Read 4183 times)

Soundbytes

  • Kimai Newbie
  • *
  • Posts: 2
    • View Profile
edit current timesheet record
« on: February 16, 2011, 11:02:26 AM »
Very often I need to edit a timesheet entry while it is recorded and not only afterwards. Sometimes I just can not initialize the recording at the same time I start to work. Then it is useful to adjust the start time rightaway.
I also find it much more helpful to be able to add comments to the record while I am working on a task and not only afterwards.

Fortunately I only needed to change a few lines in a single file to make this possible.
I have been using this mod for a couple of days now and so far it doesn't look like anything is broken.

If anybody else wants to add the functionality to their kimai installation do this:

In file kimai\extensions\ki_timesheets\templates\zef.tpl
replace Lines 67 to 81 by:

Code: [Select]
{*Edit Record Button - immer sichtbar*}

                        {strip}<a href ='#' onClick="editRecord({$arr_zef[row].zef_ID}); $(this).blur(); return false;" title='{$kga.lang.edit}'>
                            <img src='../skins/{$kga.conf.skin}/grfx/edit2.gif' width='13' height='13' alt='{$kga.lang.edit}' title='{$kga.lang.edit}' border='0' />
                        </a>{/strip}

                        
{* quick erase trashcan *}
{if $arr_zef[row].zef_out && $kga.conf.quickdelete == 1}
                        {strip}<a href ='#' class='quickdelete' onClick="quickdelete({$arr_zef[row].zef_ID}); return false;">
                            <img src='../skins/{$kga.conf.skin}/grfx/button_trashcan.png' width='13' height='13' alt='{$kga.lang.quickdelete}' title='{$kga.lang.quickdelete}' border=0 />
                        </a>{/strip}
                        
{/if}

The edit button will now also appear next to the currently recorded entry.
If the modification is not present after the patched file has been replaced on the server hit the browsers refresh button.

regards

Andreas
« Last Edit: February 16, 2011, 11:19:46 AM by Soundbytes »

tonibilly

  • Kimai Newbie
  • *
  • Posts: 1
    • View Profile
Re: edit current timesheet record
« Reply #1 on: January 17, 2012, 08:48:45 AM »
Hi, I modified in file kimai\extensions\ki_timesheets\templates\zef.tpl
but no work. How I can make that works?

Thanks

easton

  • Kimai Member
  • *
  • Posts: 7
    • View Profile
Re: edit current timesheet record
« Reply #2 on: February 02, 2012, 11:29:01 AM »
Hi, I have the same Problem. I also modified the file kimai\extensions\ki_timesheets\templates\zef.tpl but there is now difference.
I'm a Kimai newbee and I also have know experience in PHP.

Whats going wrong?

Thanks

frederickjh

  • Kimai Newbie
  • *
  • Posts: 4
    • View Profile
Re: edit current timesheet record
« Reply #3 on: February 06, 2012, 07:48:48 PM »
Hi easton and tonibilly!

I just installed the latest version of Kimai (v0.9.2.1306) and made this modification. I can see how the instructions for non-programmers could be confusing.

I found that the line numbers had increased by one. My guess is you missed to remove the last {/if} on line 82. I replaced lines 68 to 82. To try and make this clear find this section and replace it with the block above.
Code: [Select]
{*Edit Record Button - nur einblenden wenn fertig recorded*}
{if $arr_zef[row].zef_out}
                        {strip}<a href ='#' onClick="editRecord({$arr_zef[row].zef_ID}); $(this).blur(); return false;" title='{$kga.lang.edit}'>
                            <img src='../skins/{$kga.conf.skin|escape:'html'}/grfx/edit2.gif' width='13' height='13' alt='{$kga.lang.edit}' title='{$kga.lang.edit}' border='0' />
                        </a>{/strip}
                       

    {* quick erase trashcan *}
    {if $kga.conf.quickdelete > 0}
                        {strip}<a href ='#' class='quickdelete' onClick="quickdelete({$arr_zef[row].zef_ID}); return false;">
                            <img src='../skins/{$kga.conf.skin|escape:'html'}/grfx/button_trashcan.png' width='13' height='13' alt='{$kga.lang.quickdelete}' title='{$kga.lang.quickdelete}' border=0 />
                        </a>{/strip}
    {/if}

{/if}

I hope that helps!

frederickjh

  • Kimai Newbie
  • *
  • Posts: 4
    • View Profile
Re: edit current timesheet record
« Reply #4 on: February 06, 2012, 08:14:55 PM »
One other tip if you make this modification, after editing the start time you will not be able to close the edit dialog with the end times set as they are. Just hit the now button before saving.

easton

  • Kimai Member
  • *
  • Posts: 7
    • View Profile
Re: edit current timesheet record
« Reply #5 on: February 27, 2012, 11:37:35 AM »
Hi,

thanks a lot  ;D

frederickjh

  • Kimai Newbie
  • *
  • Posts: 4
    • View Profile
Re: edit current timesheet record
« Reply #6 on: June 21, 2016, 04:20:13 PM »
@Soundbytes, have you perhaps upgraded to Kimai version 0.9.3.1384 and have the same modification for it?  \extensions\ki_timesheets\templates\zef.tpl is gone in this version.
 
\extensions\ki_timesheets\templates\scripts\timeSheet.php looks like it is the file to modify.

Thanks in advance for any help you can provide!
Frederick

frederickjh

  • Kimai Newbie
  • *
  • Posts: 4
    • View Profile
Re: edit current timesheet record
« Reply #7 on: June 21, 2016, 04:31:23 PM »
Sorry, seem that this has been incorporated. What I am missing in the new version is the speech ballon by the time counter that allowed you to quickly edit the comment. I am going to file a issue on the Github tracker.