function syncTILKEE()
{
    global $sugar_config;
    $GLOBALS['log']->info('Scheduled syncTILKEE -> START');
    if (isset($sugar_config['tilkee']['user_scheduler']) && isset($sugar_config['tilkee']['user_scheduler'])) {
        require_once 'custom/include/externalAPI/Tilkee/ExtAPITilkee.php';
        require_once 'modules/TILKEE_PROJECTS/TILKEE_PROJECTS.php';
        require_once 'modules/Users/User.php';
        global $current_user;
        //$scheduler_user = new User();
        $current_user->retrieve($sugar_config['tilkee']['user_scheduler']);
        $tilkee = new ExtAPITilkee();
        //$result_call = $tilkee->get_token_password($login, $mdp) ;
        // retrieve all TILKEE Projects
        $tilkee_projects_array = get_bean_select_array(false, 'TILKEE_PROJECTS', 'name', '', 'name', false);
        foreach ($tilkee_projects_array as $id => $project) {
            $current_project = new TILKEE_PROJECTS();
            $current_project->retrieve($id);
            $current_project->sync_from_API('update_tilks');
            // Retrieve list of TILKS and update connexion
            $tilks_array = $current_project->get_linked_beans('tilkee_projects_tilkee_tilks', 'TILKEE_TILKS');
            foreach ($tilks_array as $tilkee_tilk) {
                $tilkee_tilk->sync_from_API('update_connexions');
            }
            unset($current_project);
        }
    } else {
        $GLOBALS['log']->fatal('Scheduled syncTILKEE -> scheduler connexion information is not set');
    }
    $GLOBALS['log']->info('Scheduled syncTILKEE -> END');
    return true;
}
Esempio n. 2
0
 public function process()
 {
     global $beanList, $beanFiles;
     $this->tpl = 'modules/' . $this->module . '/tpl/' . strtolower($this->action) . '.tpl';
     $ss =& $this->ss;
     $templates = Reports_Utils::getListTemplate($this->report_module);
     $select = array();
     $objects_array = array();
     if (!empty($templates)) {
         foreach ($templates as $template) {
             $select[$template->id] = $template->name;
             $objects_array[$template->id] = $template->toArray();
         }
     }
     $ss->assign('AVAILABLE_TEMPLATES', get_select_options_with_id($select, ''));
     $json = getJSONobj();
     $ss->assign('JSON_TEMPLATES', $json->encode($objects_array));
     //current format is first format in list templates
     $this->ss->assign('CURRENT_FORMAT', strtoupper($templates[0]->extension_template));
     if (isset($beanList[$this->report_module])) {
         require_once $beanFiles[$beanList[$this->report_module]];
         $seed = new $beanList[$this->report_module]();
         $seed->retrieve($this->record);
         $ss->assign("fields", $seed->toArray());
     } else {
         $ss->assign("fields", array());
     }
     $email_templates_arr = get_bean_select_array(true, 'EmailTemplate', 'name', '', 'name', true);
     $email_templates_select = get_select_options_with_id($email_templates_arr, '');
     $ss->assign("EMAIL_TEMPLATES", $email_templates_select);
     //get theme
     $themeObject = SugarThemeRegistry::current();
     $theme = $themeObject->__toString();
     $ss->assign("THEME", $theme);
     $ss->assign("MODULE_NAME", $this->module);
     $ss->assign("ACTION_NAME", $this->action);
     $this->display();
 }
    function edit_display($line, SugarBean $bean = null, $params = array())
    {
        global $mod_strings, $app_list_strings;
        $email_templates_arr = get_bean_select_array(true, 'EmailTemplate', 'name');
        $targetOptions = array();
        foreach ($bean->get_related_fields() as $field) {
            if (!isset($field['module']) || !in_array($field['module'], $this->emailableModules) || isset($field['dbType']) && $field['dbType'] == "id") {
                continue;
            }
            $targetOptions[$field['name']] = $field['module'] . ": " . trim(translate($field['vname'], $bean->module_name), ":");
        }
        array_multisort($targetOptions, SORT_ASC, $targetOptions);
        if (!array_key_exists('email_target_type', (array) $params)) {
            $params['email_target_type'] = 'Email Address';
        }
        if (!in_array($bean->module_dir, $this->emailableModules)) {
            unset($app_list_strings['aow_email_type_list']['Record Email']);
        }
        if (empty($targetOptions)) {
            unset($app_list_strings['aow_email_type_list']['Related Field']);
        }
        $html = "<table border='0' cellpadding='0' cellspacing='0' width='100%'>";
        $html .= "<tr>";
        $html .= '<td id="name_label" scope="row" valign="top" width="12.5%">' . translate("LBL_EMAIL", "AOW_Actions") . ':<span class="required">*</span></td>';
        $html .= '<td valign="top" width="37.5%">';
        $html .= "\n<select onchange='targetTypeChanged(" . $line . ")' id='aow_actions_param_email_target_type" . $line . "' name='aow_actions_param[" . $line . "][email_target_type]'>" . get_select_options_with_id($app_list_strings['aow_email_type_list'], $params['email_target_type']) . "</select>";
        //Related field inputs
        $hideRelated = $params['email_target_type'] != "Related Field" ? "style='display: none;'" : '';
        $html .= "\n<select {$hideRelated} name='aow_actions_param[" . $line . "][email_target]' id='aow_actions_param_email_target" . $line . "' >" . get_select_options_with_id($targetOptions, isset($params['email_target']) ? $params['email_target'] : '') . "</select>";
        //User Input
        $emailUserId = array_key_exists('email_user_id', (array) $params) ? $params['email_user_id'] : '';
        $emailUserName = array_key_exists('email_user_name', (array) $params) ? $params['email_user_name'] : '';
        $hideUser = $params['email_target_type'] != "Specify User" ? "style='display: none;'" : '';
        $html .= <<<EOS

        <span {$hideUser} id="aow_actions_email_user_span{$line}">
<input type="text"
        name="aow_actions_param[{$line}][email_user_name]" class="sqsEnabled" tabindex="1"
        id="aow_actions_param[{$line}][email_user_name]" size="" value="{$emailUserName}" title='' autocomplete="off"  \t >
<input type="hidden" name="aow_actions_param[{$line}][email_user_id]"
\tid="aow_actions_param[{$line}][email_user_id]"
\tvalue="{$emailUserId}">
<span class="id-ff multiple">
<button type="button"
    name="btn_aow_actions_param[{$line}][email_user_name]"
    id="btn_aow_actions_param[{$line}][email_user_name]" tabindex="1"
    title="Select User" class="button firstChild" value="Select User"
onclick="open_popup(
    'Users',
\t600,
\t400,
\t'',
\ttrue,
\tfalse,
\t{'call_back_function':'set_return',
\t    'form_name':'EditView',
\t    'field_to_name_array':{
\t                'id':'aow_actions_param[{$line}][email_user_id]',
\t                'user_name':'aow_actions_param[{$line}][email_user_name]'}},
\t'single',
\ttrue
);" ><img src="themes/default/images/id-ff-select.png?v=lSCqV0_gGHDPkVH62imIiQ"></button>
<button type="button"
    name="btn_clr_aow_actions_param[{$line}][email_user_name]"
    id="btn_clr_aow_actions_param[{$line}][email_user_name]" tabindex="1" title="Clear User"  class="button lastChild"
onclick="SUGAR.clearRelateField(this.form, 'aow_actions_param[{$line}][email_user_name]', 'aow_actions_param[{$line}][email_user_id]');"  value="Clear User" ><img src="themes/default/images/id-ff-clear.png?v=lSCqV0_gGHDPkVH62imIiQ"></button>
</span>
<script type="text/javascript">
SUGAR.util.doWhen(
\t\t"typeof(sqs_objects) != 'undefined' && typeof(sqs_objects['EditView_aow_actions_param[{$line}]['email_user_name']']) != 'undefined'",
\t\tenableQS
);
</script>
</span>

EOS;
        if (!isset($params['email'])) {
            $params['email'] = '';
        }
        if (!isset($params['email_template'])) {
            $params['email_template'] = '';
        }
        $hidden = "style='visibility: hidden;'";
        if ($params['email_template'] != '') {
            $hidden = "";
        }
        //Email input
        $hideEmail = $params['email_target_type'] != "Email Address" ? "style='display: none;'" : '';
        $html .= '<input ' . $hideEmail . ' name="aow_actions_param[' . $line . '][email]" id="aow_actions_param_email' . $line . '" size="30" maxlength="255" value="' . $params['email'] . '" type="text">';
        $html .= '</td>';
        $html .= '<td id="name_label" scope="row" valign="top" width="12.5%">' . translate("LBL_EMAIL_TEMPLATE", "AOW_Actions") . ':<span class="required">*</span></td>';
        $html .= "<td valign='top' width='37.5%'>";
        $html .= "<select name='aow_actions_param[" . $line . "][email_template]' id='aow_actions_param_email_template" . $line . "' onchange='show_edit_template_link(this," . $line . ");' >" . get_select_options_with_id($email_templates_arr, $params['email_template']) . "</select>";
        $html .= "&nbsp;<a href='javascript:open_email_template_form(" . $line . ")' >" . translate('LBL_CREATE_EMAIL_TEMPLATE', 'AOW_Actions') . "</a>";
        $html .= "&nbsp;<span name='edit_template' id='aow_actions_edit_template_link" . $line . "' {$hidden}><a href='javascript:edit_email_template_form(" . $line . ")' >" . translate('LBL_EDIT_EMAIL_TEMPLATE', 'AOW_Actions') . "</a></span>";
        $html .= "</td>";
        $html .= "</tr>";
        $html .= "</table>";
        return $html;
    }
Esempio n. 4
0
    $time_start = $split['h'] . $timedate->timeSeparator() . $split['m'];
}
$xtpl->assign("PRINT_URL", "index.php?" . $GLOBALS['request_string']);
$xtpl->assign("JAVASCRIPT", get_set_focus_js() . get_validate_record_js());
$xtpl->assign("DATE_ENTERED", $focus->date_entered);
$xtpl->assign("DATE_MODIFIED", $focus->date_modified);
$xtpl->assign("ID", $focus->id);
$xtpl->assign("NAME", $focus->name);
$xtpl->assign("FROM_NAME", $focus->from_name);
$xtpl->assign("FROM_ADDR", $focus->from_addr);
$xtpl->assign("REPLY_NAME", $focus->reply_to_name);
$xtpl->assign("REPLY_ADDR", $focus->reply_to_addr);
$xtpl->assign("DATE_START", $focus->date_start);
$xtpl->assign("TIME_START", $time_start);
$xtpl->assign("TIME_FORMAT", '(' . $timedate->get_user_time_format() . ')');
$email_templates_arr = get_bean_select_array(true, 'EmailTemplate', 'name', "(type IS NULL OR type='' OR type='campaign')", 'name');
if ($focus->template_id) {
    $xtpl->assign("TEMPLATE_ID", $focus->template_id);
    $xtpl->assign("EMAIL_TEMPLATE_OPTIONS", get_select_options_with_id($email_templates_arr, $focus->template_id));
    $xtpl->assign("EDIT_TEMPLATE", "visibility:inline");
} else {
    $xtpl->assign("EMAIL_TEMPLATE_OPTIONS", get_select_options_with_id($email_templates_arr, ""));
    $xtpl->assign("EDIT_TEMPLATE", "visibility:hidden");
}
//include campaign utils..
require_once 'modules/Campaigns/utils.php';
if (empty($_REQUEST['campaign_name'])) {
    $campaign = BeanFactory::getBean('Campaigns', $campaign_id);
    $campaign_name = $campaign->name;
} else {
    $campaign_name = $_REQUEST['campaign_name'];
Esempio n. 5
0
        echo "<input type='text' name='number' id='number' disabled='disabled' value='MULTI' style='display:none;'>";
        echo "<div style='clear:both;'></div>";
    }
    # SINGLE RECIPIENT
} else {
    echo "Номер телефона&nbsp;<span class='required'>*</span><br>";
    echo "<input type='text' name='number' id='number' value='" . trim($phone_number) . "'>";
    echo "&nbsp;<span onmouseover='show_tip();' onmouseout='hide_tip();' style='color:#FF0000;font-weight:bold;cursor:pointer;'>[?]</span>";
    echo "&nbsp;<span style='font-family:Verdana;font-size:10px;'>&lt;Код страны&gt;&lt;Номер&gt;</span><br>";
    echo "<div id='smstip'></div>";
}
# enhancement: uses of tpls 15Jul2010
if ($sms->uses_template() == true) {
    echo "<div style='height:10px;'></div>";
    echo "<span title='Optional'>Template</span><br>";
    $email_templates_arr = get_bean_select_array(true, 'EmailTemplate', 'name', 'sms_only=1', 'name');
    echo "<select id='template_id' onchange='load_message(this.value);'>" . get_select_options_with_id($email_templates_arr, "") . "</select>";
}
# # # #
echo "<div style='height:10px;'></div>";
echo "Сообщение <span class='required'>*</span><br>";
echo "<textarea name='sms_msg' id='sms_msg' rows='6' >{$msg}</textarea><br>";
echo "<span id='sms_len_notifier'>Ограничьте свое сообщение 70-ью символами для кирилицы, или 160-ью для латиницы.</span><br><br>";
echo "<div style='clear:both;'></div>";
echo "<div style='float:left;'></div>";
echo "<input type='button' class='button' id='send' value='Отправить' onclick='{$onclick}' style='float:right;'>&nbsp;";
echo '<input type="button" class="button" id="close" value="Закрыть" onclick="closePopUp();" style="float:right;">&nbsp;';
echo "<div style='clear:both;'></div>";
echo "<div id='sms_response'></div></div></div>";
//echo "<script type='text/javascript'>function closePopUp(name){jQuery.noConflict();jQuery.closePopupLayer(name);}</script>";
?>
Esempio n. 6
0
    if (isset($exServ[2]) && !empty($exServ[2]) && $exServ[2] == 'ssl') {
        $ssl = "CHECKED";
    }
}
$mark_read = '';
if ($focus->delete_seen == 0 || empty($focus->delete_seen)) {
    $mark_read = 'CHECKED';
}
// mailbox type
if ($focus->is_personal) {
    array_splice($domMailBoxType, 1, 1);
}
// if
$mailbox_type = get_select_options_with_id($domMailBoxType, $focus->mailbox_type);
// auto-reply email template
$email_templates_arr = get_bean_select_array(true, 'EmailTemplate', 'name', '', 'name', true);
if (!empty($focus->stored_options)) {
    $storedOptions = unserialize(base64_decode($focus->stored_options));
    $from_name = $storedOptions['from_name'];
    $from_addr = $storedOptions['from_addr'];
    $reply_to_name = isset($storedOptions['reply_to_name']) ? $storedOptions['reply_to_name'] : "";
    $reply_to_addr = isset($storedOptions['reply_to_addr']) ? $storedOptions['reply_to_addr'] : "";
    $trashFolder = isset($storedOptions['trashFolder']) ? $storedOptions['trashFolder'] : "";
    $sentFolder = isset($storedOptions['sentFolder']) ? $storedOptions['sentFolder'] : "";
    $distrib_method = isset($storedOptions['distrib_method']) ? $storedOptions['distrib_method'] : "";
    $create_case_email_template = isset($storedOptions['create_case_email_template']) ? $storedOptions['create_case_email_template'] : "";
    $email_num_autoreplies_24_hours = isset($storedOptions['email_num_autoreplies_24_hours']) ? $storedOptions['email_num_autoreplies_24_hours'] : $focus->defaultEmailNumAutoreplies24Hours;
    if ($storedOptions['only_since']) {
        $only_since = 'CHECKED';
    } else {
        $only_since = '';
Esempio n. 7
0
 function email_templates()
 {
     global $app_list_strings;
     $app_list_strings['email_templet_list'] = get_bean_select_array(true, 'EmailTemplate', 'name');
 }
Esempio n. 8
0
    $cfg->config['aop']['case_closure_email_template_id'] = $_REQUEST['case_closure_email_template_id'];
    $cfg->config['aop']['joomla_account_creation_email_template_id'] = $_REQUEST['joomla_account_creation_email_template_id'];
    $cfg->config['aop']['support_from_address'] = $_REQUEST['support_from_address'];
    $cfg->config['aop']['support_from_name'] = $_REQUEST['support_from_name'];
    $cfg->saveConfig();
    header('Location: index.php?module=Administration&action=index');
    exit;
}
$distributionMethod = get_select_options_with_id($app_list_strings['aop_distribution_method'], $cfg->config['aop']['distribution_method']);
if (!empty($cfg->config['aop']['distribution_user_id'])) {
    $distributionUserName = BeanFactory::getBean("Users", $cfg->config['aop']['distribution_user_id'])->name;
} else {
    $distributionUserName = '';
}
$sugar_smarty->assign('distribution_user_name', $distributionUserName);
$emailTemplateList = get_bean_select_array(true, 'EmailTemplate', 'name');
$userEmailTemplateDropdown = get_select_options_with_id($emailTemplateList, $cfg->config['aop']['user_email_template_id']);
$contactEmailTemplateDropdown = get_select_options_with_id($emailTemplateList, $cfg->config['aop']['contact_email_template_id']);
$creationEmailTemplateDropdown = get_select_options_with_id($emailTemplateList, $cfg->config['aop']['case_creation_email_template_id']);
$closureEmailTemplateDropdown = get_select_options_with_id($emailTemplateList, $cfg->config['aop']['case_closure_email_template_id']);
$joomlaEmailTemplateDropdown = get_select_options_with_id($emailTemplateList, $cfg->config['aop']['joomla_account_creation_email_template_id']);
$sugar_smarty->assign('USER_EMAIL_TEMPLATES', $userEmailTemplateDropdown);
$sugar_smarty->assign('CONTACT_EMAIL_TEMPLATES', $contactEmailTemplateDropdown);
$sugar_smarty->assign('CREATION_EMAIL_TEMPLATES', $creationEmailTemplateDropdown);
$sugar_smarty->assign('CLOSURE_EMAIL_TEMPLATES', $closureEmailTemplateDropdown);
$sugar_smarty->assign('JOOMLA_EMAIL_TEMPLATES', $joomlaEmailTemplateDropdown);
$sugar_smarty->assign('DISTRIBUTION_METHOD', $distributionMethod);
$sugar_smarty->assign('MOD', $mod_strings);
$sugar_smarty->assign('APP', $app_strings);
$sugar_smarty->assign('APP_LIST', $app_list_strings);
$sugar_smarty->assign('LANGUAGES', get_languages());
Esempio n. 9
0
    function edit_display($line, SugarBean $bean = null, $params = array())
    {
        global $app_list_strings;
        $email_templates_arr = get_bean_select_array(true, 'EmailTemplate', 'name');
        if (!in_array($bean->module_dir, getEmailableModules())) {
            unset($app_list_strings['aow_email_type_list']['Record Email']);
        }
        $targetOptions = getRelatedEmailableFields($bean->module_dir);
        if (empty($targetOptions)) {
            unset($app_list_strings['aow_email_type_list']['Related Field']);
        }
        $html = '<input type="hidden" name="aow_email_type_list" id="aow_email_type_list" value="' . get_select_options_with_id($app_list_strings['aow_email_type_list'], '') . '">
				  <input type="hidden" name="aow_email_to_list" id="aow_email_to_list" value="' . get_select_options_with_id($app_list_strings['aow_email_to_list'], '') . '">';
        $checked = '';
        if (isset($params['individual_email']) && $params['individual_email']) {
            $checked = 'CHECKED';
        }
        $html .= "<table border='0' cellpadding='0' cellspacing='0' width='100%'>";
        $html .= "<tr>";
        $html .= '<td id="relate_label" scope="row" valign="top">' . translate("LBL_INDIVIDUAL_EMAILS", "AOW_Actions") . ':';
        $html .= '</td>';
        $html .= "<td valign='top' width='37.5%'>";
        $html .= "<input type='hidden' name='aow_actions_param[" . $line . "][individual_email]' value='0' >";
        $html .= "<input type='checkbox' id='aow_actions_param[" . $line . "][individual_email]' name='aow_actions_param[" . $line . "][individual_email]' value='1' {$checked}></td>";
        $html .= '</td>';
        if (!isset($params['email_template'])) {
            $params['email_template'] = '';
        }
        $hidden = "style='visibility: hidden;'";
        if ($params['email_template'] != '') {
            $hidden = "";
        }
        $html .= '<td id="name_label" scope="row" valign="top" width="12.5%">' . translate("LBL_EMAIL_TEMPLATE", "AOW_Actions") . ':<span class="required">*</span></td>';
        $html .= "<td valign='top' width='37.5%'>";
        $html .= "<select name='aow_actions_param[" . $line . "][email_template]' id='aow_actions_param_email_template" . $line . "' onchange='show_edit_template_link(this," . $line . ");' >" . get_select_options_with_id($email_templates_arr, $params['email_template']) . "</select>";
        $html .= "&nbsp;<a href='javascript:open_email_template_form(" . $line . ")' >" . translate('LBL_CREATE_EMAIL_TEMPLATE', 'AOW_Actions') . "</a>";
        $html .= "&nbsp;<span name='edit_template' id='aow_actions_edit_template_link" . $line . "' {$hidden}><a href='javascript:edit_email_template_form(" . $line . ")' >" . translate('LBL_EDIT_EMAIL_TEMPLATE', 'AOW_Actions') . "</a></span>";
        $html .= "</td>";
        $html .= "</tr>";
        $html .= "<tr>";
        $html .= '<td id="name_label" scope="row" valign="top" width="12.5%">' . translate("LBL_EMAIL", "AOW_Actions") . ':<span class="required">*</span></td>';
        $html .= '<td valign="top" scope="row" width="37.5%">';
        $html .= '<button type="button" onclick="add_emailLine(' . $line . ')"><img src="' . SugarThemeRegistry::current()->getImageURL('id-ff-add.png') . '"></button>';
        $html .= '<table id="emailLine' . $line . '_table" width="100%"></table>';
        $html .= '</td>';
        $html .= "</tr>";
        $html .= "</table>";
        $html .= "<script id ='aow_script" . $line . "'>";
        //backward compatible
        if (isset($params['email_target_type']) && !is_array($params['email_target_type'])) {
            $email = '';
            switch ($params['email_target_type']) {
                case 'Email Address':
                    $email = $params['email'];
                    break;
                case 'Specify User':
                    $email = $params['email_user_id'];
                    break;
                case 'Related Field':
                    $email = $params['email_target'];
                    break;
            }
            $html .= "load_emailline('" . $line . "','to','" . $params['email_target_type'] . "','" . $email . "');";
        }
        //end backward compatible
        if (isset($params['email_target_type'])) {
            foreach ($params['email_target_type'] as $key => $field) {
                if (is_array($params['email'][$key])) {
                    $params['email'][$key] = json_encode($params['email'][$key]);
                }
                $html .= "load_emailline('" . $line . "','" . $params['email_to_type'][$key] . "','" . $params['email_target_type'][$key] . "','" . $params['email'][$key] . "');";
            }
        }
        $html .= "</script>";
        return $html;
    }
Esempio n. 10
0
 function get_selector_array($type, $value, $dom_name, $text_only_array = false, $meta_filter_name = "", $only_related_modules = false, $trigger_type = "", $only_plural = false)
 {
     global $app_list_strings;
     global $current_language;
     if ($type == 'assigned_user_id' || $type == 'assigned_user_name') {
         $select_array = get_user_array(TRUE, "Active", "", true, null, ' AND is_group=0 ');
     }
     if ($type == 'team_list') {
         $select_array = get_team_array();
     }
     if ($type == 'role') {
         $select_array = get_bean_select_array(true, 'ACLRole', 'name');
     }
     if ($type == 'dom_array') {
         if (!empty($app_list_strings[$dom_name])) {
             $select_array = $app_list_strings[$dom_name];
         }
         ksort($select_array);
     }
     if ($type == 'field') {
         $temp_module = BeanFactory::getBean($dom_name);
         if (!is_object($temp_module)) {
             //var_dump($dom_name);
             //display_stack_trace(true);
             $GLOBALS['log']->fatal("get_selector_array: Unknown module: {$dom_name}");
             return null;
         }
         if (isset($trigger_type) && !empty($trigger_type)) {
             global $process_dictionary;
             include_once 'modules/WorkFlowTriggerShells/MetaArray.php';
             if (array_key_exists("trigger_type_override", $process_dictionary['TriggersCreateStep1']['elements'][$trigger_type])) {
                 //we have found an override
                 $meta_filter_name = $process_dictionary['TriggersCreateStep1']['elements'][$trigger_type]['trigger_type_override'];
             }
         }
         $temp_module->call_vardef_handler($meta_filter_name);
         if ($_GET['opener_id'] == 'rel_module') {
             $temp_select_array = $temp_module->vardef_handler->get_vardef_array(false, false, true, false, true);
             $select_array = getDuplicateRelationListWithTitle($temp_select_array, $temp_module->vardef_handler->module_object->field_defs, $temp_module->vardef_handler->module_object->module_dir);
         } else {
             $select_array = $temp_module->vardef_handler->get_vardef_array(true, false, false, false, true);
             $select_array = array_unique($select_array);
             asort($select_array);
         }
         //end if type is field
     }
     if ($type == 'module_list') {
         if ($only_related_modules) {
             global $beanList;
             $temp_module = BeanFactory::getBean($dom_name);
             $temp_module->call_vardef_handler("rel_filter");
             $select_array = $temp_module->vardef_handler->get_vardef_array(true, true, true, true);
         } else {
             if ($meta_filter_name == "singular") {
                 $select_array = convert_module_to_singular(get_module_map(false));
             } else {
                 $select_array = get_module_map();
             }
         }
         unset($select_array["Forecasts"]);
         unset($select_array["Products"]);
         unset($select_array["Documents"]);
         asort($select_array);
         //end if type is module_list
     }
     if (!empty($select_array)) {
         if ($text_only_array == true) {
             return $select_array;
         } else {
             return get_select_options_with_id($select_array, $value);
         }
     } else {
         return null;
     }
     //end get_selector_array
 }
Esempio n. 11
0
}
///////////////////////////////////////////////////////////////////////////////
////	PAGE OUTPUT
$sugar_smarty->assign('MOD', $mod_strings);
$sugar_smarty->assign('APP', $app_strings);
$sugar_smarty->assign('APP_LIST', $app_list_strings);
$sugar_smarty->assign('LANGUAGES', get_languages());
$sugar_smarty->assign("JAVASCRIPT", get_set_focus_js());
$sugar_smarty->assign('config', $sugar_config);
$sugar_smarty->assign('error', $errors);
$sugar_smarty->assign('DISPLAY_RESULT', $display_result);
$sugar_smarty->assign('DISPLAY_TITLE', $display_title);
$sugar_smarty->assign('URL_TILKEE', $cfg->config['tilkee']['url_tilkee']);
$sugar_smarty->assign('TILKEE_CLIENT_ID', $cfg->config['tilkee']['client_id']);
// Scheduler users dropbox
$users_array = get_bean_select_array(false, 'User', 'user_name', ' users.status="Active" AND users.deleted=0 ', 'user_name', false);
$SELECT_USER_SCHEDULER = get_select_options_with_id($users_array, $cfg->config['tilkee']['user_scheduler']);
$sugar_smarty->assign('SELECT_USER_SCHEDULER', $SELECT_USER_SCHEDULER);
$sugar_smarty->assign('project_id_infos_project', $_REQUEST['project_id_infos_project']);
$sugar_smarty->assign('project_name_create', $_REQUEST['project_name_create']);
$sugar_smarty->assign('project_id_delete', $_REQUEST['project_id_delete']);
$sugar_smarty->assign('project_id_update', $_REQUEST['project_id_update']);
$sugar_smarty->assign('project_name_update', $_REQUEST['project_name_update']);
$sugar_smarty->assign('project_id_infos_tilk', $_REQUEST['project_id_infos_tilk']);
$sugar_smarty->assign('tilk_id_infos_tilk', $_REQUEST['tilk_id_infos_tilk']);
$sugar_smarty->assign('project_id_create_tilk', $_REQUEST['project_id_create_tilk']);
$sugar_smarty->assign('tilk_name_create', $_REQUEST['tilk_name_create']);
$sugar_smarty->assign('project_id_update_tilk', $_REQUEST['project_id_update_tilk']);
$sugar_smarty->assign('tilk_id_update_tilk', $_REQUEST['tilk_id_update_tilk']);
$sugar_smarty->assign('tilk_name_update', $_REQUEST['tilk_name_update']);
$SELECT_KIND = get_select_options_with_id($app_list_strings['type_list'], '');
Esempio n. 12
0
 function fill_in_additional_detail_fields()
 {
     parent::fill_in_additional_detail_fields();
     $this->setCalculatedValues(true);
     $types = get_bean_select_array(true, 'ContractType', 'name', 'deleted=0', 'list_order');
     $this->type_options = get_select_options_with_id($types, $this->type);
     $currency = BeanFactory::getBean('Currencies');
     if (isset($this->currency_id) && !empty($this->currency_id)) {
         $currency->retrieve($this->currency_id);
         if ($currency->deleted != 1) {
             $this->currency_name = $currency->iso4217 . ' ' . $currency->symbol;
         } else {
             $this->currency_name = $currency->getDefaultISO4217() . ' ' . $currency->getDefaultCurrencySymbol();
         }
     } else {
         $this->currency_name = $currency->getDefaultISO4217() . ' ' . $currency->getDefaultCurrencySymbol();
     }
 }
Esempio n. 13
0
    } else {
        $from_emails .= "'{$id}','{$name}','{$emails[$id]}'";
    }
}
$ss->assign("FROM_EMAILS", $from_emails);
$ss->assign("DEFAULT_FROM_EMAIL", $default_email_address);
$ss->assign("STATUS_OPTIONS", get_select_options_with_id($app_list_strings['email_marketing_status_dom'], $mrkt_focus->status));
if (empty($mrkt_focus->inbound_email_id)) {
    $ss->assign("MAILBOXES", get_select_options_with_id($mailboxes, ''));
} else {
    $ss->assign("MAILBOXES", get_select_options_with_id($mailboxes, $mrkt_focus->inbound_email_id));
}
$ss->assign("TIME_MERIDIEM", $timedate->AMPMMenu('', $mrkt_focus->time_start));
$ss->assign("TIME_FORMAT", '(' . $timedate->get_user_time_format() . ')');
$where = $campaign_focus->campaign_type == "SMS" ? "sms_only=1" : "sms_only=0";
$email_templates_arr = get_bean_select_array(true, 'EmailTemplate', 'name', $where, 'name');
if ($mrkt_focus->template_id) {
    $ss->assign("TEMPLATE_ID", $mrkt_focus->template_id);
    $ss->assign("EMAIL_TEMPLATE_OPTIONS", get_select_options_with_id($email_templates_arr, $mrkt_focus->template_id));
    $ss->assign("EDIT_TEMPLATE", "visibility:inline");
} else {
    $ss->assign("EMAIL_TEMPLATE_OPTIONS", get_select_options_with_id($email_templates_arr, ""));
    $ss->assign("EDIT_TEMPLATE", "visibility:hidden");
}
$scope_options = get_message_scope_dom($campaign_focus->id, $campaign_focus->name, $mrkt_focus->db);
$prospectlists = array();
if (isset($mrkt_focus->all_prospect_lists) && $mrkt_focus->all_prospect_lists == 1) {
    $ss->assign("ALL_PROSPECT_LISTS_CHECKED", "checked");
    $ss->assign("MESSAGE_FOR_DISABLED", "disabled");
} else {
    //get select prospect list.
Esempio n. 14
-1
/**
 *
 * @package Advanced OpenPortal
 * @copyright SalesAgility Ltd http://www.salesagility.com
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE as published by
 * the Free Software Foundation; either version 3 of the License, or
 * (at your option) any later version.
 *
 * 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 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
 *
 * @author Salesagility Ltd <*****@*****.**>
 */
function getAOPAssignField($assignField, $value)
{
    global $app_list_strings;
    $roles = get_bean_select_array(true, 'ACLRole', 'name', '', 'name', true);
    if (!file_exists('modules/SecurityGroups/SecurityGroup.php')) {
        unset($app_list_strings['aow_assign_options']['security_group']);
    } else {
        $securityGroups = get_bean_select_array(true, 'SecurityGroup', 'name', '', 'name', true);
    }
    $field = '';
    $field .= "<select type='text' name='{$assignField}" . '[0]' . "' id='{$assignField}" . '[0]' . "' onchange='assign_field_change(\"{$assignField}\")' title='' tabindex='116'>" . get_select_options_with_id($app_list_strings['aow_assign_options'], $value[0]) . "</select>&nbsp;&nbsp;";
    if (!file_exists('modules/SecurityGroups/SecurityGroup.php')) {
        $field .= "<input type='hidden' name='{$assignField}" . '[1]' . "' id='{$assignField}" . '[1]' . "' value=''  />";
    } else {
        $display = 'none';
        if ($value[0] == 'security_group') {
            $display = '';
        }
        $field .= "<select type='text' style='display:{$display}' name='{$assignField}" . '[1]' . "' id='{$assignField}" . '[1]' . "' title='' tabindex='116'>" . get_select_options_with_id($securityGroups, $value[1]) . "</select>&nbsp;&nbsp;";
    }
    $display = 'none';
    if ($value[0] == 'role' || $value[0] == 'security_group') {
        $display = '';
    }
    $field .= "<select type='text' style='display:{$display}' name='{$assignField}" . '[2]' . "' id='{$assignField}" . '[2]' . "' title='' tabindex='116'>" . get_select_options_with_id($roles, $value[2]) . "</select>&nbsp;&nbsp;";
    return $field;
}