/**
 * Smarty {sugar_getscript} function plugin
 *
 * Type:     function<br>
 * Name:     sugar_getscript<br>
 * Purpose:  Creates script tag for filename with caching string
 *
 * @param array
 * @param Smarty
 */
function smarty_function_sugar_getscript($params, &$smarty)
{
    if (!isset($params['file'])) {
        $smarty->trigger_error($GLOBALS['app_strings']['ERR_MISSING_REQUIRED_FIELDS'] . 'file');
    }
    return getVersionedScript($params['file']);
}
Esempio n. 2
0
 /**
  * @see SugarView::display()
  *
  * We are overridding the display method to manipulate the sectionPanels.
  * If portal is not enabled then don't show the Portal Information panel.
  */
 public function display()
 {
     $this->ev->process();
     if (!empty($_REQUEST['contact_name']) && !empty($_REQUEST['contact_id']) && $this->ev->fieldDefs['report_to_name']['value'] == '' && $this->ev->fieldDefs['reports_to_id']['value'] == '') {
         $this->ev->fieldDefs['report_to_name']['value'] = $_REQUEST['contact_name'];
         $this->ev->fieldDefs['reports_to_id']['value'] = $_REQUEST['contact_id'];
     }
     $admin = new Administration();
     $admin->retrieveSettings();
     if (empty($admin->settings['portal_on']) || !$admin->settings['portal_on']) {
         unset($this->ev->sectionPanels[strtoupper('lbl_portal_information')]);
     } else {
         if (isset($_REQUEST['isDuplicate']) && $_REQUEST['isDuplicate'] == 'true') {
             $this->ev->fieldDefs['portal_name']['value'] = '';
             $this->ev->fieldDefs['portal_active']['value'] = '0';
             $this->ev->fieldDefs['portal_password']['value'] = '';
             $this->ev->fieldDefs['portal_password1']['value'] = '';
             $this->ev->fieldDefs['portal_name_verified'] = '0';
             $this->ev->focus->portal_name = '';
             $this->ev->focus->portal_password = '';
             $this->ev->focus->portal_acitve = 0;
         } else {
             $this->ev->fieldDefs['portal_password']['value'] = '';
             $this->ev->fieldDefs['portal_password1']['value'] = '';
         }
         echo getVersionedScript('modules/Contacts/Contact.js');
         echo '<script language="javascript">';
         echo 'addToValidateComparison(\'EditView\', \'portal_password\', \'varchar\', false, SUGAR.language.get(\'app_strings\', \'ERR_SQS_NO_MATCH_FIELD\') + SUGAR.language.get(\'Contacts\', \'LBL_PORTAL_PASSWORD\'), \'portal_password1\');';
         echo 'addToValidateVerified(\'EditView\', \'portal_name_verified\', \'bool\', false, SUGAR.language.get(\'app_strings\', \'ERR_EXISTING_PORTAL_USERNAME\'));';
         echo 'YAHOO.util.Event.onDOMReady(function() {YAHOO.util.Event.on(\'portal_name\', \'blur\', validatePortalName);YAHOO.util.Event.on(\'portal_name\', \'keydown\', handleKeyDown);});';
         echo '</script>';
     }
     echo $this->ev->display($this->showTitle);
 }
Esempio n. 3
0
 /**
  * @see SugarView::display()
  *
  * We are overridding the display method to manipulate the sectionPanels.
  * If portal is not enabled then don't show the Portal Information panel.
  */
 public function display()
 {
     $this->ev->process();
     if (!empty($_REQUEST['contact_name']) && !empty($_REQUEST['contact_id']) && $this->ev->fieldDefs['report_to_name']['value'] == '' && $this->ev->fieldDefs['reports_to_id']['value'] == '') {
         $this->ev->fieldDefs['report_to_name']['value'] = $_REQUEST['contact_name'];
         $this->ev->fieldDefs['reports_to_id']['value'] = $_REQUEST['contact_id'];
     }
     $admin = new Administration();
     $admin->retrieveSettings();
     if (empty($admin->settings['portal_on']) || !$admin->settings['portal_on']) {
         unset($this->ev->sectionPanels[strtoupper('lbl_portal_information')]);
     } else {
         if (isset($_REQUEST['isDuplicate']) && $_REQUEST['isDuplicate'] == 'true') {
             $this->ev->fieldDefs['portal_name']['value'] = '';
             $this->ev->fieldDefs['portal_active']['value'] = '0';
             $this->ev->fieldDefs['portal_password']['value'] = '';
             $this->ev->fieldDefs['portal_password1']['value'] = '';
             $this->ev->fieldDefs['portal_name_verified'] = '0';
             $this->ev->focus->portal_name = '';
             $this->ev->focus->portal_password = '';
             $this->ev->focus->portal_acitve = 0;
         } else {
             $this->ev->fieldDefs['portal_password']['value'] = '';
             $this->ev->fieldDefs['portal_password1']['value'] = '';
         }
         echo getVersionedScript('modules/Contacts/Contact.js');
         echo '<script language="javascript">';
         echo 'addToValidateComparison(\'EditView\', \'portal_password\', \'varchar\', false, SUGAR.language.get(\'app_strings\', \'ERR_SQS_NO_MATCH_FIELD\') + SUGAR.language.get(\'Contacts\', \'LBL_PORTAL_PASSWORD\'), \'portal_password1\');';
         echo 'addToValidateVerified(\'EditView\', \'portal_name_verified\', \'bool\', false, SUGAR.language.get(\'app_strings\', \'ERR_EXISTING_PORTAL_USERNAME\'));';
         echo 'YAHOO.util.Event.onDOMReady(function() {YAHOO.util.Event.on(\'portal_name\', \'blur\', validatePortalName);YAHOO.util.Event.on(\'portal_name\', \'keydown\', handleKeyDown);});';
         echo '</script>';
     }
     // Return contacts email and birthdate in current user date format. {Iluxovi4}
     if ($_REQUEST['em_dup'] == 1) {
         global $timedate, $current_user;
         $format = $timedate->get_date_format($current_user);
         $birthday = date($format, strtotime($_REQUEST['birthdate']));
         echo "<script type='text/javascript'>\n                function em_dup()\n                {\n                    \$('#Contacts0emailAddress0').val('{$_REQUEST['Contacts0emailAddress0']}')\n                    \$('#birthdate').val('{$birthday}')\n                }\n\n                setTimeout(em_dup,10)\n            </script>";
     }
     echo $this->ev->display($this->showTitle);
 }
Esempio n. 4
0
 function process_page()
 {
     global $theme;
     global $mod_strings;
     global $app_strings;
     global $currentModule;
     global $current_language;
     global $current_module_strings;
     if (!is_file(sugar_cached('jsLanguage/WorkFlow/') . $GLOBALS['current_language'] . '.js')) {
         require_once 'include/language/jsLanguage.php';
         jsLanguage::createModuleStringsCache('WorkFlow', $GLOBALS['current_language']);
     }
     $javascript_language_files = getVersionedScript("cache/jsLanguage/WorkFlow/{$GLOBALS['current_language']}.js", $GLOBALS['sugar_config']['js_lang_version']);
     $current_module_strings = return_module_language($current_language, 'WorkFlowAlertShells');
     $ListView = new ListView();
     $header_text = '';
     if (isset($_REQUEST['workflow_id'])) {
         $workflow = BeanFactory::getBean('WorkFlow', $_REQUEST['workflow_id']);
         //TODO GET ALL ALERTS HERE
         //$focus_alerts_list = $workflow->get_linked_beans('wf_alerts','WorkFlowAlertShell');
         $alerts = BeanFactory::getBean('WorkFlowAlertShells');
         $current_module_strings = return_module_language($current_language, $alerts->module_dir);
         insert_popup_header($theme);
         $ListView->initNewXTemplate('modules/WorkFlowAlertShells/Popup_picker.html', $current_module_strings);
         $ListView->xTemplateAssign("WORKFLOW_ID", $workflow->id);
         $ListView->xTemplateAssign("JAVASCRIPT_LANGUAGE_FILES", $javascript_language_files);
         $ListView->xTemplateAssign("RETURN_URL", "&return_module=" . $currentModule . "&return_action=DetailView&return_id={$workflow->id}");
         $ListView->xTemplateAssign("EDIT_INLINE_PNG", SugarThemeRegistry::current()->getImage('edit_inline', 'align="absmiddle" border="0"', null, null, '.gif', $app_strings['LNK_EDIT']));
         $ListView->xTemplateAssign("DELETE_INLINE_PNG", SugarThemeRegistry::current()->getImage('delete_inline', 'align="absmiddle" border="0"', null, null, '.gif', $app_strings['LNK_REMOVE']));
         $ListView->setHeaderTitle($current_module_strings['LBL_MODULE_NAME_COMBO'] . $header_text);
         //$ListView->setHeaderText($button);
         //$ListView->setQuery("workflow_alertshells.alert_type = 'Email'","","", "ALERT");
         $list = $alerts->get_list("", "workflow_alertshells.alert_type = 'Email'");
         $display_list = $this->cullFromList($list['list'], $workflow->base_module, $workflow->type);
         $ListView->processListViewTwo($display_list, "main", "ALERT");
         insert_popup_footer();
     }
 }
Esempio n. 5
0
//Assign qsd script
require_once('include/QuickSearchDefaults.php');
$qsd = QuickSearchDefaults::getQuickSearchDefaults();
$sqs_objects = array( 'EditView_assigned_user_name' => $qsd->getQSUser());
$quicksearch_js = '<script type="text/javascript" language="javascript">sqs_objects = ' . $json->encode($sqs_objects) . '; enableQS();</script>';

$xtpl->assign("CANCEL_SCRIPT", $cancel_script);
$xtpl->assign("PRINT_URL", "index.php?".$GLOBALS['request_string']);
$xtpl->assign("JAVASCRIPT", get_set_focus_js() . $quicksearch_js);

if(!is_file(sugar_cached('jsLanguage/') . $GLOBALS['current_language'] . '.js')) {
    require_once('include/language/jsLanguage.php');
	$jsLanguage = new jsLanguage();
	$jsLanguage->createAppStringsCache($GLOBALS['current_language']);
}
$jsLang = getVersionedScript("cache/jsLanguage/{$GLOBALS['current_language']}.js",  $GLOBALS['sugar_config']['js_lang_version']);
$xtpl->assign("JSLANG", $jsLang);

$xtpl->assign("ID", $focus->id);
if(isset($focus->name)) $xtpl->assign("NAME", $focus->name); else $xtpl->assign("NAME", "");

//Bug45632
/* BEGIN - SECURITY GROUPS */
/**
if(isset($focus->assigned_user_id)) $xtpl->assign("ASSIGNED_USER_ID", $focus->assigned_user_id); else $xtpl->assign("ASSIGNED_USER_ID", "");
*/
if(isset($focus->assigned_user_id)) $xtpl->assign("ASSIGNED_USER_ID", $focus->assigned_user_id);
else if(empty($focus->id) && empty($focus->assigned_user_id)) {
	global $current_user;
	$xtpl->assign("ASSIGNED_USER_ID", $current_user->id);
    $xtpl->assign("ASSIGNED_USER_NAME", get_assigned_user_name($current_user->id));
Esempio n. 6
0
 protected function _getModLanguageJS()
 {
     if (!is_file(sugar_cached('jsLanguage/') . $this->module . '/' . $GLOBALS['current_language'] . '.js')) {
         require_once 'include/language/jsLanguage.php';
         jsLanguage::createModuleStringsCache($this->module, $GLOBALS['current_language']);
     }
     return getVersionedScript("cache/jsLanguage/{$this->module}/" . $GLOBALS['current_language'] . '.js', $GLOBALS['sugar_config']['js_lang_version']);
 }
Esempio n. 7
0
 function display($end = true)
 {
     global $app_strings;
     if (!is_file(sugar_cached("jsLanguage/{$GLOBALS['current_language']}.js"))) {
         require_once 'include/language/jsLanguage.php';
         jsLanguage::createAppStringsCache($GLOBALS['current_language']);
     }
     $jsLang = getVersionedScript("cache/jsLanguage/{$GLOBALS['current_language']}.js", $GLOBALS['sugar_config']['js_lang_version']);
     $this->th->ss->assign('data', $this->data['data']);
     $this->data['pageData']['offsets']['lastOffsetOnPage'] = $this->data['pageData']['offsets']['current'] + count($this->data['data']);
     $this->th->ss->assign('pageData', $this->data['pageData']);
     $navStrings = array('next' => $GLOBALS['app_strings']['LNK_LIST_NEXT'], 'previous' => $GLOBALS['app_strings']['LNK_LIST_PREVIOUS'], 'end' => $GLOBALS['app_strings']['LNK_LIST_END'], 'start' => $GLOBALS['app_strings']['LNK_LIST_START'], 'of' => $GLOBALS['app_strings']['LBL_LIST_OF']);
     $this->th->ss->assign('navStrings', $navStrings);
     $associated_row_data = array();
     //C.L. - Bug 44324 - Override the NAME entry to not display salutation so that the data returned from the popup can be searched on correctly
     $searchNameOverride = !empty($this->seed) && $this->seed instanceof Person && (isset($this->data['data'][0]['FIRST_NAME']) && isset($this->data['data'][0]['LAST_NAME'])) ? true : false;
     global $locale;
     foreach ($this->data['data'] as $val) {
         $associated_row_data[$val['ID']] = $val;
         if ($searchNameOverride) {
             $associated_row_data[$val['ID']]['NAME'] = $locale->getLocaleFormattedName($val['FIRST_NAME'], $val['LAST_NAME']);
         }
     }
     $is_show_fullname = showFullName() ? 1 : 0;
     $json = getJSONobj();
     $this->th->ss->assign('jsLang', $jsLang);
     $this->th->ss->assign('lang', substr($GLOBALS['current_language'], 0, 2));
     $this->th->ss->assign('headerTpl', $this->headerTpl);
     $this->th->ss->assign('footerTpl', $this->footerTpl);
     $this->th->ss->assign('ASSOCIATED_JAVASCRIPT_DATA', 'var associated_javascript_data = ' . $json->encode($associated_row_data) . '; var is_show_fullname = ' . $is_show_fullname . ';');
     $this->th->ss->assign('module', $this->seed->module_dir);
     $request_data = empty($_REQUEST['request_data']) ? '' : $_REQUEST['request_data'];
     $this->th->ss->assign('request_data', $request_data);
     $this->th->ss->assign('fields', $this->fieldDefs);
     $this->th->ss->assign('formData', $this->formData);
     $this->th->ss->assign('APP', $GLOBALS['app_strings']);
     $this->th->ss->assign('MOD', $GLOBALS['mod_strings']);
     if (isset($this->_popupMeta['create']['createButton'])) {
         $this->_popupMeta['create']['createButton'] = translate($this->_popupMeta['create']['createButton']);
     }
     $this->th->ss->assign('popupMeta', $this->_popupMeta);
     $this->th->ss->assign('current_query', base64_encode(serialize($_REQUEST)));
     $this->th->ss->assign('customFields', $this->customFieldDefs);
     $this->th->ss->assign('numCols', NUM_COLS);
     $this->th->ss->assign('massUpdateData', $this->massUpdateData);
     $this->th->ss->assign('sugarVersion', $GLOBALS['sugar_version']);
     $this->th->ss->assign('should_process', $this->should_process);
     if ($this->_create) {
         $this->th->ss->assign('ADDFORM', $this->getQuickCreate());
         //$this->_getAddForm());
         $this->th->ss->assign('ADDFORMHEADER', $this->_getAddFormHeader());
         $this->th->ss->assign('object_name', $this->seed->object_name);
     }
     $this->th->ss->assign('LIST_HEADER', get_form_header($GLOBALS['mod_strings']['LBL_LIST_FORM_TITLE'], '', false));
     $this->th->ss->assign('SEARCH_FORM_HEADER', get_form_header($GLOBALS['mod_strings']['LBL_SEARCH_FORM_TITLE'], '', false));
     $str = $this->th->displayTemplate($this->seed->module_dir, $this->view, $this->tpl);
     return $str;
 }
Esempio n. 8
0
 /**
  * Renders the QuickCreate form from Smarty and returns HTML
  * @param array $vars request variable global
  * @param object $email Fetched email object
  * @param bool $addToAddressBook
  * @return array
  */
 function getQuickCreateForm($vars, $email, $addToAddressBookButton = false)
 {
     require_once "include/EditView/EditView2.php";
     global $app_strings;
     global $mod_strings;
     global $current_user;
     global $beanList;
     global $beanFiles;
     global $current_language;
     //Setup the current module languge
     $mod_strings = return_module_language($current_language, $_REQUEST['qc_module']);
     $bean = $beanList[$_REQUEST['qc_module']];
     $class = $beanFiles[$bean];
     require_once $class;
     $focus = new $bean();
     $people = array('Contact', 'Lead');
     $emailAddress = array();
     // people
     if (in_array($bean, $people)) {
         // lead specific
         $focus->lead_source = 'Email';
         $focus->lead_source_description = trim($email->name);
         $from = isset($email->from_name) && !empty($email->from_name) ? $email->from_name : $email->from_addr;
         if (isset($_REQUEST['sugarEmail']) && !empty($_REQUEST['sugarEmail'])) {
             if ($email->status == "sent") {
                 $from = isset($email->to_addrs_names) && !empty($email->to_addrs_names) ? $email->to_addrs_names : $email->to_addrs;
             } else {
                 $from = isset($email->from_name) && !empty($email->from_name) ? $email->from_name : $email->from_addr_name;
             }
         }
         $name = explode(" ", trim($from));
         $address = trim(array_pop($name));
         $address = str_replace(array("<", ">", "&lt;", "&gt;"), "", $address);
         $emailAddress[] = array('email_address' => $address, 'primary_address' => 1, 'invalid_email' => 0, 'opt_out' => 0, 'reply_to_address' => 1);
         $focus->email1 = $address;
         if (!empty($name)) {
             $focus->last_name = trim(array_pop($name));
             foreach ($name as $first) {
                 if (!empty($focus->first_name)) {
                     $focus->first_name .= " ";
                 }
                 $focus->first_name .= trim($first);
             }
         }
     } else {
         // bugs, cases, tasks
         $focus->name = trim($email->name);
     }
     $focus->description = trim(strip_tags($email->description));
     $focus->assigned_user_id = $current_user->id;
     $EditView = new EditView();
     $EditView->ss = new Sugar_Smarty();
     //MFH BUG#20283 - checks for custom quickcreate fields
     $EditView->setup($_REQUEST['qc_module'], $focus, 'custom/modules/' . $focus->module_dir . '/metadata/editviewdefs.php', 'include/EditView/EditView.tpl');
     $EditView->process();
     $EditView->render();
     $EditView->defs['templateMeta']['form']['buttons'] = array('email2save' => array('id' => 'e2AjaxSave', 'customCode' => '<input type="button" class="button" value="   ' . $app_strings['LBL_SAVE_BUTTON_LABEL'] . '   " onclick="SUGAR.email2.detailView.saveQuickCreate(false);" />'), 'email2saveandreply' => array('id' => 'e2SaveAndReply', 'customCode' => '<input type="button" class="button" value="   ' . $app_strings['LBL_EMAIL_SAVE_AND_REPLY'] . '   " onclick="SUGAR.email2.detailView.saveQuickCreate(\'reply\');" />'), 'email2cancel' => array('id' => 'e2cancel', 'customCode' => '<input type="button" class="button" value="   ' . $app_strings['LBL_EMAIL_CANCEL'] . '   " onclick="SUGAR.email2.detailView.quickCreateDialog.hide();" />'));
     if ($addToAddressBookButton) {
         $EditView->defs['templateMeta']['form']['buttons']['email2saveAddToAddressBook'] = array('id' => 'e2addToAddressBook', 'customCode' => '<input type="button" class="button" value="   ' . $app_strings['LBL_EMAIL_ADDRESS_BOOK_SAVE_AND_ADD'] . '   " onclick="SUGAR.email2.detailView.saveQuickCreate(true);" />');
     }
     //Get the module language for javascript
     if (!is_file(sugar_cached('jsLanguage/') . $_REQUEST['qc_module'] . '/' . $GLOBALS['current_language'] . '.js')) {
         require_once 'include/language/jsLanguage.php';
         jsLanguage::createModuleStringsCache($_REQUEST['qc_module'], $GLOBALS['current_language']);
     }
     $jsLanguage = getVersionedScript("cache/jsLanguage/{$_REQUEST['qc_module']}/{$GLOBALS['current_language']}.js", $GLOBALS['sugar_config']['js_lang_version']);
     $EditView->view = 'EmailQCView';
     $EditView->defs['templateMeta']['form']['headerTpl'] = 'include/EditView/header.tpl';
     $EditView->defs['templateMeta']['form']['footerTpl'] = 'include/EditView/footer.tpl';
     $meta = array();
     $meta['html'] = $jsLanguage . $EditView->display(false, true);
     $meta['html'] = str_replace("src='" . getVersionedPath('include/SugarEmailAddress/SugarEmailAddress.js') . "'", '', $meta['html']);
     $meta['emailAddress'] = $emailAddress;
     $mod_strings = return_module_language($current_language, 'Emails');
     return $meta;
 }
    }
    // if
    $groupFolders[$value['id']] = $value['name'];
    $groupFoldersOrig[] = $value['origName'];
}
// foreach
$groupFolderName = "";
$addToGroupFolder = "";
$createGroupFolderStyle = "display:''";
$editGroupFolderStyle = "display:''";
if (!empty($focus->id)) {
    $groupFolderName = $focus->name;
}
if (!empty($focus->id)) {
    $addToGroupFolder = $focus->parent_folder;
}
if (!empty($focus->id)) {
    $createGroupFolderStyle = "display:none;";
} else {
    $editGroupFolderStyle = "display:none;";
}
// else
$smarty->assign('createGroupFolderStyle', $createGroupFolderStyle);
$smarty->assign('editGroupFolderStyle', $editGroupFolderStyle);
$smarty->assign('groupFolderName', $groupFolderName);
$json = getJSONobj();
$smarty->assign('group_folder_array', $json->encode($groupFoldersOrig));
$smarty->assign('group_folder_options', get_select_options_with_id($groupFolders, $addToGroupFolder));
$smarty->assign('CSS', SugarThemeRegistry::current()->getCSS());
$smarty->assign('languageStrings', getVersionedScript("cache/jsLanguage/{$GLOBALS['current_language']}.js", $GLOBALS['sugar_config']['js_lang_version']));
echo $smarty->fetch("modules/Emails/templates/_createGroupFolder.tpl");
Esempio n. 10
0
    /**
     * Add Datetime selection popup window HTML code
     * @param displayname Name to display in the popup window
     * @param varname name of the variable
     */
    function addDatetime($displayname, $varname)
    {
        global $timedate;
        $userformat = $timedate->get_user_time_format();
        $cal_dateformat = $timedate->get_cal_date_format();
        global $app_strings, $app_list_strings, $theme;
        $jscalendarImage = SugarThemeRegistry::current()->getImageURL('jscalendar.gif');
        $javascriptend = <<<EOQ
\t\t <script type="text/javascript">
\t\tCalendar.setup ({
\t\t\tinputField : "{$varname}_date",
\t\t\tdaFormat : "{$cal_dateformat}",
\t\t\tifFormat : "{$cal_dateformat}",
\t\t\tshowsTime : false,
\t\t\tbutton : "{$varname}_trigger",
\t\t\tsingleClick : true,
\t\t\tstep : 1,
\t\t\tweekNumbers:false
\t\t});
\t\t</script>
EOQ;
        $dtscript = getVersionedScript('include/SugarFields/Fields/Datetimecombo/Datetimecombo.js');
        $html = <<<EOQ
\t\t<td scope="row" width="20%">{$displayname}</td>
\t\t<td class='dataField' width="30%"><input onblur="parseDate(this, '{$cal_dateformat}')" type="text" name='{$varname}' size="12" id='{$varname}_date' maxlength='10' value="">
\t\t<img border="0" src="{$jscalendarImage}" alt='{$app_strings['LBL_MASSUPDATE_DATE']}' id="{$varname}_trigger" title="{$app_strings['LBL_MASSUPDATE_DATE']}"  align="absmiddle">&nbsp;{$javascriptend}

\t\t<span id="{$varname}_time_section"></span>
\t\t</td>
\t\t<input type="hidden" id="{$varname}" name="{$varname}">
\t\t{$dtscript}
\t\t<script type="text/javascript">
\t\tvar combo_{$varname} = new Datetimecombo(" ", "{$varname}", "{$userformat}", '','','',1);
\t\t//Render the remaining widget fields
\t\ttext = combo_{$varname}.html('');
\t\tdocument.getElementById('{$varname}_time_section').innerHTML = text;

\t\t//Call eval on the update function to handle updates to calendar picker object
\t\teval(combo_{$varname}.jsscript(''));

\t\tfunction update_{$varname}_available() {
\t\t      YAHOO.util.Event.onAvailable("{$varname}_date", this.handleOnAvailable, this);
\t\t}

\t\tupdate_{$varname}_available.prototype.handleOnAvailable = function(me) {
\t\t\tCalendar.setup ({
\t\t\tonClose : update_{$varname},
\t\t\tinputField : "{$varname}_date",
\t\t\tdaFormat : "{$cal_dateformat}",
\t\t\tifFormat : "{$cal_dateformat}",
\t\t\tbutton : "{$varname}_trigger",
\t\t\tsingleClick : true,
\t\t\tstep : 1,
\t\t\tweekNumbers:false
\t\t\t});

\t\t\t//Call update for first time to round hours and minute values
\t\t\tcombo_{$varname}.update(false);
\t\t}

\t\tvar obj_{$varname} = new update_{$varname}_available();
\t\t</script>

\t\t<script> addToValidate('MassUpdate','{$varname}_date','date',false,'{$displayname}');
\t\taddToValidateBinaryDependency('MassUpdate', '{$varname}_hours', 'alpha', false, "{$app_strings['ERR_MISSING_REQUIRED_FIELDS']}", '{$varname}_date');
\t\taddToValidateBinaryDependency('MassUpdate', '{$varname}_minutes', 'alpha', false, "{$app_strings['ERR_MISSING_REQUIRED_FIELDS']}", '{$varname}_date');
\t\taddToValidateBinaryDependency('MassUpdate', '{$varname}_meridiem', 'alpha', false, "{$app_strings['ERR_MISSING_REQUIRED_FIELDS']}", '{$varname}_date');
\t\t</script>

EOQ;
        return $html;
    }
Esempio n. 11
0
    function getForm($prefix, $mod = 'Quotes')
    {
        if (!ACLController::checkAccess('Quotes', 'edit', true)) {
            return '';
        }
        if (!empty($mod)) {
            global $current_language;
            $mod_strings = return_module_language($current_language, $mod);
        } else {
            global $mod_strings;
        }
        global $app_strings;
        global $sugar_version, $sugar_config;
        $lbl_save_button_title = $app_strings['LBL_SAVE_BUTTON_TITLE'];
        $lbl_save_button_key = $app_strings['LBL_SAVE_BUTTON_KEY'];
        $lbl_save_button_label = $app_strings['LBL_SAVE_BUTTON_LABEL'];
        $the_form = get_left_form_header($mod_strings['LBL_NEW_FORM_TITLE']);
        $the_form .= getVersionedScript("modules/Quotes/Forms.js");
        $the_form .= <<<EOQ
\t\t<form name="{$prefix}EditView" onSubmit="return check_form('{$prefix}EditView')" method="POST" action="index.php">
\t\t\t<input type="hidden" name="{$prefix}module" value="Quotes">
\t\t\t<input type="hidden" name="{$prefix}action" value="Save">
EOQ;
        $the_form .= $this->getFormBody($prefix, $mod, "{$prefix}EditView");
        $the_form .= <<<EOQ
\t\t<input title="{$lbl_save_button_title}" accessKey="{$lbl_save_button_key}" class="button" type="submit" name="button" value="  {$lbl_save_button_label}  " >
\t\t</form>

EOQ;
        $the_form .= get_left_form_footer();
        $the_form .= get_validate_record_js();
        return $the_form;
    }
Esempio n. 12
0
 * 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".
 ********************************************************************************/
//NOTE: Under the License referenced above, you are required to leave in all copyright statements in both
//the code and end-user application.
global $sugar_config, $mod_strings;
?>
<style type="text/css">
ul li {
list-style-type: square;
}
</style>
<?php 
echo getVersionedScript("modules/Home/about.js");
?>
<span>
<div class="about" style="padding: 10px 15px 20px 15px;">
<p>
<h1><IMG src="include/images/sugar_md_open.png" alt="SugarCRM" width="425" height="30" ondblclick='abouter.display();'></h1>
<br>
<b><?php 
echo $mod_strings['LBL_VERSION'] . " " . $sugar_version . " (" . $mod_strings['LBL_BUILD'] . " " . $sugar_build . ")";
if (is_file("custom_version.php")) {
    include "custom_version.php";
    print "&nbsp;&nbsp;&nbsp;" . $custom_version;
}
?>
</b></p>
 function &_get_form($defines, $additionalFormFields = null)
 {
     global $app_strings;
     global $currentModule;
     $this->module = "Calls";
     $this->subpanelDiv = "activities";
     // Create the additional form fields with real values if they were not passed in
     if (empty($additionalFormFields) && $this->additional_form_fields) {
         foreach ($this->additional_form_fields as $key => $value) {
             if (!empty($defines['focus']->{$value})) {
                 $additionalFormFields[$key] = $defines['focus']->{$value};
             } else {
                 $additionalFormFields[$key] = '';
             }
         }
     }
     if (!empty($this->module)) {
         $defines['child_module_name'] = $this->module;
     } else {
         $defines['child_module_name'] = $defines['module'];
     }
     if (!empty($this->subpanelDiv)) {
         $defines['subpanelDiv'] = $this->subpanelDiv;
     }
     $defines['parent_bean_name'] = get_class($defines['focus']);
     $form = 'form' . $defines['child_module_name'];
     $button = '<form onsubmit="return SUGAR.subpanelUtils.sendAndRetrieve(this.id, \'subpanel_' . strtolower($defines['subpanelDiv']) . '\', \'' . addslashes($app_strings['LBL_LOADING']) . '\');" action="index.php" method="post" name="form" id="form' . $form . "\">\n";
     //module_button is used to override the value of module name
     $button .= "<input type='hidden' name='target_module' value='" . $defines['child_module_name'] . "'>\n";
     $button .= "<input type='hidden' name='" . strtolower($defines['parent_bean_name']) . "_id' value='" . $defines['focus']->id . "'>\n";
     if (isset($defines['focus']->name)) {
         $button .= "<input type='hidden' name='" . strtolower($defines['parent_bean_name']) . "_name' value='" . $defines['focus']->name . "'>";
     }
     $button .= '<input type="hidden" name="to_pdf" value="true" />';
     $button .= '<input type="hidden" name="tpl" value="QuickCreate.tpl" />';
     $button .= '<input type="hidden" name="return_module" value="' . $currentModule . "\" />\n";
     $button .= '<input type="hidden" name="return_action" value="' . $defines['action'] . "\" />\n";
     $button .= '<input type="hidden" name="return_id" value="' . $defines['focus']->id . "\" />\n";
     $button .= '<input type="hidden" name="record" value="" />';
     // TODO: move this out and get $additionalFormFields working properly
     if (empty($additionalFormFields['parent_type'])) {
         if ($defines['focus']->object_name == 'Contact') {
             $additionalFormFields['parent_type'] = 'Accounts';
         } else {
             $additionalFormFields['parent_type'] = $defines['focus']->module_dir;
         }
     }
     if (empty($additionalFormFields['parent_name'])) {
         if ($defines['focus']->object_name == 'Contact') {
             $additionalFormFields['parent_name'] = $defines['focus']->account_name;
             $additionalFormFields['account_name'] = $defines['focus']->account_name;
         } else {
             $additionalFormFields['parent_name'] = $defines['focus']->name;
         }
     }
     if (empty($additionalFormFields['parent_id'])) {
         if ($defines['focus']->object_name == 'Contact') {
             $additionalFormFields['parent_id'] = $defines['focus']->account_id;
             $additionalFormFields['account_id'] = $defines['focus']->account_id;
         } else {
             $additionalFormFields['parent_id'] = $defines['focus']->id;
         }
     }
     $button .= '<input type="hidden" name="action" value="SubpanelCreates" />' . "\n";
     $button .= '<input type="hidden" name="module" value="Home" />' . "\n";
     $button .= '<input type="hidden" name="target_action" value="QuickCreate" />' . "\n";
     // fill in additional form fields for all but action
     foreach ($additionalFormFields as $key => $value) {
         if ($key != 'action') {
             $button .= '<input type="hidden" name="' . $key . '" value="' . $value . '" />' . "\n";
         }
     }
     $button .= getVersionedScript('include/SugarFields/Fields/Datetimecombo/Datetimecombo.js') . "\n";
     return $button;
 }
Esempio n. 14
0
//Bug 12335: We need to include the javascript language file first. And also the language file in WorkFlow is needed.
if (!is_file(sugar_cached('jsLanguage/') . $GLOBALS['current_language'] . '.js')) {
    require_once 'include/language/jsLanguage.php';
    jsLanguage::createAppStringsCache($GLOBALS['current_language']);
}
$javascript_language_files = getVersionedScript("cache/jsLanguage/{$GLOBALS['current_language']}.js", $GLOBALS['sugar_config']['js_lang_version']);
if (!is_file(sugar_cached('jsLanguage/') . $this->module . '/' . $GLOBALS['current_language'] . '.js')) {
    require_once 'include/language/jsLanguage.php';
    jsLanguage::createModuleStringsCache($this->module, $GLOBALS['current_language']);
}
$javascript_language_files .= getVersionedScript("cache/jsLanguage/{$this->module}/{$GLOBALS['current_language']}.js", $GLOBALS['sugar_config']['js_lang_version']);
if (!is_file(sugar_cached('jsLanguage/WorkFlow/') . $GLOBALS['current_language'] . '.js')) {
    require_once 'include/language/jsLanguage.php';
    jsLanguage::createModuleStringsCache('WorkFlow', $GLOBALS['current_language']);
}
$javascript_language_files .= getVersionedScript("cache/jsLanguage/WorkFlow/{$GLOBALS['current_language']}.js", $GLOBALS['sugar_config']['js_lang_version']);
$the_javascript = "<script type='text/javascript' language='JavaScript'>\n";
$the_javascript .= "function set_return() {\n";
$the_javascript .= "    window.opener.document.EditView.submit();";
$the_javascript .= "}\n";
$the_javascript .= "</script>\n";
$form->assign("MOD", $mod_strings);
$form->assign("APP", $app_strings);
$form->assign('JS_INCLUDE', $js_include);
$form->assign("JAVASCRIPT_LANGUAGE_FILES", $javascript_language_files);
$form->assign("MODULE_NAME", $currentModule);
$form->assign("GRIDLINE", $gridline);
$form->assign("SET_RETURN_JS", $the_javascript);
$form->assign("BASE_MODULE", $workflow_object->base_module);
$form->assign("WORKFLOW_ID", $workflow_object->id);
$form->assign("ID", $focus->id);
Esempio n. 15
0
eoq;
}
$hidden_fields = "<input type=\"hidden\" name=\"module\" value=\"UpgradeWizard\">";
$hidden_fields .= "<input type=\"hidden\" name=\"action\" value=\"index\">";
$hidden_fields .= "<input type=\"hidden\" name=\"step\" value=\"{$_REQUEST['step']}\">";
$hidden_fields .= "<input type=\"hidden\" name=\"run\" value=\"upload\">";
$form2 = '';
/*  Removing Install From Sugar tab from Upgradewizard.
if(class_exists("PackageManagerDisplay")) {
	$form2 = PackageManagerDisplay::buildPatchDisplay($form, $hidden_fields, 'index.php', array('patch', 'module'));
}
*/
if ($form2 == null) {
    $form2 = $form;
}
$json = getVersionedScript('include/JSON.js');
$form3 = <<<eoq2
<br>

<table width="100%" border="0" cellspacing="0" cellpadding="0" class="edit view">
<tr><td>

\t<table width="100%" border="0" cellspacing="0" cellpadding="0">
\t\t<tr>
\t\t\t<td>
\t\t\t\t{$mod_strings['LBL_UW_FILES_QUEUED']}<br>
\t\t\t\t{$ready}
\t\t\t</td>
\t\t</tr>
\t</table>
</td></tr>
Esempio n. 16
0
}
$xtpl = new XTemplate('modules/Expressions/Filter_Selector.html');
$xtpl->assign("MOD", $mod_strings);
$xtpl->assign("APP", $app_strings);
$xtpl->assign("RETURN_PREFIX", $exp_object->return_prefix);
$xtpl->assign("PRINT_URL", "index.php?" . $GLOBALS['request_string']);
require_once 'include/language/jsLanguage.php';
if (!is_file(sugar_cached('jsLanguage/') . $GLOBALS['current_language'] . '.js')) {
    jsLanguage::createAppStringsCache($GLOBALS['current_language']);
}
if (!is_file(sugar_cached('jsLanguage/') . $exp_object->module_dir . '/' . $GLOBALS['current_language'] . '.js')) {
    jsLanguage::createModuleStringsCache($exp_object->module_dir, $GLOBALS['current_language']);
}
$javascript_language_files = getVersionedScript("cache/jsLanguage/{$GLOBALS['current_language']}.js", $GLOBALS['sugar_config']['js_lang_version']);
$javascript_language_files .= "\n";
$javascript_language_files .= getVersionedScript("cache/jsLanguage/{$exp_object->module_dir}/{$GLOBALS['current_language']}.js", $GLOBALS['sugar_config']['js_lang_version']);
$xtpl->assign("JAVASCRIPT_LANGUAGE_FILES", $javascript_language_files);
insert_popup_header($theme);
$xtpl->parse("embeded");
$xtpl->out("embeded");
if (isset($exp_meta_array['select_field']) && $exp_meta_array['select_field'] === true) {
    $xtpl->assign('SELECT_FIELD', "Yes");
}
$xtpl->assign('EXP_META_TYPE', $exp_meta_type);
///Show field selector if required////
$xtpl->assign('PARENT_TYPE', $exp_object->parent_type);
$form_name = "FieldView";
if (isset($exp_meta_array['select_field']) && $exp_meta_array['select_field'] === true) {
    $temp_module = BeanFactory::getBean($exp_object->lhs_module);
    $temp_module->call_vardef_handler("normal_trigger");
    $temp_module->vardef_handler->start_none = true;
Esempio n. 17
0
    /**
     * Renders the QuickCreate form from Smarty and returns HTML
     * @param array $vars request variable global
     * @param object $email Fetched email object
     * @param bool $addToAddressBook
     * @return array
     */
    function getQuickCreateForm($vars, $email, $addToAddressBookButton = false)
    {
        require_once "include/EditView/EditView2.php";
        global $app_strings;
        global $mod_strings;
        global $current_user;
        global $current_language;
        $module = $_REQUEST['qc_module'];
        $beanName = BeanFactory::getBeanName($module);
        //Setup the current module languge
        $mod_strings = return_module_language($current_language, $module);
        $focus = BeanFactory::getBean($module);
        $people = array('Contact', 'Lead');
        $emailAddress = array();
        // people
        if (in_array($beanName, $people)) {
            // lead specific
            $focus->lead_source = 'Email';
            $focus->lead_source_description = trim($email->name);
            $from = isset($email->from_name) && !empty($email->from_name) ? $email->from_name : $email->from_addr;
            if (isset($_REQUEST['sugarEmail']) && !empty($_REQUEST['sugarEmail'])) {
                if ($email->status == "sent") {
                    $from = isset($email->to_addrs_names) && !empty($email->to_addrs_names) ? $email->to_addrs_names : $email->to_addrs;
                } else {
                    $from = isset($email->from_name) && !empty($email->from_name) ? $email->from_name : $email->from_addr_name;
                }
            }
            $name = explode(" ", trim($from));
            $address = trim(array_pop($name));
            $address = str_replace(array("<", ">", "&lt;", "&gt;"), "", $address);
            $emailAddress[] = array('email_address' => $address, 'primary_address' => 1, 'invalid_email' => 0, 'opt_out' => 0, 'reply_to_address' => 1);
            $focus->email1 = $address;
            if (!empty($name)) {
                $focus->last_name = trim(array_pop($name));
                foreach ($name as $first) {
                    if (!empty($focus->first_name)) {
                        $focus->first_name .= " ";
                    }
                    $focus->first_name .= trim($first);
                }
            }
        } else {
            // case & bug specific
            $focus->source = 'InboundEmail';
            // bugs, cases, tasks
            $focus->name = trim($email->name);
        }
        $focus->description = trim(strip_tags($email->description));
        $focus->assigned_user_id = $current_user->id;
        $focus->team_id = $current_user->default_team;
        $EditView = new EditView();
        $EditView->ss = new Sugar_Smarty();
        //MFH BUG#20283 - checks for custom quickcreate fields
        $EditView->setup($module, $focus, SugarAutoLoader::loadWithMetafiles($module, 'editviewdefs'));
        $EditView->process();
        $EditView->render();
        $EditView->defs['templateMeta']['form']['buttons'] = array('email2save' => array('id' => 'e2AjaxSave', 'customCode' => '<input type="button" class="button" value="   ' . $app_strings['LBL_SAVE_BUTTON_LABEL'] . '   " onclick="SUGAR.email2.detailView.saveQuickCreate(false);" />'), 'email2saveandreply' => array('id' => 'e2SaveAndReply', 'customCode' => '<input type="button" class="button" value="   ' . $app_strings['LBL_EMAIL_SAVE_AND_REPLY'] . '   " onclick="SUGAR.email2.detailView.saveQuickCreate(\'reply\');" />'), 'email2cancel' => array('id' => 'e2cancel', 'customCode' => '<input type="button" class="button" value="   ' . $app_strings['LBL_EMAIL_CANCEL'] . '   " onclick="SUGAR.email2.detailView.quickCreateDialog.hide();" />'));
        if ($addToAddressBookButton) {
            $EditView->defs['templateMeta']['form']['buttons']['email2saveAddToAddressBook'] = array('id' => 'e2addToAddressBook', 'customCode' => '<input type="button" class="button" value="   ' . $app_strings['LBL_EMAIL_ADDRESS_BOOK_SAVE_AND_ADD'] . '   " onclick="SUGAR.email2.detailView.saveQuickCreate(true);" />');
        }
        //Get the module language for javascript
        if (!is_file(sugar_cached('jsLanguage/') . "{$module}/{$GLOBALS['current_language']}.js")) {
            require_once 'include/language/jsLanguage.php';
            jsLanguage::createModuleStringsCache($module, $GLOBALS['current_language']);
        }
        $jsLanguage = getVersionedScript("cache/jsLanguage/{$module}/{$GLOBALS['current_language']}.js", $GLOBALS['sugar_config']['js_lang_version']);
        if ($focus->object_name == 'Contact') {
            $admin = Administration::getSettings();
            if (empty($admin->settings['portal_on']) || !$admin->settings['portal_on']) {
                unset($EditView->sectionPanels[strtoupper('lbl_portal_information')]);
            } else {
                $jsLanguage .= getVersionedScript("modules/Contacts/Contact.js");
                $jsLanguage .= getVersionedScript("modules/Contacts/QuickCreateEmailContact.js");
                $jsLanguage .= <<<EOQ
\t\t\t    <script language="javascript">
\t\t\t\t   addToValidateComparison('form_EmailQCView_Contacts', 'portal_password', 'varchar', false, SUGAR.language.get('app_strings', 'ERR_SQS_NO_MATCH_FIELD') + SUGAR.language.get('Contacts', 'LBL_PORTAL_PASSWORD'), 'portal_password1');
\t\t           addToValidateVerified('form_EmailQCView_Contacts', 'portal_name_verified', 'bool', false, SUGAR.language.get('app_strings', 'ERR_EXISTING_PORTAL_USERNAME'));
\t\t           YAHOO.util.Event.on('portal_name', 'blur', validatePortalName);
\t\t\t\t   YAHOO.util.Event.on('portal_name', 'keydown', handleKeyDown);
\t\t\t    </script>
EOQ;
            }
        }
        $EditView->view = 'EmailQCView';
        $EditView->defs['templateMeta']['form']['headerTpl'] = 'include/EditView/header.tpl';
        $EditView->defs['templateMeta']['form']['footerTpl'] = 'include/EditView/footer.tpl';
        $meta = array();
        $meta['html'] = $jsLanguage . $EditView->display(false, true);
        $meta['html'] = str_replace("src='" . getVersionedPath('include/SugarEmailAddress/SugarEmailAddress.js') . "'", '', $meta['html']);
        $meta['emailAddress'] = $emailAddress;
        $mod_strings = return_module_language($current_language, 'Emails');
        return $meta;
    }
                        }
                    } else {
                        echo "{$mod_strings_users['LBL_REASS_UPDATE_COMPLETE']}\n<BR>\n";
                        echo "&nbsp;&nbsp;" . count($successarr) . " {$mod_strings_users['LBL_REASS_SUCCESSFUL']}\n<BR>\n";
                        echo "&nbsp;&nbsp;" . count($failarr) . " {$mod_strings_users['LBL_REASS_FAILED']}\n";
                    }
                    echo "<BR>\n";
                }
                echo "</td></tr></table>\n";
            }
            echo "<BR><input type=button class=\"button\" value=\"{$mod_strings_users['LBL_REASS_BUTTON_RETURN']}\" onclick='document.location=\"index.php?module=Users&action=reassignUserRecords\"'>\n";
            /////////////////// END STEP 3 - Execute reassignment ///////////////////////
        }
    }
}
echo getVersionedScript("cache/include/javascript/sugar_grp_overlib.js");
?>
<script type="text/javascript">

function clearCurrentRecords()
{
    var callback = {
                success: function(){
                    document.getElementById('fromuser').selectedIndex = 0;
                    document.getElementById('touser').selectedIndex = 0;
                    document.getElementById('modulemultiselect').selectedIndex = -1;
                    updateDivDisplay(document.getElementById('modulemultiselect'));
                }
            };

    YAHOO.util.Connect.asyncRequest('POST', 'index.php?module=Users&action=clearreassignrecords&to_pdf=1', callback, null);
function template_reports_functions_js(&$args)
{
    global $mod_strings;
    ?>
<script language="javascript">
var image_path = "<?php 
    echo $args['IMAGE_PATH'];
    ?>
";
var lbl_and = "<?php 
    echo $mod_strings['LBL_AND'];
    ?>
";
var lbl_select = "<?php 
    echo $mod_strings['LBL_SELECT'];
    ?>
";
var lbl_remove = "<?php 
    echo $mod_strings['LBL_REMOVE'];
    ?>
";
var lbl_missing_fields = "<?php 
    echo $mod_strings['LBL_MISSING_FIELDS'];
    ?>
";
var lbl_at_least_one_display_column = "<?php 
    echo $mod_strings['LBL_AT_LEAST_ONE_DISPLAY_COLUMN'];
    ?>
";
var lbl_at_least_one_summary_column = "<?php 
    echo $mod_strings['LBL_AT_LEAST_ONE_SUMMARY_COLUMN'];
    ?>
";
var lbl_missing_input_value  = "<?php 
    echo $mod_strings['LBL_MISSING_INPUT_VALUE'];
    ?>
";
var lbl_missing_second_input_value = "<?php 
    echo $mod_strings['LBL_MISSING_SECOND_INPUT_VALUE'];
    ?>
";
var lbl_nothing_was_selected = "<?php 
    echo $mod_strings['LBL_NOTHING_WAS_SELECTED'];
    ?>
"
var lbl_none = "<?php 
    echo $mod_strings['LBL_NONE'];
    ?>
";
var lbl_outer_join_checkbox = "<?php 
    echo $mod_strings['LBL_OUTER_JOIN_CHECKBOX'];
    ?>
";
var lbl_add_related = "<?php 
    echo $mod_strings['LBL_ADD_RELATE'];
    ?>
";
var lbl_del_this = "<?php 
    echo $mod_strings['LBL_DEL_THIS'];
    ?>
";
var lbl_alert_cant_add = "<?php 
    echo $mod_strings['LBL_ALERT_CANT_ADD'];
    ?>
";
var lbl_related_table_blank = "<?php 
    echo $mod_strings['LBL_RELATED_TABLE_BLANK'];
    ?>
";
var lbl_optional_help = "<?php 
    echo $mod_strings['LBL_OPTIONAL_HELP'];
    ?>
";
</script>
<?php 
    echo getVersionedScript('include/javascript/report_additionals.js');
}
 function display()
 {
     $message = $this->view_object_map['message'];
     echo $message . getVersionedScript('cache/include/javascript/sugar_grp1_yui.js?') . "<script type='text/javascript' language='Javascript'>YAHOO.util.Connect.asyncRequest('GET', 'index.php?module=Administration&action=RebuildRelationship&silent=true');</script>";
 }
Esempio n. 21
0
 /**
  * @return void
  * @param unknown $data
  * @param unknown $xTemplateSection
  * @param unknown $html_varName
  * @desc INTERNAL FUNCTION handles the rows
  * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
  * All Rights Reserved.
  * Contributor(s): ______________________________________..
  */
 function processListRows($data, $xtemplateSection, $html_varName)
 {
     global $odd_bg;
     global $even_bg;
     global $hilite_bg;
     global $app_strings, $sugar_version, $sugar_config;
     global $currentModule;
     static $overlib_included;
     if (!$overlib_included) {
         echo getVersionedScript('cache/include/javascript/sugar_grp_overlib.js') . '<div id="overDiv" style="position:absolute; visibility:hidden; z-index:1000;"></div>';
         $overlib_included = true;
     }
     $this->xTemplate->assign('BG_HILITE', $hilite_bg);
     $this->xTemplate->assign('CHECKALL', SugarThemeRegistry::current()->getImage('blank', '', 1, 1, ".gif", ''));
     //$this->xTemplate->assign("BG_CLICK", $click_bg);
     $oddRow = true;
     $count = 0;
     reset($data);
     //GETTING OFFSET
     $offset = $this->getOffset($html_varName);
     $timeStamp = $this->unique_id();
     $_SESSION[$html_varName . "_FROM_LIST_VIEW"] = $timeStamp;
     $associated_row_data = array();
     //mail merge list
     $mergeList = array();
     $module = '';
     //todo what is this?  It is using an array as a boolean
     while (list($aVal, $aItem) = each($data)) {
         if (isset($this->data_array)) {
             $fields = $this->data_array;
         } else {
             $aItem->check_date_relationships_load();
             $fields = $aItem->get_list_view_data();
         }
         if (is_object($aItem)) {
             // cn: bug 5349
             //add item id to merge list, if the button is clicked
             $mergeList[] = $aItem->id;
             if (empty($module)) {
                 $module = $aItem->module_dir;
             }
         }
         //ADD OFFSET TO ARRAY
         $fields['OFFSET'] = $offset + $count + 1;
         $fields['STAMP'] = $timeStamp;
         if ($this->shouldProcess) {
             $prerow = '';
             if (!isset($this->data_array)) {
                 $prerow .= "<input onclick='sListView.check_item(this, document.MassUpdate)' type='checkbox' class='checkbox' name='mass[]' value='" . $fields['ID'] . "'>";
             }
             $this->xTemplate->assign('PREROW', $prerow);
             $this->xTemplate->assign('CHECKALL', "<input type='checkbox' class='checkbox'  title='" . $GLOBALS['app_strings']['LBL_SELECT_ALL_TITLE'] . "'  name='massall' id='massall' value='' onclick='sListView.check_all(document.MassUpdate, \"mass[]\", this.checked)'>");
         }
         if (!isset($this->data_array)) {
             $tag = $aItem->listviewACLHelper();
             $this->xTemplate->assign('TAG', $tag);
         }
         if ($oddRow) {
             $ROW_COLOR = 'oddListRow';
             $BG_COLOR = $odd_bg;
         } else {
             $ROW_COLOR = 'evenListRow';
             $BG_COLOR = $even_bg;
         }
         $oddRow = !$oddRow;
         $this->xTemplate->assign('ROW_COLOR', $ROW_COLOR);
         $this->xTemplate->assign('BG_COLOR', $BG_COLOR);
         if (isset($this->data_array)) {
             $this->xTemplate->assign('KEY', $aVal);
             $this->xTemplate->assign('VALUE', $aItem);
             $this->xTemplate->assign('INDEX', $count);
         } else {
             //AED -- some modules do not have their additionalDetails.php established. Add a check to ensure require_once does not fail
             // Bug #2786
             if ($this->_additionalDetails && $aItem->ACLAccess('DetailView') && (file_exists('modules/' . $aItem->module_dir . '/metadata/additionalDetails.php') || file_exists('custom/modules/' . $aItem->module_dir . '/metadata/additionalDetails.php'))) {
                 $additionalDetailsFile = 'modules/' . $aItem->module_dir . '/metadata/additionalDetails.php';
                 if (file_exists('custom/modules/' . $aItem->module_dir . '/metadata/additionalDetails.php')) {
                     $additionalDetailsFile = 'custom/modules/' . $aItem->module_dir . '/metadata/additionalDetails.php';
                 }
                 require_once $additionalDetailsFile;
                 $ad_function = (empty($this->additionalDetailsFunction) ? 'additionalDetails' : $this->additionalDetailsFunction) . $aItem->object_name;
                 $results = $ad_function($fields);
                 $results['string'] = str_replace(array("&#039", "'"), '\\&#039', $results['string']);
                 // no xss!
                 if (trim($results['string']) == '') {
                     $results['string'] = $app_strings['LBL_NONE'];
                 }
                 $fields[$results['fieldToAddTo']] = $fields[$results['fieldToAddTo']] . '</a>';
             }
             //fixes bug for IE where empty list view rows causes IE to not display bottom border
             if (isset($fields['DESCRIPTION']) && empty($fields['DESCRIPTION'])) {
                 $fields['DESCRIPTION'] = "&nbsp;";
             }
             if (isset($fields['LIST_ORDER']) && empty($fields['LIST_ORDER'])) {
                 $fields['LIST_ORDER'] = "&nbsp;";
             }
             $this->xTemplate->assign($html_varName, $fields);
             $aItem->setupCustomFields($aItem->module_dir);
             $aItem->custom_fields->populateAllXTPL($this->xTemplate, 'detail', $html_varName, $fields);
         }
         if (!isset($this->data_array) && $aItem->ACLAccess('DetailView')) {
             $count++;
         }
         if (isset($this->data_array)) {
             $count++;
         }
         if (!isset($this->data_array)) {
             $aItem->list_view_parse_additional_sections($this->xTemplate, $xtemplateSection);
             if ($this->xTemplate->exists($xtemplateSection . '.row.pro')) {
                 $this->xTemplate->parse($xtemplateSection . '.row.pro');
             }
         }
         $this->xTemplate->parse($xtemplateSection . '.row');
         if (isset($fields['ID'])) {
             $associated_row_data[$fields['ID']] = $fields;
             // Bug 38908: cleanup data for JS to avoid having &nbsp; shuffled around
             foreach ($fields as $key => $value) {
                 if ($value == '&nbsp;') {
                     $associated_row_data[$fields['ID']][$key] = '';
                 }
             }
         }
     }
     $_SESSION['MAILMERGE_RECORDS'] = $mergeList;
     $_SESSION['MAILMERGE_MODULE_FROM_LISTVIEW'] = $module;
     if (empty($_REQUEST['action']) || $_REQUEST['action'] != 'Popup') {
         $_SESSION['MAILMERGE_MODULE'] = $module;
     }
     if ($this->process_for_popups) {
         $json = getJSONobj();
         $is_show_fullname = showFullName() ? 1 : 0;
         $associated_javascript_data = '<script type="text/javascript">' . "\n" . 'var associated_javascript_data = ' . $json->encode($associated_row_data) . ";\n" . 'var is_show_fullname = ' . $is_show_fullname . ";\n" . '</script>';
         $this->xTemplate->assign('ASSOCIATED_JAVASCRIPT_DATA', $associated_javascript_data);
     }
     $this->xTemplate->parse($xtemplateSection);
 }