예제 #1
0
function installJJWHooks()
{
    $hooks = array(array('module' => 'Prospects', 'hook' => 'before_save', 'order' => 77, 'description' => 'updateGeocodeInfo', 'file' => 'modules/Prospects/ProspectsJjwg_MapsLogicHook.php', 'class' => 'ProspectsJjwg_MapsLogicHook', 'function' => 'updateGeocodeInfo'), array('module' => 'Prospects', 'hook' => 'after_save', 'order' => 77, 'description' => 'updateRelatedMeetingsGeocodeInfo', 'file' => 'modules/Prospects/ProspectsJjwg_MapsLogicHook.php', 'class' => 'ProspectsJjwg_MapsLogicHook', 'function' => 'updateRelatedMeetingsGeocodeInfo'), array('module' => 'Leads', 'hook' => 'before_save', 'order' => 77, 'description' => 'updateGeocodeInfo', 'file' => 'modules/Leads/LeadsJjwg_MapsLogicHook.php', 'class' => 'LeadsJjwg_MapsLogicHook', 'function' => 'updateGeocodeInfo'), array('module' => 'Leads', 'hook' => 'after_save', 'order' => 77, 'description' => 'updateRelatedMeetingsGeocodeInfo', 'file' => 'modules/Leads/LeadsJjwg_MapsLogicHook.php', 'class' => 'LeadsJjwg_MapsLogicHook', 'function' => 'updateRelatedMeetingsGeocodeInfo'), array('module' => 'Contacts', 'hook' => 'before_save', 'order' => 77, 'description' => 'updateGeocodeInfo', 'file' => 'modules/Contacts/ContactsJjwg_MapsLogicHook.php', 'class' => 'ContactsJjwg_MapsLogicHook', 'function' => 'updateGeocodeInfo'), array('module' => 'Contacts', 'hook' => 'after_save', 'order' => 77, 'description' => 'updateRelatedMeetingsGeocodeInfo', 'file' => 'modules/Contacts/ContactsJjwg_MapsLogicHook.php', 'class' => 'ContactsJjwg_MapsLogicHook', 'function' => 'updateRelatedMeetingsGeocodeInfo'), array('module' => 'Meetings', 'hook' => 'after_save', 'order' => 77, 'description' => 'updateMeetingGeocodeInfo', 'file' => 'modules/Meetings/MeetingsJjwg_MapsLogicHook.php', 'class' => 'MeetingsJjwg_MapsLogicHook', 'function' => 'updateMeetingGeocodeInfo'), array('module' => 'Opportunities', 'hook' => 'before_save', 'order' => 77, 'description' => 'updateGeocodeInfo', 'file' => 'modules/Opportunities/OpportunitiesJjwg_MapsLogicHook.php', 'class' => 'OpportunitiesJjwg_MapsLogicHook', 'function' => 'updateGeocodeInfo'), array('module' => 'Opportunities', 'hook' => 'after_save', 'order' => 77, 'description' => 'updateRelatedMeetingsGeocodeInfo', 'file' => 'modules/Opportunities/OpportunitiesJjwg_MapsLogicHook.php', 'class' => 'OpportunitiesJjwg_MapsLogicHook', 'function' => 'updateRelatedMeetingsGeocodeInfo'), array('module' => 'Opportunities', 'hook' => 'after_save', 'order' => 78, 'description' => 'updateRelatedProjectGeocodeInfo', 'file' => 'modules/Opportunities/OpportunitiesJjwg_MapsLogicHook.php', 'class' => 'OpportunitiesJjwg_MapsLogicHook', 'function' => 'updateRelatedProjectGeocodeInfo'), array('module' => 'Opportunities', 'hook' => 'after_relationship_add', 'order' => 77, 'description' => 'addRelationship', 'file' => 'modules/Opportunities/OpportunitiesJjwg_MapsLogicHook.php', 'class' => 'OpportunitiesJjwg_MapsLogicHook', 'function' => 'addRelationship'), array('module' => 'Opportunities', 'hook' => 'after_relationship_delete', 'order' => 77, 'description' => 'deleteRelationship', 'file' => 'modules/Opportunities/OpportunitiesJjwg_MapsLogicHook.php', 'class' => 'OpportunitiesJjwg_MapsLogicHook', 'function' => 'deleteRelationship'), array('module' => 'Cases', 'hook' => 'before_save', 'order' => 77, 'description' => 'updateGeocodeInfo', 'file' => 'modules/Cases/CasesJjwg_MapsLogicHook.php', 'class' => 'CasesJjwg_MapsLogicHook', 'function' => 'updateGeocodeInfo'), array('module' => 'Cases', 'hook' => 'after_save', 'order' => 77, 'description' => 'updateRelatedMeetingsGeocodeInfo', 'file' => 'modules/Cases/CasesJjwg_MapsLogicHook.php', 'class' => 'CasesJjwg_MapsLogicHook', 'function' => 'updateRelatedMeetingsGeocodeInfo'), array('module' => 'Cases', 'hook' => 'after_relationship_add', 'order' => 77, 'description' => 'addRelationship', 'file' => 'modules/Cases/CasesJjwg_MapsLogicHook.php', 'class' => 'CasesJjwg_MapsLogicHook', 'function' => 'addRelationship'), array('module' => 'Cases', 'hook' => 'after_relationship_delete', 'order' => 77, 'description' => 'deleteRelationship', 'file' => 'modules/Cases/CasesJjwg_MapsLogicHook.php', 'class' => 'CasesJjwg_MapsLogicHook', 'function' => 'deleteRelationship'), array('module' => 'Project', 'hook' => 'before_save', 'order' => 77, 'description' => 'updateGeocodeInfo', 'file' => 'modules/Project/ProjectJjwg_MapsLogicHook.php', 'class' => 'ProjectJjwg_MapsLogicHook', 'function' => 'updateGeocodeInfo'), array('module' => 'Project', 'hook' => 'after_save', 'order' => 77, 'description' => 'updateRelatedMeetingsGeocodeInfo', 'file' => 'modules/Project/ProjectJjwg_MapsLogicHook.php', 'class' => 'ProjectJjwg_MapsLogicHook', 'function' => 'updateRelatedMeetingsGeocodeInfo'), array('module' => 'Project', 'hook' => 'after_relationship_add', 'order' => 77, 'description' => 'addRelationship', 'file' => 'modules/Project/ProjectJjwg_MapsLogicHook.php', 'class' => 'ProjectJjwg_MapsLogicHook', 'function' => 'addRelationship'), array('module' => 'Project', 'hook' => 'after_relationship_delete', 'order' => 77, 'description' => 'deleteRelationship', 'file' => 'modules/Project/ProjectJjwg_MapsLogicHook.php', 'class' => 'ProjectJjwg_MapsLogicHook', 'function' => 'deleteRelationship'), array('module' => 'Accounts', 'hook' => 'before_save', 'order' => 77, 'description' => 'updateGeocodeInfo', 'file' => 'modules/Accounts/AccountsJjwg_MapsLogicHook.php', 'class' => 'AccountsJjwg_MapsLogicHook', 'function' => 'updateGeocodeInfo'), array('module' => 'Accounts', 'hook' => 'after_save', 'order' => 77, 'description' => 'updateRelatedMeetingsGeocodeInfo', 'file' => 'modules/Accounts/AccountsJjwg_MapsLogicHook.php', 'class' => 'AccountsJjwg_MapsLogicHook', 'function' => 'updateRelatedMeetingsGeocodeInfo'), array('module' => 'Accounts', 'hook' => 'after_save', 'order' => 78, 'description' => 'updateRelatedProjectGeocodeInfo', 'file' => 'modules/Accounts/AccountsJjwg_MapsLogicHook.php', 'class' => 'AccountsJjwg_MapsLogicHook', 'function' => 'updateRelatedProjectGeocodeInfo'), array('module' => 'Accounts', 'hook' => 'after_save', 'order' => 79, 'description' => 'updateRelatedOpportunitiesGeocodeInfo', 'file' => 'modules/Accounts/AccountsJjwg_MapsLogicHook.php', 'class' => 'AccountsJjwg_MapsLogicHook', 'function' => 'updateRelatedOpportunitiesGeocodeInfo'), array('module' => 'Accounts', 'hook' => 'after_save', 'order' => 80, 'description' => 'updateRelatedCasesGeocodeInfo', 'file' => 'modules/Accounts/AccountsJjwg_MapsLogicHook.php', 'class' => 'AccountsJjwg_MapsLogicHook', 'function' => 'updateRelatedCasesGeocodeInfo'), array('module' => 'Accounts', 'hook' => 'after_relationship_add', 'order' => 77, 'description' => 'addRelationship', 'file' => 'modules/Accounts/AccountsJjwg_MapsLogicHook.php', 'class' => 'AccountsJjwg_MapsLogicHook', 'function' => 'addRelationship'), array('module' => 'Accounts', 'hook' => 'after_relationship_delete', 'order' => 77, 'description' => 'deleteRelationship', 'file' => 'modules/Accounts/AccountsJjwg_MapsLogicHook.php', 'class' => 'AccountsJjwg_MapsLogicHook', 'function' => 'deleteRelationship'));
    foreach ($hooks as $hook) {
        check_logic_hook_file($hook['module'], $hook['hook'], array($hook['order'], $hook['description'], $hook['file'], $hook['class'], $hook['function']));
    }
}
예제 #2
0
/**
 *
 * SugarCRM Community Edition is a customer relationship management program developed by
 * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
 *
 * SuiteCRM is an extension to SugarCRM Community Edition developed by SalesAgility Ltd.
 * Copyright (C) 2011 - 2016 SalesAgility Ltd.
 *
 * This program is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Affero General Public License version 3 as published by the
 * Free Software Foundation with the addition of the following permission added
 * to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
 * IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
 * OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE.  See the GNU Affero General Public License for more
 * details.
 *
 * You should have received a copy of the GNU Affero General Public License along with
 * this program; if not, see http://www.gnu.org/licenses or write to the Free
 * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
 * 02110-1301 USA.
 *
 * You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
 * SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
 *
 * The interactive user interfaces in modified source and object code versions
 * of this program must display Appropriate Legal Notices, as required under
 * Section 5 of the GNU Affero General Public License version 3.
 *
 * In accordance with Section 7(b) of the GNU Affero General Public License version 3,
 * these Appropriate Legal Notices must retain the display of the "Powered by
 * SugarCRM" logo and "Supercharged by SuiteCRM" logo. If the display of the logos is not
 * reasonably feasible for  technical reasons, the Appropriate Legal Notices must
 * display the words  "Powered by SugarCRM" and "Supercharged by SuiteCRM".
 */
function install_reschedule()
{
    require_once 'ModuleInstall/ModuleInstaller.php';
    $hooks = array(array('module' => 'Calls', 'hook' => 'process_record', 'order' => 1, 'description' => 'count', 'file' => 'modules/Calls_Reschedule/reschedule_count.php', 'class' => 'reschedule_count', 'function' => 'count'));
    foreach ($hooks as $hook) {
        check_logic_hook_file($hook['module'], $hook['hook'], array($hook['order'], $hook['description'], $hook['file'], $hook['class'], $hook['function']));
    }
}
예제 #3
0
function installSSHooks()
{
    require_once 'ModuleInstall/ModuleInstaller.php';
    $hooks = array(array('module' => '', 'hook' => 'after_ui_footer', 'order' => 10, 'description' => 'popup_onload', 'file' => 'modules/SecurityGroups/AssignGroups.php', 'class' => 'AssignGroups', 'function' => 'popup_onload'), array('module' => '', 'hook' => 'after_ui_frame', 'order' => 20, 'description' => 'mass_assign', 'file' => 'modules/SecurityGroups/AssignGroups.php', 'class' => 'AssignGroups', 'function' => 'mass_assign'), array('module' => '', 'hook' => 'after_save', 'order' => 30, 'description' => 'popup_select', 'file' => 'modules/SecurityGroups/AssignGroups.php', 'class' => 'AssignGroups', 'function' => 'popup_select'));
    foreach ($hooks as $hook) {
        check_logic_hook_file($hook['module'], $hook['hook'], array($hook['order'], $hook['description'], $hook['file'], $hook['class'], $hook['function']));
    }
}
예제 #4
0
function installAOPHooks()
{
    require_once 'ModuleInstall/ModuleInstaller.php';
    $hooks = array(array('module' => 'Contacts', 'hook' => 'after_save', 'order' => 1, 'description' => 'Update Portal', 'file' => 'modules/Contacts/updatePortal.php', 'class' => 'updatePortal', 'function' => 'updateUser'), array('module' => 'Cases', 'hook' => 'before_save', 'order' => 10, 'description' => 'Save case updates', 'file' => 'modules/AOP_Case_Updates/CaseUpdatesHook.php', 'class' => 'CaseUpdatesHook', 'function' => 'saveUpdate'), array('module' => 'Cases', 'hook' => 'before_save', 'order' => 11, 'description' => 'Save case events', 'file' => 'modules/AOP_Case_Events/CaseEventsHook.php', 'class' => 'CaseEventsHook', 'function' => 'saveUpdate'), array('module' => 'Cases', 'hook' => 'before_save', 'order' => 12, 'description' => 'Case closure prep', 'file' => 'modules/AOP_Case_Updates/CaseUpdatesHook.php', 'class' => 'CaseUpdatesHook', 'function' => 'closureNotifyPrep'), array('module' => 'Cases', 'hook' => 'after_save', 'order' => 10, 'description' => 'Send contact case closure email', 'file' => 'modules/AOP_Case_Updates/CaseUpdatesHook.php', 'class' => 'CaseUpdatesHook', 'function' => 'closureNotify'), array('module' => 'Cases', 'hook' => 'after_relationship_add', 'order' => 9, 'description' => 'Assign account', 'file' => 'modules/AOP_Case_Updates/CaseUpdatesHook.php', 'class' => 'CaseUpdatesHook', 'function' => 'assignAccount'), array('module' => 'Cases', 'hook' => 'after_relationship_add', 'order' => 10, 'description' => 'Send contact case email', 'file' => 'modules/AOP_Case_Updates/CaseUpdatesHook.php', 'class' => 'CaseUpdatesHook', 'function' => 'creationNotify'), array('module' => 'Cases', 'hook' => 'after_retrieve', 'order' => 10, 'description' => 'Filter HTML', 'file' => 'modules/AOP_Case_Updates/CaseUpdatesHook.php', 'class' => 'CaseUpdatesHook', 'function' => 'filterHTML'), array('module' => 'Emails', 'hook' => 'after_save', 'order' => 10, 'description' => 'Save email case updates', 'file' => 'modules/AOP_Case_Updates/CaseUpdatesHook.php', 'class' => 'CaseUpdatesHook', 'function' => 'saveEmailUpdate'));
    foreach ($hooks as $hook) {
        check_logic_hook_file($hook['module'], $hook['hook'], array($hook['order'], $hook['description'], $hook['file'], $hook['class'], $hook['function']));
    }
}
function installAODHooks()
{
    require_once 'ModuleInstall/ModuleInstaller.php';
    $hooks = array(array('module' => '', 'hook' => 'after_save', 'order' => 1, 'description' => 'AOD Index Changes', 'file' => 'modules/AOD_Index/AOD_LogicHooks.php', 'class' => 'AOD_LogicHooks', 'function' => 'saveModuleChanges'), array('module' => '', 'hook' => 'after_delete', 'order' => 1, 'description' => 'AOD Index changes', 'file' => 'modules/AOD_Index/AOD_LogicHooks.php', 'class' => 'AOD_LogicHooks', 'function' => 'saveModuleDelete'), array('module' => '', 'hook' => 'after_restore', 'order' => 1, 'description' => 'AOD Index changes', 'file' => 'modules/AOD_Index/AOD_LogicHooks.php', 'class' => 'AOD_LogicHooks', 'function' => 'saveModuleRestore'));
    foreach ($hooks as $hook) {
        check_logic_hook_file($hook['module'], $hook['hook'], array($hook['order'], $hook['description'], $hook['file'], $hook['class'], $hook['function']));
    }
}
예제 #6
0
/**
 *
 * SugarCRM Community Edition is a customer relationship management program developed by
 * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
 *
 * SuiteCRM is an extension to SugarCRM Community Edition developed by SalesAgility Ltd.
 * Copyright (C) 2011 - 2016 SalesAgility Ltd.
 *
 * This program is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Affero General Public License version 3 as published by the
 * Free Software Foundation with the addition of the following permission added
 * to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
 * IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
 * OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE.  See the GNU Affero General Public License for more
 * details.
 *
 * You should have received a copy of the GNU Affero General Public License along with
 * this program; if not, see http://www.gnu.org/licenses or write to the Free
 * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
 * 02110-1301 USA.
 *
 * You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
 * SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
 *
 * The interactive user interfaces in modified source and object code versions
 * of this program must display Appropriate Legal Notices, as required under
 * Section 5 of the GNU Affero General Public License version 3.
 *
 * In accordance with Section 7(b) of the GNU Affero General Public License version 3,
 * these Appropriate Legal Notices must retain the display of the "Powered by
 * SugarCRM" logo and "Supercharged by SuiteCRM" logo. If the display of the logos is not
 * reasonably feasible for  technical reasons, the Appropriate Legal Notices must
 * display the words  "Powered by SugarCRM" and "Supercharged by SuiteCRM".
 */
function install_projects()
{
    require_once 'ModuleInstall/ModuleInstaller.php';
    $hooks = array(array('module' => 'Projects', 'hook' => 'before_delete', 'order' => 1, 'description' => 'Delete Project Tasks', 'file' => 'modules/Project/delete_project_tasks.php', 'class' => 'delete_project_tasks', 'function' => 'delete_tasks'), array('module' => 'ProjectTask', 'hook' => 'before_save', 'order' => 1, 'description' => 'update project end date', 'file' => 'modules/ProjectTask/updateDependencies.php', 'class' => 'updateDependencies', 'function' => 'update_dependency'), array('module' => 'ProjectTask', 'hook' => 'after_save', 'order' => 1, 'description' => 'update project end date', 'file' => 'modules/ProjectTask/updateProject.php', 'class' => 'updateEndDate', 'function' => 'update'));
    foreach ($hooks as $hook) {
        check_logic_hook_file($hook['module'], $hook['hook'], array($hook['order'], $hook['description'], $hook['file'], $hook['class'], $hook['function']));
    }
}
예제 #7
0
/**
 *
 * SugarCRM Community Edition is a customer relationship management program developed by
 * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
 *
 * SuiteCRM is an extension to SugarCRM Community Edition developed by SalesAgility Ltd.
 * Copyright (C) 2011 - 2016 SalesAgility Ltd.
 *
 * This program is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Affero General Public License version 3 as published by the
 * Free Software Foundation with the addition of the following permission added
 * to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
 * IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
 * OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE.  See the GNU Affero General Public License for more
 * details.
 *
 * You should have received a copy of the GNU Affero General Public License along with
 * this program; if not, see http://www.gnu.org/licenses or write to the Free
 * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
 * 02110-1301 USA.
 *
 * You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
 * SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
 *
 * The interactive user interfaces in modified source and object code versions
 * of this program must display Appropriate Legal Notices, as required under
 * Section 5 of the GNU Affero General Public License version 3.
 *
 * In accordance with Section 7(b) of the GNU Affero General Public License version 3,
 * these Appropriate Legal Notices must retain the display of the "Powered by
 * SugarCRM" logo and "Supercharged by SuiteCRM" logo. If the display of the logos is not
 * reasonably feasible for  technical reasons, the Appropriate Legal Notices must
 * display the words  "Powered by SugarCRM" and "Supercharged by SuiteCRM".
 */
function install_social()
{
    require_once 'ModuleInstall/ModuleInstaller.php';
    $hooks = array(array('module' => '', 'hook' => 'after_ui_frame', 'order' => 1, 'description' => 'Load Social JS', 'file' => 'include/social/hooks.php', 'class' => 'hooks', 'function' => 'load_js'));
    foreach ($hooks as $hook) {
        check_logic_hook_file($hook['module'], $hook['hook'], array($hook['order'], $hook['description'], $hook['file'], $hook['class'], $hook['function']));
    }
}
function pre_install()
{
    require_once 'include/utils.php';
    // Hook to check field level access
    check_logic_hook_file("", "after_retrieve", array(1, 'acl_fields', 'modules/acl_fields/fields_logic.php', 'acl_fields_logic', 'limit_views'));
    // Backup the original sugar templates
    copy("include/EditView/EditView.tpl", "include/EditView/EditViewOriginal.tpl");
    copy("include/DetailView/DetailView.tpl", "include/DetailView/DetailViewOriginal.tpl");
    //ER2012
    copy("include/ListView/ListViewGeneric.tpl", "include/ListView/ListViewGenericOriginal.tpl");
    copy("include/ListView/ListViewData.php", "include/ListView/ListViewData.php");
}
예제 #9
0
function pre_install()
{
    require_once 'include/utils.php';
    check_logic_hook_file("Meetings", "before_save", array(1, "Openmeetings", "modules/Openmeetings/openmeetingsRoomManagament.php", "openmeetingsRoomManagament", "createRoomWithMod"));
    check_logic_hook_file("Meetings", "before_save", array(2, "Openmeetings", "modules/Openmeetings/openmeetingsRoomManagament.php", "openmeetingsRoomManagament", "getInvitationHash"));
    check_logic_hook_file("Meetings", "before_save", array(2, "Openmeetings", "modules/Openmeetings/openmeetingsRoomManagament.php", "openmeetingsRoomManagament", "sendInvitationHash"));
    /*
    $hook_array['after_login'][] = Array(1, 'OpenMeetings', 'modules/Openmeetings/openmeetingsRoomManagament.php','openmeetingsRoomManagament', 'createMyRoomWithMod');
    $hook_array['before_save'][] = Array(1, 'OpenMeetings', 'modules/Openmeetings/openmeetingsRoomManagament.php','openmeetingsRoomManagament', 'createRoomWithMod');
    //$hook_array['before_save'][] = Array(2, 'OpenMeetings', 'modules/Openmeetings/openmeetingsRoomManagament.php','openmeetingsRoomManagament', 'getInvitationHash');
    $hook_array['before_save'][] = Array(2, 'OpenMeetings', 'modules/Openmeetings/openmeetingsRoomManagament.php','openmeetingsRoomManagament', 'sendInvitationHash');  
    */
}
예제 #10
0
 public function save()
 {
     $hook = $this->getActionArray();
     if (!empty($this->fetched_row)) {
         $oldhook = $hook;
         // since remove_logic_hook compares 1, 3 and 4
         $oldhook[3] = 'WebLogicHook';
         remove_logic_hook($this->webhook_target_module, $this->trigger_event, $oldhook);
     }
     parent::save();
     $hook[5] = $this->id;
     check_logic_hook_file($this->webhook_target_module, $this->trigger_event, $hook);
 }
예제 #11
0
 public function saveMappingHook($mapping)
 {
     $removeList = $this->allowedModuleList;
     if (is_array($mapping['beans'])) {
         foreach ($mapping['beans'] as $module => $ignore) {
             unset($removeList[$module]);
             check_logic_hook_file($module, 'after_ui_frame', array(1, $module . ' InsideView frame', 'modules/Connectors/connectors/sources/ext/rest/insideview/InsideViewLogicHook.php', 'InsideViewLogicHook', 'showFrame'));
         }
     }
     foreach ($removeList as $module) {
         remove_logic_hook($module, 'after_ui_frame', array(1, $module . ' InsideView frame', 'modules/Connectors/connectors/sources/ext/rest/insideview/InsideViewLogicHook.php', 'InsideViewLogicHook', 'showFrame'));
     }
     return parent::saveMappingHook($mapping);
 }
예제 #12
0
function pre_install()
{
    require_once 'include/utils.php';
    // creates logic hook that inserts Asterisk JavaScript into every UI frame
    check_logic_hook_file("", "after_ui_frame", array(1, 'Asterisk', 'custom/modules/Asterisk/include/AsteriskJS.php', 'AsteriskJS', 'echoJavaScript'));
    // creates Asterisk logging table
    if (empty($db)) {
        if (!class_exists('DBManagerFactory')) {
            die("no db available");
        }
        $db =& DBManagerFactory::getInstance();
    }
    $query = "DROP TABLE IF EXISTS asterisk_log";
    $db->query($query, false, "Error dropping call table: " . $query);
    $query = "CREATE TABLE asterisk_log (";
    $query .= "id int(10) unsigned NOT NULL auto_increment,";
    $query .= "call_record_id char(36) default NULL,";
    $query .= "asterisk_id varchar(45) default NULL,";
    $query .= "callstate varchar(10) default NULL,";
    $query .= "callerID varchar(45) default NULL,";
    $query .= "callerName varchar(45) default NULL,";
    $query .= "channel varchar(30) default NULL,";
    // $query .= "timestampCall varchar(30) default NULL,";
    // $query .= "timestampLink varchar(30) default NULL,";
    // $query .= "timestampHangup varchar(30) default NULL,";
    $query .= "timestampCall datetime default NULL,";
    $query .= "timestampLink datetime default NULL,";
    $query .= "timestampHangup datetime default NULL,";
    $query .= "direction varchar(1) default NULL,";
    $query .= "hangup_cause integer default NULL,";
    $query .= "hangup_cause_txt varchar(45) default NULL,";
    $query .= "asterisk_dest_id varchar(45) default NULL,";
    $query .= "recipientID varchar(45) default NULL,";
    $query .= "PRIMARY KEY (id)";
    $query .= ")";
    $db->query($query, false, "Error creating call table: " . $query);
    //	$query = "ALTER TABLE calls ADD asterisk_id varchar(45) default NULL";
    //
    //	$db->query($query, false, "Error altering call table: " . $query);
}
예제 #13
0
 function enable_manifest_logichooks()
 {
     if (empty($this->installdefs['logic_hooks']) || !is_array($this->installdefs['logic_hooks'])) {
         return;
     }
     foreach ($this->installdefs['logic_hooks'] as $hook) {
         check_logic_hook_file($hook['module'], $hook['hook'], array($hook['order'], $hook['description'], $hook['file'], $hook['class'], $hook['function']));
     }
 }
예제 #14
0
 /**
  * @dataProvider getModules
  */
 public function testGeHookArray($module)
 {
     $dir = rtrim("custom/modules/{$module}", "/");
     $file = "{$dir}/logic_hooks.php";
     if (!is_dir($dir)) {
         mkdir($dir, 0755, true);
     }
     $this->saveHook($file);
     check_logic_hook_file($module, 'test_logic_hook', $this->hook['test_logic_hook'][0]);
     $array = get_hook_array($module);
     $this->assertEquals($this->hook, $array);
 }
예제 #15
0
 * of this program must display Appropriate Legal Notices, as required under
 * Section 5 of the GNU Affero General Public License version 3.
 * 
 * In accordance with Section 7(b) of the GNU Affero General Public License version 3,
 * these Appropriate Legal Notices must retain the display of the "Powered by
 * SugarCRM" logo. If the display of the logo is not reasonably feasible for
 * technical reasons, the Appropriate Legal Notices must display the words
 * "Powered by SugarCRM".
 ********************************************************************************/
require_once 'modules/Configurator/Configurator.php';
$admin = new Administration();
$admin->retrieveSettings();
// Handle posts
if (!empty($_REQUEST['process'])) {
    // Check the cleanup logic hook, make sure it is still there
    check_logic_hook_file('Users', 'after_login', array(1, 'SugarFeed old feed entry remover', 'modules/SugarFeed/SugarFeedFlush.php', 'SugarFeedFlush', 'flushStaleEntries'));
    // We have data posted
    if ($_REQUEST['process'] == 'true') {
        // They want us to process it, the false will just fall outside of this statement
        if ($_REQUEST['feed_enable'] == '1') {
            // The feed is enabled, pay attention to what categories should be enabled or disabled
            if (!isset($db)) {
                $db = DBManagerFactory::getInstance();
            }
            $ret = $db->query("SELECT * FROM config WHERE category = 'sugarfeed' AND name LIKE 'module_%'");
            $current_modules = array();
            while ($row = $db->fetchByAssoc($ret)) {
                $current_modules[$row['name']] = $row['value'];
            }
            $active_modules = $_REQUEST['modules'];
            if (!is_array($active_modules)) {
예제 #16
0
 /** 
  * @see SugarView::display()
  */
 public function display()
 {
     global $mod_strings, $app_strings;
     $admin = new Administration();
     $admin->retrieveSettings();
     // Handle posts
     if (!empty($_REQUEST['process'])) {
         // Check the cleanup logic hook, make sure it is still there
         check_logic_hook_file('Users', 'after_login', array(1, 'SugarFeed old feed entry remover', 'modules/SugarFeed/SugarFeedFlush.php', 'SugarFeedFlush', 'flushStaleEntries'));
         // We have data posted
         if ($_REQUEST['process'] == 'true') {
             // They want us to process it, the false will just fall outside of this statement
             if ($_REQUEST['feed_enable'] == '1') {
                 // The feed is enabled, pay attention to what categories should be enabled or disabled
                 $db = DBManagerFactory::getInstance();
                 $ret = $db->query("SELECT * FROM config WHERE category = 'sugarfeed' AND name LIKE 'module_%'");
                 $current_modules = array();
                 while ($row = $db->fetchByAssoc($ret)) {
                     $current_modules[$row['name']] = $row['value'];
                 }
                 $active_modules = $_REQUEST['modules'];
                 if (!is_array($active_modules)) {
                     $active_modules = array();
                 }
                 foreach ($active_modules as $name => $is_active) {
                     $module = substr($name, 7);
                     if ($is_active == '1') {
                         // They are activating something that was disabled before
                         SugarFeed::activateModuleFeed($module);
                     } else {
                         // They are disabling something that was active before
                         SugarFeed::disableModuleFeed($module);
                     }
                 }
                 $admin->saveSetting('sugarfeed', 'enabled', '1');
             } else {
                 $admin->saveSetting('sugarfeed', 'enabled', '0');
                 // Now we need to remove all of the logic hooks, so they don't continue to run
                 // We also need to leave the database alone, so they can enable/disable modules with the system disabled
                 $modulesWithFeeds = SugarFeed::getAllFeedModules();
                 foreach ($modulesWithFeeds as $currFeedModule) {
                     SugarFeed::disableModuleFeed($currFeedModule, FALSE);
                 }
             }
             $admin->retrieveSettings(FALSE, TRUE);
             SugarFeed::flushBackendCache();
         } else {
             if ($_REQUEST['process'] == 'deleteRecords') {
                 if (!isset($db)) {
                     $db = DBManagerFactory::getInstance();
                 }
                 $db->query("UPDATE sugarfeed SET deleted = '1'");
                 echo translate('LBL_RECORDS_DELETED', 'SugarFeed');
             }
         }
         if ($_REQUEST['process'] == 'true' || $_REQUEST['process'] == 'false') {
             header('Location: index.php?module=Administration&action=index');
             return;
         }
     }
     $sugar_smarty = new Sugar_Smarty();
     $sugar_smarty->assign('mod', $mod_strings);
     $sugar_smarty->assign('app', $app_strings);
     if (isset($admin->settings['sugarfeed_enabled']) && $admin->settings['sugarfeed_enabled'] == '1') {
         $sugar_smarty->assign('enabled_checkbox', 'checked');
     }
     $possible_feeds = SugarFeed::getAllFeedModules();
     $module_list = array();
     $userFeedEnabled = 0;
     foreach ($possible_feeds as $module) {
         $currModule = array();
         if (isset($admin->settings['sugarfeed_module_' . $module]) && $admin->settings['sugarfeed_module_' . $module] == '1') {
             $currModule['enabled'] = 1;
         } else {
             $currModule['enabled'] = 0;
         }
         $currModule['module'] = $module;
         if ($module == 'UserFeed') {
             // Fake module, need to handle specially
             $userFeedEnabled = $currModule['enabled'];
             continue;
         } else {
             $currModule['label'] = $GLOBALS['app_list_strings']['moduleList'][$module];
         }
         $module_list[] = $currModule;
     }
     $sugar_smarty->assign('module_list', $module_list);
     $sugar_smarty->assign('user_feed_enabled', $userFeedEnabled);
     echo getClassicModuleTitle("Administration", array("<a href='index.php?module=Administration&action=index'>" . translate('LBL_MODULE_NAME', 'Administration') . "</a>", $mod_strings['LBL_MODULE_NAME']), false);
     $sugar_smarty->display('modules/SugarFeed/tpls/AdminSettings.tpl');
 }
예제 #17
0
 function check_logic_hook_file()
 {
     $module_name = $this->base_module;
     $event = "before_save";
     $action_array = array('1', 'workflow', 'include/workflow/WorkFlowHandler.php', 'WorkFlowHandler', 'WorkFlowHandler');
     check_logic_hook_file($module_name, $event, $action_array);
 }
예제 #18
0
/**
 * Fully enable SugarFeeds, enabling the user feed and all available modules that have SugarFeed data.
 */
function enableSugarFeeds()
{
    $admin = new Administration();
    $admin->saveSetting('sugarfeed', 'enabled', '1');
    foreach (SugarFeed::getAllFeedModules() as $module) {
        SugarFeed::activateModuleFeed($module);
    }
    check_logic_hook_file('Users', 'after_login', array(1, 'SugarFeed old feed entry remover', 'modules/SugarFeed/SugarFeedFlush.php', 'SugarFeedFlush', 'flushStaleEntries'));
}
예제 #19
0
 function installHook($file, $className)
 {
     check_logic_hook_file($this->module, "before_save", array(1, $this->module . " push feed", $file, $className, "pushFeed"));
 }