Ejemplo n.º 1
0
 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);
 }
Ejemplo n.º 2
0
 /**
  * @see SugarView::preDisplay()
  */
 public function preDisplay()
 {
     $metadataFile = $this->getMetaDataFile();
     $this->dv = new DetailView2();
     $this->dv->ss =& $this->ss;
     $this->dv->setup($this->module, $this->bean, $metadataFile, get_custom_file_if_exists('include/DetailView/DetailView.tpl'));
 }
Ejemplo n.º 3
0
 /**
  * @see SugarView::preDisplay()
  */
 public function preDisplay()
 {
     $metadataFile = $this->getMetaDataFile();
     $this->ev = $this->getEditView();
     $this->ev->ss =& $this->ss;
     $this->ev->setup($this->module, $this->bean, $metadataFile, get_custom_file_if_exists('include/EditView/EditView.tpl'));
 }
Ejemplo n.º 4
0
 /**
  * Does the actual authentication of the user and returns an id that will be used
  * to load the current user (loadUserOnSession)
  *
  * @param STRING $name
  * @param STRING $password
  * @return STRING id - used for loading the user
  *
  * Contributions by Erik Mitchell erikm@logicpd.com
  */
 function authenticateUser($name, $password)
 {
     $GLOBALS['log']->debug('authenticating user.');
     // JMH
     //        uncomment the line below to test on the server. this is a temporary solution - John H. (task 9069)
     //		$_POST['SAMLResponse'] = "PHNhbWxwOlJlc3BvbnNlIHhtbG5zOnNhbWw9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMDphc3NlcnRpb24iIHhtbG5zOnNhbWxwPSJ1cm46b2FzaXM6bmFtZXM6dGM6U0FNTDoyLjA6cHJvdG9jb2wiIHhtbG5zOnhzPSJodHRwOi8vd3d3LnczLm9yZy8yMDAxL1hNTFNjaGVtYSIgeG1sbnM6eHNpPSJodHRwOi8vd3d3LnczLm9yZy8yMDAxL1hNTFNjaGVtYS1pbnN0YW5jZSIgRGVzdGluYXRpb249Imh0dHA6Ly9kZXZzdWdhci5ydHAucmFsZWlnaC5pYm0uY29tL3N1Z2FyLXNhbWwvaW5kZXgucGhwP21vZHVsZT1Vc2VycyZhbXA7YWN0aW9uPUF1dGhlbnRpY2F0ZSIgSUQ9IkZJTVJTUF8xZjUxNjc4Ni0wMTM0LTFmMGQtYWRiZS1iZWE4M2JhM2EyNTEiIEluUmVzcG9uc2VUbz0iXzhmMmFmY2UyNTJiNDVhZGVkNWE4IiBJc3N1ZUluc3RhbnQ9IjIwMTEtMTItMDhUMjA6MTU6NTVaIiBWZXJzaW9uPSIyLjAiPg0KICAgIDxzYW1sOklzc3VlciBGb3JtYXQ9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMDpuYW1laWQtZm9ybWF0OmVudGl0eSI+aHR0cHM6Ly9sb25kby5ydHAucmFsZWlnaC5pYm0uY29tOjk0NDMvc3BzL1NBTUxJZHAvc2FtbDIwPC9zYW1sOklzc3Vlcj4NCiAgICA8c2FtbHA6U3RhdHVzPg0KICAgICAgICA8c2FtbHA6U3RhdHVzQ29kZSBWYWx1ZT0idXJuOm9hc2lzOm5hbWVzOnRjOlNBTUw6Mi4wOnN0YXR1czpTdWNjZXNzIj48L3NhbWxwOlN0YXR1c0NvZGU+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NSZWY+DQogICAgICAgICAgICA8L3NhbWw6QXV0aG5Db250ZXh0Pg0KICAgICAgICA8L3NhbWw6QXV0aG5TdGF0ZW1lbnQ+DQogICAgICAgIDxzYW1sOkF0dHJpYnV0ZVN0YXRlbWVudD4NCiAgICAgICAgICAgIDxzYW1sOkF0dHJpYnV0ZSBOYW1lPSJETl9WYWx1ZSIgTmFtZUZvcm1hdD0idXJuOmlibTpuYW1lczpJVEZJTTo1LjE6YWNjZXNzbWFuYWdlciI+DQogICAgICAgICAgICAgICAgPHNhbWw6QXR0cmlidXRlVmFsdWUgeHNpOnR5cGU9InhzOnN0cmluZyI+dWlkPUMtQ0JUSzg5NyxjPXVzLG91PWJsdWVwYWdlcyxvPWlibS5jb208L3NhbWw6QXR0cmlidXRlVmFsdWU+DQogICAgICAgICAgICA8L3NhbWw6QXR0cmlidXRlPg0KICAgICAgICA8L3NhbWw6QXR0cmlidXRlU3RhdGVtZW50Pg0KICAgIDwvc2FtbDpBc3NlcnRpb24+DQo8L3NhbWxwOlJlc3BvbnNlPg==";
     if (empty($_POST['SAMLResponse'])) {
         return parent::authenticateUser($name, $password);
     }
     $GLOBALS['log']->debug('have saml data.');
     // JMH
     // Look for custom versions of settings.php if it exists
     require get_custom_file_if_exists('modules/Users/authentication/SAMLAuthenticate/settings.php');
     require 'modules/Users/authentication/SAMLAuthenticate/lib/onelogin/saml.php';
     $samlresponse = new SamlResponse(get_saml_settings(), $_POST['SAMLResponse']);
     if ($samlresponse->is_valid()) {
         $GLOBALS['log']->debug('response is valid');
         $settings = get_saml_settings();
         $customFields = $this->getAdditionalFieldsToSelect($samlresponse, $settings);
         $GLOBALS['log']->debug('got this many custom fields:' . count($customFields));
         $xmlDoc = new DOMDocument();
         $xmlDoc->loadXML(base64_decode($_POST['SAMLResponse']));
         $xpath = new DOMXpath($xmlDoc);
         $query = $settings->saml_settings['check']['user_name'];
         $entries = $xpath->query($query);
         $nameId = $entries->item(0)->nodeValue;
         $sql = "SELECT id, status {$customFields} FROM users WHERE " . $settings->id . "='" . $nameId . "' AND deleted = 0";
         $dbresult = $GLOBALS['db']->query("SELECT id, status {$customFields} FROM users WHERE " . $settings->id . "='" . $nameId . "' AND deleted = 0");
         $GLOBALS['log']->debug("sql: {$sql}");
         // JMH
         $GLOBALS['log']->debug('queried the db');
         // JMH
         //user already exists use this one
         if ($row = $GLOBALS['db']->fetchByAssoc($dbresult)) {
             $GLOBALS['log']->debug('have db results');
             // JMH
             if ($row['status'] != 'Inactive') {
                 $GLOBALS['log']->debug('have current user');
                 // JMH
                 $this->updateCustomFields($row, $_POST['SAMLResponse'], $settings);
                 return $row['id'];
             } else {
                 $GLOBALS['log']->debug('have inactive user');
                 // JMH
                 return '';
             }
         } else {
             if (isset($settings->customCreateFunction)) {
                 call_user_func($settings->customCreateFunction, $this, $samlresponse->get_nameid(), $xpath, $settings);
             } else {
                 return $this->createUser($samlresponse->get_nameid(), $xpath, $settings);
             }
         }
         //      comment out the following two lines for testing - John H. (task 9069)
     }
     return '';
 }
Ejemplo n.º 5
0
 public function preDisplay()
 {
     //fill additionalFields
     $assigned_user = BeanFactory::getBean("Users", $this->bean->assigned_user_id);
     $this->bean->user_title = $assigned_user->title;
     //call parent
     $metadataFile = $this->getMetaDataFile();
     $this->dv = new DetailView2();
     $this->dv->ss =& $this->ss;
     $this->dv->setup($this->module, $this->bean, $metadataFile, get_custom_file_if_exists('include/DetailView/DetailView.tpl'));
 }
Ejemplo n.º 6
0
 /**
  * loads SearchFields MetaData, sets member variables
  *
  * @param string $module moduleDir
  * @param bean $seedBean seed bean to use
  * @param string $tpl template to use, defaults to moduleDir/SearchForm.html
  *
  */
 function SearchForm($module, $seedBean, $tpl = null)
 {
     global $app_strings;
     $this->module = $module;
     $searchFields = SugarAutoLoader::loadSearchFields($module);
     $this->searchFields = $searchFields[$module];
     if (empty($tpl)) {
         if (!empty($GLOBALS['layout_edit_mode'])) {
             $this->tpl = sugar_cached('studio/custom/working/modules/' . $module . '/SearchForm.html');
         } else {
             $this->tpl = get_custom_file_if_exists('modules/' . $module . '/SearchForm.html');
         }
     } else {
         $this->tpl = $tpl;
     }
     $this->bean = $seedBean;
     $this->tabs = array(array('title' => $app_strings['LNK_BASIC_SEARCH'], 'link' => $module . '|basic_search', 'key' => $module . '|basic_search'), array('title' => $app_strings['LNK_ADVANCED_SEARCH'], 'link' => $module . '|advanced_search', 'key' => $module . '|advanced_search'));
     if (SugarAutoLoader::fileExists('modules/' . $this->module . '/index.php')) {
         $this->tabs[] = array('title' => $app_strings['LNK_SAVED_VIEWS'], 'link' => $module . '|saved_views', 'key' => $module . '|saved_views');
     }
 }
Ejemplo n.º 7
0
 /**
  * FUNCTION IS DEPRECATED FOR SUGAR 6.5+
  * @codeCoverageIgnore
  * @param $file
  * @return bool
  */
 public function fileExists($file)
 {
     global $sugar_flavor, $sugar_version;
     $version = explode('.', $sugar_version);
     //$flavor = strpos($sugar_flavor, 'OD');
     //if ($flavor === false) {
     if (!((int) $version[0] == 6 && (int) $version[1] >= 7)) {
         require_once "include/utils.php";
         //if the $check_path exists in custom, $path will be returned as "custom/{$check_path}", otherwise $check_path will be returned
         $path = get_custom_file_if_exists($file);
         if ($file != $path) {
             return true;
         } else {
             return false;
         }
         //            return file_exists($file);
     } else {
         //For Sugar On-Demand
         return SugarAutoloader::fileExists($file);
     }
 }
Ejemplo n.º 8
0
 /**
  * This method assembles and renders the display of the custom template
  * for the edit and detail actions for the ProcessMaker Module.
  * @param type $module The name of the module to be rendered
  * @param type $id The id of the record to be rendered
  * @param type $viewMode This parameter can be 'bpm' 'detail' or 'edit'
  *                        in order to render the adequate template and
  *                        view definition
  */
 public function displayDataForm($module = '', $id = '', $viewMode = 'bpm', $readonly = false)
 {
     if (!empty($module) && !empty($id)) {
         $this->bean = BeanFactory::getBean($module, $id);
         $altViewMode = array();
         if (is_array($viewMode)) {
             $altViewMode = $viewMode;
             $viewMode = $viewMode['displayMode'];
         } else {
             $this->type = 'detail';
             $viewMode = 'detail';
         }
         $this->module = $module;
         $metadataFile = $this->getMetaDataFile($readonly ? 'detail' : 'edit');
         $viewdefs = '';
         if (isset($GLOBALS['sugar_config']['disable_vcr'])) {
             $this->showVCRControl = !$GLOBALS['sugar_config']['disable_vcr'];
         }
         if (empty($altViewMode)) {
             $mfile = get_custom_file_if_exists($metadataFile);
             if (isset($mfile)) {
                 require $metadataFile;
             }
         } else {
             $dynaformBean = BeanFactory::getBean('pmse_BpmDynaForm');
             //new BpmDynaForm();
             $dynaformBean->retrieve_by_string_fields(array('dyn_uid' => $altViewMode['dyn_uid']));
             $this->dyn_uid = $altViewMode['dyn_uid'];
             $viewdefs = unserialize(base64_decode($dynaformBean->dyn_view_defs));
             //unserialize(base64_decode('YToxOntzOjc6IkJwbVZpZXciO2E6Mjp7czoxMjoidGVtcGxhdGVNZXRhIjthOjU6e3M6NDoiZm9ybSI7YToyOntzOjY6ImhpZGRlbiI7YTo0OntpOjA7czoxNDg6IjxpbnB1dCB0eXBlPSJoaWRkZW4iIG5hbWU9InByb3NwZWN0X2lkIiB2YWx1ZT0ie2lmIGlzc2V0KCRzbWFydHkucmVxdWVzdC5wcm9zcGVjdF9pZCl9eyRzbWFydHkucmVxdWVzdC5wcm9zcGVjdF9pZH17ZWxzZX17JGJlYW4tPnByb3NwZWN0X2lkfXsvaWZ9Ij4iO2k6MTtzOjE0NDoiPGlucHV0IHR5cGU9ImhpZGRlbiIgbmFtZT0iYWNjb3VudF9pZCIgdmFsdWU9IntpZiBpc3NldCgkc21hcnR5LnJlcXVlc3QuYWNjb3VudF9pZCl9eyRzbWFydHkucmVxdWVzdC5hY2NvdW50X2lkfXtlbHNlfXskYmVhbi0+YWNjb3VudF9pZH17L2lmfSI+IjtpOjI7czoxNDQ6IjxpbnB1dCB0eXBlPSJoaWRkZW4iIG5hbWU9ImNvbnRhY3RfaWQiIHZhbHVlPSJ7aWYgaXNzZXQoJHNtYXJ0eS5yZXF1ZXN0LmNvbnRhY3RfaWQpfXskc21hcnR5LnJlcXVlc3Q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             if ($readonly) {
                 $this->setHeaderFootersReadOnly($viewdefs);
             }
             $tmpArray = array();
             $tmpArray[$this->bean->module_name] = $viewdefs;
             $viewdefs = $tmpArray;
         }
         $this->view = ucfirst($viewMode) . 'View';
         if (isset($viewdefs[$this->bean->module_name][$this->view])) {
             $this->defs = $viewdefs[$this->bean->module_name][$this->view];
         } else {
             $this->defs = $viewdefs[$this->bean->module_name]['EditView'];
         }
         $this->focus = $this->bean;
         $tpl = get_custom_file_if_exists('modules/pmse_Inbox/tpls/' . $this->view . '.tpl');
         $this->th = new TemplateHandler();
         $this->th->ss =& $this->ss;
         $this->tpl = $tpl;
         if ($this->th->checkTemplate($this->bean->module_name, $this->view)) {
             $this->th->deleteTemplate($this->bean->module_name, $this->view);
         }
         $this->ev = new EditView();
         $this->ev->ss =& $this->ss;
         $this->ev->module = $module;
         $this->ev->th = $this->th;
         $this->ev->focus = $this->bean;
         $this->ev->defs = $this->defs;
         $this->ev->view = $this->view;
         $this->ev->process();
         $this->fieldDefs = $this->ev->fieldDefs;
         $this->sectionPanels = $this->ev->sectionPanels;
         $this->offset = $this->ev->offset;
         $this->returnModule = $this->ev->returnModule;
         $this->returnAction = $this->ev->returnAction;
         $this->returnId = $this->ev->returnId;
         //$this->returnRelationship = $this->ev->returnRelationship;
         //$this->returnName = $this->ev->returnName;
         return $this->setupAll(false, false, $this->bean->module_name, $readonly);
     }
 }
Ejemplo n.º 9
0
 /**
  * display html used in shared view
  */
 public function display_shared_html($view)
 {
     global $app_strings, $cal_strings, $action;
     $ss = new Sugar_Smarty();
     $ss->assign("APP", $app_strings);
     $ss->assign("MOD", $cal_strings);
     $ss->assign("view", $view);
     $ss->assign("UP", SugarThemeRegistry::current()->getImage('uparrow_big', 'border="0" style="margin-bottom: 1px;"', null, null, '.gif', $app_strings['LBL_SORT']));
     $ss->assign("DOWN", SugarThemeRegistry::current()->getImage('downarrow_big', 'border="0" style="margin-top: 1px;"', null, null, '.gif', $app_strings['LBL_SORT']));
     //hide by default.
     if (!empty($_REQUEST['edit_shared'])) {
         $ss->assign("edit_shared", true);
     }
     $ss->assign("users_options", get_select_options_with_id(get_user_array(false), $this->cal->shared_ids));
     $tpl = get_custom_file_if_exists("modules/Calendar/tpls/shared_users.tpl");
     echo $ss->fetch($tpl);
 }
Ejemplo n.º 10
0
    create_default_users();
    echo $mod_strings['LBL_PERFORM_DONE'];
} else {
    echo $line_entry_format . $mod_strings['LBL_PERFORM_ADMIN_PASSWORD'] . $line_exit_format;
    installLog($mod_strings['LBL_PERFORM_ADMIN_PASSWORD']);
    $db->setUserName($setup_db_sugarsales_user);
    $db->setUserPassword($setup_db_sugarsales_password);
    set_admin_password($setup_site_admin_password);
    echo $mod_strings['LBL_PERFORM_DONE'];
}
installerHook('post_createUsers');
if ($new_report) {
    echo $line_entry_format . $mod_strings['LBL_PERFORM_DEFAULT_REPORTS'] . $line_exit_format;
    installLog($mod_strings['LBL_PERFORM_DEFAULT_REPORTS']);
    installerHook('pre_createDefaultReports');
    require_once get_custom_file_if_exists('modules/Reports/SeedReports.php');
    create_default_reports();
    installerHook('post_createDefaultReports');
    echo $mod_strings['LBL_PERFORM_DONE'];
}
// default OOB schedulers
echo $line_entry_format . $mod_strings['LBL_PERFORM_DEFAULT_SCHEDULER'] . $line_exit_format;
installLog($mod_strings['LBL_PERFORM_DEFAULT_SCHEDULER']);
$scheduler = new Scheduler();
installerHook('pre_createDefaultSchedulers');
$scheduler->rebuildDefaultSchedulers();
installerHook('post_createDefaultSchedulers');
///create kb tag data.
installLog("create kb tag default data");
KBTag::default_install_data();
echo $mod_strings['LBL_PERFORM_DONE'];
Ejemplo n.º 11
0
 public function display()
 {
     global $mod_strings;
     if (isset($_REQUEST['name_basic'])) {
         $file_search = trim($_REQUEST['name_basic']);
     } else {
         $file_search = '';
     }
     if (!isset($_REQUEST['apiName'])) {
         $apiName = 'IBMSmartCloud';
     } else {
         $tmpApi = ExternalAPIFactory::loadAPI($_REQUEST['apiName'], true);
         if ($tmpApi === false) {
             Log::error(string_format($mod_strings['ERR_INVALID_EXTERNAL_API_ACCESS'], [$_REQUEST['apiName']]));
             return;
         }
         $apiName = $_REQUEST['apiName'];
     }
     // See if we are running as a popup window
     if (isset($_REQUEST['isPopup']) && $_REQUEST['isPopup'] == 1 && !empty($_REQUEST['elemBaseName'])) {
         $isPopup = true;
     } else {
         $isPopup = false;
     }
     // bug50952 - must actually make sure we can log in, not just that we've got a EAPM record
     // getLoginInfo only checks to see if user has logged in correctly ONCE to ExternalAPI
     // Need to manually attempt to fetch the EAPM record, we don't want to give them the signup screen when they just have a deactivated account.
     $eapmBean = EAPM::getLoginInfo($apiName, true);
     $api = ExternalAPIFactory::loadAPI($apiName, true);
     $validSession = true;
     if (!empty($eapmBean)) {
         try {
             $api->loadEAPM($eapmBean);
             // $api->checkLogin() does the same thing as quickCheckLogin plus actually makes sure the user CAN log in to the API currently
             $loginCheck = $api->checkLogin($eapmBean);
             if (isset($loginCheck['success']) && !$loginCheck['success']) {
                 $validSession = false;
             }
         } catch (Exception $ex) {
             $validSession = false;
             Log::error(string_format($mod_strings['ERR_INVALID_EXTERNAL_API_LOGIN'], [$apiName]));
         }
     }
     if (!$validSession || empty($eapmBean)) {
         // Bug #49987 : Documents view.extdoc.php doesn't allow custom override
         $tpl_file = get_custom_file_if_exists('include/externalAPI/' . $apiName . '/' . $apiName . 'Signup.' . $GLOBALS['current_language'] . '.tpl');
         if (file_exists($tpl_file)) {
             $smarty = new Sugar_Smarty();
             echo $smarty->fetch($tpl_file);
         } else {
             $output = string_format(translate('LBL_ERR_FAILED_QUICKCHECK', 'EAPM'), [$apiName]);
             $output .= '<form method="POST" target="_EAPM_CHECK" action="index.php">';
             $output .= '<input type="hidden" name="module" value="EAPM">';
             $output .= '<input type="hidden" name="action" value="Save">';
             $output .= '<input type="hidden" name="record" value="' . $eapmBean->id . '">';
             $output .= '<input type="hidden" name="active" value="1">';
             $output .= '<input type="hidden" name="closeWhenDone" value="1">';
             $output .= '<input type="hidden" name="refreshParentWindow" value="1">';
             $output .= '<br><input type="submit" value="' . $GLOBALS['app_strings']['LBL_EMAIL_OK'] . '">&nbsp;';
             $output .= '<input type="button" onclick="lastLoadedMenu=undefined;DCMenu.closeOverlay();return false;" value="' . $GLOBALS['app_strings']['LBL_CANCEL_BUTTON_LABEL'] . '">';
             $output .= '</form>';
             echo $output;
         }
         return;
     }
     $searchDataLower = $api->searchDoc($file_search, true);
     // In order to emulate the list views for the SugarFields, I need to uppercase all of the key names.
     $searchData = [];
     if (is_array($searchDataLower)) {
         foreach ($searchDataLower as $row) {
             $newRow = [];
             foreach ($row as $key => $value) {
                 $newRow[strtoupper($key)] = $value;
             }
             if ($isPopup) {
                 // We are running as a popup window, we need to replace the direct url with some javascript
                 $newRow['DOC_URL'] = "javascript:window.opener.SUGAR.field.file.populateFromPopup('" . addslashes($_REQUEST['elemBaseName']) . "','" . addslashes($newRow['ID']) . "','" . addslashes($newRow['NAME']) . "','" . addslashes($newRow['URL']) . "','" . addslashes($newRow['URL']) . "'); window.close();";
             } else {
                 $newRow['DOC_URL'] = $newRow['URL'];
             }
             $searchData[] = $newRow;
         }
     }
     $displayColumns = ['NAME' => ['label' => 'LBL_LIST_EXT_DOCUMENT_NAME', 'type' => 'varchar', 'link' => true], 'DATE_MODIFIED' => ['label' => 'LBL_DATE', 'type' => 'date']];
     $ss = new Sugar_Smarty();
     $ss->assign('searchFieldLabel', translate('LBL_SEARCH_EXTERNAL_DOCUMENT', 'Documents'));
     $ss->assign('displayedNote', translate('LBL_EXTERNAL_DOCUMENT_NOTE', 'Documents'));
     $ss->assign('APP', $GLOBALS['app_strings']);
     $ss->assign('MOD', $GLOBALS['mod_strings']);
     $ss->assign('data', $searchData);
     $ss->assign('displayColumns', $displayColumns);
     $ss->assign('imgPath', SugarThemeRegistry::current()->getImageURL($apiName . '_image_inline.png'));
     if ($isPopup) {
         $ss->assign('linkTarget', '');
         $ss->assign('isPopup', 1);
         $ss->assign('elemBaseName', $_REQUEST['elemBaseName']);
     } else {
         $ss->assign('linkTarget', '_new');
         $ss->assign('isPopup', 0);
         $ss->assign('elemBaseName', '');
     }
     $ss->assign('apiName', $apiName);
     $ss->assign('DCSEARCH', $file_search);
     if ($isPopup) {
         // Need the popup header... I feel so dirty.
         ob_start();
         echo '<div class="dccontent">';
         insert_popup_header($GLOBALS['theme'], false);
         $output_html = ob_get_contents();
         ob_end_clean();
         $output_html .= get_form_header(translate('LBL_SEARCH_FORM_TITLE', 'Documents'), '', false);
         echo $output_html;
     }
     $ss->display('modules/Documents/tpls/view.extdoc.tpl');
     if ($isPopup) {
         // Close the dccontent div
         echo '</div>';
     }
 }
Ejemplo n.º 12
0
 /**
  * loads SearchFields MetaData, sets member variables
  *
  * @param string $module moduleDir
  * @param bean $seedBean seed bean to use
  * @param string $tpl template to use, defaults to moduleDir/SearchForm.html
  *
  */
 function SearchForm($module, &$seedBean, $tpl = null)
 {
     global $app_strings;
     $GLOBALS['log']->info("include.SearchForm.SearchForm.php.SearchForm");
     $this->module = $module;
     require_once 'modules/' . $module . '/metadata/SearchFields.php';
     if (file_exists('custom/modules/' . $module . '/metadata/SearchFields.php')) {
         require_once 'custom/modules/' . $module . '/metadata/SearchFields.php';
     }
     //require_once('modules/' . $module . '/metadata/SearchFields.php');
     $this->searchFields = $searchFields[$module];
     if (empty($tpl)) {
         $GLOBALS['log']->info("include.SearchForm.SearchForm.php.SearchForm, tpl is empty.");
         if (!empty($GLOBALS['layout_edit_mode'])) {
             $this->tpl = sugar_cached('studio/custom/working/modules/' . $module . '/SearchForm.html');
         } else {
             $this->tpl = get_custom_file_if_exists('modules/' . $module . '/SearchForm.html');
         }
     } else {
         $GLOBALS['log']->info("include.SearchForm.SearchForm.php.SearchForm, tpl is not empty");
         $this->tpl = $tpl;
     }
     $this->bean = $seedBean;
     $this->tabs = array(array('title' => $app_strings['LNK_BASIC_SEARCH'], 'link' => $module . '|basic_search', 'key' => $module . '|basic_search'), array('title' => $app_strings['LNK_ADVANCED_SEARCH'], 'link' => $module . '|advanced_search', 'key' => $module . '|advanced_search'));
     if (file_exists('modules/' . $this->module . '/index.php')) {
         $this->tabs[] = array('title' => $app_strings['LNK_SAVED_VIEWS'], 'link' => $module . '|saved_views', 'key' => $module . '|saved_views');
     }
 }
Ejemplo n.º 13
0
 /**
  *
  * @return the form for users posting custom messages to the feed stream
  */
 function getPostForm()
 {
     global $current_user;
     if (!empty($this->selectedCategories) && !in_array('UserFeed', $this->selectedCategories)) {
         // The user feed system isn't enabled, don't let them post notes
         return '';
     }
     $user_name = ucfirst($GLOBALS['current_user']->user_name);
     $moreimg = SugarThemeRegistry::current()->getImage('advanced_search', 'onclick="toggleDisplay(\'more_' . $this->id . '\'); toggleDisplay(\'more_img_' . $this->id . '\'); toggleDisplay(\'less_img_' . $this->id . '\');"', null, null, '.gif', translate('LBL_SHOW_MORE_OPTIONS', 'SugarFeed'));
     $lessimg = SugarThemeRegistry::current()->getImage('basic_search', 'onclick="toggleDisplay(\'more_' . $this->id . '\'); toggleDisplay(\'more_img_' . $this->id . '\'); toggleDisplay(\'less_img_' . $this->id . '\');"', null, null, '.gif', translate('LBL_HIDE_OPTIONS', 'SugarFeed'));
     $ss = new Sugar_Smarty();
     $ss->assign('LBL_TO', translate('LBL_TO', 'SugarFeed'));
     $ss->assign('LBL_POST', translate('LBL_POST', 'SugarFeed'));
     $ss->assign('LBL_SELECT', translate('LBL_SELECT', 'SugarFeed'));
     $ss->assign('LBL_IS', translate('LBL_IS', 'SugarFeed'));
     $ss->assign('id', $this->id);
     $ss->assign('more_img', $moreimg);
     $ss->assign('less_img', $lessimg);
     include_once "include/social/get_feed_data.php";
     $ss->assign('facebook', $html);
     if ($current_user->getPreference('use_real_names') == 'on') {
         $ss->assign('user_name', $current_user->full_name);
     } else {
         $ss->assign('user_name', $user_name);
     }
     $linkTypesIn = SugarFeed::getLinkTypes();
     $linkTypes = array();
     foreach ($linkTypesIn as $key => $value) {
         $linkTypes[$key] = translate('LBL_LINK_TYPE_' . $value, 'SugarFeed');
     }
     $ss->assign('link_types', $linkTypes);
     $userPostFormTplFile = 'modules/SugarFeed/Dashlets/SugarFeedDashlet/UserPostForm.tpl';
     $fetch = $ss->fetch(get_custom_file_if_exists($userPostFormTplFile));
     return $fetch;
 }
Ejemplo n.º 14
0
 /**
  * Test that custom XPath is used when specified in settings
  */
 public function testCustomNameId()
 {
     $node_id = 'Bug49959Test';
     // create response with custom XML
     $mock2 = $this->getResponse();
     $mock2->xml = $this->getResponseXml($node_id);
     // create SAML settings object with custom name id definition
     require get_custom_file_if_exists('modules/Users/authentication/SAMLAuthenticate/settings.php');
     $settings->saml_settings['check']['user_name'] = '//root';
     // expect that user ID is fetched from the document according to settings
     $result = self::$auth->get_user_id($mock2, $settings);
     $this->assertEquals($node_id, $result);
 }
Ejemplo n.º 15
0
 /**
  * Redirect to login page
  * 
  * @param SugarApplication $app
  */
 public function redirectToLogin(SugarApplication $app)
 {
     require get_custom_file_if_exists('modules/Users/authentication/SAMLAuthenticate/settings.php');
     $loginVars = $app->createLoginVars();
     // $settings - variable from modules/Users/authentication/SAMLAuthenticate/settings.php
     $settings->assertion_consumer_service_url .= htmlspecialchars($loginVars);
     $authRequest = new SamlAuthRequest($settings);
     $url = $authRequest->create();
     SugarApplication::redirect($url);
 }
Ejemplo n.º 16
0
 /**
  * getCustomFilePathIfExists
  *
  * This function wraps a call to get_custom_file_if_exists from include/utils.php
  *
  * @param $file String of filename to check
  * @return $file String of filename including custom directory if found
  */
 protected function getCustomFilePathIfExists($file)
 {
     return get_custom_file_if_exists($file);
 }
Ejemplo n.º 17
0
 public function displayOptions()
 {
     ob_start();
     global $current_language, $app_list_strings, $datetime;
     $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);
     $optionsSmarty->assign('aor_date_options', $app_list_strings['aor_date_options']);
     $optionsSmarty->assign('aor_condition_type_list', $app_list_strings['aor_condition_type_list']);
     $optionsSmarty->assign('aor_date_operator', $app_list_strings['aor_date_operator']);
     $optionsSmarty->assign('aor_date_type_list', $app_list_strings['aor_date_type_list']);
     $optionsSmarty->assign('date_time_period_list', $app_list_strings['date_time_period_list']);
     $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);
     $i = 0;
     foreach ($conditions as $condition) {
         if ($condition["value_type"] == "Date") {
             if ($condition["additionalConditions"][0] == "now") {
                 $conditions[$i]["value"] = date("d/m/Y");
             }
         }
         $i++;
     }
     $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);
 }
Ejemplo n.º 18
0
 /**
  * getFilenameForSugarWidget
  * This method attempts to autoload classes starting with name "SugarWidget".  It first checks for the file
  * in custom/include/generic/SugarWidgets directory and if not found defaults to include/generic/SugarWidgets.
  * This method is used so that we can easily customize and extend these SugarWidget classes.
  *
  * @static
  *
  * @param $class String name of the class to load
  *
  * @return string file of the SugarWidget class; false if none found
  */
 protected static function getFilenameForSugarWidget($class)
 {
     //Only bother to check if the class name starts with SugarWidget
     if (strpos($class, 'SugarWidget') !== false) {
         if (strpos($class, 'SugarWidgetField') !== false) {
             //We need to lowercase the portion after SugarWidgetField
             $name = substr($class, 16);
             if (!empty($name)) {
                 $class = 'SugarWidgetField' . strtolower($name);
             }
         }
         $file = get_custom_file_if_exists("include/generic/SugarWidgets/{$class}.php");
         if (file_exists($file)) {
             return $file;
         }
     }
     return false;
 }
Ejemplo n.º 19
0
/*********************************************************************************
Copyright (c) 2010, OneLogin, Inc.
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
    * Redistributions of source code must retain the above copyright
      notice, this list of conditions and the following disclaimer.
    * Redistributions in binary form must reproduce the above copyright
      notice, this list of conditions and the following disclaimer in the
      documentation and/or other materials provided with the distribution.
    * Neither the name of the <organization> nor the
      names of its contributors may be used to endorse or promote products
      derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL ONELOGIN, INC. BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 ********************************************************************************/
require_once 'modules/Users/authentication/SAMLAuthenticate/lib/onelogin/saml.php';
require get_custom_file_if_exists('modules/Users/authentication/SAMLAuthenticate/settings.php');
$authrequest = new SamlAuthRequest($settings);
$url = $authrequest->create();
header("Location: {$url}");
Ejemplo n.º 20
0
 /**
  * Takes in the request params from a save request and processes
  * them for the save.
  *
  * @param REQUEST params  $params
  */
 function saveTabGroups($params)
 {
     //#30205
     global $sugar_config;
     //Get the selected tab group language
     $grouptab_lang = !empty($params['grouptab_lang']) ? $params['grouptab_lang'] : $_SESSION['authenticated_user_language'];
     $tabGroups = array();
     $selected_lang = !empty($params['dropdown_lang']) ? $params['dropdown_lang'] : $_SESSION['authenticated_user_language'];
     $slot_count = $params['slot_count'];
     $completedIndexes = array();
     for ($count = 0; $count < $slot_count; $count++) {
         if ($params['delete_' . $count] == 1 || !isset($params['slot_' . $count])) {
             continue;
         }
         $index = $params['slot_' . $count];
         if (isset($completedIndexes[$index])) {
             continue;
         }
         $labelID = !empty($params['tablabelid_' . $index]) ? $params['tablabelid_' . $index] : 'LBL_GROUPTAB' . $count . '_' . time();
         $labelValue = SugarCleaner::stripTags(from_html($params['tablabel_' . $index]), false);
         $app_strings = return_application_language($grouptab_lang);
         if (empty($app_strings[$labelID]) || $app_strings[$labelID] != $labelValue) {
             $contents = return_custom_app_list_strings_file_contents($grouptab_lang);
             $new_contents = replace_or_add_app_string($labelID, $labelValue, $contents);
             save_custom_app_list_strings_contents($new_contents, $grouptab_lang);
             $languages = get_languages();
             foreach ($languages as $language => $langlabel) {
                 if ($grouptab_lang == $language) {
                     continue;
                 }
                 $app_strings = return_application_language($language);
                 if (!isset($app_strings[$labelID])) {
                     $contents = return_custom_app_list_strings_file_contents($language);
                     $new_contents = replace_or_add_app_string($labelID, $labelValue, $contents);
                     save_custom_app_list_strings_contents($new_contents, $language);
                 }
             }
             $app_strings[$labelID] = $labelValue;
         }
         $tabGroups[$labelID] = array('label' => $labelID);
         $tabGroups[$labelID]['modules'] = array();
         for ($subcount = 0; isset($params[$index . '_' . $subcount]); $subcount++) {
             $tabGroups[$labelID]['modules'][] = $params[$index . '_' . $subcount];
         }
         $completedIndexes[$index] = true;
     }
     // Force a rebuild of the app language
     global $current_user;
     include get_custom_file_if_exists('modules/Administration/RebuildJSLang.php');
     sugar_cache_clear('app_strings.' . $grouptab_lang);
     $newFile = create_custom_directory('include/tabConfig.php');
     write_array_to_file("GLOBALS['tabStructure']", $tabGroups, $newFile);
     $GLOBALS['tabStructure'] = $tabGroups;
 }
Ejemplo n.º 21
0
$query2a = "SELECT assistant FROM reg_patient where id = '" . $this->bean->id . "' AND deleted!=1";
$result = $this->bean->db->query($query2a, true);
$value = null;
if (($row = $this->bean->db->fetchByAssoc($result)) != null) {
    $value = $row['assistant'];
    echo "<script> set_session('indication','" . $value . "');</script>";
}
$query2b = "SELECT mrn_c FROM reg_patient_cstm where id_c = '" . $this->bean->id . "'";
$resultb = $this->bean->db->query($query2b, true);
if (($rowb = $this->bean->db->fetchByAssoc($resultb)) != null) {
    $mrn = $rowb['mrn_c'];
} else {
    $mrn = "";
}
echo "<script> set_session('mrn','" . $mrn . "');</script>";
$this->dv3->setup('REG_Encounter', $this->bean3, $encounterMetadataFile, get_custom_file_if_exists('custom/modules/REG_Encounter/tpls/PR_EditView.tpl'));
//$this->dv3->process();
$riskquery = "select finalscore from reg_patient_risk where pid='" . $this->bean->id . "'";
$score = $this->bean->db->query($riskquery, true);
$rowr = $this->bean->db->fetchByAssoc($score);
$finalscore = $rowr['finalscore'];
$this->dv3->ss->assign("finalscore", $finalscore);
$summary = $this->bean3->summary;
$enc_detail = explode(":", $summary);
$type = $enc_detail[0];
$typevalue = "Rx. Refill";
$this->dv3->ss->assign("encountype", "refill");
//this is a refill
if (!strcmp($type, "PEnc")) {
    $typevalue = "Patient Encounter";
    $this->dv3->ss->assign("encountype", "encounter");
Ejemplo n.º 22
0
 /**
  * Generates a default dynaform based in the base module name.
  * @param string $baseModule
  * @param array $keys
  * @param boolean $update
  * @return boolean
  */
 public function generateDefaultDynaform($baseModule, $keys, $update = false)
 {
     $this->baseModule = $baseModule;
     $params = array();
     if ($update) {
         $this->dynaform->retrieve_by_string_fields(array('prj_id' => $keys['prj_id'], 'pro_id' => $keys['pro_id'], 'name' => 'Default'));
     } else {
         $params['dyn_uid'] = PMSEEngineUtils::generateUniqueID();
     }
     $params['name'] = 'Default';
     $params['description'] = 'Default';
     $params['prj_id'] = isset($keys['prj_id']) ? $keys['prj_id'] : null;
     $params['pro_id'] = isset($keys['pro_id']) ? $keys['prj_id'] : null;
     $params['dyn_module'] = $this->baseModule;
     $params['dyn_name'] = "Default";
     $params['dyn_description'] = "Default";
     $moduleViewDefs = get_custom_file_if_exists('modules/' . $baseModule . '/metadata/editviewdefs.php');
     $viewdefs = array();
     if (!@(include_once $moduleViewDefs)) {
         return false;
     } else {
         $params['dyn_view_defs'] = array('BpmView' => $viewdefs[$baseModule]['EditView']);
         return $this->saveDynaform($baseModule, $params);
     }
 }