BugSolving2007Story
Acceptance Criteria Solve and close all pending bugs in WebBugzilla. Additional Specification Comments Have a look to the Open bug list- Differentiation of presential work vs. tele-work
- Add a messure of the worked time in the actual month
- Add "clone task" button
report.php the variable $weekly_minutes is computed, but only when the page is first loaded or saved, because the computation query is a bit heavy and executing it at every page reload isn't wanted. Please, follow the same strategy for $monthly_minutes. As you can see, a call to worked_minutes_this_week() is performed. That function is located in include/util.php and performs a plain sql query to get its results. It uses some postgresql functions to compute the first and the last days of the current week. Fortunately, you won't need so complex functions for your task. I suggest you to do the complex start and end day computations using php, and then pass that dates to the query, which will be much simpler.
To implement task cloning, be sure to understand how the task list is managed in report.php by having a look to the "parameters received by this page" comment section: tasks are stored temporarily in the $task array of arrays. That array is passed back and forth to the browser and, when the user saves the page, is finally dumped to the database.
What you have to do is to add a task clone button to each task shown in the page, taking care about the task index. That buttons should use a new $clone_task[i] array variable. So, if the user doesn't push any button in the browser, the clone_task variable won't appear on the php side. But if the user presses the button for the 3rd task (the one having the 2nd index in the zero-based task array), for example, the $clone_task[2] variable will appear, and that's the way to know which button has been pressed.
You'll have to make a hole in the array and put the cloned task just after the one that the user wanted to clone, shifting the remaining next ones one position towards the end of the array. Remember that this is in-memory work and you don't have to write anything to the database unless the user has pressed the "save" button.
And now, some general advices: Please, have a look to all the page comments and explained variables and parameters. If you create new variables or parameters, document them as well. In all the files, I've always made my best effort to do all the php coding and algorithms before (storing values in variables and arrays for later if necessary) and show the html later. I've done that because a program breaking caused by a database runtime error while iterating and writing tables (tr, td...) causes a very bad impression to the final user. Because of that, i prefer to do all the compitations before and showing the results later.
Write always in English. As you'll add new code, you can credit your own name in the list of developers in that file. Very important: always edit the files with an editor in utf8 mode. If you don't do that, you can corrupt the files in a very bad way.
Remember to add to i18n/es.po and i18n/gl.po all the translations for the new strings you create in the code. To do that, first make a backup of all the po files (just in case...), then run make i18n-dev. That will add all the new strings to the po files (without wiping them, i hope...). Then edit the po files, look for the untranslated strings, and translate them (in utf8, remember, it's very important). Then type make locale and check the results. It's uncommon, but maybe will be necessary to restart Apache for the translations being fully updated.
Maybe you want to add some extra time to the EnvironmentLearning2007Story, because you'll have to learn many new things to complete this tasks.
To finish, here you'll find some useful links to learn some of the technologies involved:
- php.net: Php language documentation
- htmlhelp.com: HTML and CSS
(the site is temporarily down at this time, but I like it very much)
- w3schools.com: Javascript, CSS and many other things
- postgresql.org: Postgres manual
. Have a look to SQL commands
, functions and operators (specially date/time)
and type conversion.
Tasks in this story
div class="twikiTopicInfo twikiRevInfo twikiGrayText twikiMoved"<&/div>-->


