function template_groups_chooser(&$args)
{
    global $mod_strings, $js_loaded;
    $table_style = '';
    if (!empty($args['display'])) {
        $table_style = "display: " . $args['display'] . "\"";
    }
    $uparraow_big = SugarThemeRegistry::current()->getImage('uparrow_big', 'border="0" style="margin-bottom: 1px;"', null, null, '.gif', $mod_strings['LBL_SORT']);
    $downarrow_big = SugarThemeRegistry::current()->getImage('downarrow_big', 'border="0" style="margin-top: 1px;" ', null, null, '.gif', $mod_strings['LBL_SORT']);
    $leftarrow_big = SugarThemeRegistry::current()->getImage('leftarrow_big', 'border="0" style="margin-right: 1px;"', null, null, '.gif', $mod_strings['LBL_SORT']);
    $rightarrow_big = SugarThemeRegistry::current()->getImage('rightarrow_big', 'border="0" style="margin-left: 1px;"', null, null, '.gif', $mod_strings['LBL_SORT']);
    $smarty = new Sugar_Smarty();
    $smarty->assign('args', $args);
    $smarty->assign('js_loaded', $js_loaded);
    $smarty->assign('table_style', $table_style);
    $smarty->assign('uparraow_big', $uparraow_big);
    $smarty->assign('downarrow_big', $downarrow_big);
    $smarty->assign('leftarrow_big', $leftarrow_big);
    $smarty->assign('rightarrow_big', $rightarrow_big);
    $smarty->assign('table_style', $table_style);
    //echo $smarty->fetch("modules/Reports/templates/_template_groups_chooser.tpl");
    if ($js_loaded == false) {
        $js_loaded = true;
    }
    return $smarty->fetch("modules/Reports/templates/_template_groups_chooser.tpl");
}
    public function display()
    {
        global $beanList, $beanFiles, $current_user, $app_strings, $app_list_strings;
        $moduleDir = empty($_REQUEST['bean']) ? '' : $_REQUEST['bean'];
        $beanName = empty($beanList[$moduleDir]) ? '' : $beanList[$moduleDir];
        $id = empty($_REQUEST['id']) ? '' : $_REQUEST['id'];
        // Bug 40216 - Add support for a custom additionalDetails.php file
        $additionalDetailsFile = $this->getAdditionalDetailsMetadataFile($moduleDir);
        if (empty($id) || empty($additionalDetailsFile)) {
            echo 'bad data';
            die;
        }
        require_once $additionalDetailsFile;
        $adFunction = 'additionalDetails' . $beanName;
        if (function_exists($adFunction)) {
            // does the additional details function exist
            $json = getJSONobj();
            $bean = BeanFactory::getBean($moduleDir, $id);
            //bug38901 - shows dropdown list label instead of database value
            foreach ($bean->field_name_map as $field => $value) {
                if ($value['type'] == 'enum' && !empty($value['options']) && !empty($app_list_strings[$value['options']]) && isset($app_list_strings[$value['options']][$bean->{$field}])) {
                    $bean->{$field} = $app_list_strings[$value['options']][$bean->{$field}];
                }
            }
            $bean->ACLFilterFields();
            $arr = array_change_key_case($bean->toArray(), CASE_UPPER);
            $results = $adFunction($arr);
            $retArray['body'] = str_replace(array("\rn", "\r", "\n"), array('', '', '<br />'), $results['string']);
            $retArray['caption'] = "<div style='float:left'>{$app_strings['LBL_ADDITIONAL_DETAILS']}</div><div style='float: right'>";
            if (!empty($_REQUEST['show_buttons'])) {
                if ($bean->ACLAccess('EditView')) {
                    $editImg = SugarThemeRegistry::current()->getImageURL('edit_inline.png', false);
                    $results['editLink'] = $this->buildButtonLink($results['editLink']);
                    $retArray['caption'] .= <<<EOC
<a style="text-decoration:none;" title="{$GLOBALS['app_strings']['LBL_EDIT_BUTTON']}" href="{$results['editLink']}">
    <img border=0 src="{$editImg}">
</a>
EOC;
                }
                if ($bean->ACLAccess('DetailView')) {
                    $detailImg = SugarThemeRegistry::current()->getImageURL('view_inline.png', false);
                    $results['viewLink'] = $this->buildButtonLink($results['viewLink']);
                    $retArray['caption'] .= <<<EOC
<a style="text-decoration:none;" title="{$GLOBALS['app_strings']['LBL_VIEW_BUTTON']}" href="{$results['viewLink']}">
    <img border=0 src="{$detailImg}" style="margin-left:2px;">
</a>
EOC;
                }
                $closeImg = SugarThemeRegistry::current()->getImageURL('close.png', false);
                $retArray['caption'] .= <<<EOC
<a title="{$GLOBALS['app_strings']['LBL_ADDITIONAL_DETAILS_CLOSE_TITLE']}" href="javascript:SUGAR.util.closeStaticAdditionalDetails();">
    <img border=0 src="{$closeImg}" style="margin-left:2px;">
</a>
EOC;
            }
            $retArray['caption'] .= "";
            $retArray['width'] = empty($results['width']) ? '300' : $results['width'];
            echo 'result = ' . $json->encode($retArray);
        }
    }
 function &displayList($layout_def)
 {
     if (!empty($layout_def['column_key'])) {
         $field_def = $this->reporter->all_fields[$layout_def['column_key']];
     } else {
         if (!empty($layout_def['fields'])) {
             $field_def = $layout_def['fields'];
         }
     }
     $cell = $this->displayListPlain($layout_def);
     $str = $cell;
     global $sugar_config;
     if (isset($sugar_config['enable_inline_reports_edit']) && $sugar_config['enable_inline_reports_edit']) {
         $module = $this->reporter->all_fields[$layout_def['column_key']]['module'];
         $name = $layout_def['name'];
         $layout_def['name'] = 'id';
         $key = $this->_get_column_alias($layout_def);
         $key = strtoupper($key);
         //If the key isn't in the layout fields, skip it
         if (!empty($layout_def['fields'][$key])) {
             $record = $layout_def['fields'][$key];
             $field_name = $field_def['name'];
             $field_type = $field_def['type'];
             $div_id = $field_def['module'] . "&{$record}&{$field_name}";
             $str = "<div id='{$div_id}'>" . $cell . "&nbsp;" . SugarThemeRegistry::current()->getImage("edit_inline", "border='0' alt='Edit Layout' align='bottom' onClick='SUGAR.reportsInlineEdit.inlineEdit(" . "\"{$div_id}\",\"{$cell}\",\"{$module}\",\"{$record}\",\"{$field_name}\",\"{$field_type}\");'") . "</div>";
         }
     }
     return $str;
 }
Example #4
0
    function getBody()
    {
        global $locale;
        $d_image = explode('?', SugarThemeRegistry::current()->getImageURL('company_logo.png'));
        return '<table style="width: 100%;" border="0" cellspacing="2" cellpadding="2">
<tbody style="text-align: left;">
<tr>
<td valign="top">
<p><img src="' . $d_image[0] . '" style="float: left;"/>&nbsp;</p>
</td>
<td style="font-weight: bold; text-align: right;"><div>' . translate('LBL_BROWSER_TITLE') . ' Ltd<br />' . translate('LBL_ANY_STREET', 'AOS_PDF_Templates') . '<br />' . translate('LBL_ANY_TOWN', 'AOS_PDF_Templates') . '</span><br />' . translate('LBL_ANY_WHERE', 'AOS_PDF_Templates') . '</div></td>
</tr>
</tbody>
</table>
<div><br /></div>
<div>$accounts_name<br /> $accounts_billing_address_street<br /> $accounts_billing_address_city<br /> $accounts_billing_address_state<br /> $accounts_billing_address_postalcode</div>
<div><br /></div>
<div>{DATE ' . $locale->getPrecedentPreference('default_date_format') . '}</div>
<div><br /></div>
<p>Dear $accounts_name</p>
<p>OpenSales was originally designed and conceived by Rustin Phares. In  2009, when Rustin could no longer devote time to the project, which is  an important one for the Community Edition of SugarCRM, SalesAgility approached him to seek permission to pick up where he had left off.</p>
<p>In early 2010 we released the first iteration of what was now to be  called "Advanced OpenSales". Since then there have been regular releases  to bring Advanced OpenSales into line with the latest releases of  SugarCRM and to advance the functionality.</p>
<p>2011 saw a complete rewrite of Advanced OpenSales to bring it into  line with the 5.x and 6.x architectures and the introduction of an  Invoice module. In March 2011, an Invoicing module for SugarCRM  Professional Edition was also released.</p>
<p>Advanced OpenSales is released under the Affero General Purpose  License meaning it&#39;s Open Source and freely available. That does not  mean that there is no cost involved in making it. Thousands of man hours  have gone in to developing and maintaining these modules. Any  contributions that assist us in keeping the project on an even keel are  gratefully received.</p>
<p>SalesAgility are SugarCRM experts. With offices in Manchester and Central Scotland,  we&#39;re ideally placed to serve your SugarCRM requirements. As  consultants, we design and implement tailored Sugar CRM instances. As  software developers, we design and deliver customised instances of Sugar  CRM that meet the more specialist needs of our clients. As a support  organisation we deliver training, hosting and help-desk services to  ensure that our clients continue to get best value from their Sugar  investment.</p>
<p>Yours sincerely</p>
<p> </p>
<p> </p>
<p>Someone</p>';
    }
/**
 * Smarty {sugar_getlink} function plugin
 *
 * Type:     function
 * Name:     sugar_getlink
 * Purpose:  Returns HTML link <a> with embedded image or normal text
 * 
 * @param array
 * @param Smarty
 */
function smarty_function_sugar_getlink($params, &$smarty)
{
    // error checking for required parameters
    if (!isset($params['url'])) {
        $smarty->trigger_error($GLOBALS['app_strings']['ERR_MISSING_REQUIRED_FIELDS'] . 'url');
    }
    if (!isset($params['title'])) {
        $smarty->trigger_error($GLOBALS['app_strings']['ERR_MISSING_REQUIRED_FIELDS'] . 'title');
    }
    // set defaults
    if (!isset($params['attr'])) {
        $params['attr'] = '';
    }
    if (!isset($params['img_name'])) {
        $params['img_name'] = '';
    }
    if (!isset($params['img_attr'])) {
        $params['img_attr'] = '';
    }
    if (!isset($params['img_width'])) {
        $params['img_width'] = null;
    }
    if (!isset($params['img_height'])) {
        $params['height'] = null;
    }
    if (!isset($params['img_placement'])) {
        $params['img_placement'] = 'imageonly';
    }
    if (!isset($params['img_alt'])) {
        $params['img_alt'] = '';
    }
    return SugarThemeRegistry::current()->getLink($params['url'], $params['title'], $params['attr'], $params['img_name'], $params['img_attr'], $params['img_width'], $params['img_height'], $params['img_alt'], $params['img_placement']);
}
/**
 * Smarty {sugar_include} function plugin
 *
 * Type:     function<br>
 * Name:     sugar_include<br>
 * Purpose:  Handles rendering the global file includes from the metadata files defined
 *           in templateMeta=>includes.
 * 
 * @author Collin Lee {clee@sugarcrm.com}
 * @param array
 * @param Smarty
 */
function smarty_function_sugar_getimagepath($params, &$smarty)
{
    if (!isset($params['file'])) {
        $smarty->trigger_error($GLOBALS['app_strings']['ERR_MISSING_REQUIRED_FIELDS'] . 'file');
    }
    return SugarThemeRegistry::current()->getImageURL($params['file']);
}
 function displayList($layout_def)
 {
     global $app_strings;
     $return_module = $_REQUEST['module'];
     $return_id = $_REQUEST['record'];
     $module_name = $layout_def['module'];
     $record_id = $layout_def['fields']['ID'];
     // calls and meetings are held.
     $new_status = 'Held';
     switch ($module_name) {
         case 'Tasks':
             $new_status = 'Completed';
             break;
     }
     $subpanel = $layout_def['subpanel_id'];
     if (isset($layout_def['linked_field_set']) && !empty($layout_def['linked_field_set'])) {
         $linked_field = $layout_def['linked_field_set'];
     } else {
         $linked_field = $layout_def['linked_field'];
     }
     $refresh_page = 0;
     if (!empty($layout_def['refresh_page'])) {
         $refresh_page = 1;
     }
     $html = "<a onclick='return sp_del_conf();' href=\"javascript:sub_p_del('{$subpanel}', '{$module_name}', '{$record_id}', {$refresh_page});\">" . SugarThemeRegistry::current()->getImage("delete_inline", "alt=" . translate('LBL_LIST_DELETE', $module_name) . " border='0'") . "</a>";
     return $html;
 }
/**
 * Smarty {sugar_getimage} function plugin
 *
 * Type:     function
 * Name:     sugar_getimage
 * Purpose:  Returns HTML image or sprite
 * 
 * @author Aamir Mansoor (amansoor@sugarcrm.com) 
 * @author Cam McKinnon (cmckinnon@sugarcrm.com)
 * @param array
 * @param Smarty
 */
function smarty_function_sugar_getimage($params, &$smarty)
{
    // error checking for required parameters
    if (!isset($params['name'])) {
        $smarty->trigger_error($GLOBALS['app_strings']['ERR_MISSING_REQUIRED_FIELDS'] . 'name');
    }
    // temp hack to deprecate the use of other_attributes
    if (isset($params['other_attributes'])) {
        $params['attr'] = $params['other_attributes'];
    }
    // set defaults
    if (!isset($params['attr'])) {
        $params['attr'] = '';
    }
    if (!isset($params['width'])) {
        $params['width'] = null;
    }
    if (!isset($params['height'])) {
        $params['height'] = null;
    }
    if (!isset($params['alt'])) {
        $params['alt'] = '';
    }
    // deprecated ?
    if (!isset($params['ext'])) {
        $params['ext'] = null;
    }
    return SugarThemeRegistry::current()->getImage($params['name'], $params['attr'], $params['width'], $params['height'], $params['ext'], $params['alt']);
}
Example #9
0
/**
 * Create HTML form to enter a new record with the minimum necessary fields.
 * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
 * All Rights Reserved.
 * Contributor(s): ______________________________________..
 */
function get_new_record_form()
{
    global $app_strings;
    global $app_list_strings;
    global $mod_strings;
    global $currentModule;
    global $current_user;
    global $timedate;
    $the_form = get_left_form_header($mod_strings['LBL_NEW_FORM_TITLE']);
    $form = new XTemplate('modules/Campaigns/Forms.html');
    $module_select = empty($_REQUEST['module_select']) ? '' : $_REQUEST['module_select'];
    $form->assign('MOD', $mod_strings);
    $form->assign('APP', $app_strings);
    $form->assign('THEME', SugarThemeRegistry::current()->__toString());
    $form->assign("JAVASCRIPT", get_set_focus_js() . get_validate_record_js());
    $form->assign("STATUS_OPTIONS", get_select_options_with_id($app_list_strings['campaign_status_dom'], "Planning"));
    $form->assign("TYPE_OPTIONS", get_select_options_with_id($app_list_strings['campaign_type_dom'], ""));
    $form->assign("USER_ID", $current_user->id);
    $form->assign("TEAM_ID", sprintf('<input type="hidden" name="team_id" value="%s">', $current_user->default_team));
    $form->assign("CALENDAR_LANG", "en");
    $form->assign("USER_DATEFORMAT", '(' . $timedate->get_user_date_format() . ')');
    $form->assign("CALENDAR_DATEFORMAT", $timedate->get_cal_date_format());
    $form->parse('main');
    $the_form .= $form->text('main');
    $focus = BeanFactory::getBean('Campaigns');
    $javascript = new javascript();
    $javascript->setFormName('quick_save');
    $javascript->setSugarBean($focus);
    $javascript->addRequiredFields('');
    $jscript = $javascript->getScript();
    $the_form .= $jscript . get_left_form_footer();
    return $the_form;
}
Example #10
0
 /**
  * display
  * Override the display method to support customization for the buttons that display
  * a popup and allow you to copy the account's address into the selected contacts.
  * The custom_code_billing and custom_code_shipping Smarty variables are found in
  * include/SugarFields/Fields/Address/DetailView.tpl (default).  If it's a English U.S.
  * locale then it'll use file include/SugarFields/Fields/Address/en_us.DetailView.tpl.
  */
 function display()
 {
     global $app_strings, $app_list_strings;
     global $mod_strings;
     parent::display();
     $smarty = new Sugar_Smarty();
     $smarty->assign('APP', $app_strings);
     $smarty->assign('MOD', $mod_strings);
     $smarty->assign('RECORD', $this->bean->id);
     $popup_request_data = array('call_back_function' => 'set_return', 'form_name' => 'xeBayOrderSend', 'field_to_name_array' => array('description' => 'message'));
     $json = getJSONobj();
     $smarty->assign('ENCODED_TEMPLATES_POPUP_REQUEST_DATA', $json->encode($popup_request_data));
     $smarty->assign("TEMPLATE_SELECT", SugarThemeRegistry::current()->getImage('id-ff-select', '', null, null, '.png', $mod_strings['LBL_SELECT']));
     $smarty->assign("TEMPLATE_CLEAR", SugarThemeRegistry::current()->getImage('id-ff-clear', '', null, null, '.gif', $mod_strings['LBL_ID_FF_CLEAR']));
     $itemAssociation = '';
     $this->bean->load_relationship('xebaytransactions');
     $transactions = $this->bean->xebaytransactions->getBeans();
     $first = true;
     foreach ($transactions as &$transaction) {
         if (!empty($transaction->item_item_id)) {
             if ($first == true) {
                 $first = false;
                 $smarty->assign('ITEM_ID', $transaction->item_item_id);
                 $smarty->assign('SUBJECT', $transaction->name);
                 $itemAssociation .= "<input name='item_assocaition' id='{$transaction->name}' type='radio' value='{$transaction->item_item_id}' checked='checked' onclick=select_item_id(this) />{$transaction->name}<br>";
             } else {
                 $itemAssociation .= "<input name='item_assocaition' id='{$transaction->name}' type='radio' value='{$transaction->item_item_id}' onclick=select_item_id(this) />{$transaction->name}<br>";
             }
         }
     }
     $smarty->assign('ITEM_ASSOCIATION', $itemAssociation);
     $smarty->assign('SALUTATION', str_replace("\n", "<br>", $this->bean->get_salutation()));
     $smarty->assign('SIGNATURE', str_replace("\n", "<br>", $this->bean->get_signature()));
     $smarty->display("modules/xeBayOrders/tpls/send.tpl");
 }
Example #11
0
 function fill_in_additional_detail_fields()
 {
     global $theme;
     global $current_language;
     global $timedate;
     global $app_list_strings;
     $this->uploadfile = $this->filename;
     $mod_strings = return_module_language($current_language, $this->object_name);
     global $img_name;
     global $img_name_bare;
     if (!$this->file_ext) {
         $img_name = SugarThemeRegistry::current()->getImageURL(strtolower($this->file_ext) . "_image_inline.gif");
         $img_name_bare = strtolower($this->file_ext) . "_image_inline";
     }
     //set default file name.
     if (!empty($img_name) && file_exists($img_name)) {
         $img_name = $img_name_bare;
     } else {
         $img_name = "def_image_inline";
         //todo change the default image.
     }
     $this->file_url_noimage = basename(UploadFile::get_url($this->filename, $this->id));
     if (!empty($this->status_id)) {
         $this->status = $app_list_strings['document_status_dom'][$this->status_id];
     }
 }
Example #12
0
    function displayScript()
    {
        global $current_language;
        $mod_strings = return_module_language($current_language, 'Emails');
        $casesImageURL = "\"" . SugarThemeRegistry::current()->getImageURL('Cases.gif') . "\"";
        $leadsImageURL = "\"" . SugarThemeRegistry::current()->getImageURL('Leads.gif') . "\"";
        $contactsImageURL = "\"" . SugarThemeRegistry::current()->getImageURL('Contacts.gif') . "\"";
        $bugsImageURL = "\"" . SugarThemeRegistry::current()->getImageURL('Bugs.gif') . "\"";
        $tasksURL = "\"" . SugarThemeRegistry::current()->getImageURL('Tasks.gif') . "\"";
        $script = <<<EOQ
        <script>
        function quick_create_overlib(id, theme) {
            return overlib('<a style=\\'width: 150px\\' class=\\'menuItem\\' onmouseover=\\'hiliteItem(this,"yes");\\' onmouseout=\\'unhiliteItem(this);\\' href=\\'index.php?module=Cases&action=EditView&inbound_email_id=' + id + '\\'>' +
            "<img border='0' src='" + {$casesImageURL} + "' style='margin-right:5px'>" + '{$mod_strings['LBL_LIST_CASE']}' + '</a>' +
            "<a style='width: 150px' class='menuItem' onmouseover='hiliteItem(this,\\"yes\\");' onmouseout='unhiliteItem(this);' href='index.php?module=Leads&action=EditView&inbound_email_id=" + id + "'>" +
                    "<img border='0' src='" + {$leadsImageURL} + "' style='margin-right:5px'>"
                    + '{$mod_strings['LBL_LIST_LEAD']}' + "</a>" +
             "<a style='width: 150px' class='menuItem' onmouseover='hiliteItem(this,\\"yes\\");' onmouseout='unhiliteItem(this);' href='index.php?module=Contacts&action=EditView&inbound_email_id=" + id + "'>" +
                    "<img border='0' src='" + {$contactsImageURL} + "' style='margin-right:5px'>"
                    + '{$mod_strings['LBL_LIST_CONTACT']}' + "</a>" +
             "<a style='width: 150px' class='menuItem' onmouseover='hiliteItem(this,\\"yes\\");' onmouseout='unhiliteItem(this);' href='index.php?module=Bugs&action=EditView&inbound_email_id=" + id + "'>"+
                    "<img border='0' src='" + {$bugsImageURL} + "' style='margin-right:5px'>"
                    + '{$mod_strings['LBL_LIST_BUG']}' + "</a>" +
             "<a style='width: 150px' class='menuItem' onmouseover='hiliteItem(this,\\"yes\\");' onmouseout='unhiliteItem(this);' href='index.php?module=Tasks&action=EditView&inbound_email_id=" + id + "'>" +
                    "<img border='0' src='" + {$tasksURL} + "' style='margin-right:5px'>"
                   + '{$mod_strings['LBL_LIST_TASK']}' + "</a>"
            , CAPTION, '{$mod_strings['LBL_QUICK_CREATE']}'
            , STICKY, MOUSEOFF, 3000, CLOSETEXT, '<img border=0 src="themes/' + theme + '/images/close_inline.gif">', WIDTH, 150, CLOSETITLE, SUGAR.language.get('app_strings', 'LBL_ADDITIONAL_DETAILS_CLOSE_TITLE'), CLOSECLICK, FGCLASS, 'olOptionsFgClass',
            CGCLASS, 'olOptionsCgClass', BGCLASS, 'olBgClass', TEXTFONTCLASS, 'olFontClass', CAPTIONFONTCLASS, 'olOptionsCapFontClass', CLOSEFONTCLASS, 'olOptionsCloseFontClass');
        }
        </script>
EOQ;
        return $script;
    }
Example #13
0
 function display()
 {
     global $current_user, $app_strings, $mod_strings;
     $admin = is_admin($current_user) || is_admin_for_module($current_user, 'Reports');
     foreach ($this->data['data'] as $i => $rowData) {
         if (isset($this->data['data'][$i]['IS_PUBLISHED'])) {
             $this->data['data'][$i]['IS_PUBLISHED'] = "<input type='checkbox' ";
             if ($rowData['IS_PUBLISHED'] == 'yes') {
                 $this->data['data'][$i]['IS_PUBLISHED'] .= ' checked ';
             }
             if ($admin) {
                 $this->data['data'][$i]['IS_PUBLISHED'] .= " onclick='location.href=\"index.php?module=Reports&action=index&publish=no&publish_report_id={$rowData['ID']}\";'>";
             } else {
                 $this->data['data'][$i]['IS_PUBLISHED'] .= ' disabled=true>';
             }
         }
         if (isset($this->data['data'][$i]['IS_SCHEDULED'])) {
             $this->data['data'][$i]['IS_SCHEDULED'] = "<a href='#' onclick=\"schedulePOPUP('{$rowData['ID']}'); return false\" class='listViewTdToolsS1'>{$rowData['IS_SCHEDULED_IMG']} {$rowData['IS_SCHEDULED']}</a>";
         }
         if (!isset($this->data['data'][$i]['IS_EDIT'])) {
             if ($this->data['data'][$i]['ASSIGNED_USER_ID'] != $current_user->id || !ACLController::checkAccess('Reports', 'edit', $this->data['data'][$i]['ASSIGNED_USER_ID'])) {
                 $this->data['data'][$i]['IS_EDIT'] = "&nbsp;";
             } else {
                 $this->data['data'][$i]['IS_EDIT'] = "<a title=\"{$app_strings['LBL_EDIT_BUTTON']}\" href=\"index.php?action=ReportsWizard&module=Reports&page=report&record={$rowData['ID']}\">" . SugarThemeRegistry::current()->getImage("edit_inline", '', null, null, ".gif", $mod_strings['LBL_EDIT']) . "</a>";
             }
         }
     }
     $this->ss->assign('act', 'ReportsWizard');
     return parent::display();
 }
Example #14
0
 /**
  * display
  *
  */
 function display()
 {
     parent::display();
     global $current_user, $app_strings, $mod_strings;
     if (isset($this->bean->query_id) && !empty($this->bean->query_id)) {
         //CHECK FOR SUB-QUERIES
         $this->bean->check_interlock();
         //OUTPUT THE DATASET
         $data_set = BeanFactory::getBean('CustomQueries', $this->bean->query_id);
         $QueryView = new ReportListView();
         $QueryView->initNewXTemplate('modules/CustomQueries/QueryView.html', $mod_strings);
         $QueryView->setHeaderTitle($this->bean->name);
         //below: make sure to aquire the custom layout headers if available
         $QueryView->export_type = "Ent";
         $QueryView->xTemplateAssign('EDIT_INLINE', SugarThemeRegistry::current()->getImage('edit_inline', 'align="absmiddle" border="0"', null, null, '.gif', $app_strings['LNK_EDIT']));
         $QueryView->xTemplateAssign('LEFTARROW_INLINE', SugarThemeRegistry::current()->getImage('calendar_previous', 'align="absmiddle" border="0"', null, null, '.gif', $mod_strings['LBL_LEFT']));
         $QueryView->xTemplateAssign('RIGHTARROW_INLINE', SugarThemeRegistry::current()->getImage('calendar_next', 'align="absmiddle" border="0"', null, null, '.gif', $mod_strings['LBL_RIGHT']));
         $QueryView->setup($data_set, $this->bean, "main", "CUSTOMQUERY");
         $query_results = $QueryView->processDataSet();
         if ($query_results['result'] == "Error") {
             if (is_admin($current_user)) {
                 echo "<font color=\"red\"><b>" . $query_results['result_msg'] . "" . $app_strings['ERROR_EXAMINE_MSG'] . "</font><BR>" . $query_results['msg'] . "</b>";
             } else {
                 echo "<font color=\"red\"><b>" . $query_results['result_msg'] . "</font></b><BR>";
             }
         }
         //end if there is even a query for the data set
     } else {
         echo "<font color=\"red\"><b>" . $app_strings['NO_QUERY_SELECTED'] . "</font></b><BR>";
     }
 }
 /**
  * @see SugarView::display()
  */
 public function display()
 {
     global $mod_strings, $app_strings, $current_user;
     global $sugar_config;
     $this->ss->assign("MODULE_TITLE", $this->getModuleTitle(false));
     $this->ss->assign("DELETE_INLINE_PNG", SugarThemeRegistry::current()->getImage('delete_inline', 'align="absmiddle" alt="' . $app_strings['LNK_DELETE'] . '" border="0"'));
     $this->ss->assign("PUBLISH_INLINE_PNG", SugarThemeRegistry::current()->getImage('publish_inline', 'align="absmiddle" alt="' . $mod_strings['LBL_PUBLISH'] . '" border="0"'));
     $this->ss->assign("UNPUBLISH_INLINE_PNG", SugarThemeRegistry::current()->getImage('unpublish_inline', 'align="absmiddle" alt="' . $mod_strings['LBL_UNPUBLISH'] . '" border="0"'));
     $this->ss->assign("IMPORT_MODULE", $_REQUEST['import_module']);
     $this->ss->assign("JAVASCRIPT", $this->_getJS());
     $this->ss->assign("CURRENT_STEP", $this->currentStep);
     //BEGIN DRAG DROP WIDGET
     $idc = new ImportDuplicateCheck($this->bean);
     $dupe_indexes = $idc->getDuplicateCheckIndexes();
     $dupe_disabled = array();
     foreach ($dupe_indexes as $dk => $dv) {
         $dupe_disabled[] = array("dupeVal" => $dk, "label" => $dv);
     }
     //set dragdrop value
     $this->ss->assign('enabled_dupes', json_encode(array()));
     $this->ss->assign('disabled_dupes', json_encode($dupe_disabled));
     //END DRAG DROP WIDGET
     $this->ss->assign("RECORDTHRESHOLD", $sugar_config['import_max_records_per_file']);
     $content = $this->ss->fetch('modules/Import/tpls/extdupcheck.tpl');
     $this->ss->assign("CONTENT", $content);
     $this->ss->display('modules/Import/tpls/wizardWrapper.tpl');
 }
Example #16
0
 /**
  * @see SugarBean::fill_in_additional_detail_fields()
  */
 public function fill_in_additional_detail_fields()
 {
     global $app_list_strings;
     global $img_name;
     global $img_name_bare;
     $this->uploadfile = $this->filename;
     // Bug 41453 - Make sure we call the parent method as well
     parent::fill_in_additional_detail_fields();
     if (!$this->file_ext) {
         $img_name = SugarThemeRegistry::current()->getImageURL(strtolower($this->file_ext) . "_image_inline.gif");
         $img_name_bare = strtolower($this->file_ext) . "_image_inline";
     }
     //set default file name.
     if (!empty($img_name) && file_exists($img_name)) {
         $img_name = $img_name_bare;
     } else {
         $img_name = "def_image_inline";
         //todo change the default image.
     }
     $this->file_url_noimage = $this->id;
     // Handle getting the status if the source of the status id field has
     // changed
     if (!empty($this->status_id)) {
         // Default value for the DLL source for this field
         $ddl_source = 'document_status_dom';
         if (isset($this->field_defs['status_id']['options'])) {
             $ddl_source = $this->field_defs['status_id']['options'];
         }
         $this->status = $app_list_strings[$ddl_source][$this->status_id];
     }
 }
 function get_list_view_data()
 {
     $data = parent::get_list_view_data();
     $delete = '';
     $group_owner = false;
     $securitygroup_name = "";
     if (empty($data['SECURITYGROUP_ID'])) {
         $securitygroup_name = "All";
     } else {
         require_once 'modules/SecurityGroups/SecurityGroup.php';
         $securitygroup = new SecurityGroup();
         $securitygroup->retrieve($data['SECURITYGROUP_ID']);
         $securitygroup_name = $securitygroup->name;
         if ($securitygroup->assigned_user_id == $GLOBALS['current_user']->id) {
             $group_owner = true;
         }
     }
     if (is_admin($GLOBALS['current_user']) || $data['CREATED_BY'] == $GLOBALS['current_user']->id || $group_owner) {
         $delete = SugarThemeRegistry::current()->getImage('delete_inline', 'width="12" height="12" border="0" align="absmiddle" style="vertical-align: bottom;" onclick=\'Message.deleteMessage("' . $data['ID'] . '", "{this.id}")\'', null, null, '.gif', '');
     }
     $username = "";
     if (empty($data['CREATED_BY'])) {
         $username = "******";
     } else {
         require_once 'modules/Users/User.php';
         $user = new User();
         $user->retrieve($data['CREATED_BY']);
         $username = $user->user_name;
     }
     $data['NAME'] = $data['DESCRIPTION'];
     $data['NAME'] = '<div class="list view" style="padding:5px;border:none;">' . html_entity_decode($data['NAME']);
     $data['NAME'] .= '<div class="byLineBox" style="padding-top: 2px"><span class="byLineLeft">' . $username . ' [' . $securitygroup_name . ']';
     $data['NAME'] .= '&nbsp;</span><span style="cursor: pointer;" class="byLineRight"> ' . $this->getTimeLapse($data['DATE_ENTERED']) . ' &nbsp;' . $delete . '</span></div>';
     return $data;
 }
Example #18
0
function additionalDetailsContact($fields)
{
    static $mod_strings;
    if (empty($mod_strings)) {
        global $current_language;
        $mod_strings = return_module_language($current_language, 'Contacts');
    }
    $overlib_string = '';
    if (!empty($fields['ID'])) {
        $overlib_string .= '<input type="hidden" value="' . $fields['ID'];
        $overlib_string .= '">';
    }
    $overlib_string .= '<h2><img src="index.php?entryPoint=getImage&themeName=' . SugarThemeRegistry::current()->name . '&imageName=Contacts.gif"/> ' . $mod_strings['LBL_CONTACT'] . '</h2>';
    if (!empty($fields['PRIMARY_ADDRESS_STREET']) || !empty($fields['PRIMARY_ADDRESS_CITY']) || !empty($fields['PRIMARY_ADDRESS_STATE']) || !empty($fields['PRIMARY_ADDRESS_POSTALCODE']) || !empty($fields['PRIMARY_ADDRESS_COUNTRY'])) {
        $overlib_string .= '<b>' . $mod_strings['LBL_PRIMARY_ADDRESS'] . '</b><br>';
    }
    if (!empty($fields['PRIMARY_ADDRESS_STREET'])) {
        $overlib_string .= $fields['PRIMARY_ADDRESS_STREET'] . '<br>';
    }
    if (!empty($fields['PRIMARY_ADDRESS_STREET_2'])) {
        $overlib_string .= $fields['PRIMARY_ADDRESS_STREET_2'] . '<br>';
    }
    if (!empty($fields['PRIMARY_ADDRESS_STREET_3'])) {
        $overlib_string .= $fields['PRIMARY_ADDRESS_STREET_3'] . '<br>';
    }
    if (!empty($fields['PRIMARY_ADDRESS_CITY'])) {
        $overlib_string .= $fields['PRIMARY_ADDRESS_CITY'] . ', ';
    }
    if (!empty($fields['PRIMARY_ADDRESS_STATE'])) {
        $overlib_string .= $fields['PRIMARY_ADDRESS_STATE'] . ' ';
    }
    if (!empty($fields['PRIMARY_ADDRESS_POSTALCODE'])) {
        $overlib_string .= $fields['PRIMARY_ADDRESS_POSTALCODE'] . ' ';
    }
    if (!empty($fields['PRIMARY_ADDRESS_COUNTRY'])) {
        $overlib_string .= $fields['PRIMARY_ADDRESS_COUNTRY'] . '<br>';
    }
    if (strlen($overlib_string) > 0 && !(strrpos($overlib_string, '<br>') == strlen($overlib_string) - 4)) {
        $overlib_string .= '<br>';
    }
    if (!empty($fields['PHONE_MOBILE'])) {
        $overlib_string .= '<b>' . $mod_strings['LBL_MOBILE_PHONE'] . '</b> <span class="phone">' . $fields['PHONE_MOBILE'] . '</span><br>';
    }
    if (!empty($fields['PHONE_HOME'])) {
        $overlib_string .= '<b>' . $mod_strings['LBL_HOME_PHONE'] . '</b> <span class="phone">' . $fields['PHONE_HOME'] . '</span><br>';
    }
    if (!empty($fields['PHONE_OTHER'])) {
        $overlib_string .= '<b>' . $mod_strings['LBL_OTHER_PHONE'] . '</b> <span class="phone">' . $fields['PHONE_OTHER'] . '</span><br>';
    }
    if (!empty($fields['DATE_MODIFIED'])) {
        $overlib_string .= '<b>' . $mod_strings['LBL_DATE_MODIFIED'] . '</b> ' . $fields['DATE_MODIFIED'] . '<br>';
    }
    if (!empty($fields['DESCRIPTION'])) {
        $overlib_string .= '<b>' . $mod_strings['LBL_DESCRIPTION'] . '</b> ' . substr($fields['DESCRIPTION'], 0, 300);
        if (strlen($fields['DESCRIPTION']) > 300) {
            $overlib_string .= '...';
        }
    }
    return array('fieldToAddTo' => 'NAME', 'string' => $overlib_string, 'editLink' => "index.php?action=EditView&module=Contacts&return_module=Contacts&record={$fields['ID']}", 'viewLink' => "index.php?action=DetailView&module=Contacts&return_module=Contacts&record={$fields['ID']}");
}
 function display()
 {
     $this->parser = ParserFactory::getParser(MB_PORTAL . strtolower($this->editLayout), $this->editModule, null, null, MB_PORTAL);
     $smarty = new Sugar_Smarty();
     //Add in the module we are viewing to our current mod strings
     global $mod_strings, $current_language;
     $editModStrings = return_module_language($current_language, $this->editModule);
     $mod_strings = sugarArrayMerge($editModStrings, $mod_strings);
     $smarty->assign('mod', $mod_strings);
     $smarty->assign('MOD', $mod_strings);
     // assign buttons
     $images = array('icon_save' => 'studio_save', 'icon_publish' => 'studio_publish', 'icon_address' => 'icon_Address', 'icon_emailaddress' => 'icon_EmailAddress', 'icon_phone' => 'icon_Phone');
     foreach ($images as $image => $file) {
         $smarty->assign($image, SugarThemeRegistry::current()->getImage($file, '', null, null, '.gif', $file));
     }
     $smarty->assign('icon_delete', SugarThemeRegistry::current()->getImage('icon_Delete', '', 48, 48, '.gif', $mod_strings['LBL_MB_DELETE']));
     $buttons = array();
     $buttons[] = array('id' => 'saveBtn', 'image' => SugarThemeRegistry::current()->getImage($images['icon_save'], '', null, null, '.gif', $mod_strings['LBL_BTN_SAVE']), 'text' => $GLOBALS['mod_strings']['LBL_BTN_SAVE'], 'actionScript' => "onclick='if(Studio2.checkCalcFields(\"{$_REQUEST['view']}\", \"ERROR_CALCULATED_PORTAL_FIELDS\"))Studio2.handleSave();'");
     $buttons[] = array('id' => 'publishBtn', 'image' => SugarThemeRegistry::current()->getImage($images['icon_publish'], '', null, null, '.gif', $mod_strings['LBL_BTN_PUBLISH']), 'text' => $GLOBALS['mod_strings']['LBL_BTN_SAVEPUBLISH'], 'actionScript' => "onclick='if(Studio2.checkCalcFields(\"{$_REQUEST['view']}\", \"ERROR_CALCULATED_PORTAL_FIELDS\"))Studio2.handlePublish();'");
     $html = "";
     foreach ($buttons as $button) {
         if ($button['id'] == "spacer") {
             $html .= "<td style='width:{$button['width']}'> </td>";
         } else {
             $html .= "<td><input id='{$button['id']}' type='button' valign='center' class='button' style='cursor:pointer' " . "onmousedown='this.className=\"buttonOn\";return false;' onmouseup='this.className=\"button\"' " . "onmouseout='this.className=\"button\"' {$button['actionScript']} value = '{$button['text']}' ></td>";
         }
     }
     $smarty->assign('buttons', $html);
     // assign fields and layout
     $smarty->assign('available_fields', $this->parser->getAvailableFields());
     $smarty->assign('field_defs', $this->parser->getFieldDefs());
     $smarty->assign('layout', $this->parser->getLayout());
     $smarty->assign('view_module', $this->editModule);
     $smarty->assign('calc_field_list', json_encode($this->parser->getCalculatedFields()));
     $smarty->assign('view', $this->editLayout);
     $smarty->assign('maxColumns', $this->parser->getMaxColumns());
     $smarty->assign('fieldwidth', '150px');
     $smarty->assign('translate', true);
     $smarty->assign('fromPortal', true);
     // flag for form submittal - when the layout is submitted the actions are the same for layouts and portal layouts, but the parsers must be different...
     if (!empty($this->parser->usingWorkingFile)) {
         $smarty->assign('layouttitle', $GLOBALS['mod_strings']['LBL_LAYOUT_PREVIEW']);
     } else {
         $smarty->assign('layouttitle', $GLOBALS['mod_strings']['LBL_CURRENT_LAYOUT']);
     }
     $ajax = new AjaxCompose();
     $ajax->addCrumb(translate('LBL_SUGARPORTAL', 'ModuleBuilder'), 'ModuleBuilder.main("sugarportal")');
     $ajax->addCrumb(translate('LBL_LAYOUTS', 'ModuleBuilder'), 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard&portal=1&layout=1")');
     $ajax->addCrumb(ucwords(translate('LBL_MODULE_NAME', $this->editModule)), 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard&portal=1&view_module=' . $this->editModule . '")');
     $ajax->addCrumb(ucwords($this->editLayout), '');
     // set up language files
     $smarty->assign('language', $this->parser->getLanguage());
     // for sugar_translate in the smarty template
     //navjeet- assistant logic has changed
     //include('modules/ModuleBuilder/language/en_us.lang.php');
     //$smarty->assign('assistantBody', $mod_strings['assistantHelp']['module']['editView'] );
     $ajax->addSection('center', $GLOBALS['mod_strings']['LBL_EDIT_LAYOUT'], $smarty->fetch('modules/ModuleBuilder/tpls/layoutView.tpl'));
     echo $ajax->getJavascript();
 }
 /**
  * generates the additional details span to be retrieved via ajax
  *
  * @param GUID id id of the record
  * @return array string to attach to field
  */
 function getAdditionalDetailsAjax($id)
 {
     global $app_strings;
     $jscalendarImage = SugarThemeRegistry::current()->getImageURL('info_inline.gif');
     $jsdetailviewImage = SugarThemeRegistry::current()->getImageURL('detailview.gif');
     $extra = "<span id='aadspan_" . $id . "' " . "onclick=\"location.href='index.php?module=AM_ProjectTemplates&action=DetailView&record=" . $id . "'\" " . " style='position: relative;'><!--not_in_theme!--><img vertical-align='middle' class='info' border='0' alt='" . $app_strings['LBL_ADDITIONAL_DETAILS'] . "' src='{$jsdetailviewImage}'></span>";
     //return array('fieldToAddTo' => $this->additionalDetailsFieldToAdd, 'string' => $extra);
 }
Example #21
0
function additionalDetailsMeeting($fields)
{
    global $timedate;
    static $mod_strings;
    if (empty($mod_strings)) {
        global $current_language;
        $mod_strings = return_module_language($current_language, 'Meetings');
    }
    //    ini_set('display_errors', true);
    //    print_r($fields);
    $overlib_string = '';
    $overlib_string .= '<input id="type" type="hidden" value="Meeting"/>';
    if (!empty($fields['ID'])) {
        $overlib_string .= '<input id="id" type="hidden" value="' . $fields['ID'];
        $overlib_string .= '"/>';
    }
    $overlib_string .= '<h2><img src="index.php?entryPoint=getImage&themeName=' . SugarThemeRegistry::current()->name . '&imageName=Meetings.gif"/> ' . $mod_strings['LBL_MEETING'] . '</h2>';
    if (!empty($fields['NAME'])) {
        $overlib_string .= '<b>' . $mod_strings['LBL_SUBJECT'] . '</b> <a href="index.php?action=DetailView&module=Meetings&record=' . $fields['ID'] . '">' . $fields['NAME'] . '</a>';
        $overlib_string .= '<br>';
    }
    if (!empty($fields['DATE_START'])) {
        // Make it easy to select for sorting in schedule bar
        $data_date = $timedate->fromUser($fields['DATE_START'])->format('Y-m-d H:i:s');
        $overlib_string .= '<span data-field="DATE_START" data-date="' . $data_date . '">';
        $overlib_string .= '<b>' . $mod_strings['LBL_DATE_TIME'] . '</b> ' . $fields['DATE_START'] . ' <br>';
        $overlib_string .= '</span>';
    }
    if (isset($fields['DURATION_HOURS']) || isset($fields['DURATION_MINUTES'])) {
        $overlib_string .= '<b>' . $mod_strings['LBL_DURATION'] . '</b> ';
        if (isset($fields['DURATION_HOURS'])) {
            $overlib_string .= $fields['DURATION_HOURS'] . $mod_strings['LBL_HOURS_ABBREV'] . ' ';
        }
        if (isset($fields['DURATION_MINUTES'])) {
            $overlib_string .= $fields['DURATION_MINUTES'] . $mod_strings['LBL_MINSS_ABBREV'];
        }
        $overlib_string .= '<br>';
    }
    if (!empty($fields['PARENT_ID'])) {
        $overlib_string .= "<b>" . $mod_strings['LBL_RELATED_TO'] . "</b> " . "<a href='index.php?module=" . $fields['PARENT_TYPE'] . "&action=DetailView&record=" . $fields['PARENT_ID'] . "'>" . $fields['PARENT_TYPE'] . ' - ' . $fields['PARENT_NAME'] . "</a>";
        $overlib_string .= '<br>';
    }
    if (!empty($fields['STATUS'])) {
        $overlib_string .= '<b>' . $mod_strings['LBL_STATUS'] . '</b> ' . $fields['STATUS'];
        $overlib_string .= '<br>';
    }
    if (!empty($fields['DESCRIPTION'])) {
        $overlib_string .= '<b>' . $mod_strings['LBL_DESCRIPTION'] . '</b> ' . substr($fields['DESCRIPTION'], 0, 300);
        if (strlen($fields['DESCRIPTION']) > 300) {
            $overlib_string .= '...';
        }
        $overlib_string .= '<br>';
    }
    $overlib_string .= '<br>';
    $editLink = "index.php?action=EditView&module=Meetings&record={$fields['ID']}";
    $viewLink = "index.php?action=DetailView&module=Meetings&record={$fields['ID']}";
    return array('fieldToAddTo' => 'NAME', 'string' => $overlib_string, 'editLink' => $editLink, 'viewLink' => $viewLink);
}
Example #22
0
function additionalDetailsLead($fields)
{
    static $mod_strings;
    if (empty($mod_strings)) {
        global $current_language;
        $mod_strings = return_module_language($current_language, 'Leads');
    }
    $overlib_string = '';
    if (!empty($fields['ID'])) {
        $overlib_string .= '<input type="hidden" value="' . $fields['ID'];
        $overlib_string .= '">';
    }
    $overlib_string .= '<h2><img src="index.php?entryPoint=getImage&themeName=' . SugarThemeRegistry::current()->name . '&imageName=Leads.gif"/> ' . $mod_strings['LBL_CONTACT'] . '</h2>';
    if (!empty($fields['PRIMARY_ADDRESS_STREET']) || !empty($fields['PRIMARY_ADDRESS_CITY']) || !empty($fields['PRIMARY_ADDRESS_STATE']) || !empty($fields['PRIMARY_ADDRESS_POSTALCODE']) || !empty($fields['PRIMARY_ADDRESS_COUNTRY'])) {
        $overlib_string .= '<b>' . $mod_strings['LBL_PRIMARY_ADDRESS'] . '</b><br>';
    }
    if (!empty($fields['PRIMARY_ADDRESS_STREET'])) {
        $overlib_string .= $fields['PRIMARY_ADDRESS_STREET'] . '<br>';
    }
    if (!empty($fields['PRIMARY_ADDRESS_CITY'])) {
        $overlib_string .= $fields['PRIMARY_ADDRESS_CITY'] . ', ';
    }
    if (!empty($fields['PRIMARY_ADDRESS_STATE'])) {
        $overlib_string .= $fields['PRIMARY_ADDRESS_STATE'] . ' ';
    }
    if (!empty($fields['PRIMARY_ADDRESS_POSTALCODE'])) {
        $overlib_string .= $fields['PRIMARY_ADDRESS_POSTALCODE'] . ' ';
    }
    if (!empty($fields['PRIMARY_ADDRESS_COUNTRY'])) {
        $overlib_string .= $fields['PRIMARY_ADDRESS_COUNTRY'] . '<br>';
    }
    if (strlen($overlib_string) > 0 && !(strrpos($overlib_string, '<br>') == strlen($overlib_string) - 4)) {
        $overlib_string .= '<br>';
    }
    if (!empty($fields['PHONE_MOBILE'])) {
        $overlib_string .= '<b>' . $mod_strings['LBL_MOBILE_PHONE'] . '</b> <span class="phone">' . $fields['PHONE_MOBILE'] . '</span><br>';
    }
    if (!empty($fields['PHONE_HOME'])) {
        $overlib_string .= '<b>' . $mod_strings['LBL_HOME_PHONE'] . '</b> <span class="phone">' . $fields['PHONE_HOME'] . '</span><br>';
    }
    if (!empty($fields['PHONE_OTHER'])) {
        $overlib_string .= '<b>' . $mod_strings['LBL_OTHER_PHONE'] . '</b> <span class="phone">' . $fields['PHONE_OTHER'] . '</span><br>';
    }
    if (!empty($fields['LEAD_SOURCE'])) {
        $overlib_string .= '<b>' . $mod_strings['LBL_LEAD_SOURCE'] . '</b> ' . $fields['LEAD_SOURCE'] . '<br>';
    }
    if (!empty($fields['EMAIL2'])) {
        $overlib_string .= '<b>' . $mod_strings['LBL_OTHER_EMAIL_ADDRESS'] . '</b> ' . "<a href=index.php?module=Emails&action=Compose&contact_id={$fields['ID']}&" . "parent_type=Contacts&parent_id={$fields['ID']}&to_addrs_ids={$fields['ID']}&to_addrs_names" . "={$fields['FIRST_NAME']}&nbsp;{$fields['LAST_NAME']}&to_addrs_emails={$fields['EMAIL2']}&" . "to_email_addrs=" . urlencode("{$fields['FIRST_NAME']} {$fields['LAST_NAME']} <{$fields['EMAIL2']}>") . "&return_module=Contacts&return_action=ListView'>{$fields['EMAIL2']}</a><br>";
    }
    if (!empty($fields['DESCRIPTION'])) {
        $overlib_string .= '<b>' . $mod_strings['LBL_DESCRIPTION'] . '</b> ' . substr($fields['DESCRIPTION'], 0, 300);
        if (strlen($fields['DESCRIPTION']) > 300) {
            $overlib_string .= '...';
        }
    }
    return array('fieldToAddTo' => 'NAME', 'string' => $overlib_string, 'editLink' => "index.php?action=EditView&module=Leads&return_module=Leads&record={$fields['ID']}", 'viewLink' => "index.php?action=DetailView&module=Leads&return_module=Leads&record={$fields['ID']}");
}
Example #23
0
 /**
  * Return the "breadcrumbs" to display at the top of the page
  *
  * @param  bool $show_help optional, true if we show the help links
  * @return HTML string containing breadcrumb title
  */
 public function getModuleTitle($show_help = true)
 {
     global $app_list_strings, $mod_strings;
     $warningText = string_format($mod_strings['LBL_LIST_WARNING'], array($app_list_strings['moduleList']['Forecasts'], $app_list_strings['moduleList'][$this->module]));
     $float = SugarThemeRegistry::current()->directionality == 'rtl' ? 'right' : 'left';
     $title = '<div><div class="moduleTitle"><h2>' . $app_list_strings['moduleList'][$this->module] . '</h2></div>';
     $title .= "<div class='overdueTask' style='float:{$float}; padding-bottom:10px;'>{$warningText}</div></div>";
     return $title;
 }
Example #24
0
 /**
  * Assign several arrow image attributes to TemplateHandler smarty. Such as width, height, etc.
  *
  * @return void
  */
 function processArrowVars()
 {
     $pathParts = pathinfo(SugarThemeRegistry::current()->getImageURL('arrow.gif', false));
     list($width, $height) = getimagesize($pathParts['dirname'] . '/' . $pathParts['basename']);
     $this->th->ss->assign('arrowExt', $pathParts['extension']);
     $this->th->ss->assign('arrowWidth', $width);
     $this->th->ss->assign('arrowHeight', $height);
     $this->th->ss->assign('arrowAlt', translate('LBL_SORT'));
 }
Example #25
0
 /**
  * @see SugarView::display()
  */
 public function display()
 {
     global $app_strings;
     $sp = new SugarPlugins();
     $plugins = $sp->getPluginList();
     $pluginsCat = array("Outlook" => array("name" => $app_strings['LBL_PLUGIN_OUTLOOK_NAME'], "desc" => $app_strings['LBL_PLUGIN_OUTLOOK_DESC']), "Word" => array("name" => $app_strings['LBL_PLUGIN_WORD_NAME'], "desc" => $app_strings['LBL_PLUGIN_WORD_DESC']), "Excel" => array("name" => $app_strings['LBL_PLUGIN_EXCEL_NAME'], "desc" => $app_strings['LBL_PLUGIN_EXCEL_DESC']));
     $str = '<table cellpadding="0" cellspacing="0" class="detail view">';
     $str .= "<tr><th colspan='2'>";
     $str .= "<h4>{$app_strings['LBL_PLUGINS_TITLE']}</h4>";
     $str .= "</th><tr>";
     $str .= "<tr><td colspan='2' style='padding-left: 10px;'>{$app_strings['LBL_PLUGINS_DESC']}</td></tr>";
     foreach ($pluginsCat as $key => $value) {
         $pluginImage = SugarThemeRegistry::current()->getImageURL("plug-in_{$key}.gif");
         $pluginContents = '';
         foreach ($plugins as $plugin) {
             $raw_name = urlencode($plugin['raw_name']);
             $display_name = str_replace('_', ' ', $plugin['formatted_name']);
             if (strpos($display_name, $key) !== false) {
                 $pluginContents .= "<li><a href='index.php?module=Home&action=DownloadPlugin&plugin={$raw_name}'>{$display_name}</a></li>";
             }
         }
         //If we have pluginContents value, combine together
         if (!empty($pluginContents)) {
             $str .= "<tr><td valign='top' width='80' style='padding-right: 10px; padding-left: 10px;'><img src='{$pluginImage}' alt='{$pluginImage}'></td>";
             $str .= "<td><b>{$value['name']}</b><br>";
             $str .= $value['desc'];
             $str .= '<ul id="pluginList">';
             $str .= $pluginContents;
             $str .= '</ul></td></tr>';
         }
     }
     $str .= "</table>";
     $pluginsCat = array("Lotus" => array("name" => $app_strings['LBL_PLUGIN_LOTUS_NAME'], "desc" => $app_strings['LBL_PLUGIN_LOTUS_DESC']));
     $str .= '<table cellpadding="0" cellspacing="0" class="detail view">';
     $str .= "<tr><th colspan='2'>";
     $str .= "<h4>{$app_strings['LBL_PLUGINS_LOTUS_TITLE']}</h4>";
     $str .= "</th><tr>";
     $str .= "<tr><td colspan='2' style='padding-left: 10px;'>{$app_strings['LBL_PLUGINS_DESC']}</td></tr>";
     foreach ($pluginsCat as $key => $value) {
         $pluginImage = SugarThemeRegistry::current()->getImageURL("plug-in_{$key}.png");
         $str .= "<tr><td valign='top' width='80' style='padding-right: 10px; padding-left: 10px;'><img src='{$pluginImage}'></td>";
         $str .= "<td><b>{$value['name']}</b><br>";
         $str .= $value['desc'];
         $str .= '<ul id="pluginList">';
         foreach ($plugins as $plugin) {
             $raw_name = urlencode($plugin['raw_name']);
             $display_name = str_replace('_', ' ', $plugin['formatted_name']);
             if (strpos($display_name, $key) !== false) {
                 $str .= "<li><a href='index.php?module=Home&action=DownloadPlugin&plugin={$raw_name}'>{$display_name}</a></li>";
             }
         }
         $str .= '</ul></td></tr>';
     }
     $str .= "</table>";
     echo $str;
 }
Example #26
0
    /**
     * Returns the Javascript necessary to initialize a TinyMCE instance for a given <textarea> or <div>
     * @param string target Comma delimited list of DOM ID's, <textarea id='someTarget'>
     * @return string
     */
    function getInstance($targets = "", $type = 'default')
    {
        global $json;
        if (empty($json)) {
            $json = getJSONobj();
        }
        $config = $this->defaultConfig;
        //include tinymce lang file
        $lang = substr($GLOBALS['current_language'], 0, 2);
        if (file_exists('include/javascript/tiny_mce/langs/' . $lang . '.js')) {
            $config['language'] = $lang;
        }
        $config['directionality'] = SugarThemeRegistry::current()->directionality;
        $config['elements'] = $targets;
        $config['theme_advanced_buttons1'] = $this->buttonConfigs[$type]['buttonConfig'];
        $config['theme_advanced_buttons2'] = $this->buttonConfigs[$type]['buttonConfig2'];
        $config['theme_advanced_buttons3'] = $this->buttonConfigs[$type]['buttonConfig3'];
        $jsConfig = $json->encode($config);
        $instantiateCall = '';
        if (!empty($targets)) {
            $exTargets = explode(",", $targets);
            foreach ($exTargets as $instance) {
                $instantiateCall .= "tinyMCE.execCommand('mceAddControl', false, document.getElementById('{$instance}'));\n";
            }
        }
        $path = getJSPath('include/javascript/tiny_mce/tiny_mce.js');
        $ret = <<<eoq
<script type="text/javascript" language="Javascript" src="{$path}"></script>

<script type="text/javascript" language="Javascript">
<!--
\$( document ).ready(function() {
    if (!SUGAR.util.isTouchScreen()) {
        if(tinyMCE.editors.length == 0 ){
            tinyMCE.init({$jsConfig});
        }else{
           {$instantiateCall}
        }      
    } else {
eoq;
        $exTargets = explode(",", $targets);
        foreach ($exTargets as $instance) {
            $ret .= <<<eoq
    document.getElementById('{$instance}').style.width = '100%';
    document.getElementById('{$instance}').style.height = '100px';
eoq;
        }
        $ret .= <<<eoq
    }
});
-->
</script>

eoq;
        return $ret;
    }
Example #27
0
 function get_list_view_data()
 {
     global $mod_strings;
     $id = $this->id;
     $sync_icon = "<img alt='' border='0' src='" . SugarThemeRegistry::current()->getImageURL('Inventory_in.png') . "'>";
     $sync = "<a href='index.php?module=xeBayUsers&action=sync&xebayuser_id={$id}&return_module=xeBayUsers&return_action=index' title='{$mod_strings['LBL_SYNC']}'>{$sync_icon}</a>";
     $field_list = $this->get_list_view_array();
     $field_list['SYNC_USER_DATA'] = $sync;
     return $field_list;
 }
 function displayList(&$layout_def)
 {
     die("<pre>" . print_r($layout_def, true) . "</pre>");
     $rel = $layout_def['linked_field'];
     $module = $layout_def['module'];
     global $app_strings;
     $edit_icon_html = SugarThemeRegistry::current()->getImage('edit_inline', 'align="absmiddle" alt="' . $app_strings['LNK_EDIT'] . '" border="0"');
     $script = "\n        function editRel(name, id, module) {\n            editRelPanel = new YAHOO.SUGAR.AsyncPanel('rel_edit', {\n                width: 500,\n                draggable: true,\n                close: true,\n                constraintoviewport: true,\n                fixedcenter: false\n            });\n            var a = editRelPanel;\n\t\t\ta.setHeader( 'Edit Properties' );\n\t\t\ta.render(document.body);\n\t\t\ta.params = {\n                module: 'Relationships',\n                action: 'editfields',\n                rel_module: module,\n                id: id,\n                rel: name,\n                to_pdf: 1\n            };\n            a.load('index.php?' + SUGAR.util.paramsToUrl(a.params));\n            a.show();\n            a.center();\n\t\t}";
     return "<script>{$script}</script>" . '<div onclick="editRel(\'p1_b1_accounts\', \'cac203f3-0380-495f-3231-4cf58f089f00\', \'Accounts\')">' . $edit_icon_html . "</div>";
 }
 function displayList(&$layout_def)
 {
     global $app_strings;
     $edit_icon_html = SugarThemeRegistry::current()->getImage('edit_inline', 'align="absmiddle" alt="' . $app_strings['LNK_EDIT'] . '" border="0"');
     if ($layout_def['EditView']) {
         return "<a href='#' onMouseOver=\"javascript:subp_nav('" . $layout_def['module'] . "', '" . $layout_def['fields']['ID'] . "', 'e', this);\"" . " onFocus=\"javascript:subp_nav('" . $layout_def['module'] . "', '" . $layout_def['fields']['ID'] . "', 'e', this);\"" . ' class="listViewTdToolsS1">' . $edit_icon_html . '&nbsp;' . $app_strings['LNK_EDIT'] . '</a>&nbsp;';
     } else {
         return '';
     }
 }
 public function display()
 {
     $tracker = new Tracker();
     $history = $tracker->get_recently_viewed($GLOBALS['current_user']->id, array('Emails', 'EmailTemplates'));
     foreach ($history as $key => $row) {
         $history[$key]['item_summary_short'] = getTrackerSubstring($row['item_summary']);
         $history[$key]['image'] = SugarThemeRegistry::current()->getImage($row['module_name'], 'border="0" align="absmiddle" alt="' . $row['item_summary'] . '"');
     }
     $this->ss->assign('LAST_VIEWED', $history);
     $this->ss->display('include/MVC/View/tpls/modulelistmenu.tpl');
 }