Page 1 of 2 12 LastLast
Results 1 to 10 of 16

Thread: Creating custom jobs from _addjobshere.php

  1. #1
    snolan74 is offline Junior Member
    Join Date
    Jul 2010
    Posts
    3

    Default Creating custom jobs from _addjobshere.php

    You'll have to excuse me because I am very new to sugar. Maybe there is a simple answer to this that I am just not seeing. I'm trying to add a module to sugar which I have followed the docs to do and all seems well up to the point where I go to create the job. I have added the job to the array (#6).

    $job_strings = array (
    0 => 'refreshJobs',
    1 => 'pollMonitoredInboxes',
    2 => 'runMassEmailCampaign',
    3 => 'pruneDatabase',
    4 => 'trimTracker',
    /*4 => 'securityAudit()',*/
    5 => 'pollMonitoredInboxesForBouncedCampaignEmails',
    6 => 'syncOTRS',


    I have also added these lines as per the instructions for the mod.

    function syncOTRS() {
    require_once ('modules/ZuckerSync/otrs.php');
    _syncOTRS();
    }


    Obviously I'm missing something because it doesn't even show as an option from the drop down in Admin -> Scheduler -> Create Scheduler


    Any help would be appreciated. Thank you in advance.

  2. #2
    kuske's Avatar
    kuske is offline Sugar Community Member
    Join Date
    Oct 2007
    Location
    Germany
    Posts
    2,597

    Default Re: Creating custom jobs from _addjobshere.php

    You did exactly the right things.

    In the Create Scheduler you should have your new job in the select box.

    Perhaps you must call an admin - repair before it works.
    Harald Kuske
    Pre-Sales Engineer Central Europe

    SUGARCRM Deutschland GmbH
    Erika-Mann-Str. 53, 80636 Munich, Germany
    Email: hkuske@sugarcrm.com
    Home: http://www.sugarcrm.com


  3. #3
    snolan74 is offline Junior Member
    Join Date
    Jul 2010
    Posts
    3

    Default Re: Creating custom jobs from _addjobshere.php

    Thanks for the reply and the advise. I did give it a try and the results were the same.

  4. #4
    kuske's Avatar
    kuske is offline Sugar Community Member
    Join Date
    Oct 2007
    Location
    Germany
    Posts
    2,597

    Default Re: Creating custom jobs from _addjobshere.php

    I added your lines exactly as you wrote to my _addJobsHere.php and found your job when creating a new scheduler in the Job dropdown...
    Attached Images Attached Images  
    Harald Kuske
    Pre-Sales Engineer Central Europe

    SUGARCRM Deutschland GmbH
    Erika-Mann-Str. 53, 80636 Munich, Germany
    Email: hkuske@sugarcrm.com
    Home: http://www.sugarcrm.com


  5. #5
    snolan74 is offline Junior Member
    Join Date
    Jul 2010
    Posts
    3

    Default Re: Creating custom jobs from _addjobshere.php

    Oh I totally believe you. This now just takes me in a different direction. Now I am just wondering if something was missed on the install of sugar which was performed by someone else. I'm going to go through the docs section Configuring the Scheduler - UNIX and Linux systems and see if anything was missed or incorrectly configured. I'll post back if I find anything. Thanks again kuske. I think this might have me at least headed down the right path.

  6. #6
    pvanoord is offline Junior Member
    Join Date
    Feb 2011
    Posts
    1

    Default Re: Creating custom jobs from _addjobshere.php

    Hello,

    Is it possible to make it work with OTRS3 and SugarCRM 6.1 ?

  7. #7
    item is offline Sugar Community Member
    Join Date
    Oct 2010
    Location
    BELGIUM
    Posts
    193

    Default Re: Creating custom jobs from _addjobshere.php

    Hello,

    Because in original file, we have :
    PHP Code:
    if (file_exists('custom/modules/Schedulers/_AddJobsHere.php')) {
        require(
    'custom/modules/Schedulers/_AddJobsHere.php');
    }
    ?> 
    i have do in upgrade-safe :

    PHP Code:
    <?php

        array_push
    ($job_strings'custom_function');

        function 
    custom_function()
        {
            
    //custom code

            //return true for completed
            
    return true;
        }

    ?>
    But nothing appears in CE 6.1.

    Regards

  8. #8
    andopes's Avatar
    andopes is offline A Sugar Hero | Help Forum Moderator
    Join Date
    Jul 2006
    Location
    São Paulo - Brazil
    Posts
    8,335

    Default Re: Creating custom jobs from _addjobshere.php

    You need to create an extended language and add a label for "custom_function".

    PHP Code:
    $mod_strings['LBL_CUSTOM_FUNCTION'] = 'Whatever you want'
    Note the prefix "LBL_" and function name in upercase.

    Cheers
    André Lopes
    DevToolKit / Project of the Month - June 2009
    Lampada Global Services- Open Source Solutions
    Avenida Ipiranga, 318
    Bloco B - CJ 1602
    São Paulo, SP 01046-010
    Brazil
    Office: +55 11 3237-3110
    Mobile: +55 11 7636-5859
    e-mail: andre@lampadaglobal.com

    Lampada Global delivers offshore software development and support services to customers around the world.
    Lampada is proud to be a SugarCRM Gold Partner, revolutionizing Customer Relationship Management.

    I DO NOT answer questions through PM and Email. If you need some help post your question into SugarForum.

  9. #9
    item is offline Sugar Community Member
    Join Date
    Oct 2010
    Location
    BELGIUM
    Posts
    193

    Default Re: Creating custom jobs from _addjobshere.php

    Hello,
    This file exist too in
    custom/modules/Scheduler/Ext/Language/en_us.lang.ext.php
    and
    custom/modules/Scheduler/Ext/Language/en_us.custom.php
    and look like this :

    PHP Code:
    <?php 
     
    //WARNING: The contents of this file are auto-generated


    //THIS FILE IS AUTO GENERATED, DO NOT MODIFY
    $mod_strings['LBL_CUSTOM_FUNCTION'] = 'Custom Function';


    ?>
    Maybe a restriction in CE ?

    Regards

  10. #10
    andopes's Avatar
    andopes is offline A Sugar Hero | Help Forum Moderator
    Join Date
    Jul 2006
    Location
    São Paulo - Brazil
    Posts
    8,335

    Default Re: Creating custom jobs from _addjobshere.php

    The correct file to add this label is:
    custom/Extension/modules/Scheduler/Ext/Language/en_us.custom.php

    Then go to Admin -> Repair -> Quick Repair and Rebuild

    Cheers
    André Lopes
    DevToolKit / Project of the Month - June 2009
    Lampada Global Services- Open Source Solutions
    Avenida Ipiranga, 318
    Bloco B - CJ 1602
    São Paulo, SP 01046-010
    Brazil
    Office: +55 11 3237-3110
    Mobile: +55 11 7636-5859
    e-mail: andre@lampadaglobal.com

    Lampada Global delivers offshore software development and support services to customers around the world.
    Lampada is proud to be a SugarCRM Gold Partner, revolutionizing Customer Relationship Management.

    I DO NOT answer questions through PM and Email. If you need some help post your question into SugarForum.

Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 2
    Last Post: 2010-06-18, 09:06 AM
  2. Sugarcrm jobs@enjayworld.com
    By enjayworld in forum Help
    Replies: 0
    Last Post: 2010-04-03, 11:19 AM
  3. Sap konsulter jobs !
    By SAP KONSULTER in forum Swedish
    Replies: 0
    Last Post: 2009-10-01, 12:12 PM
  4. is schedulers/_AddJobsHere.php upgrade-safe?
    By graatz in forum Developer Help
    Replies: 5
    Last Post: 2009-05-20, 11:46 AM
  5. Replies: 4
    Last Post: 2008-04-20, 08:52 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •