Web apps
Author
Discussion

bitwrx

Original Poster:

1,352 posts

232 months

Wednesday 24th February 2010
quotequote all
So, I have a cunning plan. There's a wicked Project Management application called Taskjuggler. It's really good, but difficult to use.

You have to write a text file of the correct syntax, whilst adhering to some basic rules about certain properties of a task or resource precluding others. I've used it, and got some really good results, but I've spent more time learning how to use it than I've saved on the projects I've managed with it.

I have an idea to write a web-based front-end for it. The text-based nature of it makes me think this would be possible. Some form of pointy-clicky interface that wrote the syntactically correct text for you, whilst performing some form of checks to make sure you adhered to the basic rules, would seem useful.

Pass this to a database on the webserver, cobble it together into a project definition, and run the Taskjuggler algorithm on it to get the pretty HTML output published to a password protected website.

But the thing is, I know nothing about web applications. Or much about software in general. But I'm an engineer, and nothing's that hard for an engineer is it? More importantly, I'm keen to learn. But I don't know what to learn.

So how should I go about it? PHP? Ruby? (on rails?)? Python? Other?

In short, I want to be able to go to a website, click some st, assemble a text file based on those clicks, and execute a shell script on that text file.

Databases may or may not be involved in storing the text.

Thoughts?

tegwin

1,682 posts

234 months

Wednesday 24th February 2010
quotequote all
If its a web app you want...

then write it in PHP.... You will need ome SQL/Mysql to connect to your database... I dont know anything about task juggler... but IMHO php would be my approach... Theres plenty of snippets of code on the web which is useful to do the basic stuff..

bitwrx

Original Poster:

1,352 posts

232 months

Thursday 25th February 2010
quotequote all
tegwin said:
If its a web app you want...

then write it in PHP.... You will need ome SQL/Mysql to connect to your database... I dont know anything about task juggler... but IMHO php would be my approach... Theres plenty of snippets of code on the web which is useful to do the basic stuff..
OK. One vote for PHP. Is Ruby not good for interactive webpages n stuff? Anyone have any experience?

evenflow

8,874 posts

310 months

Thursday 25th February 2010
quotequote all
Two votes for PHP. Hugely supported, loads of tutorials, and a learning curve that can be as gradual or steep as you wish.

Plus, it integrates seemlessly into HTML, and contains built in string and file functions that will help you construct the text file you require.

bitwrx

Original Poster:

1,352 posts

232 months

Monday 1st March 2010
quotequote all
OK before I get too far into PHP, can someone tell me if the following would be possible.

A webpage with a form containing three input boxes.

The first is a start date of a project.
The second is the end date of a project.
The third is the duration of the project.

Obviously, to fully define the timeline of the project you only need any two of these.

  1. A start date of today, and a duration of a week means the project has to finish next Monday.
  2. A start date of today and a finish date of next Monday would mean the project has a duration of 1 week.
  3. and so on.
So once the user has filled in any two of the boxes, can I make it so the third box becomes disabled?

something like:
if length(box one contents) > 0 && length(box two contents) > 0
then
box three is disabled
endif


So can PHP create dynamic pages that change as a result of user input without having to send another request back to the server?

ruddermode

105 posts

266 months

Monday 1st March 2010
quotequote all
You can use javascript for enabling/disabling form elements on a page without going to the server.

evenflow

8,874 posts

310 months

Monday 1st March 2010
quotequote all
You could do that with PHP if you used a technology called AJAX. This would do take the inputs, do some processing in the background, and then refresh the part of the page containing the third input box.

However...


An easier way would be with javascript.

Give each input box a unique ID, e.g.

<input type="text" id="starttime" ...

You would need a javascript function that calculated Duration = End Time - Start Time, Start Time = End Time - Duration, or End Time = Start Time + Duration.

You could then set an onChange event on all three of your input boxes that would call the function when a user types a value into the box.

The function should be clever enough to know if it has two of the three it needs, and therefore to populate and disable the third input box.

evenflow

8,874 posts

310 months

Monday 1st March 2010
quotequote all
...if you wanted to get snazzy, make the start time and end time input fields into a calendar using jQuery:

http://jqueryui.com/demos/datepicker/

Shay HTFC

3,588 posts

217 months

Monday 1st March 2010
quotequote all
Just incase you were still in need of being fully convinced, go with PHP and AJAX for that stuff. Loads of free tutorials on the net.

bitwrx

Original Poster:

1,352 posts

232 months

Monday 1st March 2010
quotequote all
OK, so it's all possible. This is good. I'll stick with the beginners' PHP tutorial this afternoon. There's a long way to go.

The start time/end time/duration rule is an example I made up off the top of my head, but it's typical of the sort of rule that makes Taskjuggler throw a build error.

Now all I have to do is find out a way of getting all of these rules out of Taskjuggler so I can either recreate them in PHP, or somehow automagically just access them from my frontend.

:daunted:

Thanks for your help so far.

Shay HTFC

3,588 posts

217 months

Monday 1st March 2010
quotequote all
If you do want to automagically access content from some form of text file (not sure how the system you are using works) look into regular expressions (aka regex). Its very powerful and allows you to grab specific words and parts of word patterns that may occur. i.e. grab all the properties from a properties file or something.

bitwrx

Original Poster:

1,352 posts

232 months

Monday 1st March 2010
quotequote all
Shay HTFC said:
If you do want to automagically access content from some form of text file (not sure how the system you are using works) look into regular expressions (aka regex). Its very powerful and allows you to grab specific words and parts of word patterns that may occur. i.e. grab all the properties from a properties file or something.
Neither am I. hehe

AlunR

1,676 posts

292 months

Tuesday 2nd March 2010
quotequote all
If it's using comma delimited files (sounds likely) then PH has a neat function called fgetcsv() - http://php.net/manual/en/function.fgetcsv.php

It'll import and parse a CSV to an array for you very easily.


onomatopoeia

3,526 posts

245 months

Tuesday 2nd March 2010
quotequote all
bitwrx said:
So can PHP create dynamic pages that change as a result of user input without having to send another request back to the server?
You're into client side scripting to do that, which is the spawn of the devil and a blight on the face of the world wide web.

You might guess that I'm not a fan of javascript hehe

evenflow

8,874 posts

310 months

Tuesday 2nd March 2010
quotequote all
onomatopoeia said:
bitwrx said:
So can PHP create dynamic pages that change as a result of user input without having to send another request back to the server?
You're into client side scripting to do that, which is the spawn of the devil and a blight on the face of the world wide web.

You might guess that I'm not a fan of javascript hehe
Nah, it's OK if you use a well-tested library (jQuery etc) and it degrades gracefully...

AlunR

1,676 posts

292 months

Tuesday 2nd March 2010
quotequote all
evenflow said:
onomatopoeia said:
bitwrx said:
So can PHP create dynamic pages that change as a result of user input without having to send another request back to the server?
You're into client side scripting to do that, which is the spawn of the devil and a blight on the face of the world wide web.

You might guess that I'm not a fan of javascript hehe
Nah, it's OK if you use a well-tested library (jQuery etc) and it degrades gracefully...
I prefer Progressive Enhancement to Graceful Degredation. All our apps WORK 100% without js turned on. They just get better if you have JS turned on.

Also better for Accessibility and SEO purposes.

bitwrx

Original Poster:

1,352 posts

232 months

Tuesday 2nd March 2010
quotequote all
AlunR said:
evenflow said:
onomatopoeia said:
bitwrx said:
So can PHP create dynamic pages that change as a result of user input without having to send another request back to the server?
You're into client side scripting to do that, which is the spawn of the devil and a blight on the face of the world wide web.

You might guess that I'm not a fan of javascript hehe
Nah, it's OK if you use a well-tested library (jQuery etc) and it degrades gracefully...
I prefer Progressive Enhancement to Graceful Degredation. All our apps WORK 100% without js turned on. They just get better if you have JS turned on.

Also better for Accessibility and SEO purposes.
So if I turn out to be a javascript non-fan, how else would something like this be done. Or how do I design a workaround?

Not worried about SEO. Hadn't considered accessibility - it's only a self-education project anyway.

And what's meant by 'degrades gracefully'?

evenflow

8,874 posts

310 months

Tuesday 2nd March 2010
quotequote all
bitwrx said:
So if I turn out to be a javascript non-fan, how else would something like this be done. Or how do I design a workaround?
You could do the logic and processing element "server side" with PHP, but if you want to start disabling form fields in the browser then you will need to use some client side javascript. If it is a personal project then don't worry about it, as long as you yourself don't have javascript switched off in your browser!

bitwrx said:
And what's meant by 'degrades gracefully'?
It means to design something that will work for the end user independently of whatever technology they have enabled or not in their browser.

For example, you may design the front-end to fill in a form field with client-side javascript. What if the user has javascript disabled in their browser? Then your software needs to take this into account and still work for them - just without this particular bell/whistle IYSWIM.

http://en.wikipedia.org/wiki/Unobtrusive_JavaScrip...