Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Modules
Author Message
mefoo
Regular
Regular



Joined: Sep 03, 2010
Posts: 57

PostPosted: Fri Sep 03, 2010 10:05 am Reply with quote

Hey all!

I'm working on a site atm and want to use the project tracking module to keep track of things we are working on for our people.

The catch is... I want to keep our people from viewing each others projects. (i.e. Test1 can't see Test2's projects being worked on and vica versa)

My question is... how can I restrict access to "particular project's" based on the users "group status" or some other setting somehow.

Any help would be greatly appreciated. Thanks!


P.s. I tried searching under this forum (modules) and didn't find any relevant topics with my search terms.
 
View user's profile Send private message
mefoo







PostPosted: Sun Sep 05, 2010 9:00 pm Reply with quote

Thanks for the bump but I've already crafted a crude workaround for my particular situation.

It still would be nice to see a "group view" type option with the project tracking module as well as an option to let users add their own projects (kinda like a request) & upload files associated with the particular project.

Hopefully this will breathe new life into project tracking as it's the perfect solution for our situation.

Thanks guys!!
 
Raven
Site Admin/Owner



Joined: Aug 27, 2002
Posts: 17088

PostPosted: Sun Sep 05, 2010 9:15 pm Reply with quote

Maybe Palbin can look at your code and create what you are asking.
 
View user's profile Send private message
mefoo







PostPosted: Sun Sep 05, 2010 9:45 pm Reply with quote

Search & Replace a few key words & file names within the files and shazzzam... you have a new "module".

This however, is not what I am describing in the previous post. I don't have the know how to code it... but it should be a viable couple of options seeing how most everything else can be segregated out by groups.

I.e. Project 1 would have this...

Image


EDIT**** Sorry for having to correct my description... but I was tired last night and didn't explain it very well.


The "view" options should be an option "WITHIN" the project settings.
(i.e. when you add a new project... one could set "groups only" and choose the groups who would be able to see that project)

END EDIT****

The "request" part would be something the admin could turn on or off so that the "clients" could submit their own "projects" into the database to be reviewed by the admin and either approved or denied.

EDIT**** This "request" system would be similar to how clan apps or Pro Forms work. The "users" could add their project details to the database which would then generate an email to the admin & user who added letting them know that the project is "pending" until further review by the admin. It wouldn't show up in the project list until accepted by the admin.

this would free up the people who manually enter the project data in by hand on the backend of the site and let them only have to click "approve" or "deny" on the user added project as well as removing the liability for error due to typo's etc from the site and personnel. (the user would be liable for typo's etc)

END EDIT****

The workaround I crafted basically makes a "new" module so that I can have multiple instances of the module running and choose "group view" based on the module itself. The downside of this is that if we end up gaining a large number of clients... then I'll have a huge number of unneeded "modules" just to obtain a "group view" setting based on the module itself and will have database tables for each and everyone one of those modules.

Just an idea.
 
mefoo







PostPosted: Mon Sep 06, 2010 8:36 am Reply with quote

Sorry to double post.... but I edited the previous post and when I have the time to sit and play with this... I'll try and see if I can implement what i'm asking for on a test site or something.

Ravennuke is the only nuke distro I use but it is geared more for gaming/clan sites rather than business related sites. I'm hoping to see RN spread into other area's of daily life and it makes small business a little bit more competitive in the market place.
 
jakec
Site Admin



Joined: Feb 06, 2006
Posts: 3048
Location: United Kingdom

PostPosted: Mon Sep 06, 2010 11:48 am Reply with quote

mefoo wrote:
Ravennuke is the only nuke distro I use but it is geared more for gaming/clan sites rather than business related sites.


I respectively disagree, I have 5 sites all using RN, but none of them are for gaming/clan sites.
 
View user's profile Send private message
mefoo







PostPosted: Mon Sep 06, 2010 12:25 pm Reply with quote

I can respect your opinion... but I would have you go look for different modules to add onto RN and see how many are geared for gaming/clans vs. small business.

Maybe I didn't explain myself well enough. RN is the framework which the site is built on. The "community" itself the driving factor for the direction of RN. If the majority of sites are using RN for gaming/clan sites... then the overall direction of RN will be to that base.

What i'm alluding to is adding a couple of features to RN so that it can also be used (fresh install) with small business in mind.

Otherwise, we have to write custom modules or modify code so that RN is more adapted for small biz. (i.e. with project tracker.... you can only have one instance running and the "projects" can be viewed by anyone who is within the "who can view" settings of that module)

Whereas it would benefit small biz much more to have the options of restricting who can view that project based on group status as well as letting the clients add project to that database thus removing liability from the site admins (having to input by hand) and putting the liability on the clients for ensuring they are requesting the correct work to be accomplished.

This would become a "core" module of RN so that IF the person wanted to implement something of this nature... we could. More or less.... a "work order form/tracker" system.

Basically... it would make RN that much more productive for the admins because they would eliminate the need for manually imputing the project, the admin could change the status of the project being worked on and if emails were sent out with any changes... then the clients would be updated with the status of their project.

It would be an awesome "all in one" request/tracking system that small businesses would benefit from because then we could pop up a fresh install and have a way to manage product online via RN's core functions without the need to find workarounds or rewriting code so that we can have various groups using project tracker but none could see each others work. It would also keep the files on server from piling up (due to my crude workaround) and would keep the database from being cluttered with tables that only pertain to the modified project tracking modules. (it's as if you are installing project tracker over and over again)

P.s. I noticed that you're a site admin and that leads me to believe that you're somewhat familiar with PHP Nuke / RN or at the very least have good ties to people who do in which case you can get outstanding help with w/e you're needs are, I however, don't have that luxury and I'm stuck trying to figure out how to get my site off the ground with little to no actual (from scratch) PHP NUKE programming knowledge.

Hence, I searched for anything that fits my needs or at the very least gives me a starting point to correct w/e I can... yet... most everything i've found for RN (nuke in general) is geared towards gaming etc vs. small biz. That is how I came to my conclusion.

----------------

**Edit**

I'm really not complaining about this.... I'm *wishing* to see something added to RN that would benefit small biz (our biz in particular) in the long run.

Once I get time I'm going to start figuring out how to write this all but as it stands right now... I've got to get something up for our clients to use and I really don't want to put converted .hmtl forms on a our pretty nuke site and continue to use emails/manual input as the method to update each individual tracking module.
 
jakec







PostPosted: Mon Sep 06, 2010 1:01 pm Reply with quote

OK I think we agree that is it not necessarily RN that is geared towards clans and I also agree that there are a lot of clan modules etc.

.....but there are also alot of modules which can help businesses.

I would recommend checking out Montego Scripts, Code Authors, Tricked Out News and there are a number of others.

Also just because I am a Site Admin does not mean I get any special treatment. You will see that I have posted questions here and at other websites and I have to wait in line like everybody else.

Anyway I am getting off topic.

I don't want to discourage you from making suggestions on how we can improve RN so please keep them coming. Very Happy
 
mefoo







PostPosted: Mon Sep 06, 2010 1:24 pm Reply with quote

Thanks for at the very least entertaining the idea and providing resources. I was really worried about coming off like some kid whose just complaining about things.

Like I said... when I get the time to sit and teach myself how to do it... i will, but I figured since the project tracking modules is already in place and comes with RN.... why not morph it into a Custom forms/Request/Tracker utility for small biz to use and now RN can fall any direction the user could really need it to go right out of the box.

Really appreciate your input in all this.
 
jakec







PostPosted: Mon Sep 06, 2010 3:26 pm Reply with quote

Hopefully Palbin will take a look at this, although I know he is very busy.
 
mefoo







PostPosted: Mon Sep 06, 2010 3:36 pm Reply with quote

Well actually... since i'm not the type to wait long... i've already started modding it and at this point in time... i'm trying to figure out just what the " $admin_file " is. I've already got it modded with the add links and now i'm just changing up the function to fit my needs.

I will continue modding this thing until it works for me I guess but I just don't have the know how to make it all happen "correctly".

My "to do" list:

1. Create "add" function for the users - Almost done (using admin code modded for users)
2. Modify fields they can actually use to input
3. Notitificaitons

those are the "basic" needs I will have to meet for myself... however, It would be extremely nice to roll this and a forms system all into one so that it's a one stop shop for workflow needs. Thanks for all your help!!! (and i'm sure i'll be asking more questions as I get deeper into this)
 
mefoo







PostPosted: Mon Sep 06, 2010 4:28 pm Reply with quote

Would look something like this on the front end. (what the user/client would see)

Image

On the "admin" side of it.... it would have a panel like the user accounts panel where the admissions would be "waiting" until approved by the admin etc.
 
Palbin
Site Admin



Joined: Mar 30, 2006
Posts: 2583
Location: Pittsburgh, Pennsylvania

PostPosted: Mon Sep 06, 2010 5:20 pm Reply with quote

I will not have time to look at this in the near future. Sorry. There is just so much to do Sad

_________________
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan. 
View user's profile Send private message
mefoo







PostPosted: Mon Sep 06, 2010 5:46 pm Reply with quote

It's totally understandable Palbin, I can appreciate that you're busy and it's up to us to help you out.

I will continue trying to modify this module to give users more access to the system and may have some questions for the actual programmers later on down the line with the email notifications and admin functions possibly.

thanks again for all y'alls time... I know just how precious it is.
 
Guardian2003
Site Admin



Joined: Aug 28, 2003
Posts: 6799
Location: Ha Noi, Viet Nam

PostPosted: Fri Sep 10, 2010 6:30 am Reply with quote

It has been a long time since I delved into the Project Tracking module but if I remember correctly, when you create a new project, you can add Managers, Developers, Reporters and that kind of thing so I think the logical way (possibly) to get to your requirements might be to write a small function to check whether a specific user (regardless of their 'title') has been added to a specific Project.
 
View user's profile Send private message Send e-mail
mefoo







PostPosted: Fri Sep 10, 2010 7:49 am Reply with quote

Right... but that is for the "admins" or whomever is working on said particular project. Those would be internal people looking at that which is fine, but it leaves the problems in place.

1. The front end users don't have access to add projects to a waiting list.
2. The front end users can see "ALL" projects regardless of their groups status.
3. The admin(s) do not have a back end similar to how your_account works with a "waiting" panel.
4. There is no way to add custom fields to the project, or really, the users "add project" page.

As it stands now... the "user" would have to email the "admin" and ask to have a project added to the database with relevant information pertaining to the project. But then... once it's added... there is no way for the admin to only allow said particular user to see the status of "their" project and no one else. The project has to be entered by the admin manually which can lend itself to complications down the road if the information is not correctly entered by the admin. (liability is on the admin)

The "project tracking" module ITSELF can be set to view by group status... but the actual projects within the database and what the module displays to the user can not. So if I wanted GROUP A to see their projects... and not GROUP B... I would have to use my crude work around and install a "new" module that set the group view to group B and the first instance of the module to group A to keep them from viewing each others projects.

The major flaw with that... the admin would have to bloat the server and database with more than one project tracking "module" (just renaming some stuff to trick RN into thinking it's a different module) so that projects are not viewable by different groups.

All is well though... like I've said, I'm already tearing off into this but I have never programmed anything nuke at all so this is all trial and error teaching time for me. Lots of questions and late nights wondering what the heck I'm doing. Wink Not to mention a wife that is pissy with me for spending so much time on something instead of her.

Thanks for the input guys! I will ask questions in the future. Thanks for helping out a baby take his first steps!

---------------------

On a side note... and I asked this in one of the how to's but still don't understand this all... I'm trying to have 4 fields hidden unless a checkbox is check at which point it would slide down and show the 4 fields. It "seems" I can accomplish this by using java and I've read ravens post about inserting java into nuke... but it just doesn't seem to work for me or I'm not good enough yet to get the structure & syntax right.

If anyone knows of a detailed explanation or could explain it to me I would really appreciate it. Thanks.

(example)

Option 1 checkbox:

Option 2 checkbox:

Option 3 checkbox:


If option 1 checkbox = true... move visible content down and show (4 text entry boxes)


(like this)
Java code: [ Only registered users can see links on this board! Get registered or login! ]
 
montego
Site Admin



Joined: Aug 29, 2004
Posts: 9457
Location: Arizona

PostPosted: Sun Sep 12, 2010 10:32 am Reply with quote

mefoo, just so you know, RavenNuke(tm) since 2.4.0 is now jQuery based and that is where I would focus your look for plug-ins and/or code as it provides a tremendous javascript framework to do so many different things. I.e., someone has probably already done the heavy lifting for you... I also know that the RN Team is committed to this fantastic library, which is why as a module developer, I too am starting to put it to good use.

_________________
Where Do YOU Stand?
HTML Newsletter::ShortLinks::Mailer::Downloads and more... 
View user's profile Send private message Visit poster's website
mefoo







PostPosted: Mon Sep 13, 2010 8:05 am Reply with quote

montego wrote:
mefoo, just so you know, RavenNuke(tm) since 2.4.0 is now jQuery based and that is where I would focus your look for plug-ins and/or code as it provides a tremendous javascript framework to do so many different things. I.e., someone has probably already done the heavy lifting for you... I also know that the RN Team is committed to this fantastic library, which is why as a module developer, I too am starting to put it to good use.


Thanks for the advice montego!! I really appreciate you salty dogs having patience with me and my lack of understanding on how this all ties together.

I will look into it and try to understand how it all works by looking at your Tegonuke(tm) admin area and seeing how you did things. Again... thanks a million!!!

(I've started making huge progress on this module for our business)

Keep in mind that huge progress to me probably means a few Mountain dews for you. Wink But I'm learning!!

Frontend:

Image

Presently working on my new form and the database functions. (I have a question here but I'll ask later with screenshots)


-----------------------------------

Edit****

Image

Ok.. here's the problem I'm trying to solve now. I have "Custom" fields on the registration form. One of those fields is "Company Name". (_COMPANYNAME)

I'm attempting to populate a (text) field on my form with the users "Company Name" based on what they entered at registration.

I have a separate file for "Functions" of my user control panel and my own forms as to keep my functions separate from the original functions.

So in this function file... I would create a new function (say $companyname) and to call to that on my form when I need it... however, I'm on shaky ground with the syntax and writing the actual query.

Insight would be great... really don't want someone to just solve it for me and spoon feed me.... maybe a few guided nudges. Thanks!!
 
mefoo







PostPosted: Mon Sep 13, 2010 10:34 am Reply with quote

Sorry for double post...(can't edit the other post)


Forgot to mention... I'm looking at the Your Account query used to display the logged in username at the top of the account page and understand how it works in relation to what i'm trying to accomplish.

Code:
isset($username) ? $username = check_html($username, 'nohtml') : $username = '';

$result = $db->sql_query('SELECT * FROM ' . $user_prefix . '_users WHERE username=\'' . addslashes($username) . '\'');
$num = $db->sql_numrows($result);
$usrinfo = $db->sql_fetchrow($result);


line by line:
Not sure what this is doing
Code:
isset($username) ? $username = check_html($username, 'nohtml') : $username = '';


Believe this is where it is checking the database for the username but not sure what the "addslashes" stuff means
Code:
$result = $db->sql_query('SELECT * FROM ' . $user_prefix . '_users WHERE username=\'' . addslashes($username) . '\'');


Grabs the row number from the database??
Code:
$num = $db->sql_numrows($result);


Assigns "$userinfo" the results of the query.
Code:
$usrinfo = $db->sql_fetchrow($result);



Sorry to be so needy and explaining myself so deeply... but I would rather learn this vs. just asking for solutions. Thanks.




Edit***

Nvm... Have figured out a way to do what I need it to do.

Code:
$companyname = $t = 1;

        list($companyname) = $db->sql_fetchrow($db->sql_query('SELECT value FROM ' . $user_prefix . '_users_field_values WHERE fid =\'' . $t . '\' AND uid = \'' . $userinfo['user_id'] . '\''));
        $value2 = explode('::', $sqlvalue['value']);
 
mefoo







PostPosted: Thu Sep 16, 2010 1:57 pm Reply with quote

Sorry guys for being such a questioner.... but I'm sorta lost when it comes to using JQuery and adding it to a RN page. (have never really used javascript or felt the need to teach myself.... till now)

I'm back at the checkbox issue and I just can't seem to find anything that really shows us beginners how to add or call to the JQuery functions and the right way to add this information to the module page.

I've read up on how to add the .js to the head of the document.

I've looked at a couple of modules that use javascript or jquery in them but since the scripts are different... the same method used doesn't seem to work for me.

Here is the effect I want to add to my page...

Code:
<!DOCTYPE html>

<html>
<head>
  <style>
  p { width:400px; }
  </style>
  <script src="http://code.jquery.com/jquery-latest.min.js"></script>
</head>
<body>
  <button>Toggle</button>

  <p>
    This is the paragraph to end all paragraphs.  You
    should feel <em>lucky</em> to have seen such a paragraph in
    your life.  Congratulations!
  </p>
<script>
    $("button").click(function () {
      $("p").slideToggle("slow");
    });
</script>

</body>
</html>

[ Only registered users can see links on this board! Get registered or login! ]

Question is... is there any "beginner" tutorial that I can read or get an Idea on how to add jquery into a RN page? If so... would you kindly point me in that direction. If not.... can someone give me a crash course to get me started in adding jquery to a page?

Help is always appreciated!
 
nuken
RavenNuke(tm) Development Team



Joined: Mar 11, 2007
Posts: 2024
Location: North Carolina

PostPosted: Thu Sep 16, 2010 3:09 pm Reply with quote

To add jquery to the head of a document, you only need to add this just after the opening <?php:
Code:
addJSToHead('includes/jquery/jquery.js', 'file');


To add js to the body add this next:

Code:
$inlineJS = '<script>

    $("button").click(function () {
      $("p").slideToggle("slow");
    });
</script> '."\n";
addJSToBody($inlineJS,'inline');


Add your html where you want it to appear.

Your css will probably cause issues with blocks and stuff. ex.
Code:
  p { width:400px; }

_________________
Tricked Out News 
View user's profile Send private message Send e-mail Visit poster's website
mefoo







PostPosted: Thu Sep 16, 2010 3:21 pm Reply with quote

OH I COULD KISS YOU RIGHT NOW!!! Thank you so much.

I wasn't aware of the "$inlineJS" part and that's where I was getting messed up.

-----

For future reference... There should be "3" elements to add jquery... correct?

1. The js to head
2. The "$inlineJS" to add to the body
3. My content

Edit**

I wasn't really using that css anyhow. I'm going to use this to show 4 drop down lists when a checkbox is checked and hide when unchecked. I just couldn't figure out the basics of jquery to a page and all that. (still very new to programming in RN and have never even heard of jquery until someone mentioned it above)

I am still trying to understand how they tie together and the basic syntax to get them to work together.
 
mefoo







PostPosted: Wed Sep 22, 2010 8:18 pm Reply with quote

Another question for anyone who might help.

I've gotten into the re-coding part of this and I've had a relitivly easy time reading and understanding the way you coded this Palbin, however, I'm stuck on something that I know is easy but I'm just missing it.

I'm adding the "taskadd" function to the custom form I created and the task add will be based on whether or not one, two or all three of the checkboxes are checked.

Here's your sql insert: (task add)(i've changed the table name prefix)

Code:
$db->sql_query('INSERT INTO ' .$prefix. '_mpstracker_tasks VALUES (NULL, "'. $project_id . '","'. $task_name. '","'.$task_description. '","'.$priority_id. '","'.$status_id. '","'.$task_percent. '","'.$date. '","'.$start_date. '","'.$finish_date .'")');



Now, the problem arises from the "$project_id" and how it is gathered. In the "taskadd.php" the code you wrote gets the id by a drop down menu and user selection. On my form... I'm trying to use those 3 checkboxes as the determining factor on whether or not a task is added to the database.

It seems simple enough to use the "name=" and recode the insert to include the value of the checkbox.... but I can't seem to figure out how to get the project_id from the previous insert that creates the project.

here's your code on the "projectinsert.php": (mind you i've added some of my own forms names=)

Code:
$db->sql_query('INSERT INTO ' . $prefix . '_mpstracker_projects VALUES (NULL, "' . $project_name . '", "' . $project_description . '", "' . $project_site . '", "' . $priority_id . '", "' . $status_id . '", "' . $project_percent . '", "' . $weight . '", "' . $featured . '", "' . $mps_request_date . '", "' . $allowreports . '", "' . $allowrequests . '", "' . $date . '",  "' . $finish_date . '", "' . $mps_request_date . '", "' . $mps_planaddress . '", "' . $mps_plancity . '", "' . $mps_plansubdivision . '", "' . $mps_planlotnumber . '", "' . $mps_planblocknumber . '", "' . $mps_plansectionnumber . '", "' . $mps_posttension . '", "' . $mps_conventslab . '", "' . $mps_piers . '", "' . $mps_soilreport . '", "' . $mps_planstate . '")'); 


You also have this just after that insert...

Code:
$projectresult = $db->sql_query('SELECT project_id FROM ' . $prefix . '_mpstracker_projects WHERE date_created="' . $date . '"');

list($project_id) = $db->sql_fetchrow($projectresult);


the "list($project_id)" seems like it retrieves the newly created project...or so I think.

I've tried this but I don't seem to get the project id from it.

Code:
$projectresult = $db->sql_query('SELECT project_id FROM ' . $prefix . '_mpstracker_projects WHERE date_created="' . $date . '"');

list($project_id) = $db->sql_fetchrow($projectresult);

$project_id = $projectresult;


///// Task Insert ////
$db->sql_query('INSERT INTO ' .$prefix. '_mpstracker_tasks VALUES (NULL, "'. $project_id . '","'. $task_name. '","'.$task_description. '","'.$priority_id. '","'.$status_id. '","'.$task_percent. '","'.$date. '","'.$start_date. '","'.$finish_date .'")');


any insight or help is appreciated. The script does create a project... but the id of the project in the db is 0.
 
Palbin







PostPosted: Wed Sep 22, 2010 8:31 pm Reply with quote

So if I am understanding this right you are creating a project, and you need to know its ID at the same time.

Code:


$result = $db->sql_query('INSERT INTO ' . $prefix . '_mpstracker_projects VALUES (NULL, "' . $project_name . '", "' . $project_description . '", "' . $project_site . '", "' . $priority_id . '", "' . $status_id . '", "' . $project_percent . '", "' . $weight . '", "' . $featured . '", "' . $mps_request_date . '", "' . $allowreports . '", "' . $allowrequests . '", "' . $date . '",  "' . $finish_date . '", "' . $mps_request_date . '", "' . $mps_planaddress . '", "' . $mps_plancity . '", "' . $mps_plansubdivision . '", "' . $mps_planlotnumber . '", "' . $mps_planblocknumber . '", "' . $mps_plansectionnumber . '", "' . $mps_posttension . '", "' . $mps_conventslab . '", "' . $mps_piers . '", "' . $mps_soilreport . '", "' . $mps_planstate . '")');

$project_id = $db->sql_nextid($result);
 
mefoo







PostPosted: Wed Sep 22, 2010 8:54 pm Reply with quote

well... the problem is that my form is going to create a project.... and "IF" any of those checkboxes are checked... I wanted to add a task(s) to the project being created.

In order to add the task(s)... there needs to be a project id to associate with the task(s).

So i guess that's what i'm getting at is yes... somehow I would have to get the project id just after it's created and before the task insert runs.

The project is created, then it returns the project_id just before it creates the corresponding task(s) so that they are associated with that newly created project.

Thanks for the help... I have a feeling i'm in a blonde moment right now.


----------------------

Edit*** I'm retarded.... thanks for that!
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Modules

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©