cadsite

Topic: edit job trough admin

It would be very very easy if we could edit a job trough the admin panel.

pufferdude

Re: edit job trough admin

I second this request. Not being able to edit a job through the admin is a major pain.

Jachobsen

Re: edit job trough admin

Think so too... when someone adds something that is not a valid job post but just spam you should have the option of removing and/or editing it..

keskese

Re: edit job trough admin

I was not able to use admin from the beginning but I found it very easy to replace all data through MySql

I think some hosting plans just are not suitable for jobber - no matter how much you try and whatever you do...

putypuruty

Re: edit job trough admin

Hi, guys.

If time permits me, I'll implement editing a job in admin. I'll let you know when it's done, together with instructions on how to integrate it in you site.

cadsite

Re: edit job trough admin

That would be absolutely great!

putypuruty

Re: edit job trough admin

Hi.

I've had some time these days and I've implemented this feature smile It allows you to edit exactly the same data as when posting a new job. You can also preview the changes before saving.

I'll post here what you have to do in order to have edit job in your admin section.

I'd really appreciate it if some of you guys could give it a try and report any problems. I've tried to keep the number of changes you have to make to a minimum and thus the code is a little bit ugly wink

First, you will have to edit some existing files:

1. open /admin/index.php and add the following lines before the 'default' keyword (before line 162):

Code:

case 'edit-post':
    if(!isset($_SESSION['AdminId']))
    {
        redirect_to(BASE_URL);
        exit;
    }
    require_once 'page_edit_post.php';
    $flag = 1;
    break;

You should now have something similar to this:

Code:
case 'edit-post':
    if(!isset($_SESSION['AdminId']))
    {
         redirect_to(BASE_URL);
         exit;
    }
    require_once 'page_edit_post.php';
    $flag = 1;
    break;
default:
    $flag = 0;    
    break;

2. open /admin/_templates/header.tpl and add the following lines before the line '{foreach from=$js item=j}':

Code:

    <script src="{$BASE_URL}js/jquery.validate.pack.js" type="text/javascript" charset="iso-8859-1"></script>
    <script src="{$BASE_URL}js/browser_detect.js" type="text/javascript"></script>

3. open  /admin/_templates/posts-loop.tpl and add the following line before '{if $job.is_active == 0}':

Code:
<a href="{$BASE_URL_ADMIN}edit-post/{$job.id}/" title="edit"><img src="{$BASE_URL}img/icon_edit.gif" alt="edit" /></a>

After you make these changes, you will have to download some files from the jobberbase source code repository:

1. save http://jobberbase.googlecode.com/svn/tr … n_edit.gif to /img folder
2. save http://jobberbase.googlecode.com/svn/tr … t_post.php to /admin folder
3. save http://jobberbase.googlecode.com/svn-hi … review.tpl to /admin/_templates folder
4. save http://jobberbase.googlecode.com/svn-hi … t-post.tpl to /admin/_templates folder

After all these steps are done, you will have an 'edit post' icon next to every posting in the admin section.

Let me know how it works.

PS: I've tried to test it as best as possible. You should backup your data before testing or best, you could try it on a local machine.

Last edited by putypuruty (2008-11-22 16:13:19)

3x-a-d3-u5

Re: edit job trough admin

Will we get to see this in an upgrade release?

putypuruty

Re: edit job trough admin

Yes, it should be part of the next release. But until then, maybe you could give it a try wink

hailpza

Re: edit job trough admin

I was able to get this added, and I am by no means a coder.  wink

Very simple, thanks for the detailed instructions.

I did see this error show up on the admin page when I selected a job to edit:

Notice: Undefined variable: translations in /home/gjh11/html_test/beta/admin/page_edit_post.php on line 126

N2S

Re: edit job trough admin

works with me.
I get a weird error when trying to edit the job..

Code:
Notice: Undefined variable: translations in /home2/thernbki/public_html/admin/page_edit_post.php on line 126

but everything works..thanks!

http://i34.tinypic.com/2affofk.png

putypuruty

Re: edit job trough admin

Hi guys!

I'm happy that it works wink

That warning message that you get has no impact on the edit post functionality. You get it because we have added internationalization (i18n) support also for the admin section. But this code is not part of jobberbase 1.5 beta 1.

It will be in the next release.

putypuruty

Re: edit job trough admin

Hi guys.

Whilst making the edit-job feature, I've introduced a subtle bug sad (but it doesn't affect editing a post).

I'll ask all of you who have implemented the 'edit post' feature in their admin section to repeat the first step - I have updated the mini-tutorial, please take the code from here.