From: Scott M. <sco...@gm...> - 2011-04-15 19:35:54
|
Hey Mark, You've done lots of work there. Yes, the java stuff does all appear to work now with your new code. When I was debugging things, the java loaded, but couldn't see any of the variables that php had setup, so putting them back together seemed to fix the problem from me. So long as it's all working again the way it's supposed to, I'm happy. I kinda like the "show / hide calendar" thing, but if we can get the java pop up calendar thing to function so the user doesn't have to click as much to get the "context date" to change, I'm willing to let the old calendar navigation go away. I've got one pet peeve that apparently you are responsible for tickling: Could I request that you stop splitting the else from the end bracket? ie. I like seeing this: if (something) { do this } else { do that } And you like to have this changed to this: if (something) { do this } else { do that } To me, the else block is closely related to the previous if, and by splitting it off like you do, I think it makes it look more like a potentially unrelated block. -Scott On Thu, Apr 14, 2011 at 11:32 PM, Mark Wrightson <ma...@rw...>wrote: > Hi, > > I have spent quite some time working to remove some of the global > variables that of course no longer work. > Whilst working through this process it has meant I have been tidying up > various pieces of code and in some cases > rewriting sections to ensure that things work properly rather than > magically. > > Part of this process is to remove include files that are not classes. > For instance in stopwatch: > > Before: > //$stopwatch = 1; > //$fromPopup = "true"; > //include(dirname(__FILE__)."/../include/tsx/clockOnOff_core_new.inc"); > > After: > require("include/tsx/clocking.class.php"); > $clock = new Clocking(); > $clock->createClockOnOff(null,true,false,true); > > by doing this the variables can be traced through and if a variable > isn't passed into a function it will cause an error > whereas it was hit and miss before. This is still an on going process. > > I have created classes for the stopwatch clock and also navcal. > > Please be aware that I still haven't finished making the stopwatch work. > > All the stopwatches and navcals have show hide functionality built in to > tidy up the pages. I realise that some of the work that is done here is > stuff that is being slowly modified / replaced but it really was > necessary in my aim to clean up the codebase! > > Scott: > I noticed that you changed a line in client_proj_task_javascript.php > that caused the stopwatch js to stop working: > > <script type="text/javascript" src="<?php echo > Config::getRelativeRoot();?>/js/client_proj_task_javascript.js"></script> > > to > include(...client_proj_task_javascript.js...) > > The note you left in the code about variables that could not be accessed > outside of a js script is as far as i'm aware incorrect. > A variable in the global namespace in javascript, be it assigned inline > on a html page or outside of a function in a js file, are all accessible > from anywhere. I think the exact reason why the code didn't work was a > missing quotation mark in the <script> line above. Please can you > confirm that the drop down boxes in stopwatch now function again on your > setup? > > When I rewrote the js code for stopwatch several months ago, my aim was > to remove all php code from the javascript files and getting all the > large js chunks into an external file rather than cluttering up the head > of each html page. This is why I created the > client_proj_task_javascript.class.php file so that this could be achieved. > > Regards > Mark > > -- > _____________________________________________ > > Mob: 07725 695178 > Email: ma...@rw... > > > > ------------------------------------------------------------------------------ > Benefiting from Server Virtualization: Beyond Initial Workload > Consolidation -- Increasing the use of server virtualization is a top > priority.Virtualization can reduce costs, simplify management, and improve > application availability and disaster protection. Learn more about boosting > the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev > _______________________________________________ > Tsheetx-developers mailing list > Tsh...@li... > https://lists.sourceforge.net/lists/listinfo/tsheetx-developers > |