Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Multiple Link Editors

Quote Reply
Multiple Link Editors
Hi all,

I'm playing around with a few things and came across an interesting situation. I would like to have a link entered by normal means from USER#1. Then, I'd like to have USER#2 sign in and modify or add data to the same link. Later, USER#3 will log on and add a little more info and make a few changes. Finally, USER#4 will logon and review everything and make any final changes before it's finished up.

I know I can setup several different editors to log in and use the browser to do this, but is there a way to have them log on by normal means and just use the modify page? The multi-step approach would only allow certain people to see the fields they need to enter, while others would login and see only what they need to see and add or change. Of course the initial submission would have a "master" account to oversee all of it.

I've tried using just about all the globals I can find, but I still can't get it to allow anyone to see the modification link unless they are the LinkOwner.

Any input or suggestions are eagerly appreciated!
Perl Hopefull
Quote Reply
Re: [stilton] Multiple Link Editors In reply to
Hi,

This requires a change to some of the logic of Links. I actually built this into the logo/upload program, sidewaysl, since I needed to allow editors/admins to view pending links to validate images.

You would need to alter modify.cgi to allow an editor override to see pending links.

For an example, in Modify.pm:

Code:
if ( $USER->{'Status'} eq 'Administrator') { #
$sth = $link_db->select ( { ID => $lid }); #
} else { #
$sth = $link_db->select ( { ID => $lid, LinkOwner => $USER->{Username} }); #
} #


that allows any user who is Administrator status to request the link.

You'd need to make similar changes, and add some code to a few routines to allow Editors to make changes to pending links.

You'd maybe want to limit their ability to view/modify like that to pending links.

You'd maybe want if Status eq "Editor" to let them view only pending links via modify.cgi, and make changes to those links. They'd be able to see all links via the Editors links on the standard browser interface.

This _could_ be a plugin, but there is a lot of overhead that rewriting the modify code will bypass.

Future compatibility? If your modified Modify.pm doesn't work in an upgrade, then move your modified code into a plugin at that time <G>. But the user scripts change very little from upgrade to upgrade, as they work via interface calls mostly, and that doesn't change much. The big changes are added features, and back-end improvements, so like the templates, the most you'll "lose" is in an upgrade new features would have to be added back in, your old code wouldn't "not work".


PUGDOG´┐Ż Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.
Quote Reply
Re: [pugdog] Multiple Link Editors In reply to
Hi Pugdog..long time since I've talked with you!

Thanks for the reply! I went into modify.pm and went to the subroutine
Code:


sub _modify_passed_in {
# --------------------------------------------------------
# Display link that was passed in.
#
my ($name, $category);
my $lid = $IN->param('LinkID');
my $link_db = $DB->table('Links');
my $sth = $link_db->select ( { ID => $lid, LinkOwner => $USER->{Username} });
if ($sth->rows) {


And made changes as such:

Code:


sub _modify_passed_in {
# --------------------------------------------------------
# Display link that was passed in.
#
my ($name, $category);
my $lid = $IN->param('LinkID');
my $link_db = $DB->table('Links');
if ( $USER->{'Status'} eq 'Editor') { $sth = $link_db->select ( { ID => $lid });
}
else {
$sth = $link_db->select ( { ID => $lid, LinkOwner => $USER->{Username} });
}


For whatever reason, though I get a 500 error. I'm not going to worry about validation as they are automatically validated by registered users. It's basically just for project management tasks. I thought a simple solution might be easily accessible rather than customizing the browser editor to what I want.

Thanks again for your help,
Perl Hopefull