Jump to content

Need Some Advice On New Project


bryslon
 Share

Recommended Posts

Hi All,

I am experienced PHP developer and I have made number of my own CMS systems, so that I think I should be OK with learning Process Wire.

I found the Process Wire being the best fit for my projects as I can see it is very mature CMS and it has great flexibility and I have chosen it for number of new projects I am developing myself.

However I have trouble starting up as my projects are not standard websites, but they are websites, and what I want to do is always very hard to do anyway, which is basically allowing certain users to fill forms and submit them, and then preview the list of submitted forms.

I would like to achieve the following:

1. That I have a page were I list current jobs and their statuses, e.g. list of Tasks.

2. That the page has restricted access, e.g. user needs to logon to view the page, however granunar permissions wont be required (eventually added later)

3. The user would be able to submit new job via form by simply filling it up

4. I would like to create several such "modules", where there are various task lists and forms and restrict permissions to various users.

I went thru all the code and documentation however I am bit confused because I am totally new to Process Wire.

Previously I was trying to make it into the admin page but now I can see the front page should be better fit.

I am going now thru the Wiki

Regarding the job execution, this part is already working, I am using Gearman to process tasks and update statuses as well send notifications. This is handled by external database, and it's not required for Process Wire to handle this part for the moment.

In essence, I would like to ask you what would be the high-level steps to create the list and the form (search would be also good) and then make it restricted for certain users.

I am working on this myself so no hurry with answer, if I figure it out I will post as soon as I have it.

In my own CMS, I used to do it in the following way:

1. To create a form:

$form = new Form('newTask');

$form->addField('Task Name');

$form->setAction('submitTask');

...

$page->add($form);

$page->render();

2. To list the tasks

$table = new Table();

$table->label =  'Tasks List';

$data = $tasks->getTasks('somefilter');

foreach($data as $task) {

    $table->addRow($data->id, $data->text, array('edit', 'delete'));

}

...

$page->add($table);

$page->render();

With the above I can submit new form, list objects, and I could also make group edit and so on.

The whole code would be in single module, and that module would be restricted per role e.g. only edit, only delete, only view.

The tasks were stored in single table, and the fields were defined in the xml file, so that when xml file was updated, the MySQL schema was as well. In the XML file there were the field types used to rendrer correct fields, e.g. textarea, text, checkbox etc.

many thanks for your help,

Bryslon

  • Like 2
Link to comment
Share on other sites

Hi bryslon and welcome to PW.

That is quite a detailed question but I thought I'd hopefully give you a few snippets to get started.

Creating front-end forms: https://processwire.com/talk/topic/2089-create-simple-forms-using-api/

That is a great thread that should get you going. You can have your form submission create the new page and then limit the viewing of this page to users with specific roles.

For the job tasks I would make use of PW's Page Fieldtype which is incredibly powerful: http://processwire.com/videos/page-fieldtype/

I would suggest your jobs parent parent page contain the form for submitting a new job, as well as the ability to search through jobs. This page might have a template: "jobs". The child pages would be created by the form submission, possibly set to unpublished until verified by an admin. The template for these pages might be: "job"

I have done something quite similar before - it will be a bit of a learning curve the first time, but the PW API definitely has everything to you need to build this robustly.

Not sure if that is much help, but hopefully it will get you started and you can come back to us with more specific questions as you get further into it.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...