Example #1
1
 function browse()
 {
     $smarty = new Sugar_Smarty();
     global $mod_strings;
     $smarty->assign('mod_strings', $mod_strings);
     $smarty->assign('view_module', $this->module);
     $smarty->assign('view', $this->layout);
     if (!empty($_REQUEST['subpanel'])) {
         $smarty->assign('subpanel', $_REQUEST['subpanel']);
     }
     $stamps = array();
     global $timedate;
     $userFormat = $timedate->get_date_time_format();
     $page = !empty($_REQUEST['page']) ? $_REQUEST['page'] : 0;
     $count = $this->history->getCount();
     $ts = $this->history->getNth($page * $this->pageSize);
     $snapshots = array();
     for ($i = 0; $i <= $this->pageSize && $ts > 0; $i++) {
         $dbDate = $timedate->fromTimestamp($ts)->asDb();
         $displayTS = $timedate->to_display_date_time($dbDate);
         if ($page * $this->pageSize + $i + 1 == $count) {
             $displayTS = translate("LBL_MB_DEFAULT_LAYOUT");
         }
         $snapshots[$ts] = $displayTS;
         $ts = $this->history->getNext();
     }
     if (count($snapshots) > $this->pageSize) {
         $smarty->assign('nextPage', true);
     }
     $snapshots = array_slice($snapshots, 0, $this->pageSize, true);
     $smarty->assign('currentPage', $page);
     $smarty->assign('snapshots', $snapshots);
     $html = $smarty->fetch('modules/ModuleBuilder/tpls/history.tpl');
     echo $html;
 }
Example #2
1
 /**
  * @see SugarView::display()
  */
 public function display()
 {
     $ss = new Sugar_Smarty();
     $ss->assign("MOD", $GLOBALS['mod_strings']);
     $ss->assign("MESSAGE", $GLOBALS['message']);
     echo $ss->fetch("modules/xeBaySellerLists/tpls/importfinal.tpl");
 }
function getImageHtml($focus, $name, $value, $view)
{
    if ('EditView' != $view && 'DetailView' != $view) {
        return "";
        // skip the rest of the method if another view calls this method
    }
    global $app_list_strings;
    $languageStrings = $app_list_strings["oqc"]["Services"];
    require_once 'include/Sugar_Smarty.php';
    //1.7.6 Workaround for image display without modifying htaccess file
    require_once 'include/oqc/common/Configuration.php';
    if (isset($focus->image_unique_filename)) {
        global $sugar_config;
        $conf = Configuration::getInstance();
        $oqc_uploadDir = $conf->get('fileUploadDir');
        $uploadDir = $oqc_uploadDir ? $oqc_uploadDir : $sugar_config['upload_dir'];
        if (file_exists($uploadDir . "th" . $focus->image_unique_filename)) {
            $imageurl = "oqc/GetImage.php?module=oqc_Product&id=th" . $focus->image_unique_filename;
        } else {
            $imageurl = "oqc/GetImage.php?module=oqc_Product&id=" . $focus->image_unique_filename;
        }
    } else {
        $imageurl = '';
    }
    $smarty = new Sugar_Smarty();
    $smarty->assign('image_url', $imageurl);
    $smarty->assign('languageStrings', $languageStrings);
    return $smarty->fetch('include/oqc/Products/Image.' . $view . '.html');
}
Example #4
1
 function display()
 {
     $db = DBManagerFactory::getInstance();
     /* <<<<<<< HEAD
     		$sql = "SELECT p.id,p.first_name,p.last_name,p.dob FROM reg_patient p WHERE p.id not in (SELECT distinct pe.reg_patient_reg_encounterreg_patient_ida FROM `reg_patient_reg_encounter_c` pe, reg_encounter_cstm e WHERE pe.reg_patient_reg_encounterreg_encounter_idb=e.id_c AND e.next_pmp_review_due_c is not null) ORDER By p.last_name, p.first_name";
     ======= */
     $sql = "SELECT p.id,p.first_name,p.last_name,p.dob, rec.mrn_c AS mrn,(SELECT p1b.name provname FROM reg_provider p1b,reg_provider_reg_patient_c p2b WHERE p2b.reg_provider_reg_patientreg_provider_ida = p1b.id AND p2b.reg_provider_reg_patientreg_patient_idb = p.id AND p2b.deleted =0)provname FROM reg_patient p LEFT JOIN reg_patient_cstm rec ON rec.id_c = p.id WHERE p.id not in (SELECT distinct pe.reg_patient_reg_encounterreg_patient_ida FROM `reg_patient_reg_encounter_c` pe, reg_encounter_cstm e WHERE pe.reg_patient_reg_encounterreg_encounter_idb=e.id_c AND e.last_pmp_review_done_c is not null) ORDER By p.last_name, p.first_name";
     // >>>>>>> 3097a71433de82fec730df252659026274347e46
     $resultb = $db->query($sql, true);
     $final = array();
     while ($row = $db->fetchByAssoc($resultb)) {
         $final[] = $row;
     }
     $sql1 = "SELECT p.id, rec.mrn_c AS mrn,(SELECT p1b.name provname FROM reg_provider p1b,reg_provider_reg_patient_c p2b WHERE p2b.reg_provider_reg_patientreg_provider_ida = p1b.id AND p2b.reg_provider_reg_patientreg_patient_idb = p.id AND p2b.deleted =0)provname FROM reg_patient p LEFT JOIN reg_patient_cstm rec ON rec.id_c = p.id WHERE p.id not in (SELECT distinct pe.reg_patient_reg_encounterreg_patient_ida FROM `reg_patient_reg_encounter_c` pe, reg_encounter_cstm e WHERE pe.reg_patient_reg_encounterreg_encounter_idb=e.id_c AND e.last_pmp_review_done_c is not null) GROUP BY provname ORDER By p.last_name, p.first_name";
     $resultb1 = $db->query($sql1, true);
     $final1 = array();
     while ($row1 = $db->fetchByAssoc($resultb1)) {
         $final1[] = $row1;
     }
     $sugarSmarty = new Sugar_Smarty();
     $sugarSmarty->assign("data", $final);
     $sugarSmarty->assign("data1", $final1);
     $sugarSmarty->assign("title", "Patients who do not have PMP");
     $sugarSmarty->display('custom/modules/REG_Patient/tpls/Report1REG_Patient.tpl');
     //        parent::display();
 }
function getAdditionsHtml($focus, $name, $value, $view)
{
    if ('EditView' != $view && 'DetailView' != $view) {
        return "";
        // skip the rest of the method if another view calls this method
    }
    global $mod_strings;
    global $app_list_strings;
    //2.2RC2 translation eroor fix
    $status_list = $app_list_strings["oqc_addition_status_dom"];
    $additions = $focus->getAdditions();
    foreach ($additions as &$addition) {
        $addition = $addition->toArray();
        if (isset($status_list[$addition['status']])) {
            $addition['status'] = $status_list[$addition['status']];
        }
    }
    global $sugar_version;
    $smarty = new Sugar_Smarty();
    $smarty->assign('additions', $additions);
    $smarty->assign($mod_strings);
    if (substr($sugar_version, 0, 1) == '6') {
        return $smarty->fetch('include/oqc/Additions/' . $view . '.html');
    } else {
        return $smarty->fetch('include/oqc/Additions/' . $view . '52.html');
    }
}
 function display()
 {
     $ss = new Sugar_Smarty();
     $ss->assign('lbl_campaign_name', translate('LBL_TOP_CAMPAIGNS_NAME', 'Campaigns'));
     $ss->assign('lbl_revenue', translate('LBL_TOP_CAMPAIGNS_REVENUE', 'Campaigns'));
     $ss->assign('top_campaigns', $this->top_campaigns);
     return parent::display() . $ss->fetch('modules/Campaigns/Dashlets/TopCampaignsDashlet/TopCampaignsDashlet.tpl');
 }
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");
}
Example #8
0
    /**
     * @see SugarView::display()
     */
    public function display()
    {
        $ss = new Sugar_Smarty();
        $ss->assign("MOD", $GLOBALS['mod_strings']);
        $ss->assign("INSTRUCTION", "<h1>Retrieve seller list from ebay</h1>");
        $bean = BeanFactory::getBean('xeBayAccounts');
        $resp = $bean->get_list("", "ebay_auth_token<>''", 0, -1, -1, 0, false, array('name'));
        if ($resp['row_count'] > 0) {
            $ebay_account_options = "<select name='ebay_account_name' id='ebay_account_name' title=''>";
            if ($resp['row_count'] > 1) {
                $ebay_account_options .= "<option value='All'>All</option>";
            }
            foreach ($resp['list'] as &$account) {
                $name = $account->name;
                $ebay_account_options .= "<option value='{$name}'>{$name}</option>";
            }
            $ebay_account_options .= "</select>";
            $ss->assign("EBAY_ACCOUNT_OPTIONS", $ebay_account_options);
        }
        $javascript = <<<EOQ
function ImportConfirm()
{
\t\treturn confirm("Do you want to retrieve seller list now ?");
}
EOQ;
        $ss->assign("JAVASCRIPT", $javascript);
        echo $ss->fetch("modules/xeBaySellerLists/tpls/import.tpl");
    }
Example #9
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 #10
0
 function display()
 {
     global $mod_strings;
     $smarty = new Sugar_Smarty();
     $mb = new ModuleBuilder();
     //if (!empty($_REQUEST['package'])) {
     if (empty($_REQUEST['package']) && empty($_REQUEST['new'])) {
         $this->generatePackageButtons($mb->getPackageList());
         $smarty->assign('buttons', $this->buttons);
         $smarty->assign('title', $GLOBALS['mod_strings']['LBL_MODULEBUILDER']);
         $smarty->assign("question", $GLOBALS['mod_strings']['LBL_QUESTION_PACKAGE']);
         $smarty->assign("defaultHelp", "mbHelp");
         $ajax = new AjaxCompose();
         $ajax->addCrumb($GLOBALS['mod_strings']['LBL_MODULEBUILDER'], 'ModuleBuilder.getContent("module=ModuleBuilder&action=package")');
         $ajax->addCrumb($GLOBALS['mod_strings']['LBL_PACKAGE_LIST'], '');
         $ajax->addSection('center', $GLOBALS['mod_strings']['LBL_PACKAGE_LIST'], $smarty->fetch('modules/ModuleBuilder/tpls/wizard.tpl'));
         echo $ajax->getJavascript();
     } else {
         $name = !empty($_REQUEST['package']) ? $_REQUEST['package'] : '';
         $mb->getPackage($name);
         require_once 'modules/ModuleBuilder/MB/MBPackageTree.php';
         $mbt = new MBPackageTree();
         $nodes = $mbt->fetchNodes();
         $package_labels = array();
         if (!empty($nodes['tree_data']['nodes'])) {
             foreach ($nodes['tree_data']['nodes'] as $entry) {
                 if (!empty($entry['data']['label']) && $name != $entry['data']['label']) {
                     $package_labels[] = strtoupper($entry['data']['label']);
                 }
             }
         }
         $json = getJSONobj();
         $smarty->assign('package_labels', $json->encode($package_labels));
         $this->package =& $mb->packages[$name];
         $this->loadModuleTypes();
         $this->loadPackageHelp($name);
         $this->package->date_modified = $GLOBALS['timedate']->to_display_date_time($this->package->date_modified);
         $smarty->assign('package', $this->package);
         $smarty->assign('mod_strings', $mod_strings);
         $smarty->assign('package_already_deployed', 'false');
         foreach ($this->package->modules as $a_module) {
             if (in_array($a_module->key_name, $GLOBALS['moduleList'])) {
                 $smarty->assign('package_already_deployed', 'true');
                 break;
             }
         }
         $ajax = new AjaxCompose();
         $ajax->addCrumb($GLOBALS['mod_strings']['LBL_MODULEBUILDER'], 'ModuleBuilder.getContent("module=ModuleBuilder&action=package")');
         if (empty($name)) {
             $name = $mod_strings['LBL_NEW_PACKAGE'];
         }
         $ajax->addCrumb($name, '');
         $html = $smarty->fetch('modules/ModuleBuilder/tpls/MBPackage/package.tpl');
         if (!empty($_REQUEST['action']) && $_REQUEST['action'] == 'SavePackage') {
             $html .= "<script>ModuleBuilder.treeRefresh('ModuleBuilder')</script>";
         }
         $ajax->addSection('center', translate('LBL_SECTION_PACKAGE', 'ModuleBuilder'), $html);
         echo $ajax->getJavascript();
     }
 }
 function display()
 {
     global $mod_strings, $app_strings;
     require_once 'include/connectors/utils/ConnectorUtils.php';
     require_once 'include/connectors/sources/SourceFactory.php';
     $sugar_smarty = new Sugar_Smarty();
     $sugar_smarty->assign('mod', $mod_strings);
     $sugar_smarty->assign('APP', $app_strings);
     $connectors = ConnectorUtils::getConnectors(true);
     $required_fields = array();
     //Get required fields for first connector only
     foreach ($connectors as $id => $entry) {
         $s = SourceFactory::getSource($id);
         $connector_strings = ConnectorUtils::getConnectorStrings($id);
         $fields = $s->getRequiredConfigFields();
         foreach ($fields as $field_id) {
             $label = isset($connector_strings[$field_id]) ? $connector_strings[$field_id] : $field_id;
             $required_fields[$id][$field_id] = $label;
         }
         break;
     }
     $sugar_smarty->assign('SOURCES', $connectors);
     $sugar_smarty->assign('REQUIRED_FIELDS', $required_fields);
     echo get_module_title('Connectors', $mod_strings['LBL_MODIFY_PROPERTIES_PAGE_TITLE'], true);
     $sugar_smarty->display('modules/Connectors/tpls/modify_properties.tpl');
 }
Example #12
0
 protected function constructSmarty()
 {
     $smarty = new Sugar_Smarty();
     $smarty->assign('translate', true);
     $smarty->assign('language', "Leads");
     $smarty->assign('view_module', "Leads");
     $smarty->assign('module', "Leads");
     $smarty->assign('helpName', 'listViewEditor');
     $smarty->assign('helpDefault', 'modify');
     $smarty->assign('title', 'Convert Layout');
     $modules = $this->getModulesFromDefs();
     $smarty->assign('modules', $this->jsonHelper->encode($modules));
     require_once 'modules/ModuleBuilder/parsers/relationships/DeployedRelationships.php';
     $relatableModules = DeployedRelationships::findRelatableModules();
     //pull out modules that have already been chosen
     foreach ($modules as $mDef) {
         if (isset($relatableModules[$mDef['module']])) {
             unset($relatableModules[$mDef['module']]);
         }
     }
     $displayModules = array();
     $moduleDefaults = array();
     foreach ($relatableModules as $mod => $def) {
         if ($this->parser->isModuleAllowedInConvert($mod)) {
             $displayModules[$mod] = translate($mod);
             $moduleDefaults[$mod] = $this->parser->getDefaultDefForModule($mod);
         }
     }
     $smarty->assign('availableModules', $displayModules);
     $smarty->assign('moduleDefaults', $this->jsonHelper->encode($moduleDefaults));
     return $smarty;
 }
Example #13
0
 function snippet()
 {
     /* get sort order from session */
     //session_start(); // Make a reference to the current session object,set order
     //$_SESSION['regnamesort']= 'test' ; Set a value in a session variable
     //$GLOBALS['log']->fatal('start display');
     //var_dump($this->bean);
     $smarty = new Sugar_Smarty();
     //parent::display();
     $db = DBManagerFactory::getInstance();
     $myquery = "SELECT tab4a.first_name fname, tab4a.last_name lname,  tab5a.mrn_c mrn, tab4a.gender gender FROM reg_patient  tab4a , reg_patient_cstm tab5a WHERE tab4a.id = tab5a.id_c AND tab4a.id = '" . $_REQUEST['patid'] . "'";
     $result = $db->query($myquery);
     $patdata = null;
     $row = $db->fetchRow($result);
     $smarty->assign("patdata", $row);
     $risk = new RiskEvaluation();
     //when week filter need to add week interval
     //get patient risk if exists
     //if ($_POST['mysort'] == 'week')
     if (!empty($_REQUEST['patid'])) {
         $risk->getRisk($_REQUEST['patid']);
         $smarty->assign("pid", $_REQUEST['patid']);
     }
     //echo 'request'.$_REQUEST['patid'];
     //else return false; //param not found
     //var_dump($risk);
     $smarty->assign("myrisk", $risk);
     global $current_user;
     $smarty->assign("myuser", $current_user);
     $smarty->assign("test", "test");
     return $smarty->fetch('custom/modules/REG_Patient/tpls/RiskEvaluationREG_Patient.tpl');
 }
 function display()
 {
     global $app_strings, $current_user, $mod_strings, $app_list_strings;
     $smarty = new Sugar_Smarty();
     require_once 'include/JSON.php';
     //Load the field list from the target module
     $selected_lang = $_SESSION['authenticated_user_language'];
     $vardef = array();
     //Copy app strings
     $my_list_strings = array_merge($app_list_strings);
     $child = $_REQUEST['field'];
     //if we are using ModuleBuilder then process the following
     if (!empty($_REQUEST['package']) && $_REQUEST['package'] != 'studio') {
         require_once 'modules/ModuleBuilder/MB/ModuleBuilder.php';
         $mb = new ModuleBuilder();
         $this->module = $mb->getPackageModule($_REQUEST['package'], $_REQUEST['view_module']);
         $vardef = $this->module->getVardefs();
         $this->module->mblanguage->generateAppStrings(false);
         $my_list_strings = array_merge($my_list_strings, $this->module->mblanguage->appListStrings[$selected_lang . '.lang.php']);
     } else {
         $vardef = BeanFactory::getBean($_REQUEST['view_module'])->field_defs;
     }
     foreach ($my_list_strings as $key => $value) {
         if (!is_array($value)) {
             unset($my_list_strings[$key]);
         }
     }
     $parents = $this->getParentDDs($vardef, $child, $my_list_strings);
     $visibility_grid = !empty($vardef[$child]['visibility_grid']) ? $vardef[$child]['visibility_grid'] : array();
     $smarty->assign('app_strings', $app_strings);
     $smarty->assign('mod', $mod_strings);
     $smarty->assign('parents', JSON::encode($parents));
     $smarty->assign('visibility_grid', JSON::encode($visibility_grid));
     $smarty->display('modules/ExpressionEngine/tpls/ddEditor.tpl');
 }
function getAttachmentsHtml($focus, $name, $value, $view)
{
    if ('EditView' != $view && 'DetailView' != $view) {
        return "";
        // skip the rest of the method if another view calls this method
    }
    global $app_list_strings;
    $smarty = new Sugar_Smarty();
    if (isset($focus->attachmentsequence)) {
        $c = get_all_linked_attachment_revisions($focus->attachmentsequence);
        // smarty mit Werten befüllen
        $smarty->assign('attachments', buildAttachmentsArray($c));
    } else {
        $smarty->assign('attachments', array());
    }
    // setup the popup link
    $popup_request_data = array('call_back_function' => 'popup_return_document', 'field_to_name_array' => array("id" => "document_id", "document_name" => "document_name", "document_revision_id" => "document_revision_id", "category_id" => "document_category_id", "revision" => "revision"), 'passthru_data' => array('default_category' => $app_list_strings['document_subcategory_dom']['']));
    $revision_request_data = array('call_back_function' => 'revision_return_document', 'field_to_name_array' => array("id" => "document_id", "document_name" => "document_name", "document_revision_id" => "document_revision_id", "category_id" => "document_category_id", "revision" => "revision"), 'passthru_data' => array('default_category' => $app_list_strings['document_subcategory_dom']['']));
    $json = getJSONobj();
    $encoded_request_data = $json->encode($popup_request_data);
    $encoded_revision_request_data = $json->encode($revision_request_data);
    $languageStrings = $json->encode($app_list_strings["oqc"]["Attachments"]);
    $smarty->assign('moduleName', getCurrentModuleName());
    $smarty->assign('languageStringsAttachments', $languageStrings);
    $smarty->assign('open_popup_encoded_request_data', $encoded_request_data);
    $smarty->assign('create_popup_encoded_request_data', $encoded_request_data);
    $smarty->assign('upload_revision_encoded_request_data', $encoded_revision_request_data);
    $smarty->assign('initialFilter', "\"&deleted=0\"");
    // Todo: Hier nur Dokumente zulassen, die für Vertragsanhänge erlaubt sind
    return $smarty->fetch('include/oqc/Attachments/' . $view . '.html');
}
function template_pagination(&$args)
{
    $smarty = new Sugar_Smarty();
    $reporter = $args['reporter'];
    global $mod_strings;
    // disable export if configured to
    global $current_user, $sugar_config, $app_strings;
    $smarty->assign('mod_strings', $mod_strings);
    $smarty->assign('app_strings', $app_strings);
    $is_owner = true;
    if (isset($args['reporter']->saved_report) && $args['reporter']->saved_report->assigned_user_id != $current_user->id) {
        $is_owner = false;
    }
    // if
    $isExportAccess = false;
    if (!ACLController::checkAccess('Reports', 'export', $is_owner) || $sugar_config['disable_export'] || !empty($sugar_config['admin_export_only']) && !(is_admin($current_user) || ACLController::moduleSupportsACL($reporter->module) && ACLAction::getUserAccessLevel($current_user->id, $reporter->module, 'access') == ACL_ALLOW_ENABLED && ACLAction::getUserAccessLevel($current_user->id, $reporter->module, 'admin') == ACL_ALLOW_ADMIN)) {
        // no op
    } else {
        $smarty->assign('exportImagePath', SugarThemeRegistry::current()->getImage('export', "  border='0' align='absmiddle'", null, null, '.gif', translate('LBL_EXPORT')));
        $isExportAccess = true;
    }
    // else
    $smarty->assign('isExportAccess', $isExportAccess);
    $smarty->assign('start_link_ImagePath', SugarThemeRegistry::current()->getImage("start_off", "  border='0' align='absmiddle'", null, null, '.gif', $app_strings['LNK_LIST_START']));
    $smarty->assign('prev_link_ImagePath', SugarThemeRegistry::current()->getImage("previous_off", "border='0' align='absmiddle'", null, null, '.gif', $app_strings['LNK_LIST_PREVIOUS']));
    $smarty->assign('end_link_ImagePath', SugarThemeRegistry::current()->getImage("end_off", "border='0' align='absmiddle'", null, null, '.gif', $app_strings['LNK_LIST_END']));
    $smarty->assign('next_link_ImagePath', SugarThemeRegistry::current()->getImage("next_off", "border='0' align='absmiddle'", null, null, '.gif', $app_strings['LNK_LIST_NEXT']));
    $smarty->assign('start_link_disabled', true);
    $smarty->assign('prev_link_disabled', true);
    $smarty->assign('end_link_disabled', true);
    $smarty->assign('next_link_disabled', true);
    $next = $reporter->row_end + $reporter->report_offset;
    if ($reporter->report_offset > 0) {
        $prev = $reporter->report_offset - $reporter->report_max;
        $smarty->assign('start_link_ImagePath', SugarThemeRegistry::current()->getImage("start", "  border='0' align='absmiddle'", null, null, '.gif', $app_strings['LNK_LIST_START']));
        $smarty->assign('start_link_onclick', "onClick=javascript:set_offset(0);");
        $smarty->assign('start_link_disabled', false);
        $smarty->assign('prev_link_ImagePath', SugarThemeRegistry::current()->getImage("previous", "border='0' align='absmiddle'", null, null, '.gif', $app_strings['LNK_LIST_PREVIOUS']));
        $smarty->assign('prev_link_onclick', "onClick=javascript:set_offset({$prev});");
        $smarty->assign('prev_link_disabled', false);
    }
    // if
    if ($next < $reporter->total_count) {
        $end = ceil($reporter->total_count / $reporter->report_max - 1) * $reporter->report_max;
        $smarty->assign('end_link_ImagePath', SugarThemeRegistry::current()->getImage("end", "  border='0' align='absmiddle'", null, null, '.gif', $app_strings['LNK_LIST_END']));
        $smarty->assign('end_link_disabled', false);
        $smarty->assign('end_link_onclick', "onClick=javascript:set_offset({$end});");
        $smarty->assign('next_link_ImagePath', SugarThemeRegistry::current()->getImage("next", " border='0' align='absmiddle'", null, null, '.gif', $app_strings['LNK_LIST_NEXT']));
        $smarty->assign('next_link_disabled', false);
        $smarty->assign('next_link_onclick', "onClick=javascript:set_offset({$next});");
    }
    // if
    $start_range = $reporter->report_offset > 0 ? $reporter->row_start + $reporter->report_offset : ($reporter->total_count == 0 ? 0 : 1);
    $end_range = $reporter->row_end + $reporter->report_offset;
    $smarty->assign('start_range', $start_range);
    $smarty->assign('end_range', $end_range);
    $smarty->assign('total_count', $reporter->total_count);
    return $smarty->fetch("modules/Reports/templates/_template_pagination.tpl");
}
Example #17
0
 function display()
 {
     global $app_strings, $current_user, $mod_strings, $theme;
     $smarty = new Sugar_Smarty();
     $type = !empty($_REQUEST['type']) ? $_REQUEST['type'] : 'main';
     $mbt = false;
     $admin = false;
     $mb = strtolower($type);
     $smarty->assign('TYPE', $type);
     $smarty->assign('app_strings', $app_strings);
     $smarty->assign('mod', $mod_strings);
     //Replaced by javascript function "setMode"
     switch ($type) {
         case 'studio':
             //$smarty->assign('ONLOAD','ModuleBuilder.getContent("module=ModuleBuilder&action=wizard")');
             require_once 'modules/ModuleBuilder/Module/StudioTree.php';
             $mbt = new StudioTree();
             break;
         case 'mb':
             //$smarty->assign('ONLOAD','ModuleBuilder.getContent("module=ModuleBuilder&action=package&package=")');
             require_once 'modules/ModuleBuilder/MB/MBPackageTree.php';
             $mbt = new MBPackageTree();
             break;
         case 'dropdowns':
             // $admin = is_admin($current_user);
             require_once 'modules/ModuleBuilder/Module/DropDownTree.php';
             $mbt = new DropDownTree();
             break;
         default:
             //$smarty->assign('ONLOAD','ModuleBuilder.getContent("module=ModuleBuilder&action=home")');
             require_once 'modules/ModuleBuilder/Module/MainTree.php';
             $mbt = new MainTree();
     }
     $smarty->assign('TEST_STUDIO', displayStudioForCurrentUser());
     $smarty->assign('ADMIN', is_admin($current_user));
     $smarty->display('modules/ModuleBuilder/tpls/includes.tpl');
     if ($mbt) {
         $smarty->assign('TREE', $mbt->fetch());
         $smarty->assign('TREElabel', $mbt->getName());
     }
     $userPref = $current_user->getPreference('mb_assist', 'Assistant');
     if (!$userPref) {
         $userPref = "na";
     }
     $smarty->assign('userPref', $userPref);
     ///////////////////////////////////
     require_once 'include/SugarTinyMCE.php';
     $tiny = new SugarTinyMCE();
     $tiny->defaultConfig['width'] = 300;
     $tiny->defaultConfig['height'] = 300;
     $tiny->buttonConfig = "code,separator,bold,italic,underline,strikethrough,separator,justifyleft,justifycenter,justifyright,\n\t                         justifyfull,separator,forecolor,backcolor,\n\t                         ";
     $tiny->buttonConfig2 = "pastetext,pasteword,fontselect,fontsizeselect,";
     $tiny->buttonConfig3 = "";
     $ed = $tiny->getInstance();
     $smarty->assign("tiny", $ed);
     $smarty->display('modules/ModuleBuilder/tpls/index.tpl');
 }
 function display()
 {
     $ss = new Sugar_Smarty();
     $ss->assign('lblTotalOpportunities', translate('LBL_TOTAL_OPPORTUNITIES', 'Opportunities'));
     $ss->assign('lblClosedWonOpportunities', translate('LBL_CLOSED_WON_OPPORTUNITIES', 'Opportunities'));
     $ss->assign('total_opportunities', $this->total_opportunities);
     $ss->assign('total_opportunities_won', $this->total_opportunities_won);
     return parent::display() . $ss->fetch('modules/Opportunities/Dashlets/MyClosedOpportunitiesDashlet/MyClosedOpportunitiesDashlet.tpl');
 }
Example #19
0
 function display()
 {
     $template = new Sugar_Smarty();
     $template->assign('subpanel_tabs', $this->tabs);
     $template->assign('subpanel_tabs_count', count($this->tabs));
     $template->assign('jscallback', $this->jscallback);
     $template->assign('subpanel_current_key', $this->current_key);
     return $template->display('include/tabs.tpl');
 }
 function display()
 {
     global $mod_strings, $app_strings;
     echo get_module_title('Connectors', $mod_strings['LBL_ADMINISTRATION_MAIN'], true);
     $sugar_smarty = new Sugar_Smarty();
     $sugar_smarty->assign('mod', $mod_strings);
     $sugar_smarty->assign('app', $app_strings);
     $sugar_smarty->assign('IMG', 'themes/default/images/');
     $sugar_smarty->display('modules/Connectors/tpls/administration.tpl');
 }
Example #21
0
 function displayOptions()
 {
     global $app_strings, $mod_strings;
     $ss = new Sugar_Smarty();
     $ss->assign('MOD', $this->dashletStrings);
     $ss->assign('title', $this->title);
     $ss->assign('view', $this->view);
     $ss->assign('id', $this->id);
     return parent::displayOptions() . $ss->fetch('modules/Calendar/Dashlets/CalendarDashlet/CalendarDashletOptions.tpl');
 }
 function display()
 {
     global $app_strings, $current_user, $mod_strings, $theme;
     if (is_dir("themes/{$theme}/ext/resources/css")) {
         $cssDir = opendir("themes/{$theme}/ext/resources/css");
     }
     $smarty = new Sugar_Smarty();
     $type = !empty($_REQUEST['type']) ? $_REQUEST['type'] : 'main';
     $mbt = false;
     $admin = false;
     $mb = strtolower($type);
     $smarty->assign('TYPE', $type);
     $smarty->assign('app_strings', $app_strings);
     $smarty->assign('mod', $mod_strings);
     //Replaced by javascript function "setMode"
     switch ($type) {
         case 'studio':
             //$smarty->assign('ONLOAD','ModuleBuilder.getContent("module=ModuleBuilder&action=wizard")');
             require_once 'modules/ModuleBuilder/Module/StudioTree.php';
             $mbt = new StudioTree();
             break;
         case 'mb':
             //$smarty->assign('ONLOAD','ModuleBuilder.getContent("module=ModuleBuilder&action=package&package=")');
             require_once 'modules/ModuleBuilder/MB/MBPackageTree.php';
             $mbt = new MBPackageTree();
             break;
         case 'sugarportal':
             require_once 'modules/ModuleBuilder/Module/SugarPortalTree.php';
             $mbt = new SugarPortalTree();
             break;
         case 'dropdowns':
             // $admin = is_admin($current_user);
             require_once 'modules/ModuleBuilder/Module/DropDownTree.php';
             $mbt = new DropDownTree();
             break;
         default:
             //$smarty->assign('ONLOAD','ModuleBuilder.getContent("module=ModuleBuilder&action=home")');
             require_once 'modules/ModuleBuilder/Module/MainTree.php';
             $mbt = new MainTree();
     }
     $smarty->assign('TEST_STUDIO', displayStudioForCurrentUser());
     $smarty->assign('ADMIN', is_admin($current_user));
     $smarty->display('modules/ModuleBuilder/tpls/includes.tpl');
     if ($mbt) {
         $smarty->assign('TREE', $mbt->fetch());
         $smarty->assign('TREElabel', $mbt->getName());
     }
     $userPref = $current_user->getPreference('mb_assist', 'Assistant');
     if (!$userPref) {
         $userPref = "na";
     }
     $smarty->assign('userPref', $userPref);
     $smarty->display('modules/ModuleBuilder/tpls/index.tpl');
 }
Example #23
0
 function ViewDisplaydeploy()
 {
     $smarty = new Sugar_Smarty();
     $smarty->assign('package', $_REQUEST['name']);
     $smarty->assign('message', $GLOBALS['mod_strings']['LBL_DEPLOY_IN_PROGRESS']);
     $ajax = new AjaxCompose();
     $ajax->addCrumb($GLOBALS['mod_strings']['LBL_MODULEBUILDER'], 'ModuleBuilder.main("mb")');
     $ajax->addCrumb($_REQUEST['name'], 'ModuleBuilder.getContent("module=ModuleBuilder&action=package&package=' . $_REQUEST['name'] . '")');
     $ajax->addCrumb(translate('LBL_SECTION_DEPLOY', 'ModuleBuilder'), '');
     $ajax->addSection('center', translate('LBL_SECTION_DEPLOY', 'ModuleBuilder'), $smarty->fetch('modules/ModuleBuilder/tpls/MBPackage/deploy.tpl'));
     echo $ajax->getJavascript();
 }
Example #24
0
 function display()
 {
     require_once 'include/connectors/utils/ConnectorUtils.php';
     require_once 'include/connectors/sources/SourceFactory.php';
     global $mod_strings, $app_strings;
     $sugar_smarty = new Sugar_Smarty();
     $sugar_smarty->assign('mod', $mod_strings);
     $sugar_smarty->assign('APP', $app_strings);
     $connectors = ConnectorUtils::getConnectors(true);
     $sugar_smarty->assign('SOURCES', $connectors);
     echo get_module_title('Connectors', $mod_strings['LBL_MODIFY_MAPPING_PAGE_TITLE'], true);
     $sugar_smarty->display('modules/Connectors/tpls/modify_mapping.tpl');
 }
Example #25
0
/**
 * Implement get_body function to correctly populate the template for the ModuleBuilder/Studio
 * Add field page.
 *
 * @param Sugar_Smarty $ss
 * @param array $vardef
 *
 */
function get_body(&$ss, $vardef)
{
    global $app_list_strings, $mod_strings;
    $vars = $ss->get_template_vars();
    $fields = $vars['module']->mbvardefs->vardefs['fields'];
    $fieldOptions = array();
    foreach ($fields as $id => $def) {
        $fieldOptions[$id] = $def['name'];
    }
    $ss->assign('fieldOpts', $fieldOptions);
    $ss->assign('URL', $vardef["url"]);
    return $ss->fetch('custom/modules/DynamicFields/templates/Fields/Forms/Presentationfield.tpl');
}
 public function displayOptions()
 {
     ob_start();
     global $current_language, $app_list_strings;
     $mod_strings = return_module_language($current_language, 'AOR_Reports');
     $optionsSmarty = new Sugar_Smarty();
     $optionsSmarty->assign('MOD', $mod_strings);
     $optionsSmarty->assign('id', $this->id);
     $optionsSmarty->assign('dashletTitle', $this->title);
     $optionsSmarty->assign('aor_report_id', $this->report->id);
     $optionsSmarty->assign('aor_report_name', $this->report->name);
     $optionsSmarty->assign('onlyCharts', $this->onlyCharts);
     $charts = array();
     if (!empty($this->report->id)) {
         foreach ($this->report->get_linked_beans('aor_charts', 'AOR_Charts') as $chart) {
             $charts[$chart->id] = $chart->name;
         }
     }
     $conditions = getConditionsAsParameters($this->report, $this->params);
     $optionsSmarty->assign('parameters', $conditions);
     $chartOptions = get_select_options_with_id($charts, $this->charts);
     $optionsSmarty->assign('chartOptions', $chartOptions);
     $optionsTemplate = get_custom_file_if_exists('modules/AOR_Reports/Dashlets/AORReportsDashlet/dashletConfigure.tpl');
     ob_clean();
     return $optionsSmarty->fetch($optionsTemplate);
 }
Example #27
-1
 function display()
 {
     global $mod_strings;
     $ajax = new AjaxCompose();
     $smarty = new Sugar_Smarty();
     if (isset($_REQUEST['MB']) && $_REQUEST['MB'] == "1") {
         $smarty->assign("MB", $_REQUEST['MB']);
         $smarty->assign("view_package", $_REQUEST['view_package']);
     }
     $selected_lang = !empty($_REQUEST['selected_lang']) ? $_REQUEST['selected_lang'] : $_SESSION['authenticated_user_language'];
     if (empty($selected_lang)) {
         $selected_lang = $GLOBALS['sugar_config']['default_language'];
     }
     $smarty->assign('available_languages', get_languages());
     $smarty->assign('selected_lang', $selected_lang);
     ksort($this->properties);
     $smarty->assign("properties", $this->properties);
     //        $smarty->assign("id",$this->id);
     $smarty->assign("mod_strings", $mod_strings);
     $smarty->assign('APP', $GLOBALS['app_strings']);
     $smarty->assign("view_module", $this->editModule);
     $smarty->assign("subpanel", $this->subpanel);
     if (isset($this->editPackage)) {
         $smarty->assign("view_package", $this->editPackage);
     }
     $ajax->addSection('east', translate('LBL_SECTION_PROPERTIES', 'ModuleBuilder'), $smarty->fetch('modules/ModuleBuilder/tpls/editProperty.tpl'));
     echo $ajax->getJavascript();
 }
Example #28
-1
 /**
  * Displays the dashlet
  *
  * @return string html to display dashlet
  */
 function display()
 {
     require_once "modules/Reports/Report.php";
     $chartReport = BeanFactory::getBean('Reports', $this->report_id, array('encode' => false, 'strict_retrieve' => true));
     if (!empty($chartReport)) {
         $title = getReportNameTranslation($chartReport->name);
         $this->title = $title;
         $reporter = new Report($chartReport->content);
         $reporter->is_saved_report = true;
         $reporter->saved_report_id = $chartReport->id;
         $reporter->get_total_header_row();
         $reporter->run_chart_queries();
         ob_start();
         require_once "include/SugarCharts/ChartDisplay.php";
         $chartDisplay = new ChartDisplay();
         $chartDisplay->setReporter($reporter);
         echo $chartDisplay->legacyDisplay($this->id, true);
         $str = ob_get_contents();
         ob_end_clean();
         $xmlFile = $chartDisplay->get_cache_file_name($reporter);
         $html = parent::display() . "<div align='center'>" . $str . "</div>" . "<br />";
         // return parent::display for title and such
         $ss = new Sugar_Smarty();
         $ss->assign('chartName', $this->id);
         $ss->assign('chartXMLFile', $xmlFile);
         $script = $ss->fetch('modules/Home/Dashlets/ChartsDashlet/ChartsDashletScript.tpl');
         $json = getJSONobj();
         return parent::display() . "<div align='center'>" . $str . "</div>" . "<br />";
         // return parent::display for title and such
     }
 }
Example #29
-1
 function display()
 {
     $this->fromModuleBuilder = isset($_REQUEST['MB']) || !empty($_REQUEST['view_package']) && $_REQUEST['view_package'] != 'studio';
     if ($this->fromModuleBuilder) {
         return;
         //no support for MB
     }
     global $current_user;
     global $mod_strings;
     $smarty = new Sugar_Smarty();
     $smarty->assign('title', $mod_strings['LBL_DEVELOPER_TOOLS']);
     $smarty->assign('question', $mod_strings['LBL_QUESTION_ADD_LAYOUT']);
     $smarty->assign('mod_strings', $mod_strings);
     $module_name = $_REQUEST['view_module'];
     // set up language files
     //$smarty->assign ( 'language', $parser->getLanguage() ) ; // for sugar_translate in the smarty template
     //$smarty->assign('from_mb',$this->fromModuleBuilder);
     $mb = new ModuleBuilder();
     if (!isset($_REQUEST['view_package'])) {
         $_REQUEST['view_package'] = 'studio';
     }
     $module =& $mb->getPackageModule($_REQUEST['view_package'], $_REQUEST['view_module']);
     $package = $mb->packages[$_REQUEST['view_package']];
     $package->loadModuleTitles();
     $ajax = new AjaxCompose();
     $ajax->addCrumb(translate('LBL_STUDIO', 'ModuleBuilder'), 'ModuleBuilder.main("studio")');
     $ajax->addCrumb(translate($module_name), 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard&view_module=' . $module_name . '")');
     $ajax->addCrumb(translate('LBL_LAYOUTS', 'ModuleBuilder'), 'ModuleBuilder.getContent("module=ModuleBuilder&action=addlayout&layouts=1&view_module=' . $module_name . '")');
     $ajax->addCrumb($mod_strings['LBL_ADD_LAYOUT'], '');
     //$ajax->addSection ( 'center', $moduleName . ' ' . translate('LBL_ADD_LAYOUT'),
     $html = $smarty->fetch('modules/ModuleBuilder/tpls/addlayoutdone.tpl');
     $html .= "<script>ModuleBuilder.treeRefresh('Studio')</script>";
     $ajax->addSection('center', $mod_strings['LBL_ADD_LAYOUT'], $html);
     echo $ajax->getJavascript();
 }
Example #30
-1
/**
 * SugarCRM Community Edition is a customer relationship management program developed by
 * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
 *
 * SuiteCRM is an extension to SugarCRM Community Edition developed by SalesAgility Ltd.
 * Copyright (C) 2011 - 2016 SalesAgility Ltd.
 *
 * This program is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Affero General Public License version 3 as published by the
 * Free Software Foundation with the addition of the following permission added
 * to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
 * IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
 * OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE.  See the GNU Affero General Public License for more
 * details.
 *
 * You should have received a copy of the GNU Affero General Public License along with
 * this program; if not, see http://www.gnu.org/licenses or write to the Free
 * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
 * 02110-1301 USA.
 *
 * You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
 * SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
 *
 * The interactive user interfaces in modified source and object code versions
 * of this program must display Appropriate Legal Notices, as required under
 * Section 5 of the GNU Affero General Public License version 3.
 *
 * In accordance with Section 7(b) of the GNU Affero General Public License version 3,
 * these Appropriate Legal Notices must retain the display of the "Powered by
 * SugarCRM" logo and "Supercharged by SuiteCRM" logo. If the display of the logos is not
 * reasonably feasible for  technical reasons, the Appropriate Legal Notices must
 * display the words  "Powered by SugarCRM" and "Supercharged by SuiteCRM".
 */
function displaySpots()
{
    global $mod_strings, $app_strings;
    $sugar_smarty = new Sugar_Smarty();
    $sugar_smarty->assign('MOD', $mod_strings);
    $sugar_smarty->assign('APP', $app_strings);
    return $sugar_smarty->fetch('modules/Spots/tpl/ShowSpots.tpl');
}